common_runtime/weights/
pallet_preimage.rs

1//! Autogenerated weights for pallet_preimage
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_preimage
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_preimage` using the Substrate node and recommended hardware.
34pub struct SubstrateWeight<T>(PhantomData<T>);
35impl<T: frame_system::Config> pallet_preimage::WeightInfo for SubstrateWeight<T> {
36	/// Storage: `Preimage::StatusFor` (r:1 w:0)
37	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
38	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
39	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
40	/// Storage: `Balances::Holds` (r:1 w:1)
41	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`)
42	/// Storage: `Preimage::PreimageFor` (r:0 w:1)
43	/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
44	/// The range of component `s` is `[0, 4194304]`.
45	fn note_preimage(s: u32, ) -> Weight {
46		// Proof Size summary in bytes:
47		//  Measured:  `4`
48		//  Estimated: `4051`
49		// Minimum execution time: 47_787_000 picoseconds.
50		Weight::from_parts(48_496_000, 4051)
51			// Standard Error: 6
52			.saturating_add(Weight::from_parts(2_715, 0).saturating_mul(s.into()))
53			.saturating_add(T::DbWeight::get().reads(3_u64))
54			.saturating_add(T::DbWeight::get().writes(3_u64))
55	}
56	/// Storage: `Preimage::StatusFor` (r:1 w:0)
57	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
58	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
59	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
60	/// Storage: `Preimage::PreimageFor` (r:0 w:1)
61	/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
62	/// The range of component `s` is `[0, 4194304]`.
63	fn note_requested_preimage(s: u32, ) -> Weight {
64		// Proof Size summary in bytes:
65		//  Measured:  `68`
66		//  Estimated: `4051`
67		// Minimum execution time: 17_407_000 picoseconds.
68		Weight::from_parts(17_813_000, 4051)
69			// Standard Error: 5
70			.saturating_add(Weight::from_parts(2_697, 0).saturating_mul(s.into()))
71			.saturating_add(T::DbWeight::get().reads(2_u64))
72			.saturating_add(T::DbWeight::get().writes(2_u64))
73	}
74	/// Storage: `Preimage::StatusFor` (r:1 w:0)
75	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
76	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
77	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
78	/// Storage: `Preimage::PreimageFor` (r:0 w:1)
79	/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
80	/// The range of component `s` is `[0, 4194304]`.
81	fn note_no_deposit_preimage(s: u32, ) -> Weight {
82		// Proof Size summary in bytes:
83		//  Measured:  `68`
84		//  Estimated: `4051`
85		// Minimum execution time: 15_067_000 picoseconds.
86		Weight::from_parts(15_632_000, 4051)
87			// Standard Error: 5
88			.saturating_add(Weight::from_parts(2_705, 0).saturating_mul(s.into()))
89			.saturating_add(T::DbWeight::get().reads(2_u64))
90			.saturating_add(T::DbWeight::get().writes(2_u64))
91	}
92	/// Storage: `Preimage::StatusFor` (r:1 w:0)
93	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
94	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
95	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
96	/// Storage: `Balances::Holds` (r:1 w:1)
97	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`)
98	/// Storage: `Preimage::PreimageFor` (r:0 w:1)
99	/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
100	fn unnote_preimage() -> Weight {
101		// Proof Size summary in bytes:
102		//  Measured:  `205`
103		//  Estimated: `4051`
104		// Minimum execution time: 71_672_000 picoseconds.
105		Weight::from_parts(74_639_000, 4051)
106			.saturating_add(T::DbWeight::get().reads(3_u64))
107			.saturating_add(T::DbWeight::get().writes(3_u64))
108	}
109	/// Storage: `Preimage::StatusFor` (r:1 w:0)
110	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
111	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
112	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
113	/// Storage: `Preimage::PreimageFor` (r:0 w:1)
114	/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
115	fn unnote_no_deposit_preimage() -> Weight {
116		// Proof Size summary in bytes:
117		//  Measured:  `106`
118		//  Estimated: `4051`
119		// Minimum execution time: 33_674_000 picoseconds.
120		Weight::from_parts(35_352_000, 4051)
121			.saturating_add(T::DbWeight::get().reads(2_u64))
122			.saturating_add(T::DbWeight::get().writes(2_u64))
123	}
124	/// Storage: `Preimage::StatusFor` (r:1 w:0)
125	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
126	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
127	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
128	fn request_preimage() -> Weight {
129		// Proof Size summary in bytes:
130		//  Measured:  `150`
131		//  Estimated: `4051`
132		// Minimum execution time: 30_748_000 picoseconds.
133		Weight::from_parts(33_457_000, 4051)
134			.saturating_add(T::DbWeight::get().reads(2_u64))
135			.saturating_add(T::DbWeight::get().writes(1_u64))
136	}
137	/// Storage: `Preimage::StatusFor` (r:1 w:0)
138	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
139	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
140	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
141	fn request_no_deposit_preimage() -> Weight {
142		// Proof Size summary in bytes:
143		//  Measured:  `106`
144		//  Estimated: `4051`
145		// Minimum execution time: 20_283_000 picoseconds.
146		Weight::from_parts(21_641_000, 4051)
147			.saturating_add(T::DbWeight::get().reads(2_u64))
148			.saturating_add(T::DbWeight::get().writes(1_u64))
149	}
150	/// Storage: `Preimage::StatusFor` (r:1 w:0)
151	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
152	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
153	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
154	fn request_unnoted_preimage() -> Weight {
155		// Proof Size summary in bytes:
156		//  Measured:  `4`
157		//  Estimated: `4051`
158		// Minimum execution time: 18_729_000 picoseconds.
159		Weight::from_parts(21_159_000, 4051)
160			.saturating_add(T::DbWeight::get().reads(2_u64))
161			.saturating_add(T::DbWeight::get().writes(1_u64))
162	}
163	/// Storage: `Preimage::StatusFor` (r:1 w:0)
164	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
165	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
166	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
167	fn request_requested_preimage() -> Weight {
168		// Proof Size summary in bytes:
169		//  Measured:  `68`
170		//  Estimated: `4051`
171		// Minimum execution time: 10_907_000 picoseconds.
172		Weight::from_parts(11_884_000, 4051)
173			.saturating_add(T::DbWeight::get().reads(2_u64))
174			.saturating_add(T::DbWeight::get().writes(1_u64))
175	}
176	/// Storage: `Preimage::StatusFor` (r:1 w:0)
177	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
178	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
179	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
180	/// Storage: `Preimage::PreimageFor` (r:0 w:1)
181	/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
182	fn unrequest_preimage() -> Weight {
183		// Proof Size summary in bytes:
184		//  Measured:  `106`
185		//  Estimated: `4051`
186		// Minimum execution time: 29_880_000 picoseconds.
187		Weight::from_parts(32_035_000, 4051)
188			.saturating_add(T::DbWeight::get().reads(2_u64))
189			.saturating_add(T::DbWeight::get().writes(2_u64))
190	}
191	/// Storage: `Preimage::StatusFor` (r:1 w:0)
192	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
193	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
194	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
195	fn unrequest_unnoted_preimage() -> Weight {
196		// Proof Size summary in bytes:
197		//  Measured:  `68`
198		//  Estimated: `4051`
199		// Minimum execution time: 11_524_000 picoseconds.
200		Weight::from_parts(12_369_000, 4051)
201			.saturating_add(T::DbWeight::get().reads(2_u64))
202			.saturating_add(T::DbWeight::get().writes(1_u64))
203	}
204	/// Storage: `Preimage::StatusFor` (r:1 w:0)
205	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
206	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
207	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
208	fn unrequest_multi_referenced_preimage() -> Weight {
209		// Proof Size summary in bytes:
210		//  Measured:  `68`
211		//  Estimated: `4051`
212		// Minimum execution time: 10_974_000 picoseconds.
213		Weight::from_parts(11_929_000, 4051)
214			.saturating_add(T::DbWeight::get().reads(2_u64))
215			.saturating_add(T::DbWeight::get().writes(1_u64))
216	}
217	/// Storage: `Preimage::StatusFor` (r:1023 w:1023)
218	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
219	/// Storage: `System::Account` (r:1023 w:1023)
220	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
221	/// Storage: `Balances::Holds` (r:1023 w:1023)
222	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`)
223	/// Storage: `Preimage::RequestStatusFor` (r:0 w:1023)
224	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
225	/// The range of component `n` is `[1, 1024]`.
226	fn ensure_updated(n: u32, ) -> Weight {
227		// Proof Size summary in bytes:
228		//  Measured:  `0 + n * (227 ±0)`
229		//  Estimated: `1485 + n * (2603 ±0)`
230		// Minimum execution time: 55_997_000 picoseconds.
231		Weight::from_parts(56_634_000, 1485)
232			// Standard Error: 90_648
233			.saturating_add(Weight::from_parts(56_501_608, 0).saturating_mul(n.into()))
234			.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into())))
235			.saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(n.into())))
236			.saturating_add(Weight::from_parts(0, 2603).saturating_mul(n.into()))
237	}
238}
239
240
241#[cfg(test)]
242mod tests {
243  use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
244  use crate::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
245  use crate::weights::extrinsic_weights::ExtrinsicBaseWeight;
246
247  #[allow(dead_code)]
248  struct BlockWeights;
249  impl Get<frame_system::limits::BlockWeights> for BlockWeights {
250  	fn get() -> frame_system::limits::BlockWeights {
251  		frame_system::limits::BlockWeights::builder()
252  			.base_block(Weight::zero())
253  			.for_class(DispatchClass::all(), |weights| {
254  				weights.base_extrinsic = ExtrinsicBaseWeight::get();
255  			})
256  			.for_class(DispatchClass::non_mandatory(), |weights| {
257  				weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
258  			})
259  			.build_or_panic()
260  	}
261  }
262
263	#[test]
264	fn test_note_preimage() {
265		assert!(
266			BlockWeights::get()
267				.per_class
268				.get(frame_support::dispatch::DispatchClass::Normal)
269				.max_extrinsic
270				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
271				.proof_size()
272				> 4051
273		);
274	}
275	#[test]
276	fn test_note_requested_preimage() {
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				> 4051
285		);
286	}
287	#[test]
288	fn test_note_no_deposit_preimage() {
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				> 4051
297		);
298	}
299	#[test]
300	fn test_unnote_preimage() {
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				> 4051
309		);
310	}
311	#[test]
312	fn test_unnote_no_deposit_preimage() {
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				> 4051
321		);
322	}
323	#[test]
324	fn test_request_preimage() {
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				> 4051
333		);
334	}
335	#[test]
336	fn test_request_no_deposit_preimage() {
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				> 4051
345		);
346	}
347	#[test]
348	fn test_request_unnoted_preimage() {
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				> 4051
357		);
358	}
359	#[test]
360	fn test_request_requested_preimage() {
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				> 4051
369		);
370	}
371	#[test]
372	fn test_unrequest_preimage() {
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				> 4051
381		);
382	}
383	#[test]
384	fn test_unrequest_unnoted_preimage() {
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				> 4051
393		);
394	}
395	#[test]
396	fn test_unrequest_multi_referenced_preimage() {
397		assert!(
398			BlockWeights::get()
399				.per_class
400				.get(frame_support::dispatch::DispatchClass::Normal)
401				.max_extrinsic
402				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
403				.proof_size()
404				> 4051
405		);
406	}
407	#[test]
408	fn test_ensure_updated() {
409		assert!(
410			BlockWeights::get()
411				.per_class
412				.get(frame_support::dispatch::DispatchClass::Normal)
413				.max_extrinsic
414				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
415				.proof_size()
416				> 1485
417		);
418	}
419}