pallet_frequency_tx_payment/weights.rs
1
2//! Autogenerated weights for `pallet_frequency_tx_payment`
3//!
4//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0
5//! DATE: 2025-08-20, STEPS: `20`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
6//! WORST CASE MAP SIZE: `1000000`
7//! HOSTNAME: `ip-10-173-5-194`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
8//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
9
10// Executed Command:
11// ./scripts/../target/release/frequency
12// benchmark
13// pallet
14// --pallet=pallet_frequency-tx-payment
15// --extrinsic
16// *
17// --heap-pages=4096
18// --steps=20
19// --repeat=10
20// --output=./scripts/../pallets/frequency-tx-payment/src/weights.rs
21// --template=./scripts/../.maintain/frame-weight-template.hbs
22// --additional-trie-layers=3
23// --runtime=./scripts/../target/release/wbuild/frequency-runtime/frequency_runtime.wasm
24// --genesis-builder=runtime
25
26#![cfg_attr(rustfmt, rustfmt_skip)]
27#![allow(unused_parens)]
28#![allow(unused_imports)]
29#![allow(missing_docs)]
30
31use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
32use core::marker::PhantomData;
33
34/// Weight functions needed for `pallet_frequency_tx_payment`.
35pub trait WeightInfo {
36 fn pay_with_capacity() -> Weight;
37 fn pay_with_capacity_batch_all(n: u32, ) -> Weight;
38 fn charge_tx_payment_free() -> Weight;
39 fn charge_tx_payment_token_based() -> Weight;
40 fn charge_tx_payment_capacity_based() -> Weight;
41}
42
43/// Weights for `pallet_frequency_tx_payment` using the Substrate node and recommended hardware.
44pub struct SubstrateWeight<T>(PhantomData<T>);
45impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
46 fn pay_with_capacity() -> Weight {
47 // Proof Size summary in bytes:
48 // Measured: `0`
49 // Estimated: `0`
50 // Minimum execution time: 3_769_000 picoseconds.
51 Weight::from_parts(3_991_000, 0)
52 }
53 /// The range of component `n` is `[0, 10]`.
54 fn pay_with_capacity_batch_all(n: u32, ) -> Weight {
55 // Proof Size summary in bytes:
56 // Measured: `0`
57 // Estimated: `0`
58 // Minimum execution time: 6_545_000 picoseconds.
59 Weight::from_parts(7_940_868, 0)
60 // Standard Error: 13_038
61 .saturating_add(Weight::from_parts(3_585_981, 0).saturating_mul(n.into()))
62 }
63 fn charge_tx_payment_free() -> Weight {
64 // Proof Size summary in bytes:
65 // Measured: `0`
66 // Estimated: `0`
67 // Minimum execution time: 895_000 picoseconds.
68 Weight::from_parts(975_000, 0)
69 }
70 fn charge_tx_payment_token_based() -> Weight {
71 // Proof Size summary in bytes:
72 // Measured: `0`
73 // Estimated: `0`
74 // Minimum execution time: 29_227_000 picoseconds.
75 Weight::from_parts(29_879_000, 0)
76 }
77 /// Storage: `System::Account` (r:1 w:0)
78 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
79 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
80 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
81 /// Storage: `Capacity::CapacityLedger` (r:1 w:1)
82 /// Proof: `Capacity::CapacityLedger` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`)
83 fn charge_tx_payment_capacity_based() -> Weight {
84 // Proof Size summary in bytes:
85 // Measured: `299`
86 // Estimated: `4088`
87 // Minimum execution time: 29_292_000 picoseconds.
88 Weight::from_parts(30_023_000, 4088)
89 .saturating_add(T::DbWeight::get().reads(3_u64))
90 .saturating_add(T::DbWeight::get().writes(1_u64))
91 }
92}
93
94// For backwards compatibility and tests.
95impl WeightInfo for () {
96 fn pay_with_capacity() -> Weight {
97 // Proof Size summary in bytes:
98 // Measured: `0`
99 // Estimated: `0`
100 // Minimum execution time: 3_769_000 picoseconds.
101 Weight::from_parts(3_991_000, 0)
102 }
103 /// The range of component `n` is `[0, 10]`.
104 fn pay_with_capacity_batch_all(n: u32, ) -> Weight {
105 // Proof Size summary in bytes:
106 // Measured: `0`
107 // Estimated: `0`
108 // Minimum execution time: 6_545_000 picoseconds.
109 Weight::from_parts(7_940_868, 0)
110 // Standard Error: 13_038
111 .saturating_add(Weight::from_parts(3_585_981, 0).saturating_mul(n.into()))
112 }
113 fn charge_tx_payment_free() -> Weight {
114 // Proof Size summary in bytes:
115 // Measured: `0`
116 // Estimated: `0`
117 // Minimum execution time: 895_000 picoseconds.
118 Weight::from_parts(975_000, 0)
119 }
120 fn charge_tx_payment_token_based() -> Weight {
121 // Proof Size summary in bytes:
122 // Measured: `0`
123 // Estimated: `0`
124 // Minimum execution time: 29_227_000 picoseconds.
125 Weight::from_parts(29_879_000, 0)
126 }
127 /// Storage: `System::Account` (r:1 w:0)
128 /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
129 /// Storage: `Msa::PublicKeyToMsaId` (r:1 w:0)
130 /// Proof: `Msa::PublicKeyToMsaId` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
131 /// Storage: `Capacity::CapacityLedger` (r:1 w:1)
132 /// Proof: `Capacity::CapacityLedger` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`)
133 fn charge_tx_payment_capacity_based() -> Weight {
134 // Proof Size summary in bytes:
135 // Measured: `299`
136 // Estimated: `4088`
137 // Minimum execution time: 29_292_000 picoseconds.
138 Weight::from_parts(30_023_000, 4088)
139 .saturating_add(RocksDbWeight::get().reads(3_u64))
140 .saturating_add(RocksDbWeight::get().writes(1_u64))
141 }
142}
143
144
145#[cfg(test)]
146mod tests {
147 use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
148 use common_runtime::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
149 use common_runtime::weights::extrinsic_weights::ExtrinsicBaseWeight;
150
151 #[allow(dead_code)]
152 struct BlockWeights;
153 impl Get<frame_system::limits::BlockWeights> for BlockWeights {
154 fn get() -> frame_system::limits::BlockWeights {
155 frame_system::limits::BlockWeights::builder()
156 .base_block(Weight::zero())
157 .for_class(DispatchClass::all(), |weights| {
158 weights.base_extrinsic = ExtrinsicBaseWeight::get();
159 })
160 .for_class(DispatchClass::non_mandatory(), |weights| {
161 weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
162 })
163 .build_or_panic()
164 }
165 }
166
167 #[test]
168 fn test_charge_tx_payment_capacity_based() {
169 assert!(
170 BlockWeights::get()
171 .per_class
172 .get(frame_support::dispatch::DispatchClass::Normal)
173 .max_extrinsic
174 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
175 .proof_size()
176 > 4088
177 );
178 }
179}