Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not attempt to treat miner as a coordinator when updating DKG #4591

Merged
merged 9 commits into from Apr 3, 2024
2 changes: 1 addition & 1 deletion stacks-signer/src/runloop.rs
Expand Up @@ -392,7 +392,7 @@ impl SignerRunLoop<Vec<OperationResult>, RunLoopCommand> for RunLoop {
if signer.approved_aggregate_public_key.is_none() {
if let Err(e) = retry_with_exponential_backoff(|| {
signer
.update_dkg(&self.stacks_client, current_reward_cycle)
.update_dkg(&self.stacks_client)
.map_err(backoff::Error::transient)
}) {
error!("{signer}: failed to update DKG: {e}");
Expand Down
10 changes: 3 additions & 7 deletions stacks-signer/src/signer.rs
Expand Up @@ -1207,11 +1207,7 @@ impl Signer {
}

/// Update the DKG for the provided signer info, triggering it if required
pub fn update_dkg(
&mut self,
stacks_client: &StacksClient,
current_reward_cycle: u64,
) -> Result<(), ClientError> {
pub fn update_dkg(&mut self, stacks_client: &StacksClient) -> Result<(), ClientError> {
let reward_cycle = self.reward_cycle;
let old_dkg = self.approved_aggregate_public_key;
self.approved_aggregate_public_key =
Expand All @@ -1230,8 +1226,8 @@ impl Signer {
}
return Ok(());
};
let coordinator_id = self.get_coordinator(current_reward_cycle).0;
if Some(self.signer_id) == coordinator_id && self.state == State::Idle {
let coordinator_id = self.coordinator_selector.get_coordinator().0;
if self.signer_id == coordinator_id && self.state == State::Idle {
jferrant marked this conversation as resolved.
Show resolved Hide resolved
debug!("{self}: Checking if old vote transaction exists in StackerDB...");
// Have I already voted and have a pending transaction? Check stackerdb for the same round number and reward cycle vote transaction
// Only get the account nonce of THIS signer as we only care about our own votes, not other signer votes
Expand Down