diff --git a/src/hydrabadger/hydrabadger.rs b/src/hydrabadger/hydrabadger.rs index 2cb07f2..dea2249 100644 --- a/src/hydrabadger/hydrabadger.rs +++ b/src/hydrabadger/hydrabadger.rs @@ -51,6 +51,9 @@ const DEFAULT_KEYGEN_PEER_COUNT: usize = 2; // debugging. const DEFAULT_OUTPUT_EXTRA_DELAY_MS: u64 = 0; +/// Hydrabadger configuration options. +// +// TODO: Convert to builder. #[derive(Debug, Clone, PartialEq, Eq)] pub struct Config { pub batch_size: usize, @@ -60,6 +63,7 @@ pub struct Config { pub txn_gen_bytes: usize, pub keygen_peer_count: usize, pub output_extra_delay_ms: u64, + pub start_epoch: u64, } impl Config { @@ -71,6 +75,7 @@ impl Config { txn_gen_bytes: DEFAULT_TXN_GEN_BYTES, keygen_peer_count: DEFAULT_KEYGEN_PEER_COUNT, output_extra_delay_ms: DEFAULT_OUTPUT_EXTRA_DELAY_MS, + start_epoch: 0, } } } diff --git a/src/hydrabadger/state.rs b/src/hydrabadger/state.rs index c80cf0c..3a60ceb 100644 --- a/src/hydrabadger/state.rs +++ b/src/hydrabadger/state.rs @@ -228,7 +228,7 @@ impl State { local_uid: Uid, local_sk: SecretKey, jp: JoinPlan, - _cfg: &Config, + cfg: &Config, step_queue: &SegQueue>, ) -> Result>, Error> { let iom_queue_ret; @@ -237,6 +237,7 @@ impl State { ref mut iom_queue, .. } => { let (dhb, dhb_step) = DynamicHoneyBadger::builder() + .epoch(cfg.start_epoch) .build_joining(local_uid, local_sk, jp)?; step_queue.push(dhb_step); @@ -308,6 +309,7 @@ impl State { let netinfo = NetworkInfo::new(local_uid, sk_share, pk_set, local_sk, node_ids); let dhb = DynamicHoneyBadger::builder() + .epoch(cfg.start_epoch) .build(netinfo); info!("");