Skip to content

Commit 2525cd3

Browse files
authored
refactor(benchmarks): mv genesis to presets (#2173)
Use `with_genesis_config_preset_name` for fetching genesis config for runtime-benchmarks. --------- Co-authored-by: enddynayn <[email protected]>
1 parent ba31a73 commit 2525cd3

File tree

23 files changed

+724
-722
lines changed

23 files changed

+724
-722
lines changed

node/service/src/chain_spec/frequency.rs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,6 @@ pub fn load_frequency_spec() -> ChainSpec {
1616
.unwrap()
1717
}
1818

19-
#[allow(clippy::unwrap_used)]
20-
fn frequency_genesis_config() -> serde_json::Value {
21-
let mut output: serde_json::Value =
22-
serde_json::from_slice(include_bytes!("../../../../resources/frequency.json").as_slice())
23-
.map_err(|e| format!("Invalid JSON blob {:?}", e))
24-
.unwrap();
25-
26-
if let Some(runtime) = output["genesis"]["runtime"].as_object_mut() {
27-
runtime.remove("vesting");
28-
runtime["parachainSystem"] = serde_json::json!({});
29-
runtime["treasury"] = serde_json::json!({});
30-
runtime["auraExt"] = serde_json::json!({});
31-
}
32-
33-
if let Some(system) = output["genesis"]["runtime"]["system"].as_object_mut() {
34-
system.remove("code");
35-
}
36-
37-
let runtime = &output["genesis"]["runtime"];
38-
runtime.clone()
39-
}
40-
4119
#[allow(clippy::unwrap_used)]
4220
pub fn benchmark_mainnet_config() -> ChainSpec {
4321
let properties =
@@ -60,6 +38,6 @@ pub fn benchmark_mainnet_config() -> ChainSpec {
6038
"/dns4/0.boot.frequency.xyz/tcp/30333/ws/p2p/12D3KooWBd4aEArNvXECtt2JHQACBdFmeafpyfre3q81iM1xCcpP".parse().unwrap(),
6139
"/dns4/1.boot.frequency.xyz/tcp/30333/ws/p2p/12D3KooWCW8d7Yz2d3Jcb49rWcNppRNEs1K2NZitCpPtrHSQb6dw".parse().unwrap(),
6240
])
63-
.with_genesis_config_patch(frequency_genesis_config())
41+
.with_genesis_config_preset_name("frequency")
6442
.build()
6543
}

pallets/capacity/src/weights.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
//! Autogenerated weights for `pallet_capacity`
33
//!
44
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
5-
//! DATE: 2024-09-04, STEPS: `20`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
5+
//! DATE: 2024-10-03, STEPS: `20`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
66
//! WORST CASE MAP SIZE: `1000000`
7-
//! HOSTNAME: `ip-10-173-10-33`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
7+
//! HOSTNAME: `ip-10-173-10-189`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
88
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("frequency-bench")`, DB CACHE: `1024`
99
1010
// Executed Command:
@@ -61,8 +61,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
6161
// Proof Size summary in bytes:
6262
// Measured: `174`
6363
// Estimated: `5259`
64-
// Minimum execution time: 37_795_000 picoseconds.
65-
Weight::from_parts(38_834_000, 5259)
64+
// Minimum execution time: 37_668_000 picoseconds.
65+
Weight::from_parts(38_521_000, 5259)
6666
.saturating_add(T::DbWeight::get().reads(7_u64))
6767
.saturating_add(T::DbWeight::get().writes(4_u64))
6868
}
@@ -78,8 +78,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
7878
// Proof Size summary in bytes:
7979
// Measured: `285`
8080
// Estimated: `5259`
81-
// Minimum execution time: 25_033_000 picoseconds.
82-
Weight::from_parts(25_536_000, 5259)
81+
// Minimum execution time: 24_953_000 picoseconds.
82+
Weight::from_parts(25_777_000, 5259)
8383
.saturating_add(T::DbWeight::get().reads(4_u64))
8484
.saturating_add(T::DbWeight::get().writes(2_u64))
8585
}
@@ -91,8 +91,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
9191
// Proof Size summary in bytes:
9292
// Measured: `0`
9393
// Estimated: `1984`
94-
// Minimum execution time: 2_221_000 picoseconds.
95-
Weight::from_parts(2_294_000, 1984)
94+
// Minimum execution time: 2_111_000 picoseconds.
95+
Weight::from_parts(2_236_000, 1984)
9696
.saturating_add(T::DbWeight::get().reads(2_u64))
9797
.saturating_add(T::DbWeight::get().writes(1_u64))
9898
}
@@ -108,8 +108,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
108108
// Proof Size summary in bytes:
109109
// Measured: `271`
110110
// Estimated: `4081`
111-
// Minimum execution time: 24_068_000 picoseconds.
112-
Weight::from_parts(24_809_000, 4081)
111+
// Minimum execution time: 24_341_000 picoseconds.
112+
Weight::from_parts(24_776_000, 4081)
113113
.saturating_add(T::DbWeight::get().reads(4_u64))
114114
.saturating_add(T::DbWeight::get().writes(4_u64))
115115
}
@@ -119,8 +119,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
119119
// Proof Size summary in bytes:
120120
// Measured: `0`
121121
// Estimated: `0`
122-
// Minimum execution time: 3_840_000 picoseconds.
123-
Weight::from_parts(4_067_000, 0)
122+
// Minimum execution time: 4_007_000 picoseconds.
123+
Weight::from_parts(4_219_000, 0)
124124
.saturating_add(T::DbWeight::get().writes(1_u64))
125125
}
126126
}
@@ -145,8 +145,8 @@ impl WeightInfo for () {
145145
// Proof Size summary in bytes:
146146
// Measured: `174`
147147
// Estimated: `5259`
148-
// Minimum execution time: 37_795_000 picoseconds.
149-
Weight::from_parts(38_834_000, 5259)
148+
// Minimum execution time: 37_668_000 picoseconds.
149+
Weight::from_parts(38_521_000, 5259)
150150
.saturating_add(RocksDbWeight::get().reads(7_u64))
151151
.saturating_add(RocksDbWeight::get().writes(4_u64))
152152
}
@@ -162,8 +162,8 @@ impl WeightInfo for () {
162162
// Proof Size summary in bytes:
163163
// Measured: `285`
164164
// Estimated: `5259`
165-
// Minimum execution time: 25_033_000 picoseconds.
166-
Weight::from_parts(25_536_000, 5259)
165+
// Minimum execution time: 24_953_000 picoseconds.
166+
Weight::from_parts(25_777_000, 5259)
167167
.saturating_add(RocksDbWeight::get().reads(4_u64))
168168
.saturating_add(RocksDbWeight::get().writes(2_u64))
169169
}
@@ -175,8 +175,8 @@ impl WeightInfo for () {
175175
// Proof Size summary in bytes:
176176
// Measured: `0`
177177
// Estimated: `1984`
178-
// Minimum execution time: 2_221_000 picoseconds.
179-
Weight::from_parts(2_294_000, 1984)
178+
// Minimum execution time: 2_111_000 picoseconds.
179+
Weight::from_parts(2_236_000, 1984)
180180
.saturating_add(RocksDbWeight::get().reads(2_u64))
181181
.saturating_add(RocksDbWeight::get().writes(1_u64))
182182
}
@@ -192,8 +192,8 @@ impl WeightInfo for () {
192192
// Proof Size summary in bytes:
193193
// Measured: `271`
194194
// Estimated: `4081`
195-
// Minimum execution time: 24_068_000 picoseconds.
196-
Weight::from_parts(24_809_000, 4081)
195+
// Minimum execution time: 24_341_000 picoseconds.
196+
Weight::from_parts(24_776_000, 4081)
197197
.saturating_add(RocksDbWeight::get().reads(4_u64))
198198
.saturating_add(RocksDbWeight::get().writes(4_u64))
199199
}
@@ -203,8 +203,8 @@ impl WeightInfo for () {
203203
// Proof Size summary in bytes:
204204
// Measured: `0`
205205
// Estimated: `0`
206-
// Minimum execution time: 3_840_000 picoseconds.
207-
Weight::from_parts(4_067_000, 0)
206+
// Minimum execution time: 4_007_000 picoseconds.
207+
Weight::from_parts(4_219_000, 0)
208208
.saturating_add(RocksDbWeight::get().writes(1_u64))
209209
}
210210
}

pallets/frequency-tx-payment/src/weights.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
//! Autogenerated weights for `pallet_frequency_tx_payment`
33
//!
44
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
5-
//! DATE: 2024-09-04, STEPS: `20`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
5+
//! DATE: 2024-10-03, STEPS: `20`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
66
//! WORST CASE MAP SIZE: `1000000`
7-
//! HOSTNAME: `ip-10-173-10-33`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
7+
//! HOSTNAME: `ip-10-173-10-189`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
88
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("frequency-bench")`, DB CACHE: `1024`
99
1010
// Executed Command:
@@ -44,18 +44,18 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
4444
// Proof Size summary in bytes:
4545
// Measured: `0`
4646
// Estimated: `0`
47-
// Minimum execution time: 3_096_000 picoseconds.
48-
Weight::from_parts(3_267_000, 0)
47+
// Minimum execution time: 3_086_000 picoseconds.
48+
Weight::from_parts(3_326_000, 0)
4949
}
5050
/// The range of component `n` is `[0, 10]`.
5151
fn pay_with_capacity_batch_all(n: u32, ) -> Weight {
5252
// Proof Size summary in bytes:
5353
// Measured: `0`
5454
// Estimated: `0`
55-
// Minimum execution time: 5_018_000 picoseconds.
56-
Weight::from_parts(5_849_351, 0)
57-
// Standard Error: 9_305
58-
.saturating_add(Weight::from_parts(3_104_086, 0).saturating_mul(n.into()))
55+
// Minimum execution time: 5_080_000 picoseconds.
56+
Weight::from_parts(6_288_647, 0)
57+
// Standard Error: 11_277
58+
.saturating_add(Weight::from_parts(3_105_852, 0).saturating_mul(n.into()))
5959
}
6060
}
6161

@@ -65,18 +65,18 @@ impl WeightInfo for () {
6565
// Proof Size summary in bytes:
6666
// Measured: `0`
6767
// Estimated: `0`
68-
// Minimum execution time: 3_096_000 picoseconds.
69-
Weight::from_parts(3_267_000, 0)
68+
// Minimum execution time: 3_086_000 picoseconds.
69+
Weight::from_parts(3_326_000, 0)
7070
}
7171
/// The range of component `n` is `[0, 10]`.
7272
fn pay_with_capacity_batch_all(n: u32, ) -> Weight {
7373
// Proof Size summary in bytes:
7474
// Measured: `0`
7575
// Estimated: `0`
76-
// Minimum execution time: 5_018_000 picoseconds.
77-
Weight::from_parts(5_849_351, 0)
78-
// Standard Error: 9_305
79-
.saturating_add(Weight::from_parts(3_104_086, 0).saturating_mul(n.into()))
76+
// Minimum execution time: 5_080_000 picoseconds.
77+
Weight::from_parts(6_288_647, 0)
78+
// Standard Error: 11_277
79+
.saturating_add(Weight::from_parts(3_105_852, 0).saturating_mul(n.into()))
8080
}
8181
}
8282

pallets/handles/src/weights.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
//! Autogenerated weights for `pallet_handles`
33
//!
44
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
5-
//! DATE: 2024-09-04, STEPS: `20`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
5+
//! DATE: 2024-10-03, STEPS: `20`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
66
//! WORST CASE MAP SIZE: `1000000`
7-
//! HOSTNAME: `ip-10-173-10-33`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
7+
//! HOSTNAME: `ip-10-173-10-189`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
88
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("frequency-bench")`, DB CACHE: `1024`
99
1010
// Executed Command:
@@ -54,10 +54,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
5454
// Proof Size summary in bytes:
5555
// Measured: `116`
5656
// Estimated: `4019`
57-
// Minimum execution time: 68_677_000 picoseconds.
58-
Weight::from_parts(70_300_113, 4019)
59-
// Standard Error: 9_562
60-
.saturating_add(Weight::from_parts(85_735, 0).saturating_mul(b.into()))
57+
// Minimum execution time: 64_246_000 picoseconds.
58+
Weight::from_parts(65_436_069, 4019)
59+
// Standard Error: 8_452
60+
.saturating_add(Weight::from_parts(85_489, 0).saturating_mul(b.into()))
6161
.saturating_add(T::DbWeight::get().reads(3_u64))
6262
.saturating_add(T::DbWeight::get().writes(3_u64))
6363
}
@@ -74,10 +74,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
7474
// Proof Size summary in bytes:
7575
// Measured: `222 + b * (1 ±0)`
7676
// Estimated: `4019`
77-
// Minimum execution time: 77_227_000 picoseconds.
78-
Weight::from_parts(78_870_608, 4019)
79-
// Standard Error: 7_816
80-
.saturating_add(Weight::from_parts(170_182, 0).saturating_mul(b.into()))
77+
// Minimum execution time: 77_229_000 picoseconds.
78+
Weight::from_parts(78_047_988, 4019)
79+
// Standard Error: 8_497
80+
.saturating_add(Weight::from_parts(160_502, 0).saturating_mul(b.into()))
8181
.saturating_add(T::DbWeight::get().reads(3_u64))
8282
.saturating_add(T::DbWeight::get().writes(4_u64))
8383
}
@@ -91,8 +91,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
9191
// Proof Size summary in bytes:
9292
// Measured: `231`
9393
// Estimated: `4019`
94-
// Minimum execution time: 19_290_000 picoseconds.
95-
Weight::from_parts(20_118_000, 4019)
94+
// Minimum execution time: 19_028_000 picoseconds.
95+
Weight::from_parts(19_409_000, 4019)
9696
.saturating_add(T::DbWeight::get().reads(2_u64))
9797
.saturating_add(T::DbWeight::get().writes(2_u64))
9898
}
@@ -113,10 +113,10 @@ impl WeightInfo for () {
113113
// Proof Size summary in bytes:
114114
// Measured: `116`
115115
// Estimated: `4019`
116-
// Minimum execution time: 68_677_000 picoseconds.
117-
Weight::from_parts(70_300_113, 4019)
118-
// Standard Error: 9_562
119-
.saturating_add(Weight::from_parts(85_735, 0).saturating_mul(b.into()))
116+
// Minimum execution time: 64_246_000 picoseconds.
117+
Weight::from_parts(65_436_069, 4019)
118+
// Standard Error: 8_452
119+
.saturating_add(Weight::from_parts(85_489, 0).saturating_mul(b.into()))
120120
.saturating_add(RocksDbWeight::get().reads(3_u64))
121121
.saturating_add(RocksDbWeight::get().writes(3_u64))
122122
}
@@ -133,10 +133,10 @@ impl WeightInfo for () {
133133
// Proof Size summary in bytes:
134134
// Measured: `222 + b * (1 ±0)`
135135
// Estimated: `4019`
136-
// Minimum execution time: 77_227_000 picoseconds.
137-
Weight::from_parts(78_870_608, 4019)
138-
// Standard Error: 7_816
139-
.saturating_add(Weight::from_parts(170_182, 0).saturating_mul(b.into()))
136+
// Minimum execution time: 77_229_000 picoseconds.
137+
Weight::from_parts(78_047_988, 4019)
138+
// Standard Error: 8_497
139+
.saturating_add(Weight::from_parts(160_502, 0).saturating_mul(b.into()))
140140
.saturating_add(RocksDbWeight::get().reads(3_u64))
141141
.saturating_add(RocksDbWeight::get().writes(4_u64))
142142
}
@@ -150,8 +150,8 @@ impl WeightInfo for () {
150150
// Proof Size summary in bytes:
151151
// Measured: `231`
152152
// Estimated: `4019`
153-
// Minimum execution time: 19_290_000 picoseconds.
154-
Weight::from_parts(20_118_000, 4019)
153+
// Minimum execution time: 19_028_000 picoseconds.
154+
Weight::from_parts(19_409_000, 4019)
155155
.saturating_add(RocksDbWeight::get().reads(2_u64))
156156
.saturating_add(RocksDbWeight::get().writes(2_u64))
157157
}

0 commit comments

Comments
 (0)