pallet_balances/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_balances`
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_balances
51// --header=/__w/polkadot-sdk/polkadot-sdk/substrate/HEADER-APACHE2
52// --output=/__w/polkadot-sdk/polkadot-sdk/substrate/frame/balances/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_balances`.
74pub trait WeightInfo {
75 fn transfer_allow_death() -> Weight;
76 fn transfer_keep_alive() -> Weight;
77 fn force_set_balance_creating() -> Weight;
78 fn force_set_balance_killing() -> Weight;
79 fn force_transfer() -> Weight;
80 fn transfer_all() -> Weight;
81 fn force_unreserve() -> Weight;
82 fn upgrade_accounts(u: u32, ) -> Weight;
83 fn force_adjust_total_issuance() -> Weight;
84 fn burn_allow_death() -> Weight;
85 fn burn_keep_alive() -> Weight;
86}
87
88/// Weights for `pallet_balances` using the Substrate node and recommended hardware.
89pub struct SubstrateWeight<T>(PhantomData<T>);
90impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
91 /// Storage: `System::Account` (r:1 w:1)
92 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
93 fn transfer_allow_death() -> Weight {
94 // Proof Size summary in bytes:
95 // Measured: `0`
96 // Estimated: `3593`
97 // Minimum execution time: 48_203_000 picoseconds.
98 Weight::from_parts(48_834_000, 3593)
99 .saturating_add(T::DbWeight::get().reads(1_u64))
100 .saturating_add(T::DbWeight::get().writes(1_u64))
101 }
102 /// Storage: `System::Account` (r:1 w:1)
103 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
104 fn transfer_keep_alive() -> Weight {
105 // Proof Size summary in bytes:
106 // Measured: `0`
107 // Estimated: `3593`
108 // Minimum execution time: 38_647_000 picoseconds.
109 Weight::from_parts(39_051_000, 3593)
110 .saturating_add(T::DbWeight::get().reads(1_u64))
111 .saturating_add(T::DbWeight::get().writes(1_u64))
112 }
113 /// Storage: `System::Account` (r:1 w:1)
114 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
115 fn force_set_balance_creating() -> Weight {
116 // Proof Size summary in bytes:
117 // Measured: `52`
118 // Estimated: `3593`
119 // Minimum execution time: 12_191_000 picoseconds.
120 Weight::from_parts(12_547_000, 3593)
121 .saturating_add(T::DbWeight::get().reads(1_u64))
122 .saturating_add(T::DbWeight::get().writes(1_u64))
123 }
124 /// Storage: `System::Account` (r:1 w:1)
125 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
126 fn force_set_balance_killing() -> Weight {
127 // Proof Size summary in bytes:
128 // Measured: `52`
129 // Estimated: `3593`
130 // Minimum execution time: 18_636_000 picoseconds.
131 Weight::from_parts(19_206_000, 3593)
132 .saturating_add(T::DbWeight::get().reads(1_u64))
133 .saturating_add(T::DbWeight::get().writes(1_u64))
134 }
135 /// Storage: `System::Account` (r:2 w:2)
136 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
137 fn force_transfer() -> Weight {
138 // Proof Size summary in bytes:
139 // Measured: `52`
140 // Estimated: `6196`
141 // Minimum execution time: 49_073_000 picoseconds.
142 Weight::from_parts(49_519_000, 6196)
143 .saturating_add(T::DbWeight::get().reads(2_u64))
144 .saturating_add(T::DbWeight::get().writes(2_u64))
145 }
146 /// Storage: `System::Account` (r:1 w:1)
147 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
148 fn transfer_all() -> Weight {
149 // Proof Size summary in bytes:
150 // Measured: `0`
151 // Estimated: `3593`
152 // Minimum execution time: 47_572_000 picoseconds.
153 Weight::from_parts(48_209_000, 3593)
154 .saturating_add(T::DbWeight::get().reads(1_u64))
155 .saturating_add(T::DbWeight::get().writes(1_u64))
156 }
157 /// Storage: `System::Account` (r:1 w:1)
158 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
159 fn force_unreserve() -> Weight {
160 // Proof Size summary in bytes:
161 // Measured: `52`
162 // Estimated: `3593`
163 // Minimum execution time: 15_290_000 picoseconds.
164 Weight::from_parts(15_515_000, 3593)
165 .saturating_add(T::DbWeight::get().reads(1_u64))
166 .saturating_add(T::DbWeight::get().writes(1_u64))
167 }
168 /// Storage: `System::Account` (r:999 w:999)
169 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
170 /// The range of component `u` is `[1, 1000]`.
171 fn upgrade_accounts(u: u32, ) -> Weight {
172 // Proof Size summary in bytes:
173 // Measured: `0 + u * (135 ±0)`
174 // Estimated: `990 + u * (2603 ±0)`
175 // Minimum execution time: 14_546_000 picoseconds.
176 Weight::from_parts(14_674_000, 990)
177 // Standard Error: 11_734
178 .saturating_add(Weight::from_parts(14_648_188, 0).saturating_mul(u.into()))
179 .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into())))
180 .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into())))
181 .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into()))
182 }
183 fn force_adjust_total_issuance() -> Weight {
184 // Proof Size summary in bytes:
185 // Measured: `0`
186 // Estimated: `0`
187 // Minimum execution time: 5_096_000 picoseconds.
188 Weight::from_parts(5_351_000, 0)
189 }
190 fn burn_allow_death() -> Weight {
191 // Proof Size summary in bytes:
192 // Measured: `0`
193 // Estimated: `0`
194 // Minimum execution time: 29_641_000 picoseconds.
195 Weight::from_parts(30_219_000, 0)
196 }
197 fn burn_keep_alive() -> Weight {
198 // Proof Size summary in bytes:
199 // Measured: `0`
200 // Estimated: `0`
201 // Minimum execution time: 20_462_000 picoseconds.
202 Weight::from_parts(20_720_000, 0)
203 }
204}
205
206// For backwards compatibility and tests.
207impl WeightInfo for () {
208 /// Storage: `System::Account` (r:1 w:1)
209 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
210 fn transfer_allow_death() -> Weight {
211 // Proof Size summary in bytes:
212 // Measured: `0`
213 // Estimated: `3593`
214 // Minimum execution time: 48_203_000 picoseconds.
215 Weight::from_parts(48_834_000, 3593)
216 .saturating_add(RocksDbWeight::get().reads(1_u64))
217 .saturating_add(RocksDbWeight::get().writes(1_u64))
218 }
219 /// Storage: `System::Account` (r:1 w:1)
220 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
221 fn transfer_keep_alive() -> Weight {
222 // Proof Size summary in bytes:
223 // Measured: `0`
224 // Estimated: `3593`
225 // Minimum execution time: 38_647_000 picoseconds.
226 Weight::from_parts(39_051_000, 3593)
227 .saturating_add(RocksDbWeight::get().reads(1_u64))
228 .saturating_add(RocksDbWeight::get().writes(1_u64))
229 }
230 /// Storage: `System::Account` (r:1 w:1)
231 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
232 fn force_set_balance_creating() -> Weight {
233 // Proof Size summary in bytes:
234 // Measured: `52`
235 // Estimated: `3593`
236 // Minimum execution time: 12_191_000 picoseconds.
237 Weight::from_parts(12_547_000, 3593)
238 .saturating_add(RocksDbWeight::get().reads(1_u64))
239 .saturating_add(RocksDbWeight::get().writes(1_u64))
240 }
241 /// Storage: `System::Account` (r:1 w:1)
242 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
243 fn force_set_balance_killing() -> Weight {
244 // Proof Size summary in bytes:
245 // Measured: `52`
246 // Estimated: `3593`
247 // Minimum execution time: 18_636_000 picoseconds.
248 Weight::from_parts(19_206_000, 3593)
249 .saturating_add(RocksDbWeight::get().reads(1_u64))
250 .saturating_add(RocksDbWeight::get().writes(1_u64))
251 }
252 /// Storage: `System::Account` (r:2 w:2)
253 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
254 fn force_transfer() -> Weight {
255 // Proof Size summary in bytes:
256 // Measured: `52`
257 // Estimated: `6196`
258 // Minimum execution time: 49_073_000 picoseconds.
259 Weight::from_parts(49_519_000, 6196)
260 .saturating_add(RocksDbWeight::get().reads(2_u64))
261 .saturating_add(RocksDbWeight::get().writes(2_u64))
262 }
263 /// Storage: `System::Account` (r:1 w:1)
264 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
265 fn transfer_all() -> Weight {
266 // Proof Size summary in bytes:
267 // Measured: `0`
268 // Estimated: `3593`
269 // Minimum execution time: 47_572_000 picoseconds.
270 Weight::from_parts(48_209_000, 3593)
271 .saturating_add(RocksDbWeight::get().reads(1_u64))
272 .saturating_add(RocksDbWeight::get().writes(1_u64))
273 }
274 /// Storage: `System::Account` (r:1 w:1)
275 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
276 fn force_unreserve() -> Weight {
277 // Proof Size summary in bytes:
278 // Measured: `52`
279 // Estimated: `3593`
280 // Minimum execution time: 15_290_000 picoseconds.
281 Weight::from_parts(15_515_000, 3593)
282 .saturating_add(RocksDbWeight::get().reads(1_u64))
283 .saturating_add(RocksDbWeight::get().writes(1_u64))
284 }
285 /// Storage: `System::Account` (r:999 w:999)
286 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
287 /// The range of component `u` is `[1, 1000]`.
288 fn upgrade_accounts(u: u32, ) -> Weight {
289 // Proof Size summary in bytes:
290 // Measured: `0 + u * (135 ±0)`
291 // Estimated: `990 + u * (2603 ±0)`
292 // Minimum execution time: 14_546_000 picoseconds.
293 Weight::from_parts(14_674_000, 990)
294 // Standard Error: 11_734
295 .saturating_add(Weight::from_parts(14_648_188, 0).saturating_mul(u.into()))
296 .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(u.into())))
297 .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(u.into())))
298 .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into()))
299 }
300 fn force_adjust_total_issuance() -> Weight {
301 // Proof Size summary in bytes:
302 // Measured: `0`
303 // Estimated: `0`
304 // Minimum execution time: 5_096_000 picoseconds.
305 Weight::from_parts(5_351_000, 0)
306 }
307 fn burn_allow_death() -> Weight {
308 // Proof Size summary in bytes:
309 // Measured: `0`
310 // Estimated: `0`
311 // Minimum execution time: 29_641_000 picoseconds.
312 Weight::from_parts(30_219_000, 0)
313 }
314 fn burn_keep_alive() -> Weight {
315 // Proof Size summary in bytes:
316 // Measured: `0`
317 // Estimated: `0`
318 // Minimum execution time: 20_462_000 picoseconds.
319 Weight::from_parts(20_720_000, 0)
320 }
321}