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_pooled_staking
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
21
//! DATE: 2024-08-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22
//! WORST CASE MAP SIZE: `1000000`
23
//! HOSTNAME: `benchmark-1`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
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_pooled_staking
34
// --extrinsic
35
// *
36
// --chain=dev
37
// --steps
38
// 50
39
// --repeat
40
// 20
41
// --template=benchmarking/frame-weight-runtime-template.hbs
42
// --json-file
43
// raw.json
44
// --output
45
// tmp/dancebox_weights/pallet_pooled_staking.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
/// Weights for pallet_pooled_staking using the Substrate node and recommended hardware.
55
pub struct SubstrateWeight<T>(PhantomData<T>);
56
impl<T: frame_system::Config> pallet_pooled_staking::WeightInfo for SubstrateWeight<T> {
57
	/// Storage: `PooledStaking::Pools` (r:12 w:5)
58
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
59
	/// Storage: `System::Account` (r:1 w:1)
60
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
61
	/// Storage: `Balances::Holds` (r:1 w:1)
62
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(139), added: 2614, mode: `MaxEncodedLen`)
63
	/// Storage: `PooledStaking::SortedEligibleCandidates` (r:1 w:1)
64
	/// Proof: `PooledStaking::SortedEligibleCandidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
65
	/// Storage: `Session::NextKeys` (r:1 w:0)
66
	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
67
	/// Storage: `Session::CurrentIndex` (r:1 w:0)
68
	/// Proof: `Session::CurrentIndex` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
69
	/// Storage: `PooledStaking::PendingOperations` (r:1 w:1)
70
	/// Proof: `PooledStaking::PendingOperations` (`max_values`: None, `max_size`: None, mode: `Measured`)
71
180
	fn request_delegate() -> Weight {
72
180
		// Proof Size summary in bytes:
73
180
		//  Measured:  `1465`
74
180
		//  Estimated: `32155`
75
180
		// Minimum execution time: 193_742_000 picoseconds.
76
180
		Weight::from_parts(195_946_000, 32155)
77
180
			.saturating_add(T::DbWeight::get().reads(18_u64))
78
180
			.saturating_add(T::DbWeight::get().writes(9_u64))
79
180
	}
80
	/// Storage: `PooledStaking::PendingOperations` (r:100 w:100)
81
	/// Proof: `PooledStaking::PendingOperations` (`max_values`: None, `max_size`: None, mode: `Measured`)
82
	/// Storage: `Session::CurrentIndex` (r:1 w:0)
83
	/// Proof: `Session::CurrentIndex` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
84
	/// Storage: `PooledStaking::Pools` (r:1000 w:800)
85
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
86
	/// Storage: `Balances::Holds` (r:1 w:1)
87
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(139), added: 2614, mode: `MaxEncodedLen`)
88
	/// Storage: `System::Account` (r:1 w:1)
89
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
90
	/// The range of component `b` is `[1, 100]`.
91
84
	fn execute_pending_operations(b: u32, ) -> Weight {
92
84
		// Proof Size summary in bytes:
93
84
		//  Measured:  `545 + b * (390 ±0)`
94
84
		//  Estimated: `3604 + b * (25141 ±0)`
95
84
		// Minimum execution time: 128_205_000 picoseconds.
96
84
		Weight::from_parts(28_494_049, 3604)
97
84
			// Standard Error: 35_179
98
84
			.saturating_add(Weight::from_parts(95_487_903, 0).saturating_mul(b.into()))
99
84
			.saturating_add(T::DbWeight::get().reads(3_u64))
100
84
			.saturating_add(T::DbWeight::get().reads((11_u64).saturating_mul(b.into())))
101
84
			.saturating_add(T::DbWeight::get().writes(2_u64))
102
84
			.saturating_add(T::DbWeight::get().writes((9_u64).saturating_mul(b.into())))
103
84
			.saturating_add(Weight::from_parts(0, 25141).saturating_mul(b.into()))
104
84
	}
105
	/// Storage: `PooledStaking::Pools` (r:13 w:9)
106
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
107
	/// Storage: `PooledStaking::SortedEligibleCandidates` (r:1 w:1)
108
	/// Proof: `PooledStaking::SortedEligibleCandidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
109
	/// Storage: `Session::CurrentIndex` (r:1 w:0)
110
	/// Proof: `Session::CurrentIndex` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
111
	/// Storage: `PooledStaking::PendingOperations` (r:1 w:1)
112
	/// Proof: `PooledStaking::PendingOperations` (`max_values`: None, `max_size`: None, mode: `Measured`)
113
12
	fn request_undelegate() -> Weight {
114
12
		// Proof Size summary in bytes:
115
12
		//  Measured:  `725`
116
12
		//  Estimated: `33890`
117
12
		// Minimum execution time: 145_751_000 picoseconds.
118
12
		Weight::from_parts(147_407_000, 33890)
119
12
			.saturating_add(T::DbWeight::get().reads(16_u64))
120
12
			.saturating_add(T::DbWeight::get().writes(11_u64))
121
12
	}
122
	/// Storage: `PooledStaking::Pools` (r:300 w:100)
123
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
124
	/// Storage: `System::Account` (r:2 w:2)
125
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
126
	/// The range of component `b` is `[1, 100]`.
127
96
	fn claim_manual_rewards(b: u32, ) -> Weight {
128
96
		// Proof Size summary in bytes:
129
96
		//  Measured:  `398 + b * (456 ±0)`
130
96
		//  Estimated: `6196 + b * (7882 ±0)`
131
96
		// Minimum execution time: 80_300_000 picoseconds.
132
96
		Weight::from_parts(42_666_260, 6196)
133
96
			// Standard Error: 14_878
134
96
			.saturating_add(Weight::from_parts(50_760_826, 0).saturating_mul(b.into()))
135
96
			.saturating_add(T::DbWeight::get().reads(2_u64))
136
96
			.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(b.into())))
137
96
			.saturating_add(T::DbWeight::get().writes(2_u64))
138
96
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(b.into())))
139
96
			.saturating_add(Weight::from_parts(0, 7882).saturating_mul(b.into()))
140
96
	}
141
	/// Storage: `PooledStaking::Pools` (r:4 w:1)
142
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
143
	/// Storage: `System::Account` (r:2 w:2)
144
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
145
	/// Storage: `Balances::Holds` (r:1 w:1)
146
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(139), added: 2614, mode: `MaxEncodedLen`)
147
12
	fn rebalance_hold() -> Weight {
148
12
		// Proof Size summary in bytes:
149
12
		//  Measured:  `1019`
150
12
		//  Estimated: `11909`
151
12
		// Minimum execution time: 118_985_000 picoseconds.
152
12
		Weight::from_parts(121_658_000, 11909)
153
12
			.saturating_add(T::DbWeight::get().reads(7_u64))
154
12
			.saturating_add(T::DbWeight::get().writes(4_u64))
155
12
	}
156
	/// Storage: `PooledStaking::Pools` (r:600 w:100)
157
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
158
	/// Storage: `PooledStaking::SortedEligibleCandidates` (r:1 w:1)
159
	/// Proof: `PooledStaking::SortedEligibleCandidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
160
	/// Storage: `Session::NextKeys` (r:100 w:0)
161
	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
162
	/// The range of component `b` is `[1, 100]`.
163
	fn update_candidate_position(b: u32, ) -> Weight {
164
		// Proof Size summary in bytes:
165
		//  Measured:  `400 + b * (356 ±0)`
166
		//  Estimated: `1882 + b * (15206 ±0)`
167
		// Minimum execution time: 51_606_000 picoseconds.
168
		Weight::from_parts(52_344_000, 1882)
169
			// Standard Error: 26_233
170
			.saturating_add(Weight::from_parts(38_520_951, 0).saturating_mul(b.into()))
171
			.saturating_add(T::DbWeight::get().reads(1_u64))
172
			.saturating_add(T::DbWeight::get().reads((7_u64).saturating_mul(b.into())))
173
			.saturating_add(T::DbWeight::get().writes(1_u64))
174
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(b.into())))
175
			.saturating_add(Weight::from_parts(0, 15206).saturating_mul(b.into()))
176
	}
177
	/// Storage: `PooledStaking::Pools` (r:12 w:8)
178
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
179
12
	fn swap_pool() -> Weight {
180
12
		// Proof Size summary in bytes:
181
12
		//  Measured:  `478`
182
12
		//  Estimated: `31168`
183
12
		// Minimum execution time: 106_325_000 picoseconds.
184
12
		Weight::from_parts(108_262_000, 31168)
185
12
			.saturating_add(T::DbWeight::get().reads(12_u64))
186
12
			.saturating_add(T::DbWeight::get().writes(8_u64))
187
12
	}
188
	/// Storage: `PooledStaking::Pools` (r:9 w:5)
189
	/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
190
	/// Storage: `PooledStaking::SortedEligibleCandidates` (r:1 w:1)
191
	/// Proof: `PooledStaking::SortedEligibleCandidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
192
	/// Storage: `Session::NextKeys` (r:1 w:0)
193
	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
194
	/// Storage: `System::Account` (r:2 w:2)
195
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
196
1002
	fn distribute_rewards() -> Weight {
197
1002
		// Proof Size summary in bytes:
198
1002
		//  Measured:  `1341`
199
1002
		//  Estimated: `24606`
200
1002
		// Minimum execution time: 180_839_000 picoseconds.
201
1002
		Weight::from_parts(184_953_000, 24606)
202
1002
			.saturating_add(T::DbWeight::get().reads(13_u64))
203
1002
			.saturating_add(T::DbWeight::get().writes(8_u64))
204
1002
	}
205
}