Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pallet evm weights #609

Merged
merged 8 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions runtime/laos/src/apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ impl_runtime_apis! {
) {
use frame_benchmarking::{Benchmarking, BenchmarkList};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
use super::*;

Expand All @@ -397,7 +396,6 @@ impl_runtime_apis! {
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
use frame_benchmarking::{Benchmarking, BenchmarkBatch};

use frame_system_benchmarking::Pallet as SystemBench;
impl frame_system_benchmarking::Config for Runtime {}

use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
Expand Down
8 changes: 4 additions & 4 deletions runtime/laos/src/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
// along with LAOS. If not, see <http://www.gnu.org/licenses/>.

frame_benchmarking::define_benchmarks!(
[frame_system, SystemBench::<Runtime>]
// [frame_system, SystemBench::<Runtime>] // It fails but others parachain as Moonbeam does not have this
[pallet_timestamp, Timestamp]
[pallet_sudo, Sudo]
[pallet_utility, Utility]
[pallet_multisig, Multisig]
[pallet_proxy, Proxy]
[pallet_balances, Balances]
// [pallet_balances, Balances] // We use default weights from polkadot-sdk as benchmarking functions does not support existential deposit zero
[pallet_vesting, Vesting]
[pallet_session, SessionBench::<Runtime>] // TODO check why SessionBench::<Runtime>
[pallet_parachain_staking, ParachainStaking]
[cumulus_pallet_xcmp_queue, XcmpQueue]
[pallet_evm, EVM]
[pallet_laos_evolution, LaosEvolution]
[pallet_asset_metadata_extender, AssetMetadataExtender]
// [pallet_laos_evolution, LaosEvolution]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity why our pallets don't have to compute weights?

Copy link
Member Author

@asiniscalchi asiniscalchi May 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it something we are going to handle in #584

// [pallet_asset_metadata_extender, AssetMetadataExtender]
// TODO pallet_xcm?
);
4 changes: 2 additions & 2 deletions runtime/laos/src/configs/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

//! Pallets that enable EVM execution on Substrate
use crate::{
precompiles::FrontierPrecompiles, types::ToAuthor, AccountId, Aura, Balances, BaseFee,
precompiles::FrontierPrecompiles, types::ToAuthor, weights, AccountId, Aura, Balances, BaseFee,
EVMChainId, Runtime, RuntimeEvent, Timestamp,
};
use frame_support::{
Expand Down Expand Up @@ -69,7 +69,7 @@ impl pallet_evm::Config for Runtime {
type Timestamp = Timestamp;
type WeightPerGas = WeightPerGas;
type WithdrawOrigin = pallet_evm::EnsureAddressNever<AccountId>;
type WeightInfo = pallet_evm::weights::SubstrateWeight<Runtime>; // TODO
type WeightInfo = weights::pallet_evm::WeightInfo<Runtime>;
}

pub struct CustomFindAuthor<Inner>(sp_std::marker::PhantomData<Inner>);
Expand Down
12 changes: 6 additions & 6 deletions runtime/laos/src/weights/cumulus_pallet_xcmp_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
//! Autogenerated weights for `cumulus_pallet_xcmp_queue`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2024-04-03, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `trujideb`, CPU: `12th Gen Intel(R) Core(TM) i5-12500H`
//! HOSTNAME: `titan`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024

// Executed Command:
Expand Down Expand Up @@ -36,8 +36,8 @@ impl<T: frame_system::Config> cumulus_pallet_xcmp_queue::WeightInfo for WeightIn
// Proof Size summary in bytes:
// Measured: `76`
// Estimated: `1561`
// Minimum execution time: 4_314_000 picoseconds.
Weight::from_parts(4_557_000, 0)
// Minimum execution time: 4_141_000 picoseconds.
Weight::from_parts(4_570_000, 0)
.saturating_add(Weight::from_parts(0, 1561))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
Expand All @@ -48,8 +48,8 @@ impl<T: frame_system::Config> cumulus_pallet_xcmp_queue::WeightInfo for WeightIn
// Proof Size summary in bytes:
// Measured: `76`
// Estimated: `1561`
// Minimum execution time: 4_325_000 picoseconds.
Weight::from_parts(4_587_000, 0)
// Minimum execution time: 4_368_000 picoseconds.
Weight::from_parts(4_633_000, 0)
.saturating_add(Weight::from_parts(0, 1561))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
Expand Down
1 change: 1 addition & 0 deletions runtime/laos/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
pub mod block_weights;
pub mod cumulus_pallet_xcmp_queue;
pub mod extrinsic_weights;
pub mod pallet_evm;
pub mod pallet_multisig;
pub mod pallet_parachain_staking;
pub mod pallet_proxy;
Expand Down
41 changes: 41 additions & 0 deletions runtime/laos/src/weights/pallet_evm.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

//! Autogenerated weights for `pallet_evm`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2024-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `titan`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024

// Executed Command:
// ./target/release/laos
// benchmark
// pallet
// --chain=dev
// --steps=50
// --repeat=20
// --pallet=pallet_evm
// --extrinsic=withdraw
// --wasm-execution=compiled
// --output=./runtime/laos/src/weights/

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]

use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;

/// Weight functions for `pallet_evm`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_evm::WeightInfo for WeightInfo<T> {
fn withdraw() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 1_417_000 picoseconds.
Weight::from_parts(1_611_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
}
78 changes: 39 additions & 39 deletions runtime/laos/src/weights/pallet_multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
//! Autogenerated weights for `pallet_multisig`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2024-04-03, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `trujideb`, CPU: `12th Gen Intel(R) Core(TM) i5-12500H`
//! HOSTNAME: `titan`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024

// Executed Command:
Expand Down Expand Up @@ -35,27 +35,27 @@ impl<T: frame_system::Config> pallet_multisig::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_141_000 picoseconds.
Weight::from_parts(5_642_493, 0)
// Minimum execution time: 5_513_000 picoseconds.
Weight::from_parts(6_190_410, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 2
.saturating_add(Weight::from_parts(332, 0).saturating_mul(z.into()))
.saturating_add(Weight::from_parts(319, 0).saturating_mul(z.into()))
}
/// Storage: `Multisig::Multisigs` (r:1 w:1)
/// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(521), added: 2996, mode: `MaxEncodedLen`)
/// The range of component `s` is `[2, 20]`.
/// The range of component `z` is `[0, 10000]`.
fn as_multi_create(s: u32, z: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `208`
// Measured: `204`
// Estimated: `3986`
// Minimum execution time: 28_271_000 picoseconds.
Weight::from_parts(27_005_775, 0)
// Minimum execution time: 29_188_000 picoseconds.
Weight::from_parts(27_755_610, 0)
.saturating_add(Weight::from_parts(0, 3986))
// Standard Error: 4_762
.saturating_add(Weight::from_parts(137_216, 0).saturating_mul(s.into()))
// Standard Error: 4_394
.saturating_add(Weight::from_parts(152_591, 0).saturating_mul(s.into()))
// Standard Error: 8
.saturating_add(Weight::from_parts(1_054, 0).saturating_mul(z.into()))
.saturating_add(Weight::from_parts(1_061, 0).saturating_mul(z.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand All @@ -67,33 +67,33 @@ impl<T: frame_system::Config> pallet_multisig::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `246`
// Estimated: `3986`
// Minimum execution time: 15_320_000 picoseconds.
Weight::from_parts(14_582_356, 0)
// Minimum execution time: 15_933_000 picoseconds.
Weight::from_parts(14_485_954, 0)
.saturating_add(Weight::from_parts(0, 3986))
// Standard Error: 3_703
.saturating_add(Weight::from_parts(91_799, 0).saturating_mul(s.into()))
// Standard Error: 6
.saturating_add(Weight::from_parts(1_016, 0).saturating_mul(z.into()))
// Standard Error: 3_347
.saturating_add(Weight::from_parts(140_228, 0).saturating_mul(s.into()))
// Standard Error: 5
.saturating_add(Weight::from_parts(1_101, 0).saturating_mul(z.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Multisig::Multisigs` (r:1 w:1)
/// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(521), added: 2996, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(120), added: 2595, mode: `MaxEncodedLen`)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`)
/// The range of component `s` is `[2, 20]`.
/// The range of component `z` is `[0, 10000]`.
fn as_multi_complete(s: u32, z: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `338 + s * (20 ±0)`
// Measured: `334 + s * (20 ±0)`
// Estimated: `3986`
// Minimum execution time: 30_974_000 picoseconds.
Weight::from_parts(28_834_692, 0)
// Minimum execution time: 33_153_000 picoseconds.
Weight::from_parts(31_737_450, 0)
.saturating_add(Weight::from_parts(0, 3986))
// Standard Error: 6_415
.saturating_add(Weight::from_parts(204_400, 0).saturating_mul(s.into()))
// Standard Error: 11
.saturating_add(Weight::from_parts(1_087, 0).saturating_mul(z.into()))
// Standard Error: 4_509
.saturating_add(Weight::from_parts(161_108, 0).saturating_mul(s.into()))
// Standard Error: 8
.saturating_add(Weight::from_parts(1_104, 0).saturating_mul(z.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
Expand All @@ -102,13 +102,13 @@ impl<T: frame_system::Config> pallet_multisig::WeightInfo for WeightInfo<T> {
/// The range of component `s` is `[2, 20]`.
fn approve_as_multi_create(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `208`
// Measured: `204`
// Estimated: `3986`
// Minimum execution time: 25_176_000 picoseconds.
Weight::from_parts(26_274_763, 0)
// Minimum execution time: 26_650_000 picoseconds.
Weight::from_parts(27_681_558, 0)
.saturating_add(Weight::from_parts(0, 3986))
// Standard Error: 4_519
.saturating_add(Weight::from_parts(167_971, 0).saturating_mul(s.into()))
// Standard Error: 3_071
.saturating_add(Weight::from_parts(149_095, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand All @@ -119,11 +119,11 @@ impl<T: frame_system::Config> pallet_multisig::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `246`
// Estimated: `3986`
// Minimum execution time: 12_990_000 picoseconds.
Weight::from_parts(13_565_803, 0)
// Minimum execution time: 14_057_000 picoseconds.
Weight::from_parts(14_496_549, 0)
.saturating_add(Weight::from_parts(0, 3986))
// Standard Error: 2_822
.saturating_add(Weight::from_parts(105_109, 0).saturating_mul(s.into()))
// Standard Error: 1_883
.saturating_add(Weight::from_parts(120_380, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand All @@ -132,13 +132,13 @@ impl<T: frame_system::Config> pallet_multisig::WeightInfo for WeightInfo<T> {
/// The range of component `s` is `[2, 20]`.
fn cancel_as_multi(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `378`
// Measured: `374`
// Estimated: `3986`
// Minimum execution time: 25_707_000 picoseconds.
Weight::from_parts(26_983_055, 0)
// Minimum execution time: 27_365_000 picoseconds.
Weight::from_parts(28_627_234, 0)
.saturating_add(Weight::from_parts(0, 3986))
// Standard Error: 5_260
.saturating_add(Weight::from_parts(170_289, 0).saturating_mul(s.into()))
// Standard Error: 3_233
.saturating_add(Weight::from_parts(160_750, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand Down
Loading
Loading