referrerpolicy=no-referrer-when-downgrade

pallet_sudo/
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_sudo`
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_sudo
51// --header=/__w/polkadot-sdk/polkadot-sdk/substrate/HEADER-APACHE2
52// --output=/__w/polkadot-sdk/polkadot-sdk/substrate/frame/sudo/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_sudo`.
74pub trait WeightInfo {
75	fn set_key() -> Weight;
76	fn sudo() -> Weight;
77	fn sudo_as() -> Weight;
78	fn remove_key() -> Weight;
79	fn check_only_sudo_account() -> Weight;
80}
81
82/// Weights for `pallet_sudo` using the Substrate node and recommended hardware.
83pub struct SubstrateWeight<T>(PhantomData<T>);
84impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
85	/// Storage: `Sudo::Key` (r:1 w:1)
86	/// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
87	fn set_key() -> Weight {
88		// Proof Size summary in bytes:
89		//  Measured:  `37`
90		//  Estimated: `1517`
91		// Minimum execution time: 6_860_000 picoseconds.
92		Weight::from_parts(7_237_000, 1517)
93			.saturating_add(T::DbWeight::get().reads(1_u64))
94			.saturating_add(T::DbWeight::get().writes(1_u64))
95	}
96	/// Storage: `Sudo::Key` (r:1 w:0)
97	/// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
98	fn sudo() -> Weight {
99		// Proof Size summary in bytes:
100		//  Measured:  `37`
101		//  Estimated: `1517`
102		// Minimum execution time: 7_643_000 picoseconds.
103		Weight::from_parts(7_939_000, 1517)
104			.saturating_add(T::DbWeight::get().reads(1_u64))
105	}
106	/// Storage: `Sudo::Key` (r:1 w:0)
107	/// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
108	fn sudo_as() -> Weight {
109		// Proof Size summary in bytes:
110		//  Measured:  `37`
111		//  Estimated: `1517`
112		// Minimum execution time: 7_562_000 picoseconds.
113		Weight::from_parts(7_870_000, 1517)
114			.saturating_add(T::DbWeight::get().reads(1_u64))
115	}
116	/// Storage: `Sudo::Key` (r:1 w:1)
117	/// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
118	fn remove_key() -> Weight {
119		// Proof Size summary in bytes:
120		//  Measured:  `37`
121		//  Estimated: `1517`
122		// Minimum execution time: 6_135_000 picoseconds.
123		Weight::from_parts(6_417_000, 1517)
124			.saturating_add(T::DbWeight::get().reads(1_u64))
125			.saturating_add(T::DbWeight::get().writes(1_u64))
126	}
127	/// Storage: `Sudo::Key` (r:1 w:0)
128	/// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
129	fn check_only_sudo_account() -> Weight {
130		// Proof Size summary in bytes:
131		//  Measured:  `37`
132		//  Estimated: `1517`
133		// Minimum execution time: 2_085_000 picoseconds.
134		Weight::from_parts(2_170_000, 1517)
135			.saturating_add(T::DbWeight::get().reads(1_u64))
136	}
137}
138
139// For backwards compatibility and tests.
140impl WeightInfo for () {
141	/// Storage: `Sudo::Key` (r:1 w:1)
142	/// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
143	fn set_key() -> Weight {
144		// Proof Size summary in bytes:
145		//  Measured:  `37`
146		//  Estimated: `1517`
147		// Minimum execution time: 6_860_000 picoseconds.
148		Weight::from_parts(7_237_000, 1517)
149			.saturating_add(RocksDbWeight::get().reads(1_u64))
150			.saturating_add(RocksDbWeight::get().writes(1_u64))
151	}
152	/// Storage: `Sudo::Key` (r:1 w:0)
153	/// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
154	fn sudo() -> Weight {
155		// Proof Size summary in bytes:
156		//  Measured:  `37`
157		//  Estimated: `1517`
158		// Minimum execution time: 7_643_000 picoseconds.
159		Weight::from_parts(7_939_000, 1517)
160			.saturating_add(RocksDbWeight::get().reads(1_u64))
161	}
162	/// Storage: `Sudo::Key` (r:1 w:0)
163	/// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
164	fn sudo_as() -> Weight {
165		// Proof Size summary in bytes:
166		//  Measured:  `37`
167		//  Estimated: `1517`
168		// Minimum execution time: 7_562_000 picoseconds.
169		Weight::from_parts(7_870_000, 1517)
170			.saturating_add(RocksDbWeight::get().reads(1_u64))
171	}
172	/// Storage: `Sudo::Key` (r:1 w:1)
173	/// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
174	fn remove_key() -> Weight {
175		// Proof Size summary in bytes:
176		//  Measured:  `37`
177		//  Estimated: `1517`
178		// Minimum execution time: 6_135_000 picoseconds.
179		Weight::from_parts(6_417_000, 1517)
180			.saturating_add(RocksDbWeight::get().reads(1_u64))
181			.saturating_add(RocksDbWeight::get().writes(1_u64))
182	}
183	/// Storage: `Sudo::Key` (r:1 w:0)
184	/// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
185	fn check_only_sudo_account() -> Weight {
186		// Proof Size summary in bytes:
187		//  Measured:  `37`
188		//  Estimated: `1517`
189		// Minimum execution time: 2_085_000 picoseconds.
190		Weight::from_parts(2_170_000, 1517)
191			.saturating_add(RocksDbWeight::get().reads(1_u64))
192	}
193}