pallet_validator_set_announcer/weights.rs
1// Copyright (C) Parity Technologies (UK) Ltd.
2// SPDX-License-Identifier: Apache-2.0
3
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16//! Default weights for `pallet_validator_set_announcer`.
17//!
18//! Runtimes should use their own benchmarked weights.
19
20#![allow(unused_parens)]
21#![allow(unused_imports)]
22
23use core::marker::PhantomData;
24use frame_support::{
25 traits::Get,
26 weights::{constants::RocksDbWeight, Weight},
27};
28
29/// Weight functions needed for `pallet_validator_set_announcer`.
30pub trait WeightInfo {
31 fn announce(n: u32) -> Weight;
32 fn send_announcement(n: u32) -> Weight;
33}
34
35/// Default weights for `pallet_validator_set_announcer`, see the module doc for their source.
36pub struct SubstrateWeight<T>(PhantomData<T>);
37impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
38 /// Storage: `ValidatorCollators::ValidatorSet` (r:1 w:1)
39 /// Proof: `ValidatorCollators::ValidatorSet` (`max_values`: Some(1), `max_size`: Some(32006),
40 /// added: 32501, mode: `MaxEncodedLen`)
41 /// Storage: `ValidatorCollators::PendingRotation` (r:0 w:1)
42 /// Proof: `ValidatorCollators::PendingRotation` (`max_values`: Some(1), `max_size`: Some(1),
43 /// added: 496, mode: `MaxEncodedLen`)
44 /// The range of component `n` is `[1, 1000]`.
45 fn announce(n: u32) -> Weight {
46 Weight::from_parts(27_026_338, 33_491)
47 .saturating_add(Weight::from_parts(130_496, 0).saturating_mul(n.into()))
48 .saturating_add(T::DbWeight::get().reads(1_u64))
49 .saturating_add(T::DbWeight::get().writes(2_u64))
50 }
51 /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0)
52 /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added:
53 /// 2503, mode: `MaxEncodedLen`)
54 /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
55 /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode:
56 /// `Measured`)
57 /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1)
58 /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(2306),
59 /// added: 2801, mode: `MaxEncodedLen`)
60 /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0)
61 /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None,
62 /// mode: `Measured`)
63 /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:1 w:1)
64 /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506),
65 /// added: 107981, mode: `MaxEncodedLen`)
66 /// The range of component `n` is `[1, 1000]`.
67 fn send_announcement(n: u32) -> Weight {
68 Weight::from_parts(42_127_876, 108_971)
69 .saturating_add(Weight::from_parts(222_975, 64).saturating_mul(n.into()))
70 .saturating_add(T::DbWeight::get().reads(5_u64))
71 .saturating_add(T::DbWeight::get().writes(2_u64))
72 }
73}
74
75// For backwards compatibility and tests.
76impl WeightInfo for () {
77 /// Storage: `ValidatorCollators::ValidatorSet` (r:1 w:1)
78 /// Proof: `ValidatorCollators::ValidatorSet` (`max_values`: Some(1), `max_size`: Some(32006),
79 /// added: 32501, mode: `MaxEncodedLen`)
80 /// Storage: `ValidatorCollators::PendingRotation` (r:0 w:1)
81 /// Proof: `ValidatorCollators::PendingRotation` (`max_values`: Some(1), `max_size`: Some(1),
82 /// added: 496, mode: `MaxEncodedLen`)
83 /// The range of component `n` is `[1, 1000]`.
84 fn announce(n: u32) -> Weight {
85 Weight::from_parts(27_026_338, 33_491)
86 .saturating_add(Weight::from_parts(130_496, 0).saturating_mul(n.into()))
87 .saturating_add(RocksDbWeight::get().reads(1_u64))
88 .saturating_add(RocksDbWeight::get().writes(2_u64))
89 }
90 /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0)
91 /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added:
92 /// 2503, mode: `MaxEncodedLen`)
93 /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
94 /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode:
95 /// `Measured`)
96 /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1)
97 /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(2306),
98 /// added: 2801, mode: `MaxEncodedLen`)
99 /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0)
100 /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None,
101 /// mode: `Measured`)
102 /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:1 w:1)
103 /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506),
104 /// added: 107981, mode: `MaxEncodedLen`)
105 /// The range of component `n` is `[1, 1000]`.
106 fn send_announcement(n: u32) -> Weight {
107 Weight::from_parts(42_127_876, 108_971)
108 .saturating_add(Weight::from_parts(222_975, 64).saturating_mul(n.into()))
109 .saturating_add(RocksDbWeight::get().reads(5_u64))
110 .saturating_add(RocksDbWeight::get().writes(2_u64))
111 }
112}