mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-05-30 07:48:09 +08:00
fix off-by-one with signer_id and key_ids
This commit is contained in:
@@ -40,7 +40,7 @@ impl Coordinator {
|
||||
dkg_public_shares: Default::default(),
|
||||
aggregate_public_key: Point::default(),
|
||||
message_private_key,
|
||||
ids_to_await: (1..=total_signers).collect(),
|
||||
ids_to_await: (0..total_signers).collect(),
|
||||
state: State::Idle,
|
||||
}
|
||||
}
|
||||
@@ -166,7 +166,7 @@ impl Coordinator {
|
||||
warn!("DKG Round #{} Failed: Aggregate public key does not have even y coord, re-running dkg.", self.current_dkg_id);
|
||||
self.move_to(State::DkgPublicDistribute)?;
|
||||
}
|
||||
self.ids_to_await = (1..=self.total_signers).collect();
|
||||
self.ids_to_await = (0..self.total_signers).collect();
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -185,7 +185,7 @@ impl Coordinator {
|
||||
}
|
||||
|
||||
if self.ids_to_await.is_empty() {
|
||||
self.ids_to_await = (1..=self.total_signers).collect();
|
||||
self.ids_to_await = (0..self.total_signers).collect();
|
||||
self.move_to(State::Idle)?;
|
||||
}
|
||||
Ok(())
|
||||
|
||||
@@ -188,7 +188,9 @@ impl RunLoop<FrostCoordinator> {
|
||||
.signer_key_ids
|
||||
.get(&config.signer_id)
|
||||
.unwrap()
|
||||
.clone();
|
||||
.iter()
|
||||
.map(|i| i - 1) // SigningRound::new (unlike SigningRound::from) doesn't do this
|
||||
.collect::<Vec<u32>>();
|
||||
RunLoop {
|
||||
event_timeout: config.event_timeout,
|
||||
coordinator: FrostCoordinator::new(total_signers, config.message_private_key),
|
||||
|
||||
Reference in New Issue
Block a user