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_inactivity_tracking
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.0.0
21
//! DATE: 2025-07-14, STEPS: `16`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22
//! WORST CASE MAP SIZE: `1000000`
23
//! HOSTNAME: `192.168.1.111`, CPU: `<UNKNOWN>`
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_inactivity_tracking
34
// --extrinsic
35
// *
36
// --chain=dev
37
// --steps
38
// 16
39
// --repeat
40
// 1
41
// --template=benchmarking/frame-weight-pallet-template.hbs
42
// --json-file
43
// raw.json
44
// --output
45
// tmp/pallet_inactivity_tracking.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 core::marker::PhantomData;
53

            
54
/// Weight functions needed for pallet_inactivity_tracking.
55
pub trait WeightInfo {
56
	fn set_inactivity_tracking_status() -> Weight;
57
	fn enable_offline_marking() -> Weight;
58
	fn set_offline() -> Weight;
59
	fn set_online() -> Weight;
60
	fn notify_inactive_collator() -> Weight;
61
}
62

            
63
/// Weights for pallet_inactivity_tracking using the Substrate node and recommended hardware.
64
pub struct SubstrateWeight<T>(PhantomData<T>);
65
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
66
	/// Storage: `InactivityTracking::CurrentActivityTrackingStatus` (r:1 w:1)
67
	/// Proof: `InactivityTracking::CurrentActivityTrackingStatus` (`max_values`: Some(1), `max_size`: Some(9), added: 504, mode: `MaxEncodedLen`)
68
	/// Storage: `Session::CurrentIndex` (r:1 w:0)
69
	/// Proof: `Session::CurrentIndex` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
70
	/// Storage: `InactivityTracking::ActiveCollatorsForCurrentSession` (r:0 w:1)
71
	/// Proof: `InactivityTracking::ActiveCollatorsForCurrentSession` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
72
	fn set_inactivity_tracking_status() -> Weight {
73
		// Proof Size summary in bytes:
74
		//  Measured:  `354`
75
		//  Estimated: `1839`
76
		// Minimum execution time: 12_000_000 picoseconds.
77
		Weight::from_parts(12_000_000, 1839)
78
			.saturating_add(T::DbWeight::get().reads(2_u64))
79
			.saturating_add(T::DbWeight::get().writes(2_u64))
80
	}
81
	/// Storage: `InactivityTracking::EnableMarkingOffline` (r:0 w:1)
82
	/// Proof: `InactivityTracking::EnableMarkingOffline` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
83
	fn enable_offline_marking() -> Weight {
84
		// Proof Size summary in bytes:
85
		//  Measured:  `0`
86
		//  Estimated: `0`
87
		// Minimum execution time: 3_000_000 picoseconds.
88
		Weight::from_parts(3_000_000, 0)
89
			.saturating_add(T::DbWeight::get().writes(1_u64))
90
	}
91
	/// Storage: `InactivityTracking::EnableMarkingOffline` (r:1 w:0)
92
	/// Proof: `InactivityTracking::EnableMarkingOffline` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
93
	/// Storage: `PooledStaking::SortedEligibleCandidates` (r:1 w:1)
94
	/// Proof: `PooledStaking::SortedEligibleCandidates` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`)
95
	/// Storage: `InactivityTracking::OfflineCollators` (r:1 w:1)
96
	/// Proof: `InactivityTracking::OfflineCollators` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
97
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:0)
98
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
99
	/// Storage: `PooledStaking::Pools` (r:6 w:1)
100
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: Some(113), added: 2588, mode: `MaxEncodedLen`)
101
	/// Storage: `Session::NextKeys` (r:1 w:0)
102
	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
103
	fn set_offline() -> Weight {
104
		// Proof Size summary in bytes:
105
		//  Measured:  `1348`
106
		//  Estimated: `16518`
107
		// Minimum execution time: 51_000_000 picoseconds.
108
		Weight::from_parts(51_000_000, 16518)
109
			.saturating_add(T::DbWeight::get().reads(11_u64))
110
			.saturating_add(T::DbWeight::get().writes(3_u64))
111
	}
112
	/// Storage: `InactivityTracking::OfflineCollators` (r:1 w:1)
113
	/// Proof: `InactivityTracking::OfflineCollators` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
114
	/// Storage: `PooledStaking::Pools` (r:6 w:1)
115
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: Some(113), added: 2588, mode: `MaxEncodedLen`)
116
	/// Storage: `PooledStaking::SortedEligibleCandidates` (r:1 w:1)
117
	/// Proof: `PooledStaking::SortedEligibleCandidates` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`)
118
	/// Storage: `Session::NextKeys` (r:1 w:0)
119
	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
120
	fn set_online() -> Weight {
121
		// Proof Size summary in bytes:
122
		//  Measured:  `1174`
123
		//  Estimated: `16518`
124
		// Minimum execution time: 47_000_000 picoseconds.
125
		Weight::from_parts(47_000_000, 16518)
126
			.saturating_add(T::DbWeight::get().reads(9_u64))
127
			.saturating_add(T::DbWeight::get().writes(3_u64))
128
	}
129
	/// Storage: `Session::CurrentIndex` (r:1 w:0)
130
	/// Proof: `Session::CurrentIndex` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
131
	/// Storage: `InactivityTracking::CurrentActivityTrackingStatus` (r:1 w:0)
132
	/// Proof: `InactivityTracking::CurrentActivityTrackingStatus` (`max_values`: Some(1), `max_size`: Some(9), added: 504, mode: `MaxEncodedLen`)
133
	/// Storage: `InactivityTracking::InactiveCollators` (r:5 w:0)
134
	/// Proof: `InactivityTracking::InactiveCollators` (`max_values`: None, `max_size`: Some(3214), added: 5689, mode: `MaxEncodedLen`)
135
	/// Storage: `InactivityTracking::EnableMarkingOffline` (r:1 w:0)
136
	/// Proof: `InactivityTracking::EnableMarkingOffline` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
137
	/// Storage: `PooledStaking::SortedEligibleCandidates` (r:1 w:1)
138
	/// Proof: `PooledStaking::SortedEligibleCandidates` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`)
139
	/// Storage: `InactivityTracking::OfflineCollators` (r:1 w:1)
140
	/// Proof: `InactivityTracking::OfflineCollators` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
141
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:0)
142
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
143
	/// Storage: `PooledStaking::Pools` (r:6 w:1)
144
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: Some(113), added: 2588, mode: `MaxEncodedLen`)
145
	/// Storage: `Session::NextKeys` (r:1 w:0)
146
	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
147
	fn notify_inactive_collator() -> Weight {
148
		// Proof Size summary in bytes:
149
		//  Measured:  `1582`
150
		//  Estimated: `29435`
151
		// Minimum execution time: 66_000_000 picoseconds.
152
		Weight::from_parts(66_000_000, 29435)
153
			.saturating_add(T::DbWeight::get().reads(18_u64))
154
			.saturating_add(T::DbWeight::get().writes(3_u64))
155
	}
156
}
157

            
158
// For backwards compatibility and tests
159
impl WeightInfo for () {
160
	/// Storage: `InactivityTracking::CurrentActivityTrackingStatus` (r:1 w:1)
161
	/// Proof: `InactivityTracking::CurrentActivityTrackingStatus` (`max_values`: Some(1), `max_size`: Some(9), added: 504, mode: `MaxEncodedLen`)
162
	/// Storage: `Session::CurrentIndex` (r:1 w:0)
163
	/// Proof: `Session::CurrentIndex` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
164
	/// Storage: `InactivityTracking::ActiveCollatorsForCurrentSession` (r:0 w:1)
165
	/// Proof: `InactivityTracking::ActiveCollatorsForCurrentSession` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
166
	fn set_inactivity_tracking_status() -> Weight {
167
		// Proof Size summary in bytes:
168
		//  Measured:  `354`
169
		//  Estimated: `1839`
170
		// Minimum execution time: 12_000_000 picoseconds.
171
		Weight::from_parts(12_000_000, 1839)
172
			.saturating_add(RocksDbWeight::get().reads(2_u64))
173
			.saturating_add(RocksDbWeight::get().writes(2_u64))
174
	}
175
	/// Storage: `InactivityTracking::EnableMarkingOffline` (r:0 w:1)
176
	/// Proof: `InactivityTracking::EnableMarkingOffline` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
177
	fn enable_offline_marking() -> Weight {
178
		// Proof Size summary in bytes:
179
		//  Measured:  `0`
180
		//  Estimated: `0`
181
		// Minimum execution time: 3_000_000 picoseconds.
182
		Weight::from_parts(3_000_000, 0)
183
			.saturating_add(RocksDbWeight::get().writes(1_u64))
184
	}
185
	/// Storage: `InactivityTracking::EnableMarkingOffline` (r:1 w:0)
186
	/// Proof: `InactivityTracking::EnableMarkingOffline` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
187
	/// Storage: `PooledStaking::SortedEligibleCandidates` (r:1 w:1)
188
	/// Proof: `PooledStaking::SortedEligibleCandidates` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`)
189
	/// Storage: `InactivityTracking::OfflineCollators` (r:1 w:1)
190
	/// Proof: `InactivityTracking::OfflineCollators` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
191
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:0)
192
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
193
	/// Storage: `PooledStaking::Pools` (r:6 w:1)
194
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: Some(113), added: 2588, mode: `MaxEncodedLen`)
195
	/// Storage: `Session::NextKeys` (r:1 w:0)
196
	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
197
	fn set_offline() -> Weight {
198
		// Proof Size summary in bytes:
199
		//  Measured:  `1348`
200
		//  Estimated: `16518`
201
		// Minimum execution time: 51_000_000 picoseconds.
202
		Weight::from_parts(51_000_000, 16518)
203
			.saturating_add(RocksDbWeight::get().reads(11_u64))
204
			.saturating_add(RocksDbWeight::get().writes(3_u64))
205
	}
206
	/// Storage: `InactivityTracking::OfflineCollators` (r:1 w:1)
207
	/// Proof: `InactivityTracking::OfflineCollators` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
208
	/// Storage: `PooledStaking::Pools` (r:6 w:1)
209
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: Some(113), added: 2588, mode: `MaxEncodedLen`)
210
	/// Storage: `PooledStaking::SortedEligibleCandidates` (r:1 w:1)
211
	/// Proof: `PooledStaking::SortedEligibleCandidates` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`)
212
	/// Storage: `Session::NextKeys` (r:1 w:0)
213
	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
214
	fn set_online() -> Weight {
215
		// Proof Size summary in bytes:
216
		//  Measured:  `1174`
217
		//  Estimated: `16518`
218
		// Minimum execution time: 47_000_000 picoseconds.
219
		Weight::from_parts(47_000_000, 16518)
220
			.saturating_add(RocksDbWeight::get().reads(9_u64))
221
			.saturating_add(RocksDbWeight::get().writes(3_u64))
222
	}
223
	/// Storage: `Session::CurrentIndex` (r:1 w:0)
224
	/// Proof: `Session::CurrentIndex` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
225
	/// Storage: `InactivityTracking::CurrentActivityTrackingStatus` (r:1 w:0)
226
	/// Proof: `InactivityTracking::CurrentActivityTrackingStatus` (`max_values`: Some(1), `max_size`: Some(9), added: 504, mode: `MaxEncodedLen`)
227
	/// Storage: `InactivityTracking::InactiveCollators` (r:5 w:0)
228
	/// Proof: `InactivityTracking::InactiveCollators` (`max_values`: None, `max_size`: Some(3214), added: 5689, mode: `MaxEncodedLen`)
229
	/// Storage: `InactivityTracking::EnableMarkingOffline` (r:1 w:0)
230
	/// Proof: `InactivityTracking::EnableMarkingOffline` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
231
	/// Storage: `PooledStaking::SortedEligibleCandidates` (r:1 w:1)
232
	/// Proof: `PooledStaking::SortedEligibleCandidates` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`)
233
	/// Storage: `InactivityTracking::OfflineCollators` (r:1 w:1)
234
	/// Proof: `InactivityTracking::OfflineCollators` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
235
	/// Storage: `Invulnerables::Invulnerables` (r:1 w:0)
236
	/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`)
237
	/// Storage: `PooledStaking::Pools` (r:6 w:1)
238
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: Some(113), added: 2588, mode: `MaxEncodedLen`)
239
	/// Storage: `Session::NextKeys` (r:1 w:0)
240
	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
241
	fn notify_inactive_collator() -> Weight {
242
		// Proof Size summary in bytes:
243
		//  Measured:  `1582`
244
		//  Estimated: `29435`
245
		// Minimum execution time: 66_000_000 picoseconds.
246
		Weight::from_parts(66_000_000, 29435)
247
			.saturating_add(RocksDbWeight::get().reads(18_u64))
248
			.saturating_add(RocksDbWeight::get().writes(3_u64))
249
	}
250
}