From 387956099e9f3e7987d1e615adfba72187a9a20d Mon Sep 17 00:00:00 2001 From: Herr Seppia Date: Thu, 4 Jan 2024 16:25:28 +0100 Subject: [PATCH 1/2] node: fix bench to check verify_block_cert result --- node/benches/accept.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/node/benches/accept.rs b/node/benches/accept.rs index f08ed94e70..fae0c68850 100644 --- a/node/benches/accept.rs +++ b/node/benches/accept.rs @@ -122,7 +122,7 @@ pub fn verify_block_cert(c: &mut Criterion) { format!("{} prov", input.provisioners), ), move |b| { - b.to_async(FuturesExecutor).iter(|| { + b.to_async(FuturesExecutor).iter(|| async { chain::verify_block_cert( seed, &provisioners, @@ -132,6 +132,8 @@ pub fn verify_block_cert(c: &mut Criterion) { iteration, true, ) + .await + .expect("block to be verified") }) }, ); From 93f333a7e197f2baa8eb422845a2edd9fb0746e4 Mon Sep 17 00:00:00 2001 From: Herr Seppia Date: Thu, 4 Jan 2024 16:25:56 +0100 Subject: [PATCH 2/2] node: fix verify_block_cert bench to exclude generator --- node/benches/accept.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/node/benches/accept.rs b/node/benches/accept.rs index fae0c68850..781d5618e0 100644 --- a/node/benches/accept.rs +++ b/node/benches/accept.rs @@ -40,8 +40,13 @@ fn create_step_votes( provisioners: &Provisioners, keys: &[(PublicKey, BlsSecretKey)], ) -> StepVotes { + let generator_cfg = + SortitionConfig::new(seed, round, iteration * 3, 1, None); + let generator = Committee::new(provisioners, &generator_cfg); + let exclusion = Some(generator.iter().next().unwrap().bytes().clone()); + let sortition_config = - SortitionConfig::new(seed, round, iteration * 3 + step, 64, None); + SortitionConfig::new(seed, round, iteration * 3 + step, 64, exclusion); let committee = Committee::new(provisioners, &sortition_config);