common_runtime/weights/pallet_timestamp.rs
1//! Autogenerated weights for pallet_timestamp
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_timestamp
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_timestamp` using the Substrate node and recommended hardware.
34pub struct SubstrateWeight<T>(PhantomData<T>);
35impl<T: frame_system::Config> pallet_timestamp::WeightInfo for SubstrateWeight<T> {
36 /// Storage: `Timestamp::Now` (r:1 w:1)
37 /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
38 /// Storage: `Aura::CurrentSlot` (r:1 w:0)
39 /// Proof: `Aura::CurrentSlot` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
40 fn set() -> Weight {
41 // Proof Size summary in bytes:
42 // Measured: `156`
43 // Estimated: `1988`
44 // Minimum execution time: 10_446_000 picoseconds.
45 Weight::from_parts(10_897_000, 1988)
46 .saturating_add(T::DbWeight::get().reads(2_u64))
47 .saturating_add(T::DbWeight::get().writes(1_u64))
48 }
49 fn on_finalize() -> Weight {
50 // Proof Size summary in bytes:
51 // Measured: `128`
52 // Estimated: `0`
53 // Minimum execution time: 4_368_000 picoseconds.
54 Weight::from_parts(4_536_000, 0)
55 }
56}
57
58
59#[cfg(test)]
60mod tests {
61 use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
62 use crate::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
63 use crate::weights::extrinsic_weights::ExtrinsicBaseWeight;
64
65 #[allow(dead_code)]
66 struct BlockWeights;
67 impl Get<frame_system::limits::BlockWeights> for BlockWeights {
68 fn get() -> frame_system::limits::BlockWeights {
69 frame_system::limits::BlockWeights::builder()
70 .base_block(Weight::zero())
71 .for_class(DispatchClass::all(), |weights| {
72 weights.base_extrinsic = ExtrinsicBaseWeight::get();
73 })
74 .for_class(DispatchClass::non_mandatory(), |weights| {
75 weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
76 })
77 .build_or_panic()
78 }
79 }
80
81 #[test]
82 fn test_set() {
83 assert!(
84 BlockWeights::get()
85 .per_class
86 .get(frame_support::dispatch::DispatchClass::Normal)
87 .max_extrinsic
88 .unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
89 .proof_size()
90 > 1988
91 );
92 }
93}