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_preimage
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0
21
//! DATE: 2025-11-04, 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("starlight-dev"), DB CACHE: 1024
25

            
26
// Executed Command:
27
// target/release/tanssi-relay
28
// benchmark
29
// pallet
30
// --wasm-execution=compiled
31
// --pallet
32
// pallet_preimage
33
// --extrinsic
34
// *
35
// --chain=starlight-dev
36
// --steps
37
// 50
38
// --repeat
39
// 20
40
// --template=benchmarking/frame-weight-runtime-template.hbs
41
// --json-file
42
// raw.json
43
// --output
44
// tmp/starlight_weights/pallet_preimage.rs
45

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

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

            
53
/// Weights for pallet_preimage using the Substrate node and recommended hardware.
54
pub struct SubstrateWeight<T>(PhantomData<T>);
55
impl<T: frame_system::Config> pallet_preimage::WeightInfo for SubstrateWeight<T> {
56
	/// Storage: `Preimage::StatusFor` (r:1 w:0)
57
	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
58
	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
59
	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
60
	/// Storage: `Parameters::Parameters` (r:2 w:0)
61
	/// Proof: `Parameters::Parameters` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
62
	/// Storage: `Balances::Holds` (r:1 w:1)
63
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`)
64
	/// Storage: `Preimage::PreimageFor` (r:0 w:1)
65
	/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
66
	/// The range of component `s` is `[0, 4194304]`.
67
	fn note_preimage(s: u32, ) -> Weight {
68
		// Proof Size summary in bytes:
69
		//  Measured:  `46`
70
		//  Estimated: `6012`
71
		// Minimum execution time: 69_748_000 picoseconds.
72
		Weight::from_parts(70_343_000, 6012)
73
			// Standard Error: 10
74
			.saturating_add(Weight::from_parts(2_653, 0).saturating_mul(s.into()))
75
			.saturating_add(T::DbWeight::get().reads(5_u64))
76
			.saturating_add(T::DbWeight::get().writes(3_u64))
77
	}
78
	/// Storage: `Preimage::StatusFor` (r:1 w:0)
79
	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
80
	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
81
	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
82
	/// Storage: `Preimage::PreimageFor` (r:0 w:1)
83
	/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
84
	/// The range of component `s` is `[0, 4194304]`.
85
	fn note_requested_preimage(s: u32, ) -> Weight {
86
		// Proof Size summary in bytes:
87
		//  Measured:  `106`
88
		//  Estimated: `3556`
89
		// Minimum execution time: 21_720_000 picoseconds.
90
		Weight::from_parts(22_058_000, 3556)
91
			// Standard Error: 10
92
			.saturating_add(Weight::from_parts(2_644, 0).saturating_mul(s.into()))
93
			.saturating_add(T::DbWeight::get().reads(2_u64))
94
			.saturating_add(T::DbWeight::get().writes(2_u64))
95
	}
96
	/// Storage: `Preimage::StatusFor` (r:1 w:0)
97
	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
98
	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
99
	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
100
	/// Storage: `Preimage::PreimageFor` (r:0 w:1)
101
	/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
102
	/// The range of component `s` is `[0, 4194304]`.
103
	fn note_no_deposit_preimage(s: u32, ) -> Weight {
104
		// Proof Size summary in bytes:
105
		//  Measured:  `106`
106
		//  Estimated: `3556`
107
		// Minimum execution time: 23_003_000 picoseconds.
108
		Weight::from_parts(23_293_000, 3556)
109
			// Standard Error: 10
110
			.saturating_add(Weight::from_parts(2_648, 0).saturating_mul(s.into()))
111
			.saturating_add(T::DbWeight::get().reads(2_u64))
112
			.saturating_add(T::DbWeight::get().writes(2_u64))
113
	}
114
	/// Storage: `Preimage::StatusFor` (r:1 w:0)
115
	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
116
	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
117
	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
118
	/// Storage: `Balances::Holds` (r:1 w:1)
119
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`)
120
	/// Storage: `Preimage::PreimageFor` (r:0 w:1)
121
	/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
122
	fn unnote_preimage() -> Weight {
123
		// Proof Size summary in bytes:
124
		//  Measured:  `243`
125
		//  Estimated: `3640`
126
		// Minimum execution time: 69_534_000 picoseconds.
127
		Weight::from_parts(72_262_000, 3640)
128
			.saturating_add(T::DbWeight::get().reads(3_u64))
129
			.saturating_add(T::DbWeight::get().writes(3_u64))
130
	}
131
	/// Storage: `Preimage::StatusFor` (r:1 w:0)
132
	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
133
	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
134
	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
135
	/// Storage: `Preimage::PreimageFor` (r:0 w:1)
136
	/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
137
	fn unnote_no_deposit_preimage() -> Weight {
138
		// Proof Size summary in bytes:
139
		//  Measured:  `144`
140
		//  Estimated: `3556`
141
		// Minimum execution time: 35_030_000 picoseconds.
142
		Weight::from_parts(40_417_000, 3556)
143
			.saturating_add(T::DbWeight::get().reads(2_u64))
144
			.saturating_add(T::DbWeight::get().writes(2_u64))
145
	}
146
	/// Storage: `Preimage::StatusFor` (r:1 w:0)
147
	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
148
	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
149
	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
150
	fn request_preimage() -> Weight {
151
		// Proof Size summary in bytes:
152
		//  Measured:  `188`
153
		//  Estimated: `3556`
154
		// Minimum execution time: 30_129_000 picoseconds.
155
		Weight::from_parts(32_939_000, 3556)
156
			.saturating_add(T::DbWeight::get().reads(2_u64))
157
			.saturating_add(T::DbWeight::get().writes(1_u64))
158
	}
159
	/// Storage: `Preimage::StatusFor` (r:1 w:0)
160
	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
161
	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
162
	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
163
	fn request_no_deposit_preimage() -> Weight {
164
		// Proof Size summary in bytes:
165
		//  Measured:  `144`
166
		//  Estimated: `3556`
167
		// Minimum execution time: 22_470_000 picoseconds.
168
		Weight::from_parts(24_456_000, 3556)
169
			.saturating_add(T::DbWeight::get().reads(2_u64))
170
			.saturating_add(T::DbWeight::get().writes(1_u64))
171
	}
172
	/// Storage: `Preimage::StatusFor` (r:1 w:0)
173
	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
174
	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
175
	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
176
	fn request_unnoted_preimage() -> Weight {
177
		// Proof Size summary in bytes:
178
		//  Measured:  `42`
179
		//  Estimated: `3556`
180
		// Minimum execution time: 23_156_000 picoseconds.
181
		Weight::from_parts(23_844_000, 3556)
182
			.saturating_add(T::DbWeight::get().reads(2_u64))
183
			.saturating_add(T::DbWeight::get().writes(1_u64))
184
	}
185
	/// Storage: `Preimage::StatusFor` (r:1 w:0)
186
	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
187
	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
188
	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
189
	fn request_requested_preimage() -> Weight {
190
		// Proof Size summary in bytes:
191
		//  Measured:  `106`
192
		//  Estimated: `3556`
193
		// Minimum execution time: 16_729_000 picoseconds.
194
		Weight::from_parts(17_285_000, 3556)
195
			.saturating_add(T::DbWeight::get().reads(2_u64))
196
			.saturating_add(T::DbWeight::get().writes(1_u64))
197
	}
198
	/// Storage: `Preimage::StatusFor` (r:1 w:0)
199
	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
200
	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
201
	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
202
	/// Storage: `Preimage::PreimageFor` (r:0 w:1)
203
	/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
204
	fn unrequest_preimage() -> Weight {
205
		// Proof Size summary in bytes:
206
		//  Measured:  `144`
207
		//  Estimated: `3556`
208
		// Minimum execution time: 29_200_000 picoseconds.
209
		Weight::from_parts(32_564_000, 3556)
210
			.saturating_add(T::DbWeight::get().reads(2_u64))
211
			.saturating_add(T::DbWeight::get().writes(2_u64))
212
	}
213
	/// Storage: `Preimage::StatusFor` (r:1 w:0)
214
	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
215
	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
216
	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
217
	fn unrequest_unnoted_preimage() -> Weight {
218
		// Proof Size summary in bytes:
219
		//  Measured:  `106`
220
		//  Estimated: `3556`
221
		// Minimum execution time: 16_689_000 picoseconds.
222
		Weight::from_parts(17_137_000, 3556)
223
			.saturating_add(T::DbWeight::get().reads(2_u64))
224
			.saturating_add(T::DbWeight::get().writes(1_u64))
225
	}
226
	/// Storage: `Preimage::StatusFor` (r:1 w:0)
227
	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
228
	/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
229
	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
230
	fn unrequest_multi_referenced_preimage() -> Weight {
231
		// Proof Size summary in bytes:
232
		//  Measured:  `106`
233
		//  Estimated: `3556`
234
		// Minimum execution time: 16_644_000 picoseconds.
235
		Weight::from_parts(17_151_000, 3556)
236
			.saturating_add(T::DbWeight::get().reads(2_u64))
237
			.saturating_add(T::DbWeight::get().writes(1_u64))
238
	}
239
	/// Storage: `Preimage::StatusFor` (r:1023 w:1023)
240
	/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
241
	/// Storage: `System::Account` (r:1023 w:1023)
242
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
243
	/// Storage: `Parameters::Parameters` (r:2 w:0)
244
	/// Proof: `Parameters::Parameters` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
245
	/// Storage: `Balances::Holds` (r:1023 w:1023)
246
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(175), added: 2650, mode: `MaxEncodedLen`)
247
	/// Storage: `Preimage::RequestStatusFor` (r:0 w:1023)
248
	/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
249
	/// The range of component `n` is `[1, 1024]`.
250
	fn ensure_updated(n: u32, ) -> Weight {
251
		// Proof Size summary in bytes:
252
		//  Measured:  `0 + n * (227 ±0)`
253
		//  Estimated: `6012 + n * (2650 ±0)`
254
		// Minimum execution time: 79_271_000 picoseconds.
255
		Weight::from_parts(79_830_000, 6012)
256
			// Standard Error: 46_655
257
			.saturating_add(Weight::from_parts(71_661_565, 0).saturating_mul(n.into()))
258
			.saturating_add(T::DbWeight::get().reads(2_u64))
259
			.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into())))
260
			.saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(n.into())))
261
			.saturating_add(Weight::from_parts(0, 2650).saturating_mul(n.into()))
262
	}
263
}