Skip to content

Commit

Permalink
add dkg_threshold to coordinator config
Browse files Browse the repository at this point in the history
  • Loading branch information
xoloki committed Dec 20, 2023
1 parent 0548d96 commit bd99ddd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/state_machine/coordinator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ pub struct Config {
pub num_keys: u32,
/// threshold of keys needed to form a valid signature
pub threshold: u32,
/// threshold of keys needed to complete DKG (must be >= threshold)
pub dkg_threshold: u32,
/// private key used to sign network messages
pub message_private_key: Scalar,
/// timeout to gather DkgPublicShares messages
Expand All @@ -107,6 +109,7 @@ impl Config {
num_signers,
num_keys,
threshold,
dkg_threshold: num_keys,
message_private_key,
dkg_public_timeout: None,
dkg_end_timeout: None,
Expand All @@ -122,6 +125,7 @@ impl Config {
num_signers: u32,
num_keys: u32,
threshold: u32,
dkg_threshold: u32,
message_private_key: Scalar,
dkg_public_timeout: Option<Duration>,
dkg_end_timeout: Option<Duration>,
Expand All @@ -133,6 +137,7 @@ impl Config {
num_signers,
num_keys,
threshold,
dkg_threshold,
message_private_key,
dkg_public_timeout,
dkg_end_timeout,
Expand Down Expand Up @@ -323,6 +328,7 @@ pub mod test {
let mut rng = OsRng;
let num_keys = num_signers * keys_per_signer;
let threshold = (num_keys * 7) / 10;
let dkg_threshold = (num_keys * 9) / 10;
let key_pairs = (0..num_signers)
.map(|_| {
let private_key = Scalar::random(&mut rng);
Expand Down Expand Up @@ -375,6 +381,7 @@ pub mod test {
num_signers,
num_keys,
threshold,
dkg_threshold,
private_key,
dkg_public_timeout,
dkg_end_timeout,
Expand Down

0 comments on commit bd99ddd

Please sign in to comment.