pallet_treasury/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//! Autogenerated weights for `pallet_treasury`
19//!
20//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
21//! DATE: 2024-04-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22//! WORST CASE MAP SIZE: `1000000`
23//! HOSTNAME: `runner-anb7yjbi-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
24//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024`
25
26// Executed Command:
27// ./target/production/substrate-node
28// benchmark
29// pallet
30// --chain=dev
31// --steps=50
32// --repeat=20
33// --pallet=pallet_treasury
34// --no-storage-info
35// --no-median-slopes
36// --no-min-squares
37// --extrinsic=*
38// --wasm-execution=compiled
39// --heap-pages=4096
40// --output=./substrate/frame/treasury/src/weights.rs
41// --header=./substrate/HEADER-APACHE2
42// --template=./substrate/.maintain/frame-weight-template.hbs
43
44#![cfg_attr(rustfmt, rustfmt_skip)]
45#![allow(unused_parens)]
46#![allow(unused_imports)]
47#![allow(missing_docs)]
48
49use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
50use core::marker::PhantomData;
51
52/// Weight functions needed for `pallet_treasury`.
53pub trait WeightInfo {
54 fn spend_local() -> Weight;
55 fn propose_spend() -> Weight;
56 fn reject_proposal() -> Weight;
57 fn approve_proposal(p: u32, ) -> Weight;
58 fn remove_approval() -> Weight;
59 fn on_initialize_proposals(p: u32, ) -> Weight;
60 fn spend() -> Weight;
61 fn payout() -> Weight;
62 fn check_status() -> Weight;
63 fn void_spend() -> Weight;
64}
65
66/// Weights for `pallet_treasury` using the Substrate node and recommended hardware.
67pub struct SubstrateWeight<T>(PhantomData<T>);
68impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
69 /// Storage: `Treasury::ProposalCount` (r:1 w:1)
70 /// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
71 /// Storage: `Treasury::Approvals` (r:1 w:1)
72 /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
73 /// Storage: `Treasury::Proposals` (r:0 w:1)
74 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
75 fn spend_local() -> Weight {
76 // Proof Size summary in bytes:
77 // Measured: `76`
78 // Estimated: `1887`
79 // Minimum execution time: 11_910_000 picoseconds.
80 Weight::from_parts(12_681_000, 1887)
81 .saturating_add(T::DbWeight::get().reads(2_u64))
82 .saturating_add(T::DbWeight::get().writes(3_u64))
83 }
84 /// Storage: `Treasury::ProposalCount` (r:1 w:1)
85 /// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
86 /// Storage: `Treasury::Proposals` (r:0 w:1)
87 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
88 fn propose_spend() -> Weight {
89 // Proof Size summary in bytes:
90 // Measured: `177`
91 // Estimated: `1489`
92 // Minimum execution time: 24_704_000 picoseconds.
93 Weight::from_parts(25_484_000, 1489)
94 .saturating_add(T::DbWeight::get().reads(1_u64))
95 .saturating_add(T::DbWeight::get().writes(2_u64))
96 }
97 /// Storage: `Treasury::Proposals` (r:1 w:1)
98 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
99 /// Storage: `System::Account` (r:1 w:1)
100 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
101 fn reject_proposal() -> Weight {
102 // Proof Size summary in bytes:
103 // Measured: `335`
104 // Estimated: `3593`
105 // Minimum execution time: 26_632_000 picoseconds.
106 Weight::from_parts(27_325_000, 3593)
107 .saturating_add(T::DbWeight::get().reads(2_u64))
108 .saturating_add(T::DbWeight::get().writes(2_u64))
109 }
110 /// Storage: `Treasury::Proposals` (r:1 w:0)
111 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
112 /// Storage: `Treasury::Approvals` (r:1 w:1)
113 /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
114 /// The range of component `p` is `[0, 99]`.
115 fn approve_proposal(p: u32, ) -> Weight {
116 // Proof Size summary in bytes:
117 // Measured: `504 + p * (8 ±0)`
118 // Estimated: `3573`
119 // Minimum execution time: 8_436_000 picoseconds.
120 Weight::from_parts(11_268_438, 3573)
121 // Standard Error: 1_039
122 .saturating_add(Weight::from_parts(70_903, 0).saturating_mul(p.into()))
123 .saturating_add(T::DbWeight::get().reads(2_u64))
124 .saturating_add(T::DbWeight::get().writes(1_u64))
125 }
126 /// Storage: `Treasury::Approvals` (r:1 w:1)
127 /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
128 fn remove_approval() -> Weight {
129 // Proof Size summary in bytes:
130 // Measured: `161`
131 // Estimated: `1887`
132 // Minimum execution time: 6_372_000 picoseconds.
133 Weight::from_parts(6_567_000, 1887)
134 .saturating_add(T::DbWeight::get().reads(1_u64))
135 .saturating_add(T::DbWeight::get().writes(1_u64))
136 }
137 /// Storage: `Treasury::Deactivated` (r:1 w:1)
138 /// Proof: `Treasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
139 /// Storage: `Treasury::Approvals` (r:1 w:1)
140 /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
141 /// Storage: `Treasury::Proposals` (r:99 w:99)
142 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
143 /// Storage: `System::Account` (r:198 w:198)
144 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
145 /// Storage: `Bounties::BountyApprovals` (r:1 w:1)
146 /// Proof: `Bounties::BountyApprovals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
147 /// The range of component `p` is `[0, 99]`.
148 fn on_initialize_proposals(p: u32, ) -> Weight {
149 // Proof Size summary in bytes:
150 // Measured: `451 + p * (251 ±0)`
151 // Estimated: `1887 + p * (5206 ±0)`
152 // Minimum execution time: 33_150_000 picoseconds.
153 Weight::from_parts(41_451_020, 1887)
154 // Standard Error: 19_018
155 .saturating_add(Weight::from_parts(34_410_759, 0).saturating_mul(p.into()))
156 .saturating_add(T::DbWeight::get().reads(3_u64))
157 .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(p.into())))
158 .saturating_add(T::DbWeight::get().writes(3_u64))
159 .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(p.into())))
160 .saturating_add(Weight::from_parts(0, 5206).saturating_mul(p.into()))
161 }
162 /// Storage: `AssetRate::ConversionRateToNative` (r:1 w:0)
163 /// Proof: `AssetRate::ConversionRateToNative` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
164 /// Storage: `Treasury::SpendCount` (r:1 w:1)
165 /// Proof: `Treasury::SpendCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
166 /// Storage: `Treasury::Spends` (r:0 w:1)
167 /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
168 fn spend() -> Weight {
169 // Proof Size summary in bytes:
170 // Measured: `140`
171 // Estimated: `3501`
172 // Minimum execution time: 14_233_000 picoseconds.
173 Weight::from_parts(14_842_000, 3501)
174 .saturating_add(T::DbWeight::get().reads(2_u64))
175 .saturating_add(T::DbWeight::get().writes(2_u64))
176 }
177 /// Storage: `Treasury::Spends` (r:1 w:1)
178 /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
179 /// Storage: `Assets::Asset` (r:1 w:1)
180 /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
181 /// Storage: `Assets::Account` (r:2 w:2)
182 /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
183 /// Storage: `System::Account` (r:1 w:1)
184 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
185 fn payout() -> Weight {
186 // Proof Size summary in bytes:
187 // Measured: `709`
188 // Estimated: `6208`
189 // Minimum execution time: 58_857_000 picoseconds.
190 Weight::from_parts(61_291_000, 6208)
191 .saturating_add(T::DbWeight::get().reads(5_u64))
192 .saturating_add(T::DbWeight::get().writes(5_u64))
193 }
194 /// Storage: `Treasury::Spends` (r:1 w:1)
195 /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
196 fn check_status() -> Weight {
197 // Proof Size summary in bytes:
198 // Measured: `198`
199 // Estimated: `3538`
200 // Minimum execution time: 12_116_000 picoseconds.
201 Weight::from_parts(12_480_000, 3538)
202 .saturating_add(T::DbWeight::get().reads(1_u64))
203 .saturating_add(T::DbWeight::get().writes(1_u64))
204 }
205 /// Storage: `Treasury::Spends` (r:1 w:1)
206 /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
207 fn void_spend() -> Weight {
208 // Proof Size summary in bytes:
209 // Measured: `198`
210 // Estimated: `3538`
211 // Minimum execution time: 10_834_000 picoseconds.
212 Weight::from_parts(11_427_000, 3538)
213 .saturating_add(T::DbWeight::get().reads(1_u64))
214 .saturating_add(T::DbWeight::get().writes(1_u64))
215 }
216}
217
218// For backwards compatibility and tests.
219impl WeightInfo for () {
220 /// Storage: `Treasury::ProposalCount` (r:1 w:1)
221 /// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
222 /// Storage: `Treasury::Approvals` (r:1 w:1)
223 /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
224 /// Storage: `Treasury::Proposals` (r:0 w:1)
225 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
226 fn spend_local() -> Weight {
227 // Proof Size summary in bytes:
228 // Measured: `76`
229 // Estimated: `1887`
230 // Minimum execution time: 11_910_000 picoseconds.
231 Weight::from_parts(12_681_000, 1887)
232 .saturating_add(RocksDbWeight::get().reads(2_u64))
233 .saturating_add(RocksDbWeight::get().writes(3_u64))
234 }
235 /// Storage: `Treasury::ProposalCount` (r:1 w:1)
236 /// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
237 /// Storage: `Treasury::Proposals` (r:0 w:1)
238 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
239 fn propose_spend() -> Weight {
240 // Proof Size summary in bytes:
241 // Measured: `177`
242 // Estimated: `1489`
243 // Minimum execution time: 24_704_000 picoseconds.
244 Weight::from_parts(25_484_000, 1489)
245 .saturating_add(RocksDbWeight::get().reads(1_u64))
246 .saturating_add(RocksDbWeight::get().writes(2_u64))
247 }
248 /// Storage: `Treasury::Proposals` (r:1 w:1)
249 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
250 /// Storage: `System::Account` (r:1 w:1)
251 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
252 fn reject_proposal() -> Weight {
253 // Proof Size summary in bytes:
254 // Measured: `335`
255 // Estimated: `3593`
256 // Minimum execution time: 26_632_000 picoseconds.
257 Weight::from_parts(27_325_000, 3593)
258 .saturating_add(RocksDbWeight::get().reads(2_u64))
259 .saturating_add(RocksDbWeight::get().writes(2_u64))
260 }
261 /// Storage: `Treasury::Proposals` (r:1 w:0)
262 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
263 /// Storage: `Treasury::Approvals` (r:1 w:1)
264 /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
265 /// The range of component `p` is `[0, 99]`.
266 fn approve_proposal(p: u32, ) -> Weight {
267 // Proof Size summary in bytes:
268 // Measured: `504 + p * (8 ±0)`
269 // Estimated: `3573`
270 // Minimum execution time: 8_436_000 picoseconds.
271 Weight::from_parts(11_268_438, 3573)
272 // Standard Error: 1_039
273 .saturating_add(Weight::from_parts(70_903, 0).saturating_mul(p.into()))
274 .saturating_add(RocksDbWeight::get().reads(2_u64))
275 .saturating_add(RocksDbWeight::get().writes(1_u64))
276 }
277 /// Storage: `Treasury::Approvals` (r:1 w:1)
278 /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
279 fn remove_approval() -> Weight {
280 // Proof Size summary in bytes:
281 // Measured: `161`
282 // Estimated: `1887`
283 // Minimum execution time: 6_372_000 picoseconds.
284 Weight::from_parts(6_567_000, 1887)
285 .saturating_add(RocksDbWeight::get().reads(1_u64))
286 .saturating_add(RocksDbWeight::get().writes(1_u64))
287 }
288 /// Storage: `Treasury::Deactivated` (r:1 w:1)
289 /// Proof: `Treasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
290 /// Storage: `Treasury::Approvals` (r:1 w:1)
291 /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
292 /// Storage: `Treasury::Proposals` (r:99 w:99)
293 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
294 /// Storage: `System::Account` (r:198 w:198)
295 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
296 /// Storage: `Bounties::BountyApprovals` (r:1 w:1)
297 /// Proof: `Bounties::BountyApprovals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
298 /// The range of component `p` is `[0, 99]`.
299 fn on_initialize_proposals(p: u32, ) -> Weight {
300 // Proof Size summary in bytes:
301 // Measured: `451 + p * (251 ±0)`
302 // Estimated: `1887 + p * (5206 ±0)`
303 // Minimum execution time: 33_150_000 picoseconds.
304 Weight::from_parts(41_451_020, 1887)
305 // Standard Error: 19_018
306 .saturating_add(Weight::from_parts(34_410_759, 0).saturating_mul(p.into()))
307 .saturating_add(RocksDbWeight::get().reads(3_u64))
308 .saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(p.into())))
309 .saturating_add(RocksDbWeight::get().writes(3_u64))
310 .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(p.into())))
311 .saturating_add(Weight::from_parts(0, 5206).saturating_mul(p.into()))
312 }
313 /// Storage: `AssetRate::ConversionRateToNative` (r:1 w:0)
314 /// Proof: `AssetRate::ConversionRateToNative` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
315 /// Storage: `Treasury::SpendCount` (r:1 w:1)
316 /// Proof: `Treasury::SpendCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
317 /// Storage: `Treasury::Spends` (r:0 w:1)
318 /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
319 fn spend() -> Weight {
320 // Proof Size summary in bytes:
321 // Measured: `140`
322 // Estimated: `3501`
323 // Minimum execution time: 14_233_000 picoseconds.
324 Weight::from_parts(14_842_000, 3501)
325 .saturating_add(RocksDbWeight::get().reads(2_u64))
326 .saturating_add(RocksDbWeight::get().writes(2_u64))
327 }
328 /// Storage: `Treasury::Spends` (r:1 w:1)
329 /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
330 /// Storage: `Assets::Asset` (r:1 w:1)
331 /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
332 /// Storage: `Assets::Account` (r:2 w:2)
333 /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
334 /// Storage: `System::Account` (r:1 w:1)
335 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
336 fn payout() -> Weight {
337 // Proof Size summary in bytes:
338 // Measured: `709`
339 // Estimated: `6208`
340 // Minimum execution time: 58_857_000 picoseconds.
341 Weight::from_parts(61_291_000, 6208)
342 .saturating_add(RocksDbWeight::get().reads(5_u64))
343 .saturating_add(RocksDbWeight::get().writes(5_u64))
344 }
345 /// Storage: `Treasury::Spends` (r:1 w:1)
346 /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
347 fn check_status() -> Weight {
348 // Proof Size summary in bytes:
349 // Measured: `198`
350 // Estimated: `3538`
351 // Minimum execution time: 12_116_000 picoseconds.
352 Weight::from_parts(12_480_000, 3538)
353 .saturating_add(RocksDbWeight::get().reads(1_u64))
354 .saturating_add(RocksDbWeight::get().writes(1_u64))
355 }
356 /// Storage: `Treasury::Spends` (r:1 w:1)
357 /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
358 fn void_spend() -> Weight {
359 // Proof Size summary in bytes:
360 // Measured: `198`
361 // Estimated: `3538`
362 // Minimum execution time: 10_834_000 picoseconds.
363 Weight::from_parts(11_427_000, 3538)
364 .saturating_add(RocksDbWeight::get().reads(1_u64))
365 .saturating_add(RocksDbWeight::get().writes(1_u64))
366 }
367}