Skip to content

Commit

Permalink
Update weights for PR #1971
Browse files Browse the repository at this point in the history
  • Loading branch information
wilwade authored and github-actions[bot] committed May 20, 2024
1 parent 0ec27a3 commit 65b20f7
Show file tree
Hide file tree
Showing 23 changed files with 3,116 additions and 1,034 deletions.
142 changes: 99 additions & 43 deletions pallets/capacity/src/weights.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
// This file is part of Substrate.

// Copyright (C) 2022 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! Autogenerated weights for pallet_capacity
//! Autogenerated weights for `pallet_capacity`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2024-03-06, STEPS: `20`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-05-20, STEPS: `20`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `benchmark-runner-wc6w8-pv9rm`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("frequency-bench"), DB CACHE: 1024
//! HOSTNAME: `ip-10-173-4-174`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("frequency-bench")`, DB CACHE: `1024`
// Executed Command:
// ./scripts/../target/release/frequency
Expand All @@ -47,7 +31,7 @@
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use core::marker::PhantomData;

/// Weight functions needed for pallet_capacity.
/// Weight functions needed for `pallet_capacity`.
pub trait WeightInfo {
fn stake() -> Weight;
fn withdraw_unstaked() -> Weight;
Expand All @@ -56,7 +40,7 @@ pub trait WeightInfo {
fn set_epoch_length() -> Weight;
}

/// Weights for pallet_capacity using the Substrate node and recommended hardware.
/// Weights for `pallet_capacity` using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Storage: `Msa::ProviderToRegistryEntry` (r:1 w:0)
Expand All @@ -77,8 +61,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `6249`
// Minimum execution time: 39_050_000 picoseconds.
Weight::from_parts(39_836_000, 6249)
// Minimum execution time: 40_006_000 picoseconds.
Weight::from_parts(41_273_000, 6249)
.saturating_add(T::DbWeight::get().reads(7_u64))
.saturating_add(T::DbWeight::get().writes(4_u64))
}
Expand All @@ -94,8 +78,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `285`
// Estimated: `6249`
// Minimum execution time: 27_048_000 picoseconds.
Weight::from_parts(27_536_000, 6249)
// Minimum execution time: 26_886_000 picoseconds.
Weight::from_parts(27_340_000, 6249)
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
Expand All @@ -107,8 +91,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `2974`
// Minimum execution time: 3_890_000 picoseconds.
Weight::from_parts(3_987_000, 2974)
// Minimum execution time: 3_838_000 picoseconds.
Weight::from_parts(4_160_000, 2974)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
Expand All @@ -124,8 +108,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `271`
// Estimated: `5071`
// Minimum execution time: 26_198_000 picoseconds.
Weight::from_parts(26_644_000, 5071)
// Minimum execution time: 26_375_000 picoseconds.
Weight::from_parts(27_142_000, 5071)
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(4_u64))
}
Expand All @@ -135,13 +119,13 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_361_000 picoseconds.
Weight::from_parts(6_550_000, 0)
// Minimum execution time: 6_190_000 picoseconds.
Weight::from_parts(6_560_000, 0)
.saturating_add(T::DbWeight::get().writes(1_u64))
}
}

// For backwards compatibility and tests
// For backwards compatibility and tests.
impl WeightInfo for () {
/// Storage: `Msa::ProviderToRegistryEntry` (r:1 w:0)
/// Proof: `Msa::ProviderToRegistryEntry` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`)
Expand All @@ -161,8 +145,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `6249`
// Minimum execution time: 39_050_000 picoseconds.
Weight::from_parts(39_836_000, 6249)
// Minimum execution time: 40_006_000 picoseconds.
Weight::from_parts(41_273_000, 6249)
.saturating_add(RocksDbWeight::get().reads(7_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
}
Expand All @@ -178,8 +162,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `285`
// Estimated: `6249`
// Minimum execution time: 27_048_000 picoseconds.
Weight::from_parts(27_536_000, 6249)
// Minimum execution time: 26_886_000 picoseconds.
Weight::from_parts(27_340_000, 6249)
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
Expand All @@ -191,8 +175,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `2974`
// Minimum execution time: 3_890_000 picoseconds.
Weight::from_parts(3_987_000, 2974)
// Minimum execution time: 3_838_000 picoseconds.
Weight::from_parts(4_160_000, 2974)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
Expand All @@ -208,8 +192,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `271`
// Estimated: `5071`
// Minimum execution time: 26_198_000 picoseconds.
Weight::from_parts(26_644_000, 5071)
// Minimum execution time: 26_375_000 picoseconds.
Weight::from_parts(27_142_000, 5071)
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
}
Expand All @@ -219,8 +203,80 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_361_000 picoseconds.
Weight::from_parts(6_550_000, 0)
// Minimum execution time: 6_190_000 picoseconds.
Weight::from_parts(6_560_000, 0)
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
}


#[cfg(test)]
mod tests {
use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
use common_runtime::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
use common_runtime::weights::extrinsic_weights::ExtrinsicBaseWeight;

struct BlockWeights;
impl Get<frame_system::limits::BlockWeights> for BlockWeights {
fn get() -> frame_system::limits::BlockWeights {
frame_system::limits::BlockWeights::builder()
.base_block(Weight::zero())
.for_class(DispatchClass::all(), |weights| {
weights.base_extrinsic = ExtrinsicBaseWeight::get().into();
})
.for_class(DispatchClass::non_mandatory(), |weights| {
weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
})
.build_or_panic()
}
}

#[test]
fn test_stake() {
assert!(
BlockWeights::get()
.per_class
.get(frame_support::dispatch::DispatchClass::Normal)
.max_extrinsic
.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
.proof_size()
> 6249
);
}
#[test]
fn test_withdraw_unstaked() {
assert!(
BlockWeights::get()
.per_class
.get(frame_support::dispatch::DispatchClass::Normal)
.max_extrinsic
.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
.proof_size()
> 6249
);
}
#[test]
fn test_on_initialize() {
assert!(
BlockWeights::get()
.per_class
.get(frame_support::dispatch::DispatchClass::Normal)
.max_extrinsic
.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
.proof_size()
> 2974
);
}
#[test]
fn test_unstake() {
assert!(
BlockWeights::get()
.per_class
.get(frame_support::dispatch::DispatchClass::Normal)
.max_extrinsic
.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
.proof_size()
> 5071
);
}
}
78 changes: 43 additions & 35 deletions pallets/frequency-tx-payment/src/weights.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
// This file is part of Substrate.

// Copyright (C) 2022 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! Autogenerated weights for pallet_frequency_tx_payment
//! Autogenerated weights for `pallet_frequency_tx_payment`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2024-03-06, STEPS: `20`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-05-20, STEPS: `20`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `benchmark-runner-wc6w8-pv9rm`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("frequency-bench"), DB CACHE: 1024
//! HOSTNAME: `ip-10-173-4-174`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("frequency-bench")`, DB CACHE: `1024`
// Executed Command:
// ./scripts/../target/release/frequency
Expand All @@ -47,51 +31,75 @@
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use core::marker::PhantomData;

/// Weight functions needed for pallet_frequency_tx_payment.
/// Weight functions needed for `pallet_frequency_tx_payment`.
pub trait WeightInfo {
fn pay_with_capacity() -> Weight;
fn pay_with_capacity_batch_all(n: u32, ) -> Weight;
}

/// Weights for pallet_frequency_tx_payment using the Substrate node and recommended hardware.
/// Weights for `pallet_frequency_tx_payment` using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn pay_with_capacity() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_050_000 picoseconds.
Weight::from_parts(3_326_000, 0)
// Minimum execution time: 3_328_000 picoseconds.
Weight::from_parts(3_448_000, 0)
}
/// The range of component `n` is `[0, 10]`.
fn pay_with_capacity_batch_all(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_760_000 picoseconds.
Weight::from_parts(7_767_951, 0)
// Standard Error: 10_390
.saturating_add(Weight::from_parts(4_455_305, 0).saturating_mul(n.into()))
// Minimum execution time: 6_801_000 picoseconds.
Weight::from_parts(8_170_864, 0)
// Standard Error: 12_331
.saturating_add(Weight::from_parts(4_523_695, 0).saturating_mul(n.into()))
}
}

// For backwards compatibility and tests
// For backwards compatibility and tests.
impl WeightInfo for () {
fn pay_with_capacity() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_050_000 picoseconds.
Weight::from_parts(3_326_000, 0)
// Minimum execution time: 3_328_000 picoseconds.
Weight::from_parts(3_448_000, 0)
}
/// The range of component `n` is `[0, 10]`.
fn pay_with_capacity_batch_all(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_760_000 picoseconds.
Weight::from_parts(7_767_951, 0)
// Standard Error: 10_390
.saturating_add(Weight::from_parts(4_455_305, 0).saturating_mul(n.into()))
// Minimum execution time: 6_801_000 picoseconds.
Weight::from_parts(8_170_864, 0)
// Standard Error: 12_331
.saturating_add(Weight::from_parts(4_523_695, 0).saturating_mul(n.into()))
}
}


#[cfg(test)]
mod tests {
use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
use common_runtime::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
use common_runtime::weights::extrinsic_weights::ExtrinsicBaseWeight;

struct BlockWeights;
impl Get<frame_system::limits::BlockWeights> for BlockWeights {
fn get() -> frame_system::limits::BlockWeights {
frame_system::limits::BlockWeights::builder()
.base_block(Weight::zero())
.for_class(DispatchClass::all(), |weights| {
weights.base_extrinsic = ExtrinsicBaseWeight::get().into();
})
.for_class(DispatchClass::non_mandatory(), |weights| {
weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
})
.build_or_panic()
}
}

}
Loading

0 comments on commit 65b20f7

Please sign in to comment.