diff --git a/Cargo.lock b/Cargo.lock index 29945add7..3ba948241 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2773,17 +2773,21 @@ dependencies = [ name = "darwinia-deposit" version = "6.6.5" dependencies = [ + "darwinia-ethtx-forwarder", "darwinia-staking-traits", "dc-inflation", "dc-types", + "ethabi", "frame-benchmarking", "frame-support", "frame-system", + "log", "pallet-assets", "pallet-balances", "pallet-timestamp", "parity-scale-codec", "scale-info", + "sp-core", "sp-io", "sp-runtime", "sp-std 14.0.0 (git+https://github.com/darwinia-network/polkadot-sdk?branch=release-polkadot-v1.7.2)", @@ -2794,6 +2798,7 @@ name = "darwinia-ethtx-forwarder" version = "6.6.5" dependencies = [ "array-bytes 6.2.3", + "ethabi", "ethereum", "fp-ethereum", "fp-evm", @@ -2801,6 +2806,7 @@ dependencies = [ "frame-support", "frame-system", "libsecp256k1", + "log", "moonbeam-evm-tracer", "pallet-balances", "pallet-ethereum", @@ -3007,9 +3013,9 @@ dependencies = [ "darwinia-ethtx-forwarder", "darwinia-staking-traits", "dc-inflation", - "dc-primitives", + "dc-types", "ethabi", - "ethereum", + "fp-evm", "frame-benchmarking", "frame-support", "frame-system", @@ -3022,11 +3028,11 @@ dependencies = [ "parity-scale-codec", "pretty_env_logger", "scale-info", + "serde", "sp-core", "sp-io", "sp-runtime", "sp-std 14.0.0 (git+https://github.com/darwinia-network/polkadot-sdk?branch=release-polkadot-v1.7.2)", - "substrate-test-utils", ] [[package]] @@ -14854,15 +14860,6 @@ dependencies = [ "trie-db", ] -[[package]] -name = "substrate-test-utils" -version = "4.0.0-dev" -source = "git+https://github.com/darwinia-network/polkadot-sdk?branch=release-polkadot-v1.7.2#581178546b4b0fb8ebf4a6cee5a51d5629419197" -dependencies = [ - "futures 0.3.30", - "tokio", -] - [[package]] name = "substrate-typenum" version = "1.16.0" diff --git a/Cargo.toml b/Cargo.toml index 2e2c69e89..10de90666 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,7 @@ version = "6.6.5" # crates.io array-bytes = { version = "6.2" } codec = { package = "parity-scale-codec", version = "3.6", default-features = false } +ethabi = { version = "18.0", default-features = false } ethereum = { version = "0.15", default-features = false, features = ["with-codec"] } libsecp256k1 = { version = "0.7", default-features = false } log = { version = "0.4" } diff --git a/node/src/service/mod.rs b/node/src/service/mod.rs index a4dedec3d..2207ef42c 100644 --- a/node/src/service/mod.rs +++ b/node/src/service/mod.rs @@ -747,7 +747,7 @@ where network_provider: network.clone(), is_validator: config.role.is_authority(), enable_http_requests: false, - custom_extensions: move |_| vec![], + custom_extensions: move |_| Vec::new(), }) .run(client.clone(), task_manager.spawn_handle()) .boxed(), diff --git a/pallet/account-migration/src/lib.rs b/pallet/account-migration/src/lib.rs index 9325af003..337f9b19d 100644 --- a/pallet/account-migration/src/lib.rs +++ b/pallet/account-migration/src/lib.rs @@ -55,9 +55,9 @@ mod weights; pub use weights::WeightInfo; // darwinia -use darwinia_deposit::Deposit; -use darwinia_staking::{migration::v2::OldLedger, Ledger}; -use dc_primitives::{AccountId as AccountId20, AssetId, Balance, Nonce}; +use darwinia_deposit::{Deposit, DepositId}; +use darwinia_staking::Ledger; +use dc_primitives::{AccountId as AccountId20, AssetId, Balance, BlockNumber, Nonce}; // polkadot-sdk use frame_support::{ migration, @@ -108,7 +108,10 @@ pub mod pallet { > + pallet_assets::Config + pallet_balances::Config + darwinia_deposit::Config - + darwinia_staking::Config + + darwinia_staking::Config< + Deposit = darwinia_deposit::Pallet, + MaxDeposits = ConstU32<512>, + > { /// Override the [`frame_system::Config::RuntimeEvent`]. type RuntimeEvent: From + IsType<::RuntimeEvent>; @@ -161,7 +164,7 @@ pub mod pallet { /// [`darwinia_staking::migration::v2::OldLedger`] data. #[pallet::storage] #[pallet::getter(fn ledger_of)] - pub type Ledgers = StorageMap<_, Blake2_128Concat, AccountId32, OldLedger>; + pub type Ledgers = StorageMap<_, Blake2_128Concat, AccountId32, OldLedger>; /// Multisig migration caches. #[pallet::storage] @@ -417,34 +420,34 @@ pub mod pallet { asset_details, ); } - } - if let Some(l) = >::take(from) { - if l.staked_ring > 0 { - as Currency<_>>::transfer( - to, - &darwinia_staking::account_id(), - l.staked_ring, - AllowDeath, - )?; - } + if let Some(l) = >::take(from) { + if l.staked_ring > 0 { + as Currency<_>>::transfer( + to, + &darwinia_staking::account_id(), + l.staked_ring, + AllowDeath, + )?; + } - if let Some(ds) = >::take(from) { - as Currency<_>>::transfer( - to, - &darwinia_deposit::account_id(), - ds.iter().map(|d| d.value).sum(), - AllowDeath, - )?; - >::insert( + if let Some(ds) = >::take(from) { + as Currency<_>>::transfer( + to, + &darwinia_deposit::account_id(), + ds.iter().map(|d| d.value).sum(), + AllowDeath, + )?; + >::insert( + to, + BoundedVec::try_from(ds).map_err(|_| >::ExceedMaxDeposits)?, + ); + } + + >::insert( to, - BoundedVec::try_from(ds).map_err(|_| >::ExceedMaxDeposits)?, + Ledger { ring: l.staked_ring, deposits: l.staked_deposits }, ); } - - >::insert( - to, - Ledger { ring: l.staked_ring, deposits: l.staked_deposits }, - ); } Ok(()) @@ -459,7 +462,7 @@ pub(crate) type Signature = [u8; 64]; // Copy from . // Due to its visibility. #[allow(missing_docs)] -#[derive(PartialEq, Eq, Encode, Decode, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive(PartialEq, Eq, Encode, Decode, MaxEncodedLen, RuntimeDebug, TypeInfo)] pub struct AssetAccount { balance: Balance, is_frozen: bool, @@ -467,7 +470,7 @@ pub struct AssetAccount { extra: (), } #[allow(missing_docs)] -#[derive(PartialEq, Eq, Encode, Decode, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive(PartialEq, Eq, Encode, Decode, MaxEncodedLen, RuntimeDebug, TypeInfo)] pub(crate) enum ExistenceReason { #[codec(index = 0)] Consumer, @@ -479,7 +482,7 @@ pub(crate) enum ExistenceReason { DepositRefunded, } #[allow(missing_docs)] -#[derive(PartialEq, Eq, Encode, Decode, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive(PartialEq, Eq, Encode, Decode, MaxEncodedLen, RuntimeDebug, TypeInfo)] pub(crate) struct AssetDetails { owner: AccountId20, issuer: AccountId20, @@ -495,13 +498,24 @@ pub(crate) struct AssetDetails { status: AssetStatus, } #[allow(missing_docs)] -#[derive(PartialEq, Eq, Encode, Decode, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive(PartialEq, Eq, Encode, Decode, MaxEncodedLen, RuntimeDebug, TypeInfo)] pub(crate) enum AssetStatus { Live, Frozen, Destroying, } +#[allow(missing_docs)] +#[derive(Default, PartialEq, Eq, Encode, Decode, MaxEncodedLen, RuntimeDebug, TypeInfo)] +pub struct OldLedger { + pub staked_ring: Balance, + pub staked_kton: Balance, + pub staked_deposits: BoundedVec>, + pub unstaking_ring: BoundedVec<(Balance, BlockNumber), ConstU32<512>>, + pub unstaking_kton: BoundedVec<(Balance, BlockNumber), ConstU32<512>>, + pub unstaking_deposits: BoundedVec<(DepositId, BlockNumber), ConstU32<512>>, +} + #[allow(missing_docs)] #[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] pub struct MultisigParams { diff --git a/pallet/account-migration/src/mock.rs b/pallet/account-migration/src/mock.rs index 4e5861011..656158ed0 100644 --- a/pallet/account-migration/src/mock.rs +++ b/pallet/account-migration/src/mock.rs @@ -16,7 +16,6 @@ // You should have received a copy of the GNU General Public License // along with Darwinia. If not, see . -pub use crate as darwinia_account_migration; pub use dc_primitives::*; // polkadot-sdk @@ -125,11 +124,13 @@ frame_support::parameter_types! { } impl darwinia_deposit::Config for Runtime { + type DepositMigrator = (); type Kton = Dummy; - type MaxDeposits = (); + type MaxDeposits = frame_support::traits::ConstU32<512>; type MinLockingAmount = (); type Ring = Balances; type RuntimeEvent = RuntimeEvent; + type Treasury = (); type WeightInfo = (); } @@ -137,18 +138,20 @@ impl darwinia_staking::Config for Runtime { type Currency = Balances; type Deposit = Deposit; type IssuingManager = (); - type Kton = Dummy; - type KtonStakerNotifier = (); - type MaxDeposits = (); + type KtonStaking = (); + type MaxDeposits = frame_support::traits::ConstU32<512>; type Ring = Dummy; + type RingStaking = (); type RuntimeEvent = RuntimeEvent; type ShouldEndSession = (); + type Treasury = (); + type UnixTime = Timestamp; type WeightInfo = (); } #[cfg(not(feature = "runtime-benchmarks"))] impl darwinia_staking::DepositConfig for Runtime {} -impl darwinia_account_migration::Config for Runtime { +impl crate::Config for Runtime { type RuntimeEvent = RuntimeEvent; type WeightInfo = (); } @@ -161,7 +164,7 @@ frame_support::construct_runtime! { Assets: pallet_assets, Deposit: darwinia_deposit, Staking: darwinia_staking, - AccountMigration: darwinia_account_migration, + AccountMigration: crate, } } @@ -169,13 +172,8 @@ pub(crate) fn new_test_ext() -> TestExternalities { let mut storage = >::default().build_storage().unwrap(); pallet_assets::GenesisConfig:: { - assets: vec![(darwinia_account_migration::KTON_ID, [0; 20].into(), true, 1)], - metadata: vec![( - darwinia_account_migration::KTON_ID, - b"KTON".to_vec(), - b"KTON".to_vec(), - 18, - )], + assets: vec![(crate::KTON_ID, [0; 20].into(), true, 1)], + metadata: vec![(crate::KTON_ID, b"KTON".to_vec(), b"KTON".to_vec(), 18)], ..Default::default() } .assimilate_storage(&mut storage) diff --git a/pallet/deposit/Cargo.toml b/pallet/deposit/Cargo.toml index 869474a47..1f2b2cdf1 100644 --- a/pallet/deposit/Cargo.toml +++ b/pallet/deposit/Cargo.toml @@ -9,21 +9,25 @@ version.workspace = true [dependencies] # crates.io codec = { workspace = true, package = "parity-scale-codec" } +ethabi = { workspace = true } +log = { workspace = true } scale-info = { workspace = true } # darwinia -darwinia-staking-traits = { workspace = true } -dc-inflation = { workspace = true } -dc-types = { workspace = true } +darwinia-ethtx-forwarder = { workspace = true } +darwinia-staking-traits = { workspace = true } +dc-inflation = { workspace = true } +dc-types = { workspace = true } -# subtrate +# polkadot-sdk frame-support = { workspace = true } frame-system = { workspace = true } pallet-timestamp = { workspace = true } +sp-core = { workspace = true } sp-runtime = { workspace = true } +sp-std = { workspace = true } # polkadot-sdk optional frame-benchmarking = { workspace = true, optional = true } -sp-std = { workspace = true, optional = true } [dev-dependencies] # polkadot-sdk @@ -36,24 +40,29 @@ default = ["std"] std = [ # crates.io "codec/std", + "ethabi/std", + "log/std", "scale-info/std", # darwinia + "darwinia-ethtx-forwarder/std", "darwinia-staking-traits/std", "dc-inflation/std", - # subtrate + # polkadot-sdk "frame-support/std", "frame-system/std", "pallet-timestamp/std", + "sp-core/std", "sp-runtime/std", - "sp-std?/std", + "sp-std/std", # polkadot-sdk optional "frame-benchmarking?/std", ] runtime-benchmarks = [ # darwinia + "darwinia-ethtx-forwarder/runtime-benchmarks", "darwinia-staking-traits/runtime-benchmarks", # polkadot-sdk @@ -63,7 +72,6 @@ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks", # polkadot-sdk optional "frame-benchmarking/runtime-benchmarks", - "sp-std", ] try-runtime = [ diff --git a/pallet/deposit/src/benchmarking.rs b/pallet/deposit/src/benchmarking.rs index 61a490ef5..6cebd619a 100644 --- a/pallet/deposit/src/benchmarking.rs +++ b/pallet/deposit/src/benchmarking.rs @@ -114,6 +114,39 @@ mod benchmarks { } } + #[benchmark] + fn migrate() { + let a = frame_benchmarking::whitelisted_caller::(); + let max_deposits = T::MaxDeposits::get(); + + >::set_deposit_contract(RawOrigin::Root.into(), a.clone()).unwrap(); + + // Remove `+ 1` after https://github.com/paritytech/substrate/pull/13655. + T::Ring::make_free_balance_be(&a, max_deposits as Balance * UNIT + 1); + + // Worst-case scenario: + // + // Max deposit items to be migrated. + (0..max_deposits).for_each(|_| { + >::lock(RawOrigin::Signed(a.clone()).into(), UNIT, MAX_LOCKING_MONTHS) + .unwrap() + }); + + #[extrinsic_call] + _(RawOrigin::Signed(a)); + } + + #[benchmark] + fn set_deposit_contract() { + let a = frame_benchmarking::whitelisted_caller(); + + // Worst-case scenario: + // + // Set successfully. + #[extrinsic_call] + _(RawOrigin::Root, a); + } + frame_benchmarking::impl_benchmark_test_suite!( Pallet, crate::mock::new_test_ext(), diff --git a/pallet/deposit/src/lib.rs b/pallet/deposit/src/lib.rs index 8c0edad07..e7e7693c1 100644 --- a/pallet/deposit/src/lib.rs +++ b/pallet/deposit/src/lib.rs @@ -40,10 +40,12 @@ pub use weights::WeightInfo; // core use core::{ cmp::Ordering::{Equal, Greater, Less}, + marker::PhantomData, ops::ControlFlow::{Break, Continue}, }; // crates.io use codec::FullCodec; +use ethabi::{Function, Param, ParamType, StateMutability, Token}; // darwinia use dc_inflation::MILLISECS_PER_YEAR; use dc_types::{Balance, Moment}; @@ -54,7 +56,9 @@ use frame_support::{ PalletId, }; use frame_system::pallet_prelude::*; +use sp_core::H160; use sp_runtime::traits::AccountIdConversion; +use sp_std::prelude::*; #[frame_support::pallet] pub mod pallet { @@ -75,6 +79,13 @@ pub mod pallet { /// KTON asset. type Kton: SimpleAsset; + /// Deposit contract migrator. + type DepositMigrator: MigrateToContract; + + /// Treasury account. + #[pallet::constant] + type Treasury: Get; + /// Minimum amount to lock at least. #[pallet::constant] type MinLockingAmount: Get; @@ -99,14 +110,16 @@ pub mod pallet { expired_time: Moment, kton_reward: Balance, }, - /// An expired deposit has been claimed. - DepositClaimed { owner: T::AccountId, deposit_id: DepositId }, + /// Expired deposits have been claimed. + DepositsClaimed { owner: T::AccountId, deposits: Vec }, /// An unexpired deposit has been claimed by paying the KTON penalty. DepositClaimedWithPenalty { owner: T::AccountId, deposit_id: DepositId, kton_penalty: Balance, }, + /// Deposits have been migrated. + DepositsMigrated { owner: T::AccountId, deposits: Vec }, } #[pallet::error] @@ -137,6 +150,11 @@ pub mod pallet { pub type Deposits = StorageMap<_, Blake2_128Concat, T::AccountId, BoundedVec>; + // Deposit contract address. + #[pallet::storage] + #[pallet::getter(fn deposit_contract)] + pub type DepositContract = StorageValue<_, T::AccountId>; + #[pallet::pallet] pub struct Pallet(_); #[pallet::call] @@ -218,18 +236,14 @@ pub mod pallet { pub fn claim(origin: OriginFor) -> DispatchResult { let who = ensure_signed(origin)?; let now = Self::now(); - let mut claimed = 0; + let mut to_claim = (0, Vec::new()); let _ = >::try_mutate(&who, |maybe_ds| { let ds = maybe_ds.as_mut().ok_or(())?; ds.retain(|d| { if d.expired_time <= now && !d.in_use { - claimed += d.value; - - Self::deposit_event(Event::DepositClaimed { - owner: who.clone(), - deposit_id: d.id, - }); + to_claim.0 += d.value; + to_claim.1.push(d.id); false } else { @@ -246,7 +260,8 @@ pub mod pallet { >::Ok(()) }); - T::Ring::transfer(&account_id(), &who, claimed, AllowDeath)?; + T::Ring::transfer(&account_id(), &who, to_claim.0, AllowDeath)?; + Self::deposit_event(Event::DepositsClaimed { owner: who, deposits: to_claim.1 }); Ok(()) } @@ -261,13 +276,16 @@ pub mod pallet { let d = ds .remove(ds.iter().position(|d| d.id == id).ok_or(>::DepositNotFound)?); + if d.in_use { + Err(>::DepositInUse)?; + } if ds.is_empty() { >::dec_consumers(&who); *maybe_ds = None; } - >::Ok(d) + Ok::<_, DispatchError>(d) })?; let now = Self::now(); @@ -291,10 +309,135 @@ pub mod pallet { Ok(()) } + + /// Migration data to deposit contract. + #[pallet::call_index(3)] + #[pallet::weight(::WeightInfo::migrate())] + pub fn migrate(origin: OriginFor) -> DispatchResult { + let who = ensure_signed(origin)?; + let Some(ds) = >::take(&who) else { return Ok(()) }; + let now = Self::now(); + + for c in ds.chunks(50) { + let mut to_claim = (0, Vec::new()); + let mut to_migrate = (0, Vec::new(), Vec::new()); + + for d in c { + if d.in_use { + Err(>::DepositInUse)?; + } + + if d.expired_time <= now { + to_claim.0 += d.value; + to_claim.1.push(d.id); + } else { + to_migrate.0 += d.value; + to_migrate.1.push(d.id); + to_migrate.2.push((d.value, d.start_time, d.expired_time)); + } + } + + T::Ring::transfer(&account_id(), &who, to_claim.0, AllowDeath)?; + T::Ring::transfer(&account_id(), &T::Treasury::get(), to_migrate.0, AllowDeath)?; + T::DepositMigrator::migrate(who.clone(), to_migrate.0, to_migrate.2); + + Self::deposit_event(Event::DepositsClaimed { + owner: who.clone(), + deposits: to_claim.1, + }); + Self::deposit_event(Event::DepositsMigrated { + owner: who.clone(), + deposits: to_migrate.1, + }); + } + + Ok(()) + } + + /// Set deposit contract address. + #[pallet::call_index(4)] + #[pallet::weight(::WeightInfo::set_deposit_contract())] + pub fn set_deposit_contract( + origin: OriginFor, + deposit_contract: T::AccountId, + ) -> DispatchResult { + ensure_root(origin)?; + + >::put(deposit_contract); + + Ok(()) + } + } + impl Pallet + where + T: Config, + { + fn now() -> Moment { + as UnixTime>::now().as_millis() + } + } + impl darwinia_staking_traits::Stake for Pallet + where + T: Config, + { + type AccountId = T::AccountId; + type Item = DepositId; + + fn stake(who: &Self::AccountId, item: Self::Item) -> DispatchResult { + >::try_mutate(who, |ds| { + let ds = ds.as_mut().ok_or(>::DepositNotFound)?; + let d = ds.iter_mut().find(|d| d.id == item).ok_or(>::DepositNotFound)?; + + if d.in_use { + Err(>::DepositInUse)? + } else { + d.in_use = true; + + Ok(()) + } + }) + } + + fn unstake(who: &Self::AccountId, item: Self::Item) -> DispatchResult { + >::try_mutate(who, |ds| { + let ds = ds.as_mut().ok_or(>::DepositNotFound)?; + let d = ds.iter_mut().find(|d| d.id == item).ok_or(>::DepositNotFound)?; + + if d.in_use { + d.in_use = false; + + Ok(()) + } else { + Err(>::DepositNotInUse)? + } + }) + } + } + impl darwinia_staking_traits::StakeExt for Pallet + where + T: Config, + { + type Amount = Balance; + + fn amount(who: &Self::AccountId, item: Self::Item) -> Result { + Ok(>::get(who) + .and_then(|ds| { + ds.into_iter().find_map(|d| if d.id == item { Some(d.value) } else { None }) + }) + .ok_or(>::DepositNotFound)?) + } } } pub use pallet::*; +/// Deposit identifier. +pub type DepositId = u16; +// https://github.com/polkadot-js/apps/issues/8591 +// Max deposits in Darwinia is 322. +// Max deposits in Crab is 220. +// Maybe we will use `WeakBoundedVec` later. +// pub type DepositId = u8; + /// Milliseconds per month. pub const MILLISECS_PER_MONTH: Moment = MILLISECS_PER_YEAR / 12; @@ -313,13 +456,15 @@ pub trait SimpleAsset { fn burn(who: &Self::AccountId, amount: Balance) -> DispatchResult; } -/// Deposit identifier. -pub type DepositId = u16; -// https://github.com/polkadot-js/apps/issues/8591 -// Max deposits in Darwinia is 322. -// Max deposits in Crab is 220. -// Maybe we will use `WeakBoundedVec` later. -// pub type DepositId = u8; +/// Migrate to contract trait. +pub trait MigrateToContract +where + T: Config, +{ + /// Migrate to contract. + fn migrate(_: T::AccountId, _: Balance, _: Vec<(Balance, Moment, Moment)>) {} +} +impl MigrateToContract for () where T: Config {} /// Deposit. #[derive(Clone, PartialEq, Eq, Encode, Decode, MaxEncodedLen, TypeInfo, RuntimeDebug)] @@ -336,63 +481,65 @@ pub struct Deposit { pub in_use: bool, } -impl Pallet +/// Deposit migrator. +pub struct DepositMigrator(PhantomData); +impl MigrateToContract for DepositMigrator where - T: Config, -{ - fn now() -> Moment { - as UnixTime>::now().as_millis() - } -} -impl darwinia_staking_traits::Stake for Pallet -where - T: Config, -{ - type AccountId = T::AccountId; - type Item = DepositId; - - fn stake(who: &Self::AccountId, item: Self::Item) -> DispatchResult { - >::try_mutate(who, |ds| { - let ds = ds.as_mut().ok_or(>::DepositNotFound)?; - let d = ds.iter_mut().find(|d| d.id == item).ok_or(>::DepositNotFound)?; - - if d.in_use { - Err(>::DepositInUse)? - } else { - d.in_use = true; - - Ok(()) - } - }) - } - - fn unstake(who: &Self::AccountId, item: Self::Item) -> DispatchResult { - >::try_mutate(who, |ds| { - let ds = ds.as_mut().ok_or(>::DepositNotFound)?; - let d = ds.iter_mut().find(|d| d.id == item).ok_or(>::DepositNotFound)?; - - if d.in_use { - d.in_use = false; - - Ok(()) - } else { - Err(>::DepositNotInUse)? - } - }) - } -} -impl darwinia_staking_traits::StakeExt for Pallet -where - T: Config, + T: Config + darwinia_ethtx_forwarder::Config, + T::AccountId: Into, { - type Amount = Balance; - - fn amount(who: &Self::AccountId, item: Self::Item) -> Result { - Ok(>::get(who) - .and_then(|ds| { - ds.into_iter().find_map(|d| if d.id == item { Some(d.value) } else { None }) - }) - .ok_or(>::DepositNotFound)?) + fn migrate(who: T::AccountId, total: Balance, deposits: Vec<(Balance, Moment, Moment)>) { + let Some(dc) = >::get() else { + log::error!("deposit contract must be some; qed"); + + return; + }; + let dc = dc.into(); + + #[allow(deprecated)] + darwinia_ethtx_forwarder::quick_forward_transact::( + T::Treasury::get().into(), + Function { + name: "migrate".into(), + inputs: vec![ + Param { + name: "address".to_owned(), + kind: ParamType::Address, + internal_type: None, + }, + Param { + name: "deposits".to_owned(), + kind: ParamType::Array(Box::new(ParamType::Tuple(vec![ + ParamType::Uint(128), + ParamType::Uint(64), + ParamType::Uint(64), + ]))), + internal_type: None, + }, + ], + outputs: Vec::new(), + constant: None, + state_mutability: StateMutability::Payable, + }, + &[ + Token::Address(who.into()), + Token::Array( + deposits + .into_iter() + .map(|(v, s, e)| { + Token::Tuple(vec![ + Token::Uint(v.into()), + Token::Uint(s.into()), + Token::Uint(e.into()), + ]) + }) + .collect(), + ), + ], + dc, + total.into(), + 1_000_000.into(), + ) } } diff --git a/pallet/deposit/src/mock.rs b/pallet/deposit/src/mock.rs index ec06bcf71..3689e8a12 100644 --- a/pallet/deposit/src/mock.rs +++ b/pallet/deposit/src/mock.rs @@ -16,9 +16,9 @@ // You should have received a copy of the GNU General Public License // along with Darwinia. If not, see . -pub use crate as darwinia_deposit; -pub use dc_types::{Balance, Moment, UNIT}; - +// darwinia +use crate::*; +use dc_types::{Balance, Moment, UNIT}; // polkadot-sdk use frame_support::derive_impl; use sp_io::TestExternalities; @@ -71,7 +71,7 @@ impl pallet_assets::Config for Runtime { } pub enum KtonMinting {} -impl darwinia_deposit::SimpleAsset for KtonMinting { +impl crate::SimpleAsset for KtonMinting { type AccountId = ::AccountId; fn mint(beneficiary: &Self::AccountId, amount: Balance) -> sp_runtime::DispatchResult { @@ -86,12 +86,14 @@ impl darwinia_deposit::SimpleAsset for KtonMinting { Assets::burn(RuntimeOrigin::signed(0), 0.into(), *who, amount) } } -impl darwinia_deposit::Config for Runtime { +impl crate::Config for Runtime { + type DepositMigrator = (); type Kton = KtonMinting; type MaxDeposits = frame_support::traits::ConstU32<16>; type MinLockingAmount = frame_support::traits::ConstU128; type Ring = Balances; type RuntimeEvent = RuntimeEvent; + type Treasury = (); type WeightInfo = (); } @@ -101,15 +103,11 @@ frame_support::construct_runtime! { Timestamp: pallet_timestamp, Balances: pallet_balances, Assets: pallet_assets, - Deposit: darwinia_deposit, + Deposit: crate, } } -pub(crate) fn efflux(milli_secs: Moment) { - Timestamp::set_timestamp(Timestamp::now() + milli_secs); -} - -pub(crate) fn new_test_ext() -> TestExternalities { +pub fn new_test_ext() -> TestExternalities { let mut storage = >::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { @@ -127,3 +125,17 @@ pub(crate) fn new_test_ext() -> TestExternalities { storage.into() } + +pub fn efflux(milli_secs: Moment) { + Timestamp::set_timestamp(Timestamp::now() + milli_secs); +} + +pub fn set_in_use(who: u64, in_use: bool) { + let _ = >::try_mutate(who, |maybe_ds| { + let ds = maybe_ds.as_mut().ok_or(())?; + + ds.iter_mut().for_each(|d| d.in_use = in_use); + + Ok::<_, ()>(()) + }); +} diff --git a/pallet/deposit/src/tests.rs b/pallet/deposit/src/tests.rs index f38551f64..f6e71714c 100644 --- a/pallet/deposit/src/tests.rs +++ b/pallet/deposit/src/tests.rs @@ -22,6 +22,7 @@ use crate::{ Deposit as DepositS, *, }; use darwinia_staking_traits::Stake; +use dc_types::UNIT; // polkadot-sdk use frame_support::{assert_noop, assert_ok}; use sp_runtime::TokenError; @@ -31,18 +32,18 @@ fn lock_should_work() { new_test_ext().execute_with(|| { assert_eq!(System::account(1).consumers, 0); assert_eq!( - Balances::free_balance(darwinia_deposit::account_id::< - ::AccountId, - >()), + Balances::free_balance( + crate::account_id::<::AccountId>() + ), 0 ); assert_eq!(Balances::free_balance(1), 1_000 * UNIT); assert_ok!(Deposit::lock(RuntimeOrigin::signed(1), 10 * UNIT, 1)); assert_eq!(System::account(1).consumers, 1); assert_eq!( - Balances::free_balance(darwinia_deposit::account_id::< - ::AccountId, - >()), + Balances::free_balance( + crate::account_id::<::AccountId>() + ), 10 * UNIT ); assert_eq!(Balances::free_balance(1), 990 * UNIT); @@ -331,6 +332,15 @@ fn claim_with_penalty_should_work() { ); assert_ok!(KtonMinting::mint(&1, UNIT)); + mock::set_in_use(1, true); + + assert_noop!( + Deposit::claim_with_penalty(RuntimeOrigin::signed(1), 0), + >::DepositInUse + ); + + mock::set_in_use(1, false); + assert_ok!(Deposit::claim_with_penalty(RuntimeOrigin::signed(1), 0)); assert_eq!(Balances::free_balance(1), 1_000 * UNIT); assert_eq!(Assets::balance(0, 1), 999_984_771_573_604_062); @@ -346,3 +356,20 @@ fn claim_with_penalty_should_work() { ); }); } + +#[test] +fn migrate_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Deposit::lock(RuntimeOrigin::signed(1), UNIT, 1)); + assert!(Deposit::deposit_of(1).is_some()); + + mock::set_in_use(1, true); + + assert_noop!(Deposit::migrate(RuntimeOrigin::signed(1)), >::DepositInUse); + + mock::set_in_use(1, false); + + assert_ok!(Deposit::migrate(RuntimeOrigin::signed(1))); + assert!(Deposit::deposit_of(1).is_none()); + }); +} diff --git a/pallet/deposit/src/weights.rs b/pallet/deposit/src/weights.rs index 6ffa5b074..cd6aeeb2e 100644 --- a/pallet/deposit/src/weights.rs +++ b/pallet/deposit/src/weights.rs @@ -18,8 +18,8 @@ //! Autogenerated weights for darwinia_deposit //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-11-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("koi-dev"), DB CACHE: 1024 @@ -55,6 +55,8 @@ pub trait WeightInfo { fn lock() -> Weight; fn claim() -> Weight; fn claim_with_penalty() -> Weight; + fn migrate() -> Weight; + fn set_deposit_contract() -> Weight; } /// Weights for darwinia_deposit using the Substrate node and recommended hardware. @@ -72,10 +74,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) fn lock() -> Weight { // Proof Size summary in bytes: - // Measured: `26848` + // Measured: `26812` // Estimated: `29615` - // Minimum execution time: 66_573 nanoseconds. - Weight::from_parts(69_229_000, 0) + // Minimum execution time: 92_000 nanoseconds. + Weight::from_parts(98_000_000, 0) .saturating_add(Weight::from_parts(29615, 0)) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) @@ -88,10 +90,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`) fn claim() -> Weight { // Proof Size summary in bytes: - // Measured: `26578` + // Measured: `26541` // Estimated: `29615` - // Minimum execution time: 1_188_888 nanoseconds. - Weight::from_parts(1_240_611_000, 0) + // Minimum execution time: 70_000 nanoseconds. + Weight::from_parts(82_000_000, 0) .saturating_add(Weight::from_parts(29615, 0)) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -104,15 +106,54 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) /// Storage: `Assets::Asset` (r:1 w:1) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(166), added: 2641, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`) fn claim_with_penalty() -> Weight { // Proof Size summary in bytes: - // Measured: `26704` + // Measured: `26863` // Estimated: `29615` - // Minimum execution time: 45_943 nanoseconds. - Weight::from_parts(48_619_000, 0) + // Minimum execution time: 92_000 nanoseconds. + Weight::from_parts(100_000_000, 0) .saturating_add(Weight::from_parts(29615, 0)) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: `Deposit::Deposits` (r:1 w:1) + /// Proof: `Deposit::Deposits` (`max_values`: None, `max_size`: Some(26150), added: 28625, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:3 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`) + /// Storage: `Deposit::DepositContract` (r:1 w:0) + /// Proof: `Deposit::DepositContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + /// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0) + /// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `EVM::AccountCodes` (r:2 w:0) + /// Proof: `EVM::AccountCodes` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Digest` (r:1 w:0) + /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Ethereum::Pending` (r:1 w:1) + /// Proof: `Ethereum::Pending` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn migrate() -> Weight { + // Proof Size summary in bytes: + // Measured: `27516` + // Estimated: `33456` + // Minimum execution time: 4_057_000 nanoseconds. + Weight::from_parts(4_577_000_000, 0) + .saturating_add(Weight::from_parts(33456, 0)) + .saturating_add(T::DbWeight::get().reads(11_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: `Deposit::DepositContract` (r:0 w:1) + /// Proof: `Deposit::DepositContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + fn set_deposit_contract() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_000 nanoseconds. + Weight::from_parts(3_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } } @@ -130,10 +171,10 @@ impl WeightInfo for () { /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) fn lock() -> Weight { // Proof Size summary in bytes: - // Measured: `26848` + // Measured: `26812` // Estimated: `29615` - // Minimum execution time: 66_573 nanoseconds. - Weight::from_parts(69_229_000, 0) + // Minimum execution time: 92_000 nanoseconds. + Weight::from_parts(98_000_000, 0) .saturating_add(Weight::from_parts(29615, 0)) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) @@ -146,10 +187,10 @@ impl WeightInfo for () { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`) fn claim() -> Weight { // Proof Size summary in bytes: - // Measured: `26578` + // Measured: `26541` // Estimated: `29615` - // Minimum execution time: 1_188_888 nanoseconds. - Weight::from_parts(1_240_611_000, 0) + // Minimum execution time: 70_000 nanoseconds. + Weight::from_parts(82_000_000, 0) .saturating_add(Weight::from_parts(29615, 0)) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -162,14 +203,53 @@ impl WeightInfo for () { /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) /// Storage: `Assets::Asset` (r:1 w:1) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(166), added: 2641, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`) fn claim_with_penalty() -> Weight { // Proof Size summary in bytes: - // Measured: `26704` + // Measured: `26863` // Estimated: `29615` - // Minimum execution time: 45_943 nanoseconds. - Weight::from_parts(48_619_000, 0) + // Minimum execution time: 92_000 nanoseconds. + Weight::from_parts(100_000_000, 0) .saturating_add(Weight::from_parts(29615, 0)) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) + .saturating_add(RocksDbWeight::get().reads(5_u64)) + .saturating_add(RocksDbWeight::get().writes(4_u64)) + } + /// Storage: `Deposit::Deposits` (r:1 w:1) + /// Proof: `Deposit::Deposits` (`max_values`: None, `max_size`: Some(26150), added: 28625, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:3 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`) + /// Storage: `Deposit::DepositContract` (r:1 w:0) + /// Proof: `Deposit::DepositContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + /// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0) + /// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `EVM::AccountCodes` (r:2 w:0) + /// Proof: `EVM::AccountCodes` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Digest` (r:1 w:0) + /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Ethereum::Pending` (r:1 w:1) + /// Proof: `Ethereum::Pending` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn migrate() -> Weight { + // Proof Size summary in bytes: + // Measured: `27516` + // Estimated: `33456` + // Minimum execution time: 4_057_000 nanoseconds. + Weight::from_parts(4_577_000_000, 0) + .saturating_add(Weight::from_parts(33456, 0)) + .saturating_add(RocksDbWeight::get().reads(11_u64)) + .saturating_add(RocksDbWeight::get().writes(4_u64)) + } + /// Storage: `Deposit::DepositContract` (r:0 w:1) + /// Proof: `Deposit::DepositContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + fn set_deposit_contract() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_000 nanoseconds. + Weight::from_parts(3_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } } diff --git a/pallet/ethtx-forwarder/Cargo.toml b/pallet/ethtx-forwarder/Cargo.toml index 24e1a054a..45b7b4b8c 100644 --- a/pallet/ethtx-forwarder/Cargo.toml +++ b/pallet/ethtx-forwarder/Cargo.toml @@ -9,7 +9,9 @@ version.workspace = true [dependencies] # crates.io codec = { workspace = true, package = "parity-scale-codec" } +ethabi = { workspace = true } ethereum = { workspace = true } +log = { workspace = true } scale-info = { workspace = true } # frontier @@ -31,6 +33,7 @@ sp-std = { workspace = true } [dev-dependencies] # crates.io array-bytes = { workspace = true } +ethabi = { workspace = true, features = ["std"] } libsecp256k1 = { workspace = true, features = ["std"] } sha3 = { workspace = true } @@ -49,7 +52,9 @@ default = ["std"] std = [ # crates.io "codec/std", + "ethabi/std", "ethereum/std", + "log/std", "scale-info/std", # frontier @@ -81,16 +86,6 @@ runtime-benchmarks = [ "frame-system/runtime-benchmarks", ] -try-runtime = [ - # frontier - "pallet-evm/try-runtime", - - # polkadot-sdk - "frame-support/try-runtime", - "frame-system/try-runtime", - "sp-runtime/try-runtime", -] - evm-tracing = [ # moonbeam "moonbeam-evm-tracer", diff --git a/pallet/ethtx-forwarder/src/lib.rs b/pallet/ethtx-forwarder/src/lib.rs index 4c4b27980..0f01756f2 100644 --- a/pallet/ethtx-forwarder/src/lib.rs +++ b/pallet/ethtx-forwarder/src/lib.rs @@ -25,22 +25,23 @@ mod test; // crates.io use codec::{Decode, Encode, MaxEncodedLen}; +use ethabi::{Function, Token}; use ethereum::{ EIP1559Transaction, EIP2930Transaction, LegacyTransaction, TransactionAction, TransactionSignature, TransactionV2 as Transaction, }; -use frame_support::sp_runtime::traits::UniqueSaturatedInto; use scale_info::TypeInfo; // frontier use fp_ethereum::{TransactionData, ValidatedTransaction}; use fp_evm::{CheckEvmTransaction, CheckEvmTransactionConfig, TransactionValidationError}; -use pallet_evm::{FeeCalculator, GasWeightMapping}; +use pallet_evm::{FeeCalculator, GasWeightMapping, Runner}; // polkadot-sdk -#[cfg(feature = "evm-tracing")] -use frame_support::dispatch::{DispatchErrorWithPostInfo, PostDispatchInfo}; -use frame_support::{traits::EnsureOrigin, PalletError}; +use frame_support::{dispatch::DispatchResultWithPostInfo, traits::EnsureOrigin, PalletError}; use sp_core::{Get, H160, H256, U256}; -use sp_runtime::{traits::BadOrigin, DispatchError, RuntimeDebug}; +use sp_runtime::{ + traits::{BadOrigin, UniqueSaturatedInto}, + DispatchError, RuntimeDebug, +}; use sp_std::vec::Vec; pub use pallet::*; @@ -85,7 +86,6 @@ impl> + From> EnsureOrigin #[frame_support::pallet] pub mod pallet { use super::*; - use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; #[pallet::origin] @@ -112,7 +112,7 @@ pub mod pallet { where OriginFor: Into>>, { - //This call can only be used at runtime and is not available to EOA users. + // This call can only be used at runtime and is not available to EOA users. #[pallet::call_index(0)] #[pallet::weight({ ::GasWeightMapping::gas_to_weight(request.gas_limit.unique_saturated_into(), true) @@ -121,45 +121,65 @@ pub mod pallet { origin: OriginFor, request: ForwardRequest, ) -> DispatchResultWithPostInfo { - let source = ensure_forward_transact(origin)?; - let transaction = Self::validated_transaction(source, request)?; - - #[cfg(feature = "evm-tracing")] - return Self::trace_tx(source, transaction); - #[cfg(not(feature = "evm-tracing"))] - return T::ValidatedTransaction::apply(source, transaction) - .map(|(post_info, _)| post_info); + Self::forward_transact_inner(ensure_forward_transact(origin)?, request) } } } impl Pallet { - /// Calculates the fee for submitting such an EVM transaction. - /// - /// The gas_price of an EVM transaction is always the min_gas_price(), which is a fixed value. - /// Therefore, only the gas_limit and value of the transaction should be considered in the - /// calculation of the fee, and the gas_price of the transaction itself can be ignored. - pub fn total_payment(request: &ForwardRequest) -> U256 { - let base_fee = ::FeeCalculator::min_gas_price().0; - let fee = base_fee.saturating_mul(request.gas_limit); - - request.value.saturating_add(fee) + pub fn forward_call( + from: H160, + to: H160, + data: Vec, + value: U256, + gas_limit: U256, + ) -> Result { + let (who, _) = pallet_evm::Pallet::::account_basic(&from); + ::Runner::call( + from, + to, + data, + value, + gas_limit.unique_saturated_into(), + None, + None, + Some(who.nonce), + Vec::new(), + false, // non-transactional + true, + None, + None, + ::config(), + ) + .map_err(|err| err.error.into()) + } + + pub fn forward_transact_inner( + source: H160, + request: ForwardRequest, + ) -> DispatchResultWithPostInfo { + let transaction = Self::validated_transaction(source, request)?; + + #[cfg(feature = "evm-tracing")] + return Self::trace_tx(source, transaction); + #[cfg(not(feature = "evm-tracing"))] + return T::ValidatedTransaction::apply(source, transaction).map(|(post_info, _)| post_info); } fn validated_transaction( source: H160, - req: ForwardRequest, + request: ForwardRequest, ) -> Result { let (who, _) = pallet_evm::Pallet::::account_basic(&source); let base_fee = T::FeeCalculator::min_gas_price().0; - let transaction = match req.tx_type { + let transaction = match request.tx_type { TxType::LegacyTransaction => Transaction::Legacy(LegacyTransaction { nonce: who.nonce, gas_price: base_fee, - gas_limit: req.gas_limit, - action: req.action, - value: req.value, - input: req.input, + gas_limit: request.gas_limit, + action: request.action, + value: request.value, + input: request.input, // copied from: // https://github.com/rust-ethereum/ethereum/blob/24739cc8ba6e9d8ee30ada8ec92161e4c48d578e/src/transaction.rs#L798 signature: TransactionSignature::new( @@ -180,10 +200,10 @@ impl Pallet { chain_id: 0, nonce: who.nonce, gas_price: base_fee, - gas_limit: req.gas_limit, - action: req.action, - value: req.value, - input: req.input, + gas_limit: request.gas_limit, + action: request.action, + value: request.value, + input: request.input, access_list: Default::default(), // copied from: // https://github.com/rust-ethereum/ethereum/blob/24739cc8ba6e9d8ee30ada8ec92161e4c48d578e/src/transaction.rs#L873-L875 @@ -206,10 +226,10 @@ impl Pallet { nonce: who.nonce, max_fee_per_gas: base_fee, max_priority_fee_per_gas: U256::zero(), - gas_limit: req.gas_limit, - action: req.action, - value: req.value, - input: req.input, + gas_limit: request.gas_limit, + action: request.action, + value: request.value, + input: request.input, access_list: Default::default(), // copied from: // https://github.com/rust-ethereum/ethereum/blob/24739cc8ba6e9d8ee30ada8ec92161e4c48d578e/src/transaction.rs#L873-L875 @@ -260,14 +280,11 @@ impl Pallet { } #[cfg(feature = "evm-tracing")] - fn trace_tx( - source: H160, - transaction: Transaction, - ) -> Result { + fn trace_tx(source: H160, transaction: Transaction) -> DispatchResultWithPostInfo { // moonbeam use moonbeam_evm_tracer::tracer::EvmTracer; // polkadot-sdk - use frame_support::storage::unhashed; + use frame_support::{dispatch::PostDispatchInfo, storage::unhashed}; use xcm_primitives::{EthereumXcmTracingStatus, ETHEREUM_XCM_TRACING_STORAGE_KEY}; match unhashed::get(ETHEREUM_XCM_TRACING_STORAGE_KEY) { @@ -283,7 +300,7 @@ impl Pallet { res }, - Some(EthereumXcmTracingStatus::Transaction(traced_transaction_hash)) => + Some(EthereumXcmTracingStatus::Transaction(traced_transaction_hash)) => { if transaction.hash() == traced_transaction_hash { let mut res = Ok(PostDispatchInfo::default()); @@ -300,7 +317,8 @@ impl Pallet { } else { T::ValidatedTransaction::apply(source, transaction) .map(|(post_info, _)| post_info) - }, + } + }, Some(EthereumXcmTracingStatus::TransactionExited) => Ok(PostDispatchInfo { actual_weight: None, pays_fee: frame_support::pallet_prelude::Pays::No, @@ -311,6 +329,14 @@ impl Pallet { } } +#[derive(Clone, Debug, PartialEq, Eq, Encode, Decode, TypeInfo, Default)] +pub enum TxType { + #[default] + LegacyTransaction, + EIP2930Transaction, + EIP1559Transaction, +} + // TODO: replace it with upstream error type #[derive(Encode, Decode, TypeInfo, PalletError)] pub enum TxErrorWrapper { @@ -353,10 +379,35 @@ pub struct ForwardRequest { pub input: Vec, } -#[derive(Clone, Debug, PartialEq, Eq, Encode, Decode, TypeInfo, Default)] -pub enum TxType { - #[default] - LegacyTransaction, - EIP2930Transaction, - EIP1559Transaction, +pub fn quick_forward_transact( + source: H160, + function: Function, + input: &[Token], + call: H160, + value: U256, + gas_limit: U256, +) where + T: Config, +{ + log::info!("forwarding {function:?} to {call:?} with {{ input: {input:?}, value: {value:?} }}"); + + let input = match function.encode_input(input) { + Ok(i) => i, + Err(e) => { + log::error!("failed to encode input due to {e:?}"); + + return; + }, + }; + let req = ForwardRequest { + tx_type: TxType::LegacyTransaction, + action: TransactionAction::Call(call), + value, + input, + gas_limit, + }; + + if let Err(e) = >::forward_transact_inner(source, req) { + log::error!("failed to forward ethtx due to {e:?}"); + } } diff --git a/pallet/ethtx-forwarder/src/mock.rs b/pallet/ethtx-forwarder/src/mock.rs index 70d02a037..702f06a6b 100644 --- a/pallet/ethtx-forwarder/src/mock.rs +++ b/pallet/ethtx-forwarder/src/mock.rs @@ -22,6 +22,8 @@ pub use crate as darwinia_ethtx_forwarder; // crates.io use sha3::Digest; +// darwinia +use crate::*; // polkadot-sdk use frame_support::derive_impl; use sp_runtime::BuildStorage; @@ -208,3 +210,15 @@ impl ExtBuilder { ext } } + +// Calculates the fee for submitting such an EVM transaction. +// +// The gas_price of an EVM transaction is always the min_gas_price(), which is a fixed value. +// Therefore, only the gas_limit and value of the transaction should be considered in the +// calculation of the fee, and the gas_price of the transaction itself can be ignored. +pub fn total_payment(request: &ForwardRequest) -> U256 { + let base_fee = ::FeeCalculator::min_gas_price().0; + let fee = base_fee.saturating_mul(request.gas_limit); + + request.value.saturating_add(fee) +} diff --git a/pallet/ethtx-forwarder/src/test.rs b/pallet/ethtx-forwarder/src/test.rs index 6d11c4d8d..9b199d413 100644 --- a/pallet/ethtx-forwarder/src/test.rs +++ b/pallet/ethtx-forwarder/src/test.rs @@ -17,9 +17,13 @@ // along with Darwinia. If not, see . // darwinia -use crate::{mock::*, ForwardEthOrigin, ForwardRequest, TxType}; +use crate::{ + mock::{self, *}, + ForwardEthOrigin, ForwardRequest, TxType, +}; // crates.io use ethereum::TransactionSignature; +use fp_evm::ExecutionInfoV2; // polkadot-sdk use frame_support::{assert_err, assert_ok, traits::Currency}; use sp_core::{H256, U256}; @@ -29,9 +33,9 @@ use sp_runtime::{DispatchError, ModuleError}; // pragma solidity ^0.5.0; // import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.1/contracts/token/ERC20/ERC20.sol"; // contract MyToken is ERC20 { -// constructor() public { _mint(msg.sender, 2**256 - 1); } +// constructor() public { _mint(msg.sender, 1000000); } // } -const ERC20_CONTRACT_BYTECODE: &str = "608060405234801561001057600080fd5b50610041337fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61004660201b60201c565b610291565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156100e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6101028160025461020960201b610c7c1790919060201c565b60028190555061015d816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461020960201b610c7c1790919060201c565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080828401905083811015610287576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b610e3a806102a06000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a08231146101fd578063a457c2d714610255578063a9059cbb146102bb578063dd62ed3e1461032157610088565b8063095ea7b31461008d57806318160ddd146100f357806323b872dd146101115780633950935114610197575b600080fd5b6100d9600480360360408110156100a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610399565b604051808215151515815260200191505060405180910390f35b6100fb6103b7565b6040518082815260200191505060405180910390f35b61017d6004803603606081101561012757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506103c1565b604051808215151515815260200191505060405180910390f35b6101e3600480360360408110156101ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061049a565b604051808215151515815260200191505060405180910390f35b61023f6004803603602081101561021357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061054d565b6040518082815260200191505060405180910390f35b6102a16004803603604081101561026b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610595565b604051808215151515815260200191505060405180910390f35b610307600480360360408110156102d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610662565b604051808215151515815260200191505060405180910390f35b6103836004803603604081101561033757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610680565b6040518082815260200191505060405180910390f35b60006103ad6103a6610707565b848461070f565b6001905092915050565b6000600254905090565b60006103ce848484610906565b61048f846103da610707565b61048a85604051806060016040528060288152602001610d7060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610440610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b600190509392505050565b60006105436104a7610707565b8461053e85600160006104b8610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b61070f565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006106586105a2610707565b8461065385604051806060016040528060258152602001610de160259139600160006105cc610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b6001905092915050565b600061067661066f610707565b8484610906565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610795576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180610dbd6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561081b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610d286022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180610d986025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180610d056023913960400191505060405180910390fd5b610a7d81604051806060016040528060268152602001610d4a602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b10816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610c69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610c2e578082015181840152602081019050610c13565b50505050905090810190601f168015610c5b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015610cfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820c7a5ffabf642bda14700b2de42f8c57b36621af020441df825de45fd2b3e1c5c64736f6c63430005100032"; +const ERC20_CONTRACT_BYTECODE: &str = "608060405234801561001057600080fd5b5061002433620f424061002960201b60201c565b610274565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156100cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6100e5816002546101ec60201b610c7c1790919060201c565b600281905550610140816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546101ec60201b610c7c1790919060201c565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008082840190508381101561026a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b610e3a806102836000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806370a082311161005b57806370a08231146101fd578063a457c2d714610255578063a9059cbb146102bb578063dd62ed3e1461032157610088565b8063095ea7b31461008d57806318160ddd146100f357806323b872dd146101115780633950935114610197575b600080fd5b6100d9600480360360408110156100a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610399565b604051808215151515815260200191505060405180910390f35b6100fb6103b7565b6040518082815260200191505060405180910390f35b61017d6004803603606081101561012757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506103c1565b604051808215151515815260200191505060405180910390f35b6101e3600480360360408110156101ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061049a565b604051808215151515815260200191505060405180910390f35b61023f6004803603602081101561021357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061054d565b6040518082815260200191505060405180910390f35b6102a16004803603604081101561026b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610595565b604051808215151515815260200191505060405180910390f35b610307600480360360408110156102d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610662565b604051808215151515815260200191505060405180910390f35b6103836004803603604081101561033757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610680565b6040518082815260200191505060405180910390f35b60006103ad6103a6610707565b848461070f565b6001905092915050565b6000600254905090565b60006103ce848484610906565b61048f846103da610707565b61048a85604051806060016040528060288152602001610d7060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610440610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b600190509392505050565b60006105436104a7610707565b8461053e85600160006104b8610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b61070f565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006106586105a2610707565b8461065385604051806060016040528060258152602001610de160259139600160006105cc610707565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b61070f565b6001905092915050565b600061067661066f610707565b8484610906565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610795576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180610dbd6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561081b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610d286022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180610d986025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180610d056023913960400191505060405180910390fd5b610a7d81604051806060016040528060268152602001610d4a602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bbc9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b10816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c7c90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610c69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610c2e578082015181840152602081019050610c13565b50505050905090810190601f168015610c5b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015610cfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723158204b72fba02adebd751a8e173005e094f50807c69fde771436ef2cb081650def3c64736f6c63430005110032"; fn mocked_request() -> ForwardRequest { ForwardRequest { @@ -72,7 +76,7 @@ fn forward_request_works() { } #[test] -fn forward_legacy_request_sufficient_balance() { +fn forward_request_sufficient_balance() { let alice = address_build(1); ExtBuilder::default().build().execute_with(|| { macro_rules! test_tx_types { @@ -92,7 +96,7 @@ fn forward_legacy_request_sufficient_balance() { }) ); - let fee = EthTxForwarder::total_payment(&request); + let fee = mock::total_payment(&request); let _ = Balances::deposit_creating(&alice.address, fee.as_u64()); assert_ok!(EthTxForwarder::forward_transact( ForwardEthOrigin::ForwardEth(alice.address).into(), @@ -109,6 +113,53 @@ fn forward_legacy_request_sufficient_balance() { }); } +#[test] +fn foraward_call_works() { + let alice = address_build(1); + ExtBuilder::default() + .with_balances(vec![(alice.address, 1_000_000_000_000)]) + .build() + .execute_with(|| { + let request = mocked_request(); + assert_ok!(EthTxForwarder::forward_transact( + ForwardEthOrigin::ForwardEth(alice.address).into(), + request, + )); + let pallet_ethereum::Event::Executed { to, .. } = + System::read_events_for_pallet().into_iter().nth(0).expect("events expected"); + + use ethabi::{Function, Param, ParamType, Token}; + #[allow(deprecated)] + let function = Function { + name: "balanceOf".to_owned(), + inputs: vec![Param { + name: "account".to_owned(), + kind: ParamType::Address, + internal_type: None, + }], + outputs: vec![Param { + name: "balance".to_owned(), + kind: ParamType::Uint(256), + internal_type: None, + }], + constant: None, + state_mutability: ethabi::StateMutability::View, + }; + let input = function.encode_input(&[Token::Address(alice.address)]).unwrap(); + let result = EthTxForwarder::forward_call( + alice.address, + to, + input, + Default::default(), + U256::from(10_000_000u64), + ) + .ok() + .expect("call should succeed"); + let ExecutionInfoV2 { value, .. } = result; + assert_eq!(U256::from_big_endian(&value), U256::from(1000000)); + }); +} + #[test] fn mock_signature_valid() { assert!( diff --git a/pallet/staking/Cargo.toml b/pallet/staking/Cargo.toml index a8bafb719..4e05913fe 100644 --- a/pallet/staking/Cargo.toml +++ b/pallet/staking/Cargo.toml @@ -9,19 +9,22 @@ version.workspace = true [dependencies] # crates.io codec = { workspace = true, package = "parity-scale-codec" } -ethabi = { version = "18.0", default-features = false } -ethereum = { workspace = true } +ethabi = { workspace = true } log = { workspace = true } scale-info = { workspace = true } # darwinia darwinia-ethtx-forwarder = { workspace = true } darwinia-staking-traits = { workspace = true } -dc-primitives = { workspace = true } +dc-inflation = { workspace = true } +dc-types = { workspace = true } # darwinia optional darwinia-deposit = { workspace = true, optional = true } -# subtrate +# frontier +fp-evm = { workspace = true } + +# polkadot-sdk frame-support = { workspace = true } frame-system = { workspace = true } pallet-authorship = { workspace = true } @@ -35,18 +38,17 @@ frame-benchmarking = { workspace = true, optional = true } [dev-dependencies] # crates.io pretty_env_logger = { version = "0.5" } +serde = { version = "1.0", features = ["derive"] } # darwinia darwinia-deposit = { workspace = true, features = ["std"] } # polkadot-sdk -dc-inflation = { workspace = true, features = ["std"] } -pallet-balances = { workspace = true, features = ["std"] } -pallet-session = { workspace = true, features = ["std"] } -pallet-timestamp = { workspace = true, features = ["std"] } -pallet-treasury = { workspace = true, features = ["std"] } -sp-io = { workspace = true, features = ["std"] } -substrate-test-utils = { workspace = true } +pallet-balances = { workspace = true, features = ["std"] } +pallet-session = { workspace = true, features = ["std"] } +pallet-timestamp = { workspace = true, features = ["std"] } +pallet-treasury = { workspace = true, features = ["std"] } +sp-io = { workspace = true, features = ["std"] } [features] default = ["std"] @@ -54,18 +56,20 @@ std = [ # crates.io "codec/std", "ethabi/std", - "ethereum/std", "log/std", "scale-info/std", # darwinia "darwinia-ethtx-forwarder/std", "darwinia-staking-traits/std", - "dc-primitives/std", + "dc-inflation/std", # darwinia optional "darwinia-deposit?/std", - # subtrate + # frontier + "fp-evm/std", + + # polkadot-sdk "frame-support/std", "frame-system/std", "pallet-authorship/std", @@ -92,8 +96,6 @@ runtime-benchmarks = [ ] try-runtime = [ - # darwinia - "darwinia-ethtx-forwarder/try-runtime", # polkadot-sdk "frame-support/try-runtime", "frame-system/try-runtime", diff --git a/pallet/staking/src/benchmarking.rs b/pallet/staking/src/benchmarking.rs index 973b068aa..5cf257aec 100644 --- a/pallet/staking/src/benchmarking.rs +++ b/pallet/staking/src/benchmarking.rs @@ -19,7 +19,7 @@ // darwinia use crate::*; use darwinia_deposit::SimpleAsset; -use dc_primitives::UNIT; +use dc_types::UNIT; // polkadot-sdk use frame_benchmarking::v2; use frame_system::RawOrigin; @@ -136,7 +136,7 @@ mod benchmarks { #[benchmark] fn payout() { let a = frame_benchmarking::whitelisted_caller::(); - let sender = a.clone(); + let a_cloned = a.clone(); call_on_exposure!(>::insert( &a, @@ -155,7 +155,7 @@ mod benchmarks { >::insert(&a, 500); #[extrinsic_call] - _(RawOrigin::Signed(sender), a); + _(RawOrigin::Signed(a), a_cloned); } #[benchmark] @@ -168,7 +168,7 @@ mod benchmarks { } #[benchmark] - fn set_kton_reward_distribution_contract() { + fn set_kton_staking_contract() { // Worst-case scenario: // // Set successfully. diff --git a/pallet/staking/src/lib.rs b/pallet/staking/src/lib.rs index 324ab364b..99ba28bab 100644 --- a/pallet/staking/src/lib.rs +++ b/pallet/staking/src/lib.rs @@ -27,12 +27,12 @@ //! - RING: Darwinia's native token //! - Deposit: Locking RINGs' ticket +// TODO: check this after the migration is complete. +#![allow(clippy::needless_borrows_for_generic_args)] #![cfg_attr(not(feature = "std"), no_std)] #![deny(missing_docs)] #![allow(clippy::needless_borrows_for_generic_args)] -pub mod migration; - #[cfg(test)] mod mock; #[cfg(test)] @@ -48,16 +48,17 @@ pub use darwinia_staking_traits::*; // crates.io use codec::FullCodec; -use ethabi::{Function, Param, ParamType, StateMutability}; -use ethereum::TransactionAction; +use ethabi::{Function, Param, ParamType, StateMutability, Token}; // darwinia -use darwinia_ethtx_forwarder::{ForwardEthOrigin, ForwardRequest, TxType}; -use dc_primitives::{AccountId, Balance, Moment}; +use dc_types::{Balance, Moment, UNIT}; // polkadot-sdk use frame_support::{ - pallet_prelude::*, traits::Currency, DefaultNoBound, EqNoBound, PalletId, PartialEqNoBound, + pallet_prelude::*, + traits::{Currency, UnixTime}, + DefaultNoBound, EqNoBound, PalletId, PartialEqNoBound, }; use frame_system::{pallet_prelude::*, RawOrigin}; +use pallet_session::ShouldEndSession as _; use sp_core::{H160, U256}; use sp_runtime::{ traits::{AccountIdConversion, Convert, One, Zero}, @@ -70,9 +71,9 @@ use sp_std::{collections::btree_map::BTreeMap, prelude::*}; macro_rules! call_on_exposure { ($s_e:expr, <$s:ident<$t:ident>>$($f:tt)*) => {{ match $s_e { - ($crate::ExposureCacheState::$s, _, _) => Ok(<$crate::ExposureCache0<$t>>$($f)*), - (_, $crate::ExposureCacheState::$s, _) => Ok(<$crate::ExposureCache1<$t>>$($f)*), - (_, _, $crate::ExposureCacheState::$s) => Ok(<$crate::ExposureCache2<$t>>$($f)*), + ($crate::CacheState::$s, _, _) => Ok(<$crate::ExposureCache0<$t>>$($f)*), + (_, $crate::CacheState::$s, _) => Ok(<$crate::ExposureCache1<$t>>$($f)*), + (_, _, $crate::CacheState::$s) => Ok(<$crate::ExposureCache2<$t>>$($f)*), _ => { log::error!("[pallet::staking] exposure cache states must be correct; qed"); @@ -86,15 +87,38 @@ macro_rules! call_on_exposure { $crate::call_on_exposure!(s, <$s<$t>>$($f)*) }}; } +/// Make it easier to call a function on a specific collators storage. +#[macro_export] +macro_rules! call_on_cache { + ($s_e:expr, <$s:ident<$t:ident>>$($f:tt)*) => {{ + match $s_e { + ($crate::CacheState::$s, _, _) => Ok(<$crate::CollatorsCache0<$t>>$($f)*), + (_, $crate::CacheState::$s, _) => Ok(<$crate::CollatorsCache1<$t>>$($f)*), + (_, _, $crate::CacheState::$s) => Ok(<$crate::CollatorsCache2<$t>>$($f)*), + _ => { + log::error!("[pallet::staking] collators cache states must be correct; qed"); + + Err("[pallet::staking] collators cache states must be correct; qed") + }, + } + }}; + (<$s:ident<$t:ident>>$($f:tt)*) => {{ + let s = <$crate::CollatorsCacheState<$t>>::get(); + + $crate::call_on_cache!(s, <$s<$t>>$($f)*) + }}; +} + +type DepositId = <::Deposit as Stake>::Item; + +const PAYOUT_FRAC: Perbill = Perbill::from_percent(40); +const DAY_IN_MILLIS: Moment = 24 * 60 * 60 * 1_000; #[frame_support::pallet] pub mod pallet { // darwinia use crate::*; - // TODO: limit the number of nominators that a collator can have. - // const MAX_NOMINATIONS: u32 = 32; - // Deposit helper for runtime benchmark. #[cfg(feature = "runtime-benchmarks")] use darwinia_deposit::Config as DepositConfig; @@ -106,34 +130,39 @@ pub mod pallet { pub trait DepositConfig {} #[pallet::config] - pub trait Config: frame_system::Config + DepositConfig { + pub trait Config: frame_system::Config + DepositConfig { /// Override the [`frame_system::Config::RuntimeEvent`]. type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// Weight information for extrinsics in this pallet. type WeightInfo: WeightInfo; - /// RING [`Stake`] interface. - type Ring: Stake; - - // TODO: Remove after the migration. - /// KTON [`Stake`] interface. - type Kton: Stake; + /// Unix time interface. + type UnixTime: UnixTime; - /// Deposit [`StakeExt`] interface. - type Deposit: StakeExt; + /// Pass [`pallet_session::Config::ShouldEndSession`]'s result to here. + type ShouldEndSession: Get; /// Currency interface to pay the reward. - type Currency: Currency; + type Currency: Currency; /// Inflation and reward manager. type IssuingManager: IssuingManager; - /// KTON staker notifier. - type KtonStakerNotifier: KtonStakerNotification; + /// RING [`Stake`] interface. + type Ring: Stake; - /// Pass [`pallet_session::Config::ShouldEndSession`]'s result to here. - type ShouldEndSession: Get; + /// Deposit [`StakeExt`] interface. + type Deposit: StakeExt; + + /// RING staking interface. + type RingStaking: Election + Reward; + + /// KTON staking interface. + type KtonStaking: Reward; + + /// Treasury address. + type Treasury: Get; /// Maximum deposit count. #[pallet::constant] @@ -212,15 +241,14 @@ pub mod pallet { #[pallet::getter(fn exposure_cache_states)] pub type ExposureCacheStates = StorageValue< _, - (ExposureCacheState, ExposureCacheState, ExposureCacheState), + (CacheState, CacheState, CacheState), ValueQuery, ExposureCacheStatesDefault, >; /// Default value for [`ExposureCacheStates`]. #[pallet::type_value] - pub fn ExposureCacheStatesDefault( - ) -> (ExposureCacheState, ExposureCacheState, ExposureCacheState) { - (ExposureCacheState::Previous, ExposureCacheState::Current, ExposureCacheState::Next) + pub fn ExposureCacheStatesDefault() -> (CacheState, CacheState, CacheState) { + (CacheState::Previous, CacheState::Current, CacheState::Next) } /// Exposure cache 0. @@ -292,17 +320,75 @@ pub mod pallet { #[pallet::getter(fn rate_limit_state)] pub type RateLimitState = StorageValue<_, RateLimiter, ValueQuery>; - /// KTON reward distribution contract address. + /// RING staking contract address. + #[pallet::storage] + #[pallet::getter(fn ring_staking_contract)] + pub type RingStakingContract = StorageValue<_, T::AccountId>; + /// KTON staking contract address. #[pallet::storage] - #[pallet::getter(fn kton_reward_distribution_contract)] - pub type KtonRewardDistributionContract = - StorageValue<_, T::AccountId, ValueQuery, KtonRewardDistributionContractDefault>; - /// Default value for [`KtonRewardDistributionContract`]. + #[pallet::getter(fn kton_staking_contract)] + pub type KtonStakingContract = StorageValue<_, T::AccountId>; + + /// Migration start point. + #[pallet::storage] + #[pallet::getter(fn migration_start_point)] + pub type MigrationStartPoint = StorageValue<_, Moment, ValueQuery>; + + /// Collator cache state. + /// + /// To avoid extra DB RWs during new session, such as: + /// ```nocompile + /// previous = current; + /// current = next; + /// next = elect(); + /// ``` + /// + /// Now, with data: + /// ```nocompile + /// cache1 == previous; + /// cache2 == current; + /// cache3 == next; + /// ``` + /// Just need to shift the marker and write the storage map once: + /// ```nocompile + /// mark(cache3, current); + /// mark(cache2, previous); + /// mark(cache1, next); + /// cache1 = elect(); + /// ``` + #[pallet::storage] + #[pallet::getter(fn collator_cache_state)] + pub type CollatorsCacheState = StorageValue< + _, + (CacheState, CacheState, CacheState), + ValueQuery, + CollatorCacheStateDefault, + >; + /// Default value for [`CollatorsCacheState`]. #[pallet::type_value] - pub fn KtonRewardDistributionContractDefault() -> T::AccountId { - account_id() + pub fn CollatorCacheStateDefault() -> (CacheState, CacheState, CacheState) { + (CacheState::Previous, CacheState::Current, CacheState::Next) } + // TODO: use `BoundedVec`. + /// Exposure cache 0. + #[pallet::storage] + #[pallet::unbounded] + #[pallet::getter(fn collators_cache_0)] + pub type CollatorsCache0 = StorageValue<_, Vec, ValueQuery>; + + /// Exposure cache 1. + #[pallet::storage] + #[pallet::unbounded] + #[pallet::getter(fn collators_cache_1)] + pub type CollatorsCache1 = StorageValue<_, Vec, ValueQuery>; + + /// Exposure cache 2. + #[pallet::storage] + #[pallet::unbounded] + #[pallet::getter(fn collators_cache_2)] + pub type CollatorsCache2 = StorageValue<_, Vec, ValueQuery>; + #[derive(DefaultNoBound)] #[pallet::genesis_config] pub struct GenesisConfig { @@ -539,6 +625,25 @@ pub mod pallet { Ok(()) } + /// Set the collator count. + /// + /// This will apply to the incoming session. + /// + /// Require root origin. + #[pallet::call_index(7)] + #[pallet::weight(::WeightInfo::set_collator_count())] + pub fn set_collator_count(origin: OriginFor, count: u32) -> DispatchResult { + ensure_root(origin)?; + + if count == 0 { + return Err(>::ZeroCollatorCount)?; + } + + >::put(count); + + Ok(()) + } + /// Set the max unstake RING limit. #[pallet::call_index(9)] #[pallet::weight(::WeightInfo::set_rate_limit())] @@ -550,35 +655,30 @@ pub mod pallet { Ok(()) } - /// Set the KTON reward distribution contract address. - #[pallet::call_index(10)] - #[pallet::weight(::WeightInfo::set_kton_reward_distribution_contract())] - pub fn set_kton_reward_distribution_contract( + /// Set the RING reward distribution contract address. + #[pallet::call_index(11)] + #[pallet::weight(::WeightInfo::set_ring_staking_contract())] + pub fn set_ring_staking_contract( origin: OriginFor, address: T::AccountId, ) -> DispatchResult { ensure_root(origin)?; - >::put(address); + >::put(address); Ok(()) } - /// Set the collator count. - /// - /// This will apply to the incoming session. - /// - /// Require root origin. - #[pallet::call_index(7)] - #[pallet::weight(::WeightInfo::set_collator_count())] - pub fn set_collator_count(origin: OriginFor, count: u32) -> DispatchResult { + /// Set the KTON reward distribution contract address. + #[pallet::call_index(10)] + #[pallet::weight(::WeightInfo::set_kton_staking_contract())] + pub fn set_kton_staking_contract( + origin: OriginFor, + address: T::AccountId, + ) -> DispatchResult { ensure_root(origin)?; - if count == 0 { - return Err(>::ZeroCollatorCount)?; - } - - >::put(count); + >::put(address); Ok(()) } @@ -652,32 +752,30 @@ pub mod pallet { /// Distribute the session reward to staking pot and update the stakers' reward record. pub fn distribute_session_reward(amount: Balance) { - let reward_to_ring = amount.saturating_div(2); - let reward_to_kton = amount.saturating_sub(reward_to_ring); - let (total, map) = >::take(); - let actual_reward_to_ring = map.into_iter().fold(0, |s, (c, b)| { - let r = Perbill::from_rational(b, total) * reward_to_ring; + let who = ::Treasury::get(); + + if T::IssuingManager::reward(&who, amount).is_ok() { + Self::deposit_event(Event::Payout { who, amount }); + } else { + Self::deposit_event(Event::Unpaid { who, amount }); + } - >::mutate(c, |u| *u = u.map(|u| u + r).or(Some(r))); + let reward_r = amount.saturating_div(2); + let reward_k = amount.saturating_sub(reward_r); + let (b_total, map) = >::take(); + let collators_v2 = call_on_cache!(>::get()).unwrap_or_default(); - s + r - }); - let reward = |who, amount| { - if T::IssuingManager::reward(&who, amount).is_ok() { - Self::deposit_event(Event::Payout { who, amount }); + map.into_iter().for_each(|(c, b)| { + let r = Perbill::from_rational(b, b_total).mul_floor(reward_r); + + if collators_v2.contains(&c) { + T::RingStaking::distribute(Some(c), r); } else { - Self::deposit_event(Event::Unpaid { who, amount }); + >::mutate(c, |u| *u = u.map(|u| u + r).or(Some(r))); } - }; - - reward(account_id(), actual_reward_to_ring); - reward( - [109, 111, 100, 108, 100, 97, 47, 116, 114, 115, 114, 121, 0, 0, 0, 0, 0, 0, 0, 0] - .into(), - reward_to_kton, - ); + }); - T::KtonStakerNotifier::notify(reward_to_kton); + T::KtonStaking::distribute(None, reward_k); } /// Pay the reward to the collator and its nominators. @@ -714,12 +812,11 @@ pub mod pallet { /// Prepare the session state. pub fn prepare_new_session(index: u32) -> Option> { >::kill(); - >::shift_exposure_cache_states(); + >::shift_cache_states(); #[allow(deprecated)] - if call_on_exposure!(>::remove_all(None)).is_err() { - return None; - } + call_on_exposure!(>::remove_all(None)).ok()?; + call_on_cache!(>::kill()).ok()?; let bn = >::block_number(); @@ -727,25 +824,28 @@ pub mod pallet { "[pallet::staking] assembling new collators for new session {index} at #{bn:?}", ); - if let Ok(cs) = Self::elect() { - if !cs.is_empty() { - // TODO?: if we really need this event - Self::deposit_event(Event::Elected { collators: cs.clone() }); + let (n1, n2) = Self::elect_ns(); + let cs_from_contract = Self::try_elect(n1, Self::elect_from_contract); + let cs_from_pallet = Self::try_elect(n2, Self::elect); + let cs = [cs_from_contract, cs_from_pallet].concat(); + + if cs.is_empty() { + // This error log is acceptable when testing with `genesis_collator = false`. + log::error!( + "[pallet::staking] fail to elect collators for new session {index} at #{bn:?}" + ); + + // Impossible case. + // + // But if there is an issue, retain the old collators; do not alter the session + // collators if any error occurs to prevent the chain from stalling. + None + } else { + // ? if we really need this event. + Self::deposit_event(Event::Elected { collators: cs.clone() }); - return Some(cs); - } + Some(cs) } - - // This error log is acceptable when testing with `genesis_collator = false`. - log::error!( - "[pallet::staking] fail to elect collators for new session {index} at #{bn:?}" - ); - - // Impossible case. - // - // But if there is an issue, retain the old collators; do not alter the session - // collators if any error occurs to prevent the chain from stalling. - None } /// Shift the exposure cache states. @@ -757,16 +857,20 @@ pub mod pallet { /// ```nocompile /// loop { mutate(2, 0, 1) } /// ``` - pub fn shift_exposure_cache_states() { + pub fn shift_cache_states() { let (s0, s1, s2) = >::get(); >::put((s2, s0, s1)); + + let (s0, s1, s2) = >::get(); + + >::put((s2, s0, s1)); } /// Elect the new collators. /// /// This should only be called by the [`pallet_session::SessionManager::new_session`]. - pub fn elect() -> Result, DispatchError> { + pub fn elect(n: u32) -> Option> { let nominators = >::iter().collect::>(); let mut collators = >::iter() .map(|(c, cm)| { @@ -797,20 +901,82 @@ pub mod pallet { collators .into_iter() - .take(>::get() as _) + .take(n as _) .map(|((c, e), _)| { - call_on_exposure!(cache_states, >::insert(&c, e)) - .map(|_| c) - .map_err(Into::into) + call_on_exposure!(cache_states, >::insert(&c, e)).map(|_| c).ok() }) .collect() } } + // Implementation part.2. + // + // After the migration is completed, + // the following implementation blocks will be merged into one. + impl Pallet + where + T: Config, + { + /// Elect the new collators. + pub fn elect_ns() -> (u32, u32) { + let n = >::get(); + let n1 = Self::migration_progress() * n; + + (n1, n - n1) + } + + fn migration_progress() -> Perbill { + const TOTAL: Moment = 30 * 2 * DAY_IN_MILLIS; + + let start = >::get(); + + Perbill::from_rational(now::() - start, TOTAL) + } + + fn try_elect(n: u32, elect: F) -> R + where + F: FnOnce(u32) -> Option, + R: Default, + { + if n > 0 { + elect(n).unwrap_or_default() + } else { + Default::default() + } + } + + fn elect_from_contract(n: u32) -> Option> { + let winners = T::RingStaking::elect(n)?; + + call_on_cache!(>::put(winners.clone())).ok()?; + + Some(winners) + } + } + impl pallet_authorship::EventHandler> for Pallet + where + T: Config + pallet_authorship::Config + pallet_session::Config, + { + fn note_author(author: T::AccountId) { + Self::note_authors(&[author]) + } + } + impl pallet_session::SessionManager for Pallet + where + T: Config, + { + fn end_session(_: u32) { + T::IssuingManager::on_session_end(); + } + + fn start_session(_: u32) {} + + fn new_session(index: u32) -> Option> { + Self::prepare_new_session(index) + } + } } pub use pallet::*; -type DepositId = <::Deposit as Stake>::Item; - /// Issuing and reward manager. pub trait IssuingManager where @@ -830,23 +996,32 @@ where } /// Calculate the reward. - fn calculate_reward(issued: Balance) -> Balance; - - /// The reward function. - fn reward(who: &T::AccountId, amount: Balance) -> DispatchResult; -} -impl IssuingManager for () -where - T: Config, -{ - fn calculate_reward(_inflation: Balance) -> Balance { + fn calculate_reward(_: Balance) -> Balance { 0 } - fn reward(_who: &T::AccountId, _amount: Balance) -> DispatchResult { + /// The reward function. + fn reward(_: &T::AccountId, _: Balance) -> DispatchResult { Ok(()) } } +impl IssuingManager for () where T: Config {} + +/// Election interface. +pub trait Election { + /// Elect the new collators. + fn elect(_: u32) -> Option> { + None + } +} +impl Election for () {} + +/// Distribute the reward to a contract. +pub trait Reward { + /// Distribute the reward. + fn distribute(_: Option, _: Balance) {} +} +impl Reward for () {} /// Staking rate limiter. #[derive(Clone, Debug, PartialEq, Encode, Decode, MaxEncodedLen, TypeInfo)] @@ -899,16 +1074,86 @@ impl Default for RateLimiter { } } -/// Exposure cache's state. +/// Cache state. #[allow(missing_docs)] #[cfg_attr(any(test, feature = "runtime-benchmarks", feature = "try-runtime"), derive(PartialEq))] #[derive(Encode, Decode, MaxEncodedLen, TypeInfo, RuntimeDebug)] -pub enum ExposureCacheState { +pub enum CacheState { Previous, Current, Next, } +/// Session ending checker. +pub struct ShouldEndSession(PhantomData); +impl Get for ShouldEndSession +where + T: frame_system::Config + pallet_session::Config, +{ + fn get() -> bool { + ::ShouldEndSession::should_end_session( + >::block_number(), + ) + } +} + +/// Issue new token from pallet-balances. +pub struct BalanceIssuing(PhantomData); +impl IssuingManager for BalanceIssuing +where + T: Config, +{ + fn inflate() -> Balance { + let now = now::() as Moment; + let session_duration = now - >::get(); + let elapsed_time = >::mutate(|t| { + *t = t.saturating_add(session_duration); + + *t + }); + + >::put(now); + + dc_inflation::issuing_in_period(session_duration, elapsed_time).unwrap_or_default() + } + + fn calculate_reward(issued: Balance) -> Balance { + PAYOUT_FRAC * issued + } + + fn reward(who: &T::AccountId, amount: Balance) -> DispatchResult { + let _ = T::Currency::deposit_creating(who, amount); + + Ok(()) + } +} + +/// Transfer issued token from pallet-treasury. +pub struct TreasuryIssuing(PhantomData); +impl IssuingManager for TreasuryIssuing +where + T: Config, +{ + fn calculate_reward(_: Balance) -> Balance { + 20_000 * UNIT + } + + fn reward(who: &T::AccountId, amount: Balance) -> DispatchResult { + let treasury = ::Treasury::get(); + + if who == &treasury { + Ok(()) + } else { + T::Currency::transfer( + &treasury, + who, + amount, + frame_support::traits::ExistenceRequirement::KeepAlive, + ) + } + } +} + /// A convertor from collators id. Since this pallet does not have stash/controller, this is /// just identity. pub struct IdentityCollator; @@ -960,32 +1205,150 @@ pub struct IndividualExposure { pub vote: Balance, } -// Add reward points to block authors: -// - 20 points to the block producer for producing a (non-uncle) block in the parachain chain, -// - 2 points to the block producer for each reference to a previously unreferenced uncle, and -// - 1 point to the producer of each referenced uncle block. -impl pallet_authorship::EventHandler> for Pallet +/// RING staking interface. +pub struct RingStaking(PhantomData); +impl Election for RingStaking where - T: Config + pallet_authorship::Config + pallet_session::Config, + T: Config + darwinia_ethtx_forwarder::Config, + T::AccountId: From + Into, { - fn note_author(author: T::AccountId) { - Self::note_authors(&[author]) + fn elect(n: u32) -> Option> { + const ZERO: [u8; 20] = [0; 20]; + + let Some(rsc) = >::get() else { + log::error!("RING staking contract must be some; qed"); + + return None; + }; + let rsc = rsc.into(); + #[allow(deprecated)] + let function = Function { + name: "getTopCollators".to_owned(), + inputs: vec![Param { + name: "k".to_owned(), + kind: ParamType::Uint(256), + internal_type: None, + }], + outputs: vec![Param { + name: "collators".to_owned(), + kind: ParamType::Array(Box::new(ParamType::Address)), + internal_type: None, + }], + constant: None, + state_mutability: StateMutability::View, + }; + let input = function + .encode_input(&[Token::Int(n.into())]) + .map_err(|e| log::error!("failed to encode input due to {e:?}")) + .ok()?; + + >::forward_call( + ::Treasury::get().into(), + rsc, + input, + Default::default(), + U256::from(10_000_000_u64), + ) + .map_err(|e| log::error!("failed to forward call due to {e:?}")) + .ok() + .and_then(|i| { + function + .decode_output(&i.value) + .map_err(|e| log::error!("failed to decode output due to {e:?}")) + .ok() + .map(|tokens| { + tokens + .into_iter() + .filter_map(|token| match token { + Token::Address(addr) if addr.0 != ZERO => + Some(T::AccountId::from(addr)), + _ => None, + }) + .collect() + }) + }) } } - -// Play the role of the session manager. -impl pallet_session::SessionManager for Pallet +// Distribute the reward to RING staking contract. +// +// https://github.com/darwinia-network/DIP-7/blob/7fa307136586f06c6911ce98d16c88689d91ba8c/src/collator/CollatorStakingHub.sol#L142. +impl Reward for RingStaking where - T: Config, + T: Config + darwinia_ethtx_forwarder::Config, + T::AccountId: Into, { - fn end_session(_: u32) { - T::IssuingManager::on_session_end(); + fn distribute(who: Option, amount: Balance) { + let Some(who) = who else { + log::error!("who must be some; qed"); + + return; + }; + let Some(rsc) = >::get() else { + log::error!("RING staking contract must be some; qed"); + + return; + }; + let rsc = rsc.into(); + + #[allow(deprecated)] + darwinia_ethtx_forwarder::quick_forward_transact::( + ::Treasury::get().into(), + Function { + name: "distributeReward".into(), + inputs: vec![Param { + name: "address".to_owned(), + kind: ParamType::Address, + internal_type: None, + }], + outputs: Vec::new(), + constant: None, + state_mutability: StateMutability::Payable, + }, + &[Token::Address(who.into())], + rsc, + amount.into(), + 1_000_000.into(), + ); } +} + +/// KTON staking interface. +pub struct KtonStaking(PhantomData); +// Distribute the reward to KTON staking contract. +// +// https://github.com/darwinia-network/KtonDAO/blob/2de20674f2ef90b749ade746d0768c7bda356402/src/staking/KtonDAOVault.sol#L40. +impl Reward for KtonStaking +where + T: Config + darwinia_ethtx_forwarder::Config, + T::AccountId: Into, +{ + fn distribute(_: Option, amount: Balance) { + let Some(ksc) = >::get() else { + log::error!("KTON staking contract must be some; qed"); - fn start_session(_: u32) {} + return; + }; + let ksc = ksc.into(); - fn new_session(index: u32) -> Option> { - Self::prepare_new_session(index) + #[allow(deprecated)] + darwinia_ethtx_forwarder::quick_forward_transact::( + ::Treasury::get().into(), + Function { + name: "distributeRewards".into(), + inputs: Vec::new(), + outputs: vec![Param { + name: "success or not".into(), + kind: ParamType::Bool, + internal_type: None, + }], + constant: None, + state_mutability: StateMutability::Payable, + }, + &[], + ksc, + amount.into(), + 1_000_000.into(), + ); } } @@ -997,60 +1360,9 @@ where PalletId(*b"da/staki").into_account_truncating() } -/// `StakingRewardDistribution` contact notification interface. -pub trait KtonStakerNotification { - /// Notify the KTON staker contract. - fn notify(_: Balance) {} -} -impl KtonStakerNotification for () {} -/// `StakingRewardDistribution` contact notifier. -/// -/// https://github.com/darwinia-network/KtonDAO/blob/2de20674f2ef90b749ade746d0768c7bda356402/src/staking/KtonDAOVault.sol#L40. -pub struct KtonStakerNotifier(PhantomData); -impl KtonStakerNotification for KtonStakerNotifier +fn now() -> Moment where - T: Config + darwinia_ethtx_forwarder::Config, - T::RuntimeOrigin: Into> + From, + T: Config, { - fn notify(amount: Balance) { - let krd_contract = >::get().into(); - #[allow(deprecated)] - let function = Function { - name: "distributeRewards".into(), - inputs: Vec::new(), - outputs: vec![Param { - name: "success or not".into(), - kind: ParamType::Bool, - internal_type: None, - }], - constant: None, - state_mutability: StateMutability::Payable, - }; - let input = match function.encode_input(&[]) { - Ok(i) => i, - Err(e) => { - log::error!("failed to encode input due to {e:?}"); - - return; - }, - }; - let req = ForwardRequest { - tx_type: TxType::LegacyTransaction, - action: TransactionAction::Call(krd_contract), - value: U256::from(amount), - input, - gas_limit: U256::from(1_000_000), - }; - // Treasury pallet account. - let sender = H160([ - 109, 111, 100, 108, 100, 97, 47, 116, 114, 115, 114, 121, 0, 0, 0, 0, 0, 0, 0, 0, - ]); - - if let Err(e) = >::forward_transact( - ForwardEthOrigin::ForwardEth(sender).into(), - req, - ) { - log::error!("failed to call `distributeRewards` on `KtonRewardDistributionContract` contract due to {e:?}"); - } - } + T::UnixTime::now().as_millis() } diff --git a/pallet/staking/src/migration.rs b/pallet/staking/src/migration.rs deleted file mode 100644 index 50ec8f5ee..000000000 --- a/pallet/staking/src/migration.rs +++ /dev/null @@ -1,100 +0,0 @@ -//! Pallet migrations. - -/// Migration version 1. -pub mod v1; -/// Migration version 2. -pub mod v2; - -// crates.io -use ethabi::Token; -// self -use crate::*; - -/// Migrate `StakingRewardDistribution` contract. -/// -/// https://github.com/darwinia-network/KtonDAO/blob/722bdf62942868de2eeaf19bc70d7a165fc031af/src/Owned.sol#L5. -/// https://github.com/darwinia-network/KtonDAO/blob/045b5b59d56b426cb8b06b9da912d0a3ad0a636d/src/staking/KtonDAOVault.sol#L36. -pub fn migrate_staking_reward_distribution_contract( - kton_reward_distribution_contract: T::AccountId, -) where - T: Config + darwinia_ethtx_forwarder::Config, - T::RuntimeOrigin: Into> + From, -{ - // Treasury pallet account. - let sender = - H160([109, 111, 100, 108, 100, 97, 47, 116, 114, 115, 114, 121, 0, 0, 0, 0, 0, 0, 0, 0]); - let krd_contract = kton_reward_distribution_contract.into(); - // 0x000000000Ae5DB7BDAf8D071e680452e33d91Dd5. - let krd_contract_old = H160([ - 0, 0, 0, 0, 10, 229, 219, 123, 218, 248, 208, 113, 230, 128, 69, 46, 51, 217, 29, 213, - ]); - - { - #[allow(deprecated)] - let func = Function { - name: "nominateNewOwner".into(), - inputs: vec![Param { - name: "_owner".into(), - kind: ParamType::Address, - internal_type: None, - }], - outputs: Vec::new(), - constant: None, - state_mutability: StateMutability::Payable, - }; - let input = match func.encode_input(&[Token::Address(krd_contract)]) { - Ok(i) => i, - Err(e) => { - log::error!("failed to encode input due to {e:?}"); - - return; - }, - }; - let req = ForwardRequest { - tx_type: TxType::LegacyTransaction, - action: TransactionAction::Call(krd_contract_old), - value: U256::zero(), - input, - gas_limit: U256::from(1_000_000), - }; - - if let Err(e) = >::forward_transact( - ForwardEthOrigin::ForwardEth(sender).into(), - req, - ) { - log::error!("failed to call `nominateNewOwner` due to {e:?}"); - } - } - { - #[allow(deprecated)] - let func = Function { - name: "acceptOwnershipFromOldDistribution".into(), - inputs: Vec::new(), - outputs: Vec::new(), - constant: None, - state_mutability: StateMutability::Payable, - }; - let input = match func.encode_input(&[]) { - Ok(i) => i, - Err(e) => { - log::error!("failed to encode input due to {e:?}"); - - return; - }, - }; - let req = ForwardRequest { - tx_type: TxType::LegacyTransaction, - action: TransactionAction::Call(krd_contract), - value: U256::zero(), - input, - gas_limit: U256::from(1_000_000), - }; - - if let Err(e) = >::forward_transact( - ForwardEthOrigin::ForwardEth(sender).into(), - req, - ) { - log::error!("failed to call `acceptOwnershipFromOldDistribution` due to {e:?}"); - } - } -} diff --git a/pallet/staking/src/migration/v1.rs b/pallet/staking/src/migration/v1.rs deleted file mode 100644 index 08961d5b7..000000000 --- a/pallet/staking/src/migration/v1.rs +++ /dev/null @@ -1,123 +0,0 @@ -// core -use core::marker::PhantomData; -// darwinia -use crate::*; -// polkadot-sdk -use frame_support::traits::OnRuntimeUpgrade; -#[cfg(feature = "try-runtime")] -use sp_runtime::TryRuntimeError; - -type AccountId = ::AccountId; - -#[frame_support::storage_alias] -type NextExposures = - StorageMap, Twox64Concat, AccountId, ExposureV0>>; - -#[frame_support::storage_alias] -type Exposures = - StorageMap, Twox64Concat, AccountId, ExposureV0>>; - -#[frame_support::storage_alias] -type RewardPoints = - StorageValue, (u32, BTreeMap, u32>), ValueQuery>; - -#[derive(Encode, Decode, MaxEncodedLen, TypeInfo, RuntimeDebug)] -struct ExposureV0 { - vote: Balance, - nominators: Vec>, -} - -/// Migrate darwinia-staking from v0 to v1. -pub struct MigrateToV1(PhantomData); -impl OnRuntimeUpgrade for MigrateToV1 -where - T: Config, -{ - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, TryRuntimeError> { - Ok(Vec::new()) - } - - fn on_runtime_upgrade() -> Weight { - let version = StorageVersion::get::>(); - - if version != 0 { - log::warn!( - "[pallet::staking] skipping v0 to v1 migration: executed on wrong storage version. Expected version 0, found {version:?}", - ); - - return T::DbWeight::get().reads(1); - } - - let mut count = 4; - - let (sum, map) = >::take(); - >::put(( - >::from(sum / 20), - map.into_iter() - .map(|(k, v)| (k, >::from(v / 20))) - .collect::>(), - )); - - >::iter().drain().for_each(|(k, v)| { - count += 1; - - >::insert( - &k, - Exposure { - commission: >::get(&k).unwrap_or_default(), - vote: v.vote, - nominators: v.nominators, - }, - ); - }); - >::iter().drain().for_each(|(k, v)| { - count += 1; - - >::insert( - &k, - Exposure { - commission: >::get(&k).unwrap_or_default(), - vote: v.vote, - nominators: v.nominators, - }, - ); - }); - - StorageVersion::new(1).put::>(); - - T::DbWeight::get().reads_writes(count, count) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade(_: Vec) -> Result<(), TryRuntimeError> { - assert_eq!(StorageVersion::get::>(), 1, "Version must be upgraded."); - - // Old storages should be killed. - assert_eq!(>::iter_keys().count(), 0); - assert_eq!(>::iter_keys().count(), 0); - assert!(!>::exists()); - - // Check the starting state is correct. - assert_eq!( - >::get(), - (ExposureCacheState::Previous, ExposureCacheState::Current, ExposureCacheState::Next) - ); - - assert_eq!( - >::iter_keys().count(), - 0, - "Previous exposure should be empty at start." - ); - - // Check that everything decoded fine. - >::iter_keys().for_each(|k| { - assert!(>::try_get(k).is_ok(), "Can not decode V1 `Exposure`."); - }); - >::iter_keys().for_each(|k| { - assert!(>::try_get(k).is_ok(), "Can not decode V1 `Exposure`."); - }); - - Ok(()) - } -} diff --git a/pallet/staking/src/migration/v2.rs b/pallet/staking/src/migration/v2.rs deleted file mode 100644 index bb52d803d..000000000 --- a/pallet/staking/src/migration/v2.rs +++ /dev/null @@ -1,161 +0,0 @@ -// core -use core::marker::PhantomData; -// darwinia -use crate::*; -use dc_primitives::UNIT; -// polkadot-sdk -use frame_support::traits::OnRuntimeUpgrade; -#[cfg(feature = "try-runtime")] -use sp_runtime::TryRuntimeError; - -#[frame_support::storage_alias] -type RingPool = StorageValue, ()>; -#[frame_support::storage_alias] -type KtonPool = StorageValue, ()>; -#[frame_support::storage_alias] -type MigrationStartBlock = StorageValue, ()>; - -#[allow(missing_docs)] -#[derive( - DebugNoBound, - DefaultNoBound, - PartialEqNoBound, - EqNoBound, - Encode, - Decode, - MaxEncodedLen, - TypeInfo, -)] -#[scale_info(skip_type_params(T))] -pub struct OldLedger -where - T: Config, -{ - pub staked_ring: Balance, - pub staked_kton: Balance, - pub staked_deposits: BoundedVec, ::MaxDeposits>, - pub unstaking_ring: BoundedVec<(Balance, BlockNumberFor), ConstU32<16>>, - pub unstaking_kton: BoundedVec<(Balance, BlockNumberFor), ConstU32<16>>, - pub unstaking_deposits: BoundedVec<(DepositId, BlockNumberFor), ConstU32<16>>, -} - -#[derive(Encode, Decode, MaxEncodedLen, TypeInfo, RuntimeDebug)] -struct OldExposure { - commission: Perbill, - vote: u32, - nominators: Vec>, -} -#[cfg_attr(test, derive(Clone))] -#[derive(Encode, Decode, MaxEncodedLen, TypeInfo, RuntimeDebug)] -struct OldIndividualExposure { - who: AccountId, - vote: u32, -} - -/// Migrate darwinia-staking from v1 to v2. -pub struct MigrateToV2(PhantomData); -impl OnRuntimeUpgrade for MigrateToV2 -where - T: Config, -{ - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, TryRuntimeError> { - Ok(Vec::new()) - } - - fn on_runtime_upgrade() -> Weight { - let version = StorageVersion::get::>(); - let r = 1; - - if version != 1 { - log::warn!( - "\ - [pallet::staking] skipping v1 to v2 migration: executed on wrong storage version.\ - Expected version 1, found {version:?}\ - ", - ); - - return T::DbWeight::get().reads(r); - } - - let mut w = 5; - - >::kill(); - >::kill(); - >::kill(); - >::put(20_000_000 * UNIT); - >::translate::, _>(|a, o| { - w += 6; - - let unstaking_ring = o.unstaking_ring.into_iter().fold(0, |s, (v, _)| s + v); - - // Release the unstaking RING immediately. - if unstaking_ring != 0 { - let _ = ::Ring::unstake(&a, unstaking_ring); - } - - // Release all KTON immediately. - let _ = ::Kton::unstake( - &a, - o.staked_kton + o.unstaking_kton.into_iter().fold(0, |s, (v, _)| s + v), - ); - - // Release the unstaking deposits immediately. - for (d, _) in o.unstaking_deposits { - let _ = T::Deposit::unstake(&a, d); - } - - Some(Ledger { ring: o.staked_ring, deposits: o.staked_deposits }) - }); - >::translate_values::, _>(|o| { - w += 1; - - Some(Exposure { - commission: o.commission, - vote: o.vote as _, - nominators: o - .nominators - .into_iter() - .map(|o| IndividualExposure { who: o.who, vote: o.vote as _ }) - .collect(), - }) - }); - >::translate_values::, _>(|o| { - w += 1; - - Some(Exposure { - commission: o.commission, - vote: o.vote as _, - nominators: o - .nominators - .into_iter() - .map(|o| IndividualExposure { who: o.who, vote: o.vote as _ }) - .collect(), - }) - }); - >::translate_values::, _>(|o| { - w += 1; - - Some(Exposure { - commission: o.commission, - vote: o.vote as _, - nominators: o - .nominators - .into_iter() - .map(|o| IndividualExposure { who: o.who, vote: o.vote as _ }) - .collect(), - }) - }); - - StorageVersion::new(2).put::>(); - - T::DbWeight::get().reads_writes(r, w) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade(_: Vec) -> Result<(), TryRuntimeError> { - assert_eq!(StorageVersion::get::>(), 2, "Version must be upgraded."); - - Ok(()) - } -} diff --git a/pallet/staking/src/mock.rs b/pallet/staking/src/mock.rs index f98b0ba83..7e767a55c 100644 --- a/pallet/staking/src/mock.rs +++ b/pallet/staking/src/mock.rs @@ -16,21 +16,53 @@ // You should have received a copy of the GNU General Public License // along with Darwinia. If not, see . -pub use crate as darwinia_staking; - +// core +use core::fmt::{Display, Formatter, Result as FmtResult}; +// crates.io +use codec::MaxEncodedLen; +use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; // darwinia -use dc_primitives::{AccountId, Balance, Moment, UNIT}; +use crate::*; // polkadot-sdk -use frame_support::{ - derive_impl, - traits::{Currency, OnInitialize}, -}; +use frame_support::{assert_ok, derive_impl, traits::OnInitialize}; use sp_core::H160; use sp_io::TestExternalities; use sp_runtime::{BuildStorage, RuntimeAppPublic}; pub type BlockNumber = frame_system::pallet_prelude::BlockNumberFor; +#[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + PartialOrd, + Ord, + Serialize, + Deserialize, + Encode, + Decode, + MaxEncodedLen, + TypeInfo, +)] +pub struct AccountId(pub u64); +impl From for AccountId { + fn from(value: H160) -> Self { + Self(H160::to_low_u64_le(&value)) + } +} +impl Into for AccountId { + fn into(self) -> H160 { + H160::from_low_u64_le(self.0) + } +} +impl Display for AccountId { + fn fmt(&self, f: &mut Formatter) -> FmtResult { + write!(f, "{}", self.0) + } +} #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; @@ -65,11 +97,13 @@ impl darwinia_deposit::SimpleAsset for KtonMinting { } } impl darwinia_deposit::Config for Runtime { + type DepositMigrator = (); type Kton = KtonMinting; type MaxDeposits = frame_support::traits::ConstU32<16>; type MinLockingAmount = frame_support::traits::ConstU128; type Ring = Balances; type RuntimeEvent = RuntimeEvent; + type Treasury = TreasuryAcct; type WeightInfo = (); } @@ -118,13 +152,13 @@ impl pallet_session::Config for Runtime { type SessionManager = Staking; type ShouldEndSession = pallet_session::PeriodicSessions; type ValidatorId = Self::AccountId; - type ValidatorIdOf = darwinia_staking::IdentityCollator; + type ValidatorIdOf = crate::IdentityCollator; type WeightInfo = (); } frame_support::parameter_types! { pub const TreasuryPalletId: frame_support::PalletId = frame_support::PalletId(*b"da/trsry"); - pub TreasuryAccount: AccountId = Treasury::account_id(); + pub TreasuryAcct: AccountId = Treasury::account_id(); } #[cfg(feature = "runtime-benchmarks")] pub struct DummyBenchmarkHelper; @@ -138,7 +172,7 @@ where } fn create_beneficiary(_: [u8; 32]) -> AccountId { - Default::default() + AccountId(0) } } impl pallet_treasury::Config for Runtime { @@ -155,7 +189,7 @@ impl pallet_treasury::Config for Runtime { type MaxApprovals = (); type OnSlash = (); type PalletId = TreasuryPalletId; - type Paymaster = frame_support::traits::tokens::PayFromAccount; + type Paymaster = frame_support::traits::tokens::PayFromAccount; type PayoutPeriod = (); type ProposalBond = (); type ProposalBondMaximum = (); @@ -169,96 +203,43 @@ impl pallet_treasury::Config for Runtime { } frame_support::parameter_types! { - pub PayoutFraction: sp_runtime::Perbill = sp_runtime::Perbill::from_percent(40); pub static InflationType: u8 = 0; } pub enum StatedOnSessionEnd {} -impl darwinia_staking::IssuingManager for StatedOnSessionEnd { +impl crate::IssuingManager for StatedOnSessionEnd { fn inflate() -> Balance { if INFLATION_TYPE.with(|v| *v.borrow()) == 0 { - OnDarwiniaSessionEnd::inflate() + >::inflate() } else { - OnCrabSessionEnd::inflate() + >::inflate() } } fn calculate_reward(issued: Balance) -> Balance { if INFLATION_TYPE.with(|v| *v.borrow()) == 0 { - OnDarwiniaSessionEnd::calculate_reward(issued) + >::calculate_reward(issued) } else { - OnCrabSessionEnd::calculate_reward(issued) + >::calculate_reward(issued) } } fn reward(who: &AccountId, amount: Balance) -> sp_runtime::DispatchResult { if INFLATION_TYPE.with(|v| *v.borrow()) == 0 { - OnDarwiniaSessionEnd::reward(who, amount) + >::reward(who, amount) } else { - OnCrabSessionEnd::reward(who, amount) + >::reward(who, amount) } } } -pub enum OnDarwiniaSessionEnd {} -impl darwinia_staking::IssuingManager for OnDarwiniaSessionEnd { - fn inflate() -> Balance { - let now = Timestamp::now(); - let session_duration = now - >::get(); - let elapsed_time = >::mutate(|t| { - *t = t.saturating_add(session_duration); - - *t - }); - - >::put(now); - - dc_inflation::issuing_in_period(session_duration, elapsed_time).unwrap_or_default() - } - - fn calculate_reward(issued: Balance) -> Balance { - PayoutFraction::get() * issued - } - - fn reward(who: &AccountId, amount: Balance) -> sp_runtime::DispatchResult { - let _ = Balances::deposit_creating(who, amount); - - Ok(()) - } -} -pub enum OnCrabSessionEnd {} -impl darwinia_staking::IssuingManager for OnCrabSessionEnd { - fn calculate_reward(_inflation: Balance) -> Balance { - 10_000 * UNIT - } - - fn reward(who: &AccountId, amount: Balance) -> sp_runtime::DispatchResult { - >::transfer( - &Treasury::account_id(), - who, - amount, - frame_support::traits::ExistenceRequirement::KeepAlive, - ) - } -} -pub enum ShouldEndSession {} -impl frame_support::traits::Get for ShouldEndSession { - fn get() -> bool { - // polkadot-sdk - use pallet_session::ShouldEndSession; - - ::ShouldEndSession::should_end_session( - System::block_number(), - ) - } -} pub enum RingStaking {} -impl darwinia_staking::Stake for RingStaking { +impl crate::Stake for RingStaking { type AccountId = AccountId; type Item = Balance; fn stake(who: &Self::AccountId, item: Self::Item) -> sp_runtime::DispatchResult { >::transfer( who, - &darwinia_staking::account_id(), + &crate::account_id(), item, frame_support::traits::ExistenceRequirement::AllowDeath, ) @@ -266,40 +247,66 @@ impl darwinia_staking::Stake for RingStaking { fn unstake(who: &Self::AccountId, item: Self::Item) -> sp_runtime::DispatchResult { >::transfer( - &darwinia_staking::account_id(), + &crate::account_id(), who, item, frame_support::traits::ExistenceRequirement::AllowDeath, ) } } -pub enum KtonStaking {} -impl darwinia_staking::Stake for KtonStaking { - type AccountId = AccountId; - type Item = Balance; - - fn stake(_: &Self::AccountId, _: Self::Item) -> sp_runtime::DispatchResult { - Ok(()) +impl crate::Election for RingStaking { + fn elect(n: u32) -> Option> { + Some( + (100..=(100 + n) as u64) + .map(|i| { + let who = AccountId(i); + let _ = >::deposit_creating(&who, i as _); + + assert_ok!(Session::set_keys( + RuntimeOrigin::signed(who), + SessionKeys { uint: i.into() }, + Vec::new() + )); + + who + }) + .collect(), + ) } - - fn unstake(_: &Self::AccountId, _: Self::Item) -> sp_runtime::DispatchResult { - Ok(()) +} +impl crate::Reward for RingStaking { + fn distribute(who: Option, amount: Balance) { + let Some(who) = who else { return }; + let _ = + Balances::transfer_keep_alive(RuntimeOrigin::signed(TreasuryAcct::get()), who, amount); } } -impl darwinia_staking::Config for Runtime { +pub enum KtonStaking {} +impl crate::Reward for KtonStaking { + fn distribute(_: Option, amount: Balance) { + let _ = Balances::transfer_keep_alive( + RuntimeOrigin::signed(TreasuryAcct::get()), + >::get().unwrap(), + amount, + ); + } +} +impl crate::Config for Runtime { type Currency = Balances; type Deposit = Deposit; type IssuingManager = StatedOnSessionEnd; - type Kton = KtonStaking; - type KtonStakerNotifier = (); + type KtonStaking = KtonStaking; type MaxDeposits = ::MaxDeposits; type Ring = RingStaking; + type RingStaking = RingStaking; type RuntimeEvent = RuntimeEvent; - type ShouldEndSession = ShouldEndSession; + type ShouldEndSession = crate::ShouldEndSession; + type Treasury = TreasuryAcct; + type UnixTime = Timestamp; type WeightInfo = (); } #[cfg(not(feature = "runtime-benchmarks"))] -impl darwinia_staking::DepositConfig for Runtime {} +impl crate::DepositConfig for Runtime {} frame_support::construct_runtime! { pub enum Runtime { @@ -309,14 +316,14 @@ frame_support::construct_runtime! { Deposit: darwinia_deposit, Session: pallet_session, Treasury: pallet_treasury, - Staking: darwinia_staking, + Staking: crate, } } pub enum Efflux {} impl Efflux { - pub fn time(milli_secs: Moment) { - Timestamp::set_timestamp(Timestamp::now() + milli_secs); + pub fn time(millis: Moment) { + Timestamp::set_timestamp(Timestamp::now() + millis); } pub fn block(number: BlockNumber) { @@ -353,23 +360,23 @@ impl ExtBuilder { } pub fn build(self) -> TestExternalities { - let _ = pretty_env_logger::try_init(); + // let _ = pretty_env_logger::try_init(); let mut storage = >::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: (1..=10) - .map(|i| (account_id_of(i), 1_000 * UNIT)) - .chain([(Treasury::account_id(), 1_000_000 * UNIT)]) + .map(|i| (AccountId(i), 1_000 * UNIT)) + .chain([(TreasuryAcct::get(), 1_000_000 * UNIT)]) .collect(), } .assimilate_storage(&mut storage) .unwrap(); - darwinia_staking::GenesisConfig:: { + crate::GenesisConfig:: { rate_limit: 100 * UNIT, collator_count: self.collator_count, collators: if self.genesis_collator { - (1..=self.collator_count as u64).map(|i| (account_id_of(i), UNIT)).collect() + (1..=self.collator_count as u64).map(|i| (AccountId(i), i as _)).collect() } else { Default::default() }, @@ -380,7 +387,7 @@ impl ExtBuilder { if self.genesis_collator { pallet_session::GenesisConfig:: { keys: (1..=self.collator_count as u64) - .map(|i| (account_id_of(i), account_id_of(i), SessionKeys { uint: i.into() })) + .map(|i| (AccountId(i), AccountId(i), SessionKeys { uint: i.into() })) .collect(), } .assimilate_storage(&mut storage) @@ -389,7 +396,12 @@ impl ExtBuilder { let mut ext = TestExternalities::from(storage); - ext.execute_with(|| new_session()); + ext.execute_with(|| { + >::put(AccountId(718)); + >::put(AccountId(719)); + + new_session(); + }); ext } @@ -400,8 +412,20 @@ impl Default for ExtBuilder { } } -pub fn account_id_of(i: u64) -> AccountId { - H160::from_low_u64_le(i).into() +pub fn preset_collators(n: u64) { + (10..(10 + n)).for_each(|i| { + let who = AccountId(i); + let _ = >::deposit_creating(&who, i as _); + + assert_ok!(Session::set_keys( + RuntimeOrigin::signed(who), + SessionKeys { uint: i.into() }, + Vec::new() + )); + assert_ok!(Staking::stake(RuntimeOrigin::signed(who), i as _, Vec::new())); + assert_ok!(Staking::collect(RuntimeOrigin::signed(who), Perbill::zero())); + assert_ok!(Staking::nominate(RuntimeOrigin::signed(who), who)); + }); } pub fn initialize_block(number: BlockNumber) { @@ -422,7 +446,7 @@ pub fn new_session() { } pub fn payout() { - darwinia_staking::call_on_exposure!(>::iter_keys().for_each(|c| { + crate::call_on_exposure!(>::iter_keys().for_each(|c| { let _ = Staking::payout_inner(c); })) .unwrap(); diff --git a/pallet/staking/src/tests.rs b/pallet/staking/src/tests.rs index 87c5df2d8..ac7d4358a 100644 --- a/pallet/staking/src/tests.rs +++ b/pallet/staking/src/tests.rs @@ -21,11 +21,9 @@ use core::time::Duration; // darwinia use crate::{mock::*, *}; use darwinia_deposit::Error as DepositError; -use dc_primitives::UNIT; // polkadot-sdk use frame_support::{assert_noop, assert_ok, BoundedVec}; use sp_runtime::{assert_eq_error_rate, DispatchError, Perbill}; -use substrate_test_utils::assert_eq_uvec; #[test] fn exposure_cache_states_should_work() { @@ -43,71 +41,71 @@ fn exposure_cache_states_should_work() { nominators: Default::default(), }; - >::insert(account_id_of(0), e.clone()); - >::insert(account_id_of(1), e.clone()); - >::insert(account_id_of(2), e); + >::insert(AccountId(0), e.clone()); + >::insert(AccountId(1), e.clone()); + >::insert(AccountId(2), e); } - assert!(call_on_exposure!(>::get(account_id_of(0)).is_some()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(1)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(2)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(0)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(1)).is_some()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(2)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(0)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(1)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(2)).is_some()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(0)).is_some()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(1)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(2)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(0)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(1)).is_some()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(2)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(0)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(1)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(2)).is_some()).unwrap()); assert_eq!( >::get(), - (ExposureCacheState::Previous, ExposureCacheState::Current, ExposureCacheState::Next) + (CacheState::Previous, CacheState::Current, CacheState::Next) ); - Staking::shift_exposure_cache_states(); + Staking::shift_cache_states(); - assert!(call_on_exposure!(>::get(account_id_of(0)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(1)).is_some()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(2)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(0)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(1)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(2)).is_some()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(0)).is_some()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(1)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(2)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(0)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(1)).is_some()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(2)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(0)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(1)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(2)).is_some()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(0)).is_some()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(1)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(2)).is_none()).unwrap()); assert_eq!( >::get(), - (ExposureCacheState::Next, ExposureCacheState::Previous, ExposureCacheState::Current) + (CacheState::Next, CacheState::Previous, CacheState::Current) ); - Staking::shift_exposure_cache_states(); + Staking::shift_cache_states(); - assert!(call_on_exposure!(>::get(account_id_of(0)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(1)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(2)).is_some()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(0)).is_some()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(1)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(2)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(0)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(1)).is_some()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(2)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(0)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(1)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(2)).is_some()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(0)).is_some()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(1)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(2)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(0)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(1)).is_some()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(2)).is_none()).unwrap()); assert_eq!( >::get(), - (ExposureCacheState::Current, ExposureCacheState::Next, ExposureCacheState::Previous) + (CacheState::Current, CacheState::Next, CacheState::Previous) ); - Staking::shift_exposure_cache_states(); + Staking::shift_cache_states(); - assert!(call_on_exposure!(>::get(account_id_of(0)).is_some()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(1)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(2)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(0)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(1)).is_some()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(2)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(0)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(1)).is_none()).unwrap()); - assert!(call_on_exposure!(>::get(account_id_of(2)).is_some()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(0)).is_some()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(1)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(2)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(0)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(1)).is_some()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(2)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(0)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(1)).is_none()).unwrap()); + assert!(call_on_exposure!(>::get(AccountId(2)).is_some()).unwrap()); assert_eq!( >::get(), - (ExposureCacheState::Previous, ExposureCacheState::Current, ExposureCacheState::Next) + (CacheState::Previous, CacheState::Current, CacheState::Next) ); }); } @@ -115,45 +113,45 @@ fn exposure_cache_states_should_work() { #[test] fn stake_should_work() { ExtBuilder::default().build().execute_with(|| { - assert_eq!(System::account(account_id_of(1)).consumers, 0); - assert!(Staking::ledger_of(account_id_of(1)).is_none()); - assert_eq!(Balances::free_balance(account_id_of(1)), 1_000 * UNIT); + assert_eq!(System::account(AccountId(1)).consumers, 0); + assert!(Staking::ledger_of(AccountId(1)).is_none()); + assert_eq!(Balances::free_balance(AccountId(1)), 1_000 * UNIT); assert_eq!(Staking::rate_limit_state(), RateLimiter::Pos(0)); // Stake 1 RING. - assert_ok!(Staking::stake(RuntimeOrigin::signed(account_id_of(1)), UNIT, Vec::new())); - assert_eq!(System::account(account_id_of(1)).consumers, 1); + assert_ok!(Staking::stake(RuntimeOrigin::signed(AccountId(1)), UNIT, Vec::new())); + assert_eq!(System::account(AccountId(1)).consumers, 1); assert_eq!( - Staking::ledger_of(account_id_of(1)).unwrap(), + Staking::ledger_of(AccountId(1)).unwrap(), Ledger { ring: UNIT, deposits: Default::default() } ); - assert_eq!(Balances::free_balance(account_id_of(1)), 999 * UNIT); + assert_eq!(Balances::free_balance(AccountId(1)), 999 * UNIT); assert_eq!(Staking::rate_limit_state(), RateLimiter::Pos(UNIT)); // Stake invalid deposit. assert_noop!( - Staking::stake(RuntimeOrigin::signed(account_id_of(1)), 0, vec![0]), + Staking::stake(RuntimeOrigin::signed(AccountId(1)), 0, vec![0]), >::DepositNotFound ); // Stake 1 deposit. - assert_eq!(System::account(account_id_of(1)).consumers, 1); - assert_ok!(Deposit::lock(RuntimeOrigin::signed(account_id_of(1)), UNIT, 1)); - assert_ok!(Staking::stake(RuntimeOrigin::signed(account_id_of(1)), 0, vec![0])); + assert_eq!(System::account(AccountId(1)).consumers, 1); + assert_ok!(Deposit::lock(RuntimeOrigin::signed(AccountId(1)), UNIT, 1)); + assert_ok!(Staking::stake(RuntimeOrigin::signed(AccountId(1)), 0, vec![0])); assert_eq!( - Staking::ledger_of(account_id_of(1)).unwrap(), + Staking::ledger_of(AccountId(1)).unwrap(), Ledger { ring: UNIT, deposits: BoundedVec::truncate_from(vec![0]) } ); assert_eq!(Staking::rate_limit_state(), RateLimiter::Pos(2 * UNIT)); // Stake 2 RING and 2 deposits. - assert_eq!(System::account(account_id_of(1)).consumers, 2); - assert_ok!(Deposit::lock(RuntimeOrigin::signed(account_id_of(1)), UNIT, 1)); - assert_ok!(Deposit::lock(RuntimeOrigin::signed(account_id_of(1)), UNIT, 1)); - assert_ok!(Staking::stake(RuntimeOrigin::signed(account_id_of(1)), 2 * UNIT, vec![1, 2])); - assert_eq!(Balances::free_balance(account_id_of(1)), 994 * UNIT); + assert_eq!(System::account(AccountId(1)).consumers, 2); + assert_ok!(Deposit::lock(RuntimeOrigin::signed(AccountId(1)), UNIT, 1)); + assert_ok!(Deposit::lock(RuntimeOrigin::signed(AccountId(1)), UNIT, 1)); + assert_ok!(Staking::stake(RuntimeOrigin::signed(AccountId(1)), 2 * UNIT, vec![1, 2])); + assert_eq!(Balances::free_balance(AccountId(1)), 994 * UNIT); assert_eq!( - Staking::ledger_of(account_id_of(1)).unwrap(), + Staking::ledger_of(AccountId(1)).unwrap(), Ledger { ring: 3 * UNIT, deposits: BoundedVec::truncate_from(vec![0, 1, 2]) } ); assert_eq!(Staking::rate_limit_state(), RateLimiter::Pos(6 * UNIT)); @@ -163,22 +161,18 @@ fn stake_should_work() { #[test] fn unstake_should_work() { ExtBuilder::default().build().execute_with(|| { - assert_ok!(Deposit::lock(RuntimeOrigin::signed(account_id_of(1)), UNIT, 1)); - assert_ok!(Deposit::lock(RuntimeOrigin::signed(account_id_of(1)), UNIT, 1)); - assert_ok!(Deposit::lock(RuntimeOrigin::signed(account_id_of(1)), UNIT, 1)); - assert_ok!(Staking::stake( - RuntimeOrigin::signed(account_id_of(1)), - 3 * UNIT, - vec![0, 1, 2] - )); - assert_eq!(Balances::free_balance(account_id_of(1)), 994 * UNIT); + assert_ok!(Deposit::lock(RuntimeOrigin::signed(AccountId(1)), UNIT, 1)); + assert_ok!(Deposit::lock(RuntimeOrigin::signed(AccountId(1)), UNIT, 1)); + assert_ok!(Deposit::lock(RuntimeOrigin::signed(AccountId(1)), UNIT, 1)); + assert_ok!(Staking::stake(RuntimeOrigin::signed(AccountId(1)), 3 * UNIT, vec![0, 1, 2])); + assert_eq!(Balances::free_balance(AccountId(1)), 994 * UNIT); assert_eq!(Staking::rate_limit_state(), RateLimiter::Pos(6 * UNIT)); assert_eq!( - Staking::ledger_of(account_id_of(1)).unwrap(), + Staking::ledger_of(AccountId(1)).unwrap(), Ledger { ring: 3 * UNIT, deposits: BoundedVec::truncate_from(vec![0, 1, 2]) } ); assert_eq!( - Deposit::deposit_of(account_id_of(1)) + Deposit::deposit_of(AccountId(1)) .unwrap() .into_iter() .map(|d| d.in_use) @@ -187,30 +181,30 @@ fn unstake_should_work() { ); // Unstake 1 RING. - assert_ok!(Staking::unstake(RuntimeOrigin::signed(account_id_of(1)), UNIT, Vec::new())); + assert_ok!(Staking::unstake(RuntimeOrigin::signed(AccountId(1)), UNIT, Vec::new())); assert_eq!(Staking::rate_limit_state(), RateLimiter::Pos(5 * UNIT)); - assert_eq!(Balances::free_balance(account_id_of(1)), 995 * UNIT); + assert_eq!(Balances::free_balance(AccountId(1)), 995 * UNIT); assert_eq!( - Staking::ledger_of(account_id_of(1)).unwrap(), + Staking::ledger_of(AccountId(1)).unwrap(), Ledger { ring: 2 * UNIT, deposits: BoundedVec::truncate_from(vec![0, 1, 2]) } ); // Unstake invalid deposit. assert_noop!( - Staking::unstake(RuntimeOrigin::signed(account_id_of(1)), 0, vec![3]), + Staking::unstake(RuntimeOrigin::signed(AccountId(1)), 0, vec![3]), >::DepositNotFound ); // Unstake 1 deposit. Efflux::block(1); - assert_ok!(Staking::unstake(RuntimeOrigin::signed(account_id_of(1)), 0, vec![1])); + assert_ok!(Staking::unstake(RuntimeOrigin::signed(AccountId(1)), 0, vec![1])); assert_eq!(Staking::rate_limit_state(), RateLimiter::Pos(4 * UNIT)); assert_eq!( - Staking::ledger_of(account_id_of(1)).unwrap(), + Staking::ledger_of(AccountId(1)).unwrap(), Ledger { ring: 2 * UNIT, deposits: BoundedVec::truncate_from(vec![0, 2]) } ); assert_eq!( - Deposit::deposit_of(account_id_of(1)) + Deposit::deposit_of(AccountId(1)) .unwrap() .into_iter() .map(|d| d.in_use) @@ -220,11 +214,11 @@ fn unstake_should_work() { // Unstake 2 RING and 2 deposits. Efflux::block(1); - assert_ok!(Staking::unstake(RuntimeOrigin::signed(account_id_of(1)), 2 * UNIT, vec![0, 2])); + assert_ok!(Staking::unstake(RuntimeOrigin::signed(AccountId(1)), 2 * UNIT, vec![0, 2])); assert_eq!(Staking::rate_limit_state(), RateLimiter::Pos(0)); - assert!(Staking::ledger_of(account_id_of(1)).is_none()); + assert!(Staking::ledger_of(AccountId(1)).is_none()); assert_eq!( - Deposit::deposit_of(account_id_of(1)) + Deposit::deposit_of(AccountId(1)) .unwrap() .into_iter() .map(|d| d.in_use) @@ -233,31 +227,27 @@ fn unstake_should_work() { ); // Prepare rate limit test data. - assert_ok!(Deposit::lock(RuntimeOrigin::signed(account_id_of(1)), 100 * UNIT + 1, 1)); + assert_ok!(Deposit::lock(RuntimeOrigin::signed(AccountId(1)), 100 * UNIT + 1, 1)); >::put(200 * UNIT + 2); - assert_ok!(Staking::stake( - RuntimeOrigin::signed(account_id_of(1)), - 100 * UNIT + 1, - vec![3] - )); + assert_ok!(Staking::stake(RuntimeOrigin::signed(AccountId(1)), 100 * UNIT + 1, vec![3])); >::put(100 * UNIT); >::kill(); // Unstake 100 UNIT + 1. assert_noop!( - Staking::unstake(RuntimeOrigin::signed(account_id_of(1)), 100 * UNIT + 1, Vec::new()), + Staking::unstake(RuntimeOrigin::signed(AccountId(1)), 100 * UNIT + 1, Vec::new()), >::ExceedRateLimit ); // Unstake 100 UNIT + 1. assert_noop!( - Staking::unstake(RuntimeOrigin::signed(account_id_of(1)), 0, vec![3]), + Staking::unstake(RuntimeOrigin::signed(AccountId(1)), 0, vec![3]), >::ExceedRateLimit ); // Unstake RING(100 UNIT + 1) and deposit(100 UNIT + 1). assert_noop!( - Staking::unstake(RuntimeOrigin::signed(account_id_of(1)), 100 * UNIT + 1, vec![3]), + Staking::unstake(RuntimeOrigin::signed(AccountId(1)), 100 * UNIT + 1, vec![3]), >::ExceedRateLimit ); }); @@ -266,14 +256,14 @@ fn unstake_should_work() { #[test] fn collect_should_work() { ExtBuilder::default().build().execute_with(|| { - assert!(Staking::collator_of(account_id_of(1)).is_none()); - assert_ok!(Staking::stake(RuntimeOrigin::signed(account_id_of(1)), UNIT, Vec::new())); + assert!(Staking::collator_of(AccountId(1)).is_none()); + assert_ok!(Staking::stake(RuntimeOrigin::signed(AccountId(1)), UNIT, Vec::new())); (0..=99).for_each(|c| { let c = Perbill::from_percent(c); - assert_ok!(Staking::collect(RuntimeOrigin::signed(account_id_of(1)), c)); - assert_eq!(Staking::collator_of(account_id_of(1)).unwrap(), c); + assert_ok!(Staking::collect(RuntimeOrigin::signed(AccountId(1)), c)); + assert_eq!(Staking::collator_of(AccountId(1)).unwrap(), c); }); }); } @@ -281,17 +271,14 @@ fn collect_should_work() { #[test] fn nominate_should_work() { ExtBuilder::default().build().execute_with(|| { - assert_ok!(Staking::stake(RuntimeOrigin::signed(account_id_of(1)), UNIT, Vec::new())); - assert_ok!(Staking::collect(RuntimeOrigin::signed(account_id_of(1)), Perbill::zero())); + assert_ok!(Staking::stake(RuntimeOrigin::signed(AccountId(1)), UNIT, Vec::new())); + assert_ok!(Staking::collect(RuntimeOrigin::signed(AccountId(1)), Perbill::zero())); (2..=10).for_each(|i| { - assert!(Staking::nominator_of(account_id_of(i)).is_none()); - assert_ok!(Staking::stake(RuntimeOrigin::signed(account_id_of(i)), UNIT, Vec::new())); - assert_ok!(Staking::nominate( - RuntimeOrigin::signed(account_id_of(i)), - account_id_of(1) - )); - assert_eq!(Staking::nominator_of(account_id_of(i)).unwrap(), account_id_of(1)); + assert!(Staking::nominator_of(AccountId(i)).is_none()); + assert_ok!(Staking::stake(RuntimeOrigin::signed(AccountId(i)), UNIT, Vec::new())); + assert_ok!(Staking::nominate(RuntimeOrigin::signed(AccountId(i)), AccountId(1))); + assert_eq!(Staking::nominator_of(AccountId(i)).unwrap(), AccountId(1)); }); }); } @@ -299,23 +286,20 @@ fn nominate_should_work() { #[test] fn chill_should_work() { ExtBuilder::default().build().execute_with(|| { - assert_ok!(Staking::stake(RuntimeOrigin::signed(account_id_of(1)), UNIT, Vec::new())); - assert_ok!(Staking::collect(RuntimeOrigin::signed(account_id_of(1)), Perbill::zero())); + assert_ok!(Staking::stake(RuntimeOrigin::signed(AccountId(1)), UNIT, Vec::new())); + assert_ok!(Staking::collect(RuntimeOrigin::signed(AccountId(1)), Perbill::zero())); (2..=10).for_each(|i| { - assert_ok!(Staking::stake(RuntimeOrigin::signed(account_id_of(i)), UNIT, Vec::new())); - assert_ok!(Staking::nominate( - RuntimeOrigin::signed(account_id_of(i)), - account_id_of(1) - )); + assert_ok!(Staking::stake(RuntimeOrigin::signed(AccountId(i)), UNIT, Vec::new())); + assert_ok!(Staking::nominate(RuntimeOrigin::signed(AccountId(i)), AccountId(1))); }); - assert!(Staking::collator_of(account_id_of(1)).is_some()); - (2..=10).for_each(|i| assert!(Staking::nominator_of(account_id_of(i)).is_some())); + assert!(Staking::collator_of(AccountId(1)).is_some()); + (2..=10).for_each(|i| assert!(Staking::nominator_of(AccountId(i)).is_some())); (1..=10).for_each(|i| { - assert_ok!(Staking::chill(RuntimeOrigin::signed(account_id_of(i)))); + assert_ok!(Staking::chill(RuntimeOrigin::signed(AccountId(i)))); }); - assert!(Staking::collator_of(account_id_of(1)).is_none()); - (2..=10).for_each(|i| assert!(Staking::nominator_of(account_id_of(i)).is_none())); + assert!(Staking::collator_of(AccountId(1)).is_none()); + (2..=10).for_each(|i| assert!(Staking::nominator_of(AccountId(i)).is_none())); }); } @@ -323,7 +307,7 @@ fn chill_should_work() { fn set_collator_count_should_work() { ExtBuilder::default().build().execute_with(|| { assert_noop!( - Staking::set_collator_count(RuntimeOrigin::signed(account_id_of(1)), 1), + Staking::set_collator_count(RuntimeOrigin::signed(AccountId(1)), 1), DispatchError::BadOrigin ); assert_noop!( @@ -339,31 +323,25 @@ fn elect_should_work() { ExtBuilder::default().collator_count(3).build().execute_with(|| { (1..=5).for_each(|i| { assert_ok!(Staking::stake( - RuntimeOrigin::signed(account_id_of(i)), + RuntimeOrigin::signed(AccountId(i)), i as Balance * UNIT, Vec::new() )); - assert_ok!(Staking::collect(RuntimeOrigin::signed(account_id_of(i)), Perbill::zero())); - assert_ok!(Staking::nominate( - RuntimeOrigin::signed(account_id_of(i)), - account_id_of(i) - )); + assert_ok!(Staking::collect(RuntimeOrigin::signed(AccountId(i)), Perbill::zero())); + assert_ok!(Staking::nominate(RuntimeOrigin::signed(AccountId(i)), AccountId(i))); }); (6..=10).for_each(|i| { assert_ok!(Staking::stake( - RuntimeOrigin::signed(account_id_of(i)), + RuntimeOrigin::signed(AccountId(i)), i as Balance * UNIT, Vec::new() )); - assert_ok!(Staking::nominate( - RuntimeOrigin::signed(account_id_of(i)), - account_id_of(i - 5) - )); + assert_ok!(Staking::nominate(RuntimeOrigin::signed(AccountId(i)), AccountId(i - 5))); }); assert_eq!( - Staking::elect().unwrap(), - vec![account_id_of(5), account_id_of(4), account_id_of(3)] + Staking::elect(Staking::collator_count()).unwrap(), + vec![AccountId(5), AccountId(4), AccountId(3)] ); }); } @@ -373,46 +351,42 @@ fn payout_should_work() { ExtBuilder::default().collator_count(5).build().execute_with(|| { (1..=5).for_each(|i| { assert_ok!(Staking::stake( - RuntimeOrigin::signed(account_id_of(i)), + RuntimeOrigin::signed(AccountId(i)), i as Balance * UNIT, Vec::new() )); assert_ok!(Staking::collect( - RuntimeOrigin::signed(account_id_of(i)), + RuntimeOrigin::signed(AccountId(i)), Perbill::from_percent(i as u32 * 10) )); - assert_ok!(Staking::nominate( - RuntimeOrigin::signed(account_id_of(i)), - account_id_of(i) - )); + assert_ok!(Staking::nominate(RuntimeOrigin::signed(AccountId(i)), AccountId(i))); }); (6..=10).for_each(|i| { assert_ok!(Staking::stake( - RuntimeOrigin::signed(account_id_of(i)), + RuntimeOrigin::signed(AccountId(i)), (11 - i as Balance) * UNIT, Vec::new() )); - assert_ok!(Staking::nominate( - RuntimeOrigin::signed(account_id_of(i)), - account_id_of(i - 5) - )); + assert_ok!(Staking::nominate(RuntimeOrigin::signed(AccountId(i)), AccountId(i - 5))); }); new_session(); (1..=10).for_each(|i| { assert_eq!( - Balances::free_balance(account_id_of(i)), + Balances::free_balance(AccountId(i)), (1_000 - if i < 6 { i } else { 11 - i }) as Balance * UNIT ) }); let session_duration = Duration::new(12 * 600, 0).as_millis(); + let kton_staking_contract_balance = + Balances::free_balance(>::get().unwrap()); Efflux::time(session_duration - >::get() as Moment); Staking::note_authors(&[ - account_id_of(1), - account_id_of(2), - account_id_of(3), - account_id_of(4), - account_id_of(5), + AccountId(1), + AccountId(2), + AccountId(3), + AccountId(4), + AccountId(5), ]); new_session(); new_session(); @@ -430,55 +404,51 @@ fn payout_should_work() { 145719489836065573771, 60716453916211293261, ]; + let half_reward = PAYOUT_FRAC + * dc_inflation::issuing_in_period(session_duration, Timestamp::now()).unwrap() + / 2; + assert_eq_error_rate!(half_reward, rewards.iter().sum::(), UNIT); + assert_eq_error_rate!( + half_reward, + Balances::free_balance(>::get().unwrap()) + - kton_staking_contract_balance, + UNIT + ); assert_eq!( rewards.as_slice(), (1..=10) - .map(|i| Balances::free_balance(account_id_of(i)) + .map(|i| Balances::free_balance(AccountId(i)) - (1_000 - if i < 6 { i } else { 11 - i }) as Balance * UNIT) .collect::>() ); - assert_eq_error_rate!( - PayoutFraction::get() - * dc_inflation::issuing_in_period(session_duration, Timestamp::now()).unwrap() - / 2, - rewards.iter().sum::(), - // Error rate 1 RING. - UNIT - ); }); ExtBuilder::default().inflation_type(1).collator_count(5).build().execute_with(|| { (1..=5).for_each(|i| { assert_ok!(Staking::stake( - RuntimeOrigin::signed(account_id_of(i)), + RuntimeOrigin::signed(AccountId(i)), i as Balance * UNIT, Vec::new() )); assert_ok!(Staking::collect( - RuntimeOrigin::signed(account_id_of(i)), + RuntimeOrigin::signed(AccountId(i)), Perbill::from_percent(i as u32 * 10) )); - assert_ok!(Staking::nominate( - RuntimeOrigin::signed(account_id_of(i)), - account_id_of(i) - )); + assert_ok!(Staking::nominate(RuntimeOrigin::signed(AccountId(i)), AccountId(i))); }); (6..=10).for_each(|i| { assert_ok!(Staking::stake( - RuntimeOrigin::signed(account_id_of(i)), + RuntimeOrigin::signed(AccountId(i)), (11 - i as Balance) * UNIT, Vec::new() )); - assert_ok!(Staking::nominate( - RuntimeOrigin::signed(account_id_of(i)), - account_id_of(i - 5) - )); + assert_ok!(Staking::nominate(RuntimeOrigin::signed(AccountId(i)), AccountId(i - 5))); }); new_session(); new_session(); (1..=10).for_each(|i| { assert_eq!( - Balances::free_balance(account_id_of(i)), + Balances::free_balance(AccountId(i)), (1_000 - if i < 6 { i } else { 11 - i }) as Balance * UNIT ) }); @@ -487,31 +457,31 @@ fn payout_should_work() { let session_duration = Duration::new(12 * 600, 0).as_millis(); Efflux::time(session_duration - >::get() as Moment); Staking::note_authors(&[ - account_id_of(1), - account_id_of(2), - account_id_of(3), - account_id_of(4), - account_id_of(5), + AccountId(1), + AccountId(2), + AccountId(3), + AccountId(4), + AccountId(5), ]); new_session(); payout(); let rewards = [ - 249999999400000000000, - 466666666400000000000, - 650000000000000000000, - 799999999600000000000, - 916666666500000000000, - 749999999700000000000, - 533333332800000000000, - 350000000000000000000, - 199999999800000000000, - 83333333000000000000, + 499999998800000000000, + 933333332800000000000, + 1300000000000000000000, + 1599999999200000000000, + 1833333333000000000000, + 1499999999400000000000, + 1066666665600000000000, + 700000000000000000000, + 399999999600000000000, + 166666666000000000000, ]; assert_eq!( rewards.as_slice(), (1..=10) - .map(|i| Balances::free_balance(account_id_of(i)) + .map(|i| Balances::free_balance(AccountId(i)) - (1_000 - if i < 6 { i } else { 11 - i }) as Balance * UNIT) .collect::>() ); @@ -520,10 +490,10 @@ fn payout_should_work() { assert_ok!(Balances::transfer_all( RuntimeOrigin::signed(Treasury::account_id()), - Default::default(), + AccountId(0), false )); - Staking::note_authors(&[account_id_of(1)]); + Staking::note_authors(&[AccountId(1)]); System::reset_events(); new_session(); payout(); @@ -537,12 +507,10 @@ fn payout_should_work() { }) .collect::>(), vec![ - // Pay to staking failed. - Event::Unpaid { who: account_id(), amount: 5000000000000000000000 }, // Pay to collator failed. - Event::Unpaid { who: account_id_of(6), amount: 3749999998500000000000 }, + Event::Unpaid { who: AccountId(6), amount: 7499999997000000000000 }, // Pay to nominator failed. - Event::Unpaid { who: account_id_of(1), amount: 1249999997000000000000 } + Event::Unpaid { who: AccountId(1), amount: 2499999994000000000000 } ] ); }); @@ -553,39 +521,33 @@ fn auto_payout_should_work() { ExtBuilder::default().collator_count(2).build().execute_with(|| { (1..=2).for_each(|i| { assert_ok!(Staking::stake( - RuntimeOrigin::signed(account_id_of(i)), + RuntimeOrigin::signed(AccountId(i)), i as Balance * UNIT, Vec::new() )); assert_ok!(Staking::collect( - RuntimeOrigin::signed(account_id_of(i)), + RuntimeOrigin::signed(AccountId(i)), Perbill::from_percent(i as u32 * 10) )); - assert_ok!(Staking::nominate( - RuntimeOrigin::signed(account_id_of(i)), - account_id_of(i) - )); + assert_ok!(Staking::nominate(RuntimeOrigin::signed(AccountId(i)), AccountId(i))); }); (3..=4).for_each(|i| { assert_ok!(Staking::stake( - RuntimeOrigin::signed(account_id_of(i)), + RuntimeOrigin::signed(AccountId(i)), (5 - i as Balance) * UNIT, Vec::new() )); - assert_ok!(Staking::nominate( - RuntimeOrigin::signed(account_id_of(i)), - account_id_of(i - 2) - )); + assert_ok!(Staking::nominate(RuntimeOrigin::signed(AccountId(i)), AccountId(i - 2))); }); new_session(); new_session(); Efflux::time(>::get() as Moment); - Staking::note_authors(&[account_id_of(1), account_id_of(2)]); + Staking::note_authors(&[AccountId(1), AccountId(2)]); new_session(); (1..=4).for_each(|i| { assert_eq!( - Balances::free_balance(account_id_of(i)), + Balances::free_balance(AccountId(i)), (1_000 - if i < 3 { i } else { 5 - i }) as Balance * UNIT ) }); @@ -593,10 +555,10 @@ fn auto_payout_should_work() { Efflux::block(1); assert_eq!( [ - Balances::free_balance(account_id_of(1)), - Balances::free_balance(account_id_of(2)), - Balances::free_balance(account_id_of(3)), - Balances::free_balance(account_id_of(4)), + Balances::free_balance(AccountId(1)), + Balances::free_balance(AccountId(2)), + Balances::free_balance(AccountId(3)), + Balances::free_balance(AccountId(4)), ], [ 999000607164541135398, @@ -609,10 +571,10 @@ fn auto_payout_should_work() { Efflux::block(1); assert_eq!( [ - Balances::free_balance(account_id_of(1)), - Balances::free_balance(account_id_of(2)), - Balances::free_balance(account_id_of(3)), - Balances::free_balance(account_id_of(4)), + Balances::free_balance(AccountId(1)), + Balances::free_balance(AccountId(2)), + Balances::free_balance(AccountId(3)), + Balances::free_balance(AccountId(4)), ], [ 999000607164541135398, @@ -625,10 +587,10 @@ fn auto_payout_should_work() { Efflux::block(1); assert_eq!( [ - Balances::free_balance(account_id_of(1)), - Balances::free_balance(account_id_of(2)), - Balances::free_balance(account_id_of(3)), - Balances::free_balance(account_id_of(4)), + Balances::free_balance(AccountId(1)), + Balances::free_balance(AccountId(2)), + Balances::free_balance(AccountId(3)), + Balances::free_balance(AccountId(4)), ], [ 999000607164541135398, @@ -643,92 +605,76 @@ fn auto_payout_should_work() { #[test] fn on_new_session_should_work() { ExtBuilder::default().collator_count(2).genesis_collator().build().execute_with(|| { - assert_eq_uvec!( - darwinia_staking::call_on_exposure!( - >::iter_keys().collect::>() - ) - .unwrap(), - [account_id_of(1), account_id_of(2)] + assert_eq!( + crate::call_on_exposure!(>::iter_keys().collect::>()).unwrap(), + [AccountId(1), AccountId(2)] ); - assert_eq_uvec!( - darwinia_staking::call_on_exposure!(>::iter_keys().collect::>()).unwrap(), - [account_id_of(1), account_id_of(2)] + assert_eq!( + crate::call_on_exposure!(>::iter_keys().collect::>()).unwrap(), + [AccountId(1), AccountId(2)] ); - assert_eq_uvec!( - darwinia_staking::call_on_exposure!(>::iter_keys().collect::>()) - .unwrap(), - [account_id_of(1), account_id_of(2)] + assert_eq!( + crate::call_on_exposure!(>::iter_keys().collect::>()).unwrap(), + [AccountId(1), AccountId(2)] ); - assert_ok!(Staking::collect(RuntimeOrigin::signed(account_id_of(3)), Perbill::zero())); - assert_ok!(Staking::stake(RuntimeOrigin::signed(account_id_of(3)), 2 * UNIT, Vec::new())); - assert_ok!(Staking::nominate(RuntimeOrigin::signed(account_id_of(3)), account_id_of(3))); + assert_ok!(Staking::collect(RuntimeOrigin::signed(AccountId(3)), Perbill::zero())); + assert_ok!(Staking::stake(RuntimeOrigin::signed(AccountId(3)), 2, Vec::new())); + assert_ok!(Staking::nominate(RuntimeOrigin::signed(AccountId(3)), AccountId(3))); Staking::note_authors(&Session::validators()); new_session(); - assert_eq_uvec!( - darwinia_staking::call_on_exposure!( - >::iter_keys().collect::>() - ) - .unwrap(), - [account_id_of(1), account_id_of(2)] + assert_eq!( + crate::call_on_exposure!(>::iter_keys().collect::>()).unwrap(), + [AccountId(1), AccountId(2)] ); - assert_eq_uvec!( - darwinia_staking::call_on_exposure!(>::iter_keys().collect::>()).unwrap(), - [account_id_of(1), account_id_of(2)] + assert_eq!( + crate::call_on_exposure!(>::iter_keys().collect::>()).unwrap(), + [AccountId(1), AccountId(2)] ); - assert_eq_uvec!( - darwinia_staking::call_on_exposure!(>::iter_keys().collect::>()) - .unwrap(), - [account_id_of(1), account_id_of(3)] + assert_eq!( + crate::call_on_exposure!(>::iter_keys().collect::>()).unwrap(), + [AccountId(3), AccountId(2)] ); - assert_ok!(Staking::chill(RuntimeOrigin::signed(account_id_of(3)))); - assert_ok!(Staking::collect(RuntimeOrigin::signed(account_id_of(4)), Perbill::zero())); - assert_ok!(Staking::stake(RuntimeOrigin::signed(account_id_of(4)), 2 * UNIT, Vec::new())); - assert_ok!(Staking::nominate(RuntimeOrigin::signed(account_id_of(4)), account_id_of(4))); + assert_ok!(Staking::chill(RuntimeOrigin::signed(AccountId(3)))); + assert_ok!(Staking::collect(RuntimeOrigin::signed(AccountId(4)), Perbill::zero())); + assert_ok!(Staking::stake(RuntimeOrigin::signed(AccountId(4)), 2, Vec::new())); + assert_ok!(Staking::nominate(RuntimeOrigin::signed(AccountId(4)), AccountId(4))); Staking::note_authors(&Session::validators()); new_session(); - assert_eq_uvec!( - darwinia_staking::call_on_exposure!( - >::iter_keys().collect::>() - ) - .unwrap(), - [account_id_of(1), account_id_of(2)] + assert_eq!( + crate::call_on_exposure!(>::iter_keys().collect::>()).unwrap(), + [AccountId(1), AccountId(2)] ); - assert_eq_uvec!( - darwinia_staking::call_on_exposure!(>::iter_keys().collect::>()).unwrap(), - [account_id_of(1), account_id_of(3)] + assert_eq!( + crate::call_on_exposure!(>::iter_keys().collect::>()).unwrap(), + [AccountId(3), AccountId(2)] ); - assert_eq_uvec!( - darwinia_staking::call_on_exposure!(>::iter_keys().collect::>()) - .unwrap(), - [account_id_of(1), account_id_of(4)] + assert_eq!( + crate::call_on_exposure!(>::iter_keys().collect::>()).unwrap(), + [AccountId(4), AccountId(2)] ); - assert_ok!(Staking::chill(RuntimeOrigin::signed(account_id_of(4)))); - assert_ok!(Staking::collect(RuntimeOrigin::signed(account_id_of(5)), Perbill::zero())); - assert_ok!(Staking::stake(RuntimeOrigin::signed(account_id_of(5)), 2 * UNIT, Vec::new())); - assert_ok!(Staking::nominate(RuntimeOrigin::signed(account_id_of(5)), account_id_of(5))); + assert_ok!(Staking::chill(RuntimeOrigin::signed(AccountId(4)))); + assert_ok!(Staking::collect(RuntimeOrigin::signed(AccountId(5)), Perbill::zero())); + assert_ok!(Staking::stake(RuntimeOrigin::signed(AccountId(5)), 2, Vec::new())); + assert_ok!(Staking::nominate(RuntimeOrigin::signed(AccountId(5)), AccountId(5))); Staking::note_authors(&Session::validators()); new_session(); - assert_eq_uvec!( - darwinia_staking::call_on_exposure!( - >::iter_keys().collect::>() - ) - .unwrap(), - [account_id_of(1), account_id_of(3)] + assert_eq!( + crate::call_on_exposure!(>::iter_keys().collect::>()).unwrap(), + [AccountId(3), AccountId(2)] ); - assert_eq_uvec!( - darwinia_staking::call_on_exposure!(>::iter_keys().collect::>()).unwrap(), - [account_id_of(1), account_id_of(4)] + assert_eq!( + crate::call_on_exposure!(>::iter_keys().collect::>()).unwrap(), + [AccountId(4), AccountId(2)] ); - assert_eq_uvec!( - darwinia_staking::call_on_exposure!(>::iter_keys().collect::>()) - .unwrap(), - [account_id_of(1), account_id_of(5)] + assert_eq!( + crate::call_on_exposure!(>::iter_keys().collect::>()).unwrap(), + [AccountId(5), AccountId(2)] ); }); } @@ -771,3 +717,139 @@ fn rate_limiter_should_work() { let r = RateLimiter::Neg(3); assert_eq!(r.flow_in(6, 3).unwrap(), RateLimiter::Pos(3)); } + +#[test] +fn elect_ns_should_work() { + ExtBuilder::default().collator_count(100).build().execute_with(|| { + [ + (0, 100), + (2, 98), + (3, 97), + (5, 95), + (7, 93), + (8, 92), + (10, 90), + (12, 88), + (13, 87), + (15, 85), + (17, 83), + (18, 82), + (20, 80), + (22, 78), + (23, 77), + (25, 75), + (27, 73), + (28, 72), + (30, 70), + (32, 68), + (33, 67), + (35, 65), + (37, 63), + (38, 62), + (40, 60), + (42, 58), + (43, 57), + (45, 55), + (47, 53), + (48, 52), + (50, 50), + (52, 48), + (53, 47), + (55, 45), + (57, 43), + (58, 42), + (60, 40), + (62, 38), + (63, 37), + (65, 35), + (67, 33), + (68, 32), + (70, 30), + (72, 28), + (73, 27), + (75, 25), + (77, 23), + (78, 22), + (80, 20), + (82, 18), + (83, 17), + (85, 15), + (87, 13), + (88, 12), + (90, 10), + (92, 8), + (93, 7), + (95, 5), + (97, 3), + (98, 2), + (100, 0), + (100, 0), + ] + .iter() + .for_each(|exp| { + assert_eq!(exp, &>::elect_ns()); + + Efflux::time(DAY_IN_MILLIS); + }); + }); +} + +#[test] +fn hybrid_election_should_work() { + ExtBuilder::default().collator_count(10).build().execute_with(|| { + mock::preset_collators(10); + new_session(); + new_session(); + + assert_eq!( + (10..20).rev().map(AccountId).collect::>(), + >::get() + ); + + Timestamp::set_timestamp(15 * DAY_IN_MILLIS); + new_session(); + new_session(); + + assert_eq!( + (100..103).map(AccountId).chain((12..20).rev().map(AccountId)).collect::>(), + >::get() + ); + + Timestamp::set_timestamp(30 * DAY_IN_MILLIS); + new_session(); + new_session(); + + assert_eq!( + (100..106).map(AccountId).chain((15..20).rev().map(AccountId)).collect::>(), + >::get() + ); + + Timestamp::set_timestamp(45 * DAY_IN_MILLIS); + new_session(); + new_session(); + + assert_eq!( + (100..108).map(AccountId).chain((17..20).rev().map(AccountId)).collect::>(), + >::get() + ); + + Timestamp::set_timestamp(60 * DAY_IN_MILLIS); + new_session(); + new_session(); + + assert_eq!( + (100..=110).map(AccountId).collect::>(), + >::get() + ); + }); +} + +#[test] +fn hybrid_payout_should_work() { + ExtBuilder::default().collator_count(10).build().execute_with(|| { + mock::preset_collators(10); + Timestamp::set_timestamp(30 * DAY_IN_MILLIS); + new_session(); + new_session(); + }); +} diff --git a/pallet/staking/src/weights.rs b/pallet/staking/src/weights.rs index 130c2c18d..ffa10a6b9 100644 --- a/pallet/staking/src/weights.rs +++ b/pallet/staking/src/weights.rs @@ -18,8 +18,8 @@ //! Autogenerated weights for darwinia_staking //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-04-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("koi-dev"), DB CACHE: 1024 @@ -59,7 +59,8 @@ pub trait WeightInfo { fn chill() -> Weight; fn payout() -> Weight; fn set_rate_limit() -> Weight; - fn set_kton_reward_distribution_contract() -> Weight; + fn set_ring_staking_contract() -> Weight; + fn set_kton_staking_contract() -> Weight; fn set_collator_count() -> Weight; } @@ -81,11 +82,11 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `7088 + x * (25 ±0)` // Estimated: `29615` - // Minimum execution time: 60_000 nanoseconds. - Weight::from_parts(992_585_597, 0) + // Minimum execution time: 47_000 nanoseconds. + Weight::from_parts(859_853_520, 0) .saturating_add(Weight::from_parts(29615, 0)) - // Standard Error: 297_913 - .saturating_add(Weight::from_parts(13_623_433, 0).saturating_mul(x.into())) + // Standard Error: 267_757 + .saturating_add(Weight::from_parts(12_932_760, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -104,11 +105,11 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `7415 + x * (26 ±0)` // Estimated: `29615` - // Minimum execution time: 54_000 nanoseconds. - Weight::from_parts(908_132_841, 0) + // Minimum execution time: 50_000 nanoseconds. + Weight::from_parts(643_370_535, 0) .saturating_add(Weight::from_parts(29615, 0)) - // Standard Error: 231_565 - .saturating_add(Weight::from_parts(11_600_487, 0).saturating_mul(x.into())) + // Standard Error: 274_835 + .saturating_add(Weight::from_parts(14_096_069, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -118,8 +119,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `388` // Estimated: `3497` - // Minimum execution time: 11_000 nanoseconds. - Weight::from_parts(11_000_000, 0) + // Minimum execution time: 10_000 nanoseconds. + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(3497, 0)) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -132,10 +133,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `DarwiniaStaking::Nominators` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) fn nominate() -> Weight { // Proof Size summary in bytes: - // Measured: `574` + // Measured: `600` // Estimated: `4543` - // Minimum execution time: 12_000 nanoseconds. - Weight::from_parts(12_000_000, 0) + // Minimum execution time: 13_000 nanoseconds. + Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(4543, 0)) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -149,7 +150,7 @@ impl WeightInfo for SubstrateWeight { // Measured: `0` // Estimated: `0` // Minimum execution time: 4_000 nanoseconds. - Weight::from_parts(4_000_000, 0) + Weight::from_parts(6_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -159,17 +160,17 @@ impl WeightInfo for SubstrateWeight { /// Proof: `DarwiniaStaking::ExposureCache2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `DarwiniaStaking::PendingRewards` (r:1 w:1) /// Proof: `DarwiniaStaking::PendingRewards` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:0) + /// Storage: `System::Account` (r:32 w:32) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`) fn payout() -> Weight { // Proof Size summary in bytes: - // Measured: `1845` - // Estimated: `5310` - // Minimum execution time: 205_000 nanoseconds. - Weight::from_parts(207_000_000, 0) - .saturating_add(Weight::from_parts(5310, 0)) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `2330` + // Estimated: `83902` + // Minimum execution time: 535_000 nanoseconds. + Weight::from_parts(629_000_000, 0) + .saturating_add(Weight::from_parts(83902, 0)) + .saturating_add(T::DbWeight::get().reads(35_u64)) + .saturating_add(T::DbWeight::get().writes(34_u64)) } /// Storage: `DarwiniaStaking::RateLimit` (r:0 w:1) /// Proof: `DarwiniaStaking::RateLimit` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) @@ -182,9 +183,20 @@ impl WeightInfo for SubstrateWeight { .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - // Storage: `DarwiniaStaking::KtonRewardDistributionContract` (r:0 w:1) - /// Proof: `DarwiniaStaking::KtonRewardDistributionContract` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - fn set_kton_reward_distribution_contract() -> Weight { + /// Storage: `DarwiniaStaking::RingStakingContract` (r:0 w:1) + /// Proof: `DarwiniaStaking::RingStakingContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + fn set_ring_staking_contract() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_000 nanoseconds. + Weight::from_parts(3_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `DarwiniaStaking::KtonStakingContract` (r:0 w:1) + /// Proof: `DarwiniaStaking::KtonStakingContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + fn set_kton_staking_contract() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` @@ -223,11 +235,11 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `7088 + x * (25 ±0)` // Estimated: `29615` - // Minimum execution time: 60_000 nanoseconds. - Weight::from_parts(992_585_597, 0) + // Minimum execution time: 47_000 nanoseconds. + Weight::from_parts(859_853_520, 0) .saturating_add(Weight::from_parts(29615, 0)) - // Standard Error: 297_913 - .saturating_add(Weight::from_parts(13_623_433, 0).saturating_mul(x.into())) + // Standard Error: 267_757 + .saturating_add(Weight::from_parts(12_932_760, 0).saturating_mul(x.into())) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -246,11 +258,11 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `7415 + x * (26 ±0)` // Estimated: `29615` - // Minimum execution time: 54_000 nanoseconds. - Weight::from_parts(908_132_841, 0) + // Minimum execution time: 50_000 nanoseconds. + Weight::from_parts(643_370_535, 0) .saturating_add(Weight::from_parts(29615, 0)) - // Standard Error: 231_565 - .saturating_add(Weight::from_parts(11_600_487, 0).saturating_mul(x.into())) + // Standard Error: 274_835 + .saturating_add(Weight::from_parts(14_096_069, 0).saturating_mul(x.into())) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -260,8 +272,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `388` // Estimated: `3497` - // Minimum execution time: 11_000 nanoseconds. - Weight::from_parts(11_000_000, 0) + // Minimum execution time: 10_000 nanoseconds. + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(3497, 0)) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -274,10 +286,10 @@ impl WeightInfo for () { /// Proof: `DarwiniaStaking::Nominators` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) fn nominate() -> Weight { // Proof Size summary in bytes: - // Measured: `574` + // Measured: `600` // Estimated: `4543` - // Minimum execution time: 12_000 nanoseconds. - Weight::from_parts(12_000_000, 0) + // Minimum execution time: 13_000 nanoseconds. + Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(4543, 0)) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -291,7 +303,7 @@ impl WeightInfo for () { // Measured: `0` // Estimated: `0` // Minimum execution time: 4_000 nanoseconds. - Weight::from_parts(4_000_000, 0) + Weight::from_parts(6_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -301,17 +313,17 @@ impl WeightInfo for () { /// Proof: `DarwiniaStaking::ExposureCache2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `DarwiniaStaking::PendingRewards` (r:1 w:1) /// Proof: `DarwiniaStaking::PendingRewards` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:0) + /// Storage: `System::Account` (r:32 w:32) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`) fn payout() -> Weight { // Proof Size summary in bytes: - // Measured: `1845` - // Estimated: `5310` - // Minimum execution time: 205_000 nanoseconds. - Weight::from_parts(207_000_000, 0) - .saturating_add(Weight::from_parts(5310, 0)) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) + // Measured: `2330` + // Estimated: `83902` + // Minimum execution time: 535_000 nanoseconds. + Weight::from_parts(629_000_000, 0) + .saturating_add(Weight::from_parts(83902, 0)) + .saturating_add(RocksDbWeight::get().reads(35_u64)) + .saturating_add(RocksDbWeight::get().writes(34_u64)) } /// Storage: `DarwiniaStaking::RateLimit` (r:0 w:1) /// Proof: `DarwiniaStaking::RateLimit` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) @@ -324,9 +336,20 @@ impl WeightInfo for () { .saturating_add(Weight::from_parts(0, 0)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: `DarwiniaStaking::KtonRewardDistributionContract` (r:0 w:1) - /// Proof: `DarwiniaStaking::KtonRewardDistributionContract` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - fn set_kton_reward_distribution_contract() -> Weight { + /// Storage: `DarwiniaStaking::RingStakingContract` (r:0 w:1) + /// Proof: `DarwiniaStaking::RingStakingContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + fn set_ring_staking_contract() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_000 nanoseconds. + Weight::from_parts(3_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: `DarwiniaStaking::KtonStakingContract` (r:0 w:1) + /// Proof: `DarwiniaStaking::KtonStakingContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + fn set_kton_staking_contract() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` diff --git a/pallet/staking/traits/Cargo.toml b/pallet/staking/traits/Cargo.toml index f243055fd..e1cd88ffd 100644 --- a/pallet/staking/traits/Cargo.toml +++ b/pallet/staking/traits/Cargo.toml @@ -11,7 +11,7 @@ version.workspace = true codec = { workspace = true, package = "parity-scale-codec" } scale-info = { workspace = true } -# subtrate +# polkadot-sdk sp-runtime = { workspace = true } [features] @@ -21,7 +21,7 @@ std = [ "codec/std", "scale-info/std", - # subtrate + # polkadot-sdk "sp-runtime/std", ] diff --git a/precompile/deposit/src/mock.rs b/precompile/deposit/src/mock.rs index bf366c783..58bbd1cb5 100644 --- a/precompile/deposit/src/mock.rs +++ b/precompile/deposit/src/mock.rs @@ -84,11 +84,13 @@ impl darwinia_deposit::SimpleAsset for KtonMinting { } impl darwinia_deposit::Config for Runtime { + type DepositMigrator = (); type Kton = KtonMinting; type MaxDeposits = frame_support::traits::ConstU32<16>; type MinLockingAmount = frame_support::traits::ConstU128<100>; type Ring = Balances; type RuntimeEvent = RuntimeEvent; + type Treasury = (); type WeightInfo = (); } diff --git a/precompile/staking/src/mock.rs b/precompile/staking/src/mock.rs index caa6851f8..ddcd0f520 100644 --- a/precompile/staking/src/mock.rs +++ b/precompile/staking/src/mock.rs @@ -67,6 +67,9 @@ impl pallet_timestamp::Config for Runtime { type Moment = Moment; } +frame_support::parameter_types! { + pub TreasuryAcct: AccountId = H160::zero().into(); +} pub enum KtonMinting {} impl darwinia_deposit::SimpleAsset for KtonMinting { type AccountId = AccountId; @@ -79,13 +82,14 @@ impl darwinia_deposit::SimpleAsset for KtonMinting { Ok(()) } } - impl darwinia_deposit::Config for Runtime { + type DepositMigrator = (); type Kton = KtonMinting; type MaxDeposits = frame_support::traits::ConstU32<512>; type MinLockingAmount = frame_support::traits::ConstU128<100>; type Ring = Balances; type RuntimeEvent = RuntimeEvent; + type Treasury = TreasuryAcct; type WeightInfo = (); } @@ -158,9 +162,6 @@ impl pallet_evm::Config for Runtime { type WithdrawOrigin = pallet_evm::EnsureAddressNever; } -frame_support::parameter_types! { - pub const PayoutFraction: sp_runtime::Perbill = sp_runtime::Perbill::from_percent(40); -} pub enum RingStaking {} impl darwinia_staking::Stake for RingStaking { type AccountId = AccountId; @@ -184,29 +185,18 @@ impl darwinia_staking::Stake for RingStaking { ) } } -pub enum KtonStaking {} -impl darwinia_staking::Stake for KtonStaking { - type AccountId = AccountId; - type Item = Balance; - - fn stake(_: &Self::AccountId, _: Self::Item) -> sp_runtime::DispatchResult { - Ok(()) - } - - fn unstake(_: &Self::AccountId, _: Self::Item) -> sp_runtime::DispatchResult { - Ok(()) - } -} impl darwinia_staking::Config for Runtime { type Currency = Balances; type Deposit = Deposit; type IssuingManager = (); - type Kton = KtonStaking; - type KtonStakerNotifier = (); + type KtonStaking = (); type MaxDeposits = ::MaxDeposits; type Ring = RingStaking; + type RingStaking = (); type RuntimeEvent = RuntimeEvent; type ShouldEndSession = (); + type Treasury = TreasuryAcct; + type UnixTime = Timestamp; type WeightInfo = (); } #[cfg(not(feature = "runtime-benchmarks"))] diff --git a/precompile/staking/src/tests.rs b/precompile/staking/src/tests.rs index b8aa2c494..e2c5ec7c6 100644 --- a/precompile/staking/src/tests.rs +++ b/precompile/staking/src/tests.rs @@ -52,7 +52,7 @@ fn stake_unstake_restake() { .prepare_test( alice, precompile, - PCall::stake { ring_amount: 200.into(), deposits: vec![] }, + PCall::stake { ring_amount: 200.into(), deposits: Vec::new() }, ) .execute_returns(true); assert_eq!(Staking::ledger_of(alice).unwrap().ring, 200); @@ -62,7 +62,7 @@ fn stake_unstake_restake() { .prepare_test( alice, precompile, - PCall::unstake { ring_amount: 200.into(), deposits: vec![] }, + PCall::unstake { ring_amount: 200.into(), deposits: Vec::new() }, ) .execute_returns(true); assert!(Staking::ledger_of(alice).is_none()); @@ -82,7 +82,7 @@ fn nominate() { .prepare_test( alice, precompile, - PCall::stake { ring_amount: 200.into(), deposits: vec![] }, + PCall::stake { ring_amount: 200.into(), deposits: Vec::new() }, ) .execute_returns(true); @@ -97,7 +97,7 @@ fn nominate() { .prepare_test( bob, precompile, - PCall::stake { ring_amount: 200.into(), deposits: vec![] }, + PCall::stake { ring_amount: 200.into(), deposits: Vec::new() }, ) .execute_returns(true); diff --git a/runtime/common/src/migration_helper.rs b/runtime/common/src/migration_helper.rs index 7e9c02b4d..d7e2ebcfd 100644 --- a/runtime/common/src/migration_helper.rs +++ b/runtime/common/src/migration_helper.rs @@ -164,7 +164,7 @@ fn identity_codec_should_work() { judgements: vec![(1, Judgement::KnownGood)], deposit: 100_025_800_000_000_000_000, info: IdentityInfo { - additional: vec![], + additional: Vec::new(), display: Data::Raw(b"AurevoirXavier".to_vec()), legal: Data::Raw(b"Xavier Lau".to_vec()), web: Data::Raw(b"https://linktr.ee/aurevoirxavier".to_vec()), diff --git a/runtime/common/src/test.rs b/runtime/common/src/test.rs index f34accd69..89de4f715 100644 --- a/runtime/common/src/test.rs +++ b/runtime/common/src/test.rs @@ -22,8 +22,8 @@ macro_rules! impl_account_migration_tests { mod account_migration { // darwinia use super::mock::*; + use darwinia_account_migration::OldLedger; use darwinia_deposit::Deposit as DepositS; - use darwinia_staking::migration::v2::OldLedger; // polkadot-sdk use frame_support::{ assert_err, assert_ok, migration, Blake2_128Concat, StorageHasher, @@ -363,13 +363,13 @@ macro_rules! impl_evm_tests { RuntimeOrigin::signed(H160::default().into()), H160::default(), H160::default(), - vec![], + Vec::new(), U256::default(), 1000000, U256::from(1_000_000), None, None, - vec![], + Vec::new(), ), DispatchError::BadOrigin ); @@ -378,13 +378,13 @@ macro_rules! impl_evm_tests { RuntimeOrigin::root(), H160::default(), H160::default(), - vec![], + Vec::new(), U256::default(), 1000000, U256::from(1_000_000), None, None, - vec![], + Vec::new(), ) { // Ignore the pallet index. let DispatchError::Module(e) = dispatch_info_with_err.error else { @@ -401,7 +401,7 @@ macro_rules! impl_evm_tests { ExtBuilder::default().build().execute_with(|| { assert!(DarwiniaDispatchValidator::validate_before_dispatch( &H160::default().into(), - &RuntimeCall::System(frame_system::Call::remark { remark: vec![] }) + &RuntimeCall::System(frame_system::Call::remark { remark: Vec::new() }) ) .is_none()); @@ -411,13 +411,13 @@ macro_rules! impl_evm_tests { &RuntimeCall::EVM(pallet_evm::Call::call { source: H160::default(), target: H160::default(), - input: vec![], + input: Vec::new(), value: U256::default(), gas_limit: 1000000, max_fee_per_gas: U256::from(1_000_000), max_priority_fee_per_gas: None, nonce: None, - access_list: vec![], + access_list: Vec::new(), }) ) .is_some()); @@ -430,7 +430,7 @@ macro_rules! impl_evm_tests { // Default class assert!(DarwiniaDispatchValidator::validate_before_dispatch( &H160::default().into(), - &RuntimeCall::System(frame_system::Call::remark { remark: vec![] }) + &RuntimeCall::System(frame_system::Call::remark { remark: Vec::new() }) ) .is_none()); diff --git a/runtime/crab/Cargo.toml b/runtime/crab/Cargo.toml index 0d0ee0e90..f0b95255a 100644 --- a/runtime/crab/Cargo.toml +++ b/runtime/crab/Cargo.toml @@ -277,7 +277,6 @@ try-runtime = [ # darwinia "darwinia-account-migration/try-runtime", "darwinia-deposit/try-runtime", - "darwinia-ethtx-forwarder/try-runtime", "darwinia-staking/try-runtime", # frontier diff --git a/runtime/crab/src/lib.rs b/runtime/crab/src/lib.rs index de6f08589..6040d6920 100644 --- a/runtime/crab/src/lib.rs +++ b/runtime/crab/src/lib.rs @@ -239,7 +239,6 @@ frame_benchmarking::define_benchmarks! { [pallet_balances, Balances] [pallet_collective, TechnicalCommittee] [pallet_conviction_voting, ConvictionVoting] - [pallet_evm, EVM] [pallet_message_queue, MessageQueue] [pallet_preimage, Preimage] [pallet_proxy, Proxy] diff --git a/runtime/crab/src/migration.rs b/runtime/crab/src/migration.rs index 5351fcc33..f36834591 100644 --- a/runtime/crab/src/migration.rs +++ b/runtime/crab/src/migration.rs @@ -45,19 +45,6 @@ impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade { } fn migrate() -> frame_support::weights::Weight { - frame_support::traits::StorageVersion::new(2) - .put::>(); - - const KTON_DAO_VAULT_ADDR: &str = "0x652182C6aBc0bBE41b5702b05a26d109A405EAcA"; - - #[cfg(feature = "try-runtime")] - assert!(array_bytes::hex_n_into::<_, AccountId, 20>(KTON_DAO_VAULT_ADDR).is_ok()); - - if let Ok(w) = array_bytes::hex_n_into::<_, _, 20>(KTON_DAO_VAULT_ADDR) { - >::put(w); - darwinia_staking::migration::migrate_staking_reward_distribution_contract::(w); - } - - // frame_support::weights::Weight::zero() - ::DbWeight::get().reads_writes(10, 10) + frame_support::weights::Weight::zero() + // ::DbWeight::get().reads_writes(10, 10) } diff --git a/runtime/crab/src/pallets/deposit.rs b/runtime/crab/src/pallets/deposit.rs index bdfdbd804..f8e9081b6 100644 --- a/runtime/crab/src/pallets/deposit.rs +++ b/runtime/crab/src/pallets/deposit.rs @@ -44,10 +44,12 @@ impl darwinia_deposit::SimpleAsset for KtonMinting { } impl darwinia_deposit::Config for Runtime { + type DepositMigrator = darwinia_deposit::DepositMigrator; type Kton = KtonMinting; type MaxDeposits = ConstU32<512>; type MinLockingAmount = ConstU128; type Ring = Balances; type RuntimeEvent = RuntimeEvent; + type Treasury = pallet_config::TreasuryAccount; type WeightInfo = weights::darwinia_deposit::WeightInfo; } diff --git a/runtime/crab/src/pallets/staking.rs b/runtime/crab/src/pallets/staking.rs index 8b77d7e00..87568aca1 100644 --- a/runtime/crab/src/pallets/staking.rs +++ b/runtime/crab/src/pallets/staking.rs @@ -70,44 +70,18 @@ impl darwinia_staking::Stake for KtonStaking { } } -pub enum OnCrabSessionEnd {} -impl darwinia_staking::IssuingManager for OnCrabSessionEnd { - fn calculate_reward(_inflation: Balance) -> Balance { - 20_000 * UNIT - } - - fn reward(who: &AccountId, amount: Balance) -> sp_runtime::DispatchResult { - >::transfer( - &Treasury::account_id(), - who, - amount, - frame_support::traits::ExistenceRequirement::KeepAlive, - ) - } -} - -pub enum ShouldEndSession {} -impl frame_support::traits::Get for ShouldEndSession { - fn get() -> bool { - // polkadot-sdk - use pallet_session::ShouldEndSession; - - ::ShouldEndSession::should_end_session( - System::block_number(), - ) - } -} - impl darwinia_staking::Config for Runtime { type Currency = Balances; type Deposit = Deposit; - type IssuingManager = OnCrabSessionEnd; - type Kton = KtonStaking; - type KtonStakerNotifier = darwinia_staking::KtonStakerNotifier; + type IssuingManager = darwinia_staking::TreasuryIssuing; + type KtonStaking = darwinia_staking::KtonStaking; type MaxDeposits = ::MaxDeposits; type Ring = RingStaking; + type RingStaking = darwinia_staking::RingStaking; type RuntimeEvent = RuntimeEvent; - type ShouldEndSession = ShouldEndSession; + type ShouldEndSession = darwinia_staking::ShouldEndSession; + type Treasury = pallet_config::TreasuryAccount; + type UnixTime = Timestamp; type WeightInfo = weights::darwinia_staking::WeightInfo; } #[cfg(not(feature = "runtime-benchmarks"))] diff --git a/runtime/crab/src/weights/cumulus_pallet_parachain_system.rs b/runtime/crab/src/weights/cumulus_pallet_parachain_system.rs index bd50a06fb..b7291e855 100644 --- a/runtime/crab/src/weights/cumulus_pallet_parachain_system.rs +++ b/runtime/crab/src/weights/cumulus_pallet_parachain_system.rs @@ -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-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -71,10 +71,10 @@ impl cumulus_pallet_parachain_system::WeightInfo for We // Measured: `48` // Estimated: `3517` // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + Weight::from_parts(3_000_000, 0) .saturating_add(Weight::from_parts(0, 3517)) - // Standard Error: 25_931 - .saturating_add(Weight::from_parts(93_644_619, 0).saturating_mul(n.into())) + // Standard Error: 59_482 + .saturating_add(Weight::from_parts(104_042_533, 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()))) diff --git a/runtime/crab/src/weights/cumulus_pallet_xcmp_queue.rs b/runtime/crab/src/weights/cumulus_pallet_xcmp_queue.rs index 4da21d6d7..32cf82370 100644 --- a/runtime/crab/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/runtime/crab/src/weights/cumulus_pallet_xcmp_queue.rs @@ -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-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -82,7 +82,7 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Measured: `48` // Estimated: `3517` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(11_000_000, 0) + Weight::from_parts(13_000_000, 0) .saturating_add(Weight::from_parts(0, 3517)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -93,8 +93,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `42` // Estimated: `1527` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 2_000_000 picoseconds. + 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)) @@ -106,7 +106,7 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Measured: `77` // Estimated: `1562` // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + Weight::from_parts(5_000_000, 0) .saturating_add(Weight::from_parts(0, 1562)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -137,8 +137,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `65677` // Estimated: `69142` - // Minimum execution time: 42_000_000 picoseconds. - Weight::from_parts(45_000_000, 0) + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(49_000_000, 0) .saturating_add(Weight::from_parts(0, 69142)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) @@ -151,8 +151,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `65676` // Estimated: `69141` - // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(32_000_000, 0) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(31_000_000, 0) .saturating_add(Weight::from_parts(0, 69141)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtime/crab/src/weights/darwinia_account_migration.rs b/runtime/crab/src/weights/darwinia_account_migration.rs index b02563407..944bc8df1 100644 --- a/runtime/crab/src/weights/darwinia_account_migration.rs +++ b/runtime/crab/src/weights/darwinia_account_migration.rs @@ -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-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -61,27 +61,19 @@ impl 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(1845), added: 4320, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:2 w:3) + /// Storage: `System::Account` (r:0 w:1) /// 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: `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: `28401` - // Estimated: `31866` - // Minimum execution time: 116_000_000 picoseconds. - Weight::from_parts(121_000_000, 0) - .saturating_add(Weight::from_parts(0, 31866)) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(11)) + // Measured: `591` + // Estimated: `3631` + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(27_000_000, 0) + .saturating_add(Weight::from_parts(0, 3631)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `AccountMigration::Multisigs` (r:0 w:1) /// Proof: `AccountMigration::Multisigs` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -91,34 +83,25 @@ impl 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(1845), added: 4320, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:2 w:3) + /// Storage: `System::Account` (r:0 w:1) /// 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: `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`) /// The range of component `x` is `[0, 99]`. /// The range of component `y` is `[0, 99]`. /// The range of component `z` is `[0, 99]`. fn migrate_multisig(x: u32, _y: u32, z: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` - // Estimated: `2 + x * (161 ±0) + z * (161 ±0)` - // Minimum execution time: 6_000_000 picoseconds. - Weight::from_parts(18_311_896, 0) - .saturating_add(Weight::from_parts(0, 2)) - // Standard Error: 9_962 - .saturating_add(Weight::from_parts(19_788, 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, 161).saturating_mul(x.into())) - .saturating_add(Weight::from_parts(0, 161).saturating_mul(z.into())) + // Estimated: `0 + x * (18 ±0) + z * (18 ±0)` + // Minimum execution time: 7_000_000 picoseconds. + Weight::from_parts(10_423_814, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 2_489 + .saturating_add(Weight::from_parts(36_894, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 18).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 18).saturating_mul(z.into())) } /// Storage: `AccountMigration::Multisigs` (r:1 w:1) /// Proof: `AccountMigration::Multisigs` (`max_values`: None, `max_size`: None, mode: `Measured`) diff --git a/runtime/crab/src/weights/darwinia_deposit.rs b/runtime/crab/src/weights/darwinia_deposit.rs index 5d62a886b..199eb5453 100644 --- a/runtime/crab/src/weights/darwinia_deposit.rs +++ b/runtime/crab/src/weights/darwinia_deposit.rs @@ -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-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -69,8 +69,8 @@ impl darwinia_deposit::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `26712` // Estimated: `29615` - // Minimum execution time: 76_000_000 picoseconds. - Weight::from_parts(83_000_000, 0) + // Minimum execution time: 89_000_000 picoseconds. + Weight::from_parts(98_000_000, 0) .saturating_add(Weight::from_parts(0, 29615)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -85,8 +85,8 @@ impl darwinia_deposit::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `26441` // Estimated: `29615` - // Minimum execution time: 928_000_000 picoseconds. - Weight::from_parts(962_000_000, 0) + // Minimum execution time: 66_000_000 picoseconds. + Weight::from_parts(80_000_000, 0) .saturating_add(Weight::from_parts(0, 29615)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -105,10 +105,47 @@ impl darwinia_deposit::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `26763` // Estimated: `29615` - // Minimum execution time: 84_000_000 picoseconds. - Weight::from_parts(91_000_000, 0) + // Minimum execution time: 91_000_000 picoseconds. + Weight::from_parts(110_000_000, 0) .saturating_add(Weight::from_parts(0, 29615)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } + /// Storage: `Deposit::Deposits` (r:1 w:1) + /// Proof: `Deposit::Deposits` (`max_values`: None, `max_size`: Some(26150), added: 28625, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:3 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`) + /// Storage: `Deposit::DepositContract` (r:1 w:0) + /// Proof: `Deposit::DepositContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + /// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0) + /// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `EVM::AccountCodes` (r:2 w:0) + /// Proof: `EVM::AccountCodes` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Digest` (r:1 w:0) + /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Ethereum::Pending` (r:1 w:1) + /// Proof: `Ethereum::Pending` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn migrate() -> Weight { + // Proof Size summary in bytes: + // Measured: `27325` + // Estimated: `33265` + // Minimum execution time: 3_914_000_000 picoseconds. + Weight::from_parts(4_387_000_000, 0) + .saturating_add(Weight::from_parts(0, 33265)) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `Deposit::DepositContract` (r:0 w:1) + /// Proof: `Deposit::DepositContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + fn set_deposit_contract() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } } diff --git a/runtime/crab/src/weights/darwinia_staking.rs b/runtime/crab/src/weights/darwinia_staking.rs index d527f93f6..ab85d14e4 100644 --- a/runtime/crab/src/weights/darwinia_staking.rs +++ b/runtime/crab/src/weights/darwinia_staking.rs @@ -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-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -71,10 +71,10 @@ impl darwinia_staking::WeightInfo for WeightInfo { // Measured: `7021 + x * (25 ±0)` // Estimated: `29615` // Minimum execution time: 47_000_000 picoseconds. - Weight::from_parts(672_333_775, 0) + Weight::from_parts(673_923_539, 0) .saturating_add(Weight::from_parts(0, 29615)) - // Standard Error: 237_459 - .saturating_add(Weight::from_parts(11_911_464, 0).saturating_mul(x.into())) + // Standard Error: 255_028 + .saturating_add(Weight::from_parts(13_024_071, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -93,11 +93,11 @@ impl darwinia_staking::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `7348 + x * (26 ±0)` // Estimated: `29615` - // Minimum execution time: 48_000_000 picoseconds. - Weight::from_parts(641_792_186, 0) + // Minimum execution time: 55_000_000 picoseconds. + Weight::from_parts(691_873_667, 0) .saturating_add(Weight::from_parts(0, 29615)) - // Standard Error: 237_475 - .saturating_add(Weight::from_parts(12_048_394, 0).saturating_mul(x.into())) + // Standard Error: 257_398 + .saturating_add(Weight::from_parts(13_012_274, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -107,8 +107,8 @@ impl darwinia_staking::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `388` // Estimated: `3497` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 0) .saturating_add(Weight::from_parts(0, 3497)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,10 +121,10 @@ impl darwinia_staking::WeightInfo for WeightInfo { /// Proof: `DarwiniaStaking::Nominators` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) fn nominate() -> Weight { // Proof Size summary in bytes: - // Measured: `574` + // Measured: `600` // Estimated: `4543` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(0, 4543)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -137,8 +137,8 @@ impl darwinia_staking::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(5_000_000, 0) + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(6_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -154,8 +154,8 @@ impl darwinia_staking::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1811` // Estimated: `5276` - // Minimum execution time: 133_000_000 picoseconds. - Weight::from_parts(136_000_000, 0) + // Minimum execution time: 141_000_000 picoseconds. + Weight::from_parts(169_000_000, 0) .saturating_add(Weight::from_parts(0, 5276)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -167,18 +167,28 @@ impl darwinia_staking::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `0` // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + Weight::from_parts(3_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: `DarwiniaStaking::KtonRewardDistributionContract` (r:0 w:1) - /// Proof: `DarwiniaStaking::KtonRewardDistributionContract` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - fn set_kton_reward_distribution_contract() -> Weight { + /// Storage: `DarwiniaStaking::RingStakingContract` (r:0 w:1) + /// Proof: `DarwiniaStaking::RingStakingContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + fn set_ring_staking_contract() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + Weight::from_parts(3_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } /// Storage: `DarwiniaStaking::KtonStakingContract` (r:0 w:1) + /// Proof: `DarwiniaStaking::KtonStakingContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + fn set_kton_staking_contract() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/crab/src/weights/frame_system.rs b/runtime/crab/src/weights/frame_system.rs index 18d8a534e..c3b3b0ac0 100644 --- a/runtime/crab/src/weights/frame_system.rs +++ b/runtime/crab/src/weights/frame_system.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `frame_system` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -61,21 +61,21 @@ impl frame_system::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `0` // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(1_839_585, 0) + Weight::from_parts(4_970_413, 0) .saturating_add(Weight::from_parts(0, 0)) // Standard Error: 0 - .saturating_add(Weight::from_parts(145, 0).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(156, 0).saturating_mul(b.into())) } /// The range of component `b` is `[0, 3932160]`. fn remark_with_event(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(6_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 0 - .saturating_add(Weight::from_parts(895, 0).saturating_mul(b.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_000, 0).saturating_mul(b.into())) } /// Storage: `System::Digest` (r:1 w:1) /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -86,7 +86,7 @@ impl frame_system::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `1485` // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + Weight::from_parts(4_000_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -107,8 +107,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `164` // Estimated: `1649` - // Minimum execution time: 59_823_000_000 picoseconds. - Weight::from_parts(60_726_000_000, 0) + // Minimum execution time: 69_455_000_000 picoseconds. + Weight::from_parts(74_530_000_000, 0) .saturating_add(Weight::from_parts(0, 1649)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -120,11 +120,11 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. + // Minimum execution time: 2_000_000 picoseconds. Weight::from_parts(2_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 2_060 - .saturating_add(Weight::from_parts(721_127, 0).saturating_mul(i.into())) + // Standard Error: 2_908 + .saturating_add(Weight::from_parts(800_499, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -134,11 +134,11 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. + // Minimum execution time: 2_000_000 picoseconds. Weight::from_parts(2_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 822 - .saturating_add(Weight::from_parts(510_498, 0).saturating_mul(i.into())) + // Standard Error: 1_502 + .saturating_add(Weight::from_parts(558_522, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -148,11 +148,11 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `97 + p * (69 ±0)` // Estimated: `100 + p * (70 ±0)` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 4_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(Weight::from_parts(0, 100)) - // Standard Error: 809 - .saturating_add(Weight::from_parts(938_486, 0).saturating_mul(p.into())) + // Standard Error: 3_203 + .saturating_add(Weight::from_parts(1_046_988, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) .saturating_add(Weight::from_parts(0, 70).saturating_mul(p.into())) @@ -163,8 +163,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 0) + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(7_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -186,8 +186,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `186` // Estimated: `1671` - // Minimum execution time: 62_898_000_000 picoseconds. - Weight::from_parts(63_339_000_000, 0) + // Minimum execution time: 75_039_000_000 picoseconds. + Weight::from_parts(79_857_000_000, 0) .saturating_add(Weight::from_parts(0, 1671)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtime/crab/src/weights/pallet_assets.rs b/runtime/crab/src/weights/pallet_assets.rs index 58f674ac3..8c55b3e3d 100644 --- a/runtime/crab/src/weights/pallet_assets.rs +++ b/runtime/crab/src/weights/pallet_assets.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_assets` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -62,7 +62,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `157` // Estimated: `3631` // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + Weight::from_parts(10_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -105,8 +105,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Minimum execution time: 13_000_000 picoseconds. Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) - // Standard Error: 8_479 - .saturating_add(Weight::from_parts(10_170_840, 0).saturating_mul(c.into())) + // Standard Error: 18_699 + .saturating_add(Weight::from_parts(11_439_479, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -122,11 +122,11 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `458 + a * (74 ±0)` // Estimated: `3631 + a * (2603 ±0)` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(80_268_905, 0) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) - // Standard Error: 16_839 - .saturating_add(Weight::from_parts(3_729_918, 0).saturating_mul(a.into())) + // Standard Error: 10_481 + .saturating_add(Weight::from_parts(4_273_951, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -142,7 +142,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `350` // Estimated: `3631` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) + Weight::from_parts(15_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -155,8 +155,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `350` // Estimated: `3631` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_000_000, 0) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(23_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -169,8 +169,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `410` // Estimated: `3631` - // Minimum execution time: 25_000_000 picoseconds. - Weight::from_parts(25_000_000, 0) + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(33_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -185,8 +185,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `501` // Estimated: `6168` - // Minimum execution time: 34_000_000 picoseconds. - Weight::from_parts(36_000_000, 0) + // Minimum execution time: 37_000_000 picoseconds. + Weight::from_parts(44_000_000, 0) .saturating_add(Weight::from_parts(0, 6168)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -201,8 +201,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `501` // Estimated: `6168` - // Minimum execution time: 31_000_000 picoseconds. - Weight::from_parts(31_000_000, 0) + // Minimum execution time: 32_000_000 picoseconds. + Weight::from_parts(33_000_000, 0) .saturating_add(Weight::from_parts(0, 6168)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -217,8 +217,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `501` // Estimated: `6168` - // Minimum execution time: 35_000_000 picoseconds. - Weight::from_parts(36_000_000, 0) + // Minimum execution time: 36_000_000 picoseconds. + Weight::from_parts(38_000_000, 0) .saturating_add(Weight::from_parts(0, 6168)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -231,8 +231,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `410` // Estimated: `3631` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 0) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -246,7 +246,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `410` // Estimated: `3631` // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 0) + Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -258,7 +258,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `307` // Estimated: `3631` // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + Weight::from_parts(10_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -270,7 +270,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `307` // Estimated: `3631` // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + Weight::from_parts(10_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -283,8 +283,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `350` // Estimated: `3631` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(13_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -295,7 +295,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `307` // Estimated: `3631` - // Minimum execution time: 9_000_000 picoseconds. + // Minimum execution time: 10_000_000 picoseconds. Weight::from_parts(10_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(1)) @@ -312,12 +312,12 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `350` // Estimated: `3631` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(11_711_844, 0) + Weight::from_parts(12_861_969, 0) .saturating_add(Weight::from_parts(0, 3631)) - // Standard Error: 1_106 - .saturating_add(Weight::from_parts(306, 0).saturating_mul(n.into())) - // Standard Error: 1_106 - .saturating_add(Weight::from_parts(3_079, 0).saturating_mul(s.into())) + // Standard Error: 3_361 + .saturating_add(Weight::from_parts(2_967, 0).saturating_mul(n.into())) + // Standard Error: 3_361 + .saturating_add(Weight::from_parts(1_998, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -330,7 +330,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `478` // Estimated: `3631` // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) + Weight::from_parts(13_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -341,13 +341,15 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(144), added: 2619, mode: `MaxEncodedLen`) /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn force_set_metadata(_n: u32, _s: u32, ) -> Weight { + fn force_set_metadata(_n: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `237` // Estimated: `3631` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_234_739, 0) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(12_154_297, 0) .saturating_add(Weight::from_parts(0, 3631)) + // Standard Error: 2_748 + .saturating_add(Weight::from_parts(8_426, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -359,8 +361,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `478` // Estimated: `3631` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -371,7 +373,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `307` // Estimated: `3631` - // Minimum execution time: 9_000_000 picoseconds. + // Minimum execution time: 10_000_000 picoseconds. Weight::from_parts(10_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(1)) @@ -385,8 +387,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `307` // Estimated: `3631` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(14_000_000, 0) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -403,8 +405,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `599` // Estimated: `6168` - // Minimum execution time: 41_000_000 picoseconds. - Weight::from_parts(42_000_000, 0) + // Minimum execution time: 44_000_000 picoseconds. + Weight::from_parts(51_000_000, 0) .saturating_add(Weight::from_parts(0, 6168)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) @@ -417,8 +419,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `457` // Estimated: `3631` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 0) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(20_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -431,8 +433,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `457` // Estimated: `3631` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 0) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(19_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -489,8 +491,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `556` // Estimated: `3631` - // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(28_000_000, 0) + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(36_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -504,7 +506,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `448` // Estimated: `3631` // Minimum execution time: 25_000_000 picoseconds. - Weight::from_parts(26_000_000, 0) + Weight::from_parts(27_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtime/crab/src/weights/pallet_balances.rs b/runtime/crab/src/weights/pallet_balances.rs index 26ca547d4..8be80ee34 100644 --- a/runtime/crab/src/weights/pallet_balances.rs +++ b/runtime/crab/src/weights/pallet_balances.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_balances` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -62,7 +62,7 @@ impl pallet_balances::WeightInfo for WeightInfo { // Measured: `39` // Estimated: `3581` // Minimum execution time: 43_000_000 picoseconds. - Weight::from_parts(44_000_000, 0) + Weight::from_parts(45_000_000, 0) .saturating_add(Weight::from_parts(0, 3581)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -73,8 +73,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `39` // Estimated: `3581` - // Minimum execution time: 36_000_000 picoseconds. - Weight::from_parts(38_000_000, 0) + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(46_000_000, 0) .saturating_add(Weight::from_parts(0, 3581)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -85,8 +85,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `162` // Estimated: `3581` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(14_000_000, 0) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 3581)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -98,7 +98,7 @@ impl pallet_balances::WeightInfo for WeightInfo { // Measured: `162` // Estimated: `3581` // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_000_000, 0) + Weight::from_parts(23_000_000, 0) .saturating_add(Weight::from_parts(0, 3581)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,8 +109,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `201` // Estimated: `6172` - // Minimum execution time: 45_000_000 picoseconds. - Weight::from_parts(46_000_000, 0) + // Minimum execution time: 48_000_000 picoseconds. + Weight::from_parts(54_000_000, 0) .saturating_add(Weight::from_parts(0, 6172)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -122,7 +122,7 @@ impl pallet_balances::WeightInfo for WeightInfo { // Measured: `39` // Estimated: `3581` // Minimum execution time: 46_000_000 picoseconds. - Weight::from_parts(47_000_000, 0) + Weight::from_parts(48_000_000, 0) .saturating_add(Weight::from_parts(0, 3581)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -133,8 +133,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `162` // Estimated: `3581` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) .saturating_add(Weight::from_parts(0, 3581)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -146,11 +146,11 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `91 + u * (124 ±0)` // Estimated: `990 + u * (2591 ±0)` - // Minimum execution time: 15_000_000 picoseconds. + // Minimum execution time: 16_000_000 picoseconds. Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 12_953 - .saturating_add(Weight::from_parts(12_353_948, 0).saturating_mul(u.into())) + // Standard Error: 22_072 + .saturating_add(Weight::from_parts(13_949_592, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2591).saturating_mul(u.into())) diff --git a/runtime/crab/src/weights/pallet_collective.rs b/runtime/crab/src/weights/pallet_collective.rs index 1f54955c9..7f2cbee6b 100644 --- a/runtime/crab/src/weights/pallet_collective.rs +++ b/runtime/crab/src/weights/pallet_collective.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -71,12 +71,12 @@ impl pallet_collective::WeightInfo for WeightInfo { // Measured: `0 + m * (2021 ±0) + p * (2026 ±0)` // Estimated: `12200 + m * (1231 ±14) + p * (3660 ±14)` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(11_000_000, 0) + Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(0, 12200)) - // Standard Error: 43_919 - .saturating_add(Weight::from_parts(2_400_988, 0).saturating_mul(m.into())) - // Standard Error: 43_919 - .saturating_add(Weight::from_parts(5_149_399, 0).saturating_mul(p.into())) + // Standard Error: 45_518 + .saturating_add(Weight::from_parts(2_595_649, 0).saturating_mul(m.into())) + // Standard Error: 45_518 + .saturating_add(Weight::from_parts(5_807_718, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -95,12 +95,12 @@ impl pallet_collective::WeightInfo for WeightInfo { // Measured: `73 + m * (20 ±0)` // Estimated: `3997 + m * (20 ±0)` // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(13_154_191, 0) + Weight::from_parts(12_540_883, 0) .saturating_add(Weight::from_parts(0, 3997)) - // Standard Error: 38 - .saturating_add(Weight::from_parts(767, 0).saturating_mul(b.into())) - // Standard Error: 394 - .saturating_add(Weight::from_parts(3_491, 0).saturating_mul(m.into())) + // Standard Error: 184 + .saturating_add(Weight::from_parts(1_851, 0).saturating_mul(b.into())) + // Standard Error: 1_900 + .saturating_add(Weight::from_parts(24_908, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(Weight::from_parts(0, 20).saturating_mul(m.into())) } @@ -117,12 +117,12 @@ impl pallet_collective::WeightInfo for WeightInfo { // Measured: `73 + m * (20 ±0)` // Estimated: `3997 + m * (20 ±0)` // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(14_546_634, 0) + Weight::from_parts(16_238_739, 0) .saturating_add(Weight::from_parts(0, 3997)) - // Standard Error: 40 - .saturating_add(Weight::from_parts(1_165, 0).saturating_mul(b.into())) - // Standard Error: 413 - .saturating_add(Weight::from_parts(6_158, 0).saturating_mul(m.into())) + // Standard Error: 196 + .saturating_add(Weight::from_parts(922, 0).saturating_mul(b.into())) + // Standard Error: 2_030 + .saturating_add(Weight::from_parts(9_101, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(Weight::from_parts(0, 20).saturating_mul(m.into())) } @@ -143,15 +143,13 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `357 + m * (20 ±0) + p * (36 ±0)` // Estimated: `3751 + m * (21 ±0) + p * (36 ±0)` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_790_958, 0) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(22_299_777, 0) .saturating_add(Weight::from_parts(0, 3751)) - // Standard Error: 56 - .saturating_add(Weight::from_parts(754, 0).saturating_mul(b.into())) - // Standard Error: 592 - .saturating_add(Weight::from_parts(7_595, 0).saturating_mul(m.into())) - // Standard Error: 585 - .saturating_add(Weight::from_parts(111_810, 0).saturating_mul(p.into())) + // Standard Error: 291 + .saturating_add(Weight::from_parts(507, 0).saturating_mul(b.into())) + // Standard Error: 2_998 + .saturating_add(Weight::from_parts(130_068, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(Weight::from_parts(0, 21).saturating_mul(m.into())) @@ -167,10 +165,10 @@ impl pallet_collective::WeightInfo for WeightInfo { // Measured: `832 + m * (40 ±0)` // Estimated: `4296 + m * (40 ±0)` // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(14_670_830, 0) + Weight::from_parts(17_457_013, 0) .saturating_add(Weight::from_parts(0, 4296)) - // Standard Error: 803 - .saturating_add(Weight::from_parts(6_942, 0).saturating_mul(m.into())) + // Standard Error: 3_368 + .saturating_add(Weight::from_parts(25_662, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 40).saturating_mul(m.into())) @@ -190,10 +188,12 @@ impl pallet_collective::WeightInfo for WeightInfo { // Measured: `409 + m * (40 ±0) + p * (36 ±0)` // Estimated: `3854 + m * (41 ±0) + p * (36 ±0)` // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(18_802_178, 0) + Weight::from_parts(20_865_732, 0) .saturating_add(Weight::from_parts(0, 3854)) - // Standard Error: 587 - .saturating_add(Weight::from_parts(112_449, 0).saturating_mul(p.into())) + // Standard Error: 3_715 + .saturating_add(Weight::from_parts(11_192, 0).saturating_mul(m.into())) + // Standard Error: 3_623 + .saturating_add(Weight::from_parts(136_799, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 41).saturating_mul(m.into())) @@ -216,13 +216,11 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `715 + b * (1 ±0) + m * (40 ±0) + p * (40 ±0)` // Estimated: `4032 + b * (1 ±0) + m * (42 ±0) + p * (40 ±0)` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(29_779_778, 0) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(36_446_790, 0) .saturating_add(Weight::from_parts(0, 4032)) - // Standard Error: 104 - .saturating_add(Weight::from_parts(789, 0).saturating_mul(b.into())) - // Standard Error: 1_073 - .saturating_add(Weight::from_parts(128_305, 0).saturating_mul(p.into())) + // Standard Error: 5_509 + .saturating_add(Weight::from_parts(182_123, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -245,11 +243,11 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `429 + m * (40 ±0) + p * (36 ±0)` // Estimated: `3874 + m * (41 ±0) + p * (36 ±0)` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(20_815_416, 0) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(25_330_921, 0) .saturating_add(Weight::from_parts(0, 3874)) - // Standard Error: 689 - .saturating_add(Weight::from_parts(113_104, 0).saturating_mul(p.into())) + // Standard Error: 4_098 + .saturating_add(Weight::from_parts(120_401, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 41).saturating_mul(m.into())) @@ -274,13 +272,15 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `735 + b * (1 ±0) + m * (40 ±0) + p * (40 ±0)` // Estimated: `4052 + b * (1 ±0) + m * (42 ±0) + p * (40 ±0)` - // Minimum execution time: 30_000_000 picoseconds. - Weight::from_parts(32_855_426, 0) + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(31_661_426, 0) .saturating_add(Weight::from_parts(0, 4052)) - // Standard Error: 1_179 - .saturating_add(Weight::from_parts(1_316, 0).saturating_mul(m.into())) - // Standard Error: 1_150 - .saturating_add(Weight::from_parts(126_969, 0).saturating_mul(p.into())) + // Standard Error: 570 + .saturating_add(Weight::from_parts(3_701, 0).saturating_mul(b.into())) + // Standard Error: 6_032 + .saturating_add(Weight::from_parts(21_727, 0).saturating_mul(m.into())) + // Standard Error: 5_880 + .saturating_add(Weight::from_parts(196_199, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -298,11 +298,11 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `226 + p * (32 ±0)` // Estimated: `1711 + p * (32 ±0)` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(11_369_868, 0) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(13_462_960, 0) .saturating_add(Weight::from_parts(0, 1711)) - // Standard Error: 556 - .saturating_add(Weight::from_parts(102_481, 0).saturating_mul(p.into())) + // Standard Error: 2_892 + .saturating_add(Weight::from_parts(121_652, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) diff --git a/runtime/crab/src/weights/pallet_conviction_voting.rs b/runtime/crab/src/weights/pallet_conviction_voting.rs index 454b22dcf..357351a7e 100644 --- a/runtime/crab/src/weights/pallet_conviction_voting.rs +++ b/runtime/crab/src/weights/pallet_conviction_voting.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_conviction_voting` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -71,8 +71,8 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `13458` // Estimated: `42428` - // Minimum execution time: 78_000_000 picoseconds. - Weight::from_parts(81_000_000, 0) + // Minimum execution time: 88_000_000 picoseconds. + Weight::from_parts(109_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) @@ -93,8 +93,8 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `14179` // Estimated: `83866` - // Minimum execution time: 113_000_000 picoseconds. - Weight::from_parts(117_000_000, 0) + // Minimum execution time: 131_000_000 picoseconds. + Weight::from_parts(145_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(6)) @@ -109,8 +109,8 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `13928` // Estimated: `83866` - // Minimum execution time: 86_000_000 picoseconds. - Weight::from_parts(88_000_000, 0) + // Minimum execution time: 103_000_000 picoseconds. + Weight::from_parts(119_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -123,8 +123,8 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `13052` // Estimated: `30694` - // Minimum execution time: 40_000_000 picoseconds. - Weight::from_parts(46_000_000, 0) + // Minimum execution time: 47_000_000 picoseconds. + Weight::from_parts(60_000_000, 0) .saturating_add(Weight::from_parts(0, 30694)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -146,11 +146,11 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `7020 + r * (447 ±0)` // Estimated: `83866 + r * (3387 ±0)` - // Minimum execution time: 40_000_000 picoseconds. - Weight::from_parts(127_759_577, 0) + // Minimum execution time: 50_000_000 picoseconds. + Weight::from_parts(91_282_789, 0) .saturating_add(Weight::from_parts(0, 83866)) - // Standard Error: 247_296 - .saturating_add(Weight::from_parts(31_633_691, 0).saturating_mul(r.into())) + // Standard Error: 346_446 + .saturating_add(Weight::from_parts(37_516_946, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(6)) @@ -168,11 +168,11 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `6876 + r * (447 ±0)` // Estimated: `83866 + r * (3387 ±0)` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(153_324_605, 0) + // Minimum execution time: 25_000_000 picoseconds. + Weight::from_parts(55_128_879, 0) .saturating_add(Weight::from_parts(0, 83866)) - // Standard Error: 263_649 - .saturating_add(Weight::from_parts(30_778_339, 0).saturating_mul(r.into())) + // Standard Error: 314_940 + .saturating_add(Weight::from_parts(37_330_071, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(4)) @@ -191,8 +191,8 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `12038` // Estimated: `30694` - // Minimum execution time: 64_000_000 picoseconds. - Weight::from_parts(67_000_000, 0) + // Minimum execution time: 71_000_000 picoseconds. + Weight::from_parts(82_000_000, 0) .saturating_add(Weight::from_parts(0, 30694)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) diff --git a/runtime/crab/src/weights/pallet_message_queue.rs b/runtime/crab/src/weights/pallet_message_queue.rs index 5f45a3634..bec801e1a 100644 --- a/runtime/crab/src/weights/pallet_message_queue.rs +++ b/runtime/crab/src/weights/pallet_message_queue.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_message_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -78,7 +78,7 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Measured: `218` // Estimated: `6044` // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + Weight::from_parts(10_000_000, 0) .saturating_add(Weight::from_parts(0, 6044)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -101,8 +101,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `72` // Estimated: `69050` - // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 0) + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(7_000_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -128,7 +128,7 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Measured: `0` // Estimated: `0` // Minimum execution time: 79_000_000 picoseconds. - Weight::from_parts(80_000_000, 0) + Weight::from_parts(92_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -154,8 +154,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `65667` // Estimated: `69050` - // Minimum execution time: 36_000_000 picoseconds. - Weight::from_parts(38_000_000, 0) + // Minimum execution time: 38_000_000 picoseconds. + Weight::from_parts(43_000_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -168,8 +168,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `65667` // Estimated: `69050` - // Minimum execution time: 44_000_000 picoseconds. - Weight::from_parts(46_000_000, 0) + // Minimum execution time: 46_000_000 picoseconds. + Weight::from_parts(54_000_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -183,7 +183,7 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Measured: `65667` // Estimated: `69050` // Minimum execution time: 48_000_000 picoseconds. - Weight::from_parts(50_000_000, 0) + Weight::from_parts(59_000_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtime/crab/src/weights/pallet_preimage.rs b/runtime/crab/src/weights/pallet_preimage.rs index da8869f11..170dae6cc 100644 --- a/runtime/crab/src/weights/pallet_preimage.rs +++ b/runtime/crab/src/weights/pallet_preimage.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -68,11 +68,11 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3544` - // Minimum execution time: 44_000_000 picoseconds. - Weight::from_parts(45_000_000, 0) + // Minimum execution time: 47_000_000 picoseconds. + Weight::from_parts(50_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) - // Standard Error: 1 - .saturating_add(Weight::from_parts(1_007, 0).saturating_mul(s.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_118, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -90,8 +90,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Minimum execution time: 12_000_000 picoseconds. Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) - // Standard Error: 1 - .saturating_add(Weight::from_parts(1_003, 0).saturating_mul(s.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_120, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -106,11 +106,11 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3544` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) - // Standard Error: 1 - .saturating_add(Weight::from_parts(1_034, 0).saturating_mul(s.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(1_126, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -126,8 +126,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `219` // Estimated: `3544` - // Minimum execution time: 40_000_000 picoseconds. - Weight::from_parts(41_000_000, 0) + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(52_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -142,8 +142,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3544` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_000_000, 0) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(30_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -156,8 +156,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `176` // Estimated: `3544` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(22_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -170,8 +170,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3544` - // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -184,8 +184,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3544` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -199,7 +199,7 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Measured: `106` // Estimated: `3544` // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(8_000_000, 0) + Weight::from_parts(10_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -214,8 +214,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3544` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(23_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -229,7 +229,7 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Measured: `106` // Estimated: `3544` // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(8_000_000, 0) + Weight::from_parts(10_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -242,8 +242,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3544` - // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(8_000_000, 0) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(11_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -261,11 +261,11 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `181 + n * (203 ±0)` // Estimated: `990 + n * (2591 ±0)` - // Minimum execution time: 52_000_000 picoseconds. - Weight::from_parts(53_000_000, 0) + // Minimum execution time: 55_000_000 picoseconds. + Weight::from_parts(58_000_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 22_653 - .saturating_add(Weight::from_parts(50_300_431, 0).saturating_mul(n.into())) + // Standard Error: 47_893 + .saturating_add(Weight::from_parts(57_129_527, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(n.into()))) .saturating_add(Weight::from_parts(0, 2591).saturating_mul(n.into())) diff --git a/runtime/crab/src/weights/pallet_proxy.rs b/runtime/crab/src/weights/pallet_proxy.rs index 36bf65747..d99a916e8 100644 --- a/runtime/crab/src/weights/pallet_proxy.rs +++ b/runtime/crab/src/weights/pallet_proxy.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_proxy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -65,10 +65,10 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Measured: `153 + p * (25 ±0)` // Estimated: `4310` // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_135_940, 0) + Weight::from_parts(13_868_651, 0) .saturating_add(Weight::from_parts(0, 4310)) - // Standard Error: 1_839 - .saturating_add(Weight::from_parts(1_292, 0).saturating_mul(p.into())) + // Standard Error: 6_453 + .saturating_add(Weight::from_parts(55_112, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) } /// Storage: `Proxy::Proxies` (r:1 w:0) @@ -85,13 +85,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `405 + a * (56 ±0) + p * (25 ±0)` // Estimated: `5302` - // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(29_778_618, 0) + // Minimum execution time: 30_000_000 picoseconds. + Weight::from_parts(34_034_765, 0) .saturating_add(Weight::from_parts(0, 5302)) - // Standard Error: 2_462 - .saturating_add(Weight::from_parts(121_996, 0).saturating_mul(a.into())) - // Standard Error: 2_544 - .saturating_add(Weight::from_parts(13_681, 0).saturating_mul(p.into())) + // Standard Error: 11_517 + .saturating_add(Weight::from_parts(130_688, 0).saturating_mul(a.into())) + // Standard Error: 11_900 + .saturating_add(Weight::from_parts(26_788, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -101,15 +101,17 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. - fn remove_announcement(a: u32, _p: u32, ) -> Weight { + fn remove_announcement(a: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `329 + a * (56 ±0)` // Estimated: `5302` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_593_958, 0) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(20_696_926, 0) .saturating_add(Weight::from_parts(0, 5302)) - // Standard Error: 1_731 - .saturating_add(Weight::from_parts(93_827, 0).saturating_mul(a.into())) + // Standard Error: 6_889 + .saturating_add(Weight::from_parts(138_259, 0).saturating_mul(a.into())) + // Standard Error: 7_118 + .saturating_add(Weight::from_parts(23_118, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -123,11 +125,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `329 + a * (56 ±0)` // Estimated: `5302` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_112_704, 0) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(21_877_742, 0) .saturating_add(Weight::from_parts(0, 5302)) - // Standard Error: 1_910 - .saturating_add(Weight::from_parts(108_487, 0).saturating_mul(a.into())) + // Standard Error: 7_182 + .saturating_add(Weight::from_parts(138_873, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -144,12 +146,12 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Measured: `345 + a * (56 ±0) + p * (25 ±0)` // Estimated: `5302` // Minimum execution time: 25_000_000 picoseconds. - Weight::from_parts(24_595_286, 0) + Weight::from_parts(27_954_010, 0) .saturating_add(Weight::from_parts(0, 5302)) - // Standard Error: 2_019 - .saturating_add(Weight::from_parts(126_646, 0).saturating_mul(a.into())) - // Standard Error: 2_086 - .saturating_add(Weight::from_parts(24_659, 0).saturating_mul(p.into())) + // Standard Error: 8_644 + .saturating_add(Weight::from_parts(139_219, 0).saturating_mul(a.into())) + // Standard Error: 8_931 + .saturating_add(Weight::from_parts(13_609, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -161,10 +163,10 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Measured: `149 + p * (25 ±0)` // Estimated: `4310` // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_200_551, 0) + Weight::from_parts(21_897_500, 0) .saturating_add(Weight::from_parts(0, 4310)) - // Standard Error: 2_421 - .saturating_add(Weight::from_parts(14_139, 0).saturating_mul(p.into())) + // Standard Error: 8_123 + .saturating_add(Weight::from_parts(29_671, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -175,39 +177,39 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `149 + p * (25 ±0)` // Estimated: `4310` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_074_833, 0) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(22_418_603, 0) .saturating_add(Weight::from_parts(0, 4310)) - // Standard Error: 2_738 - .saturating_add(Weight::from_parts(17_987, 0).saturating_mul(p.into())) + // Standard Error: 7_503 + .saturating_add(Weight::from_parts(14_007, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Proxy::Proxies` (r:1 w:1) /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(845), added: 3320, mode: `MaxEncodedLen`) /// The range of component `p` is `[1, 31]`. - fn remove_proxies(p: u32, ) -> Weight { + fn remove_proxies(_p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `149 + p * (25 ±0)` // Estimated: `4310` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_694_090, 0) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(22_214_453, 0) .saturating_add(Weight::from_parts(0, 4310)) - // Standard Error: 3_886 - .saturating_add(Weight::from_parts(38_911, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Proxy::Proxies` (r:1 w:1) /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(845), added: 3320, mode: `MaxEncodedLen`) /// The range of component `p` is `[1, 31]`. - fn create_pure(_p: u32, ) -> Weight { + fn create_pure(p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `161` // Estimated: `4310` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(21_849_560, 0) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(22_971_370, 0) .saturating_add(Weight::from_parts(0, 4310)) + // Standard Error: 8_048 + .saturating_add(Weight::from_parts(25_556, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -219,10 +221,10 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Measured: `174 + p * (25 ±0)` // Estimated: `4310` // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(19_947_736, 0) + Weight::from_parts(22_291_424, 0) .saturating_add(Weight::from_parts(0, 4310)) - // Standard Error: 1_368 - .saturating_add(Weight::from_parts(5_527, 0).saturating_mul(p.into())) + // Standard Error: 7_580 + .saturating_add(Weight::from_parts(1_967, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/crab/src/weights/pallet_referenda.rs b/runtime/crab/src/weights/pallet_referenda.rs index fbf1154d0..07b3722cd 100644 --- a/runtime/crab/src/weights/pallet_referenda.rs +++ b/runtime/crab/src/weights/pallet_referenda.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_referenda` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -65,8 +65,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `275` // Estimated: `42428` - // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(29_000_000, 0) + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(41_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) @@ -79,8 +79,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `516` // Estimated: `83866` - // Minimum execution time: 37_000_000 picoseconds. - Weight::from_parts(37_000_000, 0) + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(45_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -95,10 +95,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) fn place_decision_deposit_queued() -> Weight { // Proof Size summary in bytes: - // Measured: `3276` + // Measured: `3309` // Estimated: `42428` - // Minimum execution time: 40_000_000 picoseconds. - Weight::from_parts(41_000_000, 0) + // Minimum execution time: 43_000_000 picoseconds. + Weight::from_parts(49_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -113,10 +113,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) fn place_decision_deposit_not_queued() -> Weight { // Proof Size summary in bytes: - // Measured: `3296` + // Measured: `3329` // Estimated: `42428` - // Minimum execution time: 40_000_000 picoseconds. - Weight::from_parts(41_000_000, 0) + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(51_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -131,8 +131,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `516` // Estimated: `83866` - // Minimum execution time: 43_000_000 picoseconds. - Weight::from_parts(45_000_000, 0) + // Minimum execution time: 46_000_000 picoseconds. + Weight::from_parts(53_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -147,8 +147,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `516` // Estimated: `83866` - // Minimum execution time: 42_000_000 picoseconds. - Weight::from_parts(43_000_000, 0) + // Minimum execution time: 44_000_000 picoseconds. + Weight::from_parts(45_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -159,8 +159,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `425` // Estimated: `4377` - // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(25_000_000, 0) + // Minimum execution time: 26_000_000 picoseconds. + Weight::from_parts(27_000_000, 0) .saturating_add(Weight::from_parts(0, 4377)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -171,8 +171,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `384` // Estimated: `4377` - // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(25_000_000, 0) + // Minimum execution time: 26_000_000 picoseconds. + Weight::from_parts(31_000_000, 0) .saturating_add(Weight::from_parts(0, 4377)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -185,8 +185,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `390` // Estimated: `83866` - // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(25_000_000, 0) + // Minimum execution time: 26_000_000 picoseconds. + Weight::from_parts(29_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -203,8 +203,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `846` // Estimated: `83866` - // Minimum execution time: 80_000_000 picoseconds. - Weight::from_parts(81_000_000, 0) + // Minimum execution time: 83_000_000 picoseconds. + Weight::from_parts(87_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -217,8 +217,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `207` // Estimated: `5477` - // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(8_000_000, 0) + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) .saturating_add(Weight::from_parts(0, 5477)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -231,10 +231,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) fn one_fewer_deciding_failing() -> Weight { // Proof Size summary in bytes: - // Measured: `3162` + // Measured: `3209` // Estimated: `42428` - // Minimum execution time: 25_000_000 picoseconds. - Weight::from_parts(26_000_000, 0) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(34_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -247,10 +247,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) fn one_fewer_deciding_passing() -> Weight { // Proof Size summary in bytes: - // Measured: `3162` + // Measured: `3195` // Estimated: `42428` - // Minimum execution time: 26_000_000 picoseconds. - Weight::from_parts(27_000_000, 0) + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(35_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -263,8 +263,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3020` // Estimated: `5477` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 0) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 5477)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -277,8 +277,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3020` // Estimated: `5477` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 0) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) .saturating_add(Weight::from_parts(0, 5477)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -293,8 +293,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3024` // Estimated: `5477` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) .saturating_add(Weight::from_parts(0, 5477)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -309,8 +309,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3044` // Estimated: `5477` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 0) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(21_000_000, 0) .saturating_add(Weight::from_parts(0, 5477)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -323,8 +323,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `354` // Estimated: `42428` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -337,8 +337,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `390` // Estimated: `42428` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -365,8 +365,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `390` // Estimated: `42428` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 0) + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(26_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -381,7 +381,7 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `390` // Estimated: `42428` - // Minimum execution time: 23_000_000 picoseconds. + // Minimum execution time: 24_000_000 picoseconds. Weight::from_parts(24_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(3)) @@ -395,8 +395,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `443` // Estimated: `42428` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_000_000, 0) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(25_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -409,8 +409,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `426` // Estimated: `42428` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_000_000, 0) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(20_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -423,8 +423,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `443` // Estimated: `42428` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(18_000_000, 0) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(19_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -437,8 +437,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `447` // Estimated: `42428` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 0) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(19_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -453,8 +453,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `447` // Estimated: `83866` - // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(27_000_000, 0) + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(34_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -467,8 +467,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `443` // Estimated: `42428` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(19_000_000, 0) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -485,8 +485,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `443` // Estimated: `4377` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(15_000_000, 0) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(20_000_000, 0) .saturating_add(Weight::from_parts(0, 4377)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtime/crab/src/weights/pallet_scheduler.rs b/runtime/crab/src/weights/pallet_scheduler.rs index b5a94f598..00e8f0842 100644 --- a/runtime/crab/src/weights/pallet_scheduler.rs +++ b/runtime/crab/src/weights/pallet_scheduler.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -74,11 +74,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `78 + s * (177 ±0)` // Estimated: `42428` - // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(5_467_868, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(6_061_103, 0) .saturating_add(Weight::from_parts(0, 42428)) - // Standard Error: 1_549 - .saturating_add(Weight::from_parts(358_732, 0).saturating_mul(s.into())) + // Standard Error: 3_856 + .saturating_add(Weight::from_parts(389_514, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -101,11 +101,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `179 + s * (1 ±0)` // Estimated: `3644 + s * (1 ±0)` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(15_000_000, 0) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) .saturating_add(Weight::from_parts(0, 3644)) - // Standard Error: 1 - .saturating_add(Weight::from_parts(423, 0).saturating_mul(s.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(486, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(s.into())) @@ -144,7 +144,7 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. + // Minimum execution time: 2_000_000 picoseconds. Weight::from_parts(2_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) } @@ -156,10 +156,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Measured: `78 + s * (177 ±0)` // Estimated: `42428` // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(10_470_823, 0) + Weight::from_parts(11_517_176, 0) .saturating_add(Weight::from_parts(0, 42428)) - // Standard Error: 1_522 - .saturating_add(Weight::from_parts(349_517, 0).saturating_mul(s.into())) + // Standard Error: 5_666 + .saturating_add(Weight::from_parts(402_645, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -173,10 +173,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Measured: `78 + s * (177 ±0)` // Estimated: `42428` // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(11_154_775, 0) + Weight::from_parts(11_836_816, 0) .saturating_add(Weight::from_parts(0, 42428)) - // Standard Error: 1_155 - .saturating_add(Weight::from_parts(570_400, 0).saturating_mul(s.into())) + // Standard Error: 7_709 + .saturating_add(Weight::from_parts(653_066, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -189,11 +189,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `255 + s * (185 ±0)` // Estimated: `42428` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(13_980_235, 0) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(15_472_235, 0) .saturating_add(Weight::from_parts(0, 42428)) - // Standard Error: 1_964 - .saturating_add(Weight::from_parts(358_521, 0).saturating_mul(s.into())) + // Standard Error: 7_183 + .saturating_add(Weight::from_parts(429_623, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -207,10 +207,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Measured: `281 + s * (185 ±0)` // Estimated: `42428` // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(13_459_673, 0) + Weight::from_parts(13_326_693, 0) .saturating_add(Weight::from_parts(0, 42428)) - // Standard Error: 2_778 - .saturating_add(Weight::from_parts(588_797, 0).saturating_mul(s.into())) + // Standard Error: 7_954 + .saturating_add(Weight::from_parts(699_188, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/crab/src/weights/pallet_session.rs b/runtime/crab/src/weights/pallet_session.rs index aef597f56..648610786 100644 --- a/runtime/crab/src/weights/pallet_session.rs +++ b/runtime/crab/src/weights/pallet_session.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_session` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -78,7 +78,7 @@ impl pallet_session::WeightInfo for WeightInfo { // Measured: `228` // Estimated: `3693` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 3693)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtime/crab/src/weights/pallet_timestamp.rs b/runtime/crab/src/weights/pallet_timestamp.rs index 169352220..4933c5da1 100644 --- a/runtime/crab/src/weights/pallet_timestamp.rs +++ b/runtime/crab/src/weights/pallet_timestamp.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_timestamp` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -61,7 +61,7 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `1493` - // Minimum execution time: 3_000_000 picoseconds. + // Minimum execution time: 4_000_000 picoseconds. Weight::from_parts(4_000_000, 0) .saturating_add(Weight::from_parts(0, 1493)) .saturating_add(T::DbWeight::get().reads(1)) diff --git a/runtime/crab/src/weights/pallet_treasury.rs b/runtime/crab/src/weights/pallet_treasury.rs index 62c4e44b3..deaa9b1ad 100644 --- a/runtime/crab/src/weights/pallet_treasury.rs +++ b/runtime/crab/src/weights/pallet_treasury.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_treasury` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -79,8 +79,8 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `208` // Estimated: `1489` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(23_000_000, 0) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(24_000_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -93,8 +93,8 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `470` // Estimated: `6172` - // Minimum execution time: 36_000_000 picoseconds. - Weight::from_parts(37_000_000, 0) + // Minimum execution time: 37_000_000 picoseconds. + Weight::from_parts(38_000_000, 0) .saturating_add(Weight::from_parts(0, 6172)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -109,10 +109,10 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Measured: `470 + p * (8 ±0)` // Estimated: `3549` // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(8_639_558, 0) + Weight::from_parts(10_154_898, 0) .saturating_add(Weight::from_parts(0, 3549)) - // Standard Error: 707 - .saturating_add(Weight::from_parts(18_205, 0).saturating_mul(p.into())) + // Standard Error: 2_396 + .saturating_add(Weight::from_parts(34_416, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -122,7 +122,7 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127` // Estimated: `1887` - // Minimum execution time: 5_000_000 picoseconds. + // Minimum execution time: 6_000_000 picoseconds. Weight::from_parts(6_000_000, 0) .saturating_add(Weight::from_parts(0, 1887)) .saturating_add(T::DbWeight::get().reads(1)) @@ -144,10 +144,10 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Measured: `219 + p * (97 ±0)` // Estimated: `3581 + p * (2559 ±0)` // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(149_309_488, 0) + Weight::from_parts(18_314_921, 0) .saturating_add(Weight::from_parts(0, 3581)) - // Standard Error: 228_094 - .saturating_add(Weight::from_parts(2_150_806, 0).saturating_mul(p.into())) + // Standard Error: 32_528 + .saturating_add(Weight::from_parts(2_782_967, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -161,8 +161,8 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `1489` - // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -175,8 +175,8 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `315` // Estimated: `6172` - // Minimum execution time: 47_000_000 picoseconds. - Weight::from_parts(48_000_000, 0) + // Minimum execution time: 48_000_000 picoseconds. + Weight::from_parts(50_000_000, 0) .saturating_add(Weight::from_parts(0, 6172)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -188,7 +188,7 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Measured: `148` // Estimated: `3522` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + Weight::from_parts(13_000_000, 0) .saturating_add(Weight::from_parts(0, 3522)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -200,7 +200,7 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Measured: `148` // Estimated: `3522` // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + Weight::from_parts(11_000_000, 0) .saturating_add(Weight::from_parts(0, 3522)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtime/crab/src/weights/pallet_tx_pause.rs b/runtime/crab/src/weights/pallet_tx_pause.rs index e0fe27272..9da3fe68f 100644 --- a/runtime/crab/src/weights/pallet_tx_pause.rs +++ b/runtime/crab/src/weights/pallet_tx_pause.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_tx_pause` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -61,8 +61,8 @@ impl pallet_tx_pause::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `4` // Estimated: `3997` - // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(10_000_000, 0) .saturating_add(Weight::from_parts(0, 3997)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -73,8 +73,8 @@ impl pallet_tx_pause::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `566` // Estimated: `3997` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(13_000_000, 0) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) .saturating_add(Weight::from_parts(0, 3997)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtime/crab/src/weights/pallet_utility.rs b/runtime/crab/src/weights/pallet_utility.rs index f7f48c85e..b2d7dfdb7 100644 --- a/runtime/crab/src/weights/pallet_utility.rs +++ b/runtime/crab/src/weights/pallet_utility.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_utility` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -63,10 +63,10 @@ impl pallet_utility::WeightInfo for WeightInfo { // Measured: `4` // Estimated: `3997` // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(14_705_375, 0) + Weight::from_parts(20_124_325, 0) .saturating_add(Weight::from_parts(0, 3997)) - // Standard Error: 2_279 - .saturating_add(Weight::from_parts(4_479_733, 0).saturating_mul(c.into())) + // Standard Error: 20_837 + .saturating_add(Weight::from_parts(4_967_840, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: `TxPause::PausedCalls` (r:1 w:0) @@ -75,7 +75,7 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `4` // Estimated: `3997` - // Minimum execution time: 6_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(7_000_000, 0) .saturating_add(Weight::from_parts(0, 3997)) .saturating_add(T::DbWeight::get().reads(1)) @@ -88,10 +88,10 @@ impl pallet_utility::WeightInfo for WeightInfo { // Measured: `4` // Estimated: `3997` // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(14_269_732, 0) + Weight::from_parts(11_330_409, 0) .saturating_add(Weight::from_parts(0, 3997)) - // Standard Error: 2_782 - .saturating_add(Weight::from_parts(4_694_927, 0).saturating_mul(c.into())) + // Standard Error: 19_792 + .saturating_add(Weight::from_parts(5_257_682, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(1)) } fn dispatch_as() -> Weight { @@ -110,10 +110,10 @@ impl pallet_utility::WeightInfo for WeightInfo { // Measured: `4` // Estimated: `3997` // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(19_242_416, 0) + Weight::from_parts(2_679_311, 0) .saturating_add(Weight::from_parts(0, 3997)) - // Standard Error: 3_223 - .saturating_add(Weight::from_parts(4_480_011, 0).saturating_mul(c.into())) + // Standard Error: 21_388 + .saturating_add(Weight::from_parts(5_053_368, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(1)) } } diff --git a/runtime/crab/src/weights/pallet_whitelist.rs b/runtime/crab/src/weights/pallet_whitelist.rs index af7e39822..142bb54ba 100644 --- a/runtime/crab/src/weights/pallet_whitelist.rs +++ b/runtime/crab/src/weights/pallet_whitelist.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_whitelist` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("crab-dev")`, DB CACHE: 1024 @@ -66,7 +66,7 @@ impl pallet_whitelist::WeightInfo for WeightInfo { // Measured: `48` // Estimated: `3544` // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_000_000, 0) + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -81,7 +81,7 @@ impl pallet_whitelist::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `176` // Estimated: `3544` - // Minimum execution time: 13_000_000 picoseconds. + // Minimum execution time: 14_000_000 picoseconds. Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(3)) @@ -100,11 +100,11 @@ impl pallet_whitelist::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `252 + n * (1 ±0)` // Estimated: `3716 + n * (1 ±0)` - // Minimum execution time: 22_000_000 picoseconds. + // Minimum execution time: 23_000_000 picoseconds. Weight::from_parts(23_000_000, 0) .saturating_add(Weight::from_parts(0, 3716)) - // Standard Error: 0 - .saturating_add(Weight::from_parts(418, 0).saturating_mul(n.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(506, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) @@ -121,10 +121,10 @@ impl pallet_whitelist::WeightInfo for WeightInfo { // Measured: `176` // Estimated: `3544` // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(17_227_831, 0) + Weight::from_parts(19_545_715, 0) .saturating_add(Weight::from_parts(0, 3544)) - // Standard Error: 5 - .saturating_add(Weight::from_parts(976, 0).saturating_mul(n.into())) + // Standard Error: 34 + .saturating_add(Weight::from_parts(949, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/darwinia/Cargo.toml b/runtime/darwinia/Cargo.toml index c87c39260..8468aab32 100644 --- a/runtime/darwinia/Cargo.toml +++ b/runtime/darwinia/Cargo.toml @@ -301,7 +301,6 @@ try-runtime = [ "darwinia-account-migration/try-runtime", "darwinia-asset-limit/try-runtime", "darwinia-deposit/try-runtime", - "darwinia-ethtx-forwarder/try-runtime", "darwinia-staking/try-runtime", # frontier diff --git a/runtime/darwinia/src/lib.rs b/runtime/darwinia/src/lib.rs index e375a123b..a692573cb 100644 --- a/runtime/darwinia/src/lib.rs +++ b/runtime/darwinia/src/lib.rs @@ -248,7 +248,6 @@ frame_benchmarking::define_benchmarks! { [pallet_balances, Balances] [pallet_collective, TechnicalCommittee] [pallet_conviction_voting, ConvictionVoting] - [pallet_evm, EVM] [pallet_message_queue, MessageQueue] [pallet_preimage, Preimage] [pallet_proxy, Proxy] diff --git a/runtime/darwinia/src/migration.rs b/runtime/darwinia/src/migration.rs index 5eabcef42..29ced7b78 100644 --- a/runtime/darwinia/src/migration.rs +++ b/runtime/darwinia/src/migration.rs @@ -45,9 +45,6 @@ impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade { } fn migrate() -> frame_support::weights::Weight { - frame_support::traits::StorageVersion::new(2) - .put::>(); - let _ = migration::clear_storage_prefix( b"BridgeKusamaGrandpa", b"ImportedHeaders", @@ -55,25 +52,7 @@ fn migrate() -> frame_support::weights::Weight { Some(100), None, ); - let mut n = 100; - - n += migration_helper::PalletCleaner { - name: b"EthereumXcm", - values: &[b"Nonce", b"EthereumXcmSuspended"], - maps: &[], - } - .remove_storage_values(); - - const KTON_DAO_VAULT_ADDR: &str = "0x652182C6aBc0bBE41b5702b05a26d109A405EAcA"; - - #[cfg(feature = "try-runtime")] - assert!(array_bytes::hex_n_into::<_, AccountId, 20>(KTON_DAO_VAULT_ADDR).is_ok()); - - if let Ok(w) = array_bytes::hex_n_into::<_, _, 20>(KTON_DAO_VAULT_ADDR) { - >::put(w); - darwinia_staking::migration::migrate_staking_reward_distribution_contract::(w); - } // frame_support::weights::Weight::zero() - ::DbWeight::get().reads_writes(10, n + 10) + ::DbWeight::get().reads_writes(0, 100) } diff --git a/runtime/darwinia/src/pallets/deposit.rs b/runtime/darwinia/src/pallets/deposit.rs index a4f6a672a..169e1ffe3 100644 --- a/runtime/darwinia/src/pallets/deposit.rs +++ b/runtime/darwinia/src/pallets/deposit.rs @@ -44,10 +44,12 @@ impl darwinia_deposit::SimpleAsset for KtonMinting { } impl darwinia_deposit::Config for Runtime { + type DepositMigrator = darwinia_deposit::DepositMigrator; type Kton = KtonMinting; type MaxDeposits = ConstU32<512>; type MinLockingAmount = ConstU128; type Ring = Balances; type RuntimeEvent = RuntimeEvent; + type Treasury = pallet_config::TreasuryAccount; type WeightInfo = weights::darwinia_deposit::WeightInfo; } diff --git a/runtime/darwinia/src/pallets/staking.rs b/runtime/darwinia/src/pallets/staking.rs index 6994cffbb..191bbdbc7 100644 --- a/runtime/darwinia/src/pallets/staking.rs +++ b/runtime/darwinia/src/pallets/staking.rs @@ -70,55 +70,18 @@ impl darwinia_staking::Stake for KtonStaking { } } -pub enum OnDarwiniaSessionEnd {} -impl darwinia_staking::IssuingManager for OnDarwiniaSessionEnd { - fn inflate() -> Balance { - let now = Timestamp::now() as Moment; - let session_duration = now - >::get(); - let elapsed_time = >::mutate(|t| { - *t = t.saturating_add(session_duration); - - *t - }); - - >::put(now); - - dc_inflation::issuing_in_period(session_duration, elapsed_time).unwrap_or_default() - } - - fn calculate_reward(issued: Balance) -> Balance { - sp_runtime::Perbill::from_percent(40) * issued - } - - fn reward(who: &AccountId, amount: Balance) -> sp_runtime::DispatchResult { - let _ = Balances::deposit_creating(who, amount); - - Ok(()) - } -} - -pub enum ShouldEndSession {} -impl frame_support::traits::Get for ShouldEndSession { - fn get() -> bool { - // polkadot-sdk - use pallet_session::ShouldEndSession; - - ::ShouldEndSession::should_end_session( - System::block_number(), - ) - } -} - impl darwinia_staking::Config for Runtime { type Currency = Balances; type Deposit = Deposit; - type IssuingManager = OnDarwiniaSessionEnd; - type Kton = KtonStaking; - type KtonStakerNotifier = darwinia_staking::KtonStakerNotifier; + type IssuingManager = darwinia_staking::BalanceIssuing; + type KtonStaking = darwinia_staking::KtonStaking; type MaxDeposits = ::MaxDeposits; type Ring = RingStaking; + type RingStaking = darwinia_staking::RingStaking; type RuntimeEvent = RuntimeEvent; - type ShouldEndSession = ShouldEndSession; + type ShouldEndSession = darwinia_staking::ShouldEndSession; + type Treasury = pallet_config::TreasuryAccount; + type UnixTime = Timestamp; type WeightInfo = weights::darwinia_staking::WeightInfo; } #[cfg(not(feature = "runtime-benchmarks"))] diff --git a/runtime/darwinia/src/weights/cumulus_pallet_parachain_system.rs b/runtime/darwinia/src/weights/cumulus_pallet_parachain_system.rs index c067e3540..eef5c2bcb 100644 --- a/runtime/darwinia/src/weights/cumulus_pallet_parachain_system.rs +++ b/runtime/darwinia/src/weights/cumulus_pallet_parachain_system.rs @@ -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-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -73,8 +73,8 @@ impl cumulus_pallet_parachain_system::WeightInfo for We // Minimum execution time: 2_000_000 picoseconds. Weight::from_parts(2_000_000, 0) .saturating_add(Weight::from_parts(0, 3517)) - // Standard Error: 37_263 - .saturating_add(Weight::from_parts(100_294_011, 0).saturating_mul(n.into())) + // Standard Error: 57_770 + .saturating_add(Weight::from_parts(104_402_544, 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()))) diff --git a/runtime/darwinia/src/weights/cumulus_pallet_xcmp_queue.rs b/runtime/darwinia/src/weights/cumulus_pallet_xcmp_queue.rs index 6c21b1c52..ef97eb03c 100644 --- a/runtime/darwinia/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/runtime/darwinia/src/weights/cumulus_pallet_xcmp_queue.rs @@ -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-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -82,7 +82,7 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Measured: `48` // Estimated: `3517` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) + Weight::from_parts(11_000_000, 0) .saturating_add(Weight::from_parts(0, 3517)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -138,7 +138,7 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Measured: `65677` // Estimated: `69142` // Minimum execution time: 45_000_000 picoseconds. - Weight::from_parts(48_000_000, 0) + Weight::from_parts(46_000_000, 0) .saturating_add(Weight::from_parts(0, 69142)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) @@ -151,7 +151,7 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `65676` // Estimated: `69141` - // Minimum execution time: 28_000_000 picoseconds. + // Minimum execution time: 30_000_000 picoseconds. Weight::from_parts(31_000_000, 0) .saturating_add(Weight::from_parts(0, 69141)) .saturating_add(T::DbWeight::get().reads(2)) diff --git a/runtime/darwinia/src/weights/darwinia_account_migration.rs b/runtime/darwinia/src/weights/darwinia_account_migration.rs index 322ec6de7..e74294041 100644 --- a/runtime/darwinia/src/weights/darwinia_account_migration.rs +++ b/runtime/darwinia/src/weights/darwinia_account_migration.rs @@ -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-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -61,27 +61,19 @@ impl 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(1845), added: 4320, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:2 w:3) + /// Storage: `System::Account` (r:0 w:1) /// 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: `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: `28434` - // Estimated: `31899` - // Minimum execution time: 118_000_000 picoseconds. - Weight::from_parts(120_000_000, 0) - .saturating_add(Weight::from_parts(0, 31899)) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(11)) + // Measured: `591` + // Estimated: `3631` + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(27_000_000, 0) + .saturating_add(Weight::from_parts(0, 3631)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `AccountMigration::Multisigs` (r:0 w:1) /// Proof: `AccountMigration::Multisigs` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -91,34 +83,25 @@ impl 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(1845), added: 4320, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:2 w:3) + /// Storage: `System::Account` (r:0 w:1) /// 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: `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`) /// The range of component `x` is `[0, 99]`. /// The range of component `y` is `[0, 99]`. /// The range of component `z` is `[0, 99]`. fn migrate_multisig(x: u32, _y: u32, z: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` - // Estimated: `2 + x * (161 ±0) + z * (161 ±0)` - // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(19_533_534, 0) - .saturating_add(Weight::from_parts(0, 2)) - // Standard Error: 10_492 - .saturating_add(Weight::from_parts(14_924, 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, 161).saturating_mul(x.into())) - .saturating_add(Weight::from_parts(0, 161).saturating_mul(z.into())) + // Estimated: `0 + x * (18 ±0) + z * (18 ±0)` + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(10_220_315, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 2_252 + .saturating_add(Weight::from_parts(41_724, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 18).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 18).saturating_mul(z.into())) } /// Storage: `AccountMigration::Multisigs` (r:1 w:1) /// Proof: `AccountMigration::Multisigs` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -128,8 +111,8 @@ impl 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: 11_000_000 picoseconds. + Weight::from_parts(13_000_000, 0) .saturating_add(Weight::from_parts(0, 6964)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtime/darwinia/src/weights/darwinia_deposit.rs b/runtime/darwinia/src/weights/darwinia_deposit.rs index 5228a0629..10e8bffe9 100644 --- a/runtime/darwinia/src/weights/darwinia_deposit.rs +++ b/runtime/darwinia/src/weights/darwinia_deposit.rs @@ -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-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -69,8 +69,8 @@ impl darwinia_deposit::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `26812` // Estimated: `29615` - // Minimum execution time: 77_000_000 picoseconds. - Weight::from_parts(85_000_000, 0) + // Minimum execution time: 83_000_000 picoseconds. + Weight::from_parts(100_000_000, 0) .saturating_add(Weight::from_parts(0, 29615)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -85,8 +85,8 @@ impl darwinia_deposit::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `26541` // Estimated: `29615` - // Minimum execution time: 927_000_000 picoseconds. - Weight::from_parts(1_003_000_000, 0) + // Minimum execution time: 65_000_000 picoseconds. + Weight::from_parts(84_000_000, 0) .saturating_add(Weight::from_parts(0, 29615)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -105,10 +105,47 @@ impl darwinia_deposit::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `26863` // Estimated: `29615` - // Minimum execution time: 87_000_000 picoseconds. - Weight::from_parts(97_000_000, 0) + // Minimum execution time: 95_000_000 picoseconds. + Weight::from_parts(111_000_000, 0) .saturating_add(Weight::from_parts(0, 29615)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } + /// Storage: `Deposit::Deposits` (r:1 w:1) + /// Proof: `Deposit::Deposits` (`max_values`: None, `max_size`: Some(26150), added: 28625, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:3 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`) + /// Storage: `Deposit::DepositContract` (r:1 w:0) + /// Proof: `Deposit::DepositContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + /// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0) + /// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `EVM::AccountCodes` (r:2 w:0) + /// Proof: `EVM::AccountCodes` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Digest` (r:1 w:0) + /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Ethereum::Pending` (r:1 w:1) + /// Proof: `Ethereum::Pending` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn migrate() -> Weight { + // Proof Size summary in bytes: + // Measured: `27484` + // Estimated: `33424` + // Minimum execution time: 3_936_000_000 picoseconds. + Weight::from_parts(4_548_000_000, 0) + .saturating_add(Weight::from_parts(0, 33424)) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `Deposit::DepositContract` (r:0 w:1) + /// Proof: `Deposit::DepositContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + fn set_deposit_contract() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } } diff --git a/runtime/darwinia/src/weights/darwinia_staking.rs b/runtime/darwinia/src/weights/darwinia_staking.rs index 49f5b9564..cddebe04b 100644 --- a/runtime/darwinia/src/weights/darwinia_staking.rs +++ b/runtime/darwinia/src/weights/darwinia_staking.rs @@ -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-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -70,11 +70,11 @@ impl darwinia_staking::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `7088 + x * (25 ±0)` // Estimated: `29615` - // Minimum execution time: 48_000_000 picoseconds. - Weight::from_parts(646_150_780, 0) + // Minimum execution time: 52_000_000 picoseconds. + Weight::from_parts(770_181_918, 0) .saturating_add(Weight::from_parts(0, 29615)) - // Standard Error: 240_459 - .saturating_add(Weight::from_parts(12_288_123, 0).saturating_mul(x.into())) + // Standard Error: 262_777 + .saturating_add(Weight::from_parts(13_019_225, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -94,10 +94,10 @@ impl darwinia_staking::WeightInfo for WeightInfo { // Measured: `7415 + x * (26 ±0)` // Estimated: `29615` // Minimum execution time: 51_000_000 picoseconds. - Weight::from_parts(683_421_871, 0) + Weight::from_parts(755_853_947, 0) .saturating_add(Weight::from_parts(0, 29615)) - // Standard Error: 245_535 - .saturating_add(Weight::from_parts(12_549_577, 0).saturating_mul(x.into())) + // Standard Error: 261_936 + .saturating_add(Weight::from_parts(13_061_272, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -121,10 +121,10 @@ impl darwinia_staking::WeightInfo for WeightInfo { /// Proof: `DarwiniaStaking::Nominators` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) fn nominate() -> Weight { // Proof Size summary in bytes: - // Measured: `574` + // Measured: `600` // Estimated: `4543` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) .saturating_add(Weight::from_parts(0, 4543)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -154,8 +154,8 @@ impl darwinia_staking::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `2184` // Estimated: `83902` - // Minimum execution time: 520_000_000 picoseconds. - Weight::from_parts(537_000_000, 0) + // Minimum execution time: 527_000_000 picoseconds. + Weight::from_parts(616_000_000, 0) .saturating_add(Weight::from_parts(0, 83902)) .saturating_add(T::DbWeight::get().reads(35)) .saturating_add(T::DbWeight::get().writes(34)) @@ -171,14 +171,24 @@ impl darwinia_staking::WeightInfo for WeightInfo { .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: `DarwiniaStaking::KtonRewardDistributionContract` (r:0 w:1) - /// Proof: `DarwiniaStaking::KtonRewardDistributionContract` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - fn set_kton_reward_distribution_contract() -> Weight { + /// Storage: `DarwiniaStaking::RingStakingContract` (r:0 w:1) + /// Proof: `DarwiniaStaking::RingStakingContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + fn set_ring_staking_contract() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + Weight::from_parts(3_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } /// Storage: `DarwiniaStaking::KtonStakingContract` (r:0 w:1) + /// Proof: `DarwiniaStaking::KtonStakingContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + fn set_kton_staking_contract() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/darwinia/src/weights/frame_system.rs b/runtime/darwinia/src/weights/frame_system.rs index 0b7cacf31..3febf6169 100644 --- a/runtime/darwinia/src/weights/frame_system.rs +++ b/runtime/darwinia/src/weights/frame_system.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `frame_system` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -61,21 +61,21 @@ impl frame_system::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `0` // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(1_295_116, 0) + Weight::from_parts(2_022_883, 0) .saturating_add(Weight::from_parts(0, 0)) // Standard Error: 0 - .saturating_add(Weight::from_parts(150, 0).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(158, 0).saturating_mul(b.into())) } /// The range of component `b` is `[0, 3932160]`. fn remark_with_event(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_000_000 picoseconds. + // Minimum execution time: 4_000_000 picoseconds. Weight::from_parts(5_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 0 - .saturating_add(Weight::from_parts(939, 0).saturating_mul(b.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_004, 0).saturating_mul(b.into())) } /// Storage: `System::Digest` (r:1 w:1) /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -107,8 +107,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `198` // Estimated: `1683` - // Minimum execution time: 67_266_000_000 picoseconds. - Weight::from_parts(70_085_000_000, 0) + // Minimum execution time: 68_735_000_000 picoseconds. + Weight::from_parts(75_159_000_000, 0) .saturating_add(Weight::from_parts(0, 1683)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -123,8 +123,8 @@ impl frame_system::WeightInfo for WeightInfo { // Minimum execution time: 2_000_000 picoseconds. Weight::from_parts(2_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 2_360 - .saturating_add(Weight::from_parts(760_657, 0).saturating_mul(i.into())) + // Standard Error: 2_238 + .saturating_add(Weight::from_parts(796_198, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -134,11 +134,11 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. + // Minimum execution time: 2_000_000 picoseconds. Weight::from_parts(2_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 840 - .saturating_add(Weight::from_parts(536_307, 0).saturating_mul(i.into())) + // Standard Error: 1_484 + .saturating_add(Weight::from_parts(567_851, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -146,13 +146,13 @@ impl frame_system::WeightInfo for WeightInfo { /// The range of component `p` is `[0, 1000]`. fn kill_prefix(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `99 + p * (69 ±0)` - // Estimated: `101 + p * (70 ±0)` + // Measured: `97 + p * (69 ±0)` + // Estimated: `102 + p * (70 ±0)` // Minimum execution time: 3_000_000 picoseconds. Weight::from_parts(4_000_000, 0) - .saturating_add(Weight::from_parts(0, 101)) - // Standard Error: 1_241 - .saturating_add(Weight::from_parts(983_046, 0).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 102)) + // Standard Error: 3_104 + .saturating_add(Weight::from_parts(1_048_017, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) .saturating_add(Weight::from_parts(0, 70).saturating_mul(p.into())) @@ -164,7 +164,7 @@ impl frame_system::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `0` // Minimum execution time: 6_000_000 picoseconds. - Weight::from_parts(8_000_000, 0) + Weight::from_parts(11_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -186,8 +186,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `220` // Estimated: `1705` - // Minimum execution time: 69_629_000_000 picoseconds. - Weight::from_parts(74_577_000_000, 0) + // Minimum execution time: 70_228_000_000 picoseconds. + Weight::from_parts(79_493_000_000, 0) .saturating_add(Weight::from_parts(0, 1705)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtime/darwinia/src/weights/pallet_asset_manager.rs b/runtime/darwinia/src/weights/pallet_asset_manager.rs index 218905813..e4081918f 100644 --- a/runtime/darwinia/src/weights/pallet_asset_manager.rs +++ b/runtime/darwinia/src/weights/pallet_asset_manager.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_asset_manager` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -67,8 +67,8 @@ impl pallet_asset_manager::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `276` // Estimated: `3741` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(29_000_000, 0) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(30_000_000, 0) .saturating_add(Weight::from_parts(0, 3741)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) @@ -84,11 +84,11 @@ impl pallet_asset_manager::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `595 + x * (9 ±0)` // Estimated: `3983 + x * (10 ±0)` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(16_810_363, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(17_795_668, 0) .saturating_add(Weight::from_parts(0, 3983)) - // Standard Error: 2_082 - .saturating_add(Weight::from_parts(329_481, 0).saturating_mul(x.into())) + // Standard Error: 5_207 + .saturating_add(Weight::from_parts(392_816, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 10).saturating_mul(x.into())) @@ -106,11 +106,11 @@ impl pallet_asset_manager::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `968 + x * (13 ±0)` // Estimated: `4303 + x * (14 ±0)` - // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(25_440_012, 0) + // Minimum execution time: 25_000_000 picoseconds. + Weight::from_parts(28_440_466, 0) .saturating_add(Weight::from_parts(0, 4303)) - // Standard Error: 3_740 - .saturating_add(Weight::from_parts(336_831, 0).saturating_mul(x.into())) + // Standard Error: 6_795 + .saturating_add(Weight::from_parts(386_150, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(6)) .saturating_add(Weight::from_parts(0, 14).saturating_mul(x.into())) @@ -124,11 +124,11 @@ impl pallet_asset_manager::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `196 + x * (5 ±0)` // Estimated: `1678 + x * (5 ±0)` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(9_832_398, 0) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(11_889_301, 0) .saturating_add(Weight::from_parts(0, 1678)) - // Standard Error: 1_647 - .saturating_add(Weight::from_parts(290_226, 0).saturating_mul(x.into())) + // Standard Error: 4_468 + .saturating_add(Weight::from_parts(336_614, 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, 5).saturating_mul(x.into())) @@ -146,11 +146,11 @@ impl pallet_asset_manager::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `486 + x * (10 ±0)` // Estimated: `3949 + x * (10 ±0)` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(17_425_346, 0) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(20_650_636, 0) .saturating_add(Weight::from_parts(0, 3949)) - // Standard Error: 4_402 - .saturating_add(Weight::from_parts(311_738, 0).saturating_mul(x.into())) + // Standard Error: 5_638 + .saturating_add(Weight::from_parts(331_744, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(Weight::from_parts(0, 10).saturating_mul(x.into())) diff --git a/runtime/darwinia/src/weights/pallet_assets.rs b/runtime/darwinia/src/weights/pallet_assets.rs index b1c98a9d2..1e2943cb0 100644 --- a/runtime/darwinia/src/weights/pallet_assets.rs +++ b/runtime/darwinia/src/weights/pallet_assets.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_assets` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -73,7 +73,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `157` // Estimated: `3631` - // Minimum execution time: 10_000_000 picoseconds. + // Minimum execution time: 9_000_000 picoseconds. Weight::from_parts(10_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(1)) @@ -100,13 +100,13 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 1000]`. fn destroy_accounts(c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `571 + c * (183 ±0)` + // Measured: `577 + c * (183 ±0)` // Estimated: `3631 + c * (2591 ±0)` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(13_000_000, 0) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) - // Standard Error: 10_861 - .saturating_add(Weight::from_parts(10_816_720, 0).saturating_mul(c.into())) + // Standard Error: 19_912 + .saturating_add(Weight::from_parts(11_438_394, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -122,11 +122,11 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `458 + a * (74 ±0)` // Estimated: `3631 + a * (2603 ±0)` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(14_000_000, 0) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(15_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) - // Standard Error: 4_003 - .saturating_add(Weight::from_parts(4_025_329, 0).saturating_mul(a.into())) + // Standard Error: 9_699 + .saturating_add(Weight::from_parts(4_253_783, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -142,7 +142,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `350` // Estimated: `3631` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(11_000_000, 0) + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -169,8 +169,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `410` // Estimated: `3631` - // Minimum execution time: 26_000_000 picoseconds. - Weight::from_parts(26_000_000, 0) + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(32_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -186,7 +186,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `501` // Estimated: `6168` // Minimum execution time: 36_000_000 picoseconds. - Weight::from_parts(37_000_000, 0) + Weight::from_parts(42_000_000, 0) .saturating_add(Weight::from_parts(0, 6168)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -201,8 +201,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `501` // Estimated: `6168` - // Minimum execution time: 33_000_000 picoseconds. - Weight::from_parts(34_000_000, 0) + // Minimum execution time: 32_000_000 picoseconds. + Weight::from_parts(33_000_000, 0) .saturating_add(Weight::from_parts(0, 6168)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -217,8 +217,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `501` // Estimated: `6168` - // Minimum execution time: 37_000_000 picoseconds. - Weight::from_parts(38_000_000, 0) + // Minimum execution time: 38_000_000 picoseconds. + Weight::from_parts(45_000_000, 0) .saturating_add(Weight::from_parts(0, 6168)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -232,7 +232,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `410` // Estimated: `3631` // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(14_000_000, 0) + Weight::from_parts(17_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -246,7 +246,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `410` // Estimated: `3631` // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(14_000_000, 0) + Weight::from_parts(17_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -257,8 +257,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `307` // Estimated: `3631` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -284,7 +284,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `350` // Estimated: `3631` // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) + Weight::from_parts(13_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -296,7 +296,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `307` // Estimated: `3631` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -312,12 +312,12 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `350` // Estimated: `3631` // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(12_858_895, 0) + Weight::from_parts(12_129_697, 0) .saturating_add(Weight::from_parts(0, 3631)) - // Standard Error: 848 - .saturating_add(Weight::from_parts(1_298, 0).saturating_mul(n.into())) - // Standard Error: 848 - .saturating_add(Weight::from_parts(1_897, 0).saturating_mul(s.into())) + // Standard Error: 2_810 + .saturating_add(Weight::from_parts(15_482, 0).saturating_mul(n.into())) + // Standard Error: 2_810 + .saturating_add(Weight::from_parts(23_441, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -329,8 +329,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `478` // Estimated: `3631` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 0) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -341,13 +341,17 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(144), added: 2619, mode: `MaxEncodedLen`) /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn force_set_metadata(_n: u32, _s: u32, ) -> Weight { + fn force_set_metadata(n: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `237` // Estimated: `3631` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_598_205, 0) + Weight::from_parts(10_891_526, 0) .saturating_add(Weight::from_parts(0, 3631)) + // Standard Error: 2_723 + .saturating_add(Weight::from_parts(24_590, 0).saturating_mul(n.into())) + // Standard Error: 2_723 + .saturating_add(Weight::from_parts(14_605, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -359,8 +363,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `478` // Estimated: `3631` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(13_000_000, 0) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -386,7 +390,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `307` // Estimated: `3631` // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 0) + Weight::from_parts(18_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -404,7 +408,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `599` // Estimated: `6168` // Minimum execution time: 43_000_000 picoseconds. - Weight::from_parts(45_000_000, 0) + Weight::from_parts(47_000_000, 0) .saturating_add(Weight::from_parts(0, 6168)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) @@ -417,7 +421,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `457` // Estimated: `3631` - // Minimum execution time: 17_000_000 picoseconds. + // Minimum execution time: 16_000_000 picoseconds. Weight::from_parts(17_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) @@ -443,7 +447,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `307` // Estimated: `3631` - // Minimum execution time: 10_000_000 picoseconds. + // Minimum execution time: 11_000_000 picoseconds. Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(1)) @@ -459,7 +463,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `478` // Estimated: `3631` - // Minimum execution time: 30_000_000 picoseconds. + // Minimum execution time: 29_000_000 picoseconds. Weight::from_parts(31_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(3)) @@ -473,8 +477,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `350` // Estimated: `3631` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(29_000_000, 0) + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(28_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -490,7 +494,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `556` // Estimated: `3631` // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(29_000_000, 0) + Weight::from_parts(28_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -503,7 +507,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `448` // Estimated: `3631` - // Minimum execution time: 27_000_000 picoseconds. + // Minimum execution time: 26_000_000 picoseconds. Weight::from_parts(28_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) @@ -517,7 +521,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `410` // Estimated: `3631` - // Minimum execution time: 14_000_000 picoseconds. + // Minimum execution time: 13_000_000 picoseconds. Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) diff --git a/runtime/darwinia/src/weights/pallet_balances.rs b/runtime/darwinia/src/weights/pallet_balances.rs index 6c40404ca..9c332b819 100644 --- a/runtime/darwinia/src/weights/pallet_balances.rs +++ b/runtime/darwinia/src/weights/pallet_balances.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_balances` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -61,8 +61,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `39` // Estimated: `3581` - // Minimum execution time: 44_000_000 picoseconds. - Weight::from_parts(45_000_000, 0) + // Minimum execution time: 46_000_000 picoseconds. + Weight::from_parts(53_000_000, 0) .saturating_add(Weight::from_parts(0, 3581)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -73,8 +73,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `39` // Estimated: `3581` - // Minimum execution time: 37_000_000 picoseconds. - Weight::from_parts(38_000_000, 0) + // Minimum execution time: 40_000_000 picoseconds. + Weight::from_parts(43_000_000, 0) .saturating_add(Weight::from_parts(0, 3581)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -85,8 +85,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `195` // Estimated: `3581` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_000_000, 0) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 3581)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -98,7 +98,7 @@ impl pallet_balances::WeightInfo for WeightInfo { // Measured: `195` // Estimated: `3581` // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(19_000_000, 0) + Weight::from_parts(20_000_000, 0) .saturating_add(Weight::from_parts(0, 3581)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,8 +109,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `234` // Estimated: `6172` - // Minimum execution time: 46_000_000 picoseconds. - Weight::from_parts(49_000_000, 0) + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(47_000_000, 0) .saturating_add(Weight::from_parts(0, 6172)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -144,13 +144,13 @@ impl pallet_balances::WeightInfo for WeightInfo { /// The range of component `u` is `[1, 1000]`. fn upgrade_accounts(u: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `156 + u * (124 ±0)` + // Measured: `190 + u * (124 ±0)` // Estimated: `990 + u * (2591 ±0)` // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(16_000_000, 0) + Weight::from_parts(17_000_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 16_859 - .saturating_add(Weight::from_parts(13_076_232, 0).saturating_mul(u.into())) + // Standard Error: 21_312 + .saturating_add(Weight::from_parts(13_977_832, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2591).saturating_mul(u.into())) @@ -162,7 +162,7 @@ impl pallet_balances::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `1501` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(5_000_000, 0) + Weight::from_parts(6_000_000, 0) .saturating_add(Weight::from_parts(0, 1501)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtime/darwinia/src/weights/pallet_collective.rs b/runtime/darwinia/src/weights/pallet_collective.rs index d96a4247d..a2bba17a5 100644 --- a/runtime/darwinia/src/weights/pallet_collective.rs +++ b/runtime/darwinia/src/weights/pallet_collective.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -69,14 +69,14 @@ impl pallet_collective::WeightInfo for WeightInfo { fn set_members(m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (2021 ±0) + p * (2026 ±0)` - // Estimated: `12200 + m * (1231 ±15) + p * (3660 ±15)` + // Estimated: `12200 + m * (1231 ±14) + p * (3660 ±14)` // Minimum execution time: 10_000_000 picoseconds. Weight::from_parts(11_000_000, 0) .saturating_add(Weight::from_parts(0, 12200)) - // Standard Error: 59_966 - .saturating_add(Weight::from_parts(2_724_746, 0).saturating_mul(m.into())) - // Standard Error: 59_966 - .saturating_add(Weight::from_parts(5_047_021, 0).saturating_mul(p.into())) + // Standard Error: 50_693 + .saturating_add(Weight::from_parts(2_697_813, 0).saturating_mul(m.into())) + // Standard Error: 50_693 + .saturating_add(Weight::from_parts(5_731_591, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -93,12 +93,12 @@ impl pallet_collective::WeightInfo for WeightInfo { // Measured: `69 + m * (20 ±0)` // Estimated: `1554 + m * (20 ±0)` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(11_281_809, 0) + Weight::from_parts(12_240_775, 0) .saturating_add(Weight::from_parts(0, 1554)) - // Standard Error: 40 - .saturating_add(Weight::from_parts(1_264, 0).saturating_mul(b.into())) - // Standard Error: 420 - .saturating_add(Weight::from_parts(4_440, 0).saturating_mul(m.into())) + // Standard Error: 142 + .saturating_add(Weight::from_parts(854, 0).saturating_mul(b.into())) + // Standard Error: 1_472 + .saturating_add(Weight::from_parts(3_463, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(Weight::from_parts(0, 20).saturating_mul(m.into())) } @@ -113,12 +113,12 @@ impl pallet_collective::WeightInfo for WeightInfo { // Measured: `69 + m * (20 ±0)` // Estimated: `3534 + m * (20 ±0)` // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(12_974_317, 0) + Weight::from_parts(14_648_786, 0) .saturating_add(Weight::from_parts(0, 3534)) - // Standard Error: 44 - .saturating_add(Weight::from_parts(1_235, 0).saturating_mul(b.into())) - // Standard Error: 457 - .saturating_add(Weight::from_parts(7_401, 0).saturating_mul(m.into())) + // Standard Error: 181 + .saturating_add(Weight::from_parts(678, 0).saturating_mul(b.into())) + // Standard Error: 1_869 + .saturating_add(Weight::from_parts(2_211, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(Weight::from_parts(0, 20).saturating_mul(m.into())) } @@ -140,14 +140,14 @@ impl pallet_collective::WeightInfo for WeightInfo { // Measured: `357 + m * (20 ±0) + p * (36 ±0)` // Estimated: `3751 + m * (21 ±0) + p * (36 ±0)` // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(18_523_259, 0) + Weight::from_parts(19_890_728, 0) .saturating_add(Weight::from_parts(0, 3751)) - // Standard Error: 69 - .saturating_add(Weight::from_parts(948, 0).saturating_mul(b.into())) - // Standard Error: 727 - .saturating_add(Weight::from_parts(7_919, 0).saturating_mul(m.into())) - // Standard Error: 718 - .saturating_add(Weight::from_parts(117_169, 0).saturating_mul(p.into())) + // Standard Error: 319 + .saturating_add(Weight::from_parts(1_542, 0).saturating_mul(b.into())) + // Standard Error: 3_329 + .saturating_add(Weight::from_parts(5_709, 0).saturating_mul(m.into())) + // Standard Error: 3_287 + .saturating_add(Weight::from_parts(144_012, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(Weight::from_parts(0, 21).saturating_mul(m.into())) @@ -163,10 +163,10 @@ impl pallet_collective::WeightInfo for WeightInfo { // Measured: `832 + m * (40 ±0)` // Estimated: `4296 + m * (40 ±0)` // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_359_237, 0) + Weight::from_parts(18_419_291, 0) .saturating_add(Weight::from_parts(0, 4296)) - // Standard Error: 720 - .saturating_add(Weight::from_parts(8_818, 0).saturating_mul(m.into())) + // Standard Error: 3_323 + .saturating_add(Weight::from_parts(11_124, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 40).saturating_mul(m.into())) @@ -186,12 +186,12 @@ impl pallet_collective::WeightInfo for WeightInfo { // Measured: `409 + m * (40 ±0) + p * (36 ±0)` // Estimated: `3854 + m * (41 ±0) + p * (36 ±0)` // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(18_928_975, 0) + Weight::from_parts(21_904_391, 0) .saturating_add(Weight::from_parts(0, 3854)) - // Standard Error: 858 - .saturating_add(Weight::from_parts(10_089, 0).saturating_mul(m.into())) - // Standard Error: 837 - .saturating_add(Weight::from_parts(117_526, 0).saturating_mul(p.into())) + // Standard Error: 3_844 + .saturating_add(Weight::from_parts(3_705, 0).saturating_mul(m.into())) + // Standard Error: 3_748 + .saturating_add(Weight::from_parts(138_780, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 41).saturating_mul(m.into())) @@ -212,15 +212,13 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `711 + b * (1 ±0) + m * (40 ±0) + p * (40 ±0)` // Estimated: `4028 + b * (1 ±0) + m * (42 ±0) + p * (40 ±0)` - // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(28_636_530, 0) + // Minimum execution time: 26_000_000 picoseconds. + Weight::from_parts(31_689_539, 0) .saturating_add(Weight::from_parts(0, 4028)) - // Standard Error: 92 - .saturating_add(Weight::from_parts(584, 0).saturating_mul(b.into())) - // Standard Error: 976 - .saturating_add(Weight::from_parts(2_264, 0).saturating_mul(m.into())) - // Standard Error: 952 - .saturating_add(Weight::from_parts(127_220, 0).saturating_mul(p.into())) + // Standard Error: 466 + .saturating_add(Weight::from_parts(349, 0).saturating_mul(b.into())) + // Standard Error: 4_809 + .saturating_add(Weight::from_parts(168_485, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -243,13 +241,13 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `429 + m * (40 ±0) + p * (36 ±0)` // Estimated: `3874 + m * (41 ±0) + p * (36 ±0)` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_425_355, 0) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_644_454, 0) .saturating_add(Weight::from_parts(0, 3874)) - // Standard Error: 673 - .saturating_add(Weight::from_parts(3_424, 0).saturating_mul(m.into())) - // Standard Error: 656 - .saturating_add(Weight::from_parts(116_574, 0).saturating_mul(p.into())) + // Standard Error: 3_882 + .saturating_add(Weight::from_parts(16_481, 0).saturating_mul(m.into())) + // Standard Error: 3_785 + .saturating_add(Weight::from_parts(142_766, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 41).saturating_mul(m.into())) @@ -272,13 +270,13 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `731 + b * (1 ±0) + m * (40 ±0) + p * (40 ±0)` // Estimated: `4048 + b * (1 ±0) + m * (42 ±0) + p * (40 ±0)` - // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(31_047_662, 0) + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(34_238_646, 0) .saturating_add(Weight::from_parts(0, 4048)) - // Standard Error: 130 - .saturating_add(Weight::from_parts(587, 0).saturating_mul(b.into())) - // Standard Error: 1_349 - .saturating_add(Weight::from_parts(138_483, 0).saturating_mul(p.into())) + // Standard Error: 479 + .saturating_add(Weight::from_parts(516, 0).saturating_mul(b.into())) + // Standard Error: 4_942 + .saturating_add(Weight::from_parts(177_711, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -297,10 +295,10 @@ impl pallet_collective::WeightInfo for WeightInfo { // Measured: `226 + p * (32 ±0)` // Estimated: `1711 + p * (32 ±0)` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(11_835_833, 0) + Weight::from_parts(12_804_007, 0) .saturating_add(Weight::from_parts(0, 1711)) - // Standard Error: 615 - .saturating_add(Weight::from_parts(109_439, 0).saturating_mul(p.into())) + // Standard Error: 2_831 + .saturating_add(Weight::from_parts(128_548, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) diff --git a/runtime/darwinia/src/weights/pallet_conviction_voting.rs b/runtime/darwinia/src/weights/pallet_conviction_voting.rs index 61f408759..3fc1ec2c1 100644 --- a/runtime/darwinia/src/weights/pallet_conviction_voting.rs +++ b/runtime/darwinia/src/weights/pallet_conviction_voting.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_conviction_voting` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -71,8 +71,8 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `13458` // Estimated: `42428` - // Minimum execution time: 82_000_000 picoseconds. - Weight::from_parts(86_000_000, 0) + // Minimum execution time: 90_000_000 picoseconds. + Weight::from_parts(100_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) @@ -93,8 +93,8 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `14179` // Estimated: `83866` - // Minimum execution time: 115_000_000 picoseconds. - Weight::from_parts(118_000_000, 0) + // Minimum execution time: 124_000_000 picoseconds. + Weight::from_parts(149_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(6)) @@ -109,8 +109,8 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `13928` // Estimated: `83866` - // Minimum execution time: 93_000_000 picoseconds. - Weight::from_parts(97_000_000, 0) + // Minimum execution time: 96_000_000 picoseconds. + Weight::from_parts(111_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -123,8 +123,8 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `13052` // Estimated: `30694` - // Minimum execution time: 45_000_000 picoseconds. - Weight::from_parts(47_000_000, 0) + // Minimum execution time: 49_000_000 picoseconds. + Weight::from_parts(57_000_000, 0) .saturating_add(Weight::from_parts(0, 30694)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -146,11 +146,11 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `7020 + r * (447 ±0)` // Estimated: `83866 + r * (3387 ±0)` - // Minimum execution time: 41_000_000 picoseconds. - Weight::from_parts(99_814_644, 0) + // Minimum execution time: 48_000_000 picoseconds. + Weight::from_parts(107_491_225, 0) .saturating_add(Weight::from_parts(0, 83866)) - // Standard Error: 303_431 - .saturating_add(Weight::from_parts(34_505_600, 0).saturating_mul(r.into())) + // Standard Error: 345_022 + .saturating_add(Weight::from_parts(37_023_763, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(6)) @@ -168,11 +168,11 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `6876 + r * (447 ±0)` // Estimated: `83866 + r * (3387 ±0)` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(63_087_454, 0) + // Minimum execution time: 24_000_000 picoseconds. + Weight::from_parts(49_135_530, 0) .saturating_add(Weight::from_parts(0, 83866)) - // Standard Error: 340_241 - .saturating_add(Weight::from_parts(34_766_287, 0).saturating_mul(r.into())) + // Standard Error: 355_033 + .saturating_add(Weight::from_parts(37_751_665, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(4)) @@ -191,8 +191,8 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `12038` // Estimated: `30694` - // Minimum execution time: 72_000_000 picoseconds. - Weight::from_parts(79_000_000, 0) + // Minimum execution time: 74_000_000 picoseconds. + Weight::from_parts(90_000_000, 0) .saturating_add(Weight::from_parts(0, 30694)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) diff --git a/runtime/darwinia/src/weights/pallet_message_queue.rs b/runtime/darwinia/src/weights/pallet_message_queue.rs index f40205bce..f6a0c3bef 100644 --- a/runtime/darwinia/src/weights/pallet_message_queue.rs +++ b/runtime/darwinia/src/weights/pallet_message_queue.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_message_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -113,7 +113,7 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `72` // Estimated: `69050` - // Minimum execution time: 5_000_000 picoseconds. + // Minimum execution time: 4_000_000 picoseconds. Weight::from_parts(5_000_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(1)) @@ -127,8 +127,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 81_000_000 picoseconds. - Weight::from_parts(82_000_000, 0) + // Minimum execution time: 83_000_000 picoseconds. + Weight::from_parts(91_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -168,8 +168,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `65667` // Estimated: `69050` - // Minimum execution time: 44_000_000 picoseconds. - Weight::from_parts(45_000_000, 0) + // Minimum execution time: 42_000_000 picoseconds. + Weight::from_parts(54_000_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -183,7 +183,7 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Measured: `65667` // Estimated: `69050` // Minimum execution time: 52_000_000 picoseconds. - Weight::from_parts(57_000_000, 0) + Weight::from_parts(63_000_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtime/darwinia/src/weights/pallet_preimage.rs b/runtime/darwinia/src/weights/pallet_preimage.rs index 56241dc51..97f95ceeb 100644 --- a/runtime/darwinia/src/weights/pallet_preimage.rs +++ b/runtime/darwinia/src/weights/pallet_preimage.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -68,11 +68,11 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3544` - // Minimum execution time: 47_000_000 picoseconds. - Weight::from_parts(48_000_000, 0) + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(46_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) // Standard Error: 2 - .saturating_add(Weight::from_parts(1_090, 0).saturating_mul(s.into())) + .saturating_add(Weight::from_parts(1_165, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -90,8 +90,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Minimum execution time: 13_000_000 picoseconds. Weight::from_parts(13_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) - // Standard Error: 1 - .saturating_add(Weight::from_parts(1_080, 0).saturating_mul(s.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(1_164, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -106,11 +106,11 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3544` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(13_000_000, 0) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) - // Standard Error: 1 - .saturating_add(Weight::from_parts(1_045, 0).saturating_mul(s.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(1_124, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -126,8 +126,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `219` // Estimated: `3544` - // Minimum execution time: 44_000_000 picoseconds. - Weight::from_parts(45_000_000, 0) + // Minimum execution time: 46_000_000 picoseconds. + Weight::from_parts(53_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -142,8 +142,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3544` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 0) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(27_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -156,8 +156,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `176` // Estimated: `3544` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(14_000_000, 0) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(22_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -170,8 +170,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3544` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -184,8 +184,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3544` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(13_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -198,8 +198,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3544` - // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -214,8 +214,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3544` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(15_000_000, 0) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(23_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -228,8 +228,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3544` - // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -242,8 +242,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3544` - // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -259,13 +259,13 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// The range of component `n` is `[1, 1024]`. fn ensure_updated(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `249 + n * (203 ±0)` + // Measured: `270 + n * (203 ±0)` // Estimated: `990 + n * (2591 ±0)` - // Minimum execution time: 56_000_000 picoseconds. - Weight::from_parts(56_000_000, 0) + // Minimum execution time: 54_000_000 picoseconds. + Weight::from_parts(55_000_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 22_480 - .saturating_add(Weight::from_parts(52_910_356, 0).saturating_mul(n.into())) + // Standard Error: 51_485 + .saturating_add(Weight::from_parts(57_512_634, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(n.into()))) .saturating_add(Weight::from_parts(0, 2591).saturating_mul(n.into())) diff --git a/runtime/darwinia/src/weights/pallet_proxy.rs b/runtime/darwinia/src/weights/pallet_proxy.rs index b6e2b080b..f384a61bb 100644 --- a/runtime/darwinia/src/weights/pallet_proxy.rs +++ b/runtime/darwinia/src/weights/pallet_proxy.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_proxy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -63,10 +63,10 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Measured: `149 + p * (25 ±0)` // Estimated: `4310` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_023_213, 0) + Weight::from_parts(13_108_108, 0) .saturating_add(Weight::from_parts(0, 4310)) - // Standard Error: 1_162 - .saturating_add(Weight::from_parts(2_112, 0).saturating_mul(p.into())) + // Standard Error: 5_981 + .saturating_add(Weight::from_parts(7_080, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: `Proxy::Proxies` (r:1 w:0) @@ -77,17 +77,15 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. - fn proxy_announced(a: u32, p: u32, ) -> Weight { + fn proxy_announced(a: u32, _p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `401 + a * (56 ±0) + p * (25 ±0)` // Estimated: `5302` - // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(29_924_775, 0) + // Minimum execution time: 30_000_000 picoseconds. + Weight::from_parts(33_686_226, 0) .saturating_add(Weight::from_parts(0, 5302)) - // Standard Error: 2_717 - .saturating_add(Weight::from_parts(119_376, 0).saturating_mul(a.into())) - // Standard Error: 2_808 - .saturating_add(Weight::from_parts(16_783, 0).saturating_mul(p.into())) + // Standard Error: 11_152 + .saturating_add(Weight::from_parts(104_511, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -102,10 +100,10 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Measured: `329 + a * (56 ±0)` // Estimated: `5302` // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_851_030, 0) + Weight::from_parts(22_564_195, 0) .saturating_add(Weight::from_parts(0, 5302)) - // Standard Error: 2_110 - .saturating_add(Weight::from_parts(119_938, 0).saturating_mul(a.into())) + // Standard Error: 8_176 + .saturating_add(Weight::from_parts(135_367, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -120,12 +118,12 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Measured: `329 + a * (56 ±0)` // Estimated: `5302` // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(20_304_126, 0) + Weight::from_parts(21_930_472, 0) .saturating_add(Weight::from_parts(0, 5302)) - // Standard Error: 2_237 - .saturating_add(Weight::from_parts(133_692, 0).saturating_mul(a.into())) - // Standard Error: 2_311 - .saturating_add(Weight::from_parts(5_486, 0).saturating_mul(p.into())) + // Standard Error: 7_828 + .saturating_add(Weight::from_parts(111_972, 0).saturating_mul(a.into())) + // Standard Error: 8_088 + .saturating_add(Weight::from_parts(45_616, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -141,13 +139,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `345 + a * (56 ±0) + p * (25 ±0)` // Estimated: `5302` - // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(27_284_753, 0) + // Minimum execution time: 25_000_000 picoseconds. + Weight::from_parts(29_590_481, 0) .saturating_add(Weight::from_parts(0, 5302)) - // Standard Error: 2_221 - .saturating_add(Weight::from_parts(119_893, 0).saturating_mul(a.into())) - // Standard Error: 2_294 - .saturating_add(Weight::from_parts(12_747, 0).saturating_mul(p.into())) + // Standard Error: 8_950 + .saturating_add(Weight::from_parts(129_564, 0).saturating_mul(a.into())) + // Standard Error: 9_247 + .saturating_add(Weight::from_parts(7_791, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -158,11 +156,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `149 + p * (25 ±0)` // Estimated: `4310` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(21_921_957, 0) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(22_575_376, 0) .saturating_add(Weight::from_parts(0, 4310)) - // Standard Error: 1_693 - .saturating_add(Weight::from_parts(9_667, 0).saturating_mul(p.into())) + // Standard Error: 7_376 + .saturating_add(Weight::from_parts(34_705, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -174,10 +172,10 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Measured: `149 + p * (25 ±0)` // Estimated: `4310` // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_865_165, 0) + Weight::from_parts(22_895_966, 0) .saturating_add(Weight::from_parts(0, 4310)) - // Standard Error: 1_852 - .saturating_add(Weight::from_parts(7_270, 0).saturating_mul(p.into())) + // Standard Error: 7_963 + .saturating_add(Weight::from_parts(11_728, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -189,38 +187,38 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Measured: `149 + p * (25 ±0)` // Estimated: `4310` // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(20_898_631, 0) + Weight::from_parts(21_817_261, 0) .saturating_add(Weight::from_parts(0, 4310)) - // Standard Error: 2_130 - .saturating_add(Weight::from_parts(23_928, 0).saturating_mul(p.into())) + // Standard Error: 7_639 + .saturating_add(Weight::from_parts(17_057, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Proxy::Proxies` (r:1 w:1) /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(845), added: 3320, mode: `MaxEncodedLen`) /// The range of component `p` is `[1, 31]`. - fn create_pure(p: u32, ) -> Weight { + fn create_pure(_p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `161` // Estimated: `4310` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(22_881_540, 0) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(24_370_900, 0) .saturating_add(Weight::from_parts(0, 4310)) - // Standard Error: 1_227 - .saturating_add(Weight::from_parts(9_307, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Proxy::Proxies` (r:1 w:1) /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(845), added: 3320, mode: `MaxEncodedLen`) /// The range of component `p` is `[0, 30]`. - fn kill_pure(_p: u32, ) -> Weight { + fn kill_pure(p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `174 + p * (25 ±0)` // Estimated: `4310` // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_935_467, 0) + Weight::from_parts(22_602_233, 0) .saturating_add(Weight::from_parts(0, 4310)) + // Standard Error: 10_018 + .saturating_add(Weight::from_parts(38_000, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/darwinia/src/weights/pallet_referenda.rs b/runtime/darwinia/src/weights/pallet_referenda.rs index 274a53a03..a3f428328 100644 --- a/runtime/darwinia/src/weights/pallet_referenda.rs +++ b/runtime/darwinia/src/weights/pallet_referenda.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_referenda` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -65,8 +65,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `275` // Estimated: `42428` - // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(30_000_000, 0) + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(38_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) @@ -80,7 +80,7 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Measured: `516` // Estimated: `83866` // Minimum execution time: 37_000_000 picoseconds. - Weight::from_parts(39_000_000, 0) + Weight::from_parts(38_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -95,10 +95,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) fn place_decision_deposit_queued() -> Weight { // Proof Size summary in bytes: - // Measured: `3309` + // Measured: `3314` // Estimated: `42428` - // Minimum execution time: 43_000_000 picoseconds. - Weight::from_parts(43_000_000, 0) + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(55_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -113,10 +113,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) fn place_decision_deposit_not_queued() -> Weight { // Proof Size summary in bytes: - // Measured: `3329` + // Measured: `3334` // Estimated: `42428` - // Minimum execution time: 42_000_000 picoseconds. - Weight::from_parts(43_000_000, 0) + // Minimum execution time: 44_000_000 picoseconds. + Weight::from_parts(54_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -132,7 +132,7 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Measured: `516` // Estimated: `83866` // Minimum execution time: 45_000_000 picoseconds. - Weight::from_parts(47_000_000, 0) + Weight::from_parts(52_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -147,8 +147,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `516` // Estimated: `83866` - // Minimum execution time: 44_000_000 picoseconds. - Weight::from_parts(47_000_000, 0) + // Minimum execution time: 46_000_000 picoseconds. + Weight::from_parts(52_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -160,7 +160,7 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Measured: `425` // Estimated: `4377` // Minimum execution time: 25_000_000 picoseconds. - Weight::from_parts(27_000_000, 0) + Weight::from_parts(26_000_000, 0) .saturating_add(Weight::from_parts(0, 4377)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -171,8 +171,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `384` // Estimated: `4377` - // Minimum execution time: 25_000_000 picoseconds. - Weight::from_parts(26_000_000, 0) + // Minimum execution time: 26_000_000 picoseconds. + Weight::from_parts(27_000_000, 0) .saturating_add(Weight::from_parts(0, 4377)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -203,8 +203,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `880` // Estimated: `83866` - // Minimum execution time: 85_000_000 picoseconds. - Weight::from_parts(86_000_000, 0) + // Minimum execution time: 82_000_000 picoseconds. + Weight::from_parts(96_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -217,8 +217,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `207` // Estimated: `5477` - // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(8_000_000, 0) + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(10_000_000, 0) .saturating_add(Weight::from_parts(0, 5477)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -231,10 +231,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) fn one_fewer_deciding_failing() -> Weight { // Proof Size summary in bytes: - // Measured: `3195` + // Measured: `3179` // Estimated: `42428` - // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(27_000_000, 0) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(37_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -247,10 +247,10 @@ impl pallet_referenda::WeightInfo for WeightInfo { /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`) fn one_fewer_deciding_passing() -> Weight { // Proof Size summary in bytes: - // Measured: `3209` + // Measured: `3165` // Estimated: `42428` // Minimum execution time: 29_000_000 picoseconds. - Weight::from_parts(30_000_000, 0) + Weight::from_parts(33_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -263,8 +263,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3020` // Estimated: `5477` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(14_000_000, 0) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) .saturating_add(Weight::from_parts(0, 5477)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -277,8 +277,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3020` // Estimated: `5477` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 0) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 5477)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -293,8 +293,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3024` // Estimated: `5477` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(19_000_000, 0) .saturating_add(Weight::from_parts(0, 5477)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -309,8 +309,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3044` // Estimated: `5477` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(16_000_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(19_000_000, 0) .saturating_add(Weight::from_parts(0, 5477)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -338,7 +338,7 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Measured: `390` // Estimated: `42428` // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(17_000_000, 0) + Weight::from_parts(18_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -350,7 +350,7 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Measured: `299` // Estimated: `4377` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 4377)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -381,8 +381,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `390` // Estimated: `42428` - // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(25_000_000, 0) + // Minimum execution time: 23_000_000 picoseconds. + Weight::from_parts(24_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -395,8 +395,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `443` // Estimated: `42428` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_000_000, 0) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(25_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -410,7 +410,7 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Measured: `426` // Estimated: `42428` // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(19_000_000, 0) + Weight::from_parts(21_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -423,8 +423,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `443` // Estimated: `42428` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(18_000_000, 0) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(19_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -453,8 +453,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `447` // Estimated: `83866` - // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(28_000_000, 0) + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(33_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -486,7 +486,7 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Measured: `443` // Estimated: `4377` // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(16_000_000, 0) + Weight::from_parts(21_000_000, 0) .saturating_add(Weight::from_parts(0, 4377)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -499,8 +499,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `376` // Estimated: `4377` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 0) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 4377)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtime/darwinia/src/weights/pallet_scheduler.rs b/runtime/darwinia/src/weights/pallet_scheduler.rs index f95c1b1ed..5258d51fa 100644 --- a/runtime/darwinia/src/weights/pallet_scheduler.rs +++ b/runtime/darwinia/src/weights/pallet_scheduler.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -75,10 +75,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Measured: `78 + s * (177 ±0)` // Estimated: `42428` // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(5_597_112, 0) + Weight::from_parts(5_871_990, 0) .saturating_add(Weight::from_parts(0, 42428)) - // Standard Error: 1_626 - .saturating_add(Weight::from_parts(378_421, 0).saturating_mul(s.into())) + // Standard Error: 3_474 + .saturating_add(Weight::from_parts(391_272, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -102,10 +102,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Measured: `179 + s * (1 ±0)` // Estimated: `3644 + s * (1 ±0)` // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(5_444_460, 0) + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 3644)) - // Standard Error: 3 - .saturating_add(Weight::from_parts(444, 0).saturating_mul(s.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(515, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(s.into())) @@ -117,7 +117,7 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `0` // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + Weight::from_parts(5_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -142,7 +142,7 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `0` // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + Weight::from_parts(3_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `Scheduler::Agenda` (r:1 w:1) @@ -152,11 +152,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `78 + s * (177 ±0)` // Estimated: `42428` - // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(10_836_235, 0) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(11_255_764, 0) .saturating_add(Weight::from_parts(0, 42428)) - // Standard Error: 1_646 - .saturating_add(Weight::from_parts(362_847, 0).saturating_mul(s.into())) + // Standard Error: 5_709 + .saturating_add(Weight::from_parts(409_315, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -169,11 +169,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `78 + s * (177 ±0)` // Estimated: `42428` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(11_572_734, 0) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(12_321_142, 0) .saturating_add(Weight::from_parts(0, 42428)) - // Standard Error: 1_374 - .saturating_add(Weight::from_parts(578_559, 0).saturating_mul(s.into())) + // Standard Error: 6_710 + .saturating_add(Weight::from_parts(633_210, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -187,10 +187,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Measured: `255 + s * (185 ±0)` // Estimated: `42428` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(14_313_176, 0) + Weight::from_parts(16_528_470, 0) .saturating_add(Weight::from_parts(0, 42428)) - // Standard Error: 2_166 - .saturating_add(Weight::from_parts(373_829, 0).saturating_mul(s.into())) + // Standard Error: 12_470 + .saturating_add(Weight::from_parts(416_144, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -204,10 +204,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Measured: `281 + s * (185 ±0)` // Estimated: `42428` // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(13_578_285, 0) + Weight::from_parts(15_350_612, 0) .saturating_add(Weight::from_parts(0, 42428)) - // Standard Error: 1_137 - .saturating_add(Weight::from_parts(596_067, 0).saturating_mul(s.into())) + // Standard Error: 6_616 + .saturating_add(Weight::from_parts(618_093, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/darwinia/src/weights/pallet_session.rs b/runtime/darwinia/src/weights/pallet_session.rs index d6a8fa96f..cc8cfb9df 100644 --- a/runtime/darwinia/src/weights/pallet_session.rs +++ b/runtime/darwinia/src/weights/pallet_session.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_session` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -78,7 +78,7 @@ impl pallet_session::WeightInfo for WeightInfo { // Measured: `228` // Estimated: `3693` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + Weight::from_parts(13_000_000, 0) .saturating_add(Weight::from_parts(0, 3693)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtime/darwinia/src/weights/pallet_timestamp.rs b/runtime/darwinia/src/weights/pallet_timestamp.rs index 2a5e60e17..862242cad 100644 --- a/runtime/darwinia/src/weights/pallet_timestamp.rs +++ b/runtime/darwinia/src/weights/pallet_timestamp.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_timestamp` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -61,8 +61,8 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `1493` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 4_000_000 picoseconds. + Weight::from_parts(5_000_000, 0) .saturating_add(Weight::from_parts(0, 1493)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtime/darwinia/src/weights/pallet_treasury.rs b/runtime/darwinia/src/weights/pallet_treasury.rs index cf11f06d2..0b38fdc7b 100644 --- a/runtime/darwinia/src/weights/pallet_treasury.rs +++ b/runtime/darwinia/src/weights/pallet_treasury.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_treasury` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -65,8 +65,8 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `109` // Estimated: `1887` - // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 1887)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) @@ -79,8 +79,8 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `275` // Estimated: `1489` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(24_000_000, 0) + // Minimum execution time: 24_000_000 picoseconds. + Weight::from_parts(25_000_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -108,11 +108,11 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `537 + p * (8 ±0)` // Estimated: `3549` - // Minimum execution time: 6_000_000 picoseconds. - Weight::from_parts(8_680_628, 0) + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(10_364_812, 0) .saturating_add(Weight::from_parts(0, 3549)) - // Standard Error: 794 - .saturating_add(Weight::from_parts(17_204, 0).saturating_mul(p.into())) + // Standard Error: 2_150 + .saturating_add(Weight::from_parts(24_626, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -123,7 +123,7 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Measured: `194` // Estimated: `1887` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(5_000_000, 0) + Weight::from_parts(6_000_000, 0) .saturating_add(Weight::from_parts(0, 1887)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -143,11 +143,11 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `328 + p * (97 ±0)` // Estimated: `3581 + p * (2559 ±0)` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(16_684_026, 0) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(30_538_237, 0) .saturating_add(Weight::from_parts(0, 3581)) - // Standard Error: 5_581 - .saturating_add(Weight::from_parts(2_419_379, 0).saturating_mul(p.into())) + // Standard Error: 72_753 + .saturating_add(Weight::from_parts(2_692_855, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -161,7 +161,7 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `109` // Estimated: `1489` - // Minimum execution time: 8_000_000 picoseconds. + // Minimum execution time: 7_000_000 picoseconds. Weight::from_parts(8_000_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) @@ -175,8 +175,8 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `416` // Estimated: `6172` - // Minimum execution time: 48_000_000 picoseconds. - Weight::from_parts(49_000_000, 0) + // Minimum execution time: 49_000_000 picoseconds. + Weight::from_parts(51_000_000, 0) .saturating_add(Weight::from_parts(0, 6172)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -187,8 +187,8 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `215` // Estimated: `3522` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 0) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(13_000_000, 0) .saturating_add(Weight::from_parts(0, 3522)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -199,8 +199,8 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `215` // Estimated: `3522` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 0) .saturating_add(Weight::from_parts(0, 3522)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtime/darwinia/src/weights/pallet_utility.rs b/runtime/darwinia/src/weights/pallet_utility.rs index 9497861fe..881e6aaa0 100644 --- a/runtime/darwinia/src/weights/pallet_utility.rs +++ b/runtime/darwinia/src/weights/pallet_utility.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_utility` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -60,11 +60,11 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(8_163_691, 0) + // Minimum execution time: 4_000_000 picoseconds. + Weight::from_parts(13_536_226, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 2_661 - .saturating_add(Weight::from_parts(3_516_152, 0).saturating_mul(c.into())) + // Standard Error: 15_122 + .saturating_add(Weight::from_parts(3_778_643, 0).saturating_mul(c.into())) } fn as_derivative() -> Weight { // Proof Size summary in bytes: @@ -80,17 +80,17 @@ impl pallet_utility::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `0` // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(8_605_755, 0) + Weight::from_parts(1_695_457, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3_441 - .saturating_add(Weight::from_parts(3_778_083, 0).saturating_mul(c.into())) + // Standard Error: 18_788 + .saturating_add(Weight::from_parts(4_094_435, 0).saturating_mul(c.into())) } fn dispatch_as() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_000_000 picoseconds. - Weight::from_parts(6_000_000, 0) + // Minimum execution time: 7_000_000 picoseconds. + Weight::from_parts(7_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -99,9 +99,9 @@ impl pallet_utility::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `0` // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + Weight::from_parts(4_366_648, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 2_282 - .saturating_add(Weight::from_parts(3_563_062, 0).saturating_mul(c.into())) + // Standard Error: 17_973 + .saturating_add(Weight::from_parts(3_855_063, 0).saturating_mul(c.into())) } } diff --git a/runtime/darwinia/src/weights/pallet_whitelist.rs b/runtime/darwinia/src/weights/pallet_whitelist.rs index a4d6fa928..6b70d94c2 100644 --- a/runtime/darwinia/src/weights/pallet_whitelist.rs +++ b/runtime/darwinia/src/weights/pallet_whitelist.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_whitelist` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("darwinia-dev")`, DB CACHE: 1024 @@ -101,10 +101,10 @@ impl pallet_whitelist::WeightInfo for WeightInfo { // Measured: `252 + n * (1 ±0)` // Estimated: `3716 + n * (1 ±0)` // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(25_000_000, 0) + Weight::from_parts(24_000_000, 0) .saturating_add(Weight::from_parts(0, 3716)) - // Standard Error: 1 - .saturating_add(Weight::from_parts(466, 0).saturating_mul(n.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(550, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) @@ -120,11 +120,11 @@ impl pallet_whitelist::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `176` // Estimated: `3544` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(17_439_358, 0) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(20_290_598, 0) .saturating_add(Weight::from_parts(0, 3544)) - // Standard Error: 5 - .saturating_add(Weight::from_parts(992, 0).saturating_mul(n.into())) + // Standard Error: 39 + .saturating_add(Weight::from_parts(1_090, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/koi/Cargo.toml b/runtime/koi/Cargo.toml index 730fb4ba4..ec3f6beb3 100644 --- a/runtime/koi/Cargo.toml +++ b/runtime/koi/Cargo.toml @@ -291,7 +291,6 @@ try-runtime = [ # darwinia "darwinia-asset-limit/try-runtime", "darwinia-deposit/try-runtime", - "darwinia-ethtx-forwarder/try-runtime", "darwinia-staking/try-runtime", # moonbeam diff --git a/runtime/koi/src/lib.rs b/runtime/koi/src/lib.rs index 7d24c18f6..86e3252c1 100644 --- a/runtime/koi/src/lib.rs +++ b/runtime/koi/src/lib.rs @@ -164,7 +164,6 @@ frame_benchmarking::define_benchmarks! { [pallet_balances, Balances] [pallet_collective, TechnicalCommittee] [pallet_conviction_voting, ConvictionVoting] - [pallet_evm, EVM] [pallet_message_queue, MessageQueue] [pallet_preimage, Preimage] [pallet_proxy, Proxy] diff --git a/runtime/koi/src/migration.rs b/runtime/koi/src/migration.rs index 2df0bfd6d..5047bc277 100644 --- a/runtime/koi/src/migration.rs +++ b/runtime/koi/src/migration.rs @@ -45,9 +45,6 @@ impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade { } fn migrate() -> frame_support::weights::Weight { - frame_support::traits::StorageVersion::new(2) - .put::>(); - - // frame_support::weights::Weight::zero() - ::DbWeight::get().reads_writes(0, 1) + frame_support::weights::Weight::zero() + // ::DbWeight::get().reads_writes(0, 1) } diff --git a/runtime/koi/src/pallets/deposit.rs b/runtime/koi/src/pallets/deposit.rs index ad51b2ba0..69fba65e9 100644 --- a/runtime/koi/src/pallets/deposit.rs +++ b/runtime/koi/src/pallets/deposit.rs @@ -44,10 +44,12 @@ impl darwinia_deposit::SimpleAsset for KtonMinting { } impl darwinia_deposit::Config for Runtime { + type DepositMigrator = darwinia_deposit::DepositMigrator; type Kton = KtonMinting; type MaxDeposits = ConstU32<512>; type MinLockingAmount = ConstU128; type Ring = Balances; type RuntimeEvent = RuntimeEvent; + type Treasury = pallet_config::TreasuryAccount; type WeightInfo = weights::darwinia_deposit::WeightInfo; } diff --git a/runtime/koi/src/pallets/staking.rs b/runtime/koi/src/pallets/staking.rs index cb445cb73..e444a9029 100644 --- a/runtime/koi/src/pallets/staking.rs +++ b/runtime/koi/src/pallets/staking.rs @@ -42,68 +42,19 @@ impl darwinia_staking::Stake for RingStaking { ) } } -pub enum KtonStaking {} -impl darwinia_staking::Stake for KtonStaking { - type AccountId = AccountId; - type Item = Balance; - - fn stake(who: &Self::AccountId, item: Self::Item) -> sp_runtime::DispatchResult { - Assets::transfer( - RuntimeOrigin::signed(*who), - (AssetIds::KKton as AssetId).into(), - darwinia_staking::account_id(), - item, - ) - } - - fn unstake(who: &Self::AccountId, item: Self::Item) -> sp_runtime::DispatchResult { - Assets::transfer( - RuntimeOrigin::signed(darwinia_staking::account_id()), - (AssetIds::KKton as AssetId).into(), - *who, - item, - ) - } -} - -pub enum OnKoiSessionEnd {} -impl darwinia_staking::IssuingManager for OnKoiSessionEnd { - fn calculate_reward(_inflation: Balance) -> Balance { - 20_000 * UNIT - } - - fn reward(who: &AccountId, amount: Balance) -> sp_runtime::DispatchResult { - >::transfer( - &Treasury::account_id(), - who, - amount, - frame_support::traits::ExistenceRequirement::KeepAlive, - ) - } -} - -pub enum ShouldEndSession {} -impl frame_support::traits::Get for ShouldEndSession { - fn get() -> bool { - // polkadot-sdk - use pallet_session::ShouldEndSession; - - ::ShouldEndSession::should_end_session( - System::block_number(), - ) - } -} impl darwinia_staking::Config for Runtime { type Currency = Balances; type Deposit = Deposit; - type IssuingManager = OnKoiSessionEnd; - type Kton = KtonStaking; - type KtonStakerNotifier = darwinia_staking::KtonStakerNotifier; + type IssuingManager = darwinia_staking::BalanceIssuing; + type KtonStaking = darwinia_staking::KtonStaking; type MaxDeposits = ::MaxDeposits; type Ring = RingStaking; + type RingStaking = darwinia_staking::RingStaking; type RuntimeEvent = RuntimeEvent; - type ShouldEndSession = ShouldEndSession; + type ShouldEndSession = darwinia_staking::ShouldEndSession; + type Treasury = pallet_config::TreasuryAccount; + type UnixTime = Timestamp; type WeightInfo = weights::darwinia_staking::WeightInfo; } #[cfg(not(feature = "runtime-benchmarks"))] diff --git a/runtime/koi/src/weights/cumulus_pallet_parachain_system.rs b/runtime/koi/src/weights/cumulus_pallet_parachain_system.rs index 4f633cfa4..00d8cb921 100644 --- a/runtime/koi/src/weights/cumulus_pallet_parachain_system.rs +++ b/runtime/koi/src/weights/cumulus_pallet_parachain_system.rs @@ -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-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -73,8 +73,8 @@ impl cumulus_pallet_parachain_system::WeightInfo for We // Minimum execution time: 2_000_000 picoseconds. Weight::from_parts(3_000_000, 0) .saturating_add(Weight::from_parts(0, 3517)) - // Standard Error: 43_768 - .saturating_add(Weight::from_parts(100_147_420, 0).saturating_mul(n.into())) + // Standard Error: 58_621 + .saturating_add(Weight::from_parts(104_049_044, 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()))) diff --git a/runtime/koi/src/weights/cumulus_pallet_xcmp_queue.rs b/runtime/koi/src/weights/cumulus_pallet_xcmp_queue.rs index 835628f87..c11528041 100644 --- a/runtime/koi/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/runtime/koi/src/weights/cumulus_pallet_xcmp_queue.rs @@ -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-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -82,7 +82,7 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Measured: `48` // Estimated: `3517` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) + Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(0, 3517)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -116,7 +116,7 @@ impl 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) @@ -137,8 +137,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `65677` // Estimated: `69142` - // Minimum execution time: 45_000_000 picoseconds. - Weight::from_parts(46_000_000, 0) + // Minimum execution time: 50_000_000 picoseconds. + Weight::from_parts(58_000_000, 0) .saturating_add(Weight::from_parts(0, 69142)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) @@ -151,8 +151,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `65676` // Estimated: `69141` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(29_000_000, 0) + // Minimum execution time: 30_000_000 picoseconds. + Weight::from_parts(33_000_000, 0) .saturating_add(Weight::from_parts(0, 69141)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtime/koi/src/weights/darwinia_deposit.rs b/runtime/koi/src/weights/darwinia_deposit.rs index 103ffa4c3..172164848 100644 --- a/runtime/koi/src/weights/darwinia_deposit.rs +++ b/runtime/koi/src/weights/darwinia_deposit.rs @@ -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-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -69,8 +69,8 @@ impl darwinia_deposit::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `26812` // Estimated: `29615` - // Minimum execution time: 82_000_000 picoseconds. - Weight::from_parts(93_000_000, 0) + // Minimum execution time: 81_000_000 picoseconds. + Weight::from_parts(92_000_000, 0) .saturating_add(Weight::from_parts(0, 29615)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -85,8 +85,8 @@ impl darwinia_deposit::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `26541` // Estimated: `29615` - // Minimum execution time: 943_000_000 picoseconds. - Weight::from_parts(968_000_000, 0) + // Minimum execution time: 66_000_000 picoseconds. + Weight::from_parts(70_000_000, 0) .saturating_add(Weight::from_parts(0, 29615)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -105,10 +105,47 @@ impl darwinia_deposit::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `26863` // Estimated: `29615` - // Minimum execution time: 86_000_000 picoseconds. - Weight::from_parts(99_000_000, 0) + // Minimum execution time: 90_000_000 picoseconds. + Weight::from_parts(98_000_000, 0) .saturating_add(Weight::from_parts(0, 29615)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } + /// Storage: `Deposit::Deposits` (r:1 w:1) + /// Proof: `Deposit::Deposits` (`max_values`: None, `max_size`: Some(26150), added: 28625, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:3 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`) + /// Storage: `Deposit::DepositContract` (r:1 w:0) + /// Proof: `Deposit::DepositContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + /// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0) + /// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `EVM::AccountCodes` (r:2 w:0) + /// Proof: `EVM::AccountCodes` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Digest` (r:1 w:0) + /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Ethereum::Pending` (r:1 w:1) + /// Proof: `Ethereum::Pending` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn migrate() -> Weight { + // Proof Size summary in bytes: + // Measured: `27516` + // Estimated: `33456` + // Minimum execution time: 4_027_000_000 picoseconds. + Weight::from_parts(4_420_000_000, 0) + .saturating_add(Weight::from_parts(0, 33456)) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `Deposit::DepositContract` (r:0 w:1) + /// Proof: `Deposit::DepositContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + fn set_deposit_contract() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } } diff --git a/runtime/koi/src/weights/darwinia_staking.rs b/runtime/koi/src/weights/darwinia_staking.rs index c3be04aec..365b6fc7b 100644 --- a/runtime/koi/src/weights/darwinia_staking.rs +++ b/runtime/koi/src/weights/darwinia_staking.rs @@ -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-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -70,11 +70,11 @@ impl darwinia_staking::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `7088 + x * (25 ±0)` // Estimated: `29615` - // Minimum execution time: 47_000_000 picoseconds. - Weight::from_parts(653_462_438, 0) + // Minimum execution time: 48_000_000 picoseconds. + Weight::from_parts(713_221_476, 0) .saturating_add(Weight::from_parts(0, 29615)) - // Standard Error: 242_063 - .saturating_add(Weight::from_parts(12_354_738, 0).saturating_mul(x.into())) + // Standard Error: 256_283 + .saturating_add(Weight::from_parts(12_886_306, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -93,11 +93,11 @@ impl darwinia_staking::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `7415 + x * (26 ±0)` // Estimated: `29615` - // Minimum execution time: 48_000_000 picoseconds. - Weight::from_parts(690_303_938, 0) + // Minimum execution time: 50_000_000 picoseconds. + Weight::from_parts(754_642_664, 0) .saturating_add(Weight::from_parts(0, 29615)) - // Standard Error: 243_509 - .saturating_add(Weight::from_parts(12_382_062, 0).saturating_mul(x.into())) + // Standard Error: 263_617 + .saturating_add(Weight::from_parts(13_048_816, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -107,8 +107,8 @@ impl darwinia_staking::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `388` // Estimated: `3497` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 3497)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,10 +121,10 @@ impl darwinia_staking::WeightInfo for WeightInfo { /// Proof: `DarwiniaStaking::Nominators` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) fn nominate() -> Weight { // Proof Size summary in bytes: - // Measured: `574` + // Measured: `600` // Estimated: `4543` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 4543)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -148,17 +148,17 @@ impl darwinia_staking::WeightInfo for WeightInfo { /// Proof: `DarwiniaStaking::ExposureCache2` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `DarwiniaStaking::PendingRewards` (r:1 w:1) /// Proof: `DarwiniaStaking::PendingRewards` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:0) + /// Storage: `System::Account` (r:32 w:32) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`) fn payout() -> Weight { // Proof Size summary in bytes: - // Measured: `1845` - // Estimated: `5310` - // Minimum execution time: 135_000_000 picoseconds. - Weight::from_parts(143_000_000, 0) - .saturating_add(Weight::from_parts(0, 5310)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `2330` + // Estimated: `83902` + // Minimum execution time: 534_000_000 picoseconds. + Weight::from_parts(626_000_000, 0) + .saturating_add(Weight::from_parts(0, 83902)) + .saturating_add(T::DbWeight::get().reads(35)) + .saturating_add(T::DbWeight::get().writes(34)) } /// Storage: `DarwiniaStaking::RateLimit` (r:0 w:1) /// Proof: `DarwiniaStaking::RateLimit` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) @@ -167,18 +167,28 @@ impl darwinia_staking::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `0` // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + Weight::from_parts(3_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: `DarwiniaStaking::KtonRewardDistributionContract` (r:0 w:1) - /// Proof: `DarwiniaStaking::KtonRewardDistributionContract` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - fn set_kton_reward_distribution_contract() -> Weight { + /// Storage: `DarwiniaStaking::RingStakingContract` (r:0 w:1) + /// Proof: `DarwiniaStaking::RingStakingContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + fn set_ring_staking_contract() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(2_000_000, 0) + Weight::from_parts(3_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } /// Storage: `DarwiniaStaking::KtonStakingContract` (r:0 w:1) + /// Proof: `DarwiniaStaking::KtonStakingContract` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + fn set_kton_staking_contract() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(3_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/koi/src/weights/frame_system.rs b/runtime/koi/src/weights/frame_system.rs index cec635839..c10888f71 100644 --- a/runtime/koi/src/weights/frame_system.rs +++ b/runtime/koi/src/weights/frame_system.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `frame_system` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -60,22 +60,22 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. - Weight::from_parts(2_268_293, 0) + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(4_417_236, 0) .saturating_add(Weight::from_parts(0, 0)) // Standard Error: 0 - .saturating_add(Weight::from_parts(150, 0).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(156, 0).saturating_mul(b.into())) } /// The range of component `b` is `[0, 3932160]`. fn remark_with_event(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. + // Minimum execution time: 5_000_000 picoseconds. Weight::from_parts(5_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 0 - .saturating_add(Weight::from_parts(945, 0).saturating_mul(b.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(993, 0).saturating_mul(b.into())) } /// Storage: `System::Digest` (r:1 w:1) /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -107,8 +107,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `198` // Estimated: `1683` - // Minimum execution time: 67_336_000_000 picoseconds. - Weight::from_parts(71_187_000_000, 0) + // Minimum execution time: 70_989_000_000 picoseconds. + Weight::from_parts(74_848_000_000, 0) .saturating_add(Weight::from_parts(0, 1683)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -120,11 +120,11 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. + // Minimum execution time: 2_000_000 picoseconds. Weight::from_parts(2_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 4_764 - .saturating_add(Weight::from_parts(774_928, 0).saturating_mul(i.into())) + // Standard Error: 2_331 + .saturating_add(Weight::from_parts(804_469, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -134,11 +134,11 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_000_000 picoseconds. + // Minimum execution time: 2_000_000 picoseconds. Weight::from_parts(2_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 867 - .saturating_add(Weight::from_parts(532_385, 0).saturating_mul(i.into())) + // Standard Error: 1_491 + .saturating_add(Weight::from_parts(567_168, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -146,13 +146,13 @@ impl frame_system::WeightInfo for WeightInfo { /// The range of component `p` is `[0, 1000]`. fn kill_prefix(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `88 + p * (69 ±0)` - // Estimated: `92 + p * (70 ±0)` - // Minimum execution time: 4_000_000 picoseconds. + // Measured: `89 + p * (69 ±0)` + // Estimated: `94 + p * (70 ±0)` + // Minimum execution time: 3_000_000 picoseconds. Weight::from_parts(4_000_000, 0) - .saturating_add(Weight::from_parts(0, 92)) - // Standard Error: 1_084 - .saturating_add(Weight::from_parts(975_384, 0).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 94)) + // Standard Error: 2_915 + .saturating_add(Weight::from_parts(1_044_881, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) .saturating_add(Weight::from_parts(0, 70).saturating_mul(p.into())) @@ -163,8 +163,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_000_000 picoseconds. - Weight::from_parts(7_000_000, 0) + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -186,8 +186,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `220` // Estimated: `1705` - // Minimum execution time: 68_599_000_000 picoseconds. - Weight::from_parts(73_876_000_000, 0) + // Minimum execution time: 75_450_000_000 picoseconds. + Weight::from_parts(80_770_000_000, 0) .saturating_add(Weight::from_parts(0, 1705)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtime/koi/src/weights/pallet_asset_manager.rs b/runtime/koi/src/weights/pallet_asset_manager.rs index d3ab9406a..4041fbc12 100644 --- a/runtime/koi/src/weights/pallet_asset_manager.rs +++ b/runtime/koi/src/weights/pallet_asset_manager.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_asset_manager` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -67,8 +67,8 @@ impl pallet_asset_manager::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `276` // Estimated: `3741` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(29_000_000, 0) + // Minimum execution time: 30_000_000 picoseconds. + Weight::from_parts(30_000_000, 0) .saturating_add(Weight::from_parts(0, 3741)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) @@ -85,10 +85,10 @@ impl pallet_asset_manager::WeightInfo for WeightInfo // Measured: `595 + x * (9 ±0)` // Estimated: `3983 + x * (10 ±0)` // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(16_313_288, 0) + Weight::from_parts(20_209_116, 0) .saturating_add(Weight::from_parts(0, 3983)) - // Standard Error: 2_365 - .saturating_add(Weight::from_parts(333_385, 0).saturating_mul(x.into())) + // Standard Error: 5_727 + .saturating_add(Weight::from_parts(344_576, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 10).saturating_mul(x.into())) @@ -106,11 +106,11 @@ impl pallet_asset_manager::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `968 + x * (13 ±0)` // Estimated: `4303 + x * (14 ±0)` - // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(25_074_438, 0) + // Minimum execution time: 25_000_000 picoseconds. + Weight::from_parts(28_993_534, 0) .saturating_add(Weight::from_parts(0, 4303)) - // Standard Error: 2_774 - .saturating_add(Weight::from_parts(338_361, 0).saturating_mul(x.into())) + // Standard Error: 6_928 + .saturating_add(Weight::from_parts(386_014, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(6)) .saturating_add(Weight::from_parts(0, 14).saturating_mul(x.into())) @@ -124,11 +124,11 @@ impl pallet_asset_manager::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `196 + x * (5 ±0)` // Estimated: `1678 + x * (5 ±0)` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(10_468_267, 0) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(11_943_329, 0) .saturating_add(Weight::from_parts(0, 1678)) - // Standard Error: 2_533 - .saturating_add(Weight::from_parts(296_419, 0).saturating_mul(x.into())) + // Standard Error: 4_562 + .saturating_add(Weight::from_parts(325_272, 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, 5).saturating_mul(x.into())) @@ -147,10 +147,10 @@ impl pallet_asset_manager::WeightInfo for WeightInfo // Measured: `486 + x * (10 ±0)` // Estimated: `3949 + x * (10 ±0)` // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_047_312, 0) + Weight::from_parts(20_951_661, 0) .saturating_add(Weight::from_parts(0, 3949)) - // Standard Error: 2_328 - .saturating_add(Weight::from_parts(282_558, 0).saturating_mul(x.into())) + // Standard Error: 5_591 + .saturating_add(Weight::from_parts(333_493, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(Weight::from_parts(0, 10).saturating_mul(x.into())) diff --git a/runtime/koi/src/weights/pallet_assets.rs b/runtime/koi/src/weights/pallet_assets.rs index 866d6aafe..0e27ae2c5 100644 --- a/runtime/koi/src/weights/pallet_assets.rs +++ b/runtime/koi/src/weights/pallet_assets.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_assets` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -62,7 +62,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `157` // Estimated: `3631` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + Weight::from_parts(11_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -74,7 +74,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `157` // Estimated: `3631` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + Weight::from_parts(13_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -85,7 +85,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `307` // Estimated: `3631` - // Minimum execution time: 10_000_000 picoseconds. + // Minimum execution time: 9_000_000 picoseconds. Weight::from_parts(10_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(1)) @@ -100,13 +100,13 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 1000]`. fn destroy_accounts(c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `821 + c * (183 ±0)` + // Measured: `820 + c * (183 ±0)` // Estimated: `3631 + c * (2591 ±0)` // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(57_779_552, 0) + Weight::from_parts(18_889_041, 0) .saturating_add(Weight::from_parts(0, 3631)) - // Standard Error: 39_269 - .saturating_add(Weight::from_parts(10_801_270, 0).saturating_mul(c.into())) + // Standard Error: 36_945 + .saturating_add(Weight::from_parts(11_531_247, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -125,8 +125,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Minimum execution time: 13_000_000 picoseconds. Weight::from_parts(13_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) - // Standard Error: 9_351 - .saturating_add(Weight::from_parts(4_038_535, 0).saturating_mul(a.into())) + // Standard Error: 10_046 + .saturating_add(Weight::from_parts(4_316_338, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -169,8 +169,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `410` // Estimated: `3631` - // Minimum execution time: 26_000_000 picoseconds. - Weight::from_parts(27_000_000, 0) + // Minimum execution time: 25_000_000 picoseconds. + Weight::from_parts(26_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -185,8 +185,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `449` // Estimated: `6168` - // Minimum execution time: 35_000_000 picoseconds. - Weight::from_parts(36_000_000, 0) + // Minimum execution time: 36_000_000 picoseconds. + Weight::from_parts(37_000_000, 0) .saturating_add(Weight::from_parts(0, 6168)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -201,8 +201,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `449` // Estimated: `6168` - // Minimum execution time: 33_000_000 picoseconds. - Weight::from_parts(34_000_000, 0) + // Minimum execution time: 32_000_000 picoseconds. + Weight::from_parts(38_000_000, 0) .saturating_add(Weight::from_parts(0, 6168)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -217,8 +217,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `449` // Estimated: `6168` - // Minimum execution time: 36_000_000 picoseconds. - Weight::from_parts(37_000_000, 0) + // Minimum execution time: 38_000_000 picoseconds. + Weight::from_parts(45_000_000, 0) .saturating_add(Weight::from_parts(0, 6168)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -245,8 +245,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `410` // Estimated: `3631` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(13_000_000, 0) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -257,8 +257,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `307` // Estimated: `3631` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -269,8 +269,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `307` // Estimated: `3631` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -283,7 +283,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `350` // Estimated: `3631` - // Minimum execution time: 12_000_000 picoseconds. + // Minimum execution time: 11_000_000 picoseconds. Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) @@ -296,7 +296,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `307` // Estimated: `3631` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + Weight::from_parts(11_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -307,17 +307,15 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(144), added: 2619, mode: `MaxEncodedLen`) /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn set_metadata(n: u32, s: u32, ) -> Weight { + fn set_metadata(_n: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `350` // Estimated: `3631` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_101_009, 0) + Weight::from_parts(13_246_244, 0) .saturating_add(Weight::from_parts(0, 3631)) - // Standard Error: 1_067 - .saturating_add(Weight::from_parts(1_795, 0).saturating_mul(n.into())) - // Standard Error: 1_067 - .saturating_add(Weight::from_parts(2_337, 0).saturating_mul(s.into())) + // Standard Error: 3_156 + .saturating_add(Weight::from_parts(4_629, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -329,8 +327,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `478` // Estimated: `3631` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 0) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -345,8 +343,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `237` // Estimated: `3631` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_725_066, 0) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(13_511_667, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -359,8 +357,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `478` // Estimated: `3631` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -385,7 +383,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `307` // Estimated: `3631` - // Minimum execution time: 14_000_000 picoseconds. + // Minimum execution time: 15_000_000 picoseconds. Weight::from_parts(15_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) @@ -404,7 +402,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `599` // Estimated: `6168` // Minimum execution time: 42_000_000 picoseconds. - Weight::from_parts(43_000_000, 0) + Weight::from_parts(44_000_000, 0) .saturating_add(Weight::from_parts(0, 6168)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) @@ -417,8 +415,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `457` // Estimated: `3631` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 0) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(19_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -443,8 +441,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `307` // Estimated: `3631` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 0) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(13_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -459,8 +457,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `512` // Estimated: `3631` - // Minimum execution time: 30_000_000 picoseconds. - Weight::from_parts(31_000_000, 0) + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(35_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -473,8 +471,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `350` // Estimated: `3631` - // Minimum execution time: 27_000_000 picoseconds. - Weight::from_parts(27_000_000, 0) + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(33_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -503,8 +501,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `448` // Estimated: `3631` - // Minimum execution time: 25_000_000 picoseconds. - Weight::from_parts(27_000_000, 0) + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(32_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -518,7 +516,7 @@ impl pallet_assets::WeightInfo for WeightInfo { // Measured: `410` // Estimated: `3631` // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(13_000_000, 0) + Weight::from_parts(15_000_000, 0) .saturating_add(Weight::from_parts(0, 3631)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtime/koi/src/weights/pallet_balances.rs b/runtime/koi/src/weights/pallet_balances.rs index 1e7127c3b..12556b5f9 100644 --- a/runtime/koi/src/weights/pallet_balances.rs +++ b/runtime/koi/src/weights/pallet_balances.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_balances` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -61,8 +61,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `39` // Estimated: `3581` - // Minimum execution time: 43_000_000 picoseconds. - Weight::from_parts(44_000_000, 0) + // Minimum execution time: 47_000_000 picoseconds. + Weight::from_parts(53_000_000, 0) .saturating_add(Weight::from_parts(0, 3581)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -73,7 +73,7 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `39` // Estimated: `3581` - // Minimum execution time: 36_000_000 picoseconds. + // Minimum execution time: 37_000_000 picoseconds. Weight::from_parts(39_000_000, 0) .saturating_add(Weight::from_parts(0, 3581)) .saturating_add(T::DbWeight::get().reads(1)) @@ -86,7 +86,7 @@ impl pallet_balances::WeightInfo for WeightInfo { // Measured: `195` // Estimated: `3581` // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(14_000_000, 0) + Weight::from_parts(15_000_000, 0) .saturating_add(Weight::from_parts(0, 3581)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,8 +109,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `234` // Estimated: `6172` - // Minimum execution time: 46_000_000 picoseconds. - Weight::from_parts(49_000_000, 0) + // Minimum execution time: 50_000_000 picoseconds. + Weight::from_parts(57_000_000, 0) .saturating_add(Weight::from_parts(0, 6172)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -121,8 +121,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `39` // Estimated: `3581` - // Minimum execution time: 48_000_000 picoseconds. - Weight::from_parts(49_000_000, 0) + // Minimum execution time: 49_000_000 picoseconds. + Weight::from_parts(54_000_000, 0) .saturating_add(Weight::from_parts(0, 3581)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -144,13 +144,13 @@ impl pallet_balances::WeightInfo for WeightInfo { /// The range of component `u` is `[1, 1000]`. fn upgrade_accounts(u: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `424 + u * (124 ±0)` + // Measured: `458 + u * (124 ±0)` // Estimated: `990 + u * (2591 ±0)` // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(16_000_000, 0) + Weight::from_parts(17_000_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 19_096 - .saturating_add(Weight::from_parts(13_003_237, 0).saturating_mul(u.into())) + // Standard Error: 22_067 + .saturating_add(Weight::from_parts(14_037_134, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2591).saturating_mul(u.into())) @@ -162,7 +162,7 @@ impl pallet_balances::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `1501` // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 0) + Weight::from_parts(5_000_000, 0) .saturating_add(Weight::from_parts(0, 1501)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtime/koi/src/weights/pallet_collective.rs b/runtime/koi/src/weights/pallet_collective.rs index 3a9d25476..b7b0c6e18 100644 --- a/runtime/koi/src/weights/pallet_collective.rs +++ b/runtime/koi/src/weights/pallet_collective.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_collective` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -70,13 +70,13 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0 + m * (2021 ±0) + p * (2026 ±0)` // Estimated: `12200 + m * (1231 ±15) + p * (3660 ±15)` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(11_000_000, 0) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(13_000_000, 0) .saturating_add(Weight::from_parts(0, 12200)) - // Standard Error: 70_896 - .saturating_add(Weight::from_parts(3_167_004, 0).saturating_mul(m.into())) - // Standard Error: 70_896 - .saturating_add(Weight::from_parts(4_540_655, 0).saturating_mul(p.into())) + // Standard Error: 45_994 + .saturating_add(Weight::from_parts(2_608_930, 0).saturating_mul(m.into())) + // Standard Error: 45_994 + .saturating_add(Weight::from_parts(5_749_452, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -95,12 +95,10 @@ impl pallet_collective::WeightInfo for WeightInfo { // Measured: `73 + m * (20 ±0)` // Estimated: `3997 + m * (20 ±0)` // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(14_244_966, 0) + Weight::from_parts(15_709_724, 0) .saturating_add(Weight::from_parts(0, 3997)) - // Standard Error: 40 - .saturating_add(Weight::from_parts(728, 0).saturating_mul(b.into())) - // Standard Error: 412 - .saturating_add(Weight::from_parts(2_042, 0).saturating_mul(m.into())) + // Standard Error: 172 + .saturating_add(Weight::from_parts(375, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(Weight::from_parts(0, 20).saturating_mul(m.into())) } @@ -117,12 +115,12 @@ impl pallet_collective::WeightInfo for WeightInfo { // Measured: `73 + m * (20 ±0)` // Estimated: `3997 + m * (20 ±0)` // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(15_664_697, 0) + Weight::from_parts(16_328_339, 0) .saturating_add(Weight::from_parts(0, 3997)) - // Standard Error: 43 - .saturating_add(Weight::from_parts(1_057, 0).saturating_mul(b.into())) - // Standard Error: 445 - .saturating_add(Weight::from_parts(5_419, 0).saturating_mul(m.into())) + // Standard Error: 213 + .saturating_add(Weight::from_parts(1_773, 0).saturating_mul(b.into())) + // Standard Error: 2_199 + .saturating_add(Weight::from_parts(5_705, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(Weight::from_parts(0, 20).saturating_mul(m.into())) } @@ -143,15 +141,15 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `357 + m * (20 ±0) + p * (36 ±0)` // Estimated: `3751 + m * (21 ±0) + p * (36 ±0)` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(18_038_161, 0) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(19_702_013, 0) .saturating_add(Weight::from_parts(0, 3751)) - // Standard Error: 77 - .saturating_add(Weight::from_parts(1_328, 0).saturating_mul(b.into())) - // Standard Error: 806 - .saturating_add(Weight::from_parts(9_593, 0).saturating_mul(m.into())) - // Standard Error: 796 - .saturating_add(Weight::from_parts(116_562, 0).saturating_mul(p.into())) + // Standard Error: 315 + .saturating_add(Weight::from_parts(796, 0).saturating_mul(b.into())) + // Standard Error: 3_293 + .saturating_add(Weight::from_parts(14_028, 0).saturating_mul(m.into())) + // Standard Error: 3_251 + .saturating_add(Weight::from_parts(146_957, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(Weight::from_parts(0, 21).saturating_mul(m.into())) @@ -166,11 +164,11 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `832 + m * (40 ±0)` // Estimated: `4296 + m * (40 ±0)` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_243_118, 0) + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(18_888_620, 0) .saturating_add(Weight::from_parts(0, 4296)) - // Standard Error: 729 - .saturating_add(Weight::from_parts(9_936, 0).saturating_mul(m.into())) + // Standard Error: 3_932 + .saturating_add(Weight::from_parts(7_792, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 40).saturating_mul(m.into())) @@ -189,13 +187,11 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `409 + m * (40 ±0) + p * (36 ±0)` // Estimated: `3854 + m * (41 ±0) + p * (36 ±0)` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(19_230_367, 0) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(22_509_197, 0) .saturating_add(Weight::from_parts(0, 3854)) - // Standard Error: 625 - .saturating_add(Weight::from_parts(3_816, 0).saturating_mul(m.into())) - // Standard Error: 609 - .saturating_add(Weight::from_parts(119_137, 0).saturating_mul(p.into())) + // Standard Error: 3_630 + .saturating_add(Weight::from_parts(134_361, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 41).saturating_mul(m.into())) @@ -219,14 +215,14 @@ impl pallet_collective::WeightInfo for WeightInfo { // Measured: `715 + b * (1 ±0) + m * (40 ±0) + p * (40 ±0)` // Estimated: `4032 + b * (1 ±0) + m * (42 ±0) + p * (40 ±0)` // Minimum execution time: 30_000_000 picoseconds. - Weight::from_parts(29_705_330, 0) + Weight::from_parts(30_157_309, 0) .saturating_add(Weight::from_parts(0, 4032)) - // Standard Error: 123 - .saturating_add(Weight::from_parts(1_678, 0).saturating_mul(b.into())) - // Standard Error: 1_301 - .saturating_add(Weight::from_parts(10_568, 0).saturating_mul(m.into())) - // Standard Error: 1_268 - .saturating_add(Weight::from_parts(142_999, 0).saturating_mul(p.into())) + // Standard Error: 537 + .saturating_add(Weight::from_parts(2_673, 0).saturating_mul(b.into())) + // Standard Error: 5_682 + .saturating_add(Weight::from_parts(30_326, 0).saturating_mul(m.into())) + // Standard Error: 5_539 + .saturating_add(Weight::from_parts(198_810, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -250,12 +246,12 @@ impl pallet_collective::WeightInfo for WeightInfo { // Measured: `429 + m * (40 ±0) + p * (36 ±0)` // Estimated: `3874 + m * (41 ±0) + p * (36 ±0)` // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_064_164, 0) + Weight::from_parts(23_366_099, 0) .saturating_add(Weight::from_parts(0, 3874)) - // Standard Error: 853 - .saturating_add(Weight::from_parts(6_630, 0).saturating_mul(m.into())) - // Standard Error: 832 - .saturating_add(Weight::from_parts(118_190, 0).saturating_mul(p.into())) + // Standard Error: 3_943 + .saturating_add(Weight::from_parts(14_161, 0).saturating_mul(m.into())) + // Standard Error: 3_845 + .saturating_add(Weight::from_parts(138_421, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 41).saturating_mul(m.into())) @@ -280,13 +276,15 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `735 + b * (1 ±0) + m * (40 ±0) + p * (40 ±0)` // Estimated: `4052 + b * (1 ±0) + m * (42 ±0) + p * (40 ±0)` - // Minimum execution time: 32_000_000 picoseconds. - Weight::from_parts(34_768_602, 0) + // Minimum execution time: 33_000_000 picoseconds. + Weight::from_parts(33_127_380, 0) .saturating_add(Weight::from_parts(0, 4052)) - // Standard Error: 108 - .saturating_add(Weight::from_parts(362, 0).saturating_mul(b.into())) - // Standard Error: 1_114 - .saturating_add(Weight::from_parts(134_128, 0).saturating_mul(p.into())) + // Standard Error: 563 + .saturating_add(Weight::from_parts(2_533, 0).saturating_mul(b.into())) + // Standard Error: 5_952 + .saturating_add(Weight::from_parts(16_297, 0).saturating_mul(m.into())) + // Standard Error: 5_802 + .saturating_add(Weight::from_parts(200_372, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) @@ -305,10 +303,10 @@ impl pallet_collective::WeightInfo for WeightInfo { // Measured: `226 + p * (32 ±0)` // Estimated: `1711 + p * (32 ±0)` // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_143_115, 0) + Weight::from_parts(12_796_290, 0) .saturating_add(Weight::from_parts(0, 1711)) - // Standard Error: 637 - .saturating_add(Weight::from_parts(103_056, 0).saturating_mul(p.into())) + // Standard Error: 2_932 + .saturating_add(Weight::from_parts(136_419, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) diff --git a/runtime/koi/src/weights/pallet_conviction_voting.rs b/runtime/koi/src/weights/pallet_conviction_voting.rs index c3ea2b80d..1a9c1f4c8 100644 --- a/runtime/koi/src/weights/pallet_conviction_voting.rs +++ b/runtime/koi/src/weights/pallet_conviction_voting.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_conviction_voting` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -71,8 +71,8 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `13458` // Estimated: `42428` - // Minimum execution time: 79_000_000 picoseconds. - Weight::from_parts(84_000_000, 0) + // Minimum execution time: 85_000_000 picoseconds. + Weight::from_parts(105_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) @@ -93,8 +93,8 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `14179` // Estimated: `83866` - // Minimum execution time: 114_000_000 picoseconds. - Weight::from_parts(122_000_000, 0) + // Minimum execution time: 125_000_000 picoseconds. + Weight::from_parts(151_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(6)) @@ -109,8 +109,8 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `13928` // Estimated: `83866` - // Minimum execution time: 95_000_000 picoseconds. - Weight::from_parts(98_000_000, 0) + // Minimum execution time: 104_000_000 picoseconds. + Weight::from_parts(124_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -123,8 +123,8 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `13052` // Estimated: `30694` - // Minimum execution time: 46_000_000 picoseconds. - Weight::from_parts(48_000_000, 0) + // Minimum execution time: 48_000_000 picoseconds. + Weight::from_parts(58_000_000, 0) .saturating_add(Weight::from_parts(0, 30694)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -146,11 +146,11 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `7020 + r * (447 ±0)` // Estimated: `83866 + r * (3387 ±0)` - // Minimum execution time: 41_000_000 picoseconds. - Weight::from_parts(145_986_544, 0) + // Minimum execution time: 51_000_000 picoseconds. + Weight::from_parts(94_354_931, 0) .saturating_add(Weight::from_parts(0, 83866)) - // Standard Error: 350_650 - .saturating_add(Weight::from_parts(34_511_418, 0).saturating_mul(r.into())) + // Standard Error: 349_326 + .saturating_add(Weight::from_parts(37_658_543, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(6)) @@ -168,11 +168,11 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `6876 + r * (447 ±0)` // Estimated: `83866 + r * (3387 ±0)` - // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(123_366_820, 0) + // Minimum execution time: 24_000_000 picoseconds. + Weight::from_parts(53_657_365, 0) .saturating_add(Weight::from_parts(0, 83866)) - // Standard Error: 344_454 - .saturating_add(Weight::from_parts(33_701_114, 0).saturating_mul(r.into())) + // Standard Error: 323_752 + .saturating_add(Weight::from_parts(37_507_322, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(4)) @@ -191,8 +191,8 @@ impl pallet_conviction_voting::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `12038` // Estimated: `30694` - // Minimum execution time: 67_000_000 picoseconds. - Weight::from_parts(73_000_000, 0) + // Minimum execution time: 75_000_000 picoseconds. + Weight::from_parts(80_000_000, 0) .saturating_add(Weight::from_parts(0, 30694)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) diff --git a/runtime/koi/src/weights/pallet_message_queue.rs b/runtime/koi/src/weights/pallet_message_queue.rs index 069e39a35..c398d7157 100644 --- a/runtime/koi/src/weights/pallet_message_queue.rs +++ b/runtime/koi/src/weights/pallet_message_queue.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_message_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -63,7 +63,7 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `223` // Estimated: `6044` - // Minimum execution time: 11_000_000 picoseconds. + // Minimum execution time: 10_000_000 picoseconds. Weight::from_parts(11_000_000, 0) .saturating_add(Weight::from_parts(0, 6044)) .saturating_add(T::DbWeight::get().reads(3)) @@ -78,7 +78,7 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Measured: `218` // Estimated: `6044` // 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, 6044)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -113,8 +113,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `72` // Estimated: `69050` - // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 0) + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(8_000_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -127,8 +127,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 81_000_000 picoseconds. - Weight::from_parts(96_000_000, 0) + // Minimum execution time: 84_000_000 picoseconds. + Weight::from_parts(93_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -141,7 +141,7 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Measured: `171` // Estimated: `3517` // Minimum execution time: 6_000_000 picoseconds. - Weight::from_parts(7_000_000, 0) + Weight::from_parts(8_000_000, 0) .saturating_add(Weight::from_parts(0, 3517)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -154,8 +154,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `65667` // Estimated: `69050` - // Minimum execution time: 32_000_000 picoseconds. - Weight::from_parts(34_000_000, 0) + // Minimum execution time: 33_000_000 picoseconds. + Weight::from_parts(42_000_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -168,8 +168,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `65667` // Estimated: `69050` - // Minimum execution time: 42_000_000 picoseconds. - Weight::from_parts(43_000_000, 0) + // Minimum execution time: 41_000_000 picoseconds. + Weight::from_parts(48_000_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -182,8 +182,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `65667` // Estimated: `69050` - // Minimum execution time: 49_000_000 picoseconds. - Weight::from_parts(50_000_000, 0) + // Minimum execution time: 50_000_000 picoseconds. + Weight::from_parts(61_000_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtime/koi/src/weights/pallet_preimage.rs b/runtime/koi/src/weights/pallet_preimage.rs index aa2dd2a99..7a4d5a244 100644 --- a/runtime/koi/src/weights/pallet_preimage.rs +++ b/runtime/koi/src/weights/pallet_preimage.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -68,11 +68,11 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3544` - // Minimum execution time: 46_000_000 picoseconds. - Weight::from_parts(46_000_000, 0) + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(45_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) - // Standard Error: 1 - .saturating_add(Weight::from_parts(1_067, 0).saturating_mul(s.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_154, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -88,10 +88,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Measured: `106` // Estimated: `3544` // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(13_000_000, 0) + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) - // Standard Error: 1 - .saturating_add(Weight::from_parts(1_049, 0).saturating_mul(s.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_133, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -107,10 +107,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Measured: `106` // Estimated: `3544` // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(13_000_000, 0) + Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) - // Standard Error: 1 - .saturating_add(Weight::from_parts(1_096, 0).saturating_mul(s.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_128, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -126,8 +126,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `219` // Estimated: `3544` - // Minimum execution time: 44_000_000 picoseconds. - Weight::from_parts(46_000_000, 0) + // Minimum execution time: 47_000_000 picoseconds. + Weight::from_parts(58_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -142,8 +142,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3544` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(18_000_000, 0) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(25_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -156,8 +156,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `176` // Estimated: `3544` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(14_000_000, 0) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(19_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -170,8 +170,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3544` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -185,7 +185,7 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Measured: `42` // Estimated: `3544` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 0) + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -198,8 +198,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3544` - // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(11_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -214,8 +214,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3544` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(17_000_000, 0) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(21_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -228,8 +228,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3544` - // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -242,8 +242,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3544` - // Minimum execution time: 8_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(11_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -259,13 +259,13 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// The range of component `n` is `[1, 1024]`. fn ensure_updated(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `504 + n * (203 ±0)` + // Measured: `532 + n * (203 ±0)` // Estimated: `990 + n * (2591 ±0)` - // Minimum execution time: 54_000_000 picoseconds. - Weight::from_parts(54_000_000, 0) + // Minimum execution time: 56_000_000 picoseconds. + Weight::from_parts(60_000_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 22_013 - .saturating_add(Weight::from_parts(53_066_920, 0).saturating_mul(n.into())) + // Standard Error: 47_697 + .saturating_add(Weight::from_parts(57_455_847, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(n.into()))) .saturating_add(Weight::from_parts(0, 2591).saturating_mul(n.into())) diff --git a/runtime/koi/src/weights/pallet_proxy.rs b/runtime/koi/src/weights/pallet_proxy.rs index 06b2d90bb..6f6ad95a3 100644 --- a/runtime/koi/src/weights/pallet_proxy.rs +++ b/runtime/koi/src/weights/pallet_proxy.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_proxy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -64,11 +64,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `119 + p * (25 ±0)` // Estimated: `4310` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(13_336_147, 0) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(14_095_571, 0) .saturating_add(Weight::from_parts(0, 4310)) - // Standard Error: 2_057 - .saturating_add(Weight::from_parts(23_701, 0).saturating_mul(p.into())) + // Standard Error: 7_508 + .saturating_add(Weight::from_parts(48_610, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) } /// Storage: `Proxy::Proxies` (r:1 w:0) @@ -86,12 +86,12 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Measured: `371 + a * (56 ±0) + p * (25 ±0)` // Estimated: `5302` // Minimum execution time: 31_000_000 picoseconds. - Weight::from_parts(32_332_960, 0) + Weight::from_parts(34_463_299, 0) .saturating_add(Weight::from_parts(0, 5302)) - // Standard Error: 3_478 - .saturating_add(Weight::from_parts(97_301, 0).saturating_mul(a.into())) - // Standard Error: 3_594 - .saturating_add(Weight::from_parts(92, 0).saturating_mul(p.into())) + // Standard Error: 11_636 + .saturating_add(Weight::from_parts(123_729, 0).saturating_mul(a.into())) + // Standard Error: 12_022 + .saturating_add(Weight::from_parts(14_431, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -101,15 +101,17 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. - fn remove_announcement(a: u32, _p: u32, ) -> Weight { + fn remove_announcement(a: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `295 + a * (56 ±0)` // Estimated: `5302` // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_257_306, 0) + Weight::from_parts(21_259_863, 0) .saturating_add(Weight::from_parts(0, 5302)) - // Standard Error: 2_249 - .saturating_add(Weight::from_parts(114_708, 0).saturating_mul(a.into())) + // Standard Error: 7_217 + .saturating_add(Weight::from_parts(132_453, 0).saturating_mul(a.into())) + // Standard Error: 7_457 + .saturating_add(Weight::from_parts(21_254, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -124,10 +126,10 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Measured: `295 + a * (56 ±0)` // Estimated: `5302` // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_576_197, 0) + Weight::from_parts(21_964_838, 0) .saturating_add(Weight::from_parts(0, 5302)) - // Standard Error: 2_256 - .saturating_add(Weight::from_parts(111_775, 0).saturating_mul(a.into())) + // Standard Error: 7_084 + .saturating_add(Weight::from_parts(143_488, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -139,17 +141,15 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(116), added: 2591, mode: `MaxEncodedLen`) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. - fn announce(a: u32, p: u32, ) -> Weight { + fn announce(a: u32, _p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `311 + a * (56 ±0) + p * (25 ±0)` // Estimated: `5302` - // Minimum execution time: 26_000_000 picoseconds. - Weight::from_parts(26_129_689, 0) + // Minimum execution time: 25_000_000 picoseconds. + Weight::from_parts(27_807_662, 0) .saturating_add(Weight::from_parts(0, 5302)) - // Standard Error: 2_000 - .saturating_add(Weight::from_parts(128_553, 0).saturating_mul(a.into())) - // Standard Error: 2_066 - .saturating_add(Weight::from_parts(19_273, 0).saturating_mul(p.into())) + // Standard Error: 8_462 + .saturating_add(Weight::from_parts(180_035, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -160,11 +160,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `115 + p * (25 ±0)` // Estimated: `4310` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(20_919_041, 0) + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(21_111_983, 0) .saturating_add(Weight::from_parts(0, 4310)) - // Standard Error: 1_398 - .saturating_add(Weight::from_parts(7_664, 0).saturating_mul(p.into())) + // Standard Error: 6_929 + .saturating_add(Weight::from_parts(64_047, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -176,10 +176,10 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Measured: `115 + p * (25 ±0)` // Estimated: `4310` // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_056_854, 0) + Weight::from_parts(22_347_148, 0) .saturating_add(Weight::from_parts(0, 4310)) - // Standard Error: 1_550 - .saturating_add(Weight::from_parts(1_491, 0).saturating_mul(p.into())) + // Standard Error: 9_039 + .saturating_add(Weight::from_parts(33_946, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -191,10 +191,10 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Measured: `115 + p * (25 ±0)` // Estimated: `4310` // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(19_917_339, 0) + Weight::from_parts(20_953_276, 0) .saturating_add(Weight::from_parts(0, 4310)) - // Standard Error: 1_989 - .saturating_add(Weight::from_parts(17_568, 0).saturating_mul(p.into())) + // Standard Error: 7_731 + .saturating_add(Weight::from_parts(38_577, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -205,11 +205,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127` // Estimated: `4310` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(21_964_308, 0) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(22_926_728, 0) .saturating_add(Weight::from_parts(0, 4310)) - // Standard Error: 930 - .saturating_add(Weight::from_parts(1_655, 0).saturating_mul(p.into())) + // Standard Error: 8_619 + .saturating_add(Weight::from_parts(15_932, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -221,10 +221,10 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Measured: `140 + p * (25 ±0)` // Estimated: `4310` // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_169_474, 0) + Weight::from_parts(21_780_110, 0) .saturating_add(Weight::from_parts(0, 4310)) - // Standard Error: 2_189 - .saturating_add(Weight::from_parts(29_788, 0).saturating_mul(p.into())) + // Standard Error: 7_638 + .saturating_add(Weight::from_parts(17_761, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/koi/src/weights/pallet_referenda.rs b/runtime/koi/src/weights/pallet_referenda.rs index 4e5eab939..fc0f78cfd 100644 --- a/runtime/koi/src/weights/pallet_referenda.rs +++ b/runtime/koi/src/weights/pallet_referenda.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_referenda` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -65,8 +65,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `275` // Estimated: `42428` - // Minimum execution time: 30_000_000 picoseconds. - Weight::from_parts(31_000_000, 0) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(30_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) @@ -97,8 +97,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3350` // Estimated: `42428` - // Minimum execution time: 45_000_000 picoseconds. - Weight::from_parts(46_000_000, 0) + // Minimum execution time: 46_000_000 picoseconds. + Weight::from_parts(49_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -115,8 +115,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3370` // Estimated: `42428` - // Minimum execution time: 45_000_000 picoseconds. - Weight::from_parts(46_000_000, 0) + // Minimum execution time: 47_000_000 picoseconds. + Weight::from_parts(53_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -146,7 +146,7 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Measured: `461` // Estimated: `4377` // Minimum execution time: 30_000_000 picoseconds. - Weight::from_parts(31_000_000, 0) + Weight::from_parts(32_000_000, 0) .saturating_add(Weight::from_parts(0, 4377)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -157,8 +157,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `425` // Estimated: `4377` - // Minimum execution time: 25_000_000 picoseconds. - Weight::from_parts(26_000_000, 0) + // Minimum execution time: 26_000_000 picoseconds. + Weight::from_parts(27_000_000, 0) .saturating_add(Weight::from_parts(0, 4377)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -169,8 +169,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `384` // Estimated: `4377` - // Minimum execution time: 25_000_000 picoseconds. - Weight::from_parts(26_000_000, 0) + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(33_000_000, 0) .saturating_add(Weight::from_parts(0, 4377)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -183,7 +183,7 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `390` // Estimated: `83866` - // Minimum execution time: 26_000_000 picoseconds. + // Minimum execution time: 25_000_000 picoseconds. Weight::from_parts(26_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(3)) @@ -201,7 +201,7 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `880` // Estimated: `83866` - // Minimum execution time: 85_000_000 picoseconds. + // Minimum execution time: 84_000_000 picoseconds. Weight::from_parts(87_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(5)) @@ -231,8 +231,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3137` // Estimated: `42428` - // Minimum execution time: 26_000_000 picoseconds. - Weight::from_parts(27_000_000, 0) + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(32_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -247,8 +247,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3195` // Estimated: `42428` - // Minimum execution time: 32_000_000 picoseconds. - Weight::from_parts(33_000_000, 0) + // Minimum execution time: 34_000_000 picoseconds. + Weight::from_parts(41_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -261,8 +261,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3020` // Estimated: `5477` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(14_000_000, 0) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 5477)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -275,8 +275,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3020` // Estimated: `5477` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(14_000_000, 0) + // Minimum execution time: 14_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) .saturating_add(Weight::from_parts(0, 5477)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -291,8 +291,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3024` // Estimated: `5477` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(19_000_000, 0) .saturating_add(Weight::from_parts(0, 5477)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -307,8 +307,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3044` // Estimated: `5477` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 0) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(20_000_000, 0) .saturating_add(Weight::from_parts(0, 5477)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -321,8 +321,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `354` // Estimated: `42428` - // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(18_000_000, 0) + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(19_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -335,7 +335,7 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `390` // Estimated: `42428` - // Minimum execution time: 17_000_000 picoseconds. + // Minimum execution time: 18_000_000 picoseconds. Weight::from_parts(18_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) @@ -347,8 +347,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `299` // Estimated: `4377` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(14_000_000, 0) .saturating_add(Weight::from_parts(0, 4377)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -363,7 +363,7 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `390` // Estimated: `42428` - // Minimum execution time: 23_000_000 picoseconds. + // Minimum execution time: 22_000_000 picoseconds. Weight::from_parts(23_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(3)) @@ -380,7 +380,7 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Measured: `390` // Estimated: `42428` // Minimum execution time: 25_000_000 picoseconds. - Weight::from_parts(26_000_000, 0) + Weight::from_parts(30_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -393,8 +393,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `443` // Estimated: `42428` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_000_000, 0) + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -407,8 +407,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `426` // Estimated: `42428` - // Minimum execution time: 19_000_000 picoseconds. - Weight::from_parts(20_000_000, 0) + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(22_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -422,7 +422,7 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Measured: `443` // Estimated: `42428` // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(19_000_000, 0) + Weight::from_parts(22_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -451,7 +451,7 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `447` // Estimated: `83866` - // Minimum execution time: 29_000_000 picoseconds. + // Minimum execution time: 28_000_000 picoseconds. Weight::from_parts(29_000_000, 0) .saturating_add(Weight::from_parts(0, 83866)) .saturating_add(T::DbWeight::get().reads(4)) @@ -465,7 +465,7 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `443` // Estimated: `42428` - // Minimum execution time: 20_000_000 picoseconds. + // Minimum execution time: 19_000_000 picoseconds. Weight::from_parts(20_000_000, 0) .saturating_add(Weight::from_parts(0, 42428)) .saturating_add(T::DbWeight::get().reads(2)) @@ -483,8 +483,8 @@ impl pallet_referenda::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `443` // Estimated: `4377` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(16_000_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) .saturating_add(Weight::from_parts(0, 4377)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtime/koi/src/weights/pallet_scheduler.rs b/runtime/koi/src/weights/pallet_scheduler.rs index 22687ea78..ef3bbdff8 100644 --- a/runtime/koi/src/weights/pallet_scheduler.rs +++ b/runtime/koi/src/weights/pallet_scheduler.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -75,10 +75,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Measured: `78 + s * (177 ±0)` // Estimated: `42428` // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(5_646_595, 0) + Weight::from_parts(5_834_698, 0) .saturating_add(Weight::from_parts(0, 42428)) - // Standard Error: 1_323 - .saturating_add(Weight::from_parts(375_098, 0).saturating_mul(s.into())) + // Standard Error: 3_784 + .saturating_add(Weight::from_parts(398_666, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -101,11 +101,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `179 + s * (1 ±0)` // Estimated: `3644 + s * (1 ±0)` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(16_000_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) .saturating_add(Weight::from_parts(0, 3644)) - // Standard Error: 1 - .saturating_add(Weight::from_parts(443, 0).saturating_mul(s.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(521, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(s.into())) @@ -117,7 +117,7 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `0` // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + Weight::from_parts(5_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -156,10 +156,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Measured: `78 + s * (177 ±0)` // Estimated: `42428` // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(11_112_705, 0) + Weight::from_parts(12_251_764, 0) .saturating_add(Weight::from_parts(0, 42428)) - // Standard Error: 1_384 - .saturating_add(Weight::from_parts(364_052, 0).saturating_mul(s.into())) + // Standard Error: 5_910 + .saturating_add(Weight::from_parts(397_968, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -172,11 +172,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `78 + s * (177 ±0)` // Estimated: `42428` - // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(11_587_346, 0) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(12_843_673, 0) .saturating_add(Weight::from_parts(0, 42428)) - // Standard Error: 1_259 - .saturating_add(Weight::from_parts(598_064, 0).saturating_mul(s.into())) + // Standard Error: 6_444 + .saturating_add(Weight::from_parts(612_797, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -189,11 +189,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `255 + s * (185 ±0)` // Estimated: `42428` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(14_706_823, 0) + // Minimum execution time: 12_000_000 picoseconds. + Weight::from_parts(15_768_000, 0) .saturating_add(Weight::from_parts(0, 42428)) - // Standard Error: 1_946 - .saturating_add(Weight::from_parts(377_925, 0).saturating_mul(s.into())) + // Standard Error: 6_871 + .saturating_add(Weight::from_parts(402_285, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -207,10 +207,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Measured: `281 + s * (185 ±0)` // Estimated: `42428` // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(14_150_285, 0) + Weight::from_parts(14_722_204, 0) .saturating_add(Weight::from_parts(0, 42428)) - // Standard Error: 1_300 - .saturating_add(Weight::from_parts(602_890, 0).saturating_mul(s.into())) + // Standard Error: 7_510 + .saturating_add(Weight::from_parts(657_325, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/koi/src/weights/pallet_session.rs b/runtime/koi/src/weights/pallet_session.rs index a3a2319f5..ac496a87b 100644 --- a/runtime/koi/src/weights/pallet_session.rs +++ b/runtime/koi/src/weights/pallet_session.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_session` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -78,7 +78,7 @@ impl pallet_session::WeightInfo for WeightInfo { // Measured: `228` // Estimated: `3693` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + Weight::from_parts(13_000_000, 0) .saturating_add(Weight::from_parts(0, 3693)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtime/koi/src/weights/pallet_timestamp.rs b/runtime/koi/src/weights/pallet_timestamp.rs index a36f142c3..47c9b0cba 100644 --- a/runtime/koi/src/weights/pallet_timestamp.rs +++ b/runtime/koi/src/weights/pallet_timestamp.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_timestamp` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 diff --git a/runtime/koi/src/weights/pallet_treasury.rs b/runtime/koi/src/weights/pallet_treasury.rs index e6af41735..dbfb9ac96 100644 --- a/runtime/koi/src/weights/pallet_treasury.rs +++ b/runtime/koi/src/weights/pallet_treasury.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_treasury` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -66,7 +66,7 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Measured: `109` // Estimated: `1887` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + Weight::from_parts(12_000_000, 0) .saturating_add(Weight::from_parts(0, 1887)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) @@ -79,8 +79,8 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `275` // Estimated: `1489` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(24_000_000, 0) + // Minimum execution time: 25_000_000 picoseconds. + Weight::from_parts(29_000_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -93,8 +93,8 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `571` // Estimated: `6172` - // Minimum execution time: 38_000_000 picoseconds. - Weight::from_parts(39_000_000, 0) + // Minimum execution time: 40_000_000 picoseconds. + Weight::from_parts(45_000_000, 0) .saturating_add(Weight::from_parts(0, 6172)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -109,10 +109,10 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Measured: `537 + p * (8 ±0)` // Estimated: `3549` // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(8_698_281, 0) + Weight::from_parts(10_074_563, 0) .saturating_add(Weight::from_parts(0, 3549)) - // Standard Error: 822 - .saturating_add(Weight::from_parts(26_269, 0).saturating_mul(p.into())) + // Standard Error: 2_320 + .saturating_add(Weight::from_parts(34_382, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -144,10 +144,10 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Measured: `328 + p * (97 ±0)` // Estimated: `3581 + p * (2559 ±0)` // Minimum execution time: 18_000_000 picoseconds. - Weight::from_parts(127_084_382, 0) + Weight::from_parts(28_697_260, 0) .saturating_add(Weight::from_parts(0, 3581)) - // Standard Error: 161_920 - .saturating_add(Weight::from_parts(1_326_267, 0).saturating_mul(p.into())) + // Standard Error: 77_972 + .saturating_add(Weight::from_parts(2_780_716, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -175,8 +175,8 @@ impl pallet_treasury::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `416` // Estimated: `6172` - // Minimum execution time: 49_000_000 picoseconds. - Weight::from_parts(50_000_000, 0) + // Minimum execution time: 55_000_000 picoseconds. + Weight::from_parts(59_000_000, 0) .saturating_add(Weight::from_parts(0, 6172)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) diff --git a/runtime/koi/src/weights/pallet_tx_pause.rs b/runtime/koi/src/weights/pallet_tx_pause.rs index d1f423e77..2bcf92130 100644 --- a/runtime/koi/src/weights/pallet_tx_pause.rs +++ b/runtime/koi/src/weights/pallet_tx_pause.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_tx_pause` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -61,8 +61,8 @@ impl pallet_tx_pause::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `4` // Estimated: `3997` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(11_000_000, 0) .saturating_add(Weight::from_parts(0, 3997)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtime/koi/src/weights/pallet_utility.rs b/runtime/koi/src/weights/pallet_utility.rs index 2b45ea21f..78e3e3106 100644 --- a/runtime/koi/src/weights/pallet_utility.rs +++ b/runtime/koi/src/weights/pallet_utility.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_utility` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -63,10 +63,10 @@ impl pallet_utility::WeightInfo for WeightInfo { // Measured: `4` // Estimated: `3997` // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(8_246_607, 0) + Weight::from_parts(4_000_000, 0) .saturating_add(Weight::from_parts(0, 3997)) - // Standard Error: 3_195 - .saturating_add(Weight::from_parts(5_004_046, 0).saturating_mul(c.into())) + // Standard Error: 12_721 + .saturating_add(Weight::from_parts(5_456_832, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: `TxPause::PausedCalls` (r:1 w:0) @@ -76,7 +76,7 @@ impl pallet_utility::WeightInfo for WeightInfo { // Measured: `4` // Estimated: `3997` // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(8_000_000, 0) + Weight::from_parts(9_000_000, 0) .saturating_add(Weight::from_parts(0, 3997)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -88,10 +88,10 @@ impl pallet_utility::WeightInfo for WeightInfo { // Measured: `4` // Estimated: `3997` // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(32_524_056, 0) + Weight::from_parts(5_000_000, 0) .saturating_add(Weight::from_parts(0, 3997)) - // Standard Error: 5_851 - .saturating_add(Weight::from_parts(5_138_356, 0).saturating_mul(c.into())) + // Standard Error: 9_960 + .saturating_add(Weight::from_parts(5_916_048, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(1)) } fn dispatch_as() -> Weight { @@ -99,7 +99,7 @@ impl pallet_utility::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `0` // Minimum execution time: 6_000_000 picoseconds. - Weight::from_parts(6_000_000, 0) + Weight::from_parts(7_000_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `TxPause::PausedCalls` (r:1 w:0) @@ -110,10 +110,10 @@ impl pallet_utility::WeightInfo for WeightInfo { // Measured: `4` // Estimated: `3997` // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(2_073_409, 0) + Weight::from_parts(19_124_290, 0) .saturating_add(Weight::from_parts(0, 3997)) - // Standard Error: 3_686 - .saturating_add(Weight::from_parts(4_893_358, 0).saturating_mul(c.into())) + // Standard Error: 20_179 + .saturating_add(Weight::from_parts(5_499_270, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(1)) } } diff --git a/runtime/koi/src/weights/pallet_whitelist.rs b/runtime/koi/src/weights/pallet_whitelist.rs index c23beed87..56dc70aba 100644 --- a/runtime/koi/src/weights/pallet_whitelist.rs +++ b/runtime/koi/src/weights/pallet_whitelist.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_whitelist` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-06-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("koi-dev")`, DB CACHE: 1024 @@ -65,8 +65,8 @@ impl pallet_whitelist::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `48` // Estimated: `3544` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(16_000_000, 0) + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(18_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -82,7 +82,7 @@ impl pallet_whitelist::WeightInfo for WeightInfo { // Measured: `176` // Estimated: `3544` // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_000_000, 0) + Weight::from_parts(16_000_000, 0) .saturating_add(Weight::from_parts(0, 3544)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -101,10 +101,10 @@ impl pallet_whitelist::WeightInfo for WeightInfo { // Measured: `252 + n * (1 ±0)` // Estimated: `3716 + n * (1 ±0)` // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(24_000_000, 0) + Weight::from_parts(26_000_000, 0) .saturating_add(Weight::from_parts(0, 3716)) - // Standard Error: 1 - .saturating_add(Weight::from_parts(445, 0).saturating_mul(n.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(543, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) @@ -121,10 +121,10 @@ impl pallet_whitelist::WeightInfo for WeightInfo { // Measured: `176` // Estimated: `3544` // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(17_689_949, 0) + Weight::from_parts(20_605_827, 0) .saturating_add(Weight::from_parts(0, 3544)) - // Standard Error: 13 - .saturating_add(Weight::from_parts(1_015, 0).saturating_mul(n.into())) + // Standard Error: 26 + .saturating_add(Weight::from_parts(1_150, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) }