1
// Copyright (C) Moondance Labs Ltd.
2
// This file is part of Tanssi.
3

            
4
// Tanssi is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8

            
9
// Tanssi is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13

            
14
// You should have received a copy of the GNU General Public License
15
// along with Tanssi.  If not, see <http://www.gnu.org/licenses/>
16

            
17

            
18
//! Autogenerated weights for pallet_external_validators
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0
21
//! DATE: 2024-10-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22
//! WORST CASE MAP SIZE: `1000000`
23
//! HOSTNAME: `tomasz-XPS-15-9520`, CPU: `12th Gen Intel(R) Core(TM) i7-12700H`
24
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dancelight-dev"), DB CACHE: 1024
25

            
26
// Executed Command:
27
// target/release/tanssi-relay
28
// benchmark
29
// pallet
30
// --execution=wasm
31
// --wasm-execution=compiled
32
// --pallet
33
// pallet_external_validators
34
// --extrinsic
35
// *
36
// --chain=dancelight-dev
37
// --steps
38
// 50
39
// --repeat
40
// 20
41
// --template=benchmarking/frame-weight-pallet-template.hbs
42
// --json-file
43
// raw.json
44
// --output
45
// tmp/dancelight_weights/pallet_external_validators.rs
46

            
47
#![cfg_attr(rustfmt, rustfmt_skip)]
48
#![allow(unused_parens)]
49
#![allow(unused_imports)]
50

            
51
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
52
use sp_std::marker::PhantomData;
53

            
54
/// Weight functions needed for pallet_external_validators.
55
pub trait WeightInfo {
56
	fn skip_external_validators() -> Weight;
57
	fn add_whitelisted(b: u32, ) -> Weight;
58
	fn remove_whitelisted(b: u32, ) -> Weight;
59
	fn force_era() -> Weight;
60
	fn set_external_validators() -> Weight;
61
	fn new_session(r: u32, ) -> Weight;
62
}
63

            
64
/// Weights for pallet_external_validators using the Substrate node and recommended hardware.
65
pub struct SubstrateWeight<T>(PhantomData<T>);
66
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
67
	/// Storage: `ExternalValidators::SkipExternalValidators` (r:0 w:1)
68
	/// Proof: `ExternalValidators::SkipExternalValidators` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
69
	fn skip_external_validators() -> Weight {
70
		// Proof Size summary in bytes:
71
		//  Measured:  `0`
72
		//  Estimated: `0`
73
		// Minimum execution time: 1_391_000 picoseconds.
74
		Weight::from_parts(1_484_000, 0)
75
			.saturating_add(T::DbWeight::get().writes(1_u64))
76
	}
77
	/// Storage: `Session::NextKeys` (r:1 w:0)
78
	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
79
	/// Storage: `ExternalValidators::WhitelistedValidators` (r:1 w:1)
80
	/// Proof: `ExternalValidators::WhitelistedValidators` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
81
	/// The range of component `b` is `[1, 99]`.
82
	fn add_whitelisted(b: u32, ) -> Weight {
83
		// Proof Size summary in bytes:
84
		//  Measured:  `845 + b * (36 ±0)`
85
		//  Estimated: `4687 + b * (37 ±0)`
86
		// Minimum execution time: 12_829_000 picoseconds.
87
		Weight::from_parts(17_541_907, 4687)
88
			// Standard Error: 1_560
89
			.saturating_add(Weight::from_parts(62_143, 0).saturating_mul(b.into()))
90
			.saturating_add(T::DbWeight::get().reads(2_u64))
91
			.saturating_add(T::DbWeight::get().writes(1_u64))
92
			.saturating_add(Weight::from_parts(0, 37).saturating_mul(b.into()))
93
	}
94
	/// Storage: `ExternalValidators::WhitelistedValidators` (r:1 w:1)
95
	/// Proof: `ExternalValidators::WhitelistedValidators` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
96
	/// The range of component `b` is `[1, 100]`.
97
	fn remove_whitelisted(b: u32, ) -> Weight {
98
		// Proof Size summary in bytes:
99
		//  Measured:  `137 + b * (32 ±0)`
100
		//  Estimated: `4687`
101
		// Minimum execution time: 7_269_000 picoseconds.
102
		Weight::from_parts(9_100_286, 4687)
103
			// Standard Error: 626
104
			.saturating_add(Weight::from_parts(35_303, 0).saturating_mul(b.into()))
105
			.saturating_add(T::DbWeight::get().reads(1_u64))
106
			.saturating_add(T::DbWeight::get().writes(1_u64))
107
	}
108
	/// Storage: `ExternalValidators::ForceEra` (r:0 w:1)
109
	/// Proof: `ExternalValidators::ForceEra` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
110
	fn force_era() -> Weight {
111
		// Proof Size summary in bytes:
112
		//  Measured:  `0`
113
		//  Estimated: `0`
114
		// Minimum execution time: 4_578_000 picoseconds.
115
		Weight::from_parts(4_924_000, 0)
116
			.saturating_add(T::DbWeight::get().writes(1_u64))
117
	}
118
	/// Storage: `ExternalValidators::ForceEra` (r:0 w:1)
119
	/// Proof: `ExternalValidators::ForceEra` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
120
	fn set_external_validators() -> Weight {
121
		// Proof Size summary in bytes:
122
		//  Measured:  `0`
123
		//  Estimated: `0`
124
		// Minimum execution time: 4_578_000 picoseconds.
125
		Weight::from_parts(4_924_000, 0)
126
			.saturating_add(T::DbWeight::get().writes(1_u64))
127
	}
128
	/// Storage: `ExternalValidators::ForceEra` (r:1 w:0)
129
	/// Proof: `ExternalValidators::ForceEra` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
130
	/// Storage: `ExternalValidators::EraSessionStart` (r:1 w:1)
131
	/// Proof: `ExternalValidators::EraSessionStart` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
132
	/// Storage: `ExternalValidators::ActiveEra` (r:1 w:1)
133
	/// Proof: `ExternalValidators::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`)
134
	/// Storage: `ExternalValidators::WhitelistedValidators` (r:1 w:0)
135
	/// Proof: `ExternalValidators::WhitelistedValidators` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
136
	/// Storage: `ExternalValidators::SkipExternalValidators` (r:1 w:0)
137
	/// Proof: `ExternalValidators::SkipExternalValidators` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
138
	/// Storage: `ExternalValidators::ExternalValidators` (r:1 w:0)
139
	/// Proof: `ExternalValidators::ExternalValidators` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
140
	/// The range of component `r` is `[1, 100]`.
141
	fn new_session(r: u32, ) -> Weight {
142
		// Proof Size summary in bytes:
143
		//  Measured:  `137 + r * (32 ±0)`
144
		//  Estimated: `4687`
145
		// Minimum execution time: 8_587_000 picoseconds.
146
		Weight::from_parts(10_453_582, 4687)
147
			// Standard Error: 555
148
			.saturating_add(Weight::from_parts(27_159, 0).saturating_mul(r.into()))
149
			.saturating_add(T::DbWeight::get().reads(6_u64))
150
			.saturating_add(T::DbWeight::get().writes(2_u64))
151
	}
152
}
153

            
154
// For backwards compatibility and tests
155
impl WeightInfo for () {
156
	/// Storage: `ExternalValidators::SkipExternalValidators` (r:0 w:1)
157
	/// Proof: `ExternalValidators::SkipExternalValidators` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
158
	fn skip_external_validators() -> Weight {
159
		// Proof Size summary in bytes:
160
		//  Measured:  `0`
161
		//  Estimated: `0`
162
		// Minimum execution time: 1_391_000 picoseconds.
163
		Weight::from_parts(1_484_000, 0)
164
			.saturating_add(RocksDbWeight::get().writes(1_u64))
165
	}
166
	/// Storage: `Session::NextKeys` (r:1 w:0)
167
	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
168
	/// Storage: `ExternalValidators::WhitelistedValidators` (r:1 w:1)
169
	/// Proof: `ExternalValidators::WhitelistedValidators` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
170
	/// The range of component `b` is `[1, 99]`.
171
	fn add_whitelisted(b: u32, ) -> Weight {
172
		// Proof Size summary in bytes:
173
		//  Measured:  `845 + b * (36 ±0)`
174
		//  Estimated: `4687 + b * (37 ±0)`
175
		// Minimum execution time: 12_829_000 picoseconds.
176
		Weight::from_parts(17_541_907, 4687)
177
			// Standard Error: 1_560
178
			.saturating_add(Weight::from_parts(62_143, 0).saturating_mul(b.into()))
179
			.saturating_add(RocksDbWeight::get().reads(2_u64))
180
			.saturating_add(RocksDbWeight::get().writes(1_u64))
181
			.saturating_add(Weight::from_parts(0, 37).saturating_mul(b.into()))
182
	}
183
	/// Storage: `ExternalValidators::WhitelistedValidators` (r:1 w:1)
184
	/// Proof: `ExternalValidators::WhitelistedValidators` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
185
	/// The range of component `b` is `[1, 100]`.
186
	fn remove_whitelisted(b: u32, ) -> Weight {
187
		// Proof Size summary in bytes:
188
		//  Measured:  `137 + b * (32 ±0)`
189
		//  Estimated: `4687`
190
		// Minimum execution time: 7_269_000 picoseconds.
191
		Weight::from_parts(9_100_286, 4687)
192
			// Standard Error: 626
193
			.saturating_add(Weight::from_parts(35_303, 0).saturating_mul(b.into()))
194
			.saturating_add(RocksDbWeight::get().reads(1_u64))
195
			.saturating_add(RocksDbWeight::get().writes(1_u64))
196
	}
197
	/// Storage: `ExternalValidators::ForceEra` (r:0 w:1)
198
	/// Proof: `ExternalValidators::ForceEra` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
199
	fn force_era() -> Weight {
200
		// Proof Size summary in bytes:
201
		//  Measured:  `0`
202
		//  Estimated: `0`
203
		// Minimum execution time: 4_578_000 picoseconds.
204
		Weight::from_parts(4_924_000, 0)
205
			.saturating_add(RocksDbWeight::get().writes(1_u64))
206
	}
207
	/// Storage: `ExternalValidators::ForceEra` (r:0 w:1)
208
	/// Proof: `ExternalValidators::ForceEra` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
209
	fn set_external_validators() -> Weight {
210
		// Proof Size summary in bytes:
211
		//  Measured:  `0`
212
		//  Estimated: `0`
213
		// Minimum execution time: 4_578_000 picoseconds.
214
		Weight::from_parts(4_924_000, 0)
215
			.saturating_add(RocksDbWeight::get().writes(1_u64))
216
	}
217
	/// Storage: `ExternalValidators::ForceEra` (r:1 w:0)
218
	/// Proof: `ExternalValidators::ForceEra` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
219
	/// Storage: `ExternalValidators::EraSessionStart` (r:1 w:1)
220
	/// Proof: `ExternalValidators::EraSessionStart` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
221
	/// Storage: `ExternalValidators::ActiveEra` (r:1 w:1)
222
	/// Proof: `ExternalValidators::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`)
223
	/// Storage: `ExternalValidators::WhitelistedValidators` (r:1 w:0)
224
	/// Proof: `ExternalValidators::WhitelistedValidators` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
225
	/// Storage: `ExternalValidators::SkipExternalValidators` (r:1 w:0)
226
	/// Proof: `ExternalValidators::SkipExternalValidators` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
227
	/// Storage: `ExternalValidators::ExternalValidators` (r:1 w:0)
228
	/// Proof: `ExternalValidators::ExternalValidators` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
229
	/// The range of component `r` is `[1, 100]`.
230
	fn new_session(r: u32, ) -> Weight {
231
		// Proof Size summary in bytes:
232
		//  Measured:  `137 + r * (32 ±0)`
233
		//  Estimated: `4687`
234
		// Minimum execution time: 8_587_000 picoseconds.
235
		Weight::from_parts(10_453_582, 4687)
236
			// Standard Error: 555
237
			.saturating_add(Weight::from_parts(27_159, 0).saturating_mul(r.into()))
238
			.saturating_add(RocksDbWeight::get().reads(6_u64))
239
			.saturating_add(RocksDbWeight::get().writes(2_u64))
240
	}
241
}