Skip to content

Commit f9efa67

Browse files
Account for PoV size when enqueing XCMP message (#9641)
Related to #9630 , but adjusting the benchmark Using `#[benchmark(pov_mode = Measured)]` for the `enqueue_empty_xcmp_message_at` benchmark. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 63958c4 commit f9efa67

File tree

12 files changed

+516
-477
lines changed

12 files changed

+516
-477
lines changed

cumulus/pallets/xcmp-queue/src/benchmarking.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ mod benchmarks {
110110

111111
/// Add an XCMP message of 0 bytes to the message queue at the provided position
112112
/// on an existing page.
113-
#[benchmark]
113+
#[benchmark(pov_mode = Measured)]
114114
fn enqueue_empty_xcmp_message_at(
115115
n: Linear<0, { crate::MaxXcmpMessageLenOf::<T>::get() - 10 }>,
116116
) {
@@ -181,7 +181,7 @@ mod benchmarks {
181181
}
182182
}
183183

184-
#[benchmark]
184+
#[benchmark(pov_mode = Measured)]
185185
fn enqueue_1000_small_xcmp_messages() {
186186
#[cfg(test)]
187187
{

cumulus/pallets/xcmp-queue/src/weights.rs

Lines changed: 68 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
//! Autogenerated weights for `cumulus_pallet_xcmp_queue`
1717
//!
1818
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
19-
//! DATE: 2025-08-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
19+
//! DATE: 2025-09-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
2020
//! WORST CASE MAP SIZE: `1000000`
2121
//! HOSTNAME: `Serbans-MacBook-Pro.local`, CPU: `<UNKNOWN>`
22-
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-westend-dev")`, DB CACHE: `1024`
22+
//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
2323
2424
// Executed Command:
2525
// ./target/release/polkadot-parachain
@@ -89,10 +89,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
8989
// Proof Size summary in bytes:
9090
// Measured: `251`
9191
// Estimated: `5487`
92-
// Minimum execution time: 10_000_000 picoseconds.
93-
Weight::from_parts(12_286_920, 5487)
94-
// Standard Error: 1
95-
.saturating_add(Weight::from_parts(194, 0).saturating_mul(n.into()))
92+
// Minimum execution time: 11_000_000 picoseconds.
93+
Weight::from_parts(12_262_916, 5487)
94+
// Standard Error: 0
95+
.saturating_add(Weight::from_parts(187, 0).saturating_mul(n.into()))
9696
.saturating_add(T::DbWeight::get().reads(4_u64))
9797
.saturating_add(T::DbWeight::get().writes(3_u64))
9898
}
@@ -111,32 +111,33 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
111111
// Proof Size summary in bytes:
112112
// Measured: `251`
113113
// Estimated: `5487`
114-
// Minimum execution time: 8_000_000 picoseconds.
115-
Weight::from_parts(13_439_195, 5487)
116-
// Standard Error: 498
117-
.saturating_add(Weight::from_parts(130_951, 0).saturating_mul(n.into()))
114+
// Minimum execution time: 9_000_000 picoseconds.
115+
Weight::from_parts(13_664_993, 5487)
116+
// Standard Error: 220
117+
.saturating_add(Weight::from_parts(131_195, 0).saturating_mul(n.into()))
118118
.saturating_add(T::DbWeight::get().reads(4_u64))
119119
.saturating_add(T::DbWeight::get().writes(3_u64))
120120
}
121121
/// Storage: `XcmpQueue::QueueConfig` (r:1 w:0)
122-
/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`)
122+
/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `Measured`)
123123
/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
124-
/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
124+
/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `Measured`)
125125
/// Storage: `MessageQueue::Pages` (r:1 w:1)
126-
/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
126+
/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `Measured`)
127127
/// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0)
128-
/// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`)
128+
/// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `Measured`)
129129
/// The range of component `n` is `[0, 105457]`.
130130
fn enqueue_empty_xcmp_message_at(n: u32, ) -> Weight {
131131
// Proof Size summary in bytes:
132132
// Measured: `434 + n * (1 ±0)`
133-
// Estimated: `108986`
134-
// Minimum execution time: 15_000_000 picoseconds.
135-
Weight::from_parts(15_354_447, 108986)
136-
// Standard Error: 5
137-
.saturating_add(Weight::from_parts(747, 0).saturating_mul(n.into()))
133+
// Estimated: `3897 + n * (1 ±0)`
134+
// Minimum execution time: 16_000_000 picoseconds.
135+
Weight::from_parts(16_490_667, 3897)
136+
// Standard Error: 2
137+
.saturating_add(Weight::from_parts(720, 0).saturating_mul(n.into()))
138138
.saturating_add(T::DbWeight::get().reads(4_u64))
139139
.saturating_add(T::DbWeight::get().writes(2_u64))
140+
.saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into()))
140141
}
141142
/// Storage: `XcmpQueue::QueueConfig` (r:1 w:0)
142143
/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`)
@@ -153,28 +154,28 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
153154
// Proof Size summary in bytes:
154155
// Measured: `286`
155156
// Estimated: `5487`
156-
// Minimum execution time: 10_000_000 picoseconds.
157+
// Minimum execution time: 9_000_000 picoseconds.
157158
Weight::from_parts(10_000_000, 5487)
158-
// Standard Error: 31_014
159-
.saturating_add(Weight::from_parts(24_068_862, 0).saturating_mul(n.into()))
159+
// Standard Error: 26_047
160+
.saturating_add(Weight::from_parts(23_938_725, 0).saturating_mul(n.into()))
160161
.saturating_add(T::DbWeight::get().reads(4_u64))
161162
.saturating_add(T::DbWeight::get().writes(2_u64))
162163
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into())))
163164
}
164165
/// Storage: `XcmpQueue::QueueConfig` (r:1 w:0)
165-
/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`)
166+
/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `Measured`)
166167
/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
167-
/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
168+
/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `Measured`)
168169
/// Storage: `MessageQueue::Pages` (r:1 w:1)
169-
/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
170+
/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `Measured`)
170171
/// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0)
171-
/// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`)
172+
/// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `Measured`)
172173
fn enqueue_1000_small_xcmp_messages() -> Weight {
173174
// Proof Size summary in bytes:
174175
// Measured: `53167`
175-
// Estimated: `108986`
176-
// Minimum execution time: 172_000_000 picoseconds.
177-
Weight::from_parts(181_000_000, 108986)
176+
// Estimated: `56632`
177+
// Minimum execution time: 175_000_000 picoseconds.
178+
Weight::from_parts(181_000_000, 56632)
178179
.saturating_add(T::DbWeight::get().reads(4_u64))
179180
.saturating_add(T::DbWeight::get().writes(2_u64))
180181
}
@@ -195,7 +196,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
195196
// Proof Size summary in bytes:
196197
// Measured: `210`
197198
// Estimated: `2767`
198-
// Minimum execution time: 2_000_000 picoseconds.
199+
// Minimum execution time: 3_000_000 picoseconds.
199200
Weight::from_parts(3_000_000, 2767)
200201
.saturating_add(T::DbWeight::get().reads(1_u64))
201202
.saturating_add(T::DbWeight::get().writes(1_u64))
@@ -206,9 +207,9 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
206207
// Measured: `0`
207208
// Estimated: `0`
208209
// Minimum execution time: 1_000_000 picoseconds.
209-
Weight::from_parts(1_825_791, 0)
210-
// Standard Error: 564
211-
.saturating_add(Weight::from_parts(44_073, 0).saturating_mul(n.into()))
210+
Weight::from_parts(1_878_097, 0)
211+
// Standard Error: 558
212+
.saturating_add(Weight::from_parts(44_593, 0).saturating_mul(n.into()))
212213
}
213214
/// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1)
214215
/// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1)
@@ -251,7 +252,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
251252
// Proof Size summary in bytes:
252253
// Measured: `65885`
253254
// Estimated: `69350`
254-
// Minimum execution time: 45_000_000 picoseconds.
255+
// Minimum execution time: 42_000_000 picoseconds.
255256
Weight::from_parts(47_000_000, 69350)
256257
.saturating_add(T::DbWeight::get().reads(6_u64))
257258
.saturating_add(T::DbWeight::get().writes(5_u64))
@@ -286,10 +287,10 @@ impl WeightInfo for () {
286287
// Proof Size summary in bytes:
287288
// Measured: `251`
288289
// Estimated: `5487`
289-
// Minimum execution time: 10_000_000 picoseconds.
290-
Weight::from_parts(12_286_920, 5487)
291-
// Standard Error: 1
292-
.saturating_add(Weight::from_parts(194, 0).saturating_mul(n.into()))
290+
// Minimum execution time: 11_000_000 picoseconds.
291+
Weight::from_parts(12_262_916, 5487)
292+
// Standard Error: 0
293+
.saturating_add(Weight::from_parts(187, 0).saturating_mul(n.into()))
293294
.saturating_add(RocksDbWeight::get().reads(4_u64))
294295
.saturating_add(RocksDbWeight::get().writes(3_u64))
295296
}
@@ -308,32 +309,33 @@ impl WeightInfo for () {
308309
// Proof Size summary in bytes:
309310
// Measured: `251`
310311
// Estimated: `5487`
311-
// Minimum execution time: 8_000_000 picoseconds.
312-
Weight::from_parts(13_439_195, 5487)
313-
// Standard Error: 498
314-
.saturating_add(Weight::from_parts(130_951, 0).saturating_mul(n.into()))
312+
// Minimum execution time: 9_000_000 picoseconds.
313+
Weight::from_parts(13_664_993, 5487)
314+
// Standard Error: 220
315+
.saturating_add(Weight::from_parts(131_195, 0).saturating_mul(n.into()))
315316
.saturating_add(RocksDbWeight::get().reads(4_u64))
316317
.saturating_add(RocksDbWeight::get().writes(3_u64))
317318
}
318319
/// Storage: `XcmpQueue::QueueConfig` (r:1 w:0)
319-
/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`)
320+
/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `Measured`)
320321
/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
321-
/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
322+
/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `Measured`)
322323
/// Storage: `MessageQueue::Pages` (r:1 w:1)
323-
/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
324+
/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `Measured`)
324325
/// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0)
325-
/// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`)
326+
/// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `Measured`)
326327
/// The range of component `n` is `[0, 105457]`.
327328
fn enqueue_empty_xcmp_message_at(n: u32, ) -> Weight {
328329
// Proof Size summary in bytes:
329330
// Measured: `434 + n * (1 ±0)`
330-
// Estimated: `108986`
331-
// Minimum execution time: 15_000_000 picoseconds.
332-
Weight::from_parts(15_354_447, 108986)
333-
// Standard Error: 5
334-
.saturating_add(Weight::from_parts(747, 0).saturating_mul(n.into()))
331+
// Estimated: `3897 + n * (1 ±0)`
332+
// Minimum execution time: 16_000_000 picoseconds.
333+
Weight::from_parts(16_490_667, 3897)
334+
// Standard Error: 2
335+
.saturating_add(Weight::from_parts(720, 0).saturating_mul(n.into()))
335336
.saturating_add(RocksDbWeight::get().reads(4_u64))
336337
.saturating_add(RocksDbWeight::get().writes(2_u64))
338+
.saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into()))
337339
}
338340
/// Storage: `XcmpQueue::QueueConfig` (r:1 w:0)
339341
/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`)
@@ -350,28 +352,28 @@ impl WeightInfo for () {
350352
// Proof Size summary in bytes:
351353
// Measured: `286`
352354
// Estimated: `5487`
353-
// Minimum execution time: 10_000_000 picoseconds.
355+
// Minimum execution time: 9_000_000 picoseconds.
354356
Weight::from_parts(10_000_000, 5487)
355-
// Standard Error: 31_014
356-
.saturating_add(Weight::from_parts(24_068_862, 0).saturating_mul(n.into()))
357+
// Standard Error: 26_047
358+
.saturating_add(Weight::from_parts(23_938_725, 0).saturating_mul(n.into()))
357359
.saturating_add(RocksDbWeight::get().reads(4_u64))
358360
.saturating_add(RocksDbWeight::get().writes(2_u64))
359361
.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into())))
360362
}
361363
/// Storage: `XcmpQueue::QueueConfig` (r:1 w:0)
362-
/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`)
364+
/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `Measured`)
363365
/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
364-
/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
366+
/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `Measured`)
365367
/// Storage: `MessageQueue::Pages` (r:1 w:1)
366-
/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
368+
/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `Measured`)
367369
/// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0)
368-
/// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`)
370+
/// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `Measured`)
369371
fn enqueue_1000_small_xcmp_messages() -> Weight {
370372
// Proof Size summary in bytes:
371373
// Measured: `53167`
372-
// Estimated: `108986`
373-
// Minimum execution time: 172_000_000 picoseconds.
374-
Weight::from_parts(181_000_000, 108986)
374+
// Estimated: `56632`
375+
// Minimum execution time: 175_000_000 picoseconds.
376+
Weight::from_parts(181_000_000, 56632)
375377
.saturating_add(RocksDbWeight::get().reads(4_u64))
376378
.saturating_add(RocksDbWeight::get().writes(2_u64))
377379
}
@@ -392,7 +394,7 @@ impl WeightInfo for () {
392394
// Proof Size summary in bytes:
393395
// Measured: `210`
394396
// Estimated: `2767`
395-
// Minimum execution time: 2_000_000 picoseconds.
397+
// Minimum execution time: 3_000_000 picoseconds.
396398
Weight::from_parts(3_000_000, 2767)
397399
.saturating_add(RocksDbWeight::get().reads(1_u64))
398400
.saturating_add(RocksDbWeight::get().writes(1_u64))
@@ -403,9 +405,9 @@ impl WeightInfo for () {
403405
// Measured: `0`
404406
// Estimated: `0`
405407
// Minimum execution time: 1_000_000 picoseconds.
406-
Weight::from_parts(1_825_791, 0)
407-
// Standard Error: 564
408-
.saturating_add(Weight::from_parts(44_073, 0).saturating_mul(n.into()))
408+
Weight::from_parts(1_878_097, 0)
409+
// Standard Error: 558
410+
.saturating_add(Weight::from_parts(44_593, 0).saturating_mul(n.into()))
409411
}
410412
/// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1)
411413
/// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1)
@@ -448,7 +450,7 @@ impl WeightInfo for () {
448450
// Proof Size summary in bytes:
449451
// Measured: `65885`
450452
// Estimated: `69350`
451-
// Minimum execution time: 45_000_000 picoseconds.
453+
// Minimum execution time: 42_000_000 picoseconds.
452454
Weight::from_parts(47_000_000, 69350)
453455
.saturating_add(RocksDbWeight::get().reads(6_u64))
454456
.saturating_add(RocksDbWeight::get().writes(5_u64))

0 commit comments

Comments
 (0)