common_runtime/weights/extrinsic_weights.rs
1// This file is part of Frequency.
2
3// Copyright (C) Frequency Network Foundation.
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 WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0
19//! DATE: 2025-08-20 (Y/M/D)
20//! HOSTNAME: `ip-10-173-5-194`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
21//!
22//! SHORT-NAME: `extrinsic`, LONG-NAME: `ExtrinsicBase`, RUNTIME: `Frequency`
23//! WARMUPS: `10`, REPEAT: `100`
24//! WEIGHT-PATH: `runtime/common/src/weights`
25//! WEIGHT-METRIC: `Average`, WEIGHT-MUL: `1.0`, WEIGHT-ADD: `0`
26
27// Executed Command:
28// ./scripts/../target/release/frequency
29// benchmark
30// overhead
31// --weight-path=runtime/common/src/weights
32// --chain=dev
33// --warmup=10
34// --repeat=100
35// --header=./HEADER-APACHE2
36
37use sp_core::parameter_types;
38use sp_weights::{constants::WEIGHT_REF_TIME_PER_NANOS, Weight};
39
40parameter_types! {
41 /// Weight of executing a NO-OP extrinsic, for example `System::remark`.
42 /// Calculated by multiplying the *Average* with `1.0` and adding `0`.
43 ///
44 /// Stats nanoseconds:
45 /// Min, Max: 96_429, 97_915
46 /// Average: 97_059
47 /// Median: 97_074
48 /// Std-Dev: 257.13
49 ///
50 /// Percentiles nanoseconds:
51 /// 99th: 97_719
52 /// 95th: 97_476
53 /// 75th: 97_229
54 pub const ExtrinsicBaseWeight: Weight =
55 Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(97_059), 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::ExtrinsicBaseWeight::get();
68
69 // At least 10 µs.
70 assert!(
71 w.ref_time() >= 10u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
72 "Weight should be at least 10 µs."
73 );
74 // At most 1 ms.
75 assert!(
76 w.ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
77 "Weight should be at most 1 ms."
78 );
79 }
80}