pallet_state_trie_migration/weights.rs
1// This file is part of Substrate.
2
3// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: Apache-2.0
5
6// Licensed under the Apache License, Version 2.0 (the "License");
7// you may not use this file except in compliance with the License.
8// You may obtain a copy of the License at
9//
10// http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS,
14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15// See the License for the specific language governing permissions and
16// limitations under the License.
17
18// This file is part of Substrate.
19
20// Copyright (C) Parity Technologies (UK) Ltd.
21// SPDX-License-Identifier: Apache-2.0
22
23// Licensed under the Apache License, Version 2.0 (the "License");
24// you may not use this file except in compliance with the License.
25// You may obtain a copy of the License at
26//
27// http://www.apache.org/licenses/LICENSE-2.0
28//
29// Unless required by applicable law or agreed to in writing, software
30// distributed under the License is distributed on an "AS IS" BASIS,
31// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32// See the License for the specific language governing permissions and
33// limitations under the License.
34
35//! Autogenerated weights for `pallet_state_trie_migration`
36//!
37//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
38//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
39//! WORST CASE MAP SIZE: `1000000`
40//! HOSTNAME: `4563561839a5`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
41//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
42
43// Executed Command:
44// frame-omni-bencher
45// v1
46// benchmark
47// pallet
48// --extrinsic=*
49// --runtime=target/production/wbuild/kitchensink-runtime/kitchensink_runtime.wasm
50// --pallet=pallet_state_trie_migration
51// --header=/__w/polkadot-sdk/polkadot-sdk/substrate/HEADER-APACHE2
52// --output=/__w/polkadot-sdk/polkadot-sdk/substrate/frame/state-trie-migration/src/weights.rs
53// --wasm-execution=compiled
54// --steps=50
55// --repeat=20
56// --heap-pages=4096
57// --template=substrate/.maintain/frame-weight-template.hbs
58// --no-storage-info
59// --no-min-squares
60// --no-median-slopes
61// --genesis-builder-policy=none
62// --exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic,pallet_nomination_pools,pallet_remark,pallet_transaction_storage,pallet_election_provider_multi_block,pallet_election_provider_multi_block::signed,pallet_election_provider_multi_block::unsigned,pallet_election_provider_multi_block::verifier
63
64#![cfg_attr(rustfmt, rustfmt_skip)]
65#![allow(unused_parens)]
66#![allow(unused_imports)]
67#![allow(missing_docs)]
68#![allow(dead_code)]
69
70use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
71use core::marker::PhantomData;
72
73/// Weight functions needed for `pallet_state_trie_migration`.
74pub trait WeightInfo {
75 fn continue_migrate() -> Weight;
76 fn continue_migrate_wrong_witness() -> Weight;
77 fn migrate_custom_top_success() -> Weight;
78 fn migrate_custom_top_fail() -> Weight;
79 fn migrate_custom_child_success() -> Weight;
80 fn migrate_custom_child_fail() -> Weight;
81 fn process_top_key(v: u32, ) -> Weight;
82}
83
84/// Weights for `pallet_state_trie_migration` using the Substrate node and recommended hardware.
85pub struct SubstrateWeight<T>(PhantomData<T>);
86impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
87 /// Storage: `StateTrieMigration::SignedMigrationMaxLimits` (r:1 w:0)
88 /// Proof: `StateTrieMigration::SignedMigrationMaxLimits` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
89 /// Storage: `Balances::Holds` (r:1 w:0)
90 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
91 /// Storage: `StateTrieMigration::MigrationProcess` (r:1 w:1)
92 /// Proof: `StateTrieMigration::MigrationProcess` (`max_values`: Some(1), `max_size`: Some(1042), added: 1537, mode: `MaxEncodedLen`)
93 fn continue_migrate() -> Weight {
94 // Proof Size summary in bytes:
95 // Measured: `12`
96 // Estimated: `3892`
97 // Minimum execution time: 16_005_000 picoseconds.
98 Weight::from_parts(16_281_000, 3892)
99 .saturating_add(T::DbWeight::get().reads(3_u64))
100 .saturating_add(T::DbWeight::get().writes(1_u64))
101 }
102 /// Storage: `StateTrieMigration::SignedMigrationMaxLimits` (r:1 w:0)
103 /// Proof: `StateTrieMigration::SignedMigrationMaxLimits` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
104 fn continue_migrate_wrong_witness() -> Weight {
105 // Proof Size summary in bytes:
106 // Measured: `0`
107 // Estimated: `1493`
108 // Minimum execution time: 2_343_000 picoseconds.
109 Weight::from_parts(2_447_000, 1493)
110 .saturating_add(T::DbWeight::get().reads(1_u64))
111 }
112 /// Storage: `Balances::Holds` (r:1 w:0)
113 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
114 fn migrate_custom_top_success() -> Weight {
115 // Proof Size summary in bytes:
116 // Measured: `0`
117 // Estimated: `3892`
118 // Minimum execution time: 11_089_000 picoseconds.
119 Weight::from_parts(11_255_000, 3892)
120 .saturating_add(T::DbWeight::get().reads(1_u64))
121 }
122 /// Storage: `Balances::Holds` (r:1 w:1)
123 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
124 /// Storage: UNKNOWN KEY `0x666f6f` (r:1 w:1)
125 /// Proof: UNKNOWN KEY `0x666f6f` (r:1 w:1)
126 fn migrate_custom_top_fail() -> Weight {
127 // Proof Size summary in bytes:
128 // Measured: `9`
129 // Estimated: `3892`
130 // Minimum execution time: 64_067_000 picoseconds.
131 Weight::from_parts(65_266_000, 3892)
132 .saturating_add(T::DbWeight::get().reads(2_u64))
133 .saturating_add(T::DbWeight::get().writes(2_u64))
134 }
135 /// Storage: `Balances::Holds` (r:1 w:0)
136 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
137 fn migrate_custom_child_success() -> Weight {
138 // Proof Size summary in bytes:
139 // Measured: `0`
140 // Estimated: `3892`
141 // Minimum execution time: 11_467_000 picoseconds.
142 Weight::from_parts(11_716_000, 3892)
143 .saturating_add(T::DbWeight::get().reads(1_u64))
144 }
145 /// Storage: `Balances::Holds` (r:1 w:1)
146 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
147 /// Storage: UNKNOWN KEY `0x666f6f` (r:1 w:1)
148 /// Proof: UNKNOWN KEY `0x666f6f` (r:1 w:1)
149 fn migrate_custom_child_fail() -> Weight {
150 // Proof Size summary in bytes:
151 // Measured: `41`
152 // Estimated: `3892`
153 // Minimum execution time: 63_951_000 picoseconds.
154 Weight::from_parts(65_062_000, 3892)
155 .saturating_add(T::DbWeight::get().reads(2_u64))
156 .saturating_add(T::DbWeight::get().writes(2_u64))
157 }
158 /// Storage: UNKNOWN KEY `0x6b6579` (r:1 w:1)
159 /// Proof: UNKNOWN KEY `0x6b6579` (r:1 w:1)
160 /// The range of component `v` is `[1, 4194304]`.
161 fn process_top_key(v: u32, ) -> Weight {
162 // Proof Size summary in bytes:
163 // Measured: `0 + v * (1 ±0)`
164 // Estimated: `3446 + v * (1 ±0)`
165 // Minimum execution time: 2_336_000 picoseconds.
166 Weight::from_parts(2_419_000, 3446)
167 // Standard Error: 8
168 .saturating_add(Weight::from_parts(1_644, 0).saturating_mul(v.into()))
169 .saturating_add(T::DbWeight::get().reads(1_u64))
170 .saturating_add(T::DbWeight::get().writes(1_u64))
171 .saturating_add(Weight::from_parts(0, 1).saturating_mul(v.into()))
172 }
173}
174
175// For backwards compatibility and tests.
176impl WeightInfo for () {
177 /// Storage: `StateTrieMigration::SignedMigrationMaxLimits` (r:1 w:0)
178 /// Proof: `StateTrieMigration::SignedMigrationMaxLimits` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
179 /// Storage: `Balances::Holds` (r:1 w:0)
180 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
181 /// Storage: `StateTrieMigration::MigrationProcess` (r:1 w:1)
182 /// Proof: `StateTrieMigration::MigrationProcess` (`max_values`: Some(1), `max_size`: Some(1042), added: 1537, mode: `MaxEncodedLen`)
183 fn continue_migrate() -> Weight {
184 // Proof Size summary in bytes:
185 // Measured: `12`
186 // Estimated: `3892`
187 // Minimum execution time: 16_005_000 picoseconds.
188 Weight::from_parts(16_281_000, 3892)
189 .saturating_add(RocksDbWeight::get().reads(3_u64))
190 .saturating_add(RocksDbWeight::get().writes(1_u64))
191 }
192 /// Storage: `StateTrieMigration::SignedMigrationMaxLimits` (r:1 w:0)
193 /// Proof: `StateTrieMigration::SignedMigrationMaxLimits` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
194 fn continue_migrate_wrong_witness() -> Weight {
195 // Proof Size summary in bytes:
196 // Measured: `0`
197 // Estimated: `1493`
198 // Minimum execution time: 2_343_000 picoseconds.
199 Weight::from_parts(2_447_000, 1493)
200 .saturating_add(RocksDbWeight::get().reads(1_u64))
201 }
202 /// Storage: `Balances::Holds` (r:1 w:0)
203 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
204 fn migrate_custom_top_success() -> Weight {
205 // Proof Size summary in bytes:
206 // Measured: `0`
207 // Estimated: `3892`
208 // Minimum execution time: 11_089_000 picoseconds.
209 Weight::from_parts(11_255_000, 3892)
210 .saturating_add(RocksDbWeight::get().reads(1_u64))
211 }
212 /// Storage: `Balances::Holds` (r:1 w:1)
213 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
214 /// Storage: UNKNOWN KEY `0x666f6f` (r:1 w:1)
215 /// Proof: UNKNOWN KEY `0x666f6f` (r:1 w:1)
216 fn migrate_custom_top_fail() -> Weight {
217 // Proof Size summary in bytes:
218 // Measured: `9`
219 // Estimated: `3892`
220 // Minimum execution time: 64_067_000 picoseconds.
221 Weight::from_parts(65_266_000, 3892)
222 .saturating_add(RocksDbWeight::get().reads(2_u64))
223 .saturating_add(RocksDbWeight::get().writes(2_u64))
224 }
225 /// Storage: `Balances::Holds` (r:1 w:0)
226 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
227 fn migrate_custom_child_success() -> Weight {
228 // Proof Size summary in bytes:
229 // Measured: `0`
230 // Estimated: `3892`
231 // Minimum execution time: 11_467_000 picoseconds.
232 Weight::from_parts(11_716_000, 3892)
233 .saturating_add(RocksDbWeight::get().reads(1_u64))
234 }
235 /// Storage: `Balances::Holds` (r:1 w:1)
236 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
237 /// Storage: UNKNOWN KEY `0x666f6f` (r:1 w:1)
238 /// Proof: UNKNOWN KEY `0x666f6f` (r:1 w:1)
239 fn migrate_custom_child_fail() -> Weight {
240 // Proof Size summary in bytes:
241 // Measured: `41`
242 // Estimated: `3892`
243 // Minimum execution time: 63_951_000 picoseconds.
244 Weight::from_parts(65_062_000, 3892)
245 .saturating_add(RocksDbWeight::get().reads(2_u64))
246 .saturating_add(RocksDbWeight::get().writes(2_u64))
247 }
248 /// Storage: UNKNOWN KEY `0x6b6579` (r:1 w:1)
249 /// Proof: UNKNOWN KEY `0x6b6579` (r:1 w:1)
250 /// The range of component `v` is `[1, 4194304]`.
251 fn process_top_key(v: u32, ) -> Weight {
252 // Proof Size summary in bytes:
253 // Measured: `0 + v * (1 ±0)`
254 // Estimated: `3446 + v * (1 ±0)`
255 // Minimum execution time: 2_336_000 picoseconds.
256 Weight::from_parts(2_419_000, 3446)
257 // Standard Error: 8
258 .saturating_add(Weight::from_parts(1_644, 0).saturating_mul(v.into()))
259 .saturating_add(RocksDbWeight::get().reads(1_u64))
260 .saturating_add(RocksDbWeight::get().writes(1_u64))
261 .saturating_add(Weight::from_parts(0, 1).saturating_mul(v.into()))
262 }
263}