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_validator_slashes
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0
21
//! DATE: 2024-10-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22
//! WORST CASE MAP SIZE: `1000000`
23
//! HOSTNAME: `girazoki-XPS-15-9530`, CPU: `13th Gen Intel(R) Core(TM) i9-13900H`
24
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("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_validator_slashes
34
// --extrinsic
35
// *
36
// --chain=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/pallet_external_validator_slashes.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_validator_slashes.
55
pub trait WeightInfo {
56
	fn cancel_deferred_slash(s: u32, ) -> Weight;
57
	fn force_inject_slash() -> Weight;
58
	fn root_test_send_msg_to_eth() -> Weight;
59
	fn process_slashes_queue(s: u32, ) -> Weight;
60
}
61

            
62
/// Weights for pallet_external_validator_slashes using the Substrate node and recommended hardware.
63
pub struct SubstrateWeight<T>(PhantomData<T>);
64
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
65
	/// Storage: `ExternalValidators::ActiveEra` (r:1 w:0)
66
	/// Proof: `ExternalValidators::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`)
67
	/// Storage: `ExternalValidatorSlashes::Slashes` (r:1 w:1)
68
	/// Proof: `ExternalValidatorSlashes::Slashes` (`max_values`: None, `max_size`: None, mode: `Measured`)
69
	/// The range of component `s` is `[1, 1000]`.
70
	fn cancel_deferred_slash(s: u32, ) -> Weight {
71
		// Proof Size summary in bytes:
72
		//  Measured:  `42194`
73
		//  Estimated: `45659`
74
		// Minimum execution time: 69_654_000 picoseconds.
75
		Weight::from_parts(430_467_141, 45659)
76
			// Standard Error: 25_862
77
			.saturating_add(Weight::from_parts(2_233_402, 0).saturating_mul(s.into()))
78
			.saturating_add(T::DbWeight::get().reads(2_u64))
79
			.saturating_add(T::DbWeight::get().writes(1_u64))
80
	}
81
	/// Storage: `ExternalValidators::ActiveEra` (r:1 w:0)
82
	/// Proof: `ExternalValidators::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`)
83
	/// Storage: `ExternalValidatorSlashes::NextSlashId` (r:1 w:1)
84
	/// Proof: `ExternalValidatorSlashes::NextSlashId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
85
	/// Storage: `ExternalValidatorSlashes::Slashes` (r:1 w:1)
86
	/// Proof: `ExternalValidatorSlashes::Slashes` (`max_values`: None, `max_size`: None, mode: `Measured`)
87
	fn force_inject_slash() -> Weight {
88
		// Proof Size summary in bytes:
89
		//  Measured:  `151`
90
		//  Estimated: `3616`
91
		// Minimum execution time: 7_086_000 picoseconds.
92
		Weight::from_parts(7_402_000, 3616)
93
			.saturating_add(T::DbWeight::get().reads(3_u64))
94
			.saturating_add(T::DbWeight::get().writes(2_u64))
95
	}
96

            
97
	fn root_test_send_msg_to_eth() -> Weight {
98
		// Proof Size summary in bytes:
99
		//  Measured:  `322`
100
		//  Estimated: `3601`
101
		// Minimum execution time: 994_654_000 picoseconds.
102
		Weight::from_parts(1_015_195_000, 3601)
103
			.saturating_add(T::DbWeight::get().reads(3_u64))
104
			.saturating_add(T::DbWeight::get().writes(5_u64))
105
	}
106
	/// Storage: `ExternalValidators::ActiveEra` (r:1 w:0)
107
	/// Proof: `ExternalValidators::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`)
108
	/// Storage: `ExternalValidatorSlashes::UnreportedSlashesQueue` (r:1 w:1)
109
	/// Proof: `ExternalValidatorSlashes::UnreportedSlashesQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
110
	/// Storage: `Timestamp::Now` (r:1 w:0)
111
	/// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
112
	/// Storage: `EthereumSystem::Channels` (r:1 w:0)
113
	/// Proof: `EthereumSystem::Channels` (`max_values`: None, `max_size`: Some(76), added: 2551, mode: `MaxEncodedLen`)
114
	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
115
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(136), added: 2611, mode: `MaxEncodedLen`)
116
	/// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
117
	/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(33), added: 528, mode: `MaxEncodedLen`)
118
	/// Storage: UNKNOWN KEY `0x3a72656c61795f64697370617463685f71756575655f72656d61696e696e675f` (r:0 w:1)
119
	/// Proof: UNKNOWN KEY `0x3a72656c61795f64697370617463685f71756575655f72656d61696e696e675f` (r:0 w:1)
120
	/// Storage: `MessageQueue::Pages` (r:0 w:1)
121
	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(32845), added: 35320, mode: `MaxEncodedLen`)
122
	/// Storage: UNKNOWN KEY `0xf5207f03cfdce586301014700e2c2593fad157e461d71fd4c1f936839a5f1f3e` (r:0 w:1)
123
	/// Proof: UNKNOWN KEY `0xf5207f03cfdce586301014700e2c2593fad157e461d71fd4c1f936839a5f1f3e` (r:0 w:1)
124
	/// The range of component `s` is `[1, 200]`.
125
	fn process_slashes_queue(s: u32, ) -> Weight {
126
		// Proof Size summary in bytes:
127
		//  Measured:  `393 + s * (42 ±0)`
128
		//  Estimated: `3601 + s * (42 ±0)`
129
		// Minimum execution time: 46_622_000 picoseconds.
130
		Weight::from_parts(72_326_163, 3601)
131
			// Standard Error: 58_929
132
			.saturating_add(Weight::from_parts(2_894_084, 0).saturating_mul(s.into()))
133
			.saturating_add(T::DbWeight::get().reads(4_u64))
134
			.saturating_add(T::DbWeight::get().writes(2_u64))
135
			.saturating_add(Weight::from_parts(0, 42).saturating_mul(s.into()))
136
	}
137
}
138

            
139
// For backwards compatibility and tests
140
impl WeightInfo for () {
141
	/// Storage: `ExternalValidators::ActiveEra` (r:1 w:0)
142
	/// Proof: `ExternalValidators::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`)
143
	/// Storage: `ExternalValidatorSlashes::Slashes` (r:1 w:1)
144
	/// Proof: `ExternalValidatorSlashes::Slashes` (`max_values`: None, `max_size`: None, mode: `Measured`)
145
	/// The range of component `s` is `[1, 1000]`.
146
	fn cancel_deferred_slash(s: u32, ) -> Weight {
147
		// Proof Size summary in bytes:
148
		//  Measured:  `42194`
149
		//  Estimated: `45659`
150
		// Minimum execution time: 69_654_000 picoseconds.
151
		Weight::from_parts(430_467_141, 45659)
152
			// Standard Error: 25_862
153
			.saturating_add(Weight::from_parts(2_233_402, 0).saturating_mul(s.into()))
154
			.saturating_add(RocksDbWeight::get().reads(2_u64))
155
			.saturating_add(RocksDbWeight::get().writes(1_u64))
156
	}
157
	/// Storage: `ExternalValidators::ActiveEra` (r:1 w:0)
158
	/// Proof: `ExternalValidators::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`)
159
	/// Storage: `ExternalValidatorSlashes::NextSlashId` (r:1 w:1)
160
	/// Proof: `ExternalValidatorSlashes::NextSlashId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
161
	/// Storage: `ExternalValidatorSlashes::Slashes` (r:1 w:1)
162
	/// Proof: `ExternalValidatorSlashes::Slashes` (`max_values`: None, `max_size`: None, mode: `Measured`)
163
	fn force_inject_slash() -> Weight {
164
		// Proof Size summary in bytes:
165
		//  Measured:  `151`
166
		//  Estimated: `3616`
167
		// Minimum execution time: 7_086_000 picoseconds.
168
		Weight::from_parts(7_402_000, 3616)
169
			.saturating_add(RocksDbWeight::get().reads(3_u64))
170
			.saturating_add(RocksDbWeight::get().writes(2_u64))
171
	}
172

            
173
	fn root_test_send_msg_to_eth() -> Weight {
174
		// Proof Size summary in bytes:
175
		//  Measured:  `322`
176
		//  Estimated: `3601`
177
		// Minimum execution time: 994_654_000 picoseconds.
178
		Weight::from_parts(1_015_195_000, 3601)
179
			.saturating_add(RocksDbWeight::get().reads(3_u64))
180
			.saturating_add(RocksDbWeight::get().writes(5_u64))
181
	}
182

            
183

            
184
	/// Storage: `ExternalValidators::ActiveEra` (r:1 w:0)
185
	/// Proof: `ExternalValidators::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`)
186
	/// Storage: `ExternalValidatorSlashes::UnreportedSlashesQueue` (r:1 w:1)
187
	/// Proof: `ExternalValidatorSlashes::UnreportedSlashesQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
188
	/// Storage: `Timestamp::Now` (r:1 w:0)
189
	/// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
190
	/// Storage: `EthereumSystem::Channels` (r:1 w:0)
191
	/// Proof: `EthereumSystem::Channels` (`max_values`: None, `max_size`: Some(76), added: 2551, mode: `MaxEncodedLen`)
192
	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
193
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(136), added: 2611, mode: `MaxEncodedLen`)
194
	/// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
195
	/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(33), added: 528, mode: `MaxEncodedLen`)
196
	/// Storage: UNKNOWN KEY `0x3a72656c61795f64697370617463685f71756575655f72656d61696e696e675f` (r:0 w:1)
197
	/// Proof: UNKNOWN KEY `0x3a72656c61795f64697370617463685f71756575655f72656d61696e696e675f` (r:0 w:1)
198
	/// Storage: `MessageQueue::Pages` (r:0 w:1)
199
	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(32845), added: 35320, mode: `MaxEncodedLen`)
200
	/// Storage: UNKNOWN KEY `0xf5207f03cfdce586301014700e2c2593fad157e461d71fd4c1f936839a5f1f3e` (r:0 w:1)
201
	/// Proof: UNKNOWN KEY `0xf5207f03cfdce586301014700e2c2593fad157e461d71fd4c1f936839a5f1f3e` (r:0 w:1)
202
	/// The range of component `s` is `[1, 200]`.
203
7
	fn process_slashes_queue(s: u32, ) -> Weight {
204
7
		// Proof Size summary in bytes:
205
7
		//  Measured:  `393 + s * (42 ±0)`
206
7
		//  Estimated: `3601 + s * (42 ±0)`
207
7
		// Minimum execution time: 46_622_000 picoseconds.
208
7
		Weight::from_parts(72_326_163, 3601)
209
7
			// Standard Error: 58_929
210
7
			.saturating_add(Weight::from_parts(2_894_084, 0).saturating_mul(s.into()))
211
7
			.saturating_add(RocksDbWeight::get().reads(4_u64))
212
7
			.saturating_add(RocksDbWeight::get().writes(2_u64))
213
7
			.saturating_add(Weight::from_parts(0, 42).saturating_mul(s.into()))
214
7
	}
215
}