pallet_safe_mode/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_safe_mode`
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_safe_mode
51// --header=/__w/polkadot-sdk/polkadot-sdk/substrate/HEADER-APACHE2
52// --output=/__w/polkadot-sdk/polkadot-sdk/substrate/frame/safe-mode/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::weights_prelude::*;
71use core::marker::PhantomData;
72
73/// Weight functions needed for `pallet_safe_mode`.
74pub trait WeightInfo {
75 fn on_initialize_noop() -> Weight;
76 fn on_initialize_exit() -> Weight;
77 fn enter() -> Weight;
78 fn force_enter() -> Weight;
79 fn extend() -> Weight;
80 fn force_extend() -> Weight;
81 fn force_exit() -> Weight;
82 fn release_deposit() -> Weight;
83 fn force_release_deposit() -> Weight;
84 fn force_slash_deposit() -> Weight;
85}
86
87/// Weights for `pallet_safe_mode` using the Substrate node and recommended hardware.
88pub struct SubstrateWeight<T>(PhantomData<T>);
89impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
90 /// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
91 /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
92 fn on_initialize_noop() -> Weight {
93 // Proof Size summary in bytes:
94 // Measured: `0`
95 // Estimated: `1489`
96 // Minimum execution time: 684_000 picoseconds.
97 Weight::from_parts(733_000, 1489)
98 .saturating_add(T::DbWeight::get().reads(1_u64))
99 }
100 /// Storage: `SafeMode::EnteredUntil` (r:1 w:1)
101 /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
102 fn on_initialize_exit() -> Weight {
103 // Proof Size summary in bytes:
104 // Measured: `8`
105 // Estimated: `1489`
106 // Minimum execution time: 4_624_000 picoseconds.
107 Weight::from_parts(4_926_000, 1489)
108 .saturating_add(T::DbWeight::get().reads(1_u64))
109 .saturating_add(T::DbWeight::get().writes(1_u64))
110 }
111 /// Storage: `SafeMode::EnteredUntil` (r:1 w:1)
112 /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
113 /// Storage: `Balances::Holds` (r:1 w:1)
114 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
115 /// Storage: `SafeMode::Deposits` (r:0 w:1)
116 /// Proof: `SafeMode::Deposits` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`)
117 fn enter() -> Weight {
118 // Proof Size summary in bytes:
119 // Measured: `0`
120 // Estimated: `3892`
121 // Minimum execution time: 43_918_000 picoseconds.
122 Weight::from_parts(44_471_000, 3892)
123 .saturating_add(T::DbWeight::get().reads(2_u64))
124 .saturating_add(T::DbWeight::get().writes(3_u64))
125 }
126 /// Storage: `SafeMode::EnteredUntil` (r:1 w:1)
127 /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
128 fn force_enter() -> Weight {
129 // Proof Size summary in bytes:
130 // Measured: `0`
131 // Estimated: `1489`
132 // Minimum execution time: 5_020_000 picoseconds.
133 Weight::from_parts(5_200_000, 1489)
134 .saturating_add(T::DbWeight::get().reads(1_u64))
135 .saturating_add(T::DbWeight::get().writes(1_u64))
136 }
137 /// Storage: `SafeMode::EnteredUntil` (r:1 w:1)
138 /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
139 /// Storage: `Balances::Holds` (r:1 w:1)
140 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
141 /// Storage: `SafeMode::Deposits` (r:0 w:1)
142 /// Proof: `SafeMode::Deposits` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`)
143 fn extend() -> Weight {
144 // Proof Size summary in bytes:
145 // Measured: `8`
146 // Estimated: `3892`
147 // Minimum execution time: 44_860_000 picoseconds.
148 Weight::from_parts(46_411_000, 3892)
149 .saturating_add(T::DbWeight::get().reads(2_u64))
150 .saturating_add(T::DbWeight::get().writes(3_u64))
151 }
152 /// Storage: `SafeMode::EnteredUntil` (r:1 w:1)
153 /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
154 fn force_extend() -> Weight {
155 // Proof Size summary in bytes:
156 // Measured: `8`
157 // Estimated: `1489`
158 // Minimum execution time: 6_777_000 picoseconds.
159 Weight::from_parts(7_011_000, 1489)
160 .saturating_add(T::DbWeight::get().reads(1_u64))
161 .saturating_add(T::DbWeight::get().writes(1_u64))
162 }
163 /// Storage: `SafeMode::EnteredUntil` (r:1 w:1)
164 /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
165 fn force_exit() -> Weight {
166 // Proof Size summary in bytes:
167 // Measured: `8`
168 // Estimated: `1489`
169 // Minimum execution time: 5_960_000 picoseconds.
170 Weight::from_parts(6_180_000, 1489)
171 .saturating_add(T::DbWeight::get().reads(1_u64))
172 .saturating_add(T::DbWeight::get().writes(1_u64))
173 }
174 /// Storage: `SafeMode::Deposits` (r:1 w:1)
175 /// Proof: `SafeMode::Deposits` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`)
176 /// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
177 /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
178 /// Storage: `Balances::Holds` (r:1 w:1)
179 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
180 fn release_deposit() -> Weight {
181 // Proof Size summary in bytes:
182 // Measured: `129`
183 // Estimated: `3892`
184 // Minimum execution time: 36_814_000 picoseconds.
185 Weight::from_parts(37_735_000, 3892)
186 .saturating_add(T::DbWeight::get().reads(3_u64))
187 .saturating_add(T::DbWeight::get().writes(2_u64))
188 }
189 /// Storage: `SafeMode::Deposits` (r:1 w:1)
190 /// Proof: `SafeMode::Deposits` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`)
191 /// Storage: `Balances::Holds` (r:1 w:1)
192 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
193 fn force_release_deposit() -> Weight {
194 // Proof Size summary in bytes:
195 // Measured: `129`
196 // Estimated: `3892`
197 // Minimum execution time: 35_691_000 picoseconds.
198 Weight::from_parts(36_454_000, 3892)
199 .saturating_add(T::DbWeight::get().reads(2_u64))
200 .saturating_add(T::DbWeight::get().writes(2_u64))
201 }
202 /// Storage: `SafeMode::Deposits` (r:1 w:1)
203 /// Proof: `SafeMode::Deposits` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`)
204 /// Storage: `Balances::Holds` (r:1 w:1)
205 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
206 fn force_slash_deposit() -> Weight {
207 // Proof Size summary in bytes:
208 // Measured: `129`
209 // Estimated: `3892`
210 // Minimum execution time: 28_256_000 picoseconds.
211 Weight::from_parts(28_905_000, 3892)
212 .saturating_add(T::DbWeight::get().reads(2_u64))
213 .saturating_add(T::DbWeight::get().writes(2_u64))
214 }
215}
216
217// For backwards compatibility and tests.
218impl WeightInfo for () {
219 /// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
220 /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
221 fn on_initialize_noop() -> Weight {
222 // Proof Size summary in bytes:
223 // Measured: `0`
224 // Estimated: `1489`
225 // Minimum execution time: 684_000 picoseconds.
226 Weight::from_parts(733_000, 1489)
227 .saturating_add(RocksDbWeight::get().reads(1_u64))
228 }
229 /// Storage: `SafeMode::EnteredUntil` (r:1 w:1)
230 /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
231 fn on_initialize_exit() -> Weight {
232 // Proof Size summary in bytes:
233 // Measured: `8`
234 // Estimated: `1489`
235 // Minimum execution time: 4_624_000 picoseconds.
236 Weight::from_parts(4_926_000, 1489)
237 .saturating_add(RocksDbWeight::get().reads(1_u64))
238 .saturating_add(RocksDbWeight::get().writes(1_u64))
239 }
240 /// Storage: `SafeMode::EnteredUntil` (r:1 w:1)
241 /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
242 /// Storage: `Balances::Holds` (r:1 w:1)
243 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
244 /// Storage: `SafeMode::Deposits` (r:0 w:1)
245 /// Proof: `SafeMode::Deposits` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`)
246 fn enter() -> Weight {
247 // Proof Size summary in bytes:
248 // Measured: `0`
249 // Estimated: `3892`
250 // Minimum execution time: 43_918_000 picoseconds.
251 Weight::from_parts(44_471_000, 3892)
252 .saturating_add(RocksDbWeight::get().reads(2_u64))
253 .saturating_add(RocksDbWeight::get().writes(3_u64))
254 }
255 /// Storage: `SafeMode::EnteredUntil` (r:1 w:1)
256 /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
257 fn force_enter() -> Weight {
258 // Proof Size summary in bytes:
259 // Measured: `0`
260 // Estimated: `1489`
261 // Minimum execution time: 5_020_000 picoseconds.
262 Weight::from_parts(5_200_000, 1489)
263 .saturating_add(RocksDbWeight::get().reads(1_u64))
264 .saturating_add(RocksDbWeight::get().writes(1_u64))
265 }
266 /// Storage: `SafeMode::EnteredUntil` (r:1 w:1)
267 /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
268 /// Storage: `Balances::Holds` (r:1 w:1)
269 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
270 /// Storage: `SafeMode::Deposits` (r:0 w:1)
271 /// Proof: `SafeMode::Deposits` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`)
272 fn extend() -> Weight {
273 // Proof Size summary in bytes:
274 // Measured: `8`
275 // Estimated: `3892`
276 // Minimum execution time: 44_860_000 picoseconds.
277 Weight::from_parts(46_411_000, 3892)
278 .saturating_add(RocksDbWeight::get().reads(2_u64))
279 .saturating_add(RocksDbWeight::get().writes(3_u64))
280 }
281 /// Storage: `SafeMode::EnteredUntil` (r:1 w:1)
282 /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
283 fn force_extend() -> Weight {
284 // Proof Size summary in bytes:
285 // Measured: `8`
286 // Estimated: `1489`
287 // Minimum execution time: 6_777_000 picoseconds.
288 Weight::from_parts(7_011_000, 1489)
289 .saturating_add(RocksDbWeight::get().reads(1_u64))
290 .saturating_add(RocksDbWeight::get().writes(1_u64))
291 }
292 /// Storage: `SafeMode::EnteredUntil` (r:1 w:1)
293 /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
294 fn force_exit() -> Weight {
295 // Proof Size summary in bytes:
296 // Measured: `8`
297 // Estimated: `1489`
298 // Minimum execution time: 5_960_000 picoseconds.
299 Weight::from_parts(6_180_000, 1489)
300 .saturating_add(RocksDbWeight::get().reads(1_u64))
301 .saturating_add(RocksDbWeight::get().writes(1_u64))
302 }
303 /// Storage: `SafeMode::Deposits` (r:1 w:1)
304 /// Proof: `SafeMode::Deposits` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`)
305 /// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
306 /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
307 /// Storage: `Balances::Holds` (r:1 w:1)
308 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
309 fn release_deposit() -> Weight {
310 // Proof Size summary in bytes:
311 // Measured: `129`
312 // Estimated: `3892`
313 // Minimum execution time: 36_814_000 picoseconds.
314 Weight::from_parts(37_735_000, 3892)
315 .saturating_add(RocksDbWeight::get().reads(3_u64))
316 .saturating_add(RocksDbWeight::get().writes(2_u64))
317 }
318 /// Storage: `SafeMode::Deposits` (r:1 w:1)
319 /// Proof: `SafeMode::Deposits` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`)
320 /// Storage: `Balances::Holds` (r:1 w:1)
321 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
322 fn force_release_deposit() -> Weight {
323 // Proof Size summary in bytes:
324 // Measured: `129`
325 // Estimated: `3892`
326 // Minimum execution time: 35_691_000 picoseconds.
327 Weight::from_parts(36_454_000, 3892)
328 .saturating_add(RocksDbWeight::get().reads(2_u64))
329 .saturating_add(RocksDbWeight::get().writes(2_u64))
330 }
331 /// Storage: `SafeMode::Deposits` (r:1 w:1)
332 /// Proof: `SafeMode::Deposits` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`)
333 /// Storage: `Balances::Holds` (r:1 w:1)
334 /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
335 fn force_slash_deposit() -> Weight {
336 // Proof Size summary in bytes:
337 // Measured: `129`
338 // Estimated: `3892`
339 // Minimum execution time: 28_256_000 picoseconds.
340 Weight::from_parts(28_905_000, 3892)
341 .saturating_add(RocksDbWeight::get().reads(2_u64))
342 .saturating_add(RocksDbWeight::get().writes(2_u64))
343 }
344}