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 propose_spend() -> Weight;
55 fn reject_proposal() -> Weight;
56 fn approve_proposal(p: u32, ) -> Weight;
57 fn on_initialize_proposals(p: u32, ) -> Weight;
58}
59
60/// Weights for `pallet_treasury` using the Substrate node and recommended hardware.
61pub struct SubstrateWeight<T>(PhantomData<T>);
62impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
63 /// Storage: `Treasury::ProposalCount` (r:1 w:1)
64 /// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
65 /// Storage: `Treasury::Proposals` (r:0 w:1)
66 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
67 fn propose_spend() -> Weight {
68 // Proof Size summary in bytes:
69 // Measured: `177`
70 // Estimated: `1489`
71 // Minimum execution time: 24_704_000 picoseconds.
72 Weight::from_parts(25_484_000, 1489)
73 .saturating_add(T::DbWeight::get().reads(1_u64))
74 .saturating_add(T::DbWeight::get().writes(2_u64))
75 }
76 /// Storage: `Treasury::Proposals` (r:1 w:1)
77 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
78 /// Storage: `System::Account` (r:1 w:1)
79 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
80 fn reject_proposal() -> Weight {
81 // Proof Size summary in bytes:
82 // Measured: `335`
83 // Estimated: `3593`
84 // Minimum execution time: 26_632_000 picoseconds.
85 Weight::from_parts(27_325_000, 3593)
86 .saturating_add(T::DbWeight::get().reads(2_u64))
87 .saturating_add(T::DbWeight::get().writes(2_u64))
88 }
89 /// Storage: `Treasury::Proposals` (r:1 w:0)
90 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
91 /// Storage: `Treasury::Approvals` (r:1 w:1)
92 /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
93 /// The range of component `p` is `[0, 99]`.
94 fn approve_proposal(p: u32, ) -> Weight {
95 // Proof Size summary in bytes:
96 // Measured: `504 + p * (8 ±0)`
97 // Estimated: `3573`
98 // Minimum execution time: 8_436_000 picoseconds.
99 Weight::from_parts(11_268_438, 3573)
100 // Standard Error: 1_039
101 .saturating_add(Weight::from_parts(70_903, 0).saturating_mul(p.into()))
102 .saturating_add(T::DbWeight::get().reads(2_u64))
103 .saturating_add(T::DbWeight::get().writes(1_u64))
104 }
105 /// Storage: `Treasury::Deactivated` (r:1 w:1)
106 /// Proof: `Treasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
107 /// Storage: `Treasury::Approvals` (r:1 w:1)
108 /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
109 /// Storage: `Treasury::Proposals` (r:99 w:99)
110 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
111 /// Storage: `System::Account` (r:198 w:198)
112 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
113 /// Storage: `Bounties::BountyApprovals` (r:1 w:1)
114 /// Proof: `Bounties::BountyApprovals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
115 /// The range of component `p` is `[0, 99]`.
116 fn on_initialize_proposals(p: u32, ) -> Weight {
117 // Proof Size summary in bytes:
118 // Measured: `451 + p * (251 ±0)`
119 // Estimated: `1887 + p * (5206 ±0)`
120 // Minimum execution time: 33_150_000 picoseconds.
121 Weight::from_parts(41_451_020, 1887)
122 // Standard Error: 19_018
123 .saturating_add(Weight::from_parts(34_410_759, 0).saturating_mul(p.into()))
124 .saturating_add(T::DbWeight::get().reads(3_u64))
125 .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(p.into())))
126 .saturating_add(T::DbWeight::get().writes(3_u64))
127 .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(p.into())))
128 .saturating_add(Weight::from_parts(0, 5206).saturating_mul(p.into()))
129 }
130}
131
132// For backwards compatibility and tests.
133impl WeightInfo for () {
134 /// Storage: `Treasury::ProposalCount` (r:1 w:1)
135 /// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
136 /// Storage: `Treasury::Proposals` (r:0 w:1)
137 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
138 fn propose_spend() -> Weight {
139 // Proof Size summary in bytes:
140 // Measured: `177`
141 // Estimated: `1489`
142 // Minimum execution time: 24_704_000 picoseconds.
143 Weight::from_parts(25_484_000, 1489)
144 .saturating_add(RocksDbWeight::get().reads(1_u64))
145 .saturating_add(RocksDbWeight::get().writes(2_u64))
146 }
147 /// Storage: `Treasury::Proposals` (r:1 w:1)
148 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
149 /// Storage: `System::Account` (r:1 w:1)
150 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
151 fn reject_proposal() -> Weight {
152 // Proof Size summary in bytes:
153 // Measured: `335`
154 // Estimated: `3593`
155 // Minimum execution time: 26_632_000 picoseconds.
156 Weight::from_parts(27_325_000, 3593)
157 .saturating_add(RocksDbWeight::get().reads(2_u64))
158 .saturating_add(RocksDbWeight::get().writes(2_u64))
159 }
160 /// Storage: `Treasury::Proposals` (r:1 w:0)
161 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
162 /// Storage: `Treasury::Approvals` (r:1 w:1)
163 /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
164 /// The range of component `p` is `[0, 99]`.
165 fn approve_proposal(p: u32, ) -> Weight {
166 // Proof Size summary in bytes:
167 // Measured: `504 + p * (8 ±0)`
168 // Estimated: `3573`
169 // Minimum execution time: 8_436_000 picoseconds.
170 Weight::from_parts(11_268_438, 3573)
171 // Standard Error: 1_039
172 .saturating_add(Weight::from_parts(70_903, 0).saturating_mul(p.into()))
173 .saturating_add(RocksDbWeight::get().reads(2_u64))
174 .saturating_add(RocksDbWeight::get().writes(1_u64))
175 }
176 /// Storage: `Treasury::Deactivated` (r:1 w:1)
177 /// Proof: `Treasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
178 /// Storage: `Treasury::Approvals` (r:1 w:1)
179 /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
180 /// Storage: `Treasury::Proposals` (r:99 w:99)
181 /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`)
182 /// Storage: `System::Account` (r:198 w:198)
183 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
184 /// Storage: `Bounties::BountyApprovals` (r:1 w:1)
185 /// Proof: `Bounties::BountyApprovals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`)
186 /// The range of component `p` is `[0, 99]`.
187 fn on_initialize_proposals(p: u32, ) -> Weight {
188 // Proof Size summary in bytes:
189 // Measured: `451 + p * (251 ±0)`
190 // Estimated: `1887 + p * (5206 ±0)`
191 // Minimum execution time: 33_150_000 picoseconds.
192 Weight::from_parts(41_451_020, 1887)
193 // Standard Error: 19_018
194 .saturating_add(Weight::from_parts(34_410_759, 0).saturating_mul(p.into()))
195 .saturating_add(RocksDbWeight::get().reads(3_u64))
196 .saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(p.into())))
197 .saturating_add(RocksDbWeight::get().writes(3_u64))
198 .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(p.into())))
199 .saturating_add(Weight::from_parts(0, 5206).saturating_mul(p.into()))
200 }
201}