referrerpolicy=no-referrer-when-downgrade

pallet_beefy_mmr/
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_beefy_mmr`
36//!
37//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
38//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
39//! WORST CASE MAP SIZE: `1000000`
40//! HOSTNAME: `4563561839a5`, 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_beefy_mmr
51// --header=/__w/polkadot-sdk/polkadot-sdk/substrate/HEADER-APACHE2
52// --output=/__w/polkadot-sdk/polkadot-sdk/substrate/frame/beefy-mmr/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// --genesis-builder-policy=none
62// --exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic,pallet_nomination_pools,pallet_remark,pallet_transaction_storage,pallet_election_provider_multi_block,pallet_election_provider_multi_block::signed,pallet_election_provider_multi_block::unsigned,pallet_election_provider_multi_block::verifier
63
64#![cfg_attr(rustfmt, rustfmt_skip)]
65#![allow(unused_parens)]
66#![allow(unused_imports)]
67#![allow(missing_docs)]
68#![allow(dead_code)]
69
70use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
71use core::marker::PhantomData;
72
73/// Weight functions needed for `pallet_beefy_mmr`.
74pub trait WeightInfo {
75	fn n_leafs_proof_is_optimal(n: u32, ) -> Weight;
76	fn extract_validation_context() -> Weight;
77	fn read_peak() -> Weight;
78	fn n_items_proof_is_non_canonical(n: u32, ) -> Weight;
79}
80
81/// Weights for `pallet_beefy_mmr` using the Substrate node and recommended hardware.
82pub struct SubstrateWeight<T>(PhantomData<T>);
83impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
84	/// The range of component `n` is `[2, 512]`.
85	fn n_leafs_proof_is_optimal(n: u32, ) -> Weight {
86		// Proof Size summary in bytes:
87		//  Measured:  `0`
88		//  Estimated: `0`
89		// Minimum execution time: 624_000 picoseconds.
90		Weight::from_parts(1_113_539, 0)
91			// Standard Error: 66
92			.saturating_add(Weight::from_parts(1_511, 0).saturating_mul(n.into()))
93	}
94	/// Storage: `System::BlockHash` (r:1 w:0)
95	/// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
96	fn extract_validation_context() -> Weight {
97		// Proof Size summary in bytes:
98		//  Measured:  `14`
99		//  Estimated: `3509`
100		// Minimum execution time: 4_653_000 picoseconds.
101		Weight::from_parts(4_840_000, 3509)
102			.saturating_add(T::DbWeight::get().reads(1_u64))
103	}
104	/// Storage: `Mmr::Nodes` (r:1 w:0)
105	/// Proof: `Mmr::Nodes` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`)
106	fn read_peak() -> Weight {
107		// Proof Size summary in bytes:
108		//  Measured:  `129`
109		//  Estimated: `3505`
110		// Minimum execution time: 4_524_000 picoseconds.
111		Weight::from_parts(4_667_000, 3505)
112			.saturating_add(T::DbWeight::get().reads(1_u64))
113	}
114	/// Storage: `Mmr::RootHash` (r:1 w:0)
115	/// Proof: `Mmr::RootHash` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
116	/// Storage: `Mmr::NumberOfLeaves` (r:1 w:0)
117	/// Proof: `Mmr::NumberOfLeaves` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
118	/// The range of component `n` is `[2, 512]`.
119	fn n_items_proof_is_non_canonical(n: u32, ) -> Weight {
120		// Proof Size summary in bytes:
121		//  Measured:  `121`
122		//  Estimated: `1517`
123		// Minimum execution time: 8_958_000 picoseconds.
124		Weight::from_parts(14_508_704, 1517)
125			// Standard Error: 1_624
126			.saturating_add(Weight::from_parts(982_244, 0).saturating_mul(n.into()))
127			.saturating_add(T::DbWeight::get().reads(2_u64))
128	}
129}
130
131// For backwards compatibility and tests.
132impl WeightInfo for () {
133	/// The range of component `n` is `[2, 512]`.
134	fn n_leafs_proof_is_optimal(n: u32, ) -> Weight {
135		// Proof Size summary in bytes:
136		//  Measured:  `0`
137		//  Estimated: `0`
138		// Minimum execution time: 624_000 picoseconds.
139		Weight::from_parts(1_113_539, 0)
140			// Standard Error: 66
141			.saturating_add(Weight::from_parts(1_511, 0).saturating_mul(n.into()))
142	}
143	/// Storage: `System::BlockHash` (r:1 w:0)
144	/// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
145	fn extract_validation_context() -> Weight {
146		// Proof Size summary in bytes:
147		//  Measured:  `14`
148		//  Estimated: `3509`
149		// Minimum execution time: 4_653_000 picoseconds.
150		Weight::from_parts(4_840_000, 3509)
151			.saturating_add(RocksDbWeight::get().reads(1_u64))
152	}
153	/// Storage: `Mmr::Nodes` (r:1 w:0)
154	/// Proof: `Mmr::Nodes` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`)
155	fn read_peak() -> Weight {
156		// Proof Size summary in bytes:
157		//  Measured:  `129`
158		//  Estimated: `3505`
159		// Minimum execution time: 4_524_000 picoseconds.
160		Weight::from_parts(4_667_000, 3505)
161			.saturating_add(RocksDbWeight::get().reads(1_u64))
162	}
163	/// Storage: `Mmr::RootHash` (r:1 w:0)
164	/// Proof: `Mmr::RootHash` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
165	/// Storage: `Mmr::NumberOfLeaves` (r:1 w:0)
166	/// Proof: `Mmr::NumberOfLeaves` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
167	/// The range of component `n` is `[2, 512]`.
168	fn n_items_proof_is_non_canonical(n: u32, ) -> Weight {
169		// Proof Size summary in bytes:
170		//  Measured:  `121`
171		//  Estimated: `1517`
172		// Minimum execution time: 8_958_000 picoseconds.
173		Weight::from_parts(14_508_704, 1517)
174			// Standard Error: 1_624
175			.saturating_add(Weight::from_parts(982_244, 0).saturating_mul(n.into()))
176			.saturating_add(RocksDbWeight::get().reads(2_u64))
177	}
178}