referrerpolicy=no-referrer-when-downgrade

pallet_psm/
weights.rs

1// This file is part of Substrate.
2
3// Copyright (C) Amforc AG.
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_psm`
19//!
20//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
21//! DATE: 2026-03-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22//! WORST CASE MAP SIZE: `1000000`
23//! HOSTNAME: `zur1-vm-devleo-001`, CPU: `AMD EPYC 9354 32-Core Processor`
24//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024`
25
26// Executed Command:
27// ./target/release/substrate-node
28// benchmark
29// pallet
30// --chain
31// dev
32// --wasm-execution
33// compiled
34// --heap-pages
35// 4096
36// --pallet
37// pallet_psm
38// --extrinsic
39// *
40// --steps
41// 50
42// --repeat
43// 20
44// --output
45// ./substrate/frame/psm/src/weights.rs
46// --header
47// ./substrate/HEADER-APACHE2
48// --template
49// ./substrate/.maintain/frame-weight-template.hbs
50
51#![cfg_attr(rustfmt, rustfmt_skip)]
52#![allow(unused_parens)]
53#![allow(unused_imports)]
54#![allow(missing_docs)]
55#![allow(dead_code)]
56
57use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
58use core::marker::PhantomData;
59
60/// Weight functions needed for `pallet_psm`.
61pub trait WeightInfo {
62	fn mint(n: u32, ) -> Weight;
63	fn redeem() -> Weight;
64	fn set_minting_fee() -> Weight;
65	fn set_redemption_fee() -> Weight;
66	fn set_max_psm_debt() -> Weight;
67	fn set_asset_status() -> Weight;
68	fn set_asset_ceiling_weight() -> Weight;
69	fn add_external_asset() -> Weight;
70	fn remove_external_asset() -> Weight;
71}
72
73/// Weights for `pallet_psm` using the Substrate node and recommended hardware.
74pub struct SubstrateWeight<T>(PhantomData<T>);
75impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
76	/// Storage: `Psm::ExternalAssets` (r:1 w:0)
77	/// Proof: `Psm::ExternalAssets` (`max_values`: None, `max_size`: Some(21), added: 2496, mode: `MaxEncodedLen`)
78	/// Storage: `Psm::MintingFee` (r:1 w:0)
79	/// Proof: `Psm::MintingFee` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
80	/// Storage: `Assets::Asset` (r:2 w:2)
81	/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
82	/// Storage: `Psm::PsmDebt` (r:11 w:1)
83	/// Proof: `Psm::PsmDebt` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
84	/// Storage: `Psm::MaxPsmDebtOfTotal` (r:1 w:0)
85	/// Proof: `Psm::MaxPsmDebtOfTotal` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
86	/// Storage: `Psm::AssetCeilingWeight` (r:11 w:0)
87	/// Proof: `Psm::AssetCeilingWeight` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
88	/// Storage: `Assets::Account` (r:4 w:4)
89	/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
90	/// Storage: `System::Account` (r:2 w:2)
91	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
92	/// The range of component `n` is `[1, 10]`.
93	fn mint(n: u32, ) -> Weight {
94		// Proof Size summary in bytes:
95		//  Measured:  `1387 + n * (88 ±0)`
96		//  Estimated: `11426 + n * (2511 ±0)`
97		// Minimum execution time: 133_370_000 picoseconds.
98		Weight::from_parts(134_621_616, 11426)
99			// Standard Error: 20_624
100			.saturating_add(Weight::from_parts(8_263_331, 0).saturating_mul(n.into()))
101			.saturating_add(T::DbWeight::get().reads(13_u64))
102			.saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into())))
103			.saturating_add(T::DbWeight::get().writes(9_u64))
104			.saturating_add(Weight::from_parts(0, 2511).saturating_mul(n.into()))
105	}
106	/// Storage: `Psm::ExternalAssets` (r:1 w:0)
107	/// Proof: `Psm::ExternalAssets` (`max_values`: None, `max_size`: Some(21), added: 2496, mode: `MaxEncodedLen`)
108	/// Storage: `Psm::RedemptionFee` (r:1 w:0)
109	/// Proof: `Psm::RedemptionFee` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
110	/// Storage: `Psm::PsmDebt` (r:1 w:1)
111	/// Proof: `Psm::PsmDebt` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
112	/// Storage: `Assets::Account` (r:4 w:4)
113	/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
114	/// Storage: `Assets::Asset` (r:2 w:2)
115	/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
116	fn redeem() -> Weight {
117		// Proof Size summary in bytes:
118		//  Measured:  `1459`
119		//  Estimated: `11426`
120		// Minimum execution time: 137_370_000 picoseconds.
121		Weight::from_parts(145_389_000, 11426)
122			.saturating_add(T::DbWeight::get().reads(9_u64))
123			.saturating_add(T::DbWeight::get().writes(7_u64))
124	}
125	/// Storage: `Psm::MintingFee` (r:1 w:1)
126	/// Proof: `Psm::MintingFee` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
127	fn set_minting_fee() -> Weight {
128		// Proof Size summary in bytes:
129		//  Measured:  `396`
130		//  Estimated: `3489`
131		// Minimum execution time: 14_810_000 picoseconds.
132		Weight::from_parts(16_760_000, 3489)
133			.saturating_add(T::DbWeight::get().reads(1_u64))
134			.saturating_add(T::DbWeight::get().writes(1_u64))
135	}
136	/// Storage: `Psm::RedemptionFee` (r:1 w:1)
137	/// Proof: `Psm::RedemptionFee` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
138	fn set_redemption_fee() -> Weight {
139		// Proof Size summary in bytes:
140		//  Measured:  `396`
141		//  Estimated: `3489`
142		// Minimum execution time: 14_910_000 picoseconds.
143		Weight::from_parts(16_661_000, 3489)
144			.saturating_add(T::DbWeight::get().reads(1_u64))
145			.saturating_add(T::DbWeight::get().writes(1_u64))
146	}
147	/// Storage: `Psm::MaxPsmDebtOfTotal` (r:1 w:1)
148	/// Proof: `Psm::MaxPsmDebtOfTotal` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
149	fn set_max_psm_debt() -> Weight {
150		// Proof Size summary in bytes:
151		//  Measured:  `306`
152		//  Estimated: `1489`
153		// Minimum execution time: 9_990_000 picoseconds.
154		Weight::from_parts(11_200_000, 1489)
155			.saturating_add(T::DbWeight::get().reads(1_u64))
156			.saturating_add(T::DbWeight::get().writes(1_u64))
157	}
158	/// Storage: `Psm::ExternalAssets` (r:1 w:1)
159	/// Proof: `Psm::ExternalAssets` (`max_values`: None, `max_size`: Some(21), added: 2496, mode: `MaxEncodedLen`)
160	fn set_asset_status() -> Weight {
161		// Proof Size summary in bytes:
162		//  Measured:  `405`
163		//  Estimated: `3486`
164		// Minimum execution time: 17_270_000 picoseconds.
165		Weight::from_parts(19_160_000, 3486)
166			.saturating_add(T::DbWeight::get().reads(1_u64))
167			.saturating_add(T::DbWeight::get().writes(1_u64))
168	}
169	/// Storage: `Psm::ExternalAssets` (r:1 w:0)
170	/// Proof: `Psm::ExternalAssets` (`max_values`: None, `max_size`: Some(21), added: 2496, mode: `MaxEncodedLen`)
171	/// Storage: `Psm::AssetCeilingWeight` (r:1 w:1)
172	/// Proof: `Psm::AssetCeilingWeight` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
173	fn set_asset_ceiling_weight() -> Weight {
174		// Proof Size summary in bytes:
175		//  Measured:  `454`
176		//  Estimated: `3489`
177		// Minimum execution time: 19_381_000 picoseconds.
178		Weight::from_parts(21_310_000, 3489)
179			.saturating_add(T::DbWeight::get().reads(2_u64))
180			.saturating_add(T::DbWeight::get().writes(1_u64))
181	}
182	/// Storage: `Psm::ExternalAssets` (r:1 w:1)
183	/// Proof: `Psm::ExternalAssets` (`max_values`: None, `max_size`: Some(21), added: 2496, mode: `MaxEncodedLen`)
184	/// Storage: `Psm::CounterForExternalAssets` (r:1 w:1)
185	/// Proof: `Psm::CounterForExternalAssets` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
186	/// Storage: `Assets::Metadata` (r:2 w:0)
187	/// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`)
188	fn add_external_asset() -> Weight {
189		// Proof Size summary in bytes:
190		//  Measured:  `560`
191		//  Estimated: `6220`
192		// Minimum execution time: 24_990_000 picoseconds.
193		Weight::from_parts(27_370_000, 6220)
194			.saturating_add(T::DbWeight::get().reads(4_u64))
195			.saturating_add(T::DbWeight::get().writes(2_u64))
196	}
197	/// Storage: `Psm::ExternalAssets` (r:1 w:1)
198	/// Proof: `Psm::ExternalAssets` (`max_values`: None, `max_size`: Some(21), added: 2496, mode: `MaxEncodedLen`)
199	/// Storage: `Psm::PsmDebt` (r:1 w:1)
200	/// Proof: `Psm::PsmDebt` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
201	/// Storage: `Psm::CounterForExternalAssets` (r:1 w:1)
202	/// Proof: `Psm::CounterForExternalAssets` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
203	/// Storage: `Psm::AssetCeilingWeight` (r:0 w:1)
204	/// Proof: `Psm::AssetCeilingWeight` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
205	/// Storage: `Psm::MintingFee` (r:0 w:1)
206	/// Proof: `Psm::MintingFee` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
207	/// Storage: `Psm::RedemptionFee` (r:0 w:1)
208	/// Proof: `Psm::RedemptionFee` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
209	fn remove_external_asset() -> Weight {
210		// Proof Size summary in bytes:
211		//  Measured:  `417`
212		//  Estimated: `3501`
213		// Minimum execution time: 27_390_000 picoseconds.
214		Weight::from_parts(29_621_000, 3501)
215			.saturating_add(T::DbWeight::get().reads(3_u64))
216			.saturating_add(T::DbWeight::get().writes(6_u64))
217	}
218}
219
220// For backwards compatibility and tests.
221impl WeightInfo for () {
222	/// Storage: `Psm::ExternalAssets` (r:1 w:0)
223	/// Proof: `Psm::ExternalAssets` (`max_values`: None, `max_size`: Some(21), added: 2496, mode: `MaxEncodedLen`)
224	/// Storage: `Psm::MintingFee` (r:1 w:0)
225	/// Proof: `Psm::MintingFee` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
226	/// Storage: `Assets::Asset` (r:2 w:2)
227	/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
228	/// Storage: `Psm::PsmDebt` (r:11 w:1)
229	/// Proof: `Psm::PsmDebt` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
230	/// Storage: `Psm::MaxPsmDebtOfTotal` (r:1 w:0)
231	/// Proof: `Psm::MaxPsmDebtOfTotal` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
232	/// Storage: `Psm::AssetCeilingWeight` (r:11 w:0)
233	/// Proof: `Psm::AssetCeilingWeight` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
234	/// Storage: `Assets::Account` (r:4 w:4)
235	/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
236	/// Storage: `System::Account` (r:2 w:2)
237	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
238	/// The range of component `n` is `[1, 10]`.
239	fn mint(n: u32, ) -> Weight {
240		// Proof Size summary in bytes:
241		//  Measured:  `1387 + n * (88 ±0)`
242		//  Estimated: `11426 + n * (2511 ±0)`
243		// Minimum execution time: 133_370_000 picoseconds.
244		Weight::from_parts(134_621_616, 11426)
245			// Standard Error: 20_624
246			.saturating_add(Weight::from_parts(8_263_331, 0).saturating_mul(n.into()))
247			.saturating_add(RocksDbWeight::get().reads(13_u64))
248			.saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(n.into())))
249			.saturating_add(RocksDbWeight::get().writes(9_u64))
250			.saturating_add(Weight::from_parts(0, 2511).saturating_mul(n.into()))
251	}
252	/// Storage: `Psm::ExternalAssets` (r:1 w:0)
253	/// Proof: `Psm::ExternalAssets` (`max_values`: None, `max_size`: Some(21), added: 2496, mode: `MaxEncodedLen`)
254	/// Storage: `Psm::RedemptionFee` (r:1 w:0)
255	/// Proof: `Psm::RedemptionFee` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
256	/// Storage: `Psm::PsmDebt` (r:1 w:1)
257	/// Proof: `Psm::PsmDebt` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
258	/// Storage: `Assets::Account` (r:4 w:4)
259	/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
260	/// Storage: `Assets::Asset` (r:2 w:2)
261	/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
262	fn redeem() -> Weight {
263		// Proof Size summary in bytes:
264		//  Measured:  `1459`
265		//  Estimated: `11426`
266		// Minimum execution time: 137_370_000 picoseconds.
267		Weight::from_parts(145_389_000, 11426)
268			.saturating_add(RocksDbWeight::get().reads(9_u64))
269			.saturating_add(RocksDbWeight::get().writes(7_u64))
270	}
271	/// Storage: `Psm::MintingFee` (r:1 w:1)
272	/// Proof: `Psm::MintingFee` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
273	fn set_minting_fee() -> Weight {
274		// Proof Size summary in bytes:
275		//  Measured:  `396`
276		//  Estimated: `3489`
277		// Minimum execution time: 14_810_000 picoseconds.
278		Weight::from_parts(16_760_000, 3489)
279			.saturating_add(RocksDbWeight::get().reads(1_u64))
280			.saturating_add(RocksDbWeight::get().writes(1_u64))
281	}
282	/// Storage: `Psm::RedemptionFee` (r:1 w:1)
283	/// Proof: `Psm::RedemptionFee` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
284	fn set_redemption_fee() -> Weight {
285		// Proof Size summary in bytes:
286		//  Measured:  `396`
287		//  Estimated: `3489`
288		// Minimum execution time: 14_910_000 picoseconds.
289		Weight::from_parts(16_661_000, 3489)
290			.saturating_add(RocksDbWeight::get().reads(1_u64))
291			.saturating_add(RocksDbWeight::get().writes(1_u64))
292	}
293	/// Storage: `Psm::MaxPsmDebtOfTotal` (r:1 w:1)
294	/// Proof: `Psm::MaxPsmDebtOfTotal` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
295	fn set_max_psm_debt() -> Weight {
296		// Proof Size summary in bytes:
297		//  Measured:  `306`
298		//  Estimated: `1489`
299		// Minimum execution time: 9_990_000 picoseconds.
300		Weight::from_parts(11_200_000, 1489)
301			.saturating_add(RocksDbWeight::get().reads(1_u64))
302			.saturating_add(RocksDbWeight::get().writes(1_u64))
303	}
304	/// Storage: `Psm::ExternalAssets` (r:1 w:1)
305	/// Proof: `Psm::ExternalAssets` (`max_values`: None, `max_size`: Some(21), added: 2496, mode: `MaxEncodedLen`)
306	fn set_asset_status() -> Weight {
307		// Proof Size summary in bytes:
308		//  Measured:  `405`
309		//  Estimated: `3486`
310		// Minimum execution time: 17_270_000 picoseconds.
311		Weight::from_parts(19_160_000, 3486)
312			.saturating_add(RocksDbWeight::get().reads(1_u64))
313			.saturating_add(RocksDbWeight::get().writes(1_u64))
314	}
315	/// Storage: `Psm::ExternalAssets` (r:1 w:0)
316	/// Proof: `Psm::ExternalAssets` (`max_values`: None, `max_size`: Some(21), added: 2496, mode: `MaxEncodedLen`)
317	/// Storage: `Psm::AssetCeilingWeight` (r:1 w:1)
318	/// Proof: `Psm::AssetCeilingWeight` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
319	fn set_asset_ceiling_weight() -> Weight {
320		// Proof Size summary in bytes:
321		//  Measured:  `454`
322		//  Estimated: `3489`
323		// Minimum execution time: 19_381_000 picoseconds.
324		Weight::from_parts(21_310_000, 3489)
325			.saturating_add(RocksDbWeight::get().reads(2_u64))
326			.saturating_add(RocksDbWeight::get().writes(1_u64))
327	}
328	/// Storage: `Psm::ExternalAssets` (r:1 w:1)
329	/// Proof: `Psm::ExternalAssets` (`max_values`: None, `max_size`: Some(21), added: 2496, mode: `MaxEncodedLen`)
330	/// Storage: `Psm::CounterForExternalAssets` (r:1 w:1)
331	/// Proof: `Psm::CounterForExternalAssets` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
332	/// Storage: `Assets::Metadata` (r:2 w:0)
333	/// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`)
334	fn add_external_asset() -> Weight {
335		// Proof Size summary in bytes:
336		//  Measured:  `560`
337		//  Estimated: `6220`
338		// Minimum execution time: 24_990_000 picoseconds.
339		Weight::from_parts(27_370_000, 6220)
340			.saturating_add(RocksDbWeight::get().reads(4_u64))
341			.saturating_add(RocksDbWeight::get().writes(2_u64))
342	}
343	/// Storage: `Psm::ExternalAssets` (r:1 w:1)
344	/// Proof: `Psm::ExternalAssets` (`max_values`: None, `max_size`: Some(21), added: 2496, mode: `MaxEncodedLen`)
345	/// Storage: `Psm::PsmDebt` (r:1 w:1)
346	/// Proof: `Psm::PsmDebt` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`)
347	/// Storage: `Psm::CounterForExternalAssets` (r:1 w:1)
348	/// Proof: `Psm::CounterForExternalAssets` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
349	/// Storage: `Psm::AssetCeilingWeight` (r:0 w:1)
350	/// Proof: `Psm::AssetCeilingWeight` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
351	/// Storage: `Psm::MintingFee` (r:0 w:1)
352	/// Proof: `Psm::MintingFee` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
353	/// Storage: `Psm::RedemptionFee` (r:0 w:1)
354	/// Proof: `Psm::RedemptionFee` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
355	fn remove_external_asset() -> Weight {
356		// Proof Size summary in bytes:
357		//  Measured:  `417`
358		//  Estimated: `3501`
359		// Minimum execution time: 27_390_000 picoseconds.
360		Weight::from_parts(29_621_000, 3501)
361			.saturating_add(RocksDbWeight::get().reads(3_u64))
362			.saturating_add(RocksDbWeight::get().writes(6_u64))
363	}
364}