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: `Timestamp::Now` (r:1 w:0)
42 /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode:
43 /// `MaxEncodedLen`)
44 /// Storage: `ValidatorCollators::SetReceivedAt` (r:0 w:1)
45 /// Proof: `ValidatorCollators::SetReceivedAt` (`max_values`: Some(1), `max_size`: Some(8),
46 /// added: 503, mode: `MaxEncodedLen`)
47 /// Storage: `ValidatorCollators::PendingRotation` (r:0 w:1)
48 /// Proof: `ValidatorCollators::PendingRotation` (`max_values`: Some(1), `max_size`: Some(1),
49 /// added: 496, mode: `MaxEncodedLen`)
50 /// The range of component `n` is `[1, 1000]`.
51 fn announce(n: u32) -> Weight {
52 Weight::from_parts(27_026_338, 33_994)
53 .saturating_add(Weight::from_parts(130_496, 0).saturating_mul(n.into()))
54 .saturating_add(T::DbWeight::get().reads(2_u64))
55 .saturating_add(T::DbWeight::get().writes(3_u64))
56 }
57 /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0)
58 /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added:
59 /// 2503, mode: `MaxEncodedLen`)
60 /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
61 /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode:
62 /// `Measured`)
63 /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1)
64 /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(2306),
65 /// added: 2801, mode: `MaxEncodedLen`)
66 /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0)
67 /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None,
68 /// mode: `Measured`)
69 /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:1 w:1)
70 /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506),
71 /// added: 107981, mode: `MaxEncodedLen`)
72 /// The range of component `n` is `[1, 1000]`.
73 fn send_announcement(n: u32) -> Weight {
74 Weight::from_parts(42_127_876, 108_971)
75 .saturating_add(Weight::from_parts(222_975, 64).saturating_mul(n.into()))
76 .saturating_add(T::DbWeight::get().reads(5_u64))
77 .saturating_add(T::DbWeight::get().writes(2_u64))
78 }
79}
80
81// For backwards compatibility and tests.
82impl WeightInfo for () {
83 /// Storage: `ValidatorCollators::ValidatorSet` (r:1 w:1)
84 /// Proof: `ValidatorCollators::ValidatorSet` (`max_values`: Some(1), `max_size`: Some(32006),
85 /// added: 32501, mode: `MaxEncodedLen`)
86 /// Storage: `Timestamp::Now` (r:1 w:0)
87 /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode:
88 /// `MaxEncodedLen`)
89 /// Storage: `ValidatorCollators::SetReceivedAt` (r:0 w:1)
90 /// Proof: `ValidatorCollators::SetReceivedAt` (`max_values`: Some(1), `max_size`: Some(8),
91 /// added: 503, mode: `MaxEncodedLen`)
92 /// Storage: `ValidatorCollators::PendingRotation` (r:0 w:1)
93 /// Proof: `ValidatorCollators::PendingRotation` (`max_values`: Some(1), `max_size`: Some(1),
94 /// added: 496, mode: `MaxEncodedLen`)
95 /// The range of component `n` is `[1, 1000]`.
96 fn announce(n: u32) -> Weight {
97 Weight::from_parts(27_026_338, 33_994)
98 .saturating_add(Weight::from_parts(130_496, 0).saturating_mul(n.into()))
99 .saturating_add(RocksDbWeight::get().reads(2_u64))
100 .saturating_add(RocksDbWeight::get().writes(3_u64))
101 }
102 /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0)
103 /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added:
104 /// 2503, mode: `MaxEncodedLen`)
105 /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
106 /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode:
107 /// `Measured`)
108 /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1)
109 /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(2306),
110 /// added: 2801, mode: `MaxEncodedLen`)
111 /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0)
112 /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None,
113 /// mode: `Measured`)
114 /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:1 w:1)
115 /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506),
116 /// added: 107981, mode: `MaxEncodedLen`)
117 /// The range of component `n` is `[1, 1000]`.
118 fn send_announcement(n: u32) -> Weight {
119 Weight::from_parts(42_127_876, 108_971)
120 .saturating_add(Weight::from_parts(222_975, 64).saturating_mul(n.into()))
121 .saturating_add(RocksDbWeight::get().reads(5_u64))
122 .saturating_add(RocksDbWeight::get().writes(2_u64))
123 }
124}