Skip to content

Commit

Permalink
fix: pallet benchmarking script and default weights now use --release (
Browse files Browse the repository at this point in the history
…#520)

Fixes the benchmarking logic to use the `--release` flag instead of
`--debug` which, in the case of public credentials, has resulted in much
much higher weights, breaking SDK integration tests which (wrongly or
not) uses the mashnet node runtime, which in turn relies on those
default weights.
  • Loading branch information
ntn-x2 authored May 22, 2023
1 parent 2760022 commit 0163569
Show file tree
Hide file tree
Showing 12 changed files with 1,345 additions and 1,122 deletions.
60 changes: 29 additions & 31 deletions pallets/attestation/src/default_weights.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// TODO: Update these weights

// KILT Blockchain – https://botlabs.org
// Copyright (C) 2019-2023 BOTLabs GmbH

Expand All @@ -21,23 +19,23 @@
//! Autogenerated weights for attestation
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-04-05
//! STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-05-18
//! STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `rust-2`, CPU: `12th Gen Intel(R) Core(TM) i9-12900K`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024

// Executed Command:
// ./target/debug/kilt-parachain
// ./target/release/kilt-parachain
// benchmark
// pallet
// --template=.maintain/weight-template.hbs
// --header=HEADER-GPL
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --steps=2
// --repeat=1
// --steps=50
// --repeat=20
// --chain=dev
// --pallet=attestation
// --extrinsic=*
Expand Down Expand Up @@ -73,8 +71,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `793`
// Estimated: `7840`
// Minimum execution time: 447_026 nanoseconds.
Weight::from_parts(447_026_000, 7840)
// Minimum execution time: 18_852 nanoseconds.
Weight::from_parts(19_658_000, 7840)
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
Expand All @@ -84,8 +82,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `227`
// Estimated: `2670`
// Minimum execution time: 227_083 nanoseconds.
Weight::from_parts(227_083_000, 2670)
// Minimum execution time: 9_106 nanoseconds.
Weight::from_parts(9_580_000, 2670)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
Expand All @@ -97,8 +95,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `905`
// Estimated: `5277`
// Minimum execution time: 398_720 nanoseconds.
Weight::from_parts(398_720_000, 5277)
// Minimum execution time: 17_595 nanoseconds.
Weight::from_parts(18_133_000, 5277)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
Expand All @@ -110,8 +108,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `905`
// Estimated: `5277`
// Minimum execution time: 398_488 nanoseconds.
Weight::from_parts(398_488_000, 5277)
// Minimum execution time: 18_054 nanoseconds.
Weight::from_parts(18_690_000, 5277)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
Expand All @@ -123,8 +121,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `1484`
// Estimated: `7884`
// Minimum execution time: 574_892 nanoseconds.
Weight::from_parts(574_892_000, 7884)
// Minimum execution time: 25_988 nanoseconds.
Weight::from_parts(26_675_000, 7884)
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(3_u64))
}
Expand All @@ -136,8 +134,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `905`
// Estimated: `5277`
// Minimum execution time: 521_055 nanoseconds.
Weight::from_parts(521_055_000, 5277)
// Minimum execution time: 22_977 nanoseconds.
Weight::from_parts(23_725_000, 5277)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
Expand All @@ -155,8 +153,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `793`
// Estimated: `7840`
// Minimum execution time: 447_026 nanoseconds.
Weight::from_parts(447_026_000, 7840)
// Minimum execution time: 18_852 nanoseconds.
Weight::from_parts(19_658_000, 7840)
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
Expand All @@ -166,8 +164,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `227`
// Estimated: `2670`
// Minimum execution time: 227_083 nanoseconds.
Weight::from_parts(227_083_000, 2670)
// Minimum execution time: 9_106 nanoseconds.
Weight::from_parts(9_580_000, 2670)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
Expand All @@ -179,8 +177,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `905`
// Estimated: `5277`
// Minimum execution time: 398_720 nanoseconds.
Weight::from_parts(398_720_000, 5277)
// Minimum execution time: 17_595 nanoseconds.
Weight::from_parts(18_133_000, 5277)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
Expand All @@ -192,8 +190,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `905`
// Estimated: `5277`
// Minimum execution time: 398_488 nanoseconds.
Weight::from_parts(398_488_000, 5277)
// Minimum execution time: 18_054 nanoseconds.
Weight::from_parts(18_690_000, 5277)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
Expand All @@ -205,8 +203,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `1484`
// Estimated: `7884`
// Minimum execution time: 574_892 nanoseconds.
Weight::from_parts(574_892_000, 7884)
// Minimum execution time: 25_988 nanoseconds.
Weight::from_parts(26_675_000, 7884)
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64))
}
Expand All @@ -218,8 +216,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `905`
// Estimated: `5277`
// Minimum execution time: 521_055 nanoseconds.
Weight::from_parts(521_055_000, 5277)
// Minimum execution time: 22_977 nanoseconds.
Weight::from_parts(23_725_000, 5277)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
Expand Down
36 changes: 19 additions & 17 deletions pallets/ctype/src/default_weights.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// TODO: Update these weights

// KILT Blockchain – https://botlabs.org
// Copyright (C) 2019-2023 BOTLabs GmbH

Expand All @@ -21,23 +19,23 @@
//! Autogenerated weights for ctype
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-04-05
//! STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-05-18
//! STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `rust-2`, CPU: `12th Gen Intel(R) Core(TM) i9-12900K`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024

// Executed Command:
// ./target/debug/kilt-parachain
// ./target/release/kilt-parachain
// benchmark
// pallet
// --template=.maintain/weight-template.hbs
// --header=HEADER-GPL
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --steps=2
// --repeat=1
// --steps=50
// --repeat=20
// --chain=dev
// --pallet=ctype
// --extrinsic=*
Expand All @@ -64,12 +62,14 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Storage: Ctype Ctypes (r:1 w:1)
/// Proof: Ctype Ctypes (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen)
/// The range of component `l` is `[1, 5242880]`.
fn add(_l: u32, ) -> Weight {
fn add(l: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `616`
// Estimated: `7777`
// Minimum execution time: 627_192 nanoseconds.
Weight::from_parts(133_537_582_000, 7777)
// Minimum execution time: 48_042 nanoseconds.
Weight::from_parts(48_883_000, 7777)
// Standard Error: 1
.saturating_add(Weight::from_ref_time(1_195).saturating_mul(l.into()))
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(3_u64))
}
Expand All @@ -79,8 +79,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `151`
// Estimated: `2563`
// Minimum execution time: 223_926 nanoseconds.
Weight::from_parts(223_926_000, 2563)
// Minimum execution time: 10_067 nanoseconds.
Weight::from_parts(13_231_000, 2563)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
Expand All @@ -93,12 +93,14 @@ impl WeightInfo for () {
/// Storage: Ctype Ctypes (r:1 w:1)
/// Proof: Ctype Ctypes (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen)
/// The range of component `l` is `[1, 5242880]`.
fn add(_l: u32, ) -> Weight {
fn add(l: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `616`
// Estimated: `7777`
// Minimum execution time: 627_192 nanoseconds.
Weight::from_parts(133_537_582_000, 7777)
// Minimum execution time: 48_042 nanoseconds.
Weight::from_parts(48_883_000, 7777)
// Standard Error: 1
.saturating_add(Weight::from_ref_time(1_195).saturating_mul(l.into()))
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64))
}
Expand All @@ -108,8 +110,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `151`
// Estimated: `2563`
// Minimum execution time: 223_926 nanoseconds.
Weight::from_parts(223_926_000, 2563)
// Minimum execution time: 10_067 nanoseconds.
Weight::from_parts(13_231_000, 2563)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
Expand Down
Loading

0 comments on commit 0163569

Please sign in to comment.