From b0a69493cde248b8e58f4c64637af1680a16b9fb Mon Sep 17 00:00:00 2001 From: Uncle Stretch Date: Thu, 26 Feb 2026 21:36:14 +0300 Subject: [PATCH] fix benchmarking for slow clap Signed-off-by: Uncle Stretch --- pallets/slow-clap/Cargo.toml | 2 +- pallets/slow-clap/src/benchmarking.rs | 4 ++-- pallets/slow-clap/src/lib.rs | 2 +- pallets/slow-clap/src/weights.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pallets/slow-clap/Cargo.toml b/pallets/slow-clap/Cargo.toml index 7e2a227..71bb05c 100644 --- a/pallets/slow-clap/Cargo.toml +++ b/pallets/slow-clap/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ghost-slow-clap" -version = "0.4.25" +version = "0.4.26" description = "Applause protocol for the EVM bridge" license.workspace = true authors.workspace = true diff --git a/pallets/slow-clap/src/benchmarking.rs b/pallets/slow-clap/src/benchmarking.rs index 1341c29..88820bb 100644 --- a/pallets/slow-clap/src/benchmarking.rs +++ b/pallets/slow-clap/src/benchmarking.rs @@ -111,8 +111,8 @@ benchmarks! { } try_offend_validators { - let n in 4 .. T::MaxAuthorities::get(); - let d in 0 .. T::MaxAuthorities::get().saturating_div(3); + let n in 1 .. T::MaxAuthorities::get(); + let d in 0 .. T::MaxAuthorities::get(); let session_index = T::ValidatorSet::session_index(); let mut validators_vec = Vec::new(); diff --git a/pallets/slow-clap/src/lib.rs b/pallets/slow-clap/src/lib.rs index e0012a0..e2b9c1b 100644 --- a/pallets/slow-clap/src/lib.rs +++ b/pallets/slow-clap/src/lib.rs @@ -1510,7 +1510,7 @@ impl Pallet { sp_runtime::print(e); } - let extra_weight = T::WeightInfo::try_offend_validators(offenders_len); + let extra_weight = T::WeightInfo::try_offend_validators(validator_set_count, offenders_len); weight.saturating_add(extra_weight) } diff --git a/pallets/slow-clap/src/weights.rs b/pallets/slow-clap/src/weights.rs index b78ca31..ce7135d 100644 --- a/pallets/slow-clap/src/weights.rs +++ b/pallets/slow-clap/src/weights.rs @@ -49,7 +49,7 @@ use core::marker::PhantomData; pub trait WeightInfo { fn slow_clap() -> Weight; fn commit_block()-> Weight; - fn try_offend_validators(offenders_len: u32) -> Weight; + fn try_offend_validators(validators_len: u32, offenders_len: u32) -> Weight; } impl WeightInfo for () { @@ -105,7 +105,7 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().writes(1)) } - fn try_offend_validators(_offenders_len: u32) -> Weight { + fn try_offend_validators(_validators_len: u32, _offenders_len: u32) -> Weight { Default::default() } }