1
// This file is part of Substrate.
2

            
3
// Copyright (C) Parity Technologies (UK) Ltd.
4
// SPDX-License-Identifier: Apache-2.0
5

            
6
// Licensed under the Apache License, Version 2.0 (the "License");
7
// you may not use this file except in compliance with the License.
8
// You may obtain a copy of the License at
9
//
10
// 	http://www.apache.org/licenses/LICENSE-2.0
11
//
12
// Unless required by applicable law or agreed to in writing, software
13
// distributed under the License is distributed on an "AS IS" BASIS,
14
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
// See the License for the specific language governing permissions and
16
// limitations under the License.
17

            
18
//! Autogenerated weights for `pallet_migrations`
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
21
//! DATE: 2024-04-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22
//! WORST CASE MAP SIZE: `1000000`
23
//! HOSTNAME: `runner-anb7yjbi-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
24
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024`
25

            
26
// Executed Command:
27
// ./target/production/substrate-node
28
// benchmark
29
// pallet
30
// --chain=dev
31
// --steps=50
32
// --repeat=20
33
// --pallet=pallet_migrations
34
// --no-storage-info
35
// --no-median-slopes
36
// --no-min-squares
37
// --extrinsic=*
38
// --wasm-execution=compiled
39
// --heap-pages=4096
40
// --output=./substrate/frame/migrations/src/weights.rs
41
// --header=./substrate/HEADER-APACHE2
42
// --template=./substrate/.maintain/frame-weight-template.hbs
43

            
44
#![cfg_attr(rustfmt, rustfmt_skip)]
45
#![allow(unused_parens)]
46
#![allow(unused_imports)]
47
#![allow(missing_docs)]
48

            
49
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
50
use core::marker::PhantomData;
51

            
52
/// Weight functions needed for `pallet_migrations`.
53
pub trait WeightInfo {
54
	fn onboard_new_mbms() -> Weight;
55
	fn progress_mbms_none() -> Weight;
56
	fn exec_migration_completed() -> Weight;
57
	fn exec_migration_skipped_historic() -> Weight;
58
	fn exec_migration_advance() -> Weight;
59
	fn exec_migration_complete() -> Weight;
60
	fn exec_migration_fail() -> Weight;
61
	fn on_init_loop() -> Weight;
62
	fn force_set_cursor() -> Weight;
63
	fn force_set_active_cursor() -> Weight;
64
	fn force_onboard_mbms() -> Weight;
65
	fn clear_historic(n: u32, ) -> Weight;
66
}
67

            
68
/// Weights for `pallet_migrations` using the Substrate node and recommended hardware.
69
pub struct SubstrateWeight<T>(PhantomData<T>);
70
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
71
	/// Storage: `MultiBlockMigrations::Cursor` (r:1 w:1)
72
	/// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`)
73
	/// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
74
	/// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
75
	fn onboard_new_mbms() -> Weight {
76
		// Proof Size summary in bytes:
77
		//  Measured:  `276`
78
		//  Estimated: `67035`
79
		// Minimum execution time: 7_762_000 picoseconds.
80
		Weight::from_parts(8_100_000, 67035)
81
			.saturating_add(T::DbWeight::get().reads(2_u64))
82
			.saturating_add(T::DbWeight::get().writes(1_u64))
83
	}
84
	/// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0)
85
	/// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`)
86
	fn progress_mbms_none() -> Weight {
87
		// Proof Size summary in bytes:
88
		//  Measured:  `142`
89
		//  Estimated: `67035`
90
		// Minimum execution time: 2_077_000 picoseconds.
91
		Weight::from_parts(2_138_000, 67035)
92
			.saturating_add(T::DbWeight::get().reads(1_u64))
93
	}
94
	/// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
95
	/// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
96
	/// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1)
97
	/// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`)
98
	fn exec_migration_completed() -> Weight {
99
		// Proof Size summary in bytes:
100
		//  Measured:  `134`
101
		//  Estimated: `3599`
102
		// Minimum execution time: 5_868_000 picoseconds.
103
		Weight::from_parts(6_143_000, 3599)
104
			.saturating_add(T::DbWeight::get().reads(1_u64))
105
			.saturating_add(T::DbWeight::get().writes(1_u64))
106
	}
107
	/// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
108
	/// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
109
	/// Storage: `MultiBlockMigrations::Historic` (r:1 w:0)
110
	/// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`)
111
	fn exec_migration_skipped_historic() -> Weight {
112
		// Proof Size summary in bytes:
113
		//  Measured:  `330`
114
		//  Estimated: `3795`
115
		// Minimum execution time: 10_283_000 picoseconds.
116
		Weight::from_parts(10_964_000, 3795)
117
			.saturating_add(T::DbWeight::get().reads(2_u64))
118
	}
119
	/// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
120
	/// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
121
	/// Storage: `MultiBlockMigrations::Historic` (r:1 w:0)
122
	/// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`)
123
	fn exec_migration_advance() -> Weight {
124
		// Proof Size summary in bytes:
125
		//  Measured:  `276`
126
		//  Estimated: `3741`
127
		// Minimum execution time: 9_900_000 picoseconds.
128
		Weight::from_parts(10_396_000, 3741)
129
			.saturating_add(T::DbWeight::get().reads(2_u64))
130
	}
131
	/// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
132
	/// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
133
	/// Storage: `MultiBlockMigrations::Historic` (r:1 w:1)
134
	/// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`)
135
	fn exec_migration_complete() -> Weight {
136
		// Proof Size summary in bytes:
137
		//  Measured:  `276`
138
		//  Estimated: `3741`
139
		// Minimum execution time: 11_411_000 picoseconds.
140
		Weight::from_parts(11_956_000, 3741)
141
			.saturating_add(T::DbWeight::get().reads(2_u64))
142
			.saturating_add(T::DbWeight::get().writes(1_u64))
143
	}
144
	/// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
145
	/// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
146
	/// Storage: `MultiBlockMigrations::Historic` (r:1 w:0)
147
	/// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`)
148
	/// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1)
149
	/// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`)
150
	fn exec_migration_fail() -> Weight {
151
		// Proof Size summary in bytes:
152
		//  Measured:  `276`
153
		//  Estimated: `3741`
154
		// Minimum execution time: 12_398_000 picoseconds.
155
		Weight::from_parts(12_910_000, 3741)
156
			.saturating_add(T::DbWeight::get().reads(2_u64))
157
			.saturating_add(T::DbWeight::get().writes(1_u64))
158
	}
159
	fn on_init_loop() -> Weight {
160
		// Proof Size summary in bytes:
161
		//  Measured:  `0`
162
		//  Estimated: `0`
163
		// Minimum execution time: 166_000 picoseconds.
164
		Weight::from_parts(193_000, 0)
165
	}
166
	/// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1)
167
	/// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`)
168
	fn force_set_cursor() -> Weight {
169
		// Proof Size summary in bytes:
170
		//  Measured:  `0`
171
		//  Estimated: `0`
172
		// Minimum execution time: 2_686_000 picoseconds.
173
		Weight::from_parts(2_859_000, 0)
174
			.saturating_add(T::DbWeight::get().writes(1_u64))
175
	}
176
	/// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1)
177
	/// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`)
178
	fn force_set_active_cursor() -> Weight {
179
		// Proof Size summary in bytes:
180
		//  Measured:  `0`
181
		//  Estimated: `0`
182
		// Minimum execution time: 3_070_000 picoseconds.
183
		Weight::from_parts(3_250_000, 0)
184
			.saturating_add(T::DbWeight::get().writes(1_u64))
185
	}
186
	/// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0)
187
	/// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`)
188
	/// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
189
	/// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
190
	fn force_onboard_mbms() -> Weight {
191
		// Proof Size summary in bytes:
192
		//  Measured:  `251`
193
		//  Estimated: `67035`
194
		// Minimum execution time: 5_901_000 picoseconds.
195
		Weight::from_parts(6_320_000, 67035)
196
			.saturating_add(T::DbWeight::get().reads(2_u64))
197
	}
198
	/// Storage: `MultiBlockMigrations::Historic` (r:256 w:256)
199
	/// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`)
200
	/// The range of component `n` is `[0, 256]`.
201
	fn clear_historic(n: u32, ) -> Weight {
202
		// Proof Size summary in bytes:
203
		//  Measured:  `1122 + n * (271 ±0)`
204
		//  Estimated: `3834 + n * (2740 ±0)`
205
		// Minimum execution time: 15_952_000 picoseconds.
206
		Weight::from_parts(14_358_665, 3834)
207
			// Standard Error: 3_358
208
			.saturating_add(Weight::from_parts(1_323_674, 0).saturating_mul(n.into()))
209
			.saturating_add(T::DbWeight::get().reads(1_u64))
210
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into())))
211
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into())))
212
			.saturating_add(Weight::from_parts(0, 2740).saturating_mul(n.into()))
213
	}
214
}
215

            
216
// For backwards compatibility and tests.
217
impl WeightInfo for () {
218
	/// Storage: `MultiBlockMigrations::Cursor` (r:1 w:1)
219
	/// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`)
220
	/// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
221
	/// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
222
	fn onboard_new_mbms() -> Weight {
223
		// Proof Size summary in bytes:
224
		//  Measured:  `276`
225
		//  Estimated: `67035`
226
		// Minimum execution time: 7_762_000 picoseconds.
227
		Weight::from_parts(8_100_000, 67035)
228
			.saturating_add(RocksDbWeight::get().reads(2_u64))
229
			.saturating_add(RocksDbWeight::get().writes(1_u64))
230
	}
231
	/// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0)
232
	/// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`)
233
	fn progress_mbms_none() -> Weight {
234
		// Proof Size summary in bytes:
235
		//  Measured:  `142`
236
		//  Estimated: `67035`
237
		// Minimum execution time: 2_077_000 picoseconds.
238
		Weight::from_parts(2_138_000, 67035)
239
			.saturating_add(RocksDbWeight::get().reads(1_u64))
240
	}
241
	/// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
242
	/// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
243
	/// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1)
244
	/// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`)
245
	fn exec_migration_completed() -> Weight {
246
		// Proof Size summary in bytes:
247
		//  Measured:  `134`
248
		//  Estimated: `3599`
249
		// Minimum execution time: 5_868_000 picoseconds.
250
		Weight::from_parts(6_143_000, 3599)
251
			.saturating_add(RocksDbWeight::get().reads(1_u64))
252
			.saturating_add(RocksDbWeight::get().writes(1_u64))
253
	}
254
	/// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
255
	/// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
256
	/// Storage: `MultiBlockMigrations::Historic` (r:1 w:0)
257
	/// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`)
258
	fn exec_migration_skipped_historic() -> Weight {
259
		// Proof Size summary in bytes:
260
		//  Measured:  `330`
261
		//  Estimated: `3795`
262
		// Minimum execution time: 10_283_000 picoseconds.
263
		Weight::from_parts(10_964_000, 3795)
264
			.saturating_add(RocksDbWeight::get().reads(2_u64))
265
	}
266
	/// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
267
	/// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
268
	/// Storage: `MultiBlockMigrations::Historic` (r:1 w:0)
269
	/// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`)
270
	fn exec_migration_advance() -> Weight {
271
		// Proof Size summary in bytes:
272
		//  Measured:  `276`
273
		//  Estimated: `3741`
274
		// Minimum execution time: 9_900_000 picoseconds.
275
		Weight::from_parts(10_396_000, 3741)
276
			.saturating_add(RocksDbWeight::get().reads(2_u64))
277
	}
278
	/// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
279
	/// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
280
	/// Storage: `MultiBlockMigrations::Historic` (r:1 w:1)
281
	/// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`)
282
	fn exec_migration_complete() -> Weight {
283
		// Proof Size summary in bytes:
284
		//  Measured:  `276`
285
		//  Estimated: `3741`
286
		// Minimum execution time: 11_411_000 picoseconds.
287
		Weight::from_parts(11_956_000, 3741)
288
			.saturating_add(RocksDbWeight::get().reads(2_u64))
289
			.saturating_add(RocksDbWeight::get().writes(1_u64))
290
	}
291
	/// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
292
	/// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
293
	/// Storage: `MultiBlockMigrations::Historic` (r:1 w:0)
294
	/// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`)
295
	/// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1)
296
	/// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`)
297
	fn exec_migration_fail() -> Weight {
298
		// Proof Size summary in bytes:
299
		//  Measured:  `276`
300
		//  Estimated: `3741`
301
		// Minimum execution time: 12_398_000 picoseconds.
302
		Weight::from_parts(12_910_000, 3741)
303
			.saturating_add(RocksDbWeight::get().reads(2_u64))
304
			.saturating_add(RocksDbWeight::get().writes(1_u64))
305
	}
306
	fn on_init_loop() -> Weight {
307
		// Proof Size summary in bytes:
308
		//  Measured:  `0`
309
		//  Estimated: `0`
310
		// Minimum execution time: 166_000 picoseconds.
311
		Weight::from_parts(193_000, 0)
312
	}
313
	/// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1)
314
	/// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`)
315
570
	fn force_set_cursor() -> Weight {
316
570
		// Proof Size summary in bytes:
317
570
		//  Measured:  `0`
318
570
		//  Estimated: `0`
319
570
		// Minimum execution time: 2_686_000 picoseconds.
320
570
		Weight::from_parts(2_859_000, 0)
321
570
			.saturating_add(RocksDbWeight::get().writes(1_u64))
322
570
	}
323
	/// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1)
324
	/// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`)
325
326
	fn force_set_active_cursor() -> Weight {
326
326
		// Proof Size summary in bytes:
327
326
		//  Measured:  `0`
328
326
		//  Estimated: `0`
329
326
		// Minimum execution time: 3_070_000 picoseconds.
330
326
		Weight::from_parts(3_250_000, 0)
331
326
			.saturating_add(RocksDbWeight::get().writes(1_u64))
332
326
	}
333
	/// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0)
334
	/// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`)
335
	/// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
336
	/// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0)
337
74
	fn force_onboard_mbms() -> Weight {
338
74
		// Proof Size summary in bytes:
339
74
		//  Measured:  `251`
340
74
		//  Estimated: `67035`
341
74
		// Minimum execution time: 5_901_000 picoseconds.
342
74
		Weight::from_parts(6_320_000, 67035)
343
74
			.saturating_add(RocksDbWeight::get().reads(2_u64))
344
74
	}
345
	/// Storage: `MultiBlockMigrations::Historic` (r:256 w:256)
346
	/// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`)
347
	/// The range of component `n` is `[0, 256]`.
348
306
	fn clear_historic(n: u32, ) -> Weight {
349
306
		// Proof Size summary in bytes:
350
306
		//  Measured:  `1122 + n * (271 ±0)`
351
306
		//  Estimated: `3834 + n * (2740 ±0)`
352
306
		// Minimum execution time: 15_952_000 picoseconds.
353
306
		Weight::from_parts(14_358_665, 3834)
354
306
			// Standard Error: 3_358
355
306
			.saturating_add(Weight::from_parts(1_323_674, 0).saturating_mul(n.into()))
356
306
			.saturating_add(RocksDbWeight::get().reads(1_u64))
357
306
			.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into())))
358
306
			.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into())))
359
306
			.saturating_add(Weight::from_parts(0, 2740).saturating_mul(n.into()))
360
306
	}
361
}