common_runtime/weights/
pallet_session.rs

1//! Autogenerated weights for pallet_session
2//!
3//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0
4//! DATE: 2025-08-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
5//! WORST CASE MAP SIZE: `1000000`
6//! HOSTNAME: `ip-10-173-5-194`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
7//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
8
9// Executed Command:
10// ./scripts/../target/release/frequency
11// benchmark
12// pallet
13// --pallet=pallet_session
14// --extrinsic
15// *
16// --heap-pages=4096
17// --steps=50
18// --repeat=20
19// --output=./scripts/../runtime/common/src/weights
20// --template=./scripts/../.maintain/runtime-weight-template.hbs
21// --additional-trie-layers=3
22// --runtime=./scripts/../target/release/wbuild/frequency-runtime/frequency_runtime.wasm
23// --genesis-builder=runtime
24
25#![cfg_attr(rustfmt, rustfmt_skip)]
26#![allow(unused_parens)]
27#![allow(unused_imports)]
28#![allow(missing_docs)]
29
30use frame_support::{traits::Get, weights::Weight};
31use core::marker::PhantomData;
32
33/// Weights for `pallet_session` using the Substrate node and recommended hardware.
34pub struct SubstrateWeight<T>(PhantomData<T>);
35impl<T: frame_system::Config> pallet_session::WeightInfo for SubstrateWeight<T> {
36	/// Storage: `Session::NextKeys` (r:1 w:1)
37	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
38	/// Storage: `Session::KeyOwner` (r:1 w:1)
39	/// Proof: `Session::KeyOwner` (`max_values`: None, `max_size`: None, mode: `Measured`)
40	fn set_keys() -> Weight {
41		// Proof Size summary in bytes:
42		//  Measured:  `298`
43		//  Estimated: `4258`
44		// Minimum execution time: 20_763_000 picoseconds.
45		Weight::from_parts(21_793_000, 4258)
46			.saturating_add(T::DbWeight::get().reads(2_u64))
47			.saturating_add(T::DbWeight::get().writes(2_u64))
48	}
49	/// Storage: `Session::NextKeys` (r:1 w:1)
50	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
51	/// Storage: `Session::KeyOwner` (r:0 w:1)
52	/// Proof: `Session::KeyOwner` (`max_values`: None, `max_size`: None, mode: `Measured`)
53	fn purge_keys() -> Weight {
54		// Proof Size summary in bytes:
55		//  Measured:  `280`
56		//  Estimated: `4240`
57		// Minimum execution time: 15_600_000 picoseconds.
58		Weight::from_parts(16_311_000, 4240)
59			.saturating_add(T::DbWeight::get().reads(1_u64))
60			.saturating_add(T::DbWeight::get().writes(2_u64))
61	}
62}
63
64
65#[cfg(test)]
66mod tests {
67  use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
68  use crate::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
69  use crate::weights::extrinsic_weights::ExtrinsicBaseWeight;
70
71  #[allow(dead_code)]
72  struct BlockWeights;
73  impl Get<frame_system::limits::BlockWeights> for BlockWeights {
74  	fn get() -> frame_system::limits::BlockWeights {
75  		frame_system::limits::BlockWeights::builder()
76  			.base_block(Weight::zero())
77  			.for_class(DispatchClass::all(), |weights| {
78  				weights.base_extrinsic = ExtrinsicBaseWeight::get();
79  			})
80  			.for_class(DispatchClass::non_mandatory(), |weights| {
81  				weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
82  			})
83  			.build_or_panic()
84  	}
85  }
86
87	#[test]
88	fn test_set_keys() {
89		assert!(
90			BlockWeights::get()
91				.per_class
92				.get(frame_support::dispatch::DispatchClass::Normal)
93				.max_extrinsic
94				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
95				.proof_size()
96				> 4258
97		);
98	}
99	#[test]
100	fn test_purge_keys() {
101		assert!(
102			BlockWeights::get()
103				.per_class
104				.get(frame_support::dispatch::DispatchClass::Normal)
105				.max_extrinsic
106				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
107				.proof_size()
108				> 4240
109		);
110	}
111}