referrerpolicy=no-referrer-when-downgrade

pallet_bridge_grandpa/
weights.rs

1// Copyright (C) Parity Technologies (UK) Ltd.
2// This file is part of Parity Bridges Common.
3
4// Parity Bridges Common 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// Parity Bridges Common 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 Parity Bridges Common.  If not, see <http://www.gnu.org/licenses/>.
16
17//! Autogenerated weights for pallet_bridge_grandpa
18//!
19//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
20//! DATE: 2023-03-02, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
21//! WORST CASE MAP SIZE: `1000000`
22//! HOSTNAME: `covid`, CPU: `11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz`
23//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
24
25// Executed Command:
26// target/release/unknown-bridge-node
27// benchmark
28// pallet
29// --chain=dev
30// --steps=50
31// --repeat=20
32// --pallet=pallet_bridge_grandpa
33// --extrinsic=*
34// --execution=wasm
35// --wasm-execution=Compiled
36// --heap-pages=4096
37// --output=./modules/grandpa/src/weights.rs
38// --template=./.maintain/bridge-weight-template.hbs
39
40#![allow(clippy::all)]
41#![allow(unused_parens)]
42#![allow(unused_imports)]
43#![allow(missing_docs)]
44
45use frame_support::{
46	traits::Get,
47	weights::{constants::RocksDbWeight, Weight},
48};
49use sp_std::marker::PhantomData;
50
51/// Weight functions needed for pallet_bridge_grandpa.
52pub trait WeightInfo {
53	fn submit_finality_proof(p: u32, v: u32) -> Weight;
54	fn force_set_pallet_state() -> Weight;
55}
56
57/// Weights for `pallet_bridge_grandpa` that are generated using one of the Bridge testnets.
58///
59/// Those weights are test only and must never be used in production.
60pub struct BridgeWeight<T>(PhantomData<T>);
61impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
62	/// Storage: BridgeUnknownGrandpa PalletOperatingMode (r:1 w:0)
63	///
64	/// Proof: BridgeUnknownGrandpa PalletOperatingMode (max_values: Some(1), max_size: Some(1),
65	/// added: 496, mode: MaxEncodedLen)
66	///
67	/// Storage: BridgeUnknownGrandpa RequestCount (r:1 w:1)
68	///
69	/// Proof: BridgeUnknownGrandpa RequestCount (max_values: Some(1), max_size: Some(4), added:
70	/// 499, mode: MaxEncodedLen)
71	///
72	/// Storage: BridgeUnknownGrandpa BestFinalized (r:1 w:1)
73	///
74	/// Proof: BridgeUnknownGrandpa BestFinalized (max_values: Some(1), max_size: Some(36), added:
75	/// 531, mode: MaxEncodedLen)
76	///
77	/// Storage: BridgeUnknownGrandpa CurrentAuthoritySet (r:1 w:0)
78	///
79	/// Proof: BridgeUnknownGrandpa CurrentAuthoritySet (max_values: Some(1), max_size: Some(209),
80	/// added: 704, mode: MaxEncodedLen)
81	///
82	/// Storage: BridgeUnknownGrandpa ImportedHashesPointer (r:1 w:1)
83	///
84	/// Proof: BridgeUnknownGrandpa ImportedHashesPointer (max_values: Some(1), max_size: Some(4),
85	/// added: 499, mode: MaxEncodedLen)
86	///
87	/// Storage: BridgeUnknownGrandpa ImportedHashes (r:1 w:1)
88	///
89	/// Proof: BridgeUnknownGrandpa ImportedHashes (max_values: Some(14400), max_size: Some(36),
90	/// added: 2016, mode: MaxEncodedLen)
91	///
92	/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:0 w:2)
93	///
94	/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
95	/// added: 2048, mode: MaxEncodedLen)
96	///
97	/// The range of component `p` is `[1, 4]`.
98	///
99	/// The range of component `v` is `[50, 100]`.
100	fn submit_finality_proof(p: u32, v: u32) -> Weight {
101		// Proof Size summary in bytes:
102		//  Measured:  `394 + p * (60 ±0)`
103		//  Estimated: `4745`
104		// Minimum execution time: 228_072 nanoseconds.
105		Weight::from_parts(57_853_228, 4745)
106			// Standard Error: 149_421
107			.saturating_add(Weight::from_parts(36_708_702, 0).saturating_mul(p.into()))
108			// Standard Error: 10_625
109			.saturating_add(Weight::from_parts(1_469_032, 0).saturating_mul(v.into()))
110			.saturating_add(T::DbWeight::get().reads(6_u64))
111			.saturating_add(T::DbWeight::get().writes(6_u64))
112	}
113
114	/// Storage: `BridgeWestendGrandpa::CurrentAuthoritySet` (r:1 w:1)
115	/// Proof: `BridgeWestendGrandpa::CurrentAuthoritySet` (`max_values`: Some(1), `max_size`:
116	/// Some(50250), added: 50745, mode: `MaxEncodedLen`)
117	/// Storage: `BridgeWestendGrandpa::ImportedHashesPointer` (r:1 w:1)
118	/// Proof: `BridgeWestendGrandpa::ImportedHashesPointer` (`max_values`: Some(1), `max_size`:
119	/// Some(4), added: 499, mode: `MaxEncodedLen`) Storage: `BridgeWestendGrandpa::ImportedHashes`
120	/// (r:1 w:1) Proof: `BridgeWestendGrandpa::ImportedHashes` (`max_values`: Some(1024),
121	/// `max_size`: Some(36), added: 1521, mode: `MaxEncodedLen`)
122	/// Storage: `BridgeWestendGrandpa::BestFinalized` (r:0 w:1)
123	/// Proof: `BridgeWestendGrandpa::BestFinalized` (`max_values`: Some(1), `max_size`: Some(36),
124	/// added: 531, mode: `MaxEncodedLen`) Storage: `BridgeWestendGrandpa::ImportedHeaders` (r:0
125	/// w:2) Proof: `BridgeWestendGrandpa::ImportedHeaders` (`max_values`: Some(1024), `max_size`:
126	/// Some(68), added: 1553, mode: `MaxEncodedLen`)
127	fn force_set_pallet_state() -> Weight {
128		// Proof Size summary in bytes:
129		//  Measured:  `452`
130		//  Estimated: `51735`
131		// Minimum execution time: 62_232_000 picoseconds.
132		Weight::from_parts(78_755_000, 0)
133			.saturating_add(Weight::from_parts(0, 51735))
134			.saturating_add(RocksDbWeight::get().reads(3))
135			.saturating_add(RocksDbWeight::get().writes(6))
136	}
137}
138
139// For backwards compatibility and tests
140impl WeightInfo for () {
141	/// Storage: BridgeUnknownGrandpa PalletOperatingMode (r:1 w:0)
142	///
143	/// Proof: BridgeUnknownGrandpa PalletOperatingMode (max_values: Some(1), max_size: Some(1),
144	/// added: 496, mode: MaxEncodedLen)
145	///
146	/// Storage: BridgeUnknownGrandpa RequestCount (r:1 w:1)
147	///
148	/// Proof: BridgeUnknownGrandpa RequestCount (max_values: Some(1), max_size: Some(4), added:
149	/// 499, mode: MaxEncodedLen)
150	///
151	/// Storage: BridgeUnknownGrandpa BestFinalized (r:1 w:1)
152	///
153	/// Proof: BridgeUnknownGrandpa BestFinalized (max_values: Some(1), max_size: Some(36), added:
154	/// 531, mode: MaxEncodedLen)
155	///
156	/// Storage: BridgeUnknownGrandpa CurrentAuthoritySet (r:1 w:0)
157	///
158	/// Proof: BridgeUnknownGrandpa CurrentAuthoritySet (max_values: Some(1), max_size: Some(209),
159	/// added: 704, mode: MaxEncodedLen)
160	///
161	/// Storage: BridgeUnknownGrandpa ImportedHashesPointer (r:1 w:1)
162	///
163	/// Proof: BridgeUnknownGrandpa ImportedHashesPointer (max_values: Some(1), max_size: Some(4),
164	/// added: 499, mode: MaxEncodedLen)
165	///
166	/// Storage: BridgeUnknownGrandpa ImportedHashes (r:1 w:1)
167	///
168	/// Proof: BridgeUnknownGrandpa ImportedHashes (max_values: Some(14400), max_size: Some(36),
169	/// added: 2016, mode: MaxEncodedLen)
170	///
171	/// Storage: BridgeUnknownGrandpa ImportedHeaders (r:0 w:2)
172	///
173	/// Proof: BridgeUnknownGrandpa ImportedHeaders (max_values: Some(14400), max_size: Some(68),
174	/// added: 2048, mode: MaxEncodedLen)
175	///
176	/// The range of component `p` is `[1, 4]`.
177	///
178	/// The range of component `v` is `[50, 100]`.
179	fn submit_finality_proof(p: u32, v: u32) -> Weight {
180		// Proof Size summary in bytes:
181		//  Measured:  `394 + p * (60 ±0)`
182		//  Estimated: `4745`
183		// Minimum execution time: 228_072 nanoseconds.
184		Weight::from_parts(57_853_228, 4745)
185			// Standard Error: 149_421
186			.saturating_add(Weight::from_parts(36_708_702, 0).saturating_mul(p.into()))
187			// Standard Error: 10_625
188			.saturating_add(Weight::from_parts(1_469_032, 0).saturating_mul(v.into()))
189			.saturating_add(RocksDbWeight::get().reads(6_u64))
190			.saturating_add(RocksDbWeight::get().writes(6_u64))
191	}
192
193	/// Storage: `BridgeWestendGrandpa::CurrentAuthoritySet` (r:1 w:1)
194	/// Proof: `BridgeWestendGrandpa::CurrentAuthoritySet` (`max_values`: Some(1), `max_size`:
195	/// Some(50250), added: 50745, mode: `MaxEncodedLen`)
196	/// Storage: `BridgeWestendGrandpa::ImportedHashesPointer` (r:1 w:1)
197	/// Proof: `BridgeWestendGrandpa::ImportedHashesPointer` (`max_values`: Some(1), `max_size`:
198	/// Some(4), added: 499, mode: `MaxEncodedLen`) Storage: `BridgeWestendGrandpa::ImportedHashes`
199	/// (r:1 w:1) Proof: `BridgeWestendGrandpa::ImportedHashes` (`max_values`: Some(1024),
200	/// `max_size`: Some(36), added: 1521, mode: `MaxEncodedLen`)
201	/// Storage: `BridgeWestendGrandpa::BestFinalized` (r:0 w:1)
202	/// Proof: `BridgeWestendGrandpa::BestFinalized` (`max_values`: Some(1), `max_size`: Some(36),
203	/// added: 531, mode: `MaxEncodedLen`) Storage: `BridgeWestendGrandpa::ImportedHeaders` (r:0
204	/// w:2) Proof: `BridgeWestendGrandpa::ImportedHeaders` (`max_values`: Some(1024), `max_size`:
205	/// Some(68), added: 1553, mode: `MaxEncodedLen`)
206	fn force_set_pallet_state() -> Weight {
207		// Proof Size summary in bytes:
208		//  Measured:  `452`
209		//  Estimated: `51735`
210		// Minimum execution time: 62_232_000 picoseconds.
211		Weight::from_parts(78_755_000, 0)
212			.saturating_add(Weight::from_parts(0, 51735))
213			.saturating_add(RocksDbWeight::get().reads(3))
214			.saturating_add(RocksDbWeight::get().writes(6))
215	}
216}