referrerpolicy=no-referrer-when-downgrade

pallet_staking_async_rc_client/
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//! Autogenerated weights for `pallet_staking_async_rc_client`
19//!
20//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
21//! DATE: 2025-01-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22//! WORST CASE MAP SIZE: `1000000`
23//! HOSTNAME: `localhost`, CPU: `<UNKNOWN>`
24//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
25
26#![cfg_attr(rustfmt, rustfmt_skip)]
27#![allow(unused_parens)]
28#![allow(unused_imports)]
29#![allow(missing_docs)]
30#![allow(dead_code)]
31
32use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
33use core::marker::PhantomData;
34
35/// Weight functions needed for `pallet_staking_async_rc_client`.
36pub trait WeightInfo {
37	fn set_keys() -> Weight;
38	fn purge_keys() -> Weight;
39}
40
41/// Weights for `pallet_staking_async_rc_client` using the Substrate node and recommended hardware.
42pub struct SubstrateWeight<T>(PhantomData<T>);
43impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
44	/// Storage: `Staking::Validators` (r:1 w:0)
45	/// Proof: `Staking::Validators` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `MaxEncodedLen`)
46	///
47	/// This weight includes:
48	/// - One storage read to check if the caller is a validator
49	/// - Decoding session keys (6 public keys for Westend)
50	/// - Validating ownership proof (6 signature verifications)
51	/// - XCM message construction and sending
52	fn set_keys() -> Weight {
53		// Proof Size summary in bytes:
54		//  Measured:  `0`
55		//  Estimated: `3510`
56		// Minimum execution time: 150_000_000 picoseconds (placeholder - needs actual benchmarking)
57		// This is a conservative estimate accounting for:
58		// - 6 signature verifications (~20ms each = 120ms)
59		// - Key decoding and validation (~5ms)
60		// - Storage read and XCM construction (~5ms)
61		Weight::from_parts(150_000_000, 3510)
62			.saturating_add(T::DbWeight::get().reads(1_u64))
63	}
64
65	/// Storage: `Staking::Validators` (r:1 w:0)
66	/// Proof: `Staking::Validators` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `MaxEncodedLen`)
67	///
68	/// This weight includes:
69	/// - One storage read to check if the caller is a validator
70	/// - XCM message construction and sending
71	fn purge_keys() -> Weight {
72		// Proof Size summary in bytes:
73		//  Measured:  `0`
74		//  Estimated: `3510`
75		// Minimum execution time: 10_000_000 picoseconds (placeholder - needs actual benchmarking)
76		Weight::from_parts(10_000_000, 3510)
77			.saturating_add(T::DbWeight::get().reads(1_u64))
78	}
79}
80
81// For backwards compatibility and tests.
82impl WeightInfo for () {
83	fn set_keys() -> Weight {
84		Weight::from_parts(150_000_000, 3510)
85			.saturating_add(RocksDbWeight::get().reads(1_u64))
86	}
87
88	fn purge_keys() -> Weight {
89		Weight::from_parts(10_000_000, 3510)
90			.saturating_add(RocksDbWeight::get().reads(1_u64))
91	}
92}