referrerpolicy=no-referrer-when-downgrade

pallet_on_demand_para/
weights.rs

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// This file is part of Substrate.
19
20// Copyright (C) Parity Technologies (UK) Ltd.
21// SPDX-License-Identifier: Apache-2.0
22
23// Licensed under the Apache License, Version 2.0 (the "License");
24// you may not use this file except in compliance with the License.
25// You may obtain a copy of the License at
26//
27// 	http://www.apache.org/licenses/LICENSE-2.0
28//
29// Unless required by applicable law or agreed to in writing, software
30// distributed under the License is distributed on an "AS IS" BASIS,
31// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32// See the License for the specific language governing permissions and
33// limitations under the License.
34
35//! Autogenerated weights for `pallet_on_demand_para`
36//!
37//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
38//! DATE: 2026-11-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
39//! WORST CASE MAP SIZE: `1000000`
40//! HOSTNAME: `a65508a71d90`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
41//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
42
43// Executed Command:
44// frame-omni-bencher
45// v1
46// benchmark
47// pallet
48// --extrinsic=*
49// --runtime=target/production/wbuild/kitchensink-runtime/kitchensink_runtime.wasm
50// --pallet=pallet_on_demand_para
51// --header=/__w/polkadot-sdk/polkadot-sdk/substrate/HEADER-APACHE2
52// --output=/__w/polkadot-sdk/polkadot-sdk/substrate/frame/on-demand/src/weights.rs
53// --wasm-execution=compiled
54// --steps=50
55// --repeat=20
56// --heap-pages=4096
57// --template=substrate/.maintain/frame-weight-template.hbs
58// --no-storage-info
59// --no-min-squares
60// --no-median-slopes
61// --exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic,pallet_nomination_pools,pallet_remark,pallet_transaction_storage
62
63#![cfg_attr(rustfmt, rustfmt_skip)]
64#![allow(unused_parens)]
65#![allow(unused_imports)]
66#![allow(missing_docs)]
67#![allow(dead_code)]
68
69use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
70use core::marker::PhantomData;
71
72/// Weight functions needed for `pallet_on_demand_para`.
73pub trait WeightInfo {
74	fn configure() -> Weight;
75	fn enable() -> Weight;
76	fn place_order() -> Weight;
77	fn on_finalize_with_orders(n: u32, ) -> Weight;
78	fn claim_revenue(n: u32, ) -> Weight;
79}
80
81/// Weights for `pallet_on_demand_para` using the Substrate node and recommended hardware.
82pub struct SubstrateWeight<T>(PhantomData<T>);
83impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
84	/// Storage: `OnDemand::PriceConfig` (r:0 w:1)
85	/// Proof: `OnDemand::PriceConfig` (`max_values`: Some(1), `max_size`: Some(28), added: 523, mode: `MaxEncodedLen`)
86	fn configure() -> Weight {
87		// Proof Size summary in bytes:
88		//  Measured:  `0`
89		//  Estimated: `0`
90		// Minimum execution time: 3_268_000 picoseconds.
91		Weight::from_parts(3_710_000, 0)
92			.saturating_add(T::DbWeight::get().writes(1_u64))
93	}
94	/// Storage: `OnDemand::Enabled` (r:1 w:1)
95	/// Proof: `OnDemand::Enabled` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
96	fn enable() -> Weight {
97		// Proof Size summary in bytes:
98		//  Measured:  `4`
99		//  Estimated: `1486`
100		// Minimum execution time: 6_795_000 picoseconds.
101		Weight::from_parts(7_404_000, 1486)
102			.saturating_add(T::DbWeight::get().reads(1_u64))
103			.saturating_add(T::DbWeight::get().writes(1_u64))
104	}
105	/// Storage: `OnDemand::Enabled` (r:1 w:0)
106	/// Proof: `OnDemand::Enabled` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
107	/// Storage: `OnDemand::PendingBatch` (r:1 w:1)
108	/// Proof: `OnDemand::PendingBatch` (`max_values`: Some(1), `max_size`: Some(8002), added: 8497, mode: `MaxEncodedLen`)
109	/// Storage: `OnDemand::QueueState` (r:1 w:1)
110	/// Proof: `OnDemand::QueueState` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
111	/// Storage: `OnDemand::PriceConfig` (r:1 w:0)
112	/// Proof: `OnDemand::PriceConfig` (`max_values`: Some(1), `max_size`: Some(28), added: 523, mode: `MaxEncodedLen`)
113	/// Storage: `System::Account` (r:1 w:1)
114	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
115	/// Storage: `OnDemand::Revenue` (r:1 w:1)
116	/// Proof: `OnDemand::Revenue` (`max_values`: Some(1), `max_size`: Some(101), added: 596, mode: `MaxEncodedLen`)
117	fn place_order() -> Weight {
118		// Proof Size summary in bytes:
119		//  Measured:  `242`
120		//  Estimated: `9487`
121		// Minimum execution time: 57_564_000 picoseconds.
122		Weight::from_parts(60_913_000, 9487)
123			.saturating_add(T::DbWeight::get().reads(6_u64))
124			.saturating_add(T::DbWeight::get().writes(4_u64))
125	}
126	/// Storage: `OnDemand::PendingBatch` (r:1 w:1)
127	/// Proof: `OnDemand::PendingBatch` (`max_values`: Some(1), `max_size`: Some(8002), added: 8497, mode: `Measured`)
128	/// The range of component `n` is `[1, 100]`.
129	fn on_finalize_with_orders(n: u32, ) -> Weight {
130		// Proof Size summary in bytes:
131		//  Measured:  `98 + n * (8 ±0)`
132		//  Estimated: `1583 + n * (8 ±0)`
133		// Minimum execution time: 3_923_000 picoseconds.
134		Weight::from_parts(4_691_921, 1583)
135			// Standard Error: 103
136			.saturating_add(Weight::from_parts(8_899, 0).saturating_mul(n.into()))
137			.saturating_add(T::DbWeight::get().reads(1_u64))
138			.saturating_add(T::DbWeight::get().writes(1_u64))
139			.saturating_add(Weight::from_parts(0, 8).saturating_mul(n.into()))
140	}
141	/// Storage: `OnDemand::Revenue` (r:1 w:1)
142	/// Proof: `OnDemand::Revenue` (`max_values`: Some(1), `max_size`: Some(101), added: 596, mode: `MaxEncodedLen`)
143	/// Storage: `System::Account` (r:2 w:2)
144	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
145	/// The range of component `n` is `[0, 5]`.
146	fn claim_revenue(n: u32, ) -> Weight {
147		// Proof Size summary in bytes:
148		//  Measured:  `361`
149		//  Estimated: `4665 + n * (500 ±20)`
150		// Minimum execution time: 11_788_000 picoseconds.
151		Weight::from_parts(28_997_932, 4665)
152			// Standard Error: 70_037
153			.saturating_add(Weight::from_parts(9_363_395, 0).saturating_mul(n.into()))
154			.saturating_add(T::DbWeight::get().reads(2_u64))
155			.saturating_add(T::DbWeight::get().writes(1_u64))
156			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into())))
157			.saturating_add(Weight::from_parts(0, 500).saturating_mul(n.into()))
158	}
159}
160
161// For backwards compatibility and tests.
162impl WeightInfo for () {
163	/// Storage: `OnDemand::PriceConfig` (r:0 w:1)
164	/// Proof: `OnDemand::PriceConfig` (`max_values`: Some(1), `max_size`: Some(28), added: 523, mode: `MaxEncodedLen`)
165	fn configure() -> Weight {
166		// Proof Size summary in bytes:
167		//  Measured:  `0`
168		//  Estimated: `0`
169		// Minimum execution time: 3_268_000 picoseconds.
170		Weight::from_parts(3_710_000, 0)
171			.saturating_add(RocksDbWeight::get().writes(1_u64))
172	}
173	/// Storage: `OnDemand::Enabled` (r:1 w:1)
174	/// Proof: `OnDemand::Enabled` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
175	fn enable() -> Weight {
176		// Proof Size summary in bytes:
177		//  Measured:  `4`
178		//  Estimated: `1486`
179		// Minimum execution time: 6_795_000 picoseconds.
180		Weight::from_parts(7_404_000, 1486)
181			.saturating_add(RocksDbWeight::get().reads(1_u64))
182			.saturating_add(RocksDbWeight::get().writes(1_u64))
183	}
184	/// Storage: `OnDemand::Enabled` (r:1 w:0)
185	/// Proof: `OnDemand::Enabled` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
186	/// Storage: `OnDemand::PendingBatch` (r:1 w:1)
187	/// Proof: `OnDemand::PendingBatch` (`max_values`: Some(1), `max_size`: Some(8002), added: 8497, mode: `MaxEncodedLen`)
188	/// Storage: `OnDemand::QueueState` (r:1 w:1)
189	/// Proof: `OnDemand::QueueState` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
190	/// Storage: `OnDemand::PriceConfig` (r:1 w:0)
191	/// Proof: `OnDemand::PriceConfig` (`max_values`: Some(1), `max_size`: Some(28), added: 523, mode: `MaxEncodedLen`)
192	/// Storage: `System::Account` (r:1 w:1)
193	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
194	/// Storage: `OnDemand::Revenue` (r:1 w:1)
195	/// Proof: `OnDemand::Revenue` (`max_values`: Some(1), `max_size`: Some(101), added: 596, mode: `MaxEncodedLen`)
196	fn place_order() -> Weight {
197		// Proof Size summary in bytes:
198		//  Measured:  `242`
199		//  Estimated: `9487`
200		// Minimum execution time: 57_564_000 picoseconds.
201		Weight::from_parts(60_913_000, 9487)
202			.saturating_add(RocksDbWeight::get().reads(6_u64))
203			.saturating_add(RocksDbWeight::get().writes(4_u64))
204	}
205	/// Storage: `OnDemand::PendingBatch` (r:1 w:1)
206	/// Proof: `OnDemand::PendingBatch` (`max_values`: Some(1), `max_size`: Some(8002), added: 8497, mode: `Measured`)
207	/// The range of component `n` is `[1, 100]`.
208	fn on_finalize_with_orders(n: u32, ) -> Weight {
209		// Proof Size summary in bytes:
210		//  Measured:  `98 + n * (8 ±0)`
211		//  Estimated: `1583 + n * (8 ±0)`
212		// Minimum execution time: 3_923_000 picoseconds.
213		Weight::from_parts(4_691_921, 1583)
214			// Standard Error: 103
215			.saturating_add(Weight::from_parts(8_899, 0).saturating_mul(n.into()))
216			.saturating_add(RocksDbWeight::get().reads(1_u64))
217			.saturating_add(RocksDbWeight::get().writes(1_u64))
218			.saturating_add(Weight::from_parts(0, 8).saturating_mul(n.into()))
219	}
220	/// Storage: `OnDemand::Revenue` (r:1 w:1)
221	/// Proof: `OnDemand::Revenue` (`max_values`: Some(1), `max_size`: Some(101), added: 596, mode: `MaxEncodedLen`)
222	/// Storage: `System::Account` (r:2 w:2)
223	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
224	/// The range of component `n` is `[0, 5]`.
225	fn claim_revenue(n: u32, ) -> Weight {
226		// Proof Size summary in bytes:
227		//  Measured:  `361`
228		//  Estimated: `4665 + n * (500 ±20)`
229		// Minimum execution time: 11_788_000 picoseconds.
230		Weight::from_parts(28_997_932, 4665)
231			// Standard Error: 70_037
232			.saturating_add(Weight::from_parts(9_363_395, 0).saturating_mul(n.into()))
233			.saturating_add(RocksDbWeight::get().reads(2_u64))
234			.saturating_add(RocksDbWeight::get().writes(1_u64))
235			.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into())))
236			.saturating_add(Weight::from_parts(0, 500).saturating_mul(n.into()))
237	}
238}