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 48.0.0
4//! DATE: 2025-09-15, 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_658_000 picoseconds.
46		Weight::from_parts(11_699_140, 1681)
47			// Standard Error: 6_748
48			.saturating_add(Weight::from_parts(3_800_662, 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: 45_672_000 picoseconds.
68		Weight::from_parts(46_476_644, 4883)
69			// Standard Error: 5_510
70			.saturating_add(Weight::from_parts(40_029, 0).saturating_mul(b.into()))
71			// Standard Error: 1_634
72			.saturating_add(Weight::from_parts(200_400, 0).saturating_mul(c.into()))
73			.saturating_add(T::DbWeight::get().reads(4_u64))
74			.saturating_add(T::DbWeight::get().writes(3_u64))
75			.saturating_add(Weight::from_parts(0, 29).saturating_mul(b.into()))
76			.saturating_add(Weight::from_parts(0, 56).saturating_mul(c.into()))
77	}
78	/// Storage: `CollatorSelection::CandidateList` (r:1 w:0)
79	/// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(2401), added: 2896, mode: `MaxEncodedLen`)
80	/// Storage: `CollatorSelection::Invulnerables` (r:1 w:1)
81	/// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(513), added: 1008, mode: `MaxEncodedLen`)
82	/// The range of component `b` is `[2, 16]`.
83	fn remove_invulnerable(b: u32, ) -> Weight {
84		// Proof Size summary in bytes:
85		//  Measured:  `153 + b * (32 ±0)`
86		//  Estimated: `4381`
87		// Minimum execution time: 14_194_000 picoseconds.
88		Weight::from_parts(14_816_177, 4381)
89			// Standard Error: 2_269
90			.saturating_add(Weight::from_parts(139_640, 0).saturating_mul(b.into()))
91			.saturating_add(T::DbWeight::get().reads(2_u64))
92			.saturating_add(T::DbWeight::get().writes(1_u64))
93	}
94	/// Storage: `CollatorSelection::DesiredCandidates` (r:0 w:1)
95	/// Proof: `CollatorSelection::DesiredCandidates` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
96	fn set_desired_candidates() -> Weight {
97		// Proof Size summary in bytes:
98		//  Measured:  `0`
99		//  Estimated: `0`
100		// Minimum execution time: 5_256_000 picoseconds.
101		Weight::from_parts(5_483_000, 0)
102			.saturating_add(T::DbWeight::get().writes(1_u64))
103	}
104	/// Storage: `CollatorSelection::CandidacyBond` (r:1 w:1)
105	/// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
106	/// Storage: `CollatorSelection::CandidateList` (r:1 w:1)
107	/// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(2401), added: 2896, mode: `MaxEncodedLen`)
108	/// Storage: `System::Account` (r:50 w:50)
109	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
110	/// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:50)
111	/// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
112	/// The range of component `c` is `[0, 50]`.
113	/// The range of component `k` is `[0, 50]`.
114	fn set_candidacy_bond(c: u32, k: u32, ) -> Weight {
115		// Proof Size summary in bytes:
116		//  Measured:  `0 + c * (181 ±0) + k * (124 ±0)`
117		//  Estimated: `4381 + c * (894 ±29) + k * (894 ±29)`
118		// Minimum execution time: 12_804_000 picoseconds.
119		Weight::from_parts(13_102_000, 4381)
120			// Standard Error: 167_464
121			.saturating_add(Weight::from_parts(5_775_216, 0).saturating_mul(c.into()))
122			// Standard Error: 167_464
123			.saturating_add(Weight::from_parts(5_462_672, 0).saturating_mul(k.into()))
124			.saturating_add(T::DbWeight::get().reads(2_u64))
125			.saturating_add(T::DbWeight::get().writes(1_u64))
126			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into())))
127			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into())))
128			.saturating_add(Weight::from_parts(0, 894).saturating_mul(c.into()))
129			.saturating_add(Weight::from_parts(0, 894).saturating_mul(k.into()))
130	}
131	/// Storage: `CollatorSelection::CandidacyBond` (r:1 w:0)
132	/// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
133	/// Storage: `CollatorSelection::CandidateList` (r:1 w:1)
134	/// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(2401), added: 2896, mode: `MaxEncodedLen`)
135	/// The range of component `c` is `[1, 50]`.
136	fn update_bond(c: u32, ) -> Weight {
137		// Proof Size summary in bytes:
138		//  Measured:  `357 + c * (49 ±0)`
139		//  Estimated: `4381`
140		// Minimum execution time: 29_391_000 picoseconds.
141		Weight::from_parts(31_899_025, 4381)
142			// Standard Error: 2_297
143			.saturating_add(Weight::from_parts(190_628, 0).saturating_mul(c.into()))
144			.saturating_add(T::DbWeight::get().reads(2_u64))
145			.saturating_add(T::DbWeight::get().writes(1_u64))
146	}
147	/// Storage: `CollatorSelection::CandidateList` (r:1 w:1)
148	/// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(2401), added: 2896, mode: `MaxEncodedLen`)
149	/// Storage: `CollatorSelection::Invulnerables` (r:1 w:0)
150	/// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(513), added: 1008, mode: `MaxEncodedLen`)
151	/// Storage: `Session::NextKeys` (r:1 w:0)
152	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
153	/// Storage: `CollatorSelection::CandidacyBond` (r:1 w:0)
154	/// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
155	/// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:1)
156	/// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
157	/// The range of component `c` is `[1, 49]`.
158	fn register_as_candidate(c: u32, ) -> Weight {
159		// Proof Size summary in bytes:
160		//  Measured:  `604 + c * (59 ±0)`
161		//  Estimated: `4571 + c * (59 ±0)`
162		// Minimum execution time: 40_000_000 picoseconds.
163		Weight::from_parts(42_844_517, 4571)
164			// Standard Error: 2_519
165			.saturating_add(Weight::from_parts(241_897, 0).saturating_mul(c.into()))
166			.saturating_add(T::DbWeight::get().reads(4_u64))
167			.saturating_add(T::DbWeight::get().writes(2_u64))
168			.saturating_add(Weight::from_parts(0, 59).saturating_mul(c.into()))
169	}
170	/// Storage: `CollatorSelection::Invulnerables` (r:1 w:0)
171	/// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(513), added: 1008, mode: `MaxEncodedLen`)
172	/// Storage: `CollatorSelection::CandidacyBond` (r:1 w:0)
173	/// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
174	/// Storage: `Session::NextKeys` (r:1 w:0)
175	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
176	/// Storage: `CollatorSelection::CandidateList` (r:1 w:1)
177	/// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(2401), added: 2896, mode: `MaxEncodedLen`)
178	/// Storage: `System::Account` (r:1 w:1)
179	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
180	/// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:2)
181	/// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
182	/// The range of component `c` is `[1, 50]`.
183	fn take_candidate_slot(c: u32, ) -> Weight {
184		// Proof Size summary in bytes:
185		//  Measured:  `699 + c * (60 ±0)`
186		//  Estimated: `4668 + c * (60 ±0)`
187		// Minimum execution time: 55_523_000 picoseconds.
188		Weight::from_parts(58_764_779, 4668)
189			// Standard Error: 3_277
190			.saturating_add(Weight::from_parts(280_380, 0).saturating_mul(c.into()))
191			.saturating_add(T::DbWeight::get().reads(5_u64))
192			.saturating_add(T::DbWeight::get().writes(4_u64))
193			.saturating_add(Weight::from_parts(0, 60).saturating_mul(c.into()))
194	}
195	/// Storage: `CollatorSelection::CandidateList` (r:1 w:1)
196	/// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(2401), added: 2896, mode: `MaxEncodedLen`)
197	/// Storage: `CollatorSelection::Invulnerables` (r:1 w:0)
198	/// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(513), added: 1008, mode: `MaxEncodedLen`)
199	/// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:1)
200	/// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
201	/// The range of component `c` is `[1, 50]`.
202	fn leave_intent(c: u32, ) -> Weight {
203		// Proof Size summary in bytes:
204		//  Measured:  `372 + c * (48 ±0)`
205		//  Estimated: `4381`
206		// Minimum execution time: 31_385_000 picoseconds.
207		Weight::from_parts(34_186_309, 4381)
208			// Standard Error: 2_615
209			.saturating_add(Weight::from_parts(226_263, 0).saturating_mul(c.into()))
210			.saturating_add(T::DbWeight::get().reads(2_u64))
211			.saturating_add(T::DbWeight::get().writes(2_u64))
212	}
213	/// Storage: `System::Account` (r:2 w:2)
214	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
215	/// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:1)
216	/// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
217	fn note_author() -> Weight {
218		// Proof Size summary in bytes:
219		//  Measured:  `230`
220		//  Estimated: `6691`
221		// Minimum execution time: 47_617_000 picoseconds.
222		Weight::from_parts(48_417_000, 6691)
223			.saturating_add(T::DbWeight::get().reads(2_u64))
224			.saturating_add(T::DbWeight::get().writes(3_u64))
225	}
226	/// Storage: `CollatorSelection::CandidateList` (r:1 w:0)
227	/// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(2401), added: 2896, mode: `MaxEncodedLen`)
228	/// Storage: `CollatorSelection::LastAuthoredBlock` (r:50 w:0)
229	/// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
230	/// Storage: `CollatorSelection::Invulnerables` (r:1 w:0)
231	/// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(513), added: 1008, mode: `MaxEncodedLen`)
232	/// Storage: `CollatorSelection::DesiredCandidates` (r:1 w:0)
233	/// Proof: `CollatorSelection::DesiredCandidates` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
234	/// Storage: `System::Account` (r:49 w:49)
235	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
236	/// The range of component `r` is `[1, 50]`.
237	/// The range of component `c` is `[1, 50]`.
238	fn new_session(r: u32, c: u32, ) -> Weight {
239		// Proof Size summary in bytes:
240		//  Measured:  `1143 + c * (98 ±0) + r * (118 ±0)`
241		//  Estimated: `4381 + c * (2519 ±0) + r * (2603 ±0)`
242		// Minimum execution time: 22_922_000 picoseconds.
243		Weight::from_parts(23_302_000, 4381)
244			// Standard Error: 299_023
245			.saturating_add(Weight::from_parts(13_824_189, 0).saturating_mul(c.into()))
246			.saturating_add(T::DbWeight::get().reads(4_u64))
247			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into())))
248			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into())))
249			.saturating_add(Weight::from_parts(0, 2519).saturating_mul(c.into()))
250			.saturating_add(Weight::from_parts(0, 2603).saturating_mul(r.into()))
251	}
252}
253
254
255#[cfg(test)]
256mod tests {
257  use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
258  use crate::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
259  use crate::weights::extrinsic_weights::ExtrinsicBaseWeight;
260
261  #[allow(dead_code)]
262  struct BlockWeights;
263  impl Get<frame_system::limits::BlockWeights> for BlockWeights {
264  	fn get() -> frame_system::limits::BlockWeights {
265  		frame_system::limits::BlockWeights::builder()
266  			.base_block(Weight::zero())
267  			.for_class(DispatchClass::all(), |weights| {
268  				weights.base_extrinsic = ExtrinsicBaseWeight::get();
269  			})
270  			.for_class(DispatchClass::non_mandatory(), |weights| {
271  				weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
272  			})
273  			.build_or_panic()
274  	}
275  }
276
277	#[test]
278	fn test_set_invulnerables() {
279		assert!(
280			BlockWeights::get()
281				.per_class
282				.get(frame_support::dispatch::DispatchClass::Normal)
283				.max_extrinsic
284				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
285				.proof_size()
286				> 1681
287		);
288	}
289	#[test]
290	fn test_add_invulnerable() {
291		assert!(
292			BlockWeights::get()
293				.per_class
294				.get(frame_support::dispatch::DispatchClass::Normal)
295				.max_extrinsic
296				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
297				.proof_size()
298				> 4883
299		);
300	}
301	#[test]
302	fn test_remove_invulnerable() {
303		assert!(
304			BlockWeights::get()
305				.per_class
306				.get(frame_support::dispatch::DispatchClass::Normal)
307				.max_extrinsic
308				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
309				.proof_size()
310				> 4381
311		);
312	}
313	#[test]
314	fn test_set_candidacy_bond() {
315		assert!(
316			BlockWeights::get()
317				.per_class
318				.get(frame_support::dispatch::DispatchClass::Normal)
319				.max_extrinsic
320				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
321				.proof_size()
322				> 4381
323		);
324	}
325	#[test]
326	fn test_update_bond() {
327		assert!(
328			BlockWeights::get()
329				.per_class
330				.get(frame_support::dispatch::DispatchClass::Normal)
331				.max_extrinsic
332				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
333				.proof_size()
334				> 4381
335		);
336	}
337	#[test]
338	fn test_register_as_candidate() {
339		assert!(
340			BlockWeights::get()
341				.per_class
342				.get(frame_support::dispatch::DispatchClass::Normal)
343				.max_extrinsic
344				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
345				.proof_size()
346				> 4571
347		);
348	}
349	#[test]
350	fn test_take_candidate_slot() {
351		assert!(
352			BlockWeights::get()
353				.per_class
354				.get(frame_support::dispatch::DispatchClass::Normal)
355				.max_extrinsic
356				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
357				.proof_size()
358				> 4668
359		);
360	}
361	#[test]
362	fn test_leave_intent() {
363		assert!(
364			BlockWeights::get()
365				.per_class
366				.get(frame_support::dispatch::DispatchClass::Normal)
367				.max_extrinsic
368				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
369				.proof_size()
370				> 4381
371		);
372	}
373	#[test]
374	fn test_note_author() {
375		assert!(
376			BlockWeights::get()
377				.per_class
378				.get(frame_support::dispatch::DispatchClass::Normal)
379				.max_extrinsic
380				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
381				.proof_size()
382				> 6691
383		);
384	}
385	#[test]
386	fn test_new_session() {
387		assert!(
388			BlockWeights::get()
389				.per_class
390				.get(frame_support::dispatch::DispatchClass::Normal)
391				.max_extrinsic
392				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
393				.proof_size()
394				> 4381
395		);
396	}
397}