common_runtime/weights/pallet_collator_selection.rs
1//! Autogenerated weights for pallet_collator_selection
2//!
3//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0
4//! DATE: 2025-08-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
5//! WORST CASE MAP SIZE: `1000000`
6//! HOSTNAME: `ip-10-173-5-194`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
7//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
8
9// Executed Command:
10// ./scripts/../target/release/frequency
11// benchmark
12// pallet
13// --pallet=pallet_collator_selection
14// --extrinsic
15// *
16// --heap-pages=4096
17// --steps=50
18// --repeat=20
19// --output=./scripts/../runtime/common/src/weights
20// --template=./scripts/../.maintain/runtime-weight-template.hbs
21// --additional-trie-layers=3
22// --runtime=./scripts/../target/release/wbuild/frequency-runtime/frequency_runtime.wasm
23// --genesis-builder=runtime
24
25#![cfg_attr(rustfmt, rustfmt_skip)]
26#![allow(unused_parens)]
27#![allow(unused_imports)]
28#![allow(missing_docs)]
29
30use frame_support::{traits::Get, weights::Weight};
31use core::marker::PhantomData;
32
33/// Weights for `pallet_collator_selection` using the Substrate node and recommended hardware.
34pub struct SubstrateWeight<T>(PhantomData<T>);
35impl<T: frame_system::Config> pallet_collator_selection::WeightInfo for SubstrateWeight<T> {
36 /// Storage: `Session::NextKeys` (r:16 w:0)
37 /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
38 /// Storage: `CollatorSelection::Invulnerables` (r:0 w:1)
39 /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(513), added: 1008, mode: `MaxEncodedLen`)
40 /// The range of component `b` is `[1, 16]`.
41 fn set_invulnerables(b: u32, ) -> Weight {
42 // Proof Size summary in bytes:
43 // Measured: `197 + b * (80 ±0)`
44 // Estimated: `1681 + b * (2555 ±0)`
45 // Minimum execution time: 14_880_000 picoseconds.
46 Weight::from_parts(12_152_222, 1681)
47 // Standard Error: 6_930
48 .saturating_add(Weight::from_parts(3_882_926, 0).saturating_mul(b.into()))
49 .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into())))
50 .saturating_add(T::DbWeight::get().writes(1_u64))
51 .saturating_add(Weight::from_parts(0, 2555).saturating_mul(b.into()))
52 }
53 /// Storage: `Session::NextKeys` (r:1 w:0)
54 /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
55 /// Storage: `CollatorSelection::Invulnerables` (r:1 w:1)
56 /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(513), added: 1008, mode: `MaxEncodedLen`)
57 /// Storage: `CollatorSelection::CandidateList` (r:1 w:1)
58 /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(2401), added: 2896, mode: `MaxEncodedLen`)
59 /// Storage: `System::Account` (r:1 w:1)
60 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
61 /// The range of component `b` is `[1, 15]`.
62 /// The range of component `c` is `[1, 49]`.
63 fn add_invulnerable(b: u32, c: u32, ) -> Weight {
64 // Proof Size summary in bytes:
65 // Measured: `971 + b * (32 ±0) + c * (54 ±0)`
66 // Estimated: `4883 + b * (29 ±0) + c * (56 ±0)`
67 // Minimum execution time: 48_142_000 picoseconds.
68 Weight::from_parts(49_334_648, 4883)
69 // Standard Error: 1_855
70 .saturating_add(Weight::from_parts(192_513, 0).saturating_mul(c.into()))
71 .saturating_add(T::DbWeight::get().reads(4_u64))
72 .saturating_add(T::DbWeight::get().writes(3_u64))
73 .saturating_add(Weight::from_parts(0, 29).saturating_mul(b.into()))
74 .saturating_add(Weight::from_parts(0, 56).saturating_mul(c.into()))
75 }
76 /// Storage: `CollatorSelection::CandidateList` (r:1 w:0)
77 /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(2401), added: 2896, mode: `MaxEncodedLen`)
78 /// Storage: `CollatorSelection::Invulnerables` (r:1 w:1)
79 /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(513), added: 1008, mode: `MaxEncodedLen`)
80 /// The range of component `b` is `[2, 16]`.
81 fn remove_invulnerable(b: u32, ) -> Weight {
82 // Proof Size summary in bytes:
83 // Measured: `153 + b * (32 ±0)`
84 // Estimated: `4381`
85 // Minimum execution time: 13_961_000 picoseconds.
86 Weight::from_parts(14_747_587, 4381)
87 // Standard Error: 2_139
88 .saturating_add(Weight::from_parts(155_409, 0).saturating_mul(b.into()))
89 .saturating_add(T::DbWeight::get().reads(2_u64))
90 .saturating_add(T::DbWeight::get().writes(1_u64))
91 }
92 /// Storage: `CollatorSelection::DesiredCandidates` (r:0 w:1)
93 /// Proof: `CollatorSelection::DesiredCandidates` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
94 fn set_desired_candidates() -> Weight {
95 // Proof Size summary in bytes:
96 // Measured: `0`
97 // Estimated: `0`
98 // Minimum execution time: 5_263_000 picoseconds.
99 Weight::from_parts(5_540_000, 0)
100 .saturating_add(T::DbWeight::get().writes(1_u64))
101 }
102 /// Storage: `CollatorSelection::CandidacyBond` (r:1 w:1)
103 /// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
104 /// Storage: `CollatorSelection::CandidateList` (r:1 w:1)
105 /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(2401), added: 2896, mode: `MaxEncodedLen`)
106 /// Storage: `System::Account` (r:50 w:50)
107 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
108 /// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:50)
109 /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
110 /// The range of component `c` is `[0, 50]`.
111 /// The range of component `k` is `[0, 50]`.
112 fn set_candidacy_bond(c: u32, k: u32, ) -> Weight {
113 // Proof Size summary in bytes:
114 // Measured: `0 + c * (181 ±0) + k * (124 ±0)`
115 // Estimated: `4381 + c * (894 ±29) + k * (894 ±29)`
116 // Minimum execution time: 13_005_000 picoseconds.
117 Weight::from_parts(13_336_000, 4381)
118 // Standard Error: 180_953
119 .saturating_add(Weight::from_parts(6_205_127, 0).saturating_mul(c.into()))
120 // Standard Error: 180_953
121 .saturating_add(Weight::from_parts(5_863_854, 0).saturating_mul(k.into()))
122 .saturating_add(T::DbWeight::get().reads(2_u64))
123 .saturating_add(T::DbWeight::get().writes(1_u64))
124 .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into())))
125 .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into())))
126 .saturating_add(Weight::from_parts(0, 894).saturating_mul(c.into()))
127 .saturating_add(Weight::from_parts(0, 894).saturating_mul(k.into()))
128 }
129 /// Storage: `CollatorSelection::CandidacyBond` (r:1 w:0)
130 /// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
131 /// Storage: `CollatorSelection::CandidateList` (r:1 w:1)
132 /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(2401), added: 2896, mode: `MaxEncodedLen`)
133 /// The range of component `c` is `[1, 50]`.
134 fn update_bond(c: u32, ) -> Weight {
135 // Proof Size summary in bytes:
136 // Measured: `357 + c * (49 ±0)`
137 // Estimated: `4381`
138 // Minimum execution time: 30_847_000 picoseconds.
139 Weight::from_parts(33_178_116, 4381)
140 // Standard Error: 2_773
141 .saturating_add(Weight::from_parts(194_185, 0).saturating_mul(c.into()))
142 .saturating_add(T::DbWeight::get().reads(2_u64))
143 .saturating_add(T::DbWeight::get().writes(1_u64))
144 }
145 /// Storage: `CollatorSelection::CandidateList` (r:1 w:1)
146 /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(2401), added: 2896, mode: `MaxEncodedLen`)
147 /// Storage: `CollatorSelection::Invulnerables` (r:1 w:0)
148 /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(513), added: 1008, mode: `MaxEncodedLen`)
149 /// Storage: `Session::NextKeys` (r:1 w:0)
150 /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
151 /// Storage: `CollatorSelection::CandidacyBond` (r:1 w:0)
152 /// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
153 /// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:1)
154 /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
155 /// The range of component `c` is `[1, 49]`.
156 fn register_as_candidate(c: u32, ) -> Weight {
157 // Proof Size summary in bytes:
158 // Measured: `604 + c * (59 ±0)`
159 // Estimated: `4571 + c * (59 ±0)`
160 // Minimum execution time: 41_974_000 picoseconds.
161 Weight::from_parts(44_624_982, 4571)
162 // Standard Error: 2_734
163 .saturating_add(Weight::from_parts(246_300, 0).saturating_mul(c.into()))
164 .saturating_add(T::DbWeight::get().reads(4_u64))
165 .saturating_add(T::DbWeight::get().writes(2_u64))
166 .saturating_add(Weight::from_parts(0, 59).saturating_mul(c.into()))
167 }
168 /// Storage: `CollatorSelection::Invulnerables` (r:1 w:0)
169 /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(513), added: 1008, mode: `MaxEncodedLen`)
170 /// Storage: `CollatorSelection::CandidacyBond` (r:1 w:0)
171 /// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
172 /// Storage: `Session::NextKeys` (r:1 w:0)
173 /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
174 /// Storage: `CollatorSelection::CandidateList` (r:1 w:1)
175 /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(2401), added: 2896, mode: `MaxEncodedLen`)
176 /// Storage: `System::Account` (r:1 w:1)
177 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
178 /// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:2)
179 /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
180 /// The range of component `c` is `[1, 50]`.
181 fn take_candidate_slot(c: u32, ) -> Weight {
182 // Proof Size summary in bytes:
183 // Measured: `699 + c * (60 ±0)`
184 // Estimated: `4668 + c * (60 ±0)`
185 // Minimum execution time: 58_595_000 picoseconds.
186 Weight::from_parts(61_840_629, 4668)
187 // Standard Error: 3_134
188 .saturating_add(Weight::from_parts(273_453, 0).saturating_mul(c.into()))
189 .saturating_add(T::DbWeight::get().reads(5_u64))
190 .saturating_add(T::DbWeight::get().writes(4_u64))
191 .saturating_add(Weight::from_parts(0, 60).saturating_mul(c.into()))
192 }
193 /// Storage: `CollatorSelection::CandidateList` (r:1 w:1)
194 /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(2401), added: 2896, mode: `MaxEncodedLen`)
195 /// Storage: `CollatorSelection::Invulnerables` (r:1 w:0)
196 /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(513), added: 1008, mode: `MaxEncodedLen`)
197 /// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:1)
198 /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
199 /// The range of component `c` is `[1, 50]`.
200 fn leave_intent(c: u32, ) -> Weight {
201 // Proof Size summary in bytes:
202 // Measured: `372 + c * (48 ±0)`
203 // Estimated: `4381`
204 // Minimum execution time: 33_090_000 picoseconds.
205 Weight::from_parts(35_277_561, 4381)
206 // Standard Error: 2_647
207 .saturating_add(Weight::from_parts(234_133, 0).saturating_mul(c.into()))
208 .saturating_add(T::DbWeight::get().reads(2_u64))
209 .saturating_add(T::DbWeight::get().writes(2_u64))
210 }
211 /// Storage: `System::Account` (r:2 w:2)
212 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
213 /// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:1)
214 /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
215 fn note_author() -> Weight {
216 // Proof Size summary in bytes:
217 // Measured: `230`
218 // Estimated: `6691`
219 // Minimum execution time: 49_644_000 picoseconds.
220 Weight::from_parts(50_411_000, 6691)
221 .saturating_add(T::DbWeight::get().reads(2_u64))
222 .saturating_add(T::DbWeight::get().writes(3_u64))
223 }
224 /// Storage: `CollatorSelection::CandidateList` (r:1 w:0)
225 /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(2401), added: 2896, mode: `MaxEncodedLen`)
226 /// Storage: `CollatorSelection::LastAuthoredBlock` (r:50 w:0)
227 /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
228 /// Storage: `CollatorSelection::Invulnerables` (r:1 w:0)
229 /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(513), added: 1008, mode: `MaxEncodedLen`)
230 /// Storage: `CollatorSelection::DesiredCandidates` (r:1 w:0)
231 /// Proof: `CollatorSelection::DesiredCandidates` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
232 /// Storage: `System::Account` (r:49 w:49)
233 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
234 /// The range of component `r` is `[1, 50]`.
235 /// The range of component `c` is `[1, 50]`.
236 fn new_session(r: u32, c: u32, ) -> Weight {
237 // Proof Size summary in bytes:
238 // Measured: `1143 + c * (98 ±0) + r * (118 ±0)`
239 // Estimated: `4381 + c * (2519 ±0) + r * (2603 ±0)`
240 // Minimum execution time: 22_708_000 picoseconds.
241 Weight::from_parts(23_085_000, 4381)
242 // Standard Error: 321_099
243 .saturating_add(Weight::from_parts(14_482_085, 0).saturating_mul(c.into()))
244 .saturating_add(T::DbWeight::get().reads(4_u64))
245 .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into())))
246 .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into())))
247 .saturating_add(Weight::from_parts(0, 2519).saturating_mul(c.into()))
248 .saturating_add(Weight::from_parts(0, 2603).saturating_mul(r.into()))
249 }
250}
251
252
253#[cfg(test)]
254mod tests {
255 use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
256 use crate::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
257 use crate::weights::extrinsic_weights::ExtrinsicBaseWeight;
258
259 #[allow(dead_code)]
260 struct BlockWeights;
261 impl Get<frame_system::limits::BlockWeights> for BlockWeights {
262 fn get() -> frame_system::limits::BlockWeights {
263 frame_system::limits::BlockWeights::builder()
264 .base_block(Weight::zero())
265 .for_class(DispatchClass::all(), |weights| {
266 weights.base_extrinsic = ExtrinsicBaseWeight::get();
267 })
268 .for_class(DispatchClass::non_mandatory(), |weights| {
269 weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
270 })
271 .build_or_panic()
272 }
273 }
274
275 #[test]
276 fn test_set_invulnerables() {
277 assert!(
278 BlockWeights::get()
279 .per_class
280 .get(frame_support::dispatch::DispatchClass::Normal)
281 .max_extrinsic
282 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
283 .proof_size()
284 > 1681
285 );
286 }
287 #[test]
288 fn test_add_invulnerable() {
289 assert!(
290 BlockWeights::get()
291 .per_class
292 .get(frame_support::dispatch::DispatchClass::Normal)
293 .max_extrinsic
294 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
295 .proof_size()
296 > 4883
297 );
298 }
299 #[test]
300 fn test_remove_invulnerable() {
301 assert!(
302 BlockWeights::get()
303 .per_class
304 .get(frame_support::dispatch::DispatchClass::Normal)
305 .max_extrinsic
306 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
307 .proof_size()
308 > 4381
309 );
310 }
311 #[test]
312 fn test_set_candidacy_bond() {
313 assert!(
314 BlockWeights::get()
315 .per_class
316 .get(frame_support::dispatch::DispatchClass::Normal)
317 .max_extrinsic
318 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
319 .proof_size()
320 > 4381
321 );
322 }
323 #[test]
324 fn test_update_bond() {
325 assert!(
326 BlockWeights::get()
327 .per_class
328 .get(frame_support::dispatch::DispatchClass::Normal)
329 .max_extrinsic
330 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
331 .proof_size()
332 > 4381
333 );
334 }
335 #[test]
336 fn test_register_as_candidate() {
337 assert!(
338 BlockWeights::get()
339 .per_class
340 .get(frame_support::dispatch::DispatchClass::Normal)
341 .max_extrinsic
342 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
343 .proof_size()
344 > 4571
345 );
346 }
347 #[test]
348 fn test_take_candidate_slot() {
349 assert!(
350 BlockWeights::get()
351 .per_class
352 .get(frame_support::dispatch::DispatchClass::Normal)
353 .max_extrinsic
354 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
355 .proof_size()
356 > 4668
357 );
358 }
359 #[test]
360 fn test_leave_intent() {
361 assert!(
362 BlockWeights::get()
363 .per_class
364 .get(frame_support::dispatch::DispatchClass::Normal)
365 .max_extrinsic
366 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
367 .proof_size()
368 > 4381
369 );
370 }
371 #[test]
372 fn test_note_author() {
373 assert!(
374 BlockWeights::get()
375 .per_class
376 .get(frame_support::dispatch::DispatchClass::Normal)
377 .max_extrinsic
378 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
379 .proof_size()
380 > 6691
381 );
382 }
383 #[test]
384 fn test_new_session() {
385 assert!(
386 BlockWeights::get()
387 .per_class
388 .get(frame_support::dispatch::DispatchClass::Normal)
389 .max_extrinsic
390 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
391 .proof_size()
392 > 4381
393 );
394 }
395}