pallet_handles/
weights.rs

1
2//! Autogenerated weights for `pallet_handles`
3//!
4//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0
5//! DATE: 2025-08-20, STEPS: `20`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
6//! WORST CASE MAP SIZE: `1000000`
7//! HOSTNAME: `ip-10-173-5-194`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
8//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
9
10// Executed Command:
11// ./scripts/../target/release/frequency
12// benchmark
13// pallet
14// --pallet=pallet_handles
15// --extrinsic
16// *
17// --heap-pages=4096
18// --steps=20
19// --repeat=10
20// --output=./scripts/../pallets/handles/src/weights.rs
21// --template=./scripts/../.maintain/frame-weight-template.hbs
22// --additional-trie-layers=3
23// --runtime=./scripts/../target/release/wbuild/frequency-runtime/frequency_runtime.wasm
24// --genesis-builder=runtime
25
26#![cfg_attr(rustfmt, rustfmt_skip)]
27#![allow(unused_parens)]
28#![allow(unused_imports)]
29#![allow(missing_docs)]
30
31use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
32use core::marker::PhantomData;
33
34/// Weight functions needed for `pallet_handles`.
35pub trait WeightInfo {
36	fn claim_handle(b: u32, ) -> Weight;
37	fn change_handle(b: u32, ) -> Weight;
38	fn retire_handle() -> Weight;
39	fn validate_retire_handle_benchmark() -> Weight;
40}
41
42/// Weights for `pallet_handles` using the Substrate node and recommended hardware.
43pub struct SubstrateWeight<T>(PhantomData<T>);
44impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
45	/// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
46	/// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
47	/// Storage: `Handles::MSAIdToDisplayName` (r:1 w:1)
48	/// Proof: `Handles::MSAIdToDisplayName` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`)
49	/// Storage: `Handles::CanonicalBaseHandleToSuffixIndex` (r:1 w:1)
50	/// Proof: `Handles::CanonicalBaseHandleToSuffixIndex` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`)
51	/// Storage: `Handles::CanonicalBaseHandleAndSuffixToMSAId` (r:0 w:1)
52	/// Proof: `Handles::CanonicalBaseHandleAndSuffixToMSAId` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
53	/// The range of component `b` is `[3, 30]`.
54	fn claim_handle(b: u32, ) -> Weight {
55		// Proof Size summary in bytes:
56		//  Measured:  `116`
57		//  Estimated: `4019`
58		// Minimum execution time: 108_870_000 picoseconds.
59		Weight::from_parts(113_662_784, 4019)
60			// Standard Error: 36_032
61			.saturating_add(Weight::from_parts(87_546, 0).saturating_mul(b.into()))
62			.saturating_add(T::DbWeight::get().reads(3_u64))
63			.saturating_add(T::DbWeight::get().writes(3_u64))
64	}
65	/// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
66	/// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
67	/// Storage: `Handles::MSAIdToDisplayName` (r:1 w:1)
68	/// Proof: `Handles::MSAIdToDisplayName` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`)
69	/// Storage: `Handles::CanonicalBaseHandleToSuffixIndex` (r:1 w:1)
70	/// Proof: `Handles::CanonicalBaseHandleToSuffixIndex` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`)
71	/// Storage: `Handles::CanonicalBaseHandleAndSuffixToMSAId` (r:0 w:2)
72	/// Proof: `Handles::CanonicalBaseHandleAndSuffixToMSAId` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
73	/// The range of component `b` is `[3, 30]`.
74	fn change_handle(b: u32, ) -> Weight {
75		// Proof Size summary in bytes:
76		//  Measured:  `222 + b * (1 ±0)`
77		//  Estimated: `4019`
78		// Minimum execution time: 118_749_000 picoseconds.
79		Weight::from_parts(123_074_608, 4019)
80			// Standard Error: 43_648
81			.saturating_add(Weight::from_parts(123_265, 0).saturating_mul(b.into()))
82			.saturating_add(T::DbWeight::get().reads(3_u64))
83			.saturating_add(T::DbWeight::get().writes(4_u64))
84	}
85	/// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
86	/// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
87	/// Storage: `Handles::MSAIdToDisplayName` (r:1 w:1)
88	/// Proof: `Handles::MSAIdToDisplayName` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`)
89	/// Storage: `Handles::CanonicalBaseHandleAndSuffixToMSAId` (r:0 w:1)
90	/// Proof: `Handles::CanonicalBaseHandleAndSuffixToMSAId` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
91	fn retire_handle() -> Weight {
92		// Proof Size summary in bytes:
93		//  Measured:  `231`
94		//  Estimated: `4019`
95		// Minimum execution time: 24_809_000 picoseconds.
96		Weight::from_parts(26_113_000, 4019)
97			.saturating_add(T::DbWeight::get().reads(2_u64))
98			.saturating_add(T::DbWeight::get().writes(2_u64))
99	}
100	/// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
101	/// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
102	/// Storage: `Handles::MSAIdToDisplayName` (r:1 w:0)
103	/// Proof: `Handles::MSAIdToDisplayName` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`)
104	fn validate_retire_handle_benchmark() -> Weight {
105		// Proof Size summary in bytes:
106		//  Measured:  `231`
107		//  Estimated: `4019`
108		// Minimum execution time: 12_427_000 picoseconds.
109		Weight::from_parts(13_125_000, 4019)
110			.saturating_add(T::DbWeight::get().reads(2_u64))
111	}
112}
113
114// For backwards compatibility and tests.
115impl WeightInfo for () {
116	/// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
117	/// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
118	/// Storage: `Handles::MSAIdToDisplayName` (r:1 w:1)
119	/// Proof: `Handles::MSAIdToDisplayName` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`)
120	/// Storage: `Handles::CanonicalBaseHandleToSuffixIndex` (r:1 w:1)
121	/// Proof: `Handles::CanonicalBaseHandleToSuffixIndex` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`)
122	/// Storage: `Handles::CanonicalBaseHandleAndSuffixToMSAId` (r:0 w:1)
123	/// Proof: `Handles::CanonicalBaseHandleAndSuffixToMSAId` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
124	/// The range of component `b` is `[3, 30]`.
125	fn claim_handle(b: u32, ) -> Weight {
126		// Proof Size summary in bytes:
127		//  Measured:  `116`
128		//  Estimated: `4019`
129		// Minimum execution time: 108_870_000 picoseconds.
130		Weight::from_parts(113_662_784, 4019)
131			// Standard Error: 36_032
132			.saturating_add(Weight::from_parts(87_546, 0).saturating_mul(b.into()))
133			.saturating_add(RocksDbWeight::get().reads(3_u64))
134			.saturating_add(RocksDbWeight::get().writes(3_u64))
135	}
136	/// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
137	/// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
138	/// Storage: `Handles::MSAIdToDisplayName` (r:1 w:1)
139	/// Proof: `Handles::MSAIdToDisplayName` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`)
140	/// Storage: `Handles::CanonicalBaseHandleToSuffixIndex` (r:1 w:1)
141	/// Proof: `Handles::CanonicalBaseHandleToSuffixIndex` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`)
142	/// Storage: `Handles::CanonicalBaseHandleAndSuffixToMSAId` (r:0 w:2)
143	/// Proof: `Handles::CanonicalBaseHandleAndSuffixToMSAId` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
144	/// The range of component `b` is `[3, 30]`.
145	fn change_handle(b: u32, ) -> Weight {
146		// Proof Size summary in bytes:
147		//  Measured:  `222 + b * (1 ±0)`
148		//  Estimated: `4019`
149		// Minimum execution time: 118_749_000 picoseconds.
150		Weight::from_parts(123_074_608, 4019)
151			// Standard Error: 43_648
152			.saturating_add(Weight::from_parts(123_265, 0).saturating_mul(b.into()))
153			.saturating_add(RocksDbWeight::get().reads(3_u64))
154			.saturating_add(RocksDbWeight::get().writes(4_u64))
155	}
156	/// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
157	/// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
158	/// Storage: `Handles::MSAIdToDisplayName` (r:1 w:1)
159	/// Proof: `Handles::MSAIdToDisplayName` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`)
160	/// Storage: `Handles::CanonicalBaseHandleAndSuffixToMSAId` (r:0 w:1)
161	/// Proof: `Handles::CanonicalBaseHandleAndSuffixToMSAId` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
162	fn retire_handle() -> Weight {
163		// Proof Size summary in bytes:
164		//  Measured:  `231`
165		//  Estimated: `4019`
166		// Minimum execution time: 24_809_000 picoseconds.
167		Weight::from_parts(26_113_000, 4019)
168			.saturating_add(RocksDbWeight::get().reads(2_u64))
169			.saturating_add(RocksDbWeight::get().writes(2_u64))
170	}
171	/// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
172	/// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
173	/// Storage: `Handles::MSAIdToDisplayName` (r:1 w:0)
174	/// Proof: `Handles::MSAIdToDisplayName` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`)
175	fn validate_retire_handle_benchmark() -> Weight {
176		// Proof Size summary in bytes:
177		//  Measured:  `231`
178		//  Estimated: `4019`
179		// Minimum execution time: 12_427_000 picoseconds.
180		Weight::from_parts(13_125_000, 4019)
181			.saturating_add(RocksDbWeight::get().reads(2_u64))
182	}
183}
184
185
186#[cfg(test)]
187mod tests {
188  use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
189  use common_runtime::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
190  use common_runtime::weights::extrinsic_weights::ExtrinsicBaseWeight;
191
192  #[allow(dead_code)]
193  struct BlockWeights;
194  impl Get<frame_system::limits::BlockWeights> for BlockWeights {
195  	fn get() -> frame_system::limits::BlockWeights {
196  		frame_system::limits::BlockWeights::builder()
197  			.base_block(Weight::zero())
198  			.for_class(DispatchClass::all(), |weights| {
199  				weights.base_extrinsic = ExtrinsicBaseWeight::get();
200  			})
201  			.for_class(DispatchClass::non_mandatory(), |weights| {
202  				weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
203  			})
204  			.build_or_panic()
205  	}
206  }
207
208	#[test]
209	fn test_claim_handle() {
210		assert!(
211			BlockWeights::get()
212				.per_class
213				.get(frame_support::dispatch::DispatchClass::Normal)
214				.max_extrinsic
215				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
216				.proof_size()
217				> 4019
218		);
219	}
220	#[test]
221	fn test_change_handle() {
222		assert!(
223			BlockWeights::get()
224				.per_class
225				.get(frame_support::dispatch::DispatchClass::Normal)
226				.max_extrinsic
227				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
228				.proof_size()
229				> 4019
230		);
231	}
232	#[test]
233	fn test_retire_handle() {
234		assert!(
235			BlockWeights::get()
236				.per_class
237				.get(frame_support::dispatch::DispatchClass::Normal)
238				.max_extrinsic
239				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
240				.proof_size()
241				> 4019
242		);
243	}
244	#[test]
245	fn test_validate_retire_handle_benchmark() {
246		assert!(
247			BlockWeights::get()
248				.per_class
249				.get(frame_support::dispatch::DispatchClass::Normal)
250				.max_extrinsic
251				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
252				.proof_size()
253				> 4019
254		);
255	}
256}