referrerpolicy=no-referrer-when-downgrade

westend_runtime_constants/weights/
block_weights.rs

1// Copyright (C) Parity Technologies (UK) Ltd.
2// This file is part of Polkadot.
3
4// Polkadot 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// Polkadot 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 Polkadot.  If not, see <http://www.gnu.org/licenses/>.
16
17//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
18//! DATE: 2023-06-14 (Y/M/D)
19//! HOSTNAME: `runner--ss9ysm1-project-163-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
20//!
21//! SHORT-NAME: `block`, LONG-NAME: `BlockExecution`, RUNTIME: `Development`
22//! WARMUPS: `10`, REPEAT: `100`
23//! WEIGHT-PATH: `runtime/westend/constants/src/weights/`
24//! WEIGHT-METRIC: `Average`, WEIGHT-MUL: `1.0`, WEIGHT-ADD: `0`
25
26// Executed Command:
27//   ./target/production/polkadot
28//   benchmark
29//   overhead
30//   --chain=westend-dev
31//   --execution=wasm
32//   --wasm-execution=compiled
33//   --weight-path=runtime/westend/constants/src/weights/
34//   --warmup=10
35//   --repeat=100
36//   --header=./file_header.txt
37
38use sp_core::parameter_types;
39use sp_weights::{constants::WEIGHT_REF_TIME_PER_NANOS, Weight};
40
41parameter_types! {
42	/// Time to execute an empty block.
43	/// Calculated by multiplying the *Average* with `1.0` and adding `0`.
44	///
45	/// Stats nanoseconds:
46	///   Min, Max: 449_093, 498_211
47	///   Average:  461_988
48	///   Median:   459_070
49	///   Std-Dev:  10124.58
50	///
51	/// Percentiles nanoseconds:
52	///   99th: 493_580
53	///   95th: 482_929
54	///   75th: 464_502
55	pub const BlockExecutionWeight: Weight =
56		Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(461_988), 0);
57}
58
59#[cfg(test)]
60mod test_weights {
61	use sp_weights::constants;
62
63	/// Checks that the weight exists and is sane.
64	// NOTE: If this test fails but you are sure that the generated values are fine,
65	// you can delete it.
66	#[test]
67	fn sane() {
68		let w = super::BlockExecutionWeight::get();
69
70		// At least 100 µs.
71		assert!(
72			w.ref_time() >= 100u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
73			"Weight should be at least 100 µs."
74		);
75		// At most 50 ms.
76		assert!(
77			w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS,
78			"Weight should be at most 50 ms."
79		);
80	}
81}