Skip to content

Commit

Permalink
Benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
aurexav committed Nov 26, 2024
1 parent a9857ab commit e1d63c0
Show file tree
Hide file tree
Showing 68 changed files with 1,500 additions and 1,517 deletions.
7 changes: 5 additions & 2 deletions runtime/common/src/pallet_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ use dc_primitives::*;
// polkadot-sdk
use sp_core::U256;
use sp_runtime::traits::AccountIdConversion;
use sp_std::prelude::*;
use sp_std::vec;

/// We assume that ~5% of the block weight is consumed by `on_initialize` handlers. This is
/// used to limit the maximal weight of a single extrinsic.
Expand Down Expand Up @@ -137,7 +137,6 @@ frame_support::parameter_types! {
pub MaximumSchedulerWeight: frame_support::weights::Weight = sp_runtime::Perbill::from_percent(80)
* RuntimeBlockWeights::get().max_block;

pub AssetCreators: Vec<AccountId> = vec![super::gov_origin::ROOT];
pub TreasuryAccount: AccountId = TreasuryPid::get().into_account_truncating();

pub MaxProposalWeight: frame_support::weights::Weight = sp_runtime::Perbill::from_percent(50) * RuntimeBlockWeights::get().max_block;
Expand All @@ -154,3 +153,7 @@ frame_support::parameter_types! {
// FIXME: https://github.com/rust-lang/rust/issues/88581
pub GasLimitPovSizeRatio: u64 = BLOCK_GAS_LIMIT.saturating_div(BlockPovSizeLimit::get()) + 1;
}

frame_support::ord_parameter_types! {
pub const AssetCreator: AccountId = super::gov_origin::ROOT;
}
5 changes: 1 addition & 4 deletions runtime/crab/src/pallets/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ impl pallet_assets::Config for Runtime {
type BenchmarkHelper = benchmark_helper::Assets;
type CallbackHandle = ();
type CreateOrigin = frame_support::traits::AsEnsureOriginWithArg<
frame_system::EnsureSignedBy<
frame_support::traits::IsInVec<pallet_config::AssetCreators>,
Self::AccountId,
>,
frame_system::EnsureSignedBy<pallet_config::AssetCreator, Self::AccountId>,
>;
type Currency = Balances;
type Extra = ();
Expand Down
8 changes: 4 additions & 4 deletions runtime/crab/src/weights/cumulus_pallet_parachain_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! Autogenerated weights for `cumulus_pallet_parachain_system`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-10-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-11-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024
Expand Down Expand Up @@ -71,10 +71,10 @@ impl<T: frame_system::Config> cumulus_pallet_parachain_system::WeightInfo for We
// Measured: `48`
// Estimated: `3517`
// Minimum execution time: 2_000_000 picoseconds.
Weight::from_parts(806_123_245, 0)
Weight::from_parts(2_065_879_588, 0)
.saturating_add(Weight::from_parts(0, 3517))
// Standard Error: 840_467
.saturating_add(Weight::from_parts(101_126_518, 0).saturating_mul(n.into()))
// Standard Error: 478_254
.saturating_add(Weight::from_parts(86_483_068, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(4))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into())))
Expand Down
18 changes: 9 additions & 9 deletions runtime/crab/src/weights/cumulus_pallet_xcmp_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! Autogenerated weights for `cumulus_pallet_xcmp_queue`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-10-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-11-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024
Expand Down Expand Up @@ -62,7 +62,7 @@ impl<T: frame_system::Config> cumulus_pallet_xcmp_queue::WeightInfo for WeightIn
// Measured: `42`
// Estimated: `1527`
// Minimum execution time: 4_000_000 picoseconds.
Weight::from_parts(5_000_000, 0)
Weight::from_parts(4_000_000, 0)
.saturating_add(Weight::from_parts(0, 1527))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
Expand All @@ -81,8 +81,8 @@ impl<T: frame_system::Config> cumulus_pallet_xcmp_queue::WeightInfo for WeightIn
// Proof Size summary in bytes:
// Measured: `48`
// Estimated: `3517`
// Minimum execution time: 11_000_000 picoseconds.
Weight::from_parts(12_000_000, 0)
// Minimum execution time: 10_000_000 picoseconds.
Weight::from_parts(10_000_000, 0)
.saturating_add(Weight::from_parts(0, 3517))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
Expand All @@ -93,7 +93,7 @@ impl<T: frame_system::Config> cumulus_pallet_xcmp_queue::WeightInfo for WeightIn
// Proof Size summary in bytes:
// Measured: `42`
// Estimated: `1527`
// Minimum execution time: 3_000_000 picoseconds.
// Minimum execution time: 2_000_000 picoseconds.
Weight::from_parts(3_000_000, 0)
.saturating_add(Weight::from_parts(0, 1527))
.saturating_add(T::DbWeight::get().reads(1))
Expand All @@ -116,7 +116,7 @@ impl<T: frame_system::Config> cumulus_pallet_xcmp_queue::WeightInfo for WeightIn
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 9_000_000 picoseconds.
Weight::from_parts(10_000_000, 0)
Weight::from_parts(9_000_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
/// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1)
Expand All @@ -137,8 +137,8 @@ impl<T: frame_system::Config> cumulus_pallet_xcmp_queue::WeightInfo for WeightIn
// Proof Size summary in bytes:
// Measured: `65677`
// Estimated: `69142`
// Minimum execution time: 46_000_000 picoseconds.
Weight::from_parts(48_000_000, 0)
// Minimum execution time: 43_000_000 picoseconds.
Weight::from_parts(43_000_000, 0)
.saturating_add(Weight::from_parts(0, 69142))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(5))
Expand All @@ -152,7 +152,7 @@ impl<T: frame_system::Config> cumulus_pallet_xcmp_queue::WeightInfo for WeightIn
// Measured: `65676`
// Estimated: `69141`
// Minimum execution time: 28_000_000 picoseconds.
Weight::from_parts(29_000_000, 0)
Weight::from_parts(37_000_000, 0)
.saturating_add(Weight::from_parts(0, 69141))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
Expand Down
50 changes: 21 additions & 29 deletions runtime/crab/src/weights/darwinia_account_migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! Autogenerated weights for `darwinia_account_migration`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-10-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-11-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024
Expand Down Expand Up @@ -61,27 +61,23 @@ impl<T: frame_system::Config> darwinia_account_migration::WeightInfo for WeightI
/// Proof: `AccountMigration::KtonAccounts` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(166), added: 2641, mode: `MaxEncodedLen`)
/// Storage: `AccountMigration::Ledgers` (r:1 w:1)
/// Proof: `AccountMigration::Ledgers` (`max_values`: None, `max_size`: Some(24664), added: 27139, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:2 w:3)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`)
/// Storage: `AccountMigration::Deposits` (r:1 w:1)
/// Proof: `AccountMigration::Deposits` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `DarwiniaStaking::Ledgers` (r:0 w:1)
/// Proof: `DarwiniaStaking::Ledgers` (`max_values`: None, `max_size`: Some(1078), added: 3553, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:2)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:0 w:1)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`)
/// Storage: `Deposit::Deposits` (r:0 w:1)
/// Proof: `Deposit::Deposits` (`max_values`: None, `max_size`: Some(26150), added: 28625, mode: `MaxEncodedLen`)
fn migrate() -> Weight {
// Proof Size summary in bytes:
// Measured: `28313`
// Estimated: `31778`
// Minimum execution time: 116_000_000 picoseconds.
Weight::from_parts(122_000_000, 0)
.saturating_add(Weight::from_parts(0, 31778))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(11))
// Measured: `26853`
// Estimated: `30318`
// Minimum execution time: 72_000_000 picoseconds.
Weight::from_parts(75_000_000, 0)
.saturating_add(Weight::from_parts(0, 30318))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(8))
}
/// Storage: `AccountMigration::Multisigs` (r:0 w:1)
/// Proof: `AccountMigration::Multisigs` (`max_values`: None, `max_size`: None, mode: `Measured`)
Expand All @@ -91,14 +87,10 @@ impl<T: frame_system::Config> darwinia_account_migration::WeightInfo for WeightI
/// Proof: `AccountMigration::KtonAccounts` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(166), added: 2641, mode: `MaxEncodedLen`)
/// Storage: `AccountMigration::Ledgers` (r:1 w:1)
/// Proof: `AccountMigration::Ledgers` (`max_values`: None, `max_size`: Some(24664), added: 27139, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:2 w:3)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`)
/// Storage: `AccountMigration::Deposits` (r:1 w:1)
/// Proof: `AccountMigration::Deposits` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `DarwiniaStaking::Ledgers` (r:0 w:1)
/// Proof: `DarwiniaStaking::Ledgers` (`max_values`: None, `max_size`: Some(1078), added: 3553, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:2)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:0 w:1)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`)
/// Storage: `Deposit::Deposits` (r:0 w:1)
Expand All @@ -109,16 +101,16 @@ impl<T: frame_system::Config> darwinia_account_migration::WeightInfo for WeightI
fn migrate_multisig(x: u32, _y: u32, z: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `2 + x * (160 ±0) + z * (160 ±0)`
// Minimum execution time: 7_000_000 picoseconds.
Weight::from_parts(19_114_315, 0)
// Estimated: `2 + x * (153 ±0) + z * (153 ±0)`
// Minimum execution time: 6_000_000 picoseconds.
Weight::from_parts(13_492_917, 0)
.saturating_add(Weight::from_parts(0, 2))
// Standard Error: 10_526
.saturating_add(Weight::from_parts(18_756, 0).saturating_mul(x.into()))
// Standard Error: 6_202
.saturating_add(Weight::from_parts(22_267, 0).saturating_mul(x.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
.saturating_add(Weight::from_parts(0, 160).saturating_mul(x.into()))
.saturating_add(Weight::from_parts(0, 160).saturating_mul(z.into()))
.saturating_add(Weight::from_parts(0, 153).saturating_mul(x.into()))
.saturating_add(Weight::from_parts(0, 153).saturating_mul(z.into()))
}
/// Storage: `AccountMigration::Multisigs` (r:1 w:1)
/// Proof: `AccountMigration::Multisigs` (`max_values`: None, `max_size`: None, mode: `Measured`)
Expand All @@ -128,8 +120,8 @@ impl<T: frame_system::Config> darwinia_account_migration::WeightInfo for WeightI
// Proof Size summary in bytes:
// Measured: `3499`
// Estimated: `6964`
// Minimum execution time: 10_000_000 picoseconds.
Weight::from_parts(11_000_000, 0)
// Minimum execution time: 9_000_000 picoseconds.
Weight::from_parts(10_000_000, 0)
.saturating_add(Weight::from_parts(0, 6964))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
Expand Down
8 changes: 4 additions & 4 deletions runtime/crab/src/weights/darwinia_deposit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! Autogenerated weights for `darwinia_deposit`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-10-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-11-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024
Expand Down Expand Up @@ -75,8 +75,8 @@ impl<T: frame_system::Config> darwinia_deposit::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `27325`
// Estimated: `33265`
// Minimum execution time: 223_000_000 picoseconds.
Weight::from_parts(236_000_000, 0)
// Minimum execution time: 212_000_000 picoseconds.
Weight::from_parts(219_000_000, 0)
.saturating_add(Weight::from_parts(0, 33265))
.saturating_add(T::DbWeight::get().reads(11))
.saturating_add(T::DbWeight::get().writes(4))
Expand All @@ -88,7 +88,7 @@ impl<T: frame_system::Config> darwinia_deposit::WeightInfo for WeightInfo<T> {
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_000_000 picoseconds.
Weight::from_parts(3_000_000, 0)
Weight::from_parts(2_000_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand Down
14 changes: 7 additions & 7 deletions runtime/crab/src/weights/darwinia_staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! Autogenerated weights for `darwinia_staking`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-10-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-11-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024
Expand Down Expand Up @@ -63,8 +63,8 @@ impl<T: frame_system::Config> darwinia_staking::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `406`
// Estimated: `4543`
// Minimum execution time: 53_000_000 picoseconds.
Weight::from_parts(55_000_000, 0)
// Minimum execution time: 49_000_000 picoseconds.
Weight::from_parts(53_000_000, 0)
.saturating_add(Weight::from_parts(0, 4543))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
Expand All @@ -77,8 +77,8 @@ impl<T: frame_system::Config> darwinia_staking::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `271`
// Estimated: `3736`
// Minimum execution time: 13_000_000 picoseconds.
Weight::from_parts(15_000_000, 0)
// Minimum execution time: 12_000_000 picoseconds.
Weight::from_parts(13_000_000, 0)
.saturating_add(Weight::from_parts(0, 3736))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
Expand All @@ -90,7 +90,7 @@ impl<T: frame_system::Config> darwinia_staking::WeightInfo for WeightInfo<T> {
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_000_000 picoseconds.
Weight::from_parts(3_000_000, 0)
Weight::from_parts(2_000_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand All @@ -101,7 +101,7 @@ impl<T: frame_system::Config> darwinia_staking::WeightInfo for WeightInfo<T> {
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_000_000 picoseconds.
Weight::from_parts(3_000_000, 0)
Weight::from_parts(2_000_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand Down
Loading

0 comments on commit e1d63c0

Please sign in to comment.