pallet_stateful_storage/weights.rs
1
2//! MODIFIED by 'benchmark_transform' tool to replace child trie storage access with their specific DB weights
3//!
4//! Autogenerated weights for `pallet_stateful_storage`
5//!
6//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0
7//! DATE: 2026-03-23, STEPS: `20`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
8//! WORST CASE MAP SIZE: `1000000`
9//! HOSTNAME: `ip-10-173-5-194`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
10//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
11
12// Executed Command:
13// ./scripts/../target/release/frequency
14// benchmark
15// pallet
16// --pallet=pallet_stateful-storage
17// --extrinsic
18// *
19// --heap-pages=4096
20// --steps=20
21// --repeat=10
22// --output=./scripts/../pallets/stateful-storage/src/weights.rs
23// --template=./scripts/../.maintain/frame-weight-template.hbs
24// --additional-trie-layers=6
25// --runtime=./scripts/../target/release/wbuild/frequency-runtime/frequency_runtime.wasm
26// --genesis-builder=runtime
27
28#![cfg_attr(rustfmt, rustfmt_skip)]
29#![allow(unused_parens)]
30#![allow(unused_imports)]
31#![allow(missing_docs)]
32
33use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
34use core::marker::PhantomData;
35use common_runtime::weights::rocksdb_child_trie_weights::constants::RocksDbWeightChild;
36
37/// Weight functions needed for `pallet_stateful_storage`.
38pub trait WeightInfo {
39 fn apply_item_actions_add(s: u32, ) -> Weight;
40 fn apply_item_actions_delete(n: u32, ) -> Weight;
41 fn upsert_page(s: u32, ) -> Weight;
42 fn delete_page() -> Weight;
43 fn apply_item_actions_with_signature_v2_add(s: u32, ) -> Weight;
44 fn apply_item_actions_with_signature_v2_delete(n: u32, ) -> Weight;
45 fn upsert_page_with_signature_v2(s: u32, ) -> Weight;
46 fn delete_page_with_signature_v2() -> Weight;
47 fn paginated_v1_to_v2_miss() -> Weight;
48 fn paginated_v1_to_v2_hit() -> Weight;
49 fn itemized_v1_to_v2_miss() -> Weight;
50 fn itemized_v1_to_v2_hit() -> Weight;
51}
52
53/// Weights for `pallet_stateful_storage` using the Substrate node and recommended hardware.
54pub struct SubstrateWeight<T>(PhantomData<T>);
55impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
56 /// Storage: `Schemas::SchemaInfos` (r:1 w:0)
57 /// Proof: `Schemas::SchemaInfos` (`max_values`: None, `max_size`: Some(17), added: 2492, mode: `MaxEncodedLen`)
58 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
59 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
60 /// Storage: `Msa::DelegatorAndProviderToDelegation` (r:1 w:0)
61 /// Proof: `Msa::DelegatorAndProviderToDelegation` (`max_values`: None, `max_size`: Some(217), added: 2692, mode: `MaxEncodedLen`)
62 /// Storage: UNKNOWN KEY `0xbd1557c8db6bd8599a811a7175fbc2fc6400` (r:1 w:1)
63 /// Proof: UNKNOWN KEY `0xbd1557c8db6bd8599a811a7175fbc2fc6400` (r:1 w:1)
64 /// The range of component `s` is `[1024, 5120]`.
65 fn apply_item_actions_add(s: u32, ) -> Weight {
66 // Proof Size summary in bytes:
67 // Measured: `575`
68 // Estimated: `6020`
69 // Minimum execution time: 40_530_000 picoseconds.
70 Weight::from_parts(40_859_117, 6020)
71 // Standard Error: 79
72 .saturating_add(Weight::from_parts(1_343, 0).saturating_mul(s.into()))
73 .saturating_add(T::DbWeight::get().reads(3_u64))
74 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
75 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
76 }
77 /// Storage: `Schemas::SchemaInfos` (r:1 w:0)
78 /// Proof: `Schemas::SchemaInfos` (`max_values`: None, `max_size`: Some(17), added: 2492, mode: `MaxEncodedLen`)
79 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
80 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
81 /// Storage: `Msa::DelegatorAndProviderToDelegation` (r:1 w:0)
82 /// Proof: `Msa::DelegatorAndProviderToDelegation` (`max_values`: None, `max_size`: Some(217), added: 2692, mode: `MaxEncodedLen`)
83 /// Storage: UNKNOWN KEY `0xbd1557c8db6bd8599a811a7175fbc2fc6400` (r:1 w:1)
84 /// Proof: UNKNOWN KEY `0xbd1557c8db6bd8599a811a7175fbc2fc6400` (r:1 w:1)
85 /// The range of component `n` is `[1, 5]`.
86 fn apply_item_actions_delete(_n: u32, ) -> Weight {
87 // Proof Size summary in bytes:
88 // Measured: `10985`
89 // Estimated: `16430`
90 // Minimum execution time: 58_605_000 picoseconds.
91 Weight::from_parts(65_182_909, 16430)
92 .saturating_add(T::DbWeight::get().reads(3_u64))
93 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
94 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
95 }
96 /// Storage: `Schemas::SchemaInfos` (r:1 w:0)
97 /// Proof: `Schemas::SchemaInfos` (`max_values`: None, `max_size`: Some(17), added: 2492, mode: `MaxEncodedLen`)
98 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
99 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
100 /// Storage: `Msa::DelegatorAndProviderToDelegation` (r:1 w:0)
101 /// Proof: `Msa::DelegatorAndProviderToDelegation` (`max_values`: None, `max_size`: Some(217), added: 2692, mode: `MaxEncodedLen`)
102 /// Storage: UNKNOWN KEY `0x0763c98381dc89abe38627fe2f98cb7af1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
103 /// Proof: UNKNOWN KEY `0x0763c98381dc89abe38627fe2f98cb7af1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
104 /// The range of component `s` is `[1, 1024]`.
105 fn upsert_page(_s: u32, ) -> Weight {
106 // Proof Size summary in bytes:
107 // Measured: `1735`
108 // Estimated: `7180`
109 // Minimum execution time: 43_220_000 picoseconds.
110 Weight::from_parts(46_072_702, 7180)
111 .saturating_add(T::DbWeight::get().reads(3_u64))
112 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
113 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
114 }
115 /// Storage: `Schemas::SchemaInfos` (r:1 w:0)
116 /// Proof: `Schemas::SchemaInfos` (`max_values`: None, `max_size`: Some(17), added: 2492, mode: `MaxEncodedLen`)
117 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
118 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
119 /// Storage: `Msa::DelegatorAndProviderToDelegation` (r:1 w:0)
120 /// Proof: `Msa::DelegatorAndProviderToDelegation` (`max_values`: None, `max_size`: Some(217), added: 2692, mode: `MaxEncodedLen`)
121 /// Storage: UNKNOWN KEY `0x0763c98381dc89abe38627fe2f98cb7af1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
122 /// Proof: UNKNOWN KEY `0x0763c98381dc89abe38627fe2f98cb7af1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
123 fn delete_page() -> Weight {
124 // Proof Size summary in bytes:
125 // Measured: `1737`
126 // Estimated: `7182`
127 // Minimum execution time: 42_854_000 picoseconds.
128 Weight::from_parts(44_484_000, 7182)
129 .saturating_add(T::DbWeight::get().reads(3_u64))
130 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
131 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
132 }
133 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
134 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
135 /// Storage: `Schemas::SchemaInfos` (r:1 w:0)
136 /// Proof: `Schemas::SchemaInfos` (`max_values`: None, `max_size`: Some(17), added: 2492, mode: `MaxEncodedLen`)
137 /// Storage: UNKNOWN KEY `0xbd1557c8db6bd8599a811a7175fbc2fc6400` (r:1 w:1)
138 /// Proof: UNKNOWN KEY `0xbd1557c8db6bd8599a811a7175fbc2fc6400` (r:1 w:1)
139 /// The range of component `s` is `[1024, 5120]`.
140 fn apply_item_actions_with_signature_v2_add(s: u32, ) -> Weight {
141 // Proof Size summary in bytes:
142 // Measured: `582`
143 // Estimated: `6027`
144 // Minimum execution time: 129_771_000 picoseconds.
145 Weight::from_parts(122_189_548, 6027)
146 // Standard Error: 433
147 .saturating_add(Weight::from_parts(10_244, 0).saturating_mul(s.into()))
148 .saturating_add(T::DbWeight::get().reads(2_u64))
149 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
150 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
151 }
152 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
153 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
154 /// Storage: `Schemas::SchemaInfos` (r:1 w:0)
155 /// Proof: `Schemas::SchemaInfos` (`max_values`: None, `max_size`: Some(17), added: 2492, mode: `MaxEncodedLen`)
156 /// Storage: UNKNOWN KEY `0xbd1557c8db6bd8599a811a7175fbc2fc6400` (r:1 w:1)
157 /// Proof: UNKNOWN KEY `0xbd1557c8db6bd8599a811a7175fbc2fc6400` (r:1 w:1)
158 /// The range of component `n` is `[1, 5]`.
159 fn apply_item_actions_with_signature_v2_delete(_n: u32, ) -> Weight {
160 // Proof Size summary in bytes:
161 // Measured: `10992`
162 // Estimated: `16437`
163 // Minimum execution time: 139_286_000 picoseconds.
164 Weight::from_parts(148_412_812, 16437)
165 .saturating_add(T::DbWeight::get().reads(2_u64))
166 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
167 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
168 }
169 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
170 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
171 /// Storage: `Schemas::SchemaInfos` (r:1 w:0)
172 /// Proof: `Schemas::SchemaInfos` (`max_values`: None, `max_size`: Some(17), added: 2492, mode: `MaxEncodedLen`)
173 /// Storage: UNKNOWN KEY `0x0763c98381dc89abe38627fe2f98cb7af1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
174 /// Proof: UNKNOWN KEY `0x0763c98381dc89abe38627fe2f98cb7af1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
175 /// The range of component `s` is `[1, 1024]`.
176 fn upsert_page_with_signature_v2(s: u32, ) -> Weight {
177 // Proof Size summary in bytes:
178 // Measured: `1668`
179 // Estimated: `7113`
180 // Minimum execution time: 123_020_000 picoseconds.
181 Weight::from_parts(124_803_020, 7113)
182 // Standard Error: 1_245
183 .saturating_add(Weight::from_parts(14_087, 0).saturating_mul(s.into()))
184 .saturating_add(T::DbWeight::get().reads(2_u64))
185 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
186 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
187 }
188 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
189 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
190 /// Storage: `Schemas::SchemaInfos` (r:1 w:0)
191 /// Proof: `Schemas::SchemaInfos` (`max_values`: None, `max_size`: Some(17), added: 2492, mode: `MaxEncodedLen`)
192 /// Storage: UNKNOWN KEY `0x0763c98381dc89abe38627fe2f98cb7af1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
193 /// Proof: UNKNOWN KEY `0x0763c98381dc89abe38627fe2f98cb7af1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
194 fn delete_page_with_signature_v2() -> Weight {
195 // Proof Size summary in bytes:
196 // Measured: `1670`
197 // Estimated: `7115`
198 // Minimum execution time: 120_425_000 picoseconds.
199 Weight::from_parts(122_813_000, 7115)
200 .saturating_add(T::DbWeight::get().reads(2_u64))
201 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
202 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
203 }
204 /// Storage: UNKNOWN KEY `0x` (r:1 w:0)
205 /// Proof: UNKNOWN KEY `0x` (r:1 w:0)
206 fn paginated_v1_to_v2_miss() -> Weight {
207 // Proof Size summary in bytes:
208 // Measured: `11`
209 // Estimated: `5456`
210 // Minimum execution time: 2_945_000 picoseconds.
211 Weight::from_parts(3_093_000, 5456)
212 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
213 }
214 /// Storage: UNKNOWN KEY `0x` (r:1 w:0)
215 /// Proof: UNKNOWN KEY `0x` (r:1 w:0)
216 /// Storage: UNKNOWN KEY `0xf1577fbf1d628fdddb4ebfc6e8d95fb1f1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
217 /// Proof: UNKNOWN KEY `0xf1577fbf1d628fdddb4ebfc6e8d95fb1f1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
218 fn paginated_v1_to_v2_hit() -> Weight {
219 // Proof Size summary in bytes:
220 // Measured: `1172`
221 // Estimated: `6617`
222 // Minimum execution time: 11_871_000 picoseconds.
223 Weight::from_parts(12_380_000, 6617)
224 .saturating_add(RocksDbWeightChild::get().reads(2_u64))
225 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
226 }
227 /// Storage: UNKNOWN KEY `0x` (r:1 w:0)
228 /// Proof: UNKNOWN KEY `0x` (r:1 w:0)
229 fn itemized_v1_to_v2_miss() -> Weight {
230 // Proof Size summary in bytes:
231 // Measured: `11`
232 // Estimated: `5456`
233 // Minimum execution time: 2_903_000 picoseconds.
234 Weight::from_parts(3_095_000, 5456)
235 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
236 }
237 /// Storage: UNKNOWN KEY `0x` (r:1 w:0)
238 /// Proof: UNKNOWN KEY `0x` (r:1 w:0)
239 /// Storage: UNKNOWN KEY `0xf1577fbf1d628fdddb4ebfc6e8d95fb10100` (r:1 w:1)
240 /// Proof: UNKNOWN KEY `0xf1577fbf1d628fdddb4ebfc6e8d95fb10100` (r:1 w:1)
241 fn itemized_v1_to_v2_hit() -> Weight {
242 // Proof Size summary in bytes:
243 // Measured: `329`
244 // Estimated: `5774`
245 // Minimum execution time: 15_761_000 picoseconds.
246 Weight::from_parts(16_391_000, 5774)
247 .saturating_add(RocksDbWeightChild::get().reads(2_u64))
248 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
249 }
250}
251
252// For backwards compatibility and tests.
253impl WeightInfo for () {
254 /// Storage: `Schemas::SchemaInfos` (r:1 w:0)
255 /// Proof: `Schemas::SchemaInfos` (`max_values`: None, `max_size`: Some(17), added: 2492, mode: `MaxEncodedLen`)
256 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
257 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
258 /// Storage: `Msa::DelegatorAndProviderToDelegation` (r:1 w:0)
259 /// Proof: `Msa::DelegatorAndProviderToDelegation` (`max_values`: None, `max_size`: Some(217), added: 2692, mode: `MaxEncodedLen`)
260 /// Storage: UNKNOWN KEY `0xbd1557c8db6bd8599a811a7175fbc2fc6400` (r:1 w:1)
261 /// Proof: UNKNOWN KEY `0xbd1557c8db6bd8599a811a7175fbc2fc6400` (r:1 w:1)
262 /// The range of component `s` is `[1024, 5120]`.
263 fn apply_item_actions_add(s: u32, ) -> Weight {
264 // Proof Size summary in bytes:
265 // Measured: `575`
266 // Estimated: `6020`
267 // Minimum execution time: 40_530_000 picoseconds.
268 Weight::from_parts(40_859_117, 6020)
269 // Standard Error: 79
270 .saturating_add(Weight::from_parts(1_343, 0).saturating_mul(s.into()))
271 .saturating_add(RocksDbWeight::get().reads(3_u64))
272 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
273 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
274 }
275 /// Storage: `Schemas::SchemaInfos` (r:1 w:0)
276 /// Proof: `Schemas::SchemaInfos` (`max_values`: None, `max_size`: Some(17), added: 2492, mode: `MaxEncodedLen`)
277 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
278 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
279 /// Storage: `Msa::DelegatorAndProviderToDelegation` (r:1 w:0)
280 /// Proof: `Msa::DelegatorAndProviderToDelegation` (`max_values`: None, `max_size`: Some(217), added: 2692, mode: `MaxEncodedLen`)
281 /// Storage: UNKNOWN KEY `0xbd1557c8db6bd8599a811a7175fbc2fc6400` (r:1 w:1)
282 /// Proof: UNKNOWN KEY `0xbd1557c8db6bd8599a811a7175fbc2fc6400` (r:1 w:1)
283 /// The range of component `n` is `[1, 5]`.
284 fn apply_item_actions_delete(_n: u32, ) -> Weight {
285 // Proof Size summary in bytes:
286 // Measured: `10985`
287 // Estimated: `16430`
288 // Minimum execution time: 58_605_000 picoseconds.
289 Weight::from_parts(65_182_909, 16430)
290 .saturating_add(RocksDbWeight::get().reads(3_u64))
291 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
292 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
293 }
294 /// Storage: `Schemas::SchemaInfos` (r:1 w:0)
295 /// Proof: `Schemas::SchemaInfos` (`max_values`: None, `max_size`: Some(17), added: 2492, mode: `MaxEncodedLen`)
296 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
297 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
298 /// Storage: `Msa::DelegatorAndProviderToDelegation` (r:1 w:0)
299 /// Proof: `Msa::DelegatorAndProviderToDelegation` (`max_values`: None, `max_size`: Some(217), added: 2692, mode: `MaxEncodedLen`)
300 /// Storage: UNKNOWN KEY `0x0763c98381dc89abe38627fe2f98cb7af1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
301 /// Proof: UNKNOWN KEY `0x0763c98381dc89abe38627fe2f98cb7af1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
302 /// The range of component `s` is `[1, 1024]`.
303 fn upsert_page(_s: u32, ) -> Weight {
304 // Proof Size summary in bytes:
305 // Measured: `1735`
306 // Estimated: `7180`
307 // Minimum execution time: 43_220_000 picoseconds.
308 Weight::from_parts(46_072_702, 7180)
309 .saturating_add(RocksDbWeight::get().reads(3_u64))
310 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
311 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
312 }
313 /// Storage: `Schemas::SchemaInfos` (r:1 w:0)
314 /// Proof: `Schemas::SchemaInfos` (`max_values`: None, `max_size`: Some(17), added: 2492, mode: `MaxEncodedLen`)
315 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
316 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
317 /// Storage: `Msa::DelegatorAndProviderToDelegation` (r:1 w:0)
318 /// Proof: `Msa::DelegatorAndProviderToDelegation` (`max_values`: None, `max_size`: Some(217), added: 2692, mode: `MaxEncodedLen`)
319 /// Storage: UNKNOWN KEY `0x0763c98381dc89abe38627fe2f98cb7af1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
320 /// Proof: UNKNOWN KEY `0x0763c98381dc89abe38627fe2f98cb7af1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
321 fn delete_page() -> Weight {
322 // Proof Size summary in bytes:
323 // Measured: `1737`
324 // Estimated: `7182`
325 // Minimum execution time: 42_854_000 picoseconds.
326 Weight::from_parts(44_484_000, 7182)
327 .saturating_add(RocksDbWeight::get().reads(3_u64))
328 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
329 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
330 }
331 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
332 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
333 /// Storage: `Schemas::SchemaInfos` (r:1 w:0)
334 /// Proof: `Schemas::SchemaInfos` (`max_values`: None, `max_size`: Some(17), added: 2492, mode: `MaxEncodedLen`)
335 /// Storage: UNKNOWN KEY `0xbd1557c8db6bd8599a811a7175fbc2fc6400` (r:1 w:1)
336 /// Proof: UNKNOWN KEY `0xbd1557c8db6bd8599a811a7175fbc2fc6400` (r:1 w:1)
337 /// The range of component `s` is `[1024, 5120]`.
338 fn apply_item_actions_with_signature_v2_add(s: u32, ) -> Weight {
339 // Proof Size summary in bytes:
340 // Measured: `582`
341 // Estimated: `6027`
342 // Minimum execution time: 129_771_000 picoseconds.
343 Weight::from_parts(122_189_548, 6027)
344 // Standard Error: 433
345 .saturating_add(Weight::from_parts(10_244, 0).saturating_mul(s.into()))
346 .saturating_add(RocksDbWeight::get().reads(2_u64))
347 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
348 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
349 }
350 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
351 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
352 /// Storage: `Schemas::SchemaInfos` (r:1 w:0)
353 /// Proof: `Schemas::SchemaInfos` (`max_values`: None, `max_size`: Some(17), added: 2492, mode: `MaxEncodedLen`)
354 /// Storage: UNKNOWN KEY `0xbd1557c8db6bd8599a811a7175fbc2fc6400` (r:1 w:1)
355 /// Proof: UNKNOWN KEY `0xbd1557c8db6bd8599a811a7175fbc2fc6400` (r:1 w:1)
356 /// The range of component `n` is `[1, 5]`.
357 fn apply_item_actions_with_signature_v2_delete(_n: u32, ) -> Weight {
358 // Proof Size summary in bytes:
359 // Measured: `10992`
360 // Estimated: `16437`
361 // Minimum execution time: 139_286_000 picoseconds.
362 Weight::from_parts(148_412_812, 16437)
363 .saturating_add(RocksDbWeight::get().reads(2_u64))
364 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
365 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
366 }
367 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
368 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
369 /// Storage: `Schemas::SchemaInfos` (r:1 w:0)
370 /// Proof: `Schemas::SchemaInfos` (`max_values`: None, `max_size`: Some(17), added: 2492, mode: `MaxEncodedLen`)
371 /// Storage: UNKNOWN KEY `0x0763c98381dc89abe38627fe2f98cb7af1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
372 /// Proof: UNKNOWN KEY `0x0763c98381dc89abe38627fe2f98cb7af1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
373 /// The range of component `s` is `[1, 1024]`.
374 fn upsert_page_with_signature_v2(s: u32, ) -> Weight {
375 // Proof Size summary in bytes:
376 // Measured: `1668`
377 // Estimated: `7113`
378 // Minimum execution time: 123_020_000 picoseconds.
379 Weight::from_parts(124_803_020, 7113)
380 // Standard Error: 1_245
381 .saturating_add(Weight::from_parts(14_087, 0).saturating_mul(s.into()))
382 .saturating_add(RocksDbWeight::get().reads(2_u64))
383 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
384 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
385 }
386 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
387 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
388 /// Storage: `Schemas::SchemaInfos` (r:1 w:0)
389 /// Proof: `Schemas::SchemaInfos` (`max_values`: None, `max_size`: Some(17), added: 2492, mode: `MaxEncodedLen`)
390 /// Storage: UNKNOWN KEY `0x0763c98381dc89abe38627fe2f98cb7af1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
391 /// Proof: UNKNOWN KEY `0x0763c98381dc89abe38627fe2f98cb7af1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
392 fn delete_page_with_signature_v2() -> Weight {
393 // Proof Size summary in bytes:
394 // Measured: `1670`
395 // Estimated: `7115`
396 // Minimum execution time: 120_425_000 picoseconds.
397 Weight::from_parts(122_813_000, 7115)
398 .saturating_add(RocksDbWeight::get().reads(2_u64))
399 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
400 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
401 }
402 /// Storage: UNKNOWN KEY `0x` (r:1 w:0)
403 /// Proof: UNKNOWN KEY `0x` (r:1 w:0)
404 fn paginated_v1_to_v2_miss() -> Weight {
405 // Proof Size summary in bytes:
406 // Measured: `11`
407 // Estimated: `5456`
408 // Minimum execution time: 2_945_000 picoseconds.
409 Weight::from_parts(3_093_000, 5456)
410 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
411 }
412 /// Storage: UNKNOWN KEY `0x` (r:1 w:0)
413 /// Proof: UNKNOWN KEY `0x` (r:1 w:0)
414 /// Storage: UNKNOWN KEY `0xf1577fbf1d628fdddb4ebfc6e8d95fb1f1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
415 /// Proof: UNKNOWN KEY `0xf1577fbf1d628fdddb4ebfc6e8d95fb1f1577fbf1d628fdddb4ebfc6e8d95fb1` (r:1 w:1)
416 fn paginated_v1_to_v2_hit() -> Weight {
417 // Proof Size summary in bytes:
418 // Measured: `1172`
419 // Estimated: `6617`
420 // Minimum execution time: 11_871_000 picoseconds.
421 Weight::from_parts(12_380_000, 6617)
422 .saturating_add(RocksDbWeightChild::get().reads(2_u64))
423 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
424 }
425 /// Storage: UNKNOWN KEY `0x` (r:1 w:0)
426 /// Proof: UNKNOWN KEY `0x` (r:1 w:0)
427 fn itemized_v1_to_v2_miss() -> Weight {
428 // Proof Size summary in bytes:
429 // Measured: `11`
430 // Estimated: `5456`
431 // Minimum execution time: 2_903_000 picoseconds.
432 Weight::from_parts(3_095_000, 5456)
433 .saturating_add(RocksDbWeightChild::get().reads(1_u64))
434 }
435 /// Storage: UNKNOWN KEY `0x` (r:1 w:0)
436 /// Proof: UNKNOWN KEY `0x` (r:1 w:0)
437 /// Storage: UNKNOWN KEY `0xf1577fbf1d628fdddb4ebfc6e8d95fb10100` (r:1 w:1)
438 /// Proof: UNKNOWN KEY `0xf1577fbf1d628fdddb4ebfc6e8d95fb10100` (r:1 w:1)
439 fn itemized_v1_to_v2_hit() -> Weight {
440 // Proof Size summary in bytes:
441 // Measured: `329`
442 // Estimated: `5774`
443 // Minimum execution time: 15_761_000 picoseconds.
444 Weight::from_parts(16_391_000, 5774)
445 .saturating_add(RocksDbWeightChild::get().reads(2_u64))
446 .saturating_add(RocksDbWeightChild::get().writes(1_u64))
447 }
448}
449
450
451#[cfg(test)]
452mod tests {
453 use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
454 use common_runtime::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
455 use common_runtime::weights::extrinsic_weights::ExtrinsicBaseWeight;
456
457 #[allow(dead_code)]
458 struct BlockWeights;
459 impl Get<frame_system::limits::BlockWeights> for BlockWeights {
460 fn get() -> frame_system::limits::BlockWeights {
461 frame_system::limits::BlockWeights::builder()
462 .base_block(Weight::zero())
463 .for_class(DispatchClass::all(), |weights| {
464 weights.base_extrinsic = ExtrinsicBaseWeight::get();
465 })
466 .for_class(DispatchClass::non_mandatory(), |weights| {
467 weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
468 })
469 .build_or_panic()
470 }
471 }
472
473 #[test]
474 fn test_apply_item_actions_add() {
475 assert!(
476 BlockWeights::get()
477 .per_class
478 .get(frame_support::dispatch::DispatchClass::Normal)
479 .max_extrinsic
480 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
481 .proof_size()
482 > 6020
483 );
484 }
485 #[test]
486 fn test_apply_item_actions_delete() {
487 assert!(
488 BlockWeights::get()
489 .per_class
490 .get(frame_support::dispatch::DispatchClass::Normal)
491 .max_extrinsic
492 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
493 .proof_size()
494 > 16430
495 );
496 }
497 #[test]
498 fn test_upsert_page() {
499 assert!(
500 BlockWeights::get()
501 .per_class
502 .get(frame_support::dispatch::DispatchClass::Normal)
503 .max_extrinsic
504 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
505 .proof_size()
506 > 7180
507 );
508 }
509 #[test]
510 fn test_delete_page() {
511 assert!(
512 BlockWeights::get()
513 .per_class
514 .get(frame_support::dispatch::DispatchClass::Normal)
515 .max_extrinsic
516 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
517 .proof_size()
518 > 7182
519 );
520 }
521 #[test]
522 fn test_apply_item_actions_with_signature_v2_add() {
523 assert!(
524 BlockWeights::get()
525 .per_class
526 .get(frame_support::dispatch::DispatchClass::Normal)
527 .max_extrinsic
528 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
529 .proof_size()
530 > 6027
531 );
532 }
533 #[test]
534 fn test_apply_item_actions_with_signature_v2_delete() {
535 assert!(
536 BlockWeights::get()
537 .per_class
538 .get(frame_support::dispatch::DispatchClass::Normal)
539 .max_extrinsic
540 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
541 .proof_size()
542 > 16437
543 );
544 }
545 #[test]
546 fn test_upsert_page_with_signature_v2() {
547 assert!(
548 BlockWeights::get()
549 .per_class
550 .get(frame_support::dispatch::DispatchClass::Normal)
551 .max_extrinsic
552 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
553 .proof_size()
554 > 7113
555 );
556 }
557 #[test]
558 fn test_delete_page_with_signature_v2() {
559 assert!(
560 BlockWeights::get()
561 .per_class
562 .get(frame_support::dispatch::DispatchClass::Normal)
563 .max_extrinsic
564 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
565 .proof_size()
566 > 7115
567 );
568 }
569 #[test]
570 fn test_paginated_v1_to_v2_miss() {
571 assert!(
572 BlockWeights::get()
573 .per_class
574 .get(frame_support::dispatch::DispatchClass::Normal)
575 .max_extrinsic
576 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
577 .proof_size()
578 > 5456
579 );
580 }
581 #[test]
582 fn test_paginated_v1_to_v2_hit() {
583 assert!(
584 BlockWeights::get()
585 .per_class
586 .get(frame_support::dispatch::DispatchClass::Normal)
587 .max_extrinsic
588 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
589 .proof_size()
590 > 6617
591 );
592 }
593 #[test]
594 fn test_itemized_v1_to_v2_miss() {
595 assert!(
596 BlockWeights::get()
597 .per_class
598 .get(frame_support::dispatch::DispatchClass::Normal)
599 .max_extrinsic
600 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
601 .proof_size()
602 > 5456
603 );
604 }
605 #[test]
606 fn test_itemized_v1_to_v2_hit() {
607 assert!(
608 BlockWeights::get()
609 .per_class
610 .get(frame_support::dispatch::DispatchClass::Normal)
611 .max_extrinsic
612 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
613 .proof_size()
614 > 5774
615 );
616 }
617}