Skip to content

Commit a823d18

Browse files
bkontursvyatonik
andauthored
Fix bridges grandpa benchmarks (#2577) (#4548)
Cherry-picked fix from upcoming #4494 --------- Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com> Co-authored-by: command-bot <>
1 parent fd16191 commit a823d18

File tree

3 files changed

+24
-23
lines changed

3 files changed

+24
-23
lines changed

bridges/modules/grandpa/src/benchmarking.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@ const MAX_VOTE_ANCESTRIES_RANGE_END: u32 =
7070
// the same with validators - if there are too much validators, let's run benchmarks on subrange
7171
fn precommits_range_end<T: Config<I>, I: 'static>() -> u32 {
7272
let max_bridged_authorities = T::BridgedChain::MAX_AUTHORITIES_COUNT;
73-
if max_bridged_authorities > 128 {
73+
let max_bridged_authorities = if max_bridged_authorities > 128 {
7474
sp_std::cmp::max(128, max_bridged_authorities / 5)
7575
} else {
7676
max_bridged_authorities
7777
};
78+
7879
required_justification_precommits(max_bridged_authorities)
7980
}
8081

cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
//! Autogenerated weights for `pallet_bridge_grandpa`
1818
//!
1919
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
20-
//! DATE: 2024-05-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
20+
//! DATE: 2024-05-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
2121
//! WORST CASE MAP SIZE: `1000000`
22-
//! HOSTNAME: `runner-unxyhko3-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
22+
//! HOSTNAME: `runner-vicqj8em-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
2323
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
2424
2525
// Executed Command:
@@ -62,17 +62,17 @@ impl<T: frame_system::Config> pallet_bridge_grandpa::WeightInfo for WeightInfo<T
6262
/// Proof: `BridgeWestendGrandpa::ImportedHashes` (`max_values`: Some(1024), `max_size`: Some(36), added: 1521, mode: `MaxEncodedLen`)
6363
/// Storage: `BridgeWestendGrandpa::ImportedHeaders` (r:0 w:2)
6464
/// Proof: `BridgeWestendGrandpa::ImportedHeaders` (`max_values`: Some(1024), `max_size`: Some(68), added: 1553, mode: `MaxEncodedLen`)
65-
/// The range of component `p` is `[1, 838]`.
65+
/// The range of component `p` is `[1, 168]`.
6666
/// The range of component `v` is `[50, 100]`.
6767
fn submit_finality_proof(p: u32, _v: u32, ) -> Weight {
6868
// Proof Size summary in bytes:
69-
// Measured: `440 + p * (60 ±0)`
69+
// Measured: `438 + p * (60 ±0)`
7070
// Estimated: `51735`
71-
// Minimum execution time: 306_046_000 picoseconds.
72-
Weight::from_parts(384_361_000, 0)
71+
// Minimum execution time: 300_829_000 picoseconds.
72+
Weight::from_parts(321_573_000, 0)
7373
.saturating_add(Weight::from_parts(0, 51735))
74-
// Standard Error: 14_298
75-
.saturating_add(Weight::from_parts(49_045_748, 0).saturating_mul(p.into()))
74+
// Standard Error: 25_917
75+
.saturating_add(Weight::from_parts(48_613_160, 0).saturating_mul(p.into()))
7676
.saturating_add(T::DbWeight::get().reads(6))
7777
.saturating_add(T::DbWeight::get().writes(5))
7878
}
@@ -90,8 +90,8 @@ impl<T: frame_system::Config> pallet_bridge_grandpa::WeightInfo for WeightInfo<T
9090
// Proof Size summary in bytes:
9191
// Measured: `452`
9292
// Estimated: `51735`
93-
// Minimum execution time: 94_965_000 picoseconds.
94-
Weight::from_parts(113_633_000, 0)
93+
// Minimum execution time: 101_007_000 picoseconds.
94+
Weight::from_parts(129_904_000, 0)
9595
.saturating_add(Weight::from_parts(0, 51735))
9696
.saturating_add(T::DbWeight::get().reads(3))
9797
.saturating_add(T::DbWeight::get().writes(6))

cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_bridge_grandpa.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
//! Autogenerated weights for `pallet_bridge_grandpa`
1818
//!
1919
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
20-
//! DATE: 2024-05-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
20+
//! DATE: 2024-05-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
2121
//! WORST CASE MAP SIZE: `1000000`
22-
//! HOSTNAME: `runner-unxyhko3-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
22+
//! HOSTNAME: `runner-vicqj8em-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
2323
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-westend-dev")`, DB CACHE: 1024
2424
2525
// Executed Command:
@@ -62,19 +62,19 @@ impl<T: frame_system::Config> pallet_bridge_grandpa::WeightInfo for WeightInfo<T
6262
/// Proof: `BridgeRococoGrandpa::ImportedHashes` (`max_values`: Some(1024), `max_size`: Some(36), added: 1521, mode: `MaxEncodedLen`)
6363
/// Storage: `BridgeRococoGrandpa::ImportedHeaders` (r:0 w:2)
6464
/// Proof: `BridgeRococoGrandpa::ImportedHeaders` (`max_values`: Some(1024), `max_size`: Some(68), added: 1553, mode: `MaxEncodedLen`)
65-
/// The range of component `p` is `[1, 838]`.
65+
/// The range of component `p` is `[1, 168]`.
6666
/// The range of component `v` is `[50, 100]`.
6767
fn submit_finality_proof(p: u32, v: u32, ) -> Weight {
6868
// Proof Size summary in bytes:
69-
// Measured: `270 + p * (60 ±0)`
69+
// Measured: `268 + p * (60 ±0)`
7070
// Estimated: `51735`
71-
// Minimum execution time: 294_098_000 picoseconds.
72-
Weight::from_parts(31_208_540, 0)
71+
// Minimum execution time: 291_721_000 picoseconds.
72+
Weight::from_parts(37_495_589, 0)
7373
.saturating_add(Weight::from_parts(0, 51735))
74-
// Standard Error: 8_832
75-
.saturating_add(Weight::from_parts(40_930_987, 0).saturating_mul(p.into()))
76-
// Standard Error: 147_319
77-
.saturating_add(Weight::from_parts(2_663_839, 0).saturating_mul(v.into()))
74+
// Standard Error: 22_170
75+
.saturating_add(Weight::from_parts(45_403_072, 0).saturating_mul(p.into()))
76+
// Standard Error: 73_977
77+
.saturating_add(Weight::from_parts(2_130_216, 0).saturating_mul(v.into()))
7878
.saturating_add(T::DbWeight::get().reads(6))
7979
.saturating_add(T::DbWeight::get().writes(5))
8080
}
@@ -92,8 +92,8 @@ impl<T: frame_system::Config> pallet_bridge_grandpa::WeightInfo for WeightInfo<T
9292
// Proof Size summary in bytes:
9393
// Measured: `282`
9494
// Estimated: `51735`
95-
// Minimum execution time: 112_875_000 picoseconds.
96-
Weight::from_parts(120_861_000, 0)
95+
// Minimum execution time: 77_426_000 picoseconds.
96+
Weight::from_parts(90_926_000, 0)
9797
.saturating_add(Weight::from_parts(0, 51735))
9898
.saturating_add(T::DbWeight::get().reads(3))
9999
.saturating_add(T::DbWeight::get().writes(6))

0 commit comments

Comments
 (0)