referrerpolicy=no-referrer-when-downgrade

rococo_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 32.0.0
18//! DATE: 2024-02-29 (Y/M/D)
19//! HOSTNAME: `runner-bn-ce5rx-project-674-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: `./polkadot/runtime/rococo/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=rococo-dev
31//   --wasm-execution=compiled
32//   --weight-path=./polkadot/runtime/rococo/constants/src/weights/
33//   --warmup=10
34//   --repeat=100
35//   --header=./polkadot/file_header.txt
36
37use sp_core::parameter_types;
38use sp_weights::{constants::WEIGHT_REF_TIME_PER_NANOS, Weight};
39
40parameter_types! {
41	/// Time to execute an empty block.
42	/// Calculated by multiplying the *Average* with `1.0` and adding `0`.
43	///
44	/// Stats nanoseconds:
45	///   Min, Max: 440_142, 476_907
46	///   Average:  450_240
47	///   Median:   448_633
48	///   Std-Dev:  7301.18
49	///
50	/// Percentiles nanoseconds:
51	///   99th: 470_733
52	///   95th: 465_082
53	///   75th: 452_536
54	pub const BlockExecutionWeight: Weight =
55		Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(450_240), 0);
56}
57
58#[cfg(test)]
59mod test_weights {
60	use sp_weights::constants;
61
62	/// Checks that the weight exists and is sane.
63	// NOTE: If this test fails but you are sure that the generated values are fine,
64	// you can delete it.
65	#[test]
66	fn sane() {
67		let w = super::BlockExecutionWeight::get();
68
69		// At least 100 µs.
70		assert!(
71			w.ref_time() >= 100u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
72			"Weight should be at least 100 µs."
73		);
74		// At most 50 ms.
75		assert!(
76			w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS,
77			"Weight should be at most 50 ms."
78		);
79	}
80}