common_runtime/weights/
cumulus_pallet_xcmp_queue.rs

1//! Autogenerated weights for cumulus_pallet_xcmp_queue
2//!
3//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0
4//! DATE: 2025-10-03, 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=cumulus_pallet_xcmp_queue
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 `cumulus_pallet_xcmp_queue` using the Substrate node and recommended hardware.
34pub struct SubstrateWeight<T>(PhantomData<T>);
35impl<T: frame_system::Config> cumulus_pallet_xcmp_queue::WeightInfo for SubstrateWeight<T> {
36	/// Storage: `XcmpQueue::QueueConfig` (r:1 w:1)
37	/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`)
38	fn set_config_with_u32() -> Weight {
39		// Proof Size summary in bytes:
40		//  Measured:  `76`
41		//  Estimated: `1992`
42		// Minimum execution time: 5_091_000 picoseconds.
43		Weight::from_parts(5_433_000, 1992)
44			.saturating_add(T::DbWeight::get().reads(1_u64))
45			.saturating_add(T::DbWeight::get().writes(1_u64))
46	}
47	/// Storage: `XcmpQueue::QueueConfig` (r:1 w:0)
48	/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`)
49	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
50	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
51	/// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
52	/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`)
53	/// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0)
54	/// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`)
55	/// Storage: `MessageQueue::Pages` (r:0 w:1)
56	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
57	/// The range of component `n` is `[0, 105467]`.
58	fn enqueue_n_bytes_xcmp_message(n: u32, ) -> Weight {
59		// Proof Size summary in bytes:
60		//  Measured:  `82`
61		//  Estimated: `5982`
62		// Minimum execution time: 13_711_000 picoseconds.
63		Weight::from_parts(10_684_081, 5982)
64			// Standard Error: 5
65			.saturating_add(Weight::from_parts(967, 0).saturating_mul(n.into()))
66			.saturating_add(T::DbWeight::get().reads(4_u64))
67			.saturating_add(T::DbWeight::get().writes(3_u64))
68	}
69	/// Storage: `XcmpQueue::QueueConfig` (r:1 w:0)
70	/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`)
71	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
72	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
73	/// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
74	/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`)
75	/// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0)
76	/// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`)
77	/// Storage: `MessageQueue::Pages` (r:0 w:1)
78	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
79	/// The range of component `n` is `[0, 1000]`.
80	fn enqueue_n_empty_xcmp_messages(n: u32, ) -> Weight {
81		// Proof Size summary in bytes:
82		//  Measured:  `82`
83		//  Estimated: `5982`
84		// Minimum execution time: 10_964_000 picoseconds.
85		Weight::from_parts(16_002_800, 5982)
86			// Standard Error: 239
87			.saturating_add(Weight::from_parts(121_756, 0).saturating_mul(n.into()))
88			.saturating_add(T::DbWeight::get().reads(4_u64))
89			.saturating_add(T::DbWeight::get().writes(3_u64))
90	}
91	/// Storage: `XcmpQueue::QueueConfig` (r:1 w:0)
92	/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`)
93	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
94	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
95	/// Storage: `MessageQueue::Pages` (r:1 w:1)
96	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
97	/// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0)
98	/// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`)
99	/// The range of component `n` is `[0, 105457]`.
100	fn enqueue_empty_xcmp_message_at(n: u32, ) -> Weight {
101		// Proof Size summary in bytes:
102		//  Measured:  `264 + n * (1 ±0)`
103		//  Estimated: `109481`
104		// Minimum execution time: 22_291_000 picoseconds.
105		Weight::from_parts(16_274_659, 109481)
106			// Standard Error: 12
107			.saturating_add(Weight::from_parts(2_145, 0).saturating_mul(n.into()))
108			.saturating_add(T::DbWeight::get().reads(4_u64))
109			.saturating_add(T::DbWeight::get().writes(2_u64))
110	}
111	/// Storage: `XcmpQueue::QueueConfig` (r:1 w:0)
112	/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`)
113	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
114	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
115	/// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
116	/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`)
117	/// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0)
118	/// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`)
119	/// Storage: `MessageQueue::Pages` (r:0 w:100)
120	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
121	/// The range of component `n` is `[0, 100]`.
122	fn enqueue_n_full_pages(n: u32, ) -> Weight {
123		// Proof Size summary in bytes:
124		//  Measured:  `117`
125		//  Estimated: `5982`
126		// Minimum execution time: 12_687_000 picoseconds.
127		Weight::from_parts(12_854_000, 5982)
128			// Standard Error: 55_855
129			.saturating_add(Weight::from_parts(98_282_145, 0).saturating_mul(n.into()))
130			.saturating_add(T::DbWeight::get().reads(4_u64))
131			.saturating_add(T::DbWeight::get().writes(2_u64))
132			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into())))
133	}
134	/// Storage: `XcmpQueue::QueueConfig` (r:1 w:0)
135	/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`)
136	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
137	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
138	/// Storage: `MessageQueue::Pages` (r:1 w:1)
139	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
140	/// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0)
141	/// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`)
142	fn enqueue_1000_small_xcmp_messages() -> Weight {
143		// Proof Size summary in bytes:
144		//  Measured:  `52997`
145		//  Estimated: `109481`
146		// Minimum execution time: 248_874_000 picoseconds.
147		Weight::from_parts(258_496_000, 109481)
148			.saturating_add(T::DbWeight::get().reads(4_u64))
149			.saturating_add(T::DbWeight::get().writes(2_u64))
150	}
151	/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1)
152	/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`)
153	fn suspend_channel() -> Weight {
154		// Proof Size summary in bytes:
155		//  Measured:  `76`
156		//  Estimated: `3262`
157		// Minimum execution time: 3_060_000 picoseconds.
158		Weight::from_parts(3_395_000, 3262)
159			.saturating_add(T::DbWeight::get().reads(1_u64))
160			.saturating_add(T::DbWeight::get().writes(1_u64))
161	}
162	/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1)
163	/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`)
164	fn resume_channel() -> Weight {
165		// Proof Size summary in bytes:
166		//  Measured:  `111`
167		//  Estimated: `3262`
168		// Minimum execution time: 4_426_000 picoseconds.
169		Weight::from_parts(4_604_000, 3262)
170			.saturating_add(T::DbWeight::get().reads(1_u64))
171			.saturating_add(T::DbWeight::get().writes(1_u64))
172	}
173	fn take_first_concatenated_xcm() -> Weight {
174		// Proof Size summary in bytes:
175		//  Measured:  `0`
176		//  Estimated: `0`
177		// Minimum execution time: 7_627_000 picoseconds.
178		Weight::from_parts(7_761_000, 0)
179	}
180	/// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1)
181	/// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1)
182	/// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6bedc49980ba3aa32b0a189290fd036649` (r:1 w:1)
183	/// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6bedc49980ba3aa32b0a189290fd036649` (r:1 w:1)
184	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
185	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
186	/// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
187	/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`)
188	/// Storage: `XcmpQueue::QueueConfig` (r:1 w:0)
189	/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`)
190	/// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0)
191	/// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`)
192	/// Storage: `MessageQueue::Pages` (r:0 w:1)
193	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
194	fn on_idle_good_msg() -> Weight {
195		// Proof Size summary in bytes:
196		//  Measured:  `105647`
197		//  Estimated: `109607`
198		// Minimum execution time: 179_944_000 picoseconds.
199		Weight::from_parts(192_929_000, 109607)
200			.saturating_add(T::DbWeight::get().reads(6_u64))
201			.saturating_add(T::DbWeight::get().writes(5_u64))
202	}
203	/// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1)
204	/// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1)
205	/// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6bedc49980ba3aa32b0a189290fd036649` (r:1 w:1)
206	/// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6bedc49980ba3aa32b0a189290fd036649` (r:1 w:1)
207	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
208	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
209	/// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
210	/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`)
211	/// Storage: `XcmpQueue::QueueConfig` (r:1 w:0)
212	/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`)
213	/// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0)
214	/// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`)
215	/// Storage: `MessageQueue::Pages` (r:0 w:1)
216	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
217	fn on_idle_large_msg() -> Weight {
218		// Proof Size summary in bytes:
219		//  Measured:  `65716`
220		//  Estimated: `69676`
221		// Minimum execution time: 119_194_000 picoseconds.
222		Weight::from_parts(129_691_000, 69676)
223			.saturating_add(T::DbWeight::get().reads(6_u64))
224			.saturating_add(T::DbWeight::get().writes(5_u64))
225	}
226}
227
228
229#[cfg(test)]
230mod tests {
231  use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
232  use crate::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
233  use crate::weights::extrinsic_weights::ExtrinsicBaseWeight;
234
235  #[allow(dead_code)]
236  struct BlockWeights;
237  impl Get<frame_system::limits::BlockWeights> for BlockWeights {
238  	fn get() -> frame_system::limits::BlockWeights {
239  		frame_system::limits::BlockWeights::builder()
240  			.base_block(Weight::zero())
241  			.for_class(DispatchClass::all(), |weights| {
242  				weights.base_extrinsic = ExtrinsicBaseWeight::get();
243  			})
244  			.for_class(DispatchClass::non_mandatory(), |weights| {
245  				weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
246  			})
247  			.build_or_panic()
248  	}
249  }
250
251	#[test]
252	fn test_set_config_with_u32() {
253		assert!(
254			BlockWeights::get()
255				.per_class
256				.get(frame_support::dispatch::DispatchClass::Normal)
257				.max_extrinsic
258				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
259				.proof_size()
260				> 1992
261		);
262	}
263	#[test]
264	fn test_enqueue_n_bytes_xcmp_message() {
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				> 5982
273		);
274	}
275	#[test]
276	fn test_enqueue_n_empty_xcmp_messages() {
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				> 5982
285		);
286	}
287	#[test]
288	fn test_enqueue_empty_xcmp_message_at() {
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				> 109481
297		);
298	}
299	#[test]
300	fn test_enqueue_n_full_pages() {
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				> 5982
309		);
310	}
311	#[test]
312	fn test_enqueue_1000_small_xcmp_messages() {
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				> 109481
321		);
322	}
323	#[test]
324	fn test_suspend_channel() {
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				> 3262
333		);
334	}
335	#[test]
336	fn test_resume_channel() {
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				> 3262
345		);
346	}
347	#[test]
348	fn test_on_idle_good_msg() {
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				> 109607
357		);
358	}
359	#[test]
360	fn test_on_idle_large_msg() {
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				> 69676
369		);
370	}
371}