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_invulnerables
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
21
//! DATE: 2024-04-09, 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-node
28
// benchmark
29
// pallet
30
// --execution=wasm
31
// --wasm-execution=compiled
32
// --pallet
33
// pallet_invulnerables
34
// --extrinsic
35
// *
36
// --chain=dev
37
// --steps
38
// 50
39
// --repeat
40
// 20
41
// --template=./benchmarking/frame-weight-template.hbs
42
// --json-file
43
// raw.json
44
// --output
45
// tmp/pallet_invulnerables.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_invulnerables.
55
pub trait WeightInfo {
56
	fn add_invulnerable(_b: u32) -> Weight;
57
	fn remove_invulnerable(_b: u32) -> Weight;
58
	fn new_session(_b: u32) -> Weight;
59
	fn reward_invulnerable(_b: u32) -> Weight;
60
}
61

            
62
/// Weights for pallet_invulnerables 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: `Session::NextKeys` (r:1 w:0)
66
	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
67
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:1)
68
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
69
	/// The range of component `b` is `[1, 99]`.
70
	fn add_invulnerable(b: u32, ) -> Weight {
71
		// Proof Size summary in bytes:
72
		//  Measured:  `549 + b * (36 ±0)`
73
		//  Estimated: `4687 + b * (37 ±0)`
74
		// Minimum execution time: 14_073_000 picoseconds.
75
		Weight::from_parts(17_124_910, 4687)
76
			// Standard Error: 1_519
77
			.saturating_add(Weight::from_parts(76_594, 0).saturating_mul(b.into()))
78
			.saturating_add(T::DbWeight::get().reads(2_u64))
79
			.saturating_add(T::DbWeight::get().writes(1_u64))
80
			.saturating_add(Weight::from_parts(0, 37).saturating_mul(b.into()))
81
	}
82
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:1)
83
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
84
	/// The range of component `b` is `[1, 100]`.
85
	fn remove_invulnerable(b: u32, ) -> Weight {
86
		// Proof Size summary in bytes:
87
		//  Measured:  `70 + b * (32 ±0)`
88
		//  Estimated: `4687`
89
		// Minimum execution time: 8_623_000 picoseconds.
90
		Weight::from_parts(10_574_224, 4687)
91
			// Standard Error: 992
92
			.saturating_add(Weight::from_parts(52_490, 0).saturating_mul(b.into()))
93
			.saturating_add(T::DbWeight::get().reads(1_u64))
94
			.saturating_add(T::DbWeight::get().writes(1_u64))
95
	}
96
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:0)
97
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
98
	/// Storage: `System::BlockWeight` (r:1 w:1)
99
	/// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`)
100
	/// The range of component `r` is `[1, 100]`.
101
	fn new_session(r: u32, ) -> Weight {
102
		// Proof Size summary in bytes:
103
		//  Measured:  `70 + r * (32 ±0)`
104
		//  Estimated: `4687`
105
		// Minimum execution time: 7_295_000 picoseconds.
106
		Weight::from_parts(7_742_784, 4687)
107
			// Standard Error: 4_715
108
			.saturating_add(Weight::from_parts(105_985, 0).saturating_mul(r.into()))
109
			.saturating_add(T::DbWeight::get().reads(2_u64))
110
			.saturating_add(T::DbWeight::get().writes(1_u64))
111
	}
112
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:0)
113
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
114
	/// Storage: `System::Account` (r:1 w:1)
115
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
116
	/// The range of component `b` is `[1, 100]`.
117
	fn reward_invulnerable(b: u32, ) -> Weight {
118
		// Proof Size summary in bytes:
119
		//  Measured:  `218 + b * (33 ±0)`
120
		//  Estimated: `4687`
121
		// Minimum execution time: 17_514_000 picoseconds.
122
		Weight::from_parts(19_797_082, 4687)
123
			// Standard Error: 1_701
124
			.saturating_add(Weight::from_parts(69_693, 0).saturating_mul(b.into()))
125
			.saturating_add(T::DbWeight::get().reads(2_u64))
126
			.saturating_add(T::DbWeight::get().writes(1_u64))
127
	}
128
}
129

            
130
// For backwards compatibility and tests
131
impl WeightInfo for () {
132
	/// Storage: `Session::NextKeys` (r:1 w:0)
133
	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
134
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:1)
135
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
136
	/// The range of component `b` is `[1, 99]`.
137
	fn add_invulnerable(b: u32, ) -> Weight {
138
		// Proof Size summary in bytes:
139
		//  Measured:  `549 + b * (36 ±0)`
140
		//  Estimated: `4687 + b * (37 ±0)`
141
		// Minimum execution time: 14_073_000 picoseconds.
142
		Weight::from_parts(17_124_910, 4687)
143
			// Standard Error: 1_519
144
			.saturating_add(Weight::from_parts(76_594, 0).saturating_mul(b.into()))
145
			.saturating_add(RocksDbWeight::get().reads(2_u64))
146
			.saturating_add(RocksDbWeight::get().writes(1_u64))
147
			.saturating_add(Weight::from_parts(0, 37).saturating_mul(b.into()))
148
	}
149
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:1)
150
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
151
	/// The range of component `b` is `[1, 100]`.
152
	fn remove_invulnerable(b: u32, ) -> Weight {
153
		// Proof Size summary in bytes:
154
		//  Measured:  `70 + b * (32 ±0)`
155
		//  Estimated: `4687`
156
		// Minimum execution time: 8_623_000 picoseconds.
157
		Weight::from_parts(10_574_224, 4687)
158
			// Standard Error: 992
159
			.saturating_add(Weight::from_parts(52_490, 0).saturating_mul(b.into()))
160
			.saturating_add(RocksDbWeight::get().reads(1_u64))
161
			.saturating_add(RocksDbWeight::get().writes(1_u64))
162
	}
163
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:0)
164
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
165
	/// Storage: `System::BlockWeight` (r:1 w:1)
166
	/// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`)
167
	/// The range of component `r` is `[1, 100]`.
168
12
	fn new_session(r: u32, ) -> Weight {
169
12
		// Proof Size summary in bytes:
170
12
		//  Measured:  `70 + r * (32 ±0)`
171
12
		//  Estimated: `4687`
172
12
		// Minimum execution time: 7_295_000 picoseconds.
173
12
		Weight::from_parts(7_742_784, 4687)
174
12
			// Standard Error: 4_715
175
12
			.saturating_add(Weight::from_parts(105_985, 0).saturating_mul(r.into()))
176
12
			.saturating_add(RocksDbWeight::get().reads(2_u64))
177
12
			.saturating_add(RocksDbWeight::get().writes(1_u64))
178
12
	}
179
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:0)
180
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
181
	/// Storage: `System::Account` (r:1 w:1)
182
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
183
	/// The range of component `b` is `[1, 100]`.
184
	fn reward_invulnerable(b: u32, ) -> Weight {
185
		// Proof Size summary in bytes:
186
		//  Measured:  `218 + b * (33 ±0)`
187
		//  Estimated: `4687`
188
		// Minimum execution time: 17_514_000 picoseconds.
189
		Weight::from_parts(19_797_082, 4687)
190
			// Standard Error: 1_701
191
			.saturating_add(Weight::from_parts(69_693, 0).saturating_mul(b.into()))
192
			.saturating_add(RocksDbWeight::get().reads(2_u64))
193
			.saturating_add(RocksDbWeight::get().writes(1_u64))
194
	}
195
}