pallet_collator_selection/
weights.rs

1// This file is part of Astar.
2
3// Copyright (C) Stake Technologies Pte.Ltd.
4// SPDX-License-Identifier: GPL-3.0-or-later
5
6// Astar is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation, either version 3 of the License, or
9// (at your option) any later version.
10
11// Astar is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14// GNU General Public License for more details.
15
16// You should have received a copy of the GNU General Public License
17// along with Astar. If not, see <http://www.gnu.org/licenses/>.
18
19//! Autogenerated weights for `pallet_collator_selection`
20//!
21//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
22//! DATE: 2025-09-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
23//! WORST CASE MAP SIZE: `1000000`
24//! HOSTNAME: `gh-runner-01-ovh`, CPU: `Intel(R) Xeon(R) E-2236 CPU @ 3.40GHz`
25//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024
26
27// Executed Command:
28// frame-omni-bencher
29// v1
30// benchmark
31// pallet
32// --runtime=./target/release/wbuild/astar-runtime/astar_runtime.compact.compressed.wasm
33// --steps=50
34// --repeat=20
35// --pallet=pallet_collator_selection
36// --extrinsic=*
37// --wasm-execution=compiled
38// --heap-pages=4096
39// --json-input=./benchmark-results/astar/json/collator_selection_weights.json
40// --output=./benchmark-results/astar/pallet/collator_selection_weights.rs
41// --template=./scripts/templates/pallet-weight-template.hbs
42
43#![cfg_attr(rustfmt, rustfmt_skip)]
44#![allow(unused_parens)]
45#![allow(unused_imports)]
46#![allow(missing_docs)]
47#![allow(dead_code)]
48
49use frame_support::{traits::Get, weights::{constants::RocksDbWeight, Weight}};
50use core::marker::PhantomData;
51
52/// Weight info trait.
53pub trait WeightInfo {
54	fn set_invulnerables(b: u32, ) -> Weight;
55	fn add_invulnerable(i: u32, ) -> Weight;
56	fn remove_invulnerable(i: u32, ) -> Weight;
57	fn set_desired_candidates() -> Weight;
58	fn set_candidacy_bond() -> Weight;
59	fn register_as_candidate() -> Weight;
60	fn apply_for_candidacy() -> Weight;
61	fn close_application() -> Weight;
62	fn approve_application(c: u32, ) -> Weight;
63	fn kick_candidate(c: u32, ) -> Weight;
64	fn leave_intent(c: u32, ) -> Weight;
65	fn withdraw_bond() -> Weight;
66	fn note_author() -> Weight;
67	fn new_session(r: u32, c: u32, ) -> Weight;
68}
69
70/// Weight functions for `pallet_collator_selection`.
71pub struct SubstrateWeight<T>(PhantomData<T>);
72impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
73	/// The range of component `b` is `[1, 48]`.
74	fn set_invulnerables(b: u32, ) -> Weight {
75		// Proof Size summary in bytes:
76		//  Measured:  `206 + b * (79 ±0)`
77		//  Estimated: `0`
78		// Minimum execution time: 13_662_000 picoseconds.
79		Weight::from_parts(12_508_678, 0)
80			.saturating_add(Weight::from_parts(0, 0))
81			// Standard Error: 4_373
82			.saturating_add(Weight::from_parts(3_129_599, 0).saturating_mul(b.into()))
83			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into())))
84			.saturating_add(T::DbWeight::get().writes(1))
85	}
86	/// The range of component `i` is `[1, 47]`.
87	fn add_invulnerable(i: u32, ) -> Weight {
88		// Proof Size summary in bytes:
89		//  Measured:  `476 + i * (43 ±0)`
90		//  Estimated: `0`
91		// Minimum execution time: 18_549_000 picoseconds.
92		Weight::from_parts(19_653_308, 0)
93			.saturating_add(Weight::from_parts(0, 0))
94			// Standard Error: 1_490
95			.saturating_add(Weight::from_parts(80_814, 0).saturating_mul(i.into()))
96			.saturating_add(T::DbWeight::get().reads(2))
97			.saturating_add(T::DbWeight::get().writes(1))
98	}
99	/// The range of component `i` is `[2, 48]`.
100	fn remove_invulnerable(i: u32, ) -> Weight {
101		// Proof Size summary in bytes:
102		//  Measured:  `153 + i * (32 ±0)`
103		//  Estimated: `0`
104		// Minimum execution time: 12_100_000 picoseconds.
105		Weight::from_parts(12_603_771, 0)
106			.saturating_add(Weight::from_parts(0, 0))
107			// Standard Error: 495
108			.saturating_add(Weight::from_parts(39_389, 0).saturating_mul(i.into()))
109			.saturating_add(T::DbWeight::get().reads(1))
110			.saturating_add(T::DbWeight::get().writes(1))
111	}
112	fn set_desired_candidates() -> Weight {
113		// Proof Size summary in bytes:
114		//  Measured:  `0`
115		//  Estimated: `0`
116		// Minimum execution time: 6_447_000 picoseconds.
117		Weight::from_parts(6_532_000, 0)
118			.saturating_add(Weight::from_parts(0, 0))
119			.saturating_add(T::DbWeight::get().writes(1))
120	}
121	fn set_candidacy_bond() -> Weight {
122		// Proof Size summary in bytes:
123		//  Measured:  `0`
124		//  Estimated: `0`
125		// Minimum execution time: 6_353_000 picoseconds.
126		Weight::from_parts(6_542_000, 0)
127			.saturating_add(Weight::from_parts(0, 0))
128			.saturating_add(T::DbWeight::get().writes(1))
129	}
130	fn register_as_candidate() -> Weight {
131		// Proof Size summary in bytes:
132		//  Measured:  `0`
133		//  Estimated: `0`
134		// Minimum execution time: 5_878_000 picoseconds.
135		Weight::from_parts(6_090_000, 0)
136			.saturating_add(Weight::from_parts(0, 0))
137	}
138	fn apply_for_candidacy() -> Weight {
139		// Proof Size summary in bytes:
140		//  Measured:  `499`
141		//  Estimated: `0`
142		// Minimum execution time: 43_475_000 picoseconds.
143		Weight::from_parts(43_998_000, 0)
144			.saturating_add(Weight::from_parts(0, 0))
145			.saturating_add(T::DbWeight::get().reads(7))
146			.saturating_add(T::DbWeight::get().writes(2))
147	}
148	fn close_application() -> Weight {
149		// Proof Size summary in bytes:
150		//  Measured:  `204`
151		//  Estimated: `0`
152		// Minimum execution time: 25_561_000 picoseconds.
153		Weight::from_parts(25_916_000, 0)
154			.saturating_add(Weight::from_parts(0, 0))
155			.saturating_add(T::DbWeight::get().reads(1))
156			.saturating_add(T::DbWeight::get().writes(1))
157	}
158	/// The range of component `c` is `[1, 148]`.
159	fn approve_application(c: u32, ) -> Weight {
160		// Proof Size summary in bytes:
161		//  Measured:  `951 + c * (50 ±0)`
162		//  Estimated: `0`
163		// Minimum execution time: 28_312_000 picoseconds.
164		Weight::from_parts(29_571_535, 0)
165			.saturating_add(Weight::from_parts(0, 0))
166			// Standard Error: 591
167			.saturating_add(Weight::from_parts(57_387, 0).saturating_mul(c.into()))
168			.saturating_add(T::DbWeight::get().reads(4))
169			.saturating_add(T::DbWeight::get().writes(3))
170	}
171	/// The range of component `c` is `[6, 148]`.
172	fn kick_candidate(c: u32, ) -> Weight {
173		// Proof Size summary in bytes:
174		//  Measured:  `892 + c * (50 ±0)`
175		//  Estimated: `0`
176		// Minimum execution time: 54_899_000 picoseconds.
177		Weight::from_parts(56_992_252, 0)
178			.saturating_add(Weight::from_parts(0, 0))
179			// Standard Error: 1_033
180			.saturating_add(Weight::from_parts(57_441, 0).saturating_mul(c.into()))
181			.saturating_add(T::DbWeight::get().reads(3))
182			.saturating_add(T::DbWeight::get().writes(3))
183	}
184	/// The range of component `c` is `[6, 148]`.
185	fn leave_intent(c: u32, ) -> Weight {
186		// Proof Size summary in bytes:
187		//  Measured:  `735 + c * (48 ±0)`
188		//  Estimated: `0`
189		// Minimum execution time: 18_218_000 picoseconds.
190		Weight::from_parts(19_010_015, 0)
191			.saturating_add(Weight::from_parts(0, 0))
192			// Standard Error: 476
193			.saturating_add(Weight::from_parts(49_506, 0).saturating_mul(c.into()))
194			.saturating_add(T::DbWeight::get().reads(2))
195			.saturating_add(T::DbWeight::get().writes(2))
196	}
197	fn withdraw_bond() -> Weight {
198		// Proof Size summary in bytes:
199		//  Measured:  `759`
200		//  Estimated: `0`
201		// Minimum execution time: 33_250_000 picoseconds.
202		Weight::from_parts(33_638_000, 0)
203			.saturating_add(Weight::from_parts(0, 0))
204			.saturating_add(T::DbWeight::get().reads(2))
205			.saturating_add(T::DbWeight::get().writes(2))
206	}
207	fn note_author() -> Weight {
208		// Proof Size summary in bytes:
209		//  Measured:  `259`
210		//  Estimated: `0`
211		// Minimum execution time: 44_741_000 picoseconds.
212		Weight::from_parts(45_029_000, 0)
213			.saturating_add(Weight::from_parts(0, 0))
214			.saturating_add(T::DbWeight::get().reads(2))
215			.saturating_add(T::DbWeight::get().writes(3))
216	}
217	/// The range of component `r` is `[1, 148]`.
218	/// The range of component `c` is `[1, 148]`.
219	fn new_session(_r: u32, c: u32, ) -> Weight {
220		// Proof Size summary in bytes:
221		//  Measured:  `4688 + c * (97 ±0) + r * (112 ±0)`
222		//  Estimated: `0`
223		// Minimum execution time: 25_341_000 picoseconds.
224		Weight::from_parts(25_767_000, 0)
225			.saturating_add(Weight::from_parts(0, 0))
226			// Standard Error: 656_944
227			.saturating_add(Weight::from_parts(21_823_460, 0).saturating_mul(c.into()))
228			.saturating_add(T::DbWeight::get().reads(4))
229			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into())))
230			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into())))
231	}
232}
233
234/// Weights for tests
235impl WeightInfo for () {
236	/// The range of component `b` is `[1, 48]`.
237	fn set_invulnerables(b: u32, ) -> Weight {
238		// Proof Size summary in bytes:
239		//  Measured:  `206 + b * (79 ±0)`
240		//  Estimated: `0`
241		// Minimum execution time: 13_662_000 picoseconds.
242		Weight::from_parts(12_508_678, 0)
243			.saturating_add(Weight::from_parts(0, 0))
244			// Standard Error: 4_373
245			.saturating_add(Weight::from_parts(3_129_599, 0).saturating_mul(b.into()))
246			.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(b.into())))
247			.saturating_add(RocksDbWeight::get().writes(1))
248	}
249	/// The range of component `i` is `[1, 47]`.
250	fn add_invulnerable(i: u32, ) -> Weight {
251		// Proof Size summary in bytes:
252		//  Measured:  `476 + i * (43 ±0)`
253		//  Estimated: `0`
254		// Minimum execution time: 18_549_000 picoseconds.
255		Weight::from_parts(19_653_308, 0)
256			.saturating_add(Weight::from_parts(0, 0))
257			// Standard Error: 1_490
258			.saturating_add(Weight::from_parts(80_814, 0).saturating_mul(i.into()))
259			.saturating_add(RocksDbWeight::get().reads(2))
260			.saturating_add(RocksDbWeight::get().writes(1))
261	}
262	/// The range of component `i` is `[2, 48]`.
263	fn remove_invulnerable(i: u32, ) -> Weight {
264		// Proof Size summary in bytes:
265		//  Measured:  `153 + i * (32 ±0)`
266		//  Estimated: `0`
267		// Minimum execution time: 12_100_000 picoseconds.
268		Weight::from_parts(12_603_771, 0)
269			.saturating_add(Weight::from_parts(0, 0))
270			// Standard Error: 495
271			.saturating_add(Weight::from_parts(39_389, 0).saturating_mul(i.into()))
272			.saturating_add(RocksDbWeight::get().reads(1))
273			.saturating_add(RocksDbWeight::get().writes(1))
274	}
275	fn set_desired_candidates() -> Weight {
276		// Proof Size summary in bytes:
277		//  Measured:  `0`
278		//  Estimated: `0`
279		// Minimum execution time: 6_447_000 picoseconds.
280		Weight::from_parts(6_532_000, 0)
281			.saturating_add(Weight::from_parts(0, 0))
282			.saturating_add(RocksDbWeight::get().writes(1))
283	}
284	fn set_candidacy_bond() -> Weight {
285		// Proof Size summary in bytes:
286		//  Measured:  `0`
287		//  Estimated: `0`
288		// Minimum execution time: 6_353_000 picoseconds.
289		Weight::from_parts(6_542_000, 0)
290			.saturating_add(Weight::from_parts(0, 0))
291			.saturating_add(RocksDbWeight::get().writes(1))
292	}
293	fn register_as_candidate() -> Weight {
294		// Proof Size summary in bytes:
295		//  Measured:  `0`
296		//  Estimated: `0`
297		// Minimum execution time: 5_878_000 picoseconds.
298		Weight::from_parts(6_090_000, 0)
299			.saturating_add(Weight::from_parts(0, 0))
300	}
301	fn apply_for_candidacy() -> Weight {
302		// Proof Size summary in bytes:
303		//  Measured:  `499`
304		//  Estimated: `0`
305		// Minimum execution time: 43_475_000 picoseconds.
306		Weight::from_parts(43_998_000, 0)
307			.saturating_add(Weight::from_parts(0, 0))
308			.saturating_add(RocksDbWeight::get().reads(7))
309			.saturating_add(RocksDbWeight::get().writes(2))
310	}
311	fn close_application() -> Weight {
312		// Proof Size summary in bytes:
313		//  Measured:  `204`
314		//  Estimated: `0`
315		// Minimum execution time: 25_561_000 picoseconds.
316		Weight::from_parts(25_916_000, 0)
317			.saturating_add(Weight::from_parts(0, 0))
318			.saturating_add(RocksDbWeight::get().reads(1))
319			.saturating_add(RocksDbWeight::get().writes(1))
320	}
321	/// The range of component `c` is `[1, 148]`.
322	fn approve_application(c: u32, ) -> Weight {
323		// Proof Size summary in bytes:
324		//  Measured:  `951 + c * (50 ±0)`
325		//  Estimated: `0`
326		// Minimum execution time: 28_312_000 picoseconds.
327		Weight::from_parts(29_571_535, 0)
328			.saturating_add(Weight::from_parts(0, 0))
329			// Standard Error: 591
330			.saturating_add(Weight::from_parts(57_387, 0).saturating_mul(c.into()))
331			.saturating_add(RocksDbWeight::get().reads(4))
332			.saturating_add(RocksDbWeight::get().writes(3))
333	}
334	/// The range of component `c` is `[6, 148]`.
335	fn kick_candidate(c: u32, ) -> Weight {
336		// Proof Size summary in bytes:
337		//  Measured:  `892 + c * (50 ±0)`
338		//  Estimated: `0`
339		// Minimum execution time: 54_899_000 picoseconds.
340		Weight::from_parts(56_992_252, 0)
341			.saturating_add(Weight::from_parts(0, 0))
342			// Standard Error: 1_033
343			.saturating_add(Weight::from_parts(57_441, 0).saturating_mul(c.into()))
344			.saturating_add(RocksDbWeight::get().reads(3))
345			.saturating_add(RocksDbWeight::get().writes(3))
346	}
347	/// The range of component `c` is `[6, 148]`.
348	fn leave_intent(c: u32, ) -> Weight {
349		// Proof Size summary in bytes:
350		//  Measured:  `735 + c * (48 ±0)`
351		//  Estimated: `0`
352		// Minimum execution time: 18_218_000 picoseconds.
353		Weight::from_parts(19_010_015, 0)
354			.saturating_add(Weight::from_parts(0, 0))
355			// Standard Error: 476
356			.saturating_add(Weight::from_parts(49_506, 0).saturating_mul(c.into()))
357			.saturating_add(RocksDbWeight::get().reads(2))
358			.saturating_add(RocksDbWeight::get().writes(2))
359	}
360	fn withdraw_bond() -> Weight {
361		// Proof Size summary in bytes:
362		//  Measured:  `759`
363		//  Estimated: `0`
364		// Minimum execution time: 33_250_000 picoseconds.
365		Weight::from_parts(33_638_000, 0)
366			.saturating_add(Weight::from_parts(0, 0))
367			.saturating_add(RocksDbWeight::get().reads(2))
368			.saturating_add(RocksDbWeight::get().writes(2))
369	}
370	fn note_author() -> Weight {
371		// Proof Size summary in bytes:
372		//  Measured:  `259`
373		//  Estimated: `0`
374		// Minimum execution time: 44_741_000 picoseconds.
375		Weight::from_parts(45_029_000, 0)
376			.saturating_add(Weight::from_parts(0, 0))
377			.saturating_add(RocksDbWeight::get().reads(2))
378			.saturating_add(RocksDbWeight::get().writes(3))
379	}
380	/// The range of component `r` is `[1, 148]`.
381	/// The range of component `c` is `[1, 148]`.
382	fn new_session(_r: u32, c: u32, ) -> Weight {
383		// Proof Size summary in bytes:
384		//  Measured:  `4688 + c * (97 ±0) + r * (112 ±0)`
385		//  Estimated: `0`
386		// Minimum execution time: 25_341_000 picoseconds.
387		Weight::from_parts(25_767_000, 0)
388			.saturating_add(Weight::from_parts(0, 0))
389			// Standard Error: 656_944
390			.saturating_add(Weight::from_parts(21_823_460, 0).saturating_mul(c.into()))
391			.saturating_add(RocksDbWeight::get().reads(4))
392			.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(c.into())))
393			.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(c.into())))
394	}
395}