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
}
59

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

            
96
// For backwards compatibility and tests
97
impl WeightInfo for () {
98
	/// Storage: `ExternalValidators::ActiveEra` (r:1 w:0)
99
	/// Proof: `ExternalValidators::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`)
100
	/// Storage: `ExternalValidatorSlashes::Slashes` (r:1 w:1)
101
	/// Proof: `ExternalValidatorSlashes::Slashes` (`max_values`: None, `max_size`: None, mode: `Measured`)
102
	/// The range of component `s` is `[1, 1000]`.
103
	fn cancel_deferred_slash(s: u32, ) -> Weight {
104
		// Proof Size summary in bytes:
105
		//  Measured:  `42194`
106
		//  Estimated: `45659`
107
		// Minimum execution time: 69_654_000 picoseconds.
108
		Weight::from_parts(430_467_141, 45659)
109
			// Standard Error: 25_862
110
			.saturating_add(Weight::from_parts(2_233_402, 0).saturating_mul(s.into()))
111
			.saturating_add(RocksDbWeight::get().reads(2_u64))
112
			.saturating_add(RocksDbWeight::get().writes(1_u64))
113
	}
114
	/// Storage: `ExternalValidators::ActiveEra` (r:1 w:0)
115
	/// Proof: `ExternalValidators::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`)
116
	/// Storage: `ExternalValidatorSlashes::NextSlashId` (r:1 w:1)
117
	/// Proof: `ExternalValidatorSlashes::NextSlashId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
118
	/// Storage: `ExternalValidatorSlashes::Slashes` (r:1 w:1)
119
	/// Proof: `ExternalValidatorSlashes::Slashes` (`max_values`: None, `max_size`: None, mode: `Measured`)
120
	fn force_inject_slash() -> Weight {
121
		// Proof Size summary in bytes:
122
		//  Measured:  `151`
123
		//  Estimated: `3616`
124
		// Minimum execution time: 7_086_000 picoseconds.
125
		Weight::from_parts(7_402_000, 3616)
126
			.saturating_add(RocksDbWeight::get().reads(3_u64))
127
			.saturating_add(RocksDbWeight::get().writes(2_u64))
128
	}
129
}