pallet_im_online/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// This file is part of Substrate.
19
20// Copyright (C) Parity Technologies (UK) Ltd.
21// SPDX-License-Identifier: Apache-2.0
22
23// Licensed under the Apache License, Version 2.0 (the "License");
24// you may not use this file except in compliance with the License.
25// You may obtain a copy of the License at
26//
27// http://www.apache.org/licenses/LICENSE-2.0
28//
29// Unless required by applicable law or agreed to in writing, software
30// distributed under the License is distributed on an "AS IS" BASIS,
31// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32// See the License for the specific language governing permissions and
33// limitations under the License.
34
35//! Autogenerated weights for `pallet_im_online`
36//!
37//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
38//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
39//! WORST CASE MAP SIZE: `1000000`
40//! HOSTNAME: `4563561839a5`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
41//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
42
43// Executed Command:
44// frame-omni-bencher
45// v1
46// benchmark
47// pallet
48// --extrinsic=*
49// --runtime=target/production/wbuild/kitchensink-runtime/kitchensink_runtime.wasm
50// --pallet=pallet_im_online
51// --header=/__w/polkadot-sdk/polkadot-sdk/substrate/HEADER-APACHE2
52// --output=/__w/polkadot-sdk/polkadot-sdk/substrate/frame/im-online/src/weights.rs
53// --wasm-execution=compiled
54// --steps=50
55// --repeat=20
56// --heap-pages=4096
57// --template=substrate/.maintain/frame-weight-template.hbs
58// --no-storage-info
59// --no-min-squares
60// --no-median-slopes
61// --genesis-builder-policy=none
62// --exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic,pallet_nomination_pools,pallet_remark,pallet_transaction_storage,pallet_election_provider_multi_block,pallet_election_provider_multi_block::signed,pallet_election_provider_multi_block::unsigned,pallet_election_provider_multi_block::verifier
63
64#![cfg_attr(rustfmt, rustfmt_skip)]
65#![allow(unused_parens)]
66#![allow(unused_imports)]
67#![allow(missing_docs)]
68#![allow(dead_code)]
69
70use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
71use core::marker::PhantomData;
72
73/// Weight functions needed for `pallet_im_online`.
74pub trait WeightInfo {
75 fn heartbeat(k: u32, ) -> Weight;
76 fn authorize_heartbeat(k: u32, ) -> Weight;
77}
78
79/// Weights for `pallet_im_online` using the Substrate node and recommended hardware.
80pub struct SubstrateWeight<T>(PhantomData<T>);
81impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
82 /// Storage: `Session::CurrentIndex` (r:1 w:0)
83 /// Proof: `Session::CurrentIndex` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
84 /// Storage: `ImOnline::ReceivedHeartbeats` (r:1 w:1)
85 /// Proof: `ImOnline::ReceivedHeartbeats` (`max_values`: None, `max_size`: Some(25), added: 2500, mode: `MaxEncodedLen`)
86 /// Storage: `ImOnline::Keys` (r:1 w:0)
87 /// Proof: `ImOnline::Keys` (`max_values`: Some(1), `max_size`: Some(320002), added: 320497, mode: `MaxEncodedLen`)
88 /// The range of component `k` is `[1, 10000]`.
89 fn heartbeat(_k: u32, ) -> Weight {
90 // Proof Size summary in bytes:
91 // Measured: `4 + k * (32 ±0)`
92 // Estimated: `321494`
93 // Minimum execution time: 11_000_000 picoseconds.
94 Weight::from_parts(220_000_000, 321494)
95 .saturating_add(T::DbWeight::get().reads(3_u64))
96 .saturating_add(T::DbWeight::get().writes(1_u64))
97 }
98 /// Storage: `Session::Validators` (r:1 w:0)
99 /// Proof: `Session::Validators` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
100 /// Storage: `Session::CurrentIndex` (r:1 w:0)
101 /// Proof: `Session::CurrentIndex` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
102 /// Storage: `ImOnline::Keys` (r:1 w:0)
103 /// Proof: `ImOnline::Keys` (`max_values`: Some(1), `max_size`: Some(320002), added: 320497, mode: `MaxEncodedLen`)
104 /// The range of component `k` is `[1, 10000]`.
105 fn authorize_heartbeat(_k: u32, ) -> Weight {
106 // Proof Size summary in bytes:
107 // Measured: `4 + k * (32 ±0)`
108 // Estimated: `321494`
109 // Minimum execution time: 46_000_000 picoseconds.
110 Weight::from_parts(135_000_000, 321494)
111 .saturating_add(T::DbWeight::get().reads(3_u64))
112 }
113}
114
115// For backwards compatibility and tests.
116impl WeightInfo for () {
117 /// Storage: `Session::CurrentIndex` (r:1 w:0)
118 /// Proof: `Session::CurrentIndex` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
119 /// Storage: `ImOnline::ReceivedHeartbeats` (r:1 w:1)
120 /// Proof: `ImOnline::ReceivedHeartbeats` (`max_values`: None, `max_size`: Some(25), added: 2500, mode: `MaxEncodedLen`)
121 /// Storage: `ImOnline::Keys` (r:1 w:0)
122 /// Proof: `ImOnline::Keys` (`max_values`: Some(1), `max_size`: Some(320002), added: 320497, mode: `MaxEncodedLen`)
123 /// The range of component `k` is `[1, 10000]`.
124 fn heartbeat(_k: u32, ) -> Weight {
125 // Proof Size summary in bytes:
126 // Measured: `4 + k * (32 ±0)`
127 // Estimated: `321494`
128 // Minimum execution time: 11_000_000 picoseconds.
129 Weight::from_parts(220_000_000, 321494)
130 .saturating_add(RocksDbWeight::get().reads(3_u64))
131 .saturating_add(RocksDbWeight::get().writes(1_u64))
132 }
133 /// Storage: `Session::Validators` (r:1 w:0)
134 /// Proof: `Session::Validators` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
135 /// Storage: `Session::CurrentIndex` (r:1 w:0)
136 /// Proof: `Session::CurrentIndex` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
137 /// Storage: `ImOnline::Keys` (r:1 w:0)
138 /// Proof: `ImOnline::Keys` (`max_values`: Some(1), `max_size`: Some(320002), added: 320497, mode: `MaxEncodedLen`)
139 /// The range of component `k` is `[1, 10000]`.
140 fn authorize_heartbeat(_k: u32, ) -> Weight {
141 // Proof Size summary in bytes:
142 // Measured: `4 + k * (32 ±0)`
143 // Estimated: `321494`
144 // Minimum execution time: 46_000_000 picoseconds.
145 Weight::from_parts(135_000_000, 321494)
146 .saturating_add(RocksDbWeight::get().reads(3_u64))
147 }
148}