1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293
//! Autogenerated weights for pallet_treasury
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2024-05-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `ip-10-173-4-53`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("frequency-bench"), DB CACHE: 1024
// Executed Command:
// ./scripts/../target/release/frequency
// benchmark
// pallet
// --pallet=pallet_treasury
// --extrinsic
// *
// --chain=frequency-bench
// --heap-pages=4096
// --wasm-execution=compiled
// --additional-trie-layers=5
// --steps=50
// --repeat=20
// --output=./scripts/../runtime/common/src/weights
// --template=./scripts/../.maintain/runtime-weight-template.hbs
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;
/// Weights for `pallet_treasury` using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_treasury::WeightInfo for SubstrateWeight<T> {
/// Storage: Treasury ProposalCount (r:1 w:1)
/// Proof: Treasury ProposalCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Treasury Approvals (r:1 w:1)
/// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen)
/// Storage: Treasury Proposals (r:0 w:1)
/// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen)
fn spend_local() -> Weight {
// Proof Size summary in bytes:
// Measured: `42`
// Estimated: `1887`
// Minimum execution time: 177_000_000 picoseconds.
Weight::from_parts(191_000_000, 0)
.saturating_add(Weight::from_parts(0, 1887))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: Treasury ProposalCount (r:1 w:1)
/// Proof: Treasury ProposalCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Treasury Proposals (r:0 w:1)
/// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen)
fn propose_spend() -> Weight {
// Proof Size summary in bytes:
// Measured: `143`
// Estimated: `1489`
// Minimum execution time: 354_000_000 picoseconds.
Weight::from_parts(376_000_000, 0)
.saturating_add(Weight::from_parts(0, 1489))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Treasury Proposals (r:1 w:1)
/// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen)
/// Storage: System Account (r:1 w:1)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
fn reject_proposal() -> Weight {
// Proof Size summary in bytes:
// Measured: `301`
// Estimated: `3593`
// Minimum execution time: 547_000_000 picoseconds.
Weight::from_parts(550_000_000, 0)
.saturating_add(Weight::from_parts(0, 3593))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Treasury Proposals (r:1 w:0)
/// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen)
/// Storage: Treasury Approvals (r:1 w:1)
/// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen)
/// The range of component `p` is `[0, 99]`.
fn approve_proposal(p: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `470 + p * (8 ±0)`
// Estimated: `3573`
// Minimum execution time: 104_000_000 picoseconds.
Weight::from_parts(121_184_402, 0)
.saturating_add(Weight::from_parts(0, 3573))
// Standard Error: 42_854
.saturating_add(Weight::from_parts(153_112, 0).saturating_mul(p.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Treasury Approvals (r:1 w:1)
/// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen)
fn remove_approval() -> Weight {
// Proof Size summary in bytes:
// Measured: `127`
// Estimated: `1887`
// Minimum execution time: 80_000_000 picoseconds.
Weight::from_parts(82_000_000, 0)
.saturating_add(Weight::from_parts(0, 1887))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: Treasury Deactivated (r:1 w:1)
/// Proof: Treasury Deactivated (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
/// Storage: Balances InactiveIssuance (r:1 w:1)
/// Proof: Balances InactiveIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
/// Storage: Treasury Approvals (r:1 w:1)
/// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen)
/// Storage: Treasury Proposals (r:99 w:99)
/// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen)
/// Storage: System Account (r:199 w:199)
/// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
/// Storage: Bounties BountyApprovals (r:1 w:1)
/// Proof: Bounties BountyApprovals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen)
/// The range of component `p` is `[0, 99]`.
fn on_initialize_proposals(p: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `331 + p * (251 ±0)`
// Estimated: `3593 + p * (5206 ±0)`
// Minimum execution time: 887_000_000 picoseconds.
Weight::from_parts(828_616_021, 0)
.saturating_add(Weight::from_parts(0, 3593))
// Standard Error: 695_351
.saturating_add(Weight::from_parts(566_114_524, 0).saturating_mul(p.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(p.into())))
.saturating_add(T::DbWeight::get().writes(5))
.saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(p.into())))
.saturating_add(Weight::from_parts(0, 5206).saturating_mul(p.into()))
}
/// Storage: AssetRate ConversionRateToNative (r:1 w:0)
/// Proof: AssetRate ConversionRateToNative (max_values: None, max_size: Some(1237), added: 3712, mode: MaxEncodedLen)
/// Storage: Treasury SpendCount (r:1 w:1)
/// Proof: Treasury SpendCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Treasury Spends (r:0 w:1)
/// Proof: Treasury Spends (max_values: None, max_size: Some(1848), added: 4323, mode: MaxEncodedLen)
fn spend() -> Weight {
// Proof Size summary in bytes:
// Measured: `114`
// Estimated: `4702`
// Minimum execution time: 208_000_000 picoseconds.
Weight::from_parts(222_000_000, 0)
.saturating_add(Weight::from_parts(0, 4702))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Treasury Spends (r:1 w:1)
/// Proof: Treasury Spends (max_values: None, max_size: Some(1848), added: 4323, mode: MaxEncodedLen)
/// Storage: XcmPallet QueryCounter (r:1 w:1)
/// Proof Skipped: XcmPallet QueryCounter (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Configuration ActiveConfig (r:1 w:0)
/// Proof Skipped: Configuration ActiveConfig (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Dmp DeliveryFeeFactor (r:1 w:0)
/// Proof Skipped: Dmp DeliveryFeeFactor (max_values: None, max_size: None, mode: Measured)
/// Storage: XcmPallet SupportedVersion (r:1 w:0)
/// Proof Skipped: XcmPallet SupportedVersion (max_values: None, max_size: None, mode: Measured)
/// Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
/// Proof Skipped: XcmPallet VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: XcmPallet SafeXcmVersion (r:1 w:0)
/// Proof Skipped: XcmPallet SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Dmp DownwardMessageQueues (r:1 w:1)
/// Proof Skipped: Dmp DownwardMessageQueues (max_values: None, max_size: None, mode: Measured)
/// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
/// Proof Skipped: Dmp DownwardMessageQueueHeads (max_values: None, max_size: None, mode: Measured)
/// Storage: XcmPallet Queries (r:0 w:1)
/// Proof Skipped: XcmPallet Queries (max_values: None, max_size: None, mode: Measured)
fn payout() -> Weight {
// Proof Size summary in bytes:
// Measured: `737`
// Estimated: `5313`
// Minimum execution time: 551_000_000 picoseconds.
Weight::from_parts(569_000_000, 0)
.saturating_add(Weight::from_parts(0, 5313))
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(6))
}
/// Storage: Treasury Spends (r:1 w:1)
/// Proof: Treasury Spends (max_values: None, max_size: Some(1848), added: 4323, mode: MaxEncodedLen)
/// Storage: XcmPallet Queries (r:1 w:1)
/// Proof Skipped: XcmPallet Queries (max_values: None, max_size: None, mode: Measured)
fn check_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `442`
// Estimated: `5313`
// Minimum execution time: 245_000_000 picoseconds.
Weight::from_parts(281_000_000, 0)
.saturating_add(Weight::from_parts(0, 5313))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: Treasury Spends (r:1 w:1)
/// Proof: Treasury Spends (max_values: None, max_size: Some(1848), added: 4323, mode: MaxEncodedLen)
fn void_spend() -> Weight {
// Proof Size summary in bytes:
// Measured: `172`
// Estimated: `5313`
// Minimum execution time: 147_000_000 picoseconds.
Weight::from_parts(160_000_000, 0)
.saturating_add(Weight::from_parts(0, 5313))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
}
#[cfg(test)]
mod tests {
use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
use crate::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
use crate::weights::extrinsic_weights::ExtrinsicBaseWeight;
struct BlockWeights;
impl Get<frame_system::limits::BlockWeights> for BlockWeights {
fn get() -> frame_system::limits::BlockWeights {
frame_system::limits::BlockWeights::builder()
.base_block(Weight::zero())
.for_class(DispatchClass::all(), |weights| {
weights.base_extrinsic = ExtrinsicBaseWeight::get().into();
})
.for_class(DispatchClass::non_mandatory(), |weights| {
weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
})
.build_or_panic()
}
}
#[test]
fn test_propose_spend() {
assert!(
BlockWeights::get()
.per_class
.get(frame_support::dispatch::DispatchClass::Normal)
.max_extrinsic
.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
.proof_size()
> 2974
);
}
#[test]
fn test_reject_proposal() {
assert!(
BlockWeights::get()
.per_class
.get(frame_support::dispatch::DispatchClass::Normal)
.max_extrinsic
.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
.proof_size()
> 5078
);
}
#[test]
fn test_approve_proposal() {
assert!(
BlockWeights::get()
.per_class
.get(frame_support::dispatch::DispatchClass::Normal)
.max_extrinsic
.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
.proof_size()
> 5058
);
}
#[test]
fn test_remove_approval() {
assert!(
BlockWeights::get()
.per_class
.get(frame_support::dispatch::DispatchClass::Normal)
.max_extrinsic
.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
.proof_size()
> 3228
);
}
#[test]
fn test_on_initialize_proposals() {
assert!(
BlockWeights::get()
.per_class
.get(frame_support::dispatch::DispatchClass::Normal)
.max_extrinsic
.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
.proof_size()
> 5078
);
}
}