From 38a3cded8aa5d33940320bf72157a55ec3889e3f Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Wed, 2 Oct 2024 10:43:11 +0800 Subject: [PATCH 01/31] init solution --- pallets/timegraph/src/lib.rs | 163 +++++++++++++++++++++++------ pallets/timegraph/src/mock.rs | 3 + pallets/timegraph/src/tests.rs | 181 ++++++++++++++++++++------------- 3 files changed, 245 insertions(+), 102 deletions(-) diff --git a/pallets/timegraph/src/lib.rs b/pallets/timegraph/src/lib.rs index 64678bcbb..61ad4cbb0 100644 --- a/pallets/timegraph/src/lib.rs +++ b/pallets/timegraph/src/lib.rs @@ -21,15 +21,20 @@ pub mod pallet { use polkadot_sdk::{frame_support, frame_system}; use frame_support::pallet_prelude::*; - use frame_support::traits::{Currency, ExistenceRequirement}; + use frame_support::traits::{Currency, ReservableCurrency, ExistenceRequirement}; use frame_system::pallet_prelude::*; pub type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; + + + pub trait WeightInfo { fn deposit() -> Weight; fn withdraw() -> Weight; + fn transfer_to_pool() -> Weight; + fn transfer_award_to_user() -> Weight; } impl WeightInfo for () { @@ -40,6 +45,14 @@ pub mod pallet { fn withdraw() -> Weight { Weight::default() } + + fn transfer_to_pool() -> Weight { + Weight::default() + } + + fn transfer_award_to_user() -> Weight { + Weight::default() + } } #[pallet::pallet] @@ -51,7 +64,10 @@ pub mod pallet { type RuntimeEvent: From> + IsType<::RuntimeEvent>; type WeightInfo: WeightInfo; - type Currency: Currency; + type Currency: Currency + ReservableCurrency; + #[pallet::constant] + type InitialThreshold: Get>; + } ///Stores the next deposit sequence number for each account. @@ -66,13 +82,25 @@ pub mod pallet { pub type NextWithdrawalSequence = StorageMap<_, Blake2_128Concat, T::AccountId, u64, ValueQuery>; + #[pallet::storage] + #[pallet::getter(fn timegraph_account)] + pub type TimegraphAccount = StorageValue<_, T::AccountId, OptionQuery>; + + #[pallet::storage] + #[pallet::getter(fn reward_pool_account)] + pub type RewardPoolAccount = StorageValue<_, T::AccountId, OptionQuery>; + + #[pallet::storage] + #[pallet::getter(fn threshold)] + pub type Threshold = StorageValue<_, BalanceOf, OptionQuery>; + #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { /// Deposit event - Deposit(T::AccountId, T::AccountId, BalanceOf, u64), + Deposit(T::AccountId, BalanceOf, u64), /// Withdrawal Event - Withdrawal(T::AccountId, T::AccountId, BalanceOf, u64), + Withdrawal(T::AccountId, BalanceOf, u64), } #[pallet::error] @@ -94,26 +122,23 @@ pub mod pallet { /// # Flow /// 1. Ensure the origin is a signed account. /// 2. Validate the amount is greater than zero. - /// 3. Ensure the sender and receiver are not the same. + /// 3. Ensure the sender . /// 4. Transfer the funds. - /// 5. Increment the deposit sequence number. + /// 5. Increment the deposit sequence number for origin. /// 6. Emit a [`Event::Deposit`] event. #[pallet::call_index(0)] #[pallet::weight(T::WeightInfo::deposit())] - pub fn deposit( - origin: OriginFor, - to: T::AccountId, - amount: BalanceOf, - ) -> DispatchResult { + pub fn deposit(origin: OriginFor, amount: BalanceOf) -> DispatchResult { let who = ensure_signed(origin)?; ensure!(amount > 0_u32.into(), Error::::ZeroAmount); - ensure!(who != to, Error::::SenderSameWithReceiver); - T::Currency::transfer(&who, &to, amount, ExistenceRequirement::KeepAlive)?; - let deposit_sequence = Self::next_deposit_sequence(&to); + + T::Currency::reserve(&who, amount)?; + + let deposit_sequence = Self::next_deposit_sequence(&who); let next_sequence = deposit_sequence.checked_add(1).ok_or(Error::::SequenceNumberOverflow)?; - NextDepositSequence::::insert(&to, next_sequence); - Self::deposit_event(Event::Deposit(who, to, amount, next_sequence)); + NextDepositSequence::::insert(&who, next_sequence); + Self::deposit_event(Event::Deposit(who, amount, next_sequence)); Ok(()) } @@ -130,23 +155,101 @@ pub mod pallet { /// 7. Emit a [`Event::Withdrawal`] event. #[pallet::call_index(1)] #[pallet::weight(T::WeightInfo::withdraw())] - pub fn withdraw( - origin: OriginFor, - to: T::AccountId, - amount: BalanceOf, - sequence: u64, - ) -> DispatchResult { + pub fn withdraw(origin: OriginFor, amount: BalanceOf) -> DispatchResult { let who = ensure_signed(origin)?; ensure!(amount > 0_u32.into(), Error::::ZeroAmount); - ensure!(who != to, Error::::SenderSameWithReceiver); - let withdrawal_sequence = Self::next_withdrawal_sequence(&who); - let next_withdrawal_sequence = - withdrawal_sequence.checked_add(1).ok_or(Error::::SequenceNumberOverflow)?; - ensure!(sequence == next_withdrawal_sequence, Error::::WithDrawalSequenceMismatch); - T::Currency::transfer(&who, &to, amount, ExistenceRequirement::KeepAlive)?; - NextWithdrawalSequence::::insert(&who, next_withdrawal_sequence); - Self::deposit_event(Event::Withdrawal(who, to, amount, sequence)); + + let current_reserve = T::Currency::reserved_balance(&who); + ensure!(amount <= current_reserve, Error::::SequenceNumberOverflow); + + ensure!( + T::Currency::unreserve(&who, amount) > (BalanceOf::::from(0_u32)), + Error::::SequenceNumberOverflow + ); + + NextWithdrawalSequence::::try_mutate(&who, |x| -> DispatchResult { + *x = x.checked_add(1).ok_or(Error::::SequenceNumberOverflow)?; + Ok(()) + })?; + + Self::deposit_event(Event::Withdrawal( + who.clone(), + amount, + NextWithdrawalSequence::::get(&who), + )); Ok(()) } + + #[pallet::call_index(2)] + #[pallet::weight(T::WeightInfo::transfer_to_pool())] + pub fn transfer_to_pool(origin: OriginFor, account: T::AccountId, amount: BalanceOf) -> DispatchResult { + Self::ensure_timegraph(origin)?; + let unserved = T::Currency::unreserve(&account, amount); + ensure!( + unserved > (BalanceOf::::from(0_u32)), + Error::::SequenceNumberOverflow + ); + + + Ok(()) + } + + #[pallet::call_index(3)] + #[pallet::weight(T::WeightInfo::transfer_award_to_user())] + pub fn transfer_award_to_user(origin: OriginFor, account: T::AccountId, amount: BalanceOf) -> DispatchResult { + Self::ensure_timegraph(origin)?; + let pool_account = RewardPoolAccount::::get().ok_or(Error::::SequenceNumberOverflow)?; + + let pool_balance = T::Currency::free_balance(&pool_account); + ensure!(pool_balance > amount, Error::::SequenceNumberOverflow); + + T::Currency::transfer(&pool_account, &account, amount, ExistenceRequirement::KeepAlive)?; + + Ok(()) + } + + #[pallet::call_index(4)] + #[pallet::weight(T::WeightInfo::withdraw())] + pub fn set_timegraph_account(origin: OriginFor, account: T::AccountId) -> DispatchResult { + ensure_root(origin)?; + ensure!(Some(account.clone()) != TimegraphAccount::::get(), Error::::SequenceNumberOverflow); + TimegraphAccount::::set(Some(account)); + Ok(()) + } + + #[pallet::call_index(5)] + #[pallet::weight(T::WeightInfo::withdraw())] + pub fn set_reward_pool_account(origin: OriginFor, account: T::AccountId) -> DispatchResult { + ensure_root(origin)?; + + ensure!(Some(account.clone()) != RewardPoolAccount::::get(), Error::::SequenceNumberOverflow); + + + RewardPoolAccount::::set(Some(account)); + + Ok(()) + } + + #[pallet::call_index(6)] + #[pallet::weight(T::WeightInfo::withdraw())] + pub fn set_threshold(origin: OriginFor, amount: BalanceOf) -> DispatchResult { + ensure_root(origin)?; + + ensure!(Some(amount) != Threshold::::get(), Error::::SequenceNumberOverflow); + Threshold::::set(Some(amount)); + + Ok(()) + } + } + + impl Pallet { + pub fn ensure_timegraph(origin: OriginFor) -> DispatchResult { + let who = ensure_signed(origin)?; + let current_account = TimegraphAccount::::get(); + ensure!(Some(who) == current_account, Error::::SequenceNumberOverflow); + Ok(()) + } + + } } diff --git a/pallets/timegraph/src/mock.rs b/pallets/timegraph/src/mock.rs index 35ff64a97..0af210639 100644 --- a/pallets/timegraph/src/mock.rs +++ b/pallets/timegraph/src/mock.rs @@ -40,10 +40,13 @@ impl pallet_balances::Config for Test { type WeightInfo = pallet_balances::weights::SubstrateWeight; } + +// #[derive_impl(pallet_timegraph::config_preludes::TestDefaultConfig)] impl pallet_timegraph::Config for Test { type RuntimeEvent = RuntimeEvent; type WeightInfo = (); type Currency = Balances; + type InitialThreshold = ConstU128<1_000_000_000_000>; } pub fn new_test_ext() -> sp_io::TestExternalities { diff --git a/pallets/timegraph/src/tests.rs b/pallets/timegraph/src/tests.rs index 18585cd41..754a0c5e0 100644 --- a/pallets/timegraph/src/tests.rs +++ b/pallets/timegraph/src/tests.rs @@ -2,103 +2,140 @@ use crate as pallet_timegraph; use crate::mock::*; use crate::{Error, Event}; -use polkadot_sdk::{frame_support, frame_system}; +use polkadot_sdk::{frame_support, frame_system, pallet_balances}; -use frame_support::{assert_noop, assert_ok}; -use frame_system::RawOrigin; +use frame_support::{assert_noop, assert_ok, traits::Currency}; +use frame_system::{Origin, RawOrigin}; #[test] -fn test_deposit() { +fn deposit_works() { new_test_ext().execute_with(|| { - let sender = 1; - let receiver = 2; - let amount = 100; - let init_sequence = 0; - assert_eq!(Timegraph::next_deposit_sequence(sender), init_sequence); - assert_noop!( - Timegraph::deposit(RawOrigin::Signed(sender).into(), sender, amount), - Error::::SenderSameWithReceiver - ); + // Arrange + let user = 1; + let initial_balance = 1000; + let deposit_amount = 500; - assert_noop!( - Timegraph::deposit(RawOrigin::Signed(sender).into(), receiver, 0_u128), - Error::::ZeroAmount - ); - - assert_ok!(Timegraph::deposit(RuntimeOrigin::signed(sender), receiver, amount)); + // Ensure the user has enough balance + Balances::make_free_balance_be(&user, initial_balance); - System::assert_last_event( - Event::::Deposit(sender, receiver, amount, init_sequence + 1).into(), - ); + // Act + assert_ok!(Timegraph::deposit(RawOrigin::Signed(user).into(), deposit_amount)); - pallet_timegraph::NextDepositSequence::::insert(receiver, u64::MAX); - assert_noop!( - Timegraph::deposit(RawOrigin::Signed(sender).into(), receiver, amount), - Error::::SequenceNumberOverflow - ); + // Assert + assert_eq!(Balances::reserved_balance(&user), deposit_amount); + assert_eq!(Timegraph::next_deposit_sequence(&user), 1); }); } #[test] -fn test_withdraw() { +fn deposit_fails_with_zero_amount() { new_test_ext().execute_with(|| { - let sender = 1; - let receiver = 2; - let amount = 100; - let init_sequence = 0; - assert_eq!(Timegraph::next_withdrawal_sequence(sender), init_sequence); + // Arrange + let user = 1; + let deposit_amount = 0; + // Act & Assert assert_noop!( - Timegraph::withdraw( - RawOrigin::Signed(sender).into(), - sender, - amount, - init_sequence + 1 - ), - Error::::SenderSameWithReceiver - ); - - assert_noop!( - Timegraph::withdraw( - RawOrigin::Signed(sender).into(), - receiver, - 0_u128, - init_sequence + 1 - ), + Timegraph::deposit(RawOrigin::Signed(user).into(), deposit_amount), Error::::ZeroAmount ); + }); +} - assert_noop!( - Timegraph::withdraw(RawOrigin::Signed(sender).into(), receiver, amount, init_sequence), - Error::::WithDrawalSequenceMismatch - ); +#[test] +fn deposit_fails_with_insufficient_balance() { + new_test_ext().execute_with(|| { + // Arrange + let user = 1; + let initial_balance = 100; + let deposit_amount = 500; + // Ensure the user has insufficient balance + Balances::make_free_balance_be(&user, initial_balance); + + // Act & Assert assert_noop!( - Timegraph::withdraw( - RawOrigin::Signed(sender).into(), - receiver, - amount, - init_sequence + 2 - ), - Error::::WithDrawalSequenceMismatch + Timegraph::deposit(RawOrigin::Signed(user).into(), deposit_amount), + pallet_balances::Error::::InsufficientBalance ); + }); +} - assert_ok!(Timegraph::withdraw( - RuntimeOrigin::signed(sender), - receiver, - amount, - init_sequence + 1 - )); - assert_eq!(Timegraph::next_withdrawal_sequence(sender), init_sequence + 1); +#[test] +fn deposit_fails_with_sequence_overflow() { + new_test_ext().execute_with(|| { + let user = 1; - System::assert_last_event( - Event::::Withdrawal(sender, receiver, amount, init_sequence + 1).into(), - ); + let amount = 100; - pallet_timegraph::NextWithdrawalSequence::::insert(sender, u64::MAX); + pallet_timegraph::NextDepositSequence::::insert(user, u64::MAX); assert_noop!( - Timegraph::withdraw(RawOrigin::Signed(sender).into(), receiver, amount, init_sequence), + Timegraph::deposit(RawOrigin::Signed(user).into(), amount), Error::::SequenceNumberOverflow ); }); } + +// #[test] +// fn test_withdraw() { +// new_test_ext().execute_with(|| {x +// let sender = 1; +// let receiver = 2; +// let amount = 100; +// let init_sequence = 0; +// assert_eq!(Timegraph::next_withdrawal_sequence(sender), init_sequence); + +// assert_noop!( +// Timegraph::withdraw( +// RawOrigin::Signed(sender).into(), +// sender, +// amount, +// init_sequence + 1 +// ), +// Error::::SenderSameWithReceiver +// ); + +// assert_noop!( +// Timegraph::withdraw( +// RawOrigin::Signed(sender).into(), +// receiver, +// 0_u128, +// init_sequence + 1 +// ), +// Error::::ZeroAmount +// ); + +// assert_noop!( +// Timegraph::withdraw(RawOrigin::Signed(sender).into(), receiver, amount, init_sequence), +// Error::::WithDrawalSequenceMismatch +// ); + +// assert_noop!( +// Timegraph::withdraw( +// RawOrigin::Signed(sender).into(), +// receiver, +// amount, +// init_sequence + 2 +// ), +// Error::::WithDrawalSequenceMismatch +// ); + +// assert_ok!(Timegraph::withdraw( +// RuntimeOrigin::signed(sender), +// receiver, +// amount, +// init_sequence + 1 +// )); +// assert_eq!(Timegraph::next_withdrawal_sequence(sender), init_sequence + 1); + +// System::assert_last_event( +// Event::::Withdrawal(sender, receiver, amount, init_sequence + 1).into(), +// ); + +// pallet_timegraph::NextWithdrawalSequence::::insert(sender, u64::MAX); +// assert_noop!( +// Timegraph::withdraw(RawOrigin::Signed(sender).into(), receiver, amount, init_sequence), +// Error::::SequenceNumberOverflow +// ); +// }); +// } From 109bcf826d4cbfc1e59e0269a2ca97ffc88aed16 Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Wed, 2 Oct 2024 11:23:37 +0800 Subject: [PATCH 02/31] initial parameter value --- pallets/timegraph/src/lib.rs | 46 +++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/pallets/timegraph/src/lib.rs b/pallets/timegraph/src/lib.rs index 61ad4cbb0..4acb98bb7 100644 --- a/pallets/timegraph/src/lib.rs +++ b/pallets/timegraph/src/lib.rs @@ -27,9 +27,6 @@ pub mod pallet { pub type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; - - - pub trait WeightInfo { fn deposit() -> Weight; fn withdraw() -> Weight; @@ -67,9 +64,28 @@ pub mod pallet { type Currency: Currency + ReservableCurrency; #[pallet::constant] type InitialThreshold: Get>; + #[pallet::constant] + type InitialTimegraphAccount: Get; + #[pallet::constant] + type InitialRewardPoolAccount: Get; } + #[pallet::type_value] + pub fn DefaultTimegraphAccount() -> T::AccountId { + T::InitialTimegraphAccount::get() + } + + #[pallet::type_value] + pub fn DefaultRewardPoolAccount() -> T::AccountId { + T::InitialRewardPoolAccount::get() + } + + #[pallet::type_value] + pub fn DefaultThreshold() -> BalanceOf { + T::InitialThreshold::get() + } + ///Stores the next deposit sequence number for each account. #[pallet::storage] #[pallet::getter(fn next_deposit_sequence)] @@ -84,15 +100,15 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn timegraph_account)] - pub type TimegraphAccount = StorageValue<_, T::AccountId, OptionQuery>; + pub type TimegraphAccount = StorageValue<_, T::AccountId, ValueQuery, DefaultTimegraphAccount>; #[pallet::storage] #[pallet::getter(fn reward_pool_account)] - pub type RewardPoolAccount = StorageValue<_, T::AccountId, OptionQuery>; + pub type RewardPoolAccount = StorageValue<_, T::AccountId, ValueQuery, DefaultRewardPoolAccount>; #[pallet::storage] #[pallet::getter(fn threshold)] - pub type Threshold = StorageValue<_, BalanceOf, OptionQuery>; + pub type Threshold = StorageValue<_, BalanceOf, ValueQuery, DefaultThreshold>; #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] @@ -198,7 +214,7 @@ pub mod pallet { #[pallet::weight(T::WeightInfo::transfer_award_to_user())] pub fn transfer_award_to_user(origin: OriginFor, account: T::AccountId, amount: BalanceOf) -> DispatchResult { Self::ensure_timegraph(origin)?; - let pool_account = RewardPoolAccount::::get().ok_or(Error::::SequenceNumberOverflow)?; + let pool_account = RewardPoolAccount::::get(); let pool_balance = T::Currency::free_balance(&pool_account); ensure!(pool_balance > amount, Error::::SequenceNumberOverflow); @@ -212,8 +228,8 @@ pub mod pallet { #[pallet::weight(T::WeightInfo::withdraw())] pub fn set_timegraph_account(origin: OriginFor, account: T::AccountId) -> DispatchResult { ensure_root(origin)?; - ensure!(Some(account.clone()) != TimegraphAccount::::get(), Error::::SequenceNumberOverflow); - TimegraphAccount::::set(Some(account)); + ensure!(account.clone() != TimegraphAccount::::get(), Error::::SequenceNumberOverflow); + TimegraphAccount::::set(account); Ok(()) } @@ -222,10 +238,10 @@ pub mod pallet { pub fn set_reward_pool_account(origin: OriginFor, account: T::AccountId) -> DispatchResult { ensure_root(origin)?; - ensure!(Some(account.clone()) != RewardPoolAccount::::get(), Error::::SequenceNumberOverflow); + ensure!(account.clone() != RewardPoolAccount::::get(), Error::::SequenceNumberOverflow); - RewardPoolAccount::::set(Some(account)); + RewardPoolAccount::::set(account); Ok(()) } @@ -235,8 +251,8 @@ pub mod pallet { pub fn set_threshold(origin: OriginFor, amount: BalanceOf) -> DispatchResult { ensure_root(origin)?; - ensure!(Some(amount) != Threshold::::get(), Error::::SequenceNumberOverflow); - Threshold::::set(Some(amount)); + ensure!(amount != Threshold::::get(), Error::::SequenceNumberOverflow); + Threshold::::set(amount); Ok(()) } @@ -246,10 +262,8 @@ pub mod pallet { pub fn ensure_timegraph(origin: OriginFor) -> DispatchResult { let who = ensure_signed(origin)?; let current_account = TimegraphAccount::::get(); - ensure!(Some(who) == current_account, Error::::SequenceNumberOverflow); + ensure!(who == current_account, Error::::SequenceNumberOverflow); Ok(()) } - - } } From b042994f7965c1b63c3e66d4ecc04cd0aa7b6410 Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Wed, 2 Oct 2024 14:38:52 +0800 Subject: [PATCH 03/31] add saturating --- pallets/timegraph/Cargo.toml | 4 ++-- pallets/timegraph/src/lib.rs | 21 ++++++++++++--------- pallets/timegraph/src/mock.rs | 2 ++ 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/pallets/timegraph/Cargo.toml b/pallets/timegraph/Cargo.toml index 0baf2beac..d1039d801 100644 --- a/pallets/timegraph/Cargo.toml +++ b/pallets/timegraph/Cargo.toml @@ -16,10 +16,10 @@ scale-codec = { workspace = true, features = [ "max-encoded-len" ] } scale-info.workspace = true simple-mermaid.workspace = true -polkadot-sdk = { workspace = true, features = [ "frame-support", "frame-system" ] } +polkadot-sdk = { workspace = true, features = [ "frame-support", "frame-system", "sp-runtime" ] } [dev-dependencies] -polkadot-sdk = { workspace = true, features = [ "pallet-balances", "sp-core", "sp-io", "sp-runtime" ] } +polkadot-sdk = { workspace = true, features = [ "pallet-balances", "sp-core", "sp-io" ] } [features] default = [ "std" ] diff --git a/pallets/timegraph/src/lib.rs b/pallets/timegraph/src/lib.rs index 4acb98bb7..a3034283a 100644 --- a/pallets/timegraph/src/lib.rs +++ b/pallets/timegraph/src/lib.rs @@ -18,11 +18,12 @@ mod tests; #[polkadot_sdk::frame_support::pallet] pub mod pallet { - use polkadot_sdk::{frame_support, frame_system}; + use polkadot_sdk::{frame_support, frame_system, sp_runtime}; use frame_support::pallet_prelude::*; use frame_support::traits::{Currency, ReservableCurrency, ExistenceRequirement}; use frame_system::pallet_prelude::*; + use sp_runtime::traits::Saturating; pub type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; @@ -127,8 +128,7 @@ pub mod pallet { SequenceNumberOverflow, /// zero amount ZeroAmount, - /// sender same with receiver - SenderSameWithReceiver, + } #[pallet::call] @@ -150,11 +150,12 @@ pub mod pallet { T::Currency::reserve(&who, amount)?; - let deposit_sequence = Self::next_deposit_sequence(&who); - let next_sequence = - deposit_sequence.checked_add(1).ok_or(Error::::SequenceNumberOverflow)?; - NextDepositSequence::::insert(&who, next_sequence); - Self::deposit_event(Event::Deposit(who, amount, next_sequence)); + NextDepositSequence::::try_mutate(&who, |x| -> DispatchResult { + *x = x.checked_add(1).ok_or(Error::::SequenceNumberOverflow)?; + Ok(()) + })?; + + Self::deposit_event(Event::Deposit(who.clone(), amount, NextDepositSequence::::get(who))); Ok(()) } @@ -176,7 +177,9 @@ pub mod pallet { ensure!(amount > 0_u32.into(), Error::::ZeroAmount); let current_reserve = T::Currency::reserved_balance(&who); - ensure!(amount <= current_reserve, Error::::SequenceNumberOverflow); + let threshold = Threshold::::get(); + + ensure!(amount.saturating_add(threshold) <= current_reserve, Error::::SequenceNumberOverflow); ensure!( T::Currency::unreserve(&who, amount) > (BalanceOf::::from(0_u32)), diff --git a/pallets/timegraph/src/mock.rs b/pallets/timegraph/src/mock.rs index 0af210639..af77f2fb1 100644 --- a/pallets/timegraph/src/mock.rs +++ b/pallets/timegraph/src/mock.rs @@ -47,6 +47,8 @@ impl pallet_timegraph::Config for Test { type WeightInfo = (); type Currency = Balances; type InitialThreshold = ConstU128<1_000_000_000_000>; + type InitialRewardPoolAccount = ConstU64<1>; + type InitialTimegraphAccount = ConstU64<2>; } pub fn new_test_ext() -> sp_io::TestExternalities { From c2e3660be63148483a48758fd498f94cf7724733 Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Thu, 3 Oct 2024 14:21:19 +0800 Subject: [PATCH 04/31] all extrinsics done --- pallets/timegraph/src/lib.rs | 249 ++++++++++++++++++++++++++++------ pallets/timegraph/src/mock.rs | 1 - 2 files changed, 207 insertions(+), 43 deletions(-) diff --git a/pallets/timegraph/src/lib.rs b/pallets/timegraph/src/lib.rs index a3034283a..3f7c8ae08 100644 --- a/pallets/timegraph/src/lib.rs +++ b/pallets/timegraph/src/lib.rs @@ -21,7 +21,7 @@ pub mod pallet { use polkadot_sdk::{frame_support, frame_system, sp_runtime}; use frame_support::pallet_prelude::*; - use frame_support::traits::{Currency, ReservableCurrency, ExistenceRequirement}; + use frame_support::traits::{Currency, ExistenceRequirement, ReservableCurrency}; use frame_system::pallet_prelude::*; use sp_runtime::traits::Saturating; @@ -69,23 +69,22 @@ pub mod pallet { type InitialTimegraphAccount: Get; #[pallet::constant] type InitialRewardPoolAccount: Get; - } #[pallet::type_value] - pub fn DefaultTimegraphAccount() -> T::AccountId { - T::InitialTimegraphAccount::get() - } + pub fn DefaultTimegraphAccount() -> T::AccountId { + T::InitialTimegraphAccount::get() + } #[pallet::type_value] - pub fn DefaultRewardPoolAccount() -> T::AccountId { - T::InitialRewardPoolAccount::get() - } + pub fn DefaultRewardPoolAccount() -> T::AccountId { + T::InitialRewardPoolAccount::get() + } #[pallet::type_value] - pub fn DefaultThreshold() -> BalanceOf { - T::InitialThreshold::get() - } + pub fn DefaultThreshold() -> BalanceOf { + T::InitialThreshold::get() + } ///Stores the next deposit sequence number for each account. #[pallet::storage] @@ -101,11 +100,13 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn timegraph_account)] - pub type TimegraphAccount = StorageValue<_, T::AccountId, ValueQuery, DefaultTimegraphAccount>; + pub type TimegraphAccount = + StorageValue<_, T::AccountId, ValueQuery, DefaultTimegraphAccount>; #[pallet::storage] #[pallet::getter(fn reward_pool_account)] - pub type RewardPoolAccount = StorageValue<_, T::AccountId, ValueQuery, DefaultRewardPoolAccount>; + pub type RewardPoolAccount = + StorageValue<_, T::AccountId, ValueQuery, DefaultRewardPoolAccount>; #[pallet::storage] #[pallet::getter(fn threshold)] @@ -115,20 +116,72 @@ pub mod pallet { #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { /// Deposit event - Deposit(T::AccountId, BalanceOf, u64), - /// Withdrawal Event - Withdrawal(T::AccountId, BalanceOf, u64), + /// + /// # Parameters + /// - `who`: The account ID of the user making the deposit. + /// - `amount`: The amount of funds deposited. + /// - `sequence`: The sequence number of the deposit. + Deposit { + who: T::AccountId, + amount: BalanceOf, + sequence: u64, + }, + /// Withdrawal event + /// + /// # Parameters + /// - `who`: The account ID of the user making the withdrawal. + /// - `amount`: The amount of funds withdrawn. + /// - `sequence`: The sequence number of the withdrawal. + Withdrawal { + who: T::AccountId, + amount: BalanceOf, + sequence: u64, + }, + + TransferToPool { + from: T::AccountId, + to: T::AccountId, + amount: BalanceOf, + }, + + TransferAwardToUser { + from: T::AccountId, + to: T::AccountId, + amount: BalanceOf, + }, + + TimegraphAccountReset { + old: T::AccountId, + new: T::AccountId, + }, + + RewardPoolAccountReset { + old: T::AccountId, + new: T::AccountId, + }, + + ThresholdReset { + old: BalanceOf, + new: BalanceOf, + }, } #[pallet::error] pub enum Error { - /// withdrawal sequence from timegraph is not expected - WithDrawalSequenceMismatch, /// sequence number overflow SequenceNumberOverflow, /// zero amount ZeroAmount, - + /// must keep the threshold until account is removed. + WithdrawalAmountOverReserve, + /// The amount to be withdrawn is not required. + NotWithdrawalRequired, + /// The reward pool does not have enough balance to complete the operation. + RewardPoolOutOfBalance, + RewardToSameAccount, + SameTimegraphAccount, + SameRewardPoolAccount, + SameThreshold, } #[pallet::call] @@ -155,7 +208,11 @@ pub mod pallet { Ok(()) })?; - Self::deposit_event(Event::Deposit(who.clone(), amount, NextDepositSequence::::get(who))); + Self::deposit_event(Event::Deposit { + who: who.clone(), + amount, + sequence: NextDepositSequence::::get(who), + }); Ok(()) } @@ -179,11 +236,14 @@ pub mod pallet { let current_reserve = T::Currency::reserved_balance(&who); let threshold = Threshold::::get(); - ensure!(amount.saturating_add(threshold) <= current_reserve, Error::::SequenceNumberOverflow); + ensure!( + amount.saturating_add(threshold) <= current_reserve, + Error::::WithdrawalAmountOverReserve + ); ensure!( - T::Currency::unreserve(&who, amount) > (BalanceOf::::from(0_u32)), - Error::::SequenceNumberOverflow + T::Currency::unreserve(&who, amount) == amount, + Error::::NotWithdrawalRequired ); NextWithdrawalSequence::::try_mutate(&who, |x| -> DispatchResult { @@ -191,77 +251,182 @@ pub mod pallet { Ok(()) })?; - Self::deposit_event(Event::Withdrawal( - who.clone(), + Self::deposit_event(Event::Withdrawal { + who: who.clone(), amount, - NextWithdrawalSequence::::get(&who), - )); + sequence: NextWithdrawalSequence::::get(&who), + }); Ok(()) } + /// The extrinsic from timegraph allows transferring funds to the reward pool + /// + /// # Flow + /// 1. Ensure the origin is the timegraph account. + /// 2. Unreserve the specified amount from the given account. + /// 3. Transfer the unreserved funds to the reward pool account. + /// 4. Emit a [`Event::TransferToPool`] event. #[pallet::call_index(2)] #[pallet::weight(T::WeightInfo::transfer_to_pool())] - pub fn transfer_to_pool(origin: OriginFor, account: T::AccountId, amount: BalanceOf) -> DispatchResult { + pub fn transfer_to_pool( + origin: OriginFor, + account: T::AccountId, + amount: BalanceOf, + ) -> DispatchResult { Self::ensure_timegraph(origin)?; let unserved = T::Currency::unreserve(&account, amount); - ensure!( - unserved > (BalanceOf::::from(0_u32)), - Error::::SequenceNumberOverflow - ); + ensure!(unserved == amount, Error::::NotWithdrawalRequired); + T::Currency::transfer( + &account, + &RewardPoolAccount::::get(), + amount, + ExistenceRequirement::KeepAlive, + )?; + + Self::deposit_event(Event::TransferToPool { + from: account.clone(), + to: RewardPoolAccount::::get(), + amount, + }); Ok(()) } + + /// The extrinsic from timegraph allows transferring awards to a user + /// + /// # Flow + /// 1. Ensure the origin is the timegraph account. + /// 2. Ensure the account is not the reward pool account. + /// 3. Check if the reward pool has enough balance. + /// 4. Transfer the specified amount from the reward pool account to the given account. + /// 5. Reserve the transferred amount in the given account. + /// 6. Emit a [`Event::TransferAwardToUser`] event. #[pallet::call_index(3)] #[pallet::weight(T::WeightInfo::transfer_award_to_user())] - pub fn transfer_award_to_user(origin: OriginFor, account: T::AccountId, amount: BalanceOf) -> DispatchResult { + pub fn transfer_award_to_user( + origin: OriginFor, + account: T::AccountId, + amount: BalanceOf, + ) -> DispatchResult { Self::ensure_timegraph(origin)?; - let pool_account = RewardPoolAccount::::get(); + ensure!(account != RewardPoolAccount::::get(), Error::::RewardToSameAccount); + let pool_account = RewardPoolAccount::::get(); let pool_balance = T::Currency::free_balance(&pool_account); - ensure!(pool_balance > amount, Error::::SequenceNumberOverflow); + ensure!(pool_balance > amount, Error::::RewardPoolOutOfBalance); - T::Currency::transfer(&pool_account, &account, amount, ExistenceRequirement::KeepAlive)?; + T::Currency::transfer( + &pool_account, + &account, + amount, + ExistenceRequirement::KeepAlive, + )?; + + T::Currency::reserve(&account, amount)?; + + Self::deposit_event(Event::TransferAwardToUser { + from: RewardPoolAccount::::get(), + to: account, + amount, + }); Ok(()) } + /// The extrinsic allows setting a new timegraph account + /// + /// # Flow + /// 1. Ensure the origin is the root account. + /// 2. Ensure the new account is different from the current timegraph account. + /// 3. Emit a [`Event::TimegraphAccountReset`] event. + /// 4. Set the new timegraph account. #[pallet::call_index(4)] #[pallet::weight(T::WeightInfo::withdraw())] - pub fn set_timegraph_account(origin: OriginFor, account: T::AccountId) -> DispatchResult { + pub fn set_timegraph_account( + origin: OriginFor, + account: T::AccountId, + ) -> DispatchResult { ensure_root(origin)?; - ensure!(account.clone() != TimegraphAccount::::get(), Error::::SequenceNumberOverflow); + ensure!( + account.clone() != TimegraphAccount::::get(), + Error::::SameTimegraphAccount + ); + + Self::deposit_event(Event::TimegraphAccountReset { + old: TimegraphAccount::::get(), + new: account.clone(), + }); + TimegraphAccount::::set(account); + Ok(()) } + /// The extrinsic allows setting a new reward pool account + /// + /// # Flow + /// 1. Ensure the origin is the root account. + /// 2. Ensure the new account is different from the current reward pool account. + /// 3. Emit a [`Event::RewardPoolAccountReset`] event. + /// 4. Set the new reward pool account. #[pallet::call_index(5)] #[pallet::weight(T::WeightInfo::withdraw())] - pub fn set_reward_pool_account(origin: OriginFor, account: T::AccountId) -> DispatchResult { + pub fn set_reward_pool_account( + origin: OriginFor, + account: T::AccountId, + ) -> DispatchResult { ensure_root(origin)?; - ensure!(account.clone() != RewardPoolAccount::::get(), Error::::SequenceNumberOverflow); + ensure!( + account.clone() != RewardPoolAccount::::get(), + Error::::SameRewardPoolAccount + ); + Self::deposit_event(Event::RewardPoolAccountReset { + old: RewardPoolAccount::::get(), + new: account.clone(), + }); RewardPoolAccount::::set(account); Ok(()) } + /// The extrinsic allows setting a new threshold + /// + /// # Flow + /// 1. Ensure the origin is the root account. + /// 2. Ensure the new threshold amount is different from the current threshold. + /// 3. Emit a [`Event::ThresholdReset`] event. + /// 4. Set the new threshold amount. #[pallet::call_index(6)] #[pallet::weight(T::WeightInfo::withdraw())] pub fn set_threshold(origin: OriginFor, amount: BalanceOf) -> DispatchResult { ensure_root(origin)?; - ensure!(amount != Threshold::::get(), Error::::SequenceNumberOverflow); + ensure!(amount != Threshold::::get(), Error::::SameThreshold); + + Self::deposit_event(Event::ThresholdReset { + old: Threshold::::get(), + new: amount, + }); + Threshold::::set(amount); Ok(()) } } - impl Pallet { + impl Pallet { + /// Ensures that the origin is the current timegraph account. + /// + /// # Parameters + /// - `origin`: The origin of the call, which must be a signed account. + /// + /// # Errors + /// - Returns `Error::::SequenceNumberOverflow` if the origin is not the current timegraph account. pub fn ensure_timegraph(origin: OriginFor) -> DispatchResult { let who = ensure_signed(origin)?; let current_account = TimegraphAccount::::get(); diff --git a/pallets/timegraph/src/mock.rs b/pallets/timegraph/src/mock.rs index af77f2fb1..68ab868f8 100644 --- a/pallets/timegraph/src/mock.rs +++ b/pallets/timegraph/src/mock.rs @@ -40,7 +40,6 @@ impl pallet_balances::Config for Test { type WeightInfo = pallet_balances::weights::SubstrateWeight; } - // #[derive_impl(pallet_timegraph::config_preludes::TestDefaultConfig)] impl pallet_timegraph::Config for Test { type RuntimeEvent = RuntimeEvent; From 93434856229770592460509b14045c24cb964c3b Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Thu, 3 Oct 2024 14:32:24 +0800 Subject: [PATCH 05/31] document for all --- pallets/timegraph/src/lib.rs | 38 ++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/pallets/timegraph/src/lib.rs b/pallets/timegraph/src/lib.rs index 3f7c8ae08..6687fbe23 100644 --- a/pallets/timegraph/src/lib.rs +++ b/pallets/timegraph/src/lib.rs @@ -138,28 +138,55 @@ pub mod pallet { sequence: u64, }, + /// Transfer to pool event + /// + /// # Parameters + /// - `from`: The account ID of the user transferring the funds. + /// - `to`: The account ID of the pool receiving the funds. + /// - `amount`: The amount of funds transferred. TransferToPool { from: T::AccountId, to: T::AccountId, amount: BalanceOf, }, + /// Transfer award to user event + /// + /// # Parameters + /// - `from`: The account ID of the pool transferring the award. + /// - `to`: The account ID of the user receiving the award. + /// - `amount`: The amount of award transferred. TransferAwardToUser { from: T::AccountId, to: T::AccountId, amount: BalanceOf, }, + /// Timegraph account reset event + /// + /// # Parameters + /// - `old`: The old timegraph account ID. + /// - `new`: The new timegraph account ID. TimegraphAccountReset { old: T::AccountId, new: T::AccountId, }, + /// Reward pool account reset event + /// + /// # Parameters + /// - `old`: The old reward pool account ID. + /// - `new`: The new reward pool account ID. RewardPoolAccountReset { old: T::AccountId, new: T::AccountId, }, + /// Threshold reset event + /// + /// # Parameters + /// - `old`: The old threshold value. + /// - `new`: The new threshold value. ThresholdReset { old: BalanceOf, new: BalanceOf, @@ -178,10 +205,17 @@ pub mod pallet { NotWithdrawalRequired, /// The reward pool does not have enough balance to complete the operation. RewardPoolOutOfBalance, + /// The reward cannot be transferred to the same account. RewardToSameAccount, + /// The new timegraph account cannot be the same as the old one. SameTimegraphAccount, + /// The new reward pool account cannot be the same as the old one. SameRewardPoolAccount, + /// The new threshold cannot be the same as the old one. SameThreshold, + + /// The sender is not a timegraph account. + SenderIsNotTimegraph, } #[pallet::call] @@ -426,11 +460,11 @@ pub mod pallet { /// - `origin`: The origin of the call, which must be a signed account. /// /// # Errors - /// - Returns `Error::::SequenceNumberOverflow` if the origin is not the current timegraph account. + /// - Returns `Error::::SenderIsNotTimegraph` if the origin is not the current timegraph account. pub fn ensure_timegraph(origin: OriginFor) -> DispatchResult { let who = ensure_signed(origin)?; let current_account = TimegraphAccount::::get(); - ensure!(who == current_account, Error::::SequenceNumberOverflow); + ensure!(who == current_account, Error::::SenderIsNotTimegraph); Ok(()) } } From a4b3807cbb6e865aca678516bea8f93f84b099fa Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Thu, 3 Oct 2024 14:35:41 +0800 Subject: [PATCH 06/31] fmt code --- pallets/timegraph/src/lib.rs | 41 ++++++------------------------------ 1 file changed, 7 insertions(+), 34 deletions(-) diff --git a/pallets/timegraph/src/lib.rs b/pallets/timegraph/src/lib.rs index 6687fbe23..a57c55436 100644 --- a/pallets/timegraph/src/lib.rs +++ b/pallets/timegraph/src/lib.rs @@ -121,22 +121,14 @@ pub mod pallet { /// - `who`: The account ID of the user making the deposit. /// - `amount`: The amount of funds deposited. /// - `sequence`: The sequence number of the deposit. - Deposit { - who: T::AccountId, - amount: BalanceOf, - sequence: u64, - }, + Deposit { who: T::AccountId, amount: BalanceOf, sequence: u64 }, /// Withdrawal event /// /// # Parameters /// - `who`: The account ID of the user making the withdrawal. /// - `amount`: The amount of funds withdrawn. /// - `sequence`: The sequence number of the withdrawal. - Withdrawal { - who: T::AccountId, - amount: BalanceOf, - sequence: u64, - }, + Withdrawal { who: T::AccountId, amount: BalanceOf, sequence: u64 }, /// Transfer to pool event /// @@ -144,11 +136,7 @@ pub mod pallet { /// - `from`: The account ID of the user transferring the funds. /// - `to`: The account ID of the pool receiving the funds. /// - `amount`: The amount of funds transferred. - TransferToPool { - from: T::AccountId, - to: T::AccountId, - amount: BalanceOf, - }, + TransferToPool { from: T::AccountId, to: T::AccountId, amount: BalanceOf }, /// Transfer award to user event /// @@ -156,41 +144,28 @@ pub mod pallet { /// - `from`: The account ID of the pool transferring the award. /// - `to`: The account ID of the user receiving the award. /// - `amount`: The amount of award transferred. - TransferAwardToUser { - from: T::AccountId, - to: T::AccountId, - amount: BalanceOf, - }, + TransferAwardToUser { from: T::AccountId, to: T::AccountId, amount: BalanceOf }, /// Timegraph account reset event /// /// # Parameters /// - `old`: The old timegraph account ID. /// - `new`: The new timegraph account ID. - TimegraphAccountReset { - old: T::AccountId, - new: T::AccountId, - }, + TimegraphAccountReset { old: T::AccountId, new: T::AccountId }, /// Reward pool account reset event /// /// # Parameters /// - `old`: The old reward pool account ID. /// - `new`: The new reward pool account ID. - RewardPoolAccountReset { - old: T::AccountId, - new: T::AccountId, - }, + RewardPoolAccountReset { old: T::AccountId, new: T::AccountId }, /// Threshold reset event /// /// # Parameters /// - `old`: The old threshold value. /// - `new`: The new threshold value. - ThresholdReset { - old: BalanceOf, - new: BalanceOf, - }, + ThresholdReset { old: BalanceOf, new: BalanceOf }, } #[pallet::error] @@ -213,7 +188,6 @@ pub mod pallet { SameRewardPoolAccount, /// The new threshold cannot be the same as the old one. SameThreshold, - /// The sender is not a timegraph account. SenderIsNotTimegraph, } @@ -327,7 +301,6 @@ pub mod pallet { Ok(()) } - /// The extrinsic from timegraph allows transferring awards to a user /// /// # Flow From 525088ec62b6df41ddff01fbbd396f27c24e5a03 Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Thu, 3 Oct 2024 14:50:06 +0800 Subject: [PATCH 07/31] update benchmarks --- pallets/timegraph/src/benchmarking.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pallets/timegraph/src/benchmarking.rs b/pallets/timegraph/src/benchmarking.rs index 073aba7d2..ee5c9ea4b 100644 --- a/pallets/timegraph/src/benchmarking.rs +++ b/pallets/timegraph/src/benchmarking.rs @@ -18,24 +18,22 @@ mod benchmarks { #[benchmark] fn deposit() { let caller = whitelisted_caller(); - let recipient = account("recipient", 0, 1); let amount: BalanceOf = 5_000_000u32.into(); let amount_be: BalanceOf = amount * 100u32.into(); T::Currency::resolve_creating(&caller, T::Currency::issue(amount_be)); #[extrinsic_call] - deposit(RawOrigin::Signed(caller), recipient, amount); + deposit(RawOrigin::Signed(caller), amount); } #[benchmark] fn withdraw() { let caller = whitelisted_caller(); - let recipient = account("recipient", 0, 1); let amount: BalanceOf = 5_000_000u32.into(); let amount_be: BalanceOf = amount * 100u32.into(); let sequence = 1; T::Currency::resolve_creating(&caller, T::Currency::issue(amount_be)); #[extrinsic_call] - withdraw(RawOrigin::Signed(caller), recipient, amount, sequence); + withdraw(RawOrigin::Signed(caller), amount); } impl_benchmark_test_suite!(Timegraph, crate::mock::new_test_ext(), crate::mock::Test); From 83638e86f5b7069af85c814d7193a5359d0cbe71 Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Fri, 4 Oct 2024 10:33:57 +0800 Subject: [PATCH 08/31] fix unit tests --- Cargo.lock | 1 + pallets/timegraph/Cargo.toml | 3 +- pallets/timegraph/src/lib.rs | 6 +- pallets/timegraph/src/mock.rs | 7 +- pallets/timegraph/src/tests.rs | 115 +++++++++++++++------------------ 5 files changed, 64 insertions(+), 68 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 707719f30..4c25be487 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10419,6 +10419,7 @@ dependencies = [ name = "pallet-timegraph" version = "0.7.0" dependencies = [ + "log", "parity-scale-codec", "polkadot-sdk", "scale-info", diff --git a/pallets/timegraph/Cargo.toml b/pallets/timegraph/Cargo.toml index d1039d801..278358e8f 100644 --- a/pallets/timegraph/Cargo.toml +++ b/pallets/timegraph/Cargo.toml @@ -15,11 +15,12 @@ repository.workspace = true scale-codec = { workspace = true, features = [ "max-encoded-len" ] } scale-info.workspace = true simple-mermaid.workspace = true +log.workspace = true polkadot-sdk = { workspace = true, features = [ "frame-support", "frame-system", "sp-runtime" ] } [dev-dependencies] -polkadot-sdk = { workspace = true, features = [ "pallet-balances", "sp-core", "sp-io" ] } +polkadot-sdk = { workspace = true, features = [ "pallet-balances", "sp-core", "sp-io", "sp-tracing", "sp-runtime" ] } [features] default = [ "std" ] diff --git a/pallets/timegraph/src/lib.rs b/pallets/timegraph/src/lib.rs index a57c55436..173da04dd 100644 --- a/pallets/timegraph/src/lib.rs +++ b/pallets/timegraph/src/lib.rs @@ -71,16 +71,19 @@ pub mod pallet { type InitialRewardPoolAccount: Get; } + /// Default value from runtime configuration #[pallet::type_value] pub fn DefaultTimegraphAccount() -> T::AccountId { T::InitialTimegraphAccount::get() } + /// Default value from runtime configuration #[pallet::type_value] pub fn DefaultRewardPoolAccount() -> T::AccountId { T::InitialRewardPoolAccount::get() } + /// Default value from runtime configuration #[pallet::type_value] pub fn DefaultThreshold() -> BalanceOf { T::InitialThreshold::get() @@ -242,6 +245,7 @@ pub mod pallet { ensure!(amount > 0_u32.into(), Error::::ZeroAmount); let current_reserve = T::Currency::reserved_balance(&who); + let threshold = Threshold::::get(); ensure!( @@ -250,7 +254,7 @@ pub mod pallet { ); ensure!( - T::Currency::unreserve(&who, amount) == amount, + T::Currency::unreserve(&who, amount) == 0_u32.into(), Error::::NotWithdrawalRequired ); diff --git a/pallets/timegraph/src/mock.rs b/pallets/timegraph/src/mock.rs index 68ab868f8..f70d0da59 100644 --- a/pallets/timegraph/src/mock.rs +++ b/pallets/timegraph/src/mock.rs @@ -1,6 +1,8 @@ use crate::{self as pallet_timegraph}; -use polkadot_sdk::{frame_support, frame_system, pallet_balances, sp_core, sp_io, sp_runtime}; +use polkadot_sdk::{ + frame_support, frame_system, pallet_balances, sp_core, sp_io, sp_runtime, sp_tracing, +}; use frame_support::derive_impl; use sp_core::{ConstU128, ConstU64}; @@ -45,12 +47,13 @@ impl pallet_timegraph::Config for Test { type RuntimeEvent = RuntimeEvent; type WeightInfo = (); type Currency = Balances; - type InitialThreshold = ConstU128<1_000_000_000_000>; + type InitialThreshold = ConstU128<1_000>; type InitialRewardPoolAccount = ConstU64<1>; type InitialTimegraphAccount = ConstU64<2>; } pub fn new_test_ext() -> sp_io::TestExternalities { + sp_tracing::try_init_simple(); let mut storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: vec![(1_u64, 10_000_000), (2_u64, 20_000_000)], diff --git a/pallets/timegraph/src/tests.rs b/pallets/timegraph/src/tests.rs index 754a0c5e0..cbbc47ef6 100644 --- a/pallets/timegraph/src/tests.rs +++ b/pallets/timegraph/src/tests.rs @@ -2,10 +2,11 @@ use crate as pallet_timegraph; use crate::mock::*; use crate::{Error, Event}; -use polkadot_sdk::{frame_support, frame_system, pallet_balances}; +use polkadot_sdk::{frame_support, frame_system, pallet_balances, sp_runtime}; use frame_support::{assert_noop, assert_ok, traits::Currency}; use frame_system::{Origin, RawOrigin}; +use sp_runtime::traits::BadOrigin; #[test] fn deposit_works() { @@ -76,66 +77,52 @@ fn deposit_fails_with_sequence_overflow() { }); } -// #[test] -// fn test_withdraw() { -// new_test_ext().execute_with(|| {x -// let sender = 1; -// let receiver = 2; -// let amount = 100; -// let init_sequence = 0; -// assert_eq!(Timegraph::next_withdrawal_sequence(sender), init_sequence); - -// assert_noop!( -// Timegraph::withdraw( -// RawOrigin::Signed(sender).into(), -// sender, -// amount, -// init_sequence + 1 -// ), -// Error::::SenderSameWithReceiver -// ); - -// assert_noop!( -// Timegraph::withdraw( -// RawOrigin::Signed(sender).into(), -// receiver, -// 0_u128, -// init_sequence + 1 -// ), -// Error::::ZeroAmount -// ); - -// assert_noop!( -// Timegraph::withdraw(RawOrigin::Signed(sender).into(), receiver, amount, init_sequence), -// Error::::WithDrawalSequenceMismatch -// ); - -// assert_noop!( -// Timegraph::withdraw( -// RawOrigin::Signed(sender).into(), -// receiver, -// amount, -// init_sequence + 2 -// ), -// Error::::WithDrawalSequenceMismatch -// ); - -// assert_ok!(Timegraph::withdraw( -// RuntimeOrigin::signed(sender), -// receiver, -// amount, -// init_sequence + 1 -// )); -// assert_eq!(Timegraph::next_withdrawal_sequence(sender), init_sequence + 1); - -// System::assert_last_event( -// Event::::Withdrawal(sender, receiver, amount, init_sequence + 1).into(), -// ); - -// pallet_timegraph::NextWithdrawalSequence::::insert(sender, u64::MAX); -// assert_noop!( -// Timegraph::withdraw(RawOrigin::Signed(sender).into(), receiver, amount, init_sequence), -// Error::::SequenceNumberOverflow -// ); -// }); -// } +#[test] +fn test_withdraw_success() { + new_test_ext().execute_with(|| { + let user = 1; + let origin = RawOrigin::Signed(user); + let amount = 1000; + Timegraph::deposit( + RawOrigin::Signed(user).into(), + amount + pallet_timegraph::Threshold::::get(), + ); + let reserved = ::Currency::reserved_balance(&user); + assert_eq!(reserved, amount + pallet_timegraph::Threshold::::get(),); + assert_ok!(Timegraph::withdraw(origin.into(), amount)); + let reserved = ::Currency::reserved_balance(&user); + assert_eq!(reserved, pallet_timegraph::Threshold::::get()); + }); +} + +#[test] +fn test_withdraw_zero_amount() { + new_test_ext().execute_with(|| { + let user = 1; + let origin = RawOrigin::Signed(user); + // let amount: BalanceOf = 0; + assert_noop!(Timegraph::withdraw(origin.into(), 0_u32.into()), Error::::ZeroAmount); + }); +} + +#[test] +fn test_withdraw_over_reserve() { + new_test_ext().execute_with(|| { + let user = 1; + let origin = RawOrigin::Signed(user); + let amount = 1_000; + assert_noop!( + Timegraph::withdraw(origin.into(), amount), + Error::::WithdrawalAmountOverReserve + ); + }); +} + +#[test] +fn test_withdraw_bad_origin() { + new_test_ext().execute_with(|| { + let origin = RawOrigin::None; + let amount = 1000; + assert_noop!(Timegraph::withdraw(origin.into(), amount), BadOrigin); + }); +} From 6682ef93f5752fe766ffed7693beaca67a549c41 Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Fri, 4 Oct 2024 11:40:48 +0800 Subject: [PATCH 09/31] more unit tests --- pallets/timegraph/src/lib.rs | 2 +- pallets/timegraph/src/tests.rs | 82 +++++++++++++++++++++++++++++++++- 2 files changed, 81 insertions(+), 3 deletions(-) diff --git a/pallets/timegraph/src/lib.rs b/pallets/timegraph/src/lib.rs index 173da04dd..e468f5d23 100644 --- a/pallets/timegraph/src/lib.rs +++ b/pallets/timegraph/src/lib.rs @@ -287,7 +287,7 @@ pub mod pallet { ) -> DispatchResult { Self::ensure_timegraph(origin)?; let unserved = T::Currency::unreserve(&account, amount); - ensure!(unserved == amount, Error::::NotWithdrawalRequired); + ensure!(unserved == 0_u32.into(), Error::::NotWithdrawalRequired); T::Currency::transfer( &account, diff --git a/pallets/timegraph/src/tests.rs b/pallets/timegraph/src/tests.rs index cbbc47ef6..488153329 100644 --- a/pallets/timegraph/src/tests.rs +++ b/pallets/timegraph/src/tests.rs @@ -83,10 +83,10 @@ fn test_withdraw_success() { let user = 1; let origin = RawOrigin::Signed(user); let amount = 1000; - Timegraph::deposit( + assert_ok!(Timegraph::deposit( RawOrigin::Signed(user).into(), amount + pallet_timegraph::Threshold::::get(), - ); + )); let reserved = ::Currency::reserved_balance(&user); assert_eq!(reserved, amount + pallet_timegraph::Threshold::::get(),); assert_ok!(Timegraph::withdraw(origin.into(), amount)); @@ -126,3 +126,81 @@ fn test_withdraw_bad_origin() { assert_noop!(Timegraph::withdraw(origin.into(), amount), BadOrigin); }); } + +#[test] +fn transfer_to_pool_works() { + new_test_ext().execute_with(|| { + // Arrange + let timegraph_account = 1; + let user_account = 2; + let initial_reserved_balance = 1000; + let transfer_amount = 500; + + // Set the timegraph account + pallet_timegraph::TimegraphAccount::::set(timegraph_account); + + assert_ok!(Timegraph::deposit( + RawOrigin::Signed(user_account).into(), + transfer_amount + pallet_timegraph::Threshold::::get(), + )); + + // Act + assert_ok!(Timegraph::transfer_to_pool( + RawOrigin::Signed(timegraph_account).into(), + user_account, + transfer_amount + )); + + // Assert + assert_eq!(Balances::reserved_balance(&user_account), pallet_timegraph::Threshold::::get()); + }); +} + +#[test] +fn transfer_to_pool_fails_with_non_timegraph_origin() { + new_test_ext().execute_with(|| { + // Arrange + let non_timegraph_account = 3; + let user_account = 2; + let transfer_amount = 500; + + // Act & Assert + assert_noop!( + Timegraph::transfer_to_pool( + RawOrigin::Signed(non_timegraph_account).into(), + user_account, + transfer_amount + ), + Error::::SenderIsNotTimegraph + ); + }); +} + +#[test] +fn transfer_to_pool_fails_with_insufficient_reserved_balance() { + new_test_ext().execute_with(|| { + // Arrange + let timegraph_account = 1; + let user_account = 2; + let initial_reserved_balance = 300; + let transfer_amount = 500; + + // Set the timegraph account + pallet_timegraph::TimegraphAccount::::set(timegraph_account); + + assert_ok!(Timegraph::deposit( + RawOrigin::Signed(user_account).into(), + initial_reserved_balance + pallet_timegraph::Threshold::::get(), + )); + + // Act & Assert + assert_noop!( + Timegraph::transfer_to_pool( + RawOrigin::Signed(timegraph_account).into(), + user_account, + transfer_amount + pallet_timegraph::Threshold::::get() + ), + Error::::NotWithdrawalRequired + ); + }); +} From 48fbf6fef1476ac6c20b9ab8ef323f74e74f3f97 Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Mon, 7 Oct 2024 10:10:12 +0800 Subject: [PATCH 10/31] update runtime --- pallets/timegraph/src/tests.rs | 5 ++++- runtimes/mainnet/src/lib.rs | 9 +++++++++ runtimes/testnet/src/lib.rs | 17 +++++++++++++---- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/pallets/timegraph/src/tests.rs b/pallets/timegraph/src/tests.rs index 488153329..d0882da3d 100644 --- a/pallets/timegraph/src/tests.rs +++ b/pallets/timegraph/src/tests.rs @@ -152,7 +152,10 @@ fn transfer_to_pool_works() { )); // Assert - assert_eq!(Balances::reserved_balance(&user_account), pallet_timegraph::Threshold::::get()); + assert_eq!( + Balances::reserved_balance(&user_account), + pallet_timegraph::Threshold::::get() + ); }); } diff --git a/runtimes/mainnet/src/lib.rs b/runtimes/mainnet/src/lib.rs index 32e589ab2..786aedc9a 100644 --- a/runtimes/mainnet/src/lib.rs +++ b/runtimes/mainnet/src/lib.rs @@ -1301,10 +1301,19 @@ impl pallet_tasks::Config for Runtime { type MaxTasksPerBlock = ConstU32<10_000>; } +parameter_types! { + pub const InitialRewardPoolAccount: AccountId = AccountId::new([0_u8; 32]); + pub const InitialTimegraphAccount: AccountId = AccountId::new([0_u8; 32]); + pub const InitialThreshold: Balance = 1000; +} + impl pallet_timegraph::Config for Runtime { type RuntimeEvent = RuntimeEvent; type WeightInfo = weights::timegraph::WeightInfo; type Currency = Balances; + type InitialRewardPoolAccount = InitialRewardPoolAccount; + type InitialTimegraphAccount = InitialTimegraphAccount; + type InitialThreshold = InitialThreshold; } impl pallet_networks::Config for Runtime { diff --git a/runtimes/testnet/src/lib.rs b/runtimes/testnet/src/lib.rs index 6db1cba61..b82759362 100644 --- a/runtimes/testnet/src/lib.rs +++ b/runtimes/testnet/src/lib.rs @@ -53,12 +53,12 @@ use sp_runtime::{ generic::{self, Era}, impl_opaque_keys, traits::{ - BlakeTwo256, Block as BlockT, BlockNumberProvider, Hash as HashT, IdentityLookup, - NumberFor, OpaqueKeys, Saturating, + BlakeTwo256, Block as BlockT, BlockNumberProvider, Hash as HashT, IdentifyAccount, + IdentityLookup, NumberFor, OpaqueKeys, Saturating, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, ExtrinsicInclusionMode, FixedPointNumber, Percent, RuntimeDebug, - SaturatedConversion, + ApplyExtrinsicResult, ExtrinsicInclusionMode, FixedPointNumber, MultiSigner, Percent, + RuntimeDebug, SaturatedConversion, }; use sp_std::prelude::*; #[cfg(feature = "std")] @@ -1008,10 +1008,19 @@ impl pallet_tasks::Config for Runtime { type MaxTasksPerBlock = ConstU32<10_000>; } +parameter_types! { + pub const InitialRewardPoolAccount: AccountId = AccountId::new([0_u8; 32]); + pub const InitialTimegraphAccount: AccountId = AccountId::new([0_u8; 32]); + pub const InitialThreshold: Balance = 1000; +} + impl pallet_timegraph::Config for Runtime { type RuntimeEvent = RuntimeEvent; type WeightInfo = weights::timegraph::WeightInfo; type Currency = Balances; + type InitialRewardPoolAccount = InitialRewardPoolAccount; + type InitialTimegraphAccount = InitialTimegraphAccount; + type InitialThreshold = InitialThreshold; } impl pallet_networks::Config for Runtime { From dd12a84cd646ddd3c1ee55940e2202d6558572bb Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Mon, 7 Oct 2024 12:34:23 +0800 Subject: [PATCH 11/31] more test cases --- pallets/timegraph/src/tests.rs | 259 ++++++++++++++++++++++++++++++++- 1 file changed, 258 insertions(+), 1 deletion(-) diff --git a/pallets/timegraph/src/tests.rs b/pallets/timegraph/src/tests.rs index d0882da3d..94c52c748 100644 --- a/pallets/timegraph/src/tests.rs +++ b/pallets/timegraph/src/tests.rs @@ -133,7 +133,6 @@ fn transfer_to_pool_works() { // Arrange let timegraph_account = 1; let user_account = 2; - let initial_reserved_balance = 1000; let transfer_amount = 500; // Set the timegraph account @@ -207,3 +206,261 @@ fn transfer_to_pool_fails_with_insufficient_reserved_balance() { ); }); } + +#[test] +fn transfer_award_to_user_works() { + new_test_ext().execute_with(|| { + // Arrange + let timegraph_account = 1; + let user_account = 2; + let reward_pool_account = 3; + let initial_pool_balance = 1000; + let transfer_amount = 500; + + // Set the timegraph and reward pool accounts + pallet_timegraph::TimegraphAccount::::set(timegraph_account); + pallet_timegraph::RewardPoolAccount::::set(reward_pool_account); + + // Ensure the reward pool has enough balance + Balances::make_free_balance_be(&reward_pool_account, initial_pool_balance); + + // Act + assert_ok!(Timegraph::transfer_award_to_user( + RawOrigin::Signed(timegraph_account).into(), + user_account, + transfer_amount + )); + + // Assert + assert_eq!(Balances::reserved_balance(&user_account), transfer_amount); + assert_eq!( + Balances::free_balance(&reward_pool_account), + initial_pool_balance - transfer_amount + ); + }); +} + +#[test] +fn transfer_award_to_user_fails_with_insufficient_pool_balance() { + new_test_ext().execute_with(|| { + // Arrange + let timegraph_account = 1; + let user_account = 2; + let reward_pool_account = 3; + let initial_pool_balance = 300; + let transfer_amount = 500; + + // Set the timegraph and reward pool accounts + pallet_timegraph::TimegraphAccount::::set(timegraph_account); + pallet_timegraph::RewardPoolAccount::::set(reward_pool_account); + + // Ensure the reward pool has insufficient balance + Balances::make_free_balance_be(&reward_pool_account, initial_pool_balance); + + // Act & Assert + assert_noop!( + Timegraph::transfer_award_to_user( + RawOrigin::Signed(timegraph_account).into(), + user_account, + transfer_amount + ), + Error::::RewardPoolOutOfBalance + ); + }); +} + +#[test] +fn transfer_award_to_user_fails_when_transferring_to_reward_pool_account() { + new_test_ext().execute_with(|| { + // Arrange + let timegraph_account = 1; + let reward_pool_account = 3; + let transfer_amount = 500; + + // Set the timegraph and reward pool accounts + pallet_timegraph::TimegraphAccount::::set(timegraph_account); + pallet_timegraph::RewardPoolAccount::::set(reward_pool_account); + + // Act & Assert + assert_noop!( + Timegraph::transfer_award_to_user( + RawOrigin::Signed(timegraph_account).into(), + reward_pool_account, + transfer_amount + ), + Error::::RewardToSameAccount + ); + }); +} + +#[test] +fn set_timegraph_account_works() { + new_test_ext().execute_with(|| { + // Arrange + let new_timegraph_account = 1; + let root_origin = RawOrigin::Root; + + // Act + assert_ok!(Timegraph::set_timegraph_account(root_origin.into(), new_timegraph_account)); + + // Assert + assert_eq!(pallet_timegraph::TimegraphAccount::::get(), new_timegraph_account); + }); +} + +#[test] +fn set_timegraph_account_fails_with_same_account() { + new_test_ext().execute_with(|| { + // Arrange + let existing_timegraph_account = 1; + let root_origin = RawOrigin::Root; + + // Set the initial timegraph account + pallet_timegraph::TimegraphAccount::::set(existing_timegraph_account); + + // Act & Assert + assert_noop!( + Timegraph::set_timegraph_account(root_origin.into(), existing_timegraph_account), + Error::::SameTimegraphAccount + ); + }); +} + +#[test] +fn set_timegraph_account_fails_with_non_root_origin() { + new_test_ext().execute_with(|| { + // Arrange + let new_timegraph_account = 1; + let non_root_origin = RawOrigin::Signed(2); // Non-root account + + // Act & Assert + assert_noop!( + Timegraph::set_timegraph_account(non_root_origin.into(), new_timegraph_account), + sp_runtime::DispatchError::BadOrigin + ); + }); +} + +#[test] +fn set_reward_pool_account_works() { + new_test_ext().execute_with(|| { + // Arrange + let new_reward_pool_account = 6; + let root_origin = RawOrigin::Root; + + // Act + assert_ok!(Timegraph::set_reward_pool_account(root_origin.into(), new_reward_pool_account)); + + // Assert + assert_eq!(pallet_timegraph::RewardPoolAccount::::get(), new_reward_pool_account); + }); +} + +#[test] +fn set_reward_pool_account_fails_with_same_account() { + new_test_ext().execute_with(|| { + // Arrange + let existing_reward_pool_account = 1; + let root_origin = RawOrigin::Root; + + // Set the initial reward pool account + pallet_timegraph::RewardPoolAccount::::set(existing_reward_pool_account); + + // Act & Assert + assert_noop!( + Timegraph::set_reward_pool_account(root_origin.into(), existing_reward_pool_account), + Error::::SameRewardPoolAccount + ); + }); +} + +#[test] +fn set_reward_pool_account_fails_with_non_root_origin() { + new_test_ext().execute_with(|| { + // Arrange + let new_reward_pool_account = 1; + let non_root_origin = RawOrigin::Signed(2); // Non-root account + + // Act & Assert + assert_noop!( + Timegraph::set_reward_pool_account(non_root_origin.into(), new_reward_pool_account), + sp_runtime::DispatchError::BadOrigin + ); + }); +} + +#[test] +fn set_threshold_works() { + new_test_ext().execute_with(|| { + // Arrange + let new_threshold = 2000; + let root_origin = RawOrigin::Root; + + // Act + assert_ok!(Timegraph::set_threshold(root_origin.into(), new_threshold)); + + // Assert + assert_eq!(pallet_timegraph::Threshold::::get(), new_threshold); + }); +} + +#[test] +fn set_threshold_fails_with_same_value() { + new_test_ext().execute_with(|| { + // Arrange + let initial_threshold = 1000; + let root_origin = RawOrigin::Root; + + // Set the initial threshold + pallet_timegraph::Threshold::::set(initial_threshold); + + // Act & Assert + assert_noop!( + Timegraph::set_threshold(root_origin.into(), initial_threshold), + Error::::SameThreshold + ); + }); +} + +#[test] +fn set_threshold_fails_with_non_root_origin() { + new_test_ext().execute_with(|| { + // Arrange + let new_threshold = 2000; + let non_root_origin = RawOrigin::Signed(1); + + // Act & Assert + assert_noop!( + Timegraph::set_threshold(non_root_origin.into(), new_threshold), + sp_runtime::DispatchError::BadOrigin + ); + }); +} + +#[test] +fn ensure_timegraph_works_with_correct_origin() { + new_test_ext().execute_with(|| { + // Arrange + let timegraph_account = 1; + pallet_timegraph::TimegraphAccount::::set(timegraph_account); + + // Act & Assert + assert_ok!(Timegraph::ensure_timegraph(RawOrigin::Signed(timegraph_account).into())); + }); +} + +#[test] +fn ensure_timegraph_fails_with_incorrect_origin() { + new_test_ext().execute_with(|| { + // Arrange + let timegraph_account = 1; + let non_timegraph_account = 2; + pallet_timegraph::TimegraphAccount::::set(timegraph_account); + + // Act & Assert + assert_noop!( + Timegraph::ensure_timegraph(RawOrigin::Signed(non_timegraph_account).into()), + Error::::SenderIsNotTimegraph + ); + }); +} From ac48dc637e2a69b2eae69e346a64d6a22c65cffa Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Mon, 7 Oct 2024 12:50:58 +0800 Subject: [PATCH 12/31] fix clippy --- pallets/timegraph/src/tests.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pallets/timegraph/src/tests.rs b/pallets/timegraph/src/tests.rs index 94c52c748..b9c68ee40 100644 --- a/pallets/timegraph/src/tests.rs +++ b/pallets/timegraph/src/tests.rs @@ -1,11 +1,11 @@ use crate as pallet_timegraph; use crate::mock::*; -use crate::{Error, Event}; +use crate::{Error}; use polkadot_sdk::{frame_support, frame_system, pallet_balances, sp_runtime}; use frame_support::{assert_noop, assert_ok, traits::Currency}; -use frame_system::{Origin, RawOrigin}; +use frame_system::{RawOrigin}; use sp_runtime::traits::BadOrigin; #[test] @@ -23,8 +23,8 @@ fn deposit_works() { assert_ok!(Timegraph::deposit(RawOrigin::Signed(user).into(), deposit_amount)); // Assert - assert_eq!(Balances::reserved_balance(&user), deposit_amount); - assert_eq!(Timegraph::next_deposit_sequence(&user), 1); + assert_eq!(Balances::reserved_balance(user), deposit_amount); + assert_eq!(Timegraph::next_deposit_sequence(user), 1); }); } @@ -87,10 +87,10 @@ fn test_withdraw_success() { RawOrigin::Signed(user).into(), amount + pallet_timegraph::Threshold::::get(), )); - let reserved = ::Currency::reserved_balance(&user); + let reserved = ::Currency::reserved_balance(user); assert_eq!(reserved, amount + pallet_timegraph::Threshold::::get(),); assert_ok!(Timegraph::withdraw(origin.into(), amount)); - let reserved = ::Currency::reserved_balance(&user); + let reserved = ::Currency::reserved_balance(user); assert_eq!(reserved, pallet_timegraph::Threshold::::get()); }); } @@ -152,7 +152,7 @@ fn transfer_to_pool_works() { // Assert assert_eq!( - Balances::reserved_balance(&user_account), + Balances::reserved_balance(user_account), pallet_timegraph::Threshold::::get() ); }); @@ -232,9 +232,9 @@ fn transfer_award_to_user_works() { )); // Assert - assert_eq!(Balances::reserved_balance(&user_account), transfer_amount); + assert_eq!(Balances::reserved_balance(user_account), transfer_amount); assert_eq!( - Balances::free_balance(&reward_pool_account), + Balances::free_balance(reward_pool_account), initial_pool_balance - transfer_amount ); }); From 9068911e4c1888dfada3657ce87d636d207754fe Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Mon, 7 Oct 2024 13:44:40 +0800 Subject: [PATCH 13/31] fix clippy --- pallets/timegraph/src/tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/timegraph/src/tests.rs b/pallets/timegraph/src/tests.rs index b9c68ee40..7ce9de3a2 100644 --- a/pallets/timegraph/src/tests.rs +++ b/pallets/timegraph/src/tests.rs @@ -1,11 +1,11 @@ use crate as pallet_timegraph; use crate::mock::*; -use crate::{Error}; +use crate::Error; use polkadot_sdk::{frame_support, frame_system, pallet_balances, sp_runtime}; use frame_support::{assert_noop, assert_ok, traits::Currency}; -use frame_system::{RawOrigin}; +use frame_system::RawOrigin; use sp_runtime::traits::BadOrigin; #[test] From c6608b4a0b7421c3b6ca0ba9fecc1e836ea03b27 Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Mon, 7 Oct 2024 16:59:19 +0800 Subject: [PATCH 14/31] update benchmarks --- pallets/timegraph/src/benchmarking.rs | 37 ++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/pallets/timegraph/src/benchmarking.rs b/pallets/timegraph/src/benchmarking.rs index ee5c9ea4b..e7e63bf88 100644 --- a/pallets/timegraph/src/benchmarking.rs +++ b/pallets/timegraph/src/benchmarking.rs @@ -30,11 +30,46 @@ mod benchmarks { let caller = whitelisted_caller(); let amount: BalanceOf = 5_000_000u32.into(); let amount_be: BalanceOf = amount * 100u32.into(); - let sequence = 1; T::Currency::resolve_creating(&caller, T::Currency::issue(amount_be)); #[extrinsic_call] withdraw(RawOrigin::Signed(caller), amount); } + #[benchmark] + fn set_timegraph_account() { + let caller: T::AccountId = whitelisted_caller(); + let new_account: T::AccountId = T::AccountId::from([0u8; 32]); + #[extrinsic_call] + // Example new account + withdraw(RawOrigin::Signed(caller), amount); + } + + // // Benchmark for the `set_reward_pool_account` extrinsic + // #[benchmark] + // fn set_reward_pool_account() { + // let caller: T::AccountId = whitelisted_caller(); + // let new_pool_account: T::AccountId = T::AccountId::from([1u8; 32]); // Example new pool account + // }: _(RawOrigin::Root, new_pool_account) + // verify { + // // Verify that the new reward pool account is set correctly + // assert_eq!(RewardPoolAccount::::get(), new_pool_account); + // } + + // // Benchmark for the `transfer_award_to_user` extrinsic + // #[benchmark] + // fn transfer_award_to_user() { + // let caller: T::AccountId = whitelisted_caller(); + // let user_account: T::AccountId = T::AccountId::from([2u8; 32]); // Example user account + // let amount: BalanceOf = 100u32.into(); // Example transfer amount + + // // Ensure the reward pool has enough balance + // let reward_pool_account = RewardPoolAccount::::get(); + // T::Currency::make_free_balance_be(&reward_pool_account, 1000u32.into()); + // }: _(RawOrigin::Signed(caller), user_account, amount) + // verify { + // // Verify that the user's balance is updated correctly + // assert_eq!(T::Currency::free_balance(&user_account), amount); + // } + impl_benchmark_test_suite!(Timegraph, crate::mock::new_test_ext(), crate::mock::Test); } From 66d927b4d466ebd10510cbda9ca0ff6e1ff4d8b1 Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Mon, 7 Oct 2024 21:48:11 +0800 Subject: [PATCH 15/31] update benchmarks --- pallets/timegraph/Cargo.toml | 3 +++ pallets/timegraph/src/benchmarking.rs | 27 +++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/pallets/timegraph/Cargo.toml b/pallets/timegraph/Cargo.toml index 278358e8f..19b3ae760 100644 --- a/pallets/timegraph/Cargo.toml +++ b/pallets/timegraph/Cargo.toml @@ -18,10 +18,12 @@ simple-mermaid.workspace = true log.workspace = true polkadot-sdk = { workspace = true, features = [ "frame-support", "frame-system", "sp-runtime" ] } +time-primitives.workspace = true [dev-dependencies] polkadot-sdk = { workspace = true, features = [ "pallet-balances", "sp-core", "sp-io", "sp-tracing", "sp-runtime" ] } + [features] default = [ "std" ] std = [ @@ -29,6 +31,7 @@ std = [ "scale-info/std", "polkadot-sdk/std", + "time-primitives/std", ] runtime-benchmarks = [ "polkadot-sdk/runtime-benchmarks", diff --git a/pallets/timegraph/src/benchmarking.rs b/pallets/timegraph/src/benchmarking.rs index e7e63bf88..46cdaa80b 100644 --- a/pallets/timegraph/src/benchmarking.rs +++ b/pallets/timegraph/src/benchmarking.rs @@ -5,11 +5,20 @@ use super::*; #[allow(unused)] use crate::Pallet as Timegraph; -use polkadot_sdk::{frame_benchmarking, frame_support, frame_system}; +use polkadot_sdk::{frame_benchmarking, frame_support, frame_system, sp_core}; use frame_benchmarking::v2::*; use frame_system::RawOrigin; +use time_primitives::{AccountId, NetworkId, PublicKey}; + +pub const ALICE: [u8; 32] = [1u8; 32]; +pub const ETHEREUM: NetworkId = 1; + +fn public_key() -> PublicKey { + PublicKey::Sr25519(sp_core::sr25519::Public::from_raw(ALICE)) +} + #[benchmarks] mod benchmarks { use super::*; @@ -36,14 +45,24 @@ mod benchmarks { } #[benchmark] - fn set_timegraph_account() { + fn transfer_to_pool() { let caller: T::AccountId = whitelisted_caller(); - let new_account: T::AccountId = T::AccountId::from([0u8; 32]); + let account: T::AccountId = account("name", 0, 0); + let amount: BalanceOf = 5_000_000u32.into(); #[extrinsic_call] // Example new account - withdraw(RawOrigin::Signed(caller), amount); + transfer_to_pool(RawOrigin::Signed(caller), account, amount); } + // #[benchmark] + // fn set_timegraph_account() { + // let caller: T::AccountId = whitelisted_caller(); + // let new_account: T::AccountId = T::AccountId::from([0u8; 32]); + // #[extrinsic_call] + // // Example new account + // withdraw(RawOrigin::Signed(caller), amount); + // } + // // Benchmark for the `set_reward_pool_account` extrinsic // #[benchmark] // fn set_reward_pool_account() { From e0a1e77e6293100ee23ea16ad1ad28fb824d0139 Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Tue, 8 Oct 2024 10:40:48 +0800 Subject: [PATCH 16/31] update benchmarks --- Cargo.lock | 1 + pallets/timegraph/src/benchmarking.rs | 11 +---------- pallets/timegraph/src/lib.rs | 15 +++++++++++++++ runtimes/mainnet/src/weights/timegraph.rs | 20 ++++++++++++++++++++ runtimes/testnet/src/lib.rs | 4 ++-- runtimes/testnet/src/weights/timegraph.rs | 23 +++++++++++++++++++++++ 6 files changed, 62 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 520879849..2a5d8799c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10368,6 +10368,7 @@ dependencies = [ "polkadot-sdk", "scale-info", "simple-mermaid", + "time-primitives", ] [[package]] diff --git a/pallets/timegraph/src/benchmarking.rs b/pallets/timegraph/src/benchmarking.rs index 46cdaa80b..a53e5ad3a 100644 --- a/pallets/timegraph/src/benchmarking.rs +++ b/pallets/timegraph/src/benchmarking.rs @@ -5,20 +5,11 @@ use super::*; #[allow(unused)] use crate::Pallet as Timegraph; -use polkadot_sdk::{frame_benchmarking, frame_support, frame_system, sp_core}; +use polkadot_sdk::{frame_benchmarking, frame_support, frame_system}; use frame_benchmarking::v2::*; use frame_system::RawOrigin; -use time_primitives::{AccountId, NetworkId, PublicKey}; - -pub const ALICE: [u8; 32] = [1u8; 32]; -pub const ETHEREUM: NetworkId = 1; - -fn public_key() -> PublicKey { - PublicKey::Sr25519(sp_core::sr25519::Public::from_raw(ALICE)) -} - #[benchmarks] mod benchmarks { use super::*; diff --git a/pallets/timegraph/src/lib.rs b/pallets/timegraph/src/lib.rs index e468f5d23..0462b9aec 100644 --- a/pallets/timegraph/src/lib.rs +++ b/pallets/timegraph/src/lib.rs @@ -33,6 +33,9 @@ pub mod pallet { fn withdraw() -> Weight; fn transfer_to_pool() -> Weight; fn transfer_award_to_user() -> Weight; + fn set_timegraph_account() -> Weight; + fn set_reward_pool_account() -> Weight; + fn set_threshold() -> Weight; } impl WeightInfo for () { @@ -51,6 +54,18 @@ pub mod pallet { fn transfer_award_to_user() -> Weight { Weight::default() } + + fn set_timegraph_account() -> Weight { + Weight::default() + } + + fn set_reward_pool_account() -> Weight { + Weight::default() + } + + fn set_threshold() -> Weight { + Weight::default() + } } #[pallet::pallet] diff --git a/runtimes/mainnet/src/weights/timegraph.rs b/runtimes/mainnet/src/weights/timegraph.rs index 51f69927d..eef2ceba2 100644 --- a/runtimes/mainnet/src/weights/timegraph.rs +++ b/runtimes/mainnet/src/weights/timegraph.rs @@ -61,4 +61,24 @@ impl pallet_timegraph::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } + + fn transfer_to_pool() -> Weight { + Weight::default() + } + + fn transfer_award_to_user() -> Weight { + Weight::default() + } + + fn set_timegraph_account() -> Weight { + Weight::default() + } + + fn set_reward_pool_account() -> Weight { + Weight::default() + } + + fn set_threshold() -> Weight { + Weight::default() + } } diff --git a/runtimes/testnet/src/lib.rs b/runtimes/testnet/src/lib.rs index 385a54efb..fe709432f 100644 --- a/runtimes/testnet/src/lib.rs +++ b/runtimes/testnet/src/lib.rs @@ -57,8 +57,8 @@ use sp_runtime::{ IdentityLookup, NumberFor, OpaqueKeys, Saturating, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, ExtrinsicInclusionMode, FixedPointNumber, MultiSigner, Percent, - RuntimeDebug, SaturatedConversion, + ApplyExtrinsicResult, ExtrinsicInclusionMode, FixedPointNumber, Percent, RuntimeDebug, + SaturatedConversion, }; use sp_std::prelude::*; #[cfg(feature = "std")] diff --git a/runtimes/testnet/src/weights/timegraph.rs b/runtimes/testnet/src/weights/timegraph.rs index a804b84c4..0b9320d44 100644 --- a/runtimes/testnet/src/weights/timegraph.rs +++ b/runtimes/testnet/src/weights/timegraph.rs @@ -61,4 +61,27 @@ impl pallet_timegraph::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } + + fn transfer_to_pool() -> Weight { + Weight::default() + } + + fn transfer_award_to_user() -> Weight { + Weight::default() + } + + fn set_timegraph_account() -> Weight { + Weight::default() + } + + fn set_reward_pool_account() -> Weight { + Weight::default() + } + + fn set_threshold() -> Weight { + Weight::default() + } + + + } From aa0627e905aaaa6a4b1a24db5271543d3fc85851 Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Tue, 8 Oct 2024 13:14:36 +0800 Subject: [PATCH 17/31] fix clippy --- runtimes/testnet/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtimes/testnet/src/lib.rs b/runtimes/testnet/src/lib.rs index fe709432f..21aee86c5 100644 --- a/runtimes/testnet/src/lib.rs +++ b/runtimes/testnet/src/lib.rs @@ -53,8 +53,8 @@ use sp_runtime::{ generic::{self, Era}, impl_opaque_keys, traits::{ - BlakeTwo256, Block as BlockT, BlockNumberProvider, Hash as HashT, IdentifyAccount, - IdentityLookup, NumberFor, OpaqueKeys, Saturating, + BlakeTwo256, Block as BlockT, BlockNumberProvider, Hash as HashT, IdentityLookup, + NumberFor, OpaqueKeys, Saturating, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, ApplyExtrinsicResult, ExtrinsicInclusionMode, FixedPointNumber, Percent, RuntimeDebug, From b351c9eb718ef733dd1105145685703180792620 Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Tue, 8 Oct 2024 15:14:49 +0800 Subject: [PATCH 18/31] fix function in benchmarks --- pallets/timegraph/src/benchmarking.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pallets/timegraph/src/benchmarking.rs b/pallets/timegraph/src/benchmarking.rs index a53e5ad3a..951df2ea5 100644 --- a/pallets/timegraph/src/benchmarking.rs +++ b/pallets/timegraph/src/benchmarking.rs @@ -13,7 +13,7 @@ use frame_system::RawOrigin; #[benchmarks] mod benchmarks { use super::*; - use frame_support::traits::Currency; + use frame_support::traits::{Currency, ReservableCurrency}; #[benchmark] fn deposit() { @@ -31,6 +31,8 @@ mod benchmarks { let amount: BalanceOf = 5_000_000u32.into(); let amount_be: BalanceOf = amount * 100u32.into(); T::Currency::resolve_creating(&caller, T::Currency::issue(amount_be)); + let _ = T::Currency::reserve(&caller, Threshold::::get() + amount); + #[extrinsic_call] withdraw(RawOrigin::Signed(caller), amount); } @@ -40,8 +42,8 @@ mod benchmarks { let caller: T::AccountId = whitelisted_caller(); let account: T::AccountId = account("name", 0, 0); let amount: BalanceOf = 5_000_000u32.into(); + let _ = T::Currency::reserve(&caller, Threshold::::get() + amount); #[extrinsic_call] - // Example new account transfer_to_pool(RawOrigin::Signed(caller), account, amount); } From 54fe4d9835744feb122c762687534afe7f3e1e6d Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Wed, 9 Oct 2024 11:02:00 +0800 Subject: [PATCH 19/31] update benchmarks --- pallets/timegraph/src/benchmarking.rs | 85 +++++++++++++++------------ 1 file changed, 48 insertions(+), 37 deletions(-) diff --git a/pallets/timegraph/src/benchmarking.rs b/pallets/timegraph/src/benchmarking.rs index 951df2ea5..d10a78010 100644 --- a/pallets/timegraph/src/benchmarking.rs +++ b/pallets/timegraph/src/benchmarking.rs @@ -41,47 +41,58 @@ mod benchmarks { fn transfer_to_pool() { let caller: T::AccountId = whitelisted_caller(); let account: T::AccountId = account("name", 0, 0); - let amount: BalanceOf = 5_000_000u32.into(); - let _ = T::Currency::reserve(&caller, Threshold::::get() + amount); + let amount: BalanceOf = 5_000_000_u32.into(); + T::Currency::resolve_creating( + &account, + T::Currency::issue(amount * 100u32.into() + Threshold::::get()), + ); + TimegraphAccount::::set(caller.clone()); + T::Currency::reserve(&account, Threshold::::get() + amount); + #[extrinsic_call] transfer_to_pool(RawOrigin::Signed(caller), account, amount); } - // #[benchmark] - // fn set_timegraph_account() { - // let caller: T::AccountId = whitelisted_caller(); - // let new_account: T::AccountId = T::AccountId::from([0u8; 32]); - // #[extrinsic_call] - // // Example new account - // withdraw(RawOrigin::Signed(caller), amount); - // } - - // // Benchmark for the `set_reward_pool_account` extrinsic - // #[benchmark] - // fn set_reward_pool_account() { - // let caller: T::AccountId = whitelisted_caller(); - // let new_pool_account: T::AccountId = T::AccountId::from([1u8; 32]); // Example new pool account - // }: _(RawOrigin::Root, new_pool_account) - // verify { - // // Verify that the new reward pool account is set correctly - // assert_eq!(RewardPoolAccount::::get(), new_pool_account); - // } - - // // Benchmark for the `transfer_award_to_user` extrinsic - // #[benchmark] - // fn transfer_award_to_user() { - // let caller: T::AccountId = whitelisted_caller(); - // let user_account: T::AccountId = T::AccountId::from([2u8; 32]); // Example user account - // let amount: BalanceOf = 100u32.into(); // Example transfer amount - - // // Ensure the reward pool has enough balance - // let reward_pool_account = RewardPoolAccount::::get(); - // T::Currency::make_free_balance_be(&reward_pool_account, 1000u32.into()); - // }: _(RawOrigin::Signed(caller), user_account, amount) - // verify { - // // Verify that the user's balance is updated correctly - // assert_eq!(T::Currency::free_balance(&user_account), amount); - // } + #[benchmark] + fn transfer_award_to_user() { + let caller: T::AccountId = whitelisted_caller(); + let account: T::AccountId = account("name", 0, 0); + let amount: BalanceOf = 5_000_000_u32.into(); + + T::Currency::resolve_creating(&caller, T::Currency::issue(amount * 200u32.into())); + + T::Currency::resolve_creating(&account, T::Currency::issue(amount * 100u32.into())); + + TimegraphAccount::::set(caller.clone()); + RewardPoolAccount::::set(caller.clone()); + + #[extrinsic_call] + transfer_award_to_user(RawOrigin::Signed(caller), account, amount); + } + + #[benchmark] + fn set_timegraph_account() { + let new_account: T::AccountId = account("name", 0, 0); + #[extrinsic_call] + // Example new account + set_timegraph_account(RawOrigin::Root, new_account); + } + + #[benchmark] + fn set_reward_pool_account() { + let new_account: T::AccountId = account("name", 0, 0); + + #[extrinsic_call] + set_reward_pool_account(RawOrigin::Root, new_account); + } + + #[benchmark] + fn set_threshold() { + let amount: BalanceOf = 5_000_000_u32.into(); + + #[extrinsic_call] + set_threshold(RawOrigin::Root, amount); + } impl_benchmark_test_suite!(Timegraph, crate::mock::new_test_ext(), crate::mock::Test); } From da20a938699b519996c368c84f30ac6d6fe10870 Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Wed, 9 Oct 2024 11:03:13 +0800 Subject: [PATCH 20/31] fix clippy --- pallets/timegraph/src/benchmarking.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/timegraph/src/benchmarking.rs b/pallets/timegraph/src/benchmarking.rs index d10a78010..980082166 100644 --- a/pallets/timegraph/src/benchmarking.rs +++ b/pallets/timegraph/src/benchmarking.rs @@ -47,7 +47,7 @@ mod benchmarks { T::Currency::issue(amount * 100u32.into() + Threshold::::get()), ); TimegraphAccount::::set(caller.clone()); - T::Currency::reserve(&account, Threshold::::get() + amount); + let _ = T::Currency::reserve(&account, Threshold::::get() + amount); #[extrinsic_call] transfer_to_pool(RawOrigin::Signed(caller), account, amount); From 7e9bfefcfadebb8151f20dc7c58b2c9abbcc2835 Mon Sep 17 00:00:00 2001 From: Github Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 09:05:26 +0000 Subject: [PATCH 21/31] runtimes: update pallet weights --- runtimes/mainnet/src/weights/dmail.rs | 12 +-- runtimes/mainnet/src/weights/elections.rs | 6 +- runtimes/mainnet/src/weights/members.rs | 14 +-- runtimes/mainnet/src/weights/networks.rs | 16 ++-- runtimes/mainnet/src/weights/shards.rs | 18 ++-- runtimes/mainnet/src/weights/tasks.rs | 24 +++-- runtimes/mainnet/src/weights/timegraph.rs | 98 +++++++++++++++------ runtimes/testnet/src/weights/dmail.rs | 14 +-- runtimes/testnet/src/weights/elections.rs | 6 +- runtimes/testnet/src/weights/members.rs | 14 +-- runtimes/testnet/src/weights/networks.rs | 14 ++- runtimes/testnet/src/weights/shards.rs | 18 ++-- runtimes/testnet/src/weights/tasks.rs | 24 +++-- runtimes/testnet/src/weights/timegraph.rs | 101 +++++++++++++++------- 14 files changed, 229 insertions(+), 150 deletions(-) diff --git a/runtimes/mainnet/src/weights/dmail.rs b/runtimes/mainnet/src/weights/dmail.rs index 20ecdf751..1df3b5ee5 100644 --- a/runtimes/mainnet/src/weights/dmail.rs +++ b/runtimes/mainnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -37,16 +37,12 @@ impl pallet_dmail::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 1000]`. /// The range of component `a` is `[1, 1000]`. /// The range of component `b` is `[1, 1000]`. - fn send_email(a: u32, b: u32, ) -> Weight { + fn send_email(_a: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_306_000 picoseconds. - Weight::from_parts(8_154_792, 0) + // Minimum execution time: 8_096_000 picoseconds. + Weight::from_parts(11_257_439, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 64 - .saturating_add(Weight::from_parts(1_709, 0).saturating_mul(a.into())) - // Standard Error: 64 - .saturating_add(Weight::from_parts(1_390, 0).saturating_mul(b.into())) } } diff --git a/runtimes/mainnet/src/weights/elections.rs b/runtimes/mainnet/src/weights/elections.rs index d8d21243d..1ccc16406 100644 --- a/runtimes/mainnet/src/weights/elections.rs +++ b/runtimes/mainnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_032_000 picoseconds. - Weight::from_parts(12_934_000, 0) + // Minimum execution time: 18_154_000 picoseconds. + Weight::from_parts(22_141_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/mainnet/src/weights/members.rs b/runtimes/mainnet/src/weights/members.rs index 99808a445..d1a0a77c2 100644 --- a/runtimes/mainnet/src/weights/members.rs +++ b/runtimes/mainnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 65_983_000 picoseconds. - Weight::from_parts(69_980_000, 0) + // Minimum execution time: 62_668_000 picoseconds. + Weight::from_parts(65_613_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 23_444_000 picoseconds. - Weight::from_parts(24_496_000, 0) + // Minimum execution time: 21_912_000 picoseconds. + Weight::from_parts(23_073_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 60_433_000 picoseconds. - Weight::from_parts(63_148_000, 0) + // Minimum execution time: 57_096_000 picoseconds. + Weight::from_parts(59_091_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/mainnet/src/weights/networks.rs b/runtimes/mainnet/src/weights/networks.rs index 9a27bb420..e7de2a4fe 100644 --- a/runtimes/mainnet/src/weights/networks.rs +++ b/runtimes/mainnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -63,15 +63,15 @@ impl pallet_networks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 1000]`. /// The range of component `a` is `[1, 1000]`. /// The range of component `b` is `[1, 1000]`. - fn register_network(_a: u32, b: u32, ) -> Weight { + fn register_network(a: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 57_528_000 picoseconds. - Weight::from_parts(67_875_460, 0) + // Minimum execution time: 54_472_000 picoseconds. + Weight::from_parts(60_721_590, 0) .saturating_add(Weight::from_parts(0, 3583)) - // Standard Error: 582 - .saturating_add(Weight::from_parts(2_239, 0).saturating_mul(b.into())) + // Standard Error: 878 + .saturating_add(Weight::from_parts(9_384, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -89,8 +89,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 22_822_000 picoseconds. - Weight::from_parts(24_496_000, 0) + // Minimum execution time: 21_078_000 picoseconds. + Weight::from_parts(22_713_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/mainnet/src/weights/shards.rs b/runtimes/mainnet/src/weights/shards.rs index 1936e3a17..4fd24a56b 100644 --- a/runtimes/mainnet/src/weights/shards.rs +++ b/runtimes/mainnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 523_901_000 picoseconds. - Weight::from_parts(575_157_000, 0) + // Minimum execution time: 515_665_000 picoseconds. + Weight::from_parts(537_095_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 63_900_000 picoseconds. - Weight::from_parts(74_540_000, 0) + // Minimum execution time: 61_144_000 picoseconds. + Weight::from_parts(64_941_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 75_850_000 picoseconds. - Weight::from_parts(81_784_000, 0) + // Minimum execution time: 71_514_000 picoseconds. + Weight::from_parts(76_032_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_676_000 picoseconds. - Weight::from_parts(3_907_000, 0) + // Minimum execution time: 3_577_000 picoseconds. + Weight::from_parts(3_807_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/mainnet/src/weights/tasks.rs b/runtimes/mainnet/src/weights/tasks.rs index fc1c9c7fe..4ddb34d3d 100644 --- a/runtimes/mainnet/src/weights/tasks.rs +++ b/runtimes/mainnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,8 +41,6 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// Proof: `Tasks::TaskShard` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Shards::ShardNetwork` (r:1 w:0) /// Proof: `Shards::ShardNetwork` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Networks::NetworkGatewayAddress` (r:1 w:0) - /// Proof: `Networks::NetworkGatewayAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Shards::ShardCommitment` (r:1 w:0) /// Proof: `Shards::ShardCommitment` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Networks::NetworkBatchSize` (r:1 w:0) @@ -69,12 +67,12 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// Proof: `Tasks::TaskNetwork` (`max_values`: None, `max_size`: None, mode: `Measured`) fn submit_task_result() -> Weight { // Proof Size summary in bytes: - // Measured: `1381` - // Estimated: `12271` - // Minimum execution time: 635_821_000 picoseconds. - Weight::from_parts(685_121_000, 0) - .saturating_add(Weight::from_parts(0, 12271)) - .saturating_add(T::DbWeight::get().reads(20)) + // Measured: `1380` + // Estimated: `12270` + // Minimum execution time: 654_895_000 picoseconds. + Weight::from_parts(695_300_000, 0) + .saturating_add(Weight::from_parts(0, 12270)) + .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) } /// Storage: `Tasks::ReadEventsTask` (r:2 w:0) @@ -107,11 +105,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3665` // Estimated: `9197` - // Minimum execution time: 76_194_000 picoseconds. - Weight::from_parts(143_303_681, 0) + // Minimum execution time: 78_306_000 picoseconds. + Weight::from_parts(138_792_154, 0) .saturating_add(Weight::from_parts(0, 9197)) - // Standard Error: 115 - .saturating_add(Weight::from_parts(7_783, 0).saturating_mul(b.into())) + // Standard Error: 91 + .saturating_add(Weight::from_parts(7_492, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtimes/mainnet/src/weights/timegraph.rs b/runtimes/mainnet/src/weights/timegraph.rs index eef2ceba2..c1bc89d71 100644 --- a/runtimes/mainnet/src/weights/timegraph.rs +++ b/runtimes/mainnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -33,52 +33,98 @@ use core::marker::PhantomData; /// Weight functions for `pallet_timegraph`. pub struct WeightInfo(PhantomData); impl pallet_timegraph::WeightInfo for WeightInfo { - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `Timegraph::NextDepositSequence` (r:1 w:1) /// Proof: `Timegraph::NextDepositSequence` (`max_values`: None, `max_size`: None, mode: `Measured`) fn deposit() -> Weight { // Proof Size summary in bytes: // Measured: `3` - // Estimated: `3593` - // Minimum execution time: 65_263_000 picoseconds. - Weight::from_parts(66_885_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + // Estimated: `3468` + // Minimum execution time: 31_509_000 picoseconds. + Weight::from_parts(32_821_000, 0) + .saturating_add(Weight::from_parts(0, 3468)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `Timegraph::Threshold` (r:1 w:0) + /// Proof: `Timegraph::Threshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Timegraph::NextWithdrawalSequence` (r:1 w:1) /// Proof: `Timegraph::NextWithdrawalSequence` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn withdraw() -> Weight { // Proof Size summary in bytes: // Measured: `3` - // Estimated: `3593` - // Minimum execution time: 65_902_000 picoseconds. - Weight::from_parts(67_226_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) + // Estimated: `3468` + // Minimum execution time: 31_919_000 picoseconds. + Weight::from_parts(33_333_000, 0) + .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(1)) } - + /// Storage: `Timegraph::TimegraphAccount` (r:1 w:0) + /// Proof: `Timegraph::TimegraphAccount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Timegraph::RewardPoolAccount` (r:1 w:0) + /// Proof: `Timegraph::RewardPoolAccount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn transfer_to_pool() -> Weight { - Weight::default() + // Proof Size summary in bytes: + // Measured: `272` + // Estimated: `6196` + // Minimum execution time: 79_769_000 picoseconds. + Weight::from_parts(81_723_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) } - + /// Storage: `Timegraph::TimegraphAccount` (r:1 w:0) + /// Proof: `Timegraph::TimegraphAccount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Timegraph::RewardPoolAccount` (r:1 w:0) + /// Proof: `Timegraph::RewardPoolAccount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn transfer_award_to_user() -> Weight { - Weight::default() + // Proof Size summary in bytes: + // Measured: `285` + // Estimated: `3593` + // Minimum execution time: 77_115_000 picoseconds. + Weight::from_parts(78_756_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) } - + /// Storage: `Timegraph::TimegraphAccount` (r:1 w:1) + /// Proof: `Timegraph::TimegraphAccount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn set_timegraph_account() -> Weight { - Weight::default() + // Proof Size summary in bytes: + // Measured: `3` + // Estimated: `1488` + // Minimum execution time: 9_267_000 picoseconds. + Weight::from_parts(9_988_000, 0) + .saturating_add(Weight::from_parts(0, 1488)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - + /// Storage: `Timegraph::RewardPoolAccount` (r:1 w:1) + /// Proof: `Timegraph::RewardPoolAccount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn set_reward_pool_account() -> Weight { - Weight::default() + // Proof Size summary in bytes: + // Measured: `3` + // Estimated: `1488` + // Minimum execution time: 9_318_000 picoseconds. + Weight::from_parts(10_038_000, 0) + .saturating_add(Weight::from_parts(0, 1488)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - + /// Storage: `Timegraph::Threshold` (r:1 w:1) + /// Proof: `Timegraph::Threshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn set_threshold() -> Weight { - Weight::default() + // Proof Size summary in bytes: + // Measured: `3` + // Estimated: `1488` + // Minimum execution time: 9_117_000 picoseconds. + Weight::from_parts(9_678_000, 0) + .saturating_add(Weight::from_parts(0, 1488)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/runtimes/testnet/src/weights/dmail.rs b/runtimes/testnet/src/weights/dmail.rs index 86059c967..3522110f9 100644 --- a/runtimes/testnet/src/weights/dmail.rs +++ b/runtimes/testnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,12 +41,12 @@ impl pallet_dmail::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_026_000 picoseconds. - Weight::from_parts(8_734_292, 0) + // Minimum execution time: 7_985_000 picoseconds. + Weight::from_parts(8_063_180, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 97 - .saturating_add(Weight::from_parts(858, 0).saturating_mul(a.into())) - // Standard Error: 97 - .saturating_add(Weight::from_parts(997, 0).saturating_mul(b.into())) + // Standard Error: 58 + .saturating_add(Weight::from_parts(1_319, 0).saturating_mul(a.into())) + // Standard Error: 58 + .saturating_add(Weight::from_parts(453, 0).saturating_mul(b.into())) } } diff --git a/runtimes/testnet/src/weights/elections.rs b/runtimes/testnet/src/weights/elections.rs index c32d68431..7fc9a6ea4 100644 --- a/runtimes/testnet/src/weights/elections.rs +++ b/runtimes/testnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_233_000 picoseconds. - Weight::from_parts(14_056_000, 0) + // Minimum execution time: 12_774_000 picoseconds. + Weight::from_parts(14_327_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/testnet/src/weights/members.rs b/runtimes/testnet/src/weights/members.rs index e2b0e2555..7aea4c18d 100644 --- a/runtimes/testnet/src/weights/members.rs +++ b/runtimes/testnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 63_728_000 picoseconds. - Weight::from_parts(75_172_000, 0) + // Minimum execution time: 63_319_000 picoseconds. + Weight::from_parts(98_364_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 22_552_000 picoseconds. - Weight::from_parts(25_057_000, 0) + // Minimum execution time: 22_081_000 picoseconds. + Weight::from_parts(25_748_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 58_929_000 picoseconds. - Weight::from_parts(96_210_000, 0) + // Minimum execution time: 57_928_000 picoseconds. + Weight::from_parts(63_690_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/testnet/src/weights/networks.rs b/runtimes/testnet/src/weights/networks.rs index b5664fd0b..147755bba 100644 --- a/runtimes/testnet/src/weights/networks.rs +++ b/runtimes/testnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -63,15 +63,13 @@ impl pallet_networks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 1000]`. /// The range of component `a` is `[1, 1000]`. /// The range of component `b` is `[1, 1000]`. - fn register_network(a: u32, _b: u32, ) -> Weight { + fn register_network(_a: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 58_479_000 picoseconds. - Weight::from_parts(83_677_227, 0) + // Minimum execution time: 54_702_000 picoseconds. + Weight::from_parts(68_118_259, 0) .saturating_add(Weight::from_parts(0, 3583)) - // Standard Error: 857 - .saturating_add(Weight::from_parts(306, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -89,8 +87,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 23_053_000 picoseconds. - Weight::from_parts(26_610_000, 0) + // Minimum execution time: 21_580_000 picoseconds. + Weight::from_parts(23_114_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/testnet/src/weights/shards.rs b/runtimes/testnet/src/weights/shards.rs index f3802ccca..9e773dfde 100644 --- a/runtimes/testnet/src/weights/shards.rs +++ b/runtimes/testnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 529_191_000 picoseconds. - Weight::from_parts(612_456_000, 0) + // Minimum execution time: 515_534_000 picoseconds. + Weight::from_parts(518_259_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 62_176_000 picoseconds. - Weight::from_parts(68_717_000, 0) + // Minimum execution time: 60_263_000 picoseconds. + Weight::from_parts(62_045_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 74_419_000 picoseconds. - Weight::from_parts(78_317_000, 0) + // Minimum execution time: 74_169_000 picoseconds. + Weight::from_parts(76_524_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_667_000 picoseconds. - Weight::from_parts(3_867_000, 0) + // Minimum execution time: 3_527_000 picoseconds. + Weight::from_parts(3_797_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/testnet/src/weights/tasks.rs b/runtimes/testnet/src/weights/tasks.rs index fb394db88..301aac4b3 100644 --- a/runtimes/testnet/src/weights/tasks.rs +++ b/runtimes/testnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,8 +41,6 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// Proof: `Tasks::TaskShard` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Shards::ShardNetwork` (r:1 w:0) /// Proof: `Shards::ShardNetwork` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Networks::NetworkGatewayAddress` (r:1 w:0) - /// Proof: `Networks::NetworkGatewayAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Shards::ShardCommitment` (r:1 w:0) /// Proof: `Shards::ShardCommitment` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Networks::NetworkBatchSize` (r:1 w:0) @@ -69,12 +67,12 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// Proof: `Tasks::TaskNetwork` (`max_values`: None, `max_size`: None, mode: `Measured`) fn submit_task_result() -> Weight { // Proof Size summary in bytes: - // Measured: `1381` - // Estimated: `12271` - // Minimum execution time: 661_105_000 picoseconds. - Weight::from_parts(739_063_000, 0) - .saturating_add(Weight::from_parts(0, 12271)) - .saturating_add(T::DbWeight::get().reads(20)) + // Measured: `1380` + // Estimated: `12270` + // Minimum execution time: 631_722_000 picoseconds. + Weight::from_parts(643_855_000, 0) + .saturating_add(Weight::from_parts(0, 12270)) + .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) } /// Storage: `Tasks::ReadEventsTask` (r:2 w:0) @@ -107,11 +105,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3665` // Estimated: `9197` - // Minimum execution time: 80_151_000 picoseconds. - Weight::from_parts(146_706_263, 0) + // Minimum execution time: 75_792_000 picoseconds. + Weight::from_parts(133_102_321, 0) .saturating_add(Weight::from_parts(0, 9197)) - // Standard Error: 109 - .saturating_add(Weight::from_parts(7_616, 0).saturating_mul(b.into())) + // Standard Error: 99 + .saturating_add(Weight::from_parts(8_363, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtimes/testnet/src/weights/timegraph.rs b/runtimes/testnet/src/weights/timegraph.rs index 0b9320d44..33259b339 100644 --- a/runtimes/testnet/src/weights/timegraph.rs +++ b/runtimes/testnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -33,55 +33,98 @@ use core::marker::PhantomData; /// Weight functions for `pallet_timegraph`. pub struct WeightInfo(PhantomData); impl pallet_timegraph::WeightInfo for WeightInfo { - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `Timegraph::NextDepositSequence` (r:1 w:1) /// Proof: `Timegraph::NextDepositSequence` (`max_values`: None, `max_size`: None, mode: `Measured`) fn deposit() -> Weight { // Proof Size summary in bytes: // Measured: `3` - // Estimated: `3593` - // Minimum execution time: 63_069_000 picoseconds. - Weight::from_parts(89_106_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + // Estimated: `3468` + // Minimum execution time: 35_025_000 picoseconds. + Weight::from_parts(36_949_000, 0) + .saturating_add(Weight::from_parts(0, 3468)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `Timegraph::Threshold` (r:1 w:0) + /// Proof: `Timegraph::Threshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Timegraph::NextWithdrawalSequence` (r:1 w:1) /// Proof: `Timegraph::NextWithdrawalSequence` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn withdraw() -> Weight { // Proof Size summary in bytes: // Measured: `3` - // Estimated: `3593` - // Minimum execution time: 62_978_000 picoseconds. - Weight::from_parts(99_425_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) + // Estimated: `3468` + // Minimum execution time: 35_196_000 picoseconds. + Weight::from_parts(37_731_000, 0) + .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(1)) } - + /// Storage: `Timegraph::TimegraphAccount` (r:1 w:0) + /// Proof: `Timegraph::TimegraphAccount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Timegraph::RewardPoolAccount` (r:1 w:0) + /// Proof: `Timegraph::RewardPoolAccount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn transfer_to_pool() -> Weight { - Weight::default() + // Proof Size summary in bytes: + // Measured: `272` + // Estimated: `6196` + // Minimum execution time: 89_538_000 picoseconds. + Weight::from_parts(95_037_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) } - + /// Storage: `Timegraph::TimegraphAccount` (r:1 w:0) + /// Proof: `Timegraph::TimegraphAccount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Timegraph::RewardPoolAccount` (r:1 w:0) + /// Proof: `Timegraph::RewardPoolAccount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn transfer_award_to_user() -> Weight { - Weight::default() + // Proof Size summary in bytes: + // Measured: `285` + // Estimated: `3593` + // Minimum execution time: 86_432_000 picoseconds. + Weight::from_parts(90_750_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) } - + /// Storage: `Timegraph::TimegraphAccount` (r:1 w:1) + /// Proof: `Timegraph::TimegraphAccount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn set_timegraph_account() -> Weight { - Weight::default() + // Proof Size summary in bytes: + // Measured: `3` + // Estimated: `1488` + // Minimum execution time: 10_049_000 picoseconds. + Weight::from_parts(11_462_000, 0) + .saturating_add(Weight::from_parts(0, 1488)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - + /// Storage: `Timegraph::RewardPoolAccount` (r:1 w:1) + /// Proof: `Timegraph::RewardPoolAccount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn set_reward_pool_account() -> Weight { - Weight::default() + // Proof Size summary in bytes: + // Measured: `3` + // Estimated: `1488` + // Minimum execution time: 9_908_000 picoseconds. + Weight::from_parts(11_230_000, 0) + .saturating_add(Weight::from_parts(0, 1488)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - + /// Storage: `Timegraph::Threshold` (r:1 w:1) + /// Proof: `Timegraph::Threshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn set_threshold() -> Weight { - Weight::default() + // Proof Size summary in bytes: + // Measured: `3` + // Estimated: `1488` + // Minimum execution time: 9_919_000 picoseconds. + Weight::from_parts(12_443_000, 0) + .saturating_add(Weight::from_parts(0, 1488)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - - - } From 36b27049c3bde45b22eb4851039ee637d759200e Mon Sep 17 00:00:00 2001 From: juniuszhou Date: Thu, 10 Oct 2024 09:09:08 +0800 Subject: [PATCH 22/31] merge with development --- pallets/tasks/src/benchmarking.rs | 21 ++++++--- pallets/tasks/src/lib.rs | 26 +++++++++-- pallets/tasks/src/mock.rs | 3 +- pallets/tasks/src/tests.rs | 20 +++++++- runtimes/mainnet/src/lib.rs | 42 +++++++++++++++-- runtimes/mainnet/src/weights/dmail.rs | 12 +++-- runtimes/mainnet/src/weights/elections.rs | 6 +-- runtimes/mainnet/src/weights/members.rs | 14 +++--- runtimes/mainnet/src/weights/networks.rs | 18 ++++---- runtimes/mainnet/src/weights/shards.rs | 16 +++---- runtimes/mainnet/src/weights/tasks.rs | 56 +++++++++++++++-------- runtimes/mainnet/src/weights/timegraph.rs | 22 ++++----- runtimes/testnet/src/lib.rs | 42 +++++++++++++++-- runtimes/testnet/src/weights/dmail.rs | 14 +++--- runtimes/testnet/src/weights/elections.rs | 6 +-- runtimes/testnet/src/weights/members.rs | 14 +++--- runtimes/testnet/src/weights/networks.rs | 10 ++-- runtimes/testnet/src/weights/shards.rs | 18 ++++---- runtimes/testnet/src/weights/tasks.rs | 56 +++++++++++++++-------- runtimes/testnet/src/weights/timegraph.rs | 22 ++++----- 20 files changed, 299 insertions(+), 139 deletions(-) diff --git a/pallets/tasks/src/benchmarking.rs b/pallets/tasks/src/benchmarking.rs index 431f97025..bdf49efe6 100644 --- a/pallets/tasks/src/benchmarking.rs +++ b/pallets/tasks/src/benchmarking.rs @@ -26,14 +26,14 @@ const SIGNATURE: TssSignature = [ fn create_simple_task() { const ETHEREUM: NetworkId = 0; - ::Shards::create_shard( + let (shard_id, _) = ::Shards::create_shard( ETHEREUM, [[0u8; 32].into(), [1u8; 32].into(), [2u8; 32].into()].to_vec(), 1, ); - ShardState::::insert(0, ShardStatus::Online); - ShardCommitment::::insert(0, vec![PUBKEY]); - Pallet::::shard_online(0, ETHEREUM); + ShardState::::insert(shard_id, ShardStatus::Online); + ShardCommitment::::insert(shard_id, vec![PUBKEY]); + Pallet::::shard_online(shard_id, ETHEREUM); Pallet::::create_task(ETHEREUM, Task::ReadGatewayEvents { blocks: 0..10 }); } @@ -43,7 +43,6 @@ benchmarks! { submit_task_result { NetworkGatewayAddress::::insert(0, [0; 32]); create_simple_task::(); - Pallet::::assign_task(0, 0); Pallet::::on_initialize(frame_system::Pallet::::block_number()); let result = TaskResult::ReadGatewayEvents { events: vec![], signature: SIGNATURE }; }: _(RawOrigin::Signed([0u8; 32].into()), 0, result) verify {} @@ -53,8 +52,18 @@ benchmarks! { for i in 0..b { create_simple_task::(); } + Pallet::::prepare_batches(); }: { - Pallet::::on_initialize(frame_system::Pallet::::block_number()); + Pallet::::schedule_tasks(); + } verify { } + + prepare_batches { + let b in 1..::MaxBatchesPerBlock::get(); + for i in 0..b { + create_simple_task::(); + } + }: { + Pallet::::prepare_batches(); } verify { } impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); diff --git a/pallets/tasks/src/lib.rs b/pallets/tasks/src/lib.rs index 20bc9c8aa..a4c4f713b 100644 --- a/pallets/tasks/src/lib.rs +++ b/pallets/tasks/src/lib.rs @@ -76,6 +76,7 @@ pub mod pallet { /// Trait to define the weights for various extrinsics in the pallet. pub trait WeightInfo { fn submit_task_result() -> Weight; + fn prepare_batches(n: u32) -> Weight; fn schedule_tasks(n: u32) -> Weight; } @@ -83,6 +84,9 @@ pub mod pallet { fn submit_task_result() -> Weight { Weight::default() } + fn prepare_batches(_: u32) -> Weight { + Weight::default() + } fn schedule_tasks(_: u32) -> Weight { Weight::default() } @@ -104,7 +108,10 @@ pub mod pallet { type WeightInfo: WeightInfo; type Shards: ShardsInterface; type Networks: NetworksInterface; + /// Maximum number of tasks scheduled per block in `on_initialize` type MaxTasksPerBlock: Get; + /// Maximum number of batches started per block in `on_initialize` + type MaxBatchesPerBlock: Get; } /// Double map storage for unassigned tasks. @@ -283,7 +290,7 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { fn on_initialize(_: BlockNumberFor) -> Weight { - Self::schedule_tasks() + Self::prepare_batches().saturating_add(Self::schedule_tasks()) } } @@ -497,8 +504,7 @@ pub mod pallet { /// tasks_per_shard = min(tasks_per_shard, max_assignable_tasks) /// for registered_shard in network: /// number_of_tasks_to_assign = min(tasks_per_shard, shard_capacity(registered_shard)) - fn schedule_tasks() -> Weight { - Self::prepare_batches(); + pub(crate) fn schedule_tasks() -> Weight { let mut num_tasks_assigned: u32 = 0u32; for (network, task_id) in ReadEventsTask::::iter() { let max_assignable_tasks = T::Networks::shard_task_limit(network); @@ -556,20 +562,32 @@ pub mod pallet { ::WeightInfo::schedule_tasks(num_tasks_assigned) } - fn prepare_batches() { + pub(crate) fn prepare_batches() -> Weight { + let mut num_batches_started = 0u32; for (network, _) in ReadEventsTask::::iter() { let batch_gas_limit = T::Networks::batch_gas_limit(network); let mut batcher = BatchBuilder::new(batch_gas_limit); let queue = Self::ops_queue(network); while let Some(op) = queue.pop() { if let Some(msg) = batcher.push(op) { + if num_batches_started == T::MaxBatchesPerBlock::get() { + return ::WeightInfo::prepare_batches( + T::MaxBatchesPerBlock::get(), + ); + } Self::start_batch(network, msg); + num_batches_started = num_batches_started.saturating_plus_one(); } } + if num_batches_started == T::MaxBatchesPerBlock::get() { + return ::WeightInfo::prepare_batches(T::MaxBatchesPerBlock::get()); + } if let Some(msg) = batcher.take_batch() { Self::start_batch(network, msg); + num_batches_started = num_batches_started.saturating_plus_one(); } } + ::WeightInfo::prepare_batches(num_batches_started) } fn start_batch(network: NetworkId, msg: GatewayMessage) { diff --git a/pallets/tasks/src/mock.rs b/pallets/tasks/src/mock.rs index 8018bfb63..790e147f0 100644 --- a/pallets/tasks/src/mock.rs +++ b/pallets/tasks/src/mock.rs @@ -41,7 +41,7 @@ impl NetworksInterface for MockNetworks { 5 } fn batch_gas_limit(_network: NetworkId) -> u128 { - 10_000 + 10 } fn shard_task_limit(_network: NetworkId) -> u32 { 10 @@ -261,6 +261,7 @@ impl pallet_tasks::Config for Test { type Shards = Shards; type Networks = MockNetworks; type MaxTasksPerBlock = ConstU32<3>; + type MaxBatchesPerBlock = ConstU32<4>; } impl frame_system::offchain::CreateSignedTransaction for Test diff --git a/pallets/tasks/src/tests.rs b/pallets/tasks/src/tests.rs index 9ccc597fa..11b2f76b7 100644 --- a/pallets/tasks/src/tests.rs +++ b/pallets/tasks/src/tests.rs @@ -1,5 +1,5 @@ use crate::mock::*; -use crate::ShardRegistered; +use crate::{BatchIdCounter, ShardRegistered}; use frame_support::assert_ok; use frame_system::RawOrigin; @@ -257,6 +257,24 @@ fn test_max_tasks_per_block() { }) } +#[test] +fn test_max_batches_per_block() { + new_test_ext().execute_with(|| { + register_gateway(ETHEREUM, 42); + for _ in 0..10 { + let shard = create_shard(ETHEREUM, 3, 1); + register_shard(shard); + assert!(Tasks::is_shard_registered(shard)); + } + roll(1); + // Max 4 batches per block + assert_eq!(BatchIdCounter::::get(), 4); + // Max 4 batches per block + roll(1); + assert_eq!(BatchIdCounter::::get(), 8); + }) +} + mod bench_helper { use super::*; diff --git a/runtimes/mainnet/src/lib.rs b/runtimes/mainnet/src/lib.rs index 7f6dddb3b..a2041a696 100644 --- a/runtimes/mainnet/src/lib.rs +++ b/runtimes/mainnet/src/lib.rs @@ -1298,7 +1298,8 @@ impl pallet_tasks::Config for Runtime { type WeightInfo = weights::tasks::WeightInfo; type Networks = Networks; type Shards = Shards; - type MaxTasksPerBlock = ConstU32<10_000>; + type MaxTasksPerBlock = ConstU32<1_500>; + type MaxBatchesPerBlock = ConstU32<1_000>; } parameter_types! { @@ -1979,6 +1980,7 @@ mod tests { use super::*; use frame_election_provider_support::NposSolution; use frame_system::offchain::CreateSignedTransaction; + use pallet_tasks::WeightInfo; use sp_runtime::UpperOf; #[test] @@ -2017,8 +2019,9 @@ mod tests { #[test] fn max_tasks_per_block() { - use pallet_tasks::WeightInfo; - let avg_on_initialize: Weight = AVERAGE_ON_INITIALIZE_RATIO * MAXIMUM_BLOCK_WEIGHT; + // 50% of max on_initialize space for task scheduling conservatively + let avg_on_initialize: Weight = + Perbill::from_percent(50) * (AVERAGE_ON_INITIALIZE_RATIO * MAXIMUM_BLOCK_WEIGHT); assert!( ::WeightInfo::schedule_tasks(1) .all_lte(avg_on_initialize), @@ -2046,4 +2049,37 @@ mod tests { "MaxTasksPerBlock {max_tasks_per_block_configured} > max number of tasks per block tested = {num_tasks}" ); } + + #[test] + fn max_batches_per_block() { + // 50% of max on_initialize space for starting batches conservatively + let avg_on_initialize: Weight = + Perbill::from_percent(50) * (AVERAGE_ON_INITIALIZE_RATIO * MAXIMUM_BLOCK_WEIGHT); + assert!( + ::WeightInfo::prepare_batches(1) + .all_lte(avg_on_initialize), + "BUG: Starting a single batch consumes more weight than available in on-initialize" + ); + assert!( + ::WeightInfo::prepare_batches(1) + .all_lte(::WeightInfo::prepare_batches(2)), + "BUG: Starting 1 batch consumes more weight than starting 2" + ); + let mut num_batches: u32 = 2; + while ::WeightInfo::prepare_batches(num_batches) + .all_lt(avg_on_initialize) + { + num_batches += 1; + if num_batches == 10_000_000 { + // 10_000_000 batches started; halting to break out of loop + break; + } + } + let max_batches_per_block_configured: u32 = + ::MaxBatchesPerBlock::get(); + assert!( + max_batches_per_block_configured <= num_batches, + "MaxTasksPerBlock {max_batches_per_block_configured} > max number of batches per block tested = {num_batches}" + ); + } } diff --git a/runtimes/mainnet/src/weights/dmail.rs b/runtimes/mainnet/src/weights/dmail.rs index 1df3b5ee5..2ae3bf2c0 100644 --- a/runtimes/mainnet/src/weights/dmail.rs +++ b/runtimes/mainnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -37,12 +37,16 @@ impl pallet_dmail::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 1000]`. /// The range of component `a` is `[1, 1000]`. /// The range of component `b` is `[1, 1000]`. - fn send_email(_a: u32, _b: u32, ) -> Weight { + fn send_email(a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_096_000 picoseconds. - Weight::from_parts(11_257_439, 0) + // Minimum execution time: 8_194_000 picoseconds. + Weight::from_parts(6_902_453, 0) .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 89 + .saturating_add(Weight::from_parts(2_112, 0).saturating_mul(a.into())) + // Standard Error: 89 + .saturating_add(Weight::from_parts(1_764, 0).saturating_mul(b.into())) } } diff --git a/runtimes/mainnet/src/weights/elections.rs b/runtimes/mainnet/src/weights/elections.rs index 1ccc16406..7dcea34dd 100644 --- a/runtimes/mainnet/src/weights/elections.rs +++ b/runtimes/mainnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 18_154_000 picoseconds. - Weight::from_parts(22_141_000, 0) + // Minimum execution time: 12_043_000 picoseconds. + Weight::from_parts(15_699_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/mainnet/src/weights/members.rs b/runtimes/mainnet/src/weights/members.rs index d1a0a77c2..4a8174dea 100644 --- a/runtimes/mainnet/src/weights/members.rs +++ b/runtimes/mainnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 62_668_000 picoseconds. - Weight::from_parts(65_613_000, 0) + // Minimum execution time: 62_598_000 picoseconds. + Weight::from_parts(71_073_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 21_912_000 picoseconds. - Weight::from_parts(23_073_000, 0) + // Minimum execution time: 22_793_000 picoseconds. + Weight::from_parts(25_318_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 57_096_000 picoseconds. - Weight::from_parts(59_091_000, 0) + // Minimum execution time: 58_098_000 picoseconds. + Weight::from_parts(62_848_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/mainnet/src/weights/networks.rs b/runtimes/mainnet/src/weights/networks.rs index e7de2a4fe..e032398b7 100644 --- a/runtimes/mainnet/src/weights/networks.rs +++ b/runtimes/mainnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -63,15 +63,17 @@ impl pallet_networks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 1000]`. /// The range of component `a` is `[1, 1000]`. /// The range of component `b` is `[1, 1000]`. - fn register_network(a: u32, _b: u32, ) -> Weight { + fn register_network(a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 54_472_000 picoseconds. - Weight::from_parts(60_721_590, 0) + // Minimum execution time: 59_722_000 picoseconds. + Weight::from_parts(53_225_243, 0) .saturating_add(Weight::from_parts(0, 3583)) - // Standard Error: 878 - .saturating_add(Weight::from_parts(9_384, 0).saturating_mul(a.into())) + // Standard Error: 951 + .saturating_add(Weight::from_parts(14_180, 0).saturating_mul(a.into())) + // Standard Error: 951 + .saturating_add(Weight::from_parts(8_256, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -89,8 +91,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 21_078_000 picoseconds. - Weight::from_parts(22_713_000, 0) + // Minimum execution time: 22_993_000 picoseconds. + Weight::from_parts(33_282_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/mainnet/src/weights/shards.rs b/runtimes/mainnet/src/weights/shards.rs index 4fd24a56b..f25de6c64 100644 --- a/runtimes/mainnet/src/weights/shards.rs +++ b/runtimes/mainnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 515_665_000 picoseconds. - Weight::from_parts(537_095_000, 0) + // Minimum execution time: 514_212_000 picoseconds. + Weight::from_parts(526_125_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 61_144_000 picoseconds. - Weight::from_parts(64_941_000, 0) + // Minimum execution time: 59_812_000 picoseconds. + Weight::from_parts(63_157_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 71_514_000 picoseconds. - Weight::from_parts(76_032_000, 0) + // Minimum execution time: 71_615_000 picoseconds. + Weight::from_parts(75_992_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,7 +111,7 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_577_000 picoseconds. + // Minimum execution time: 3_507_000 picoseconds. Weight::from_parts(3_807_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) diff --git a/runtimes/mainnet/src/weights/tasks.rs b/runtimes/mainnet/src/weights/tasks.rs index 4ddb34d3d..9e31a0022 100644 --- a/runtimes/mainnet/src/weights/tasks.rs +++ b/runtimes/mainnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -69,31 +69,25 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 654_895_000 picoseconds. - Weight::from_parts(695_300_000, 0) + // Minimum execution time: 624_318_000 picoseconds. + Weight::from_parts(698_456_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) } /// Storage: `Tasks::ReadEventsTask` (r:2 w:0) /// Proof: `Tasks::ReadEventsTask` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Networks::NetworkBatchGasLimit` (r:1 w:0) - /// Proof: `Networks::NetworkBatchGasLimit` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tasks::OpsRemoveIndex` (r:1 w:0) - /// Proof: `Tasks::OpsRemoveIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tasks::OpsInsertIndex` (r:1 w:0) - /// Proof: `Tasks::OpsInsertIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Networks::NetworkShardTaskLimit` (r:1 w:0) /// Proof: `Networks::NetworkShardTaskLimit` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::TaskShard` (r:1 w:1) /// Proof: `Tasks::TaskShard` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tasks::NetworkShards` (r:2 w:0) + /// Storage: `Tasks::NetworkShards` (r:10001 w:0) /// Proof: `Tasks::NetworkShards` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTaskCount` (r:1 w:1) /// Proof: `Tasks::ShardTaskCount` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::Tasks` (r:1 w:0) /// Proof: `Tasks::Tasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Shards::ShardCommitment` (r:1 w:0) + /// Storage: `Shards::ShardCommitment` (r:10000 w:0) /// Proof: `Shards::ShardCommitment` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardRegistered` (r:1 w:0) /// Proof: `Tasks::ShardRegistered` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -103,14 +97,38 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 10000]`. fn schedule_tasks(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3665` - // Estimated: `9197` - // Minimum execution time: 78_306_000 picoseconds. - Weight::from_parts(138_792_154, 0) - .saturating_add(Weight::from_parts(0, 9197)) - // Standard Error: 91 - .saturating_add(Weight::from_parts(7_492, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(13)) + // Measured: `4412 + b * (91 ±0)` + // Estimated: `10028 + b * (2566 ±0)` + // Minimum execution time: 59_763_000 picoseconds. + Weight::from_parts(63_449_000, 0) + .saturating_add(Weight::from_parts(0, 10028)) + // Standard Error: 10_361 + .saturating_add(Weight::from_parts(11_731_446, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 2566).saturating_mul(b.into())) + } + /// Storage: `Tasks::ReadEventsTask` (r:2 w:0) + /// Proof: `Tasks::ReadEventsTask` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Networks::NetworkBatchGasLimit` (r:1 w:0) + /// Proof: `Networks::NetworkBatchGasLimit` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tasks::OpsRemoveIndex` (r:1 w:0) + /// Proof: `Tasks::OpsRemoveIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tasks::OpsInsertIndex` (r:1 w:0) + /// Proof: `Tasks::OpsInsertIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `b` is `[1, 1000]`. + /// The range of component `b` is `[1, 1000]`. + fn prepare_batches(b: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `958` + // Estimated: `6794 + b * (1 ±0)` + // Minimum execution time: 25_137_000 picoseconds. + Weight::from_parts(43_753_099, 0) + .saturating_add(Weight::from_parts(0, 6794)) + // Standard Error: 345 + .saturating_add(Weight::from_parts(14_169, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } } diff --git a/runtimes/mainnet/src/weights/timegraph.rs b/runtimes/mainnet/src/weights/timegraph.rs index c1bc89d71..387788342 100644 --- a/runtimes/mainnet/src/weights/timegraph.rs +++ b/runtimes/mainnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -38,12 +38,12 @@ impl pallet_timegraph::WeightInfo for WeightInfo { fn deposit() -> Weight { // Proof Size summary in bytes: // Measured: `3` - // Estimated: `3468` - // Minimum execution time: 31_509_000 picoseconds. - Weight::from_parts(32_821_000, 0) - .saturating_add(Weight::from_parts(0, 3468)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Estimated: `3593` + // Minimum execution time: 62_948_000 picoseconds. + Weight::from_parts(91_992_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `Timegraph::Threshold` (r:1 w:0) /// Proof: `Timegraph::Threshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -52,10 +52,10 @@ impl pallet_timegraph::WeightInfo for WeightInfo { fn withdraw() -> Weight { // Proof Size summary in bytes: // Measured: `3` - // Estimated: `3468` - // Minimum execution time: 31_919_000 picoseconds. - Weight::from_parts(33_333_000, 0) - .saturating_add(Weight::from_parts(0, 3468)) + // Estimated: `3593` + // Minimum execution time: 62_627_000 picoseconds. + Weight::from_parts(68_719_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtimes/testnet/src/lib.rs b/runtimes/testnet/src/lib.rs index 21aee86c5..db744d1b1 100644 --- a/runtimes/testnet/src/lib.rs +++ b/runtimes/testnet/src/lib.rs @@ -1005,7 +1005,8 @@ impl pallet_tasks::Config for Runtime { type WeightInfo = weights::tasks::WeightInfo; type Networks = Networks; type Shards = Shards; - type MaxTasksPerBlock = ConstU32<10_000>; + type MaxTasksPerBlock = ConstU32<1_500>; + type MaxBatchesPerBlock = ConstU32<1_000>; } parameter_types! { @@ -1612,6 +1613,7 @@ impl_runtime_apis! { mod multiplier_tests { use super::*; use frame_support::{dispatch::DispatchInfo, traits::OnFinalize}; + use pallet_tasks::WeightInfo; use separator::Separatable; use sp_runtime::traits::Convert; @@ -1693,8 +1695,9 @@ mod multiplier_tests { #[test] fn max_tasks_per_block() { - use pallet_tasks::WeightInfo; - let avg_on_initialize: Weight = AVERAGE_ON_INITIALIZE_RATIO * MAXIMUM_BLOCK_WEIGHT; + // 50% of max on_initialize space for task scheduling conservatively + let avg_on_initialize: Weight = + Perbill::from_percent(50) * (AVERAGE_ON_INITIALIZE_RATIO * MAXIMUM_BLOCK_WEIGHT); assert!( ::WeightInfo::schedule_tasks(1) .all_lte(avg_on_initialize), @@ -1722,4 +1725,37 @@ mod multiplier_tests { "MaxTasksPerBlock {max_tasks_per_block_configured} > max number of tasks per block tested = {num_tasks}" ); } + + #[test] + fn max_batches_per_block() { + // 50% of max on_initialize space for starting batches conservatively + let avg_on_initialize: Weight = + Perbill::from_percent(50) * (AVERAGE_ON_INITIALIZE_RATIO * MAXIMUM_BLOCK_WEIGHT); + assert!( + ::WeightInfo::prepare_batches(1) + .all_lte(avg_on_initialize), + "BUG: Starting a single batch consumes more weight than available in on-initialize" + ); + assert!( + ::WeightInfo::prepare_batches(1) + .all_lte(::WeightInfo::prepare_batches(2)), + "BUG: Starting 1 batch consumes more weight than starting 2" + ); + let mut num_batches: u32 = 2; + while ::WeightInfo::prepare_batches(num_batches) + .all_lt(avg_on_initialize) + { + num_batches += 1; + if num_batches == 10_000_000 { + // 10_000_000 batches started; halting to break out of loop + break; + } + } + let max_batches_per_block_configured: u32 = + ::MaxBatchesPerBlock::get(); + assert!( + max_batches_per_block_configured <= num_batches, + "MaxTasksPerBlock {max_batches_per_block_configured} > max number of batches per block tested = {num_batches}" + ); + } } diff --git a/runtimes/testnet/src/weights/dmail.rs b/runtimes/testnet/src/weights/dmail.rs index 3522110f9..007f1c91f 100644 --- a/runtimes/testnet/src/weights/dmail.rs +++ b/runtimes/testnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,12 +41,12 @@ impl pallet_dmail::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_985_000 picoseconds. - Weight::from_parts(8_063_180, 0) + // Minimum execution time: 8_006_000 picoseconds. + Weight::from_parts(7_871_314, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 58 - .saturating_add(Weight::from_parts(1_319, 0).saturating_mul(a.into())) - // Standard Error: 58 - .saturating_add(Weight::from_parts(453, 0).saturating_mul(b.into())) + // Standard Error: 74 + .saturating_add(Weight::from_parts(941, 0).saturating_mul(a.into())) + // Standard Error: 74 + .saturating_add(Weight::from_parts(1_044, 0).saturating_mul(b.into())) } } diff --git a/runtimes/testnet/src/weights/elections.rs b/runtimes/testnet/src/weights/elections.rs index 7fc9a6ea4..ddfd2dd3e 100644 --- a/runtimes/testnet/src/weights/elections.rs +++ b/runtimes/testnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_774_000 picoseconds. - Weight::from_parts(14_327_000, 0) + // Minimum execution time: 11_972_000 picoseconds. + Weight::from_parts(14_357_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/testnet/src/weights/members.rs b/runtimes/testnet/src/weights/members.rs index 7aea4c18d..d84085ead 100644 --- a/runtimes/testnet/src/weights/members.rs +++ b/runtimes/testnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 63_319_000 picoseconds. - Weight::from_parts(98_364_000, 0) + // Minimum execution time: 61_496_000 picoseconds. + Weight::from_parts(64_841_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 22_081_000 picoseconds. - Weight::from_parts(25_748_000, 0) + // Minimum execution time: 22_101_000 picoseconds. + Weight::from_parts(23_594_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 57_928_000 picoseconds. - Weight::from_parts(63_690_000, 0) + // Minimum execution time: 57_117_000 picoseconds. + Weight::from_parts(60_143_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/testnet/src/weights/networks.rs b/runtimes/testnet/src/weights/networks.rs index 147755bba..756a5edb0 100644 --- a/runtimes/testnet/src/weights/networks.rs +++ b/runtimes/testnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -67,8 +67,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 54_702_000 picoseconds. - Weight::from_parts(68_118_259, 0) + // Minimum execution time: 55_634_000 picoseconds. + Weight::from_parts(96_580_843, 0) .saturating_add(Weight::from_parts(0, 3583)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) @@ -87,8 +87,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 21_580_000 picoseconds. - Weight::from_parts(23_114_000, 0) + // Minimum execution time: 21_421_000 picoseconds. + Weight::from_parts(27_320_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/testnet/src/weights/shards.rs b/runtimes/testnet/src/weights/shards.rs index 9e773dfde..4e513a617 100644 --- a/runtimes/testnet/src/weights/shards.rs +++ b/runtimes/testnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 515_534_000 picoseconds. - Weight::from_parts(518_259_000, 0) + // Minimum execution time: 511_876_000 picoseconds. + Weight::from_parts(533_108_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 60_263_000 picoseconds. - Weight::from_parts(62_045_000, 0) + // Minimum execution time: 58_870_000 picoseconds. + Weight::from_parts(61_526_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 74_169_000 picoseconds. - Weight::from_parts(76_524_000, 0) + // Minimum execution time: 71_064_000 picoseconds. + Weight::from_parts(73_317_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_527_000 picoseconds. - Weight::from_parts(3_797_000, 0) + // Minimum execution time: 3_536_000 picoseconds. + Weight::from_parts(3_796_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/testnet/src/weights/tasks.rs b/runtimes/testnet/src/weights/tasks.rs index 301aac4b3..1acdb99ff 100644 --- a/runtimes/testnet/src/weights/tasks.rs +++ b/runtimes/testnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -69,31 +69,25 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 631_722_000 picoseconds. - Weight::from_parts(643_855_000, 0) + // Minimum execution time: 632_823_000 picoseconds. + Weight::from_parts(686_694_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) } /// Storage: `Tasks::ReadEventsTask` (r:2 w:0) /// Proof: `Tasks::ReadEventsTask` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Networks::NetworkBatchGasLimit` (r:1 w:0) - /// Proof: `Networks::NetworkBatchGasLimit` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tasks::OpsRemoveIndex` (r:1 w:0) - /// Proof: `Tasks::OpsRemoveIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tasks::OpsInsertIndex` (r:1 w:0) - /// Proof: `Tasks::OpsInsertIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Networks::NetworkShardTaskLimit` (r:1 w:0) /// Proof: `Networks::NetworkShardTaskLimit` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::TaskShard` (r:1 w:1) /// Proof: `Tasks::TaskShard` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tasks::NetworkShards` (r:2 w:0) + /// Storage: `Tasks::NetworkShards` (r:10001 w:0) /// Proof: `Tasks::NetworkShards` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTaskCount` (r:1 w:1) /// Proof: `Tasks::ShardTaskCount` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::Tasks` (r:1 w:0) /// Proof: `Tasks::Tasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Shards::ShardCommitment` (r:1 w:0) + /// Storage: `Shards::ShardCommitment` (r:10000 w:0) /// Proof: `Shards::ShardCommitment` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardRegistered` (r:1 w:0) /// Proof: `Tasks::ShardRegistered` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -103,14 +97,38 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 10000]`. fn schedule_tasks(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3665` - // Estimated: `9197` - // Minimum execution time: 75_792_000 picoseconds. - Weight::from_parts(133_102_321, 0) - .saturating_add(Weight::from_parts(0, 9197)) - // Standard Error: 99 - .saturating_add(Weight::from_parts(8_363, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(13)) + // Measured: `4412 + b * (91 ±0)` + // Estimated: `10028 + b * (2566 ±0)` + // Minimum execution time: 60_142_000 picoseconds. + Weight::from_parts(62_126_000, 0) + .saturating_add(Weight::from_parts(0, 10028)) + // Standard Error: 10_840 + .saturating_add(Weight::from_parts(11_935_194, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 2566).saturating_mul(b.into())) + } + /// Storage: `Tasks::ReadEventsTask` (r:2 w:0) + /// Proof: `Tasks::ReadEventsTask` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Networks::NetworkBatchGasLimit` (r:1 w:0) + /// Proof: `Networks::NetworkBatchGasLimit` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tasks::OpsRemoveIndex` (r:1 w:0) + /// Proof: `Tasks::OpsRemoveIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tasks::OpsInsertIndex` (r:1 w:0) + /// Proof: `Tasks::OpsInsertIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `b` is `[1, 1000]`. + /// The range of component `b` is `[1, 1000]`. + fn prepare_batches(b: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `958` + // Estimated: `6794 + b * (1 ±0)` + // Minimum execution time: 25_127_000 picoseconds. + Weight::from_parts(46_252_164, 0) + .saturating_add(Weight::from_parts(0, 6794)) + // Standard Error: 461 + .saturating_add(Weight::from_parts(13_225, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } } diff --git a/runtimes/testnet/src/weights/timegraph.rs b/runtimes/testnet/src/weights/timegraph.rs index 33259b339..a96b697de 100644 --- a/runtimes/testnet/src/weights/timegraph.rs +++ b/runtimes/testnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -38,12 +38,12 @@ impl pallet_timegraph::WeightInfo for WeightInfo { fn deposit() -> Weight { // Proof Size summary in bytes: // Measured: `3` - // Estimated: `3468` - // Minimum execution time: 35_025_000 picoseconds. - Weight::from_parts(36_949_000, 0) - .saturating_add(Weight::from_parts(0, 3468)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Estimated: `3593` + // Minimum execution time: 62_337_000 picoseconds. + Weight::from_parts(66_425_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `Timegraph::Threshold` (r:1 w:0) /// Proof: `Timegraph::Threshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -52,10 +52,10 @@ impl pallet_timegraph::WeightInfo for WeightInfo { fn withdraw() -> Weight { // Proof Size summary in bytes: // Measured: `3` - // Estimated: `3468` - // Minimum execution time: 35_196_000 picoseconds. - Weight::from_parts(37_731_000, 0) - .saturating_add(Weight::from_parts(0, 3468)) + // Estimated: `3593` + // Minimum execution time: 63_148_000 picoseconds. + Weight::from_parts(71_112_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } From ae60c0257c1b0536482304a3158ccefb3b04c255 Mon Sep 17 00:00:00 2001 From: taniasaleem123 <97734319+taniasaleem123@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:47:17 +0500 Subject: [PATCH 23/31] Mainnet Tokenomics parameters update (#1057) Co-authored-by: TaniaSaleem <47881225+TaniaSaleem@users.noreply.github.com> Co-authored-by: Tania Saleem Co-authored-by: Florian Franzen --- Cargo.lock | 1 + runtimes/common/Cargo.toml | 2 + runtimes/common/src/lib.rs | 89 ++++++++++++++++- runtimes/mainnet/src/lib.rs | 186 ++++++++++++++++++++++++++++-------- runtimes/testnet/Cargo.toml | 1 + runtimes/testnet/src/lib.rs | 15 ++- 6 files changed, 243 insertions(+), 51 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2a5d8799c..a4dc1f2da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13997,6 +13997,7 @@ name = "runtime-common" version = "1.0.0" dependencies = [ "polkadot-sdk", + "smallvec", "time-primitives", ] diff --git a/runtimes/common/Cargo.toml b/runtimes/common/Cargo.toml index a4ba304f8..48f857507 100644 --- a/runtimes/common/Cargo.toml +++ b/runtimes/common/Cargo.toml @@ -10,10 +10,12 @@ repository.workspace = true [dependencies] time-primitives.workspace = true +smallvec = "1.8.0" polkadot-sdk = { workspace = true, features = [ "frame-system", "frame-metadata-hash-extension", + "frame-support", "pallet-balances", "pallet-timestamp", "pallet-staking", diff --git a/runtimes/common/src/lib.rs b/runtimes/common/src/lib.rs index 986f575f2..e3d521584 100644 --- a/runtimes/common/src/lib.rs +++ b/runtimes/common/src/lib.rs @@ -20,6 +20,12 @@ pub use sp_runtime::BuildStorage; /// Weight matters. pub mod weights; +use frame_support::weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight}; + +/// We allow for 2 seconds of compute with a 6 second average block time, with maximum proof size. +pub const MAXIMUM_BLOCK_WEIGHT: Weight = + Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), u64::MAX); + /// Money matters. pub mod currency { pub use time_primitives::currency::*; @@ -27,7 +33,7 @@ pub mod currency { pub const TOTAL_ISSUANCE: Balance = 90_570_710 * ANLOG; pub const TRANSACTION_BYTE_FEE: Balance = MICROANLOG; - pub const STORAGE_BYTE_FEE: Balance = 300 * MILLIANLOG; + pub const STORAGE_BYTE_FEE: Balance = 300 * MILLIANLOG; // Change based on benchmarking pub const fn deposit(items: u32, bytes: u32) -> Balance { items as Balance * 750 * MILLIANLOG + (bytes as Balance) * STORAGE_BYTE_FEE @@ -56,6 +62,58 @@ pub mod time { pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4); } +/// Fee-Calculation. +pub mod fee { + use super::frame_support; + use crate::weights::ExtrinsicBaseWeight; + use frame_support::weights::{ + WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, + }; + + use crate::currency::*; + pub use crate::sp_runtime::Perbill; + use smallvec::smallvec; + + /// Handles converting a weight scalar to a fee value, based on the scale and granularity of the + /// node's balance type. + /// + /// This should typically create a mapping between the following ranges: + /// - [0, `frame_system::MaximumBlockWeight`] + /// - [Balance::min, Balance::max] + /// + /// Yet, it can be used for any other sort of change to weight-fee. Some examples being: + /// - Setting it to `0` will essentially disable the weight fee. + /// - Setting it to `1` will cause the literal `#[weight = x]` values to be charged. + pub struct WeightToFee; + /// By introducing a second-degree term, the fee will grow faster as the weight increases. + /// This can be useful for discouraging transactions that consume excessive resources. + /// While a first-degree polynomial gives a linear fee increase, adding a quadratic term + /// will make fees grow non-linearly, meaning larger weights result in disproportionately larger fees. + /// This change can help manage network congestion by making resource-heavy operations more expensive. + impl WeightToFeePolynomial for WeightToFee { + type Balance = Balance; + fn polynomial() -> WeightToFeeCoefficients { + // in Timechain, extrinsic base weight (smallest non-zero weight) is mapped to MILLIANLOG: + let p = super::currency::MILLIANLOG; + let q = Balance::from(ExtrinsicBaseWeight::get().ref_time()); + smallvec![ + WeightToFeeCoefficient { + degree: 2, + negative: false, + coeff_frac: Perbill::from_rational((TOCK / MILLIANLOG) % q, q), + coeff_integer: (TOCK / MILLIANLOG) / q, + }, + WeightToFeeCoefficient { + degree: 1, + negative: false, + coeff_frac: Perbill::from_rational(p % q, q), + coeff_integer: p / q, + } + ] + } + } +} + /// Shared signing extensions pub type SignedExtra = ( frame_system::CheckNonZeroSender, @@ -108,3 +166,32 @@ macro_rules! prod_or_dev { } }; } + +#[cfg(test)] +mod tests { + use super::{ + currency::*, fee::WeightToFee, frame_support::weights::WeightToFee as WeightToFeeT, + MAXIMUM_BLOCK_WEIGHT, + }; + use crate::weights::ExtrinsicBaseWeight; + + #[test] + // Test that the fee for `MAXIMUM_BLOCK_WEIGHT` of weight has sane bounds. + fn full_block_fee_is_correct() { + // A full block should cost between 5,000 and 10,000 MILLIANLOG. + let full_block = WeightToFee::weight_to_fee(&MAXIMUM_BLOCK_WEIGHT); + println!("FULL BLOCK Fee: {}", full_block); + assert!(full_block >= 5_000 * MILLIANLOG); + assert!(full_block <= 10_000 * MILLIANLOG); + } + + #[test] + // This function tests that the fee for `ExtrinsicBaseWeight` of weight is correct + fn extrinsic_base_fee_is_correct() { + // `ExtrinsicBaseWeight` should cost MICROANLOG + println!("Base: {}", ExtrinsicBaseWeight::get()); + let x = WeightToFee::weight_to_fee(&ExtrinsicBaseWeight::get()); + let y = MILLIANLOG; + assert!(x.max(y) - x.min(y) < MICROANLOG); + } +} diff --git a/runtimes/mainnet/src/lib.rs b/runtimes/mainnet/src/lib.rs index a2041a696..2db8e9146 100644 --- a/runtimes/mainnet/src/lib.rs +++ b/runtimes/mainnet/src/lib.rs @@ -38,10 +38,8 @@ use frame_support::{ OnUnbalanced, WithdrawReasons, }, weights::{ - constants::{ - BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND, - }, - ConstantMultiplier, IdentityFee, Weight, + constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}, + ConstantMultiplier, Weight, }, PalletId, }; @@ -91,8 +89,10 @@ pub use time_primitives::{ TaskResult, TssPublicKey, TssSignature, ANLOG, }; +/// weightToFee implementation +use runtime_common::fee::WeightToFee; /// Constant values used within the runtime. -use runtime_common::{currency::*, time::*, BABE_GENESIS_EPOCH_CONFIG}; +use runtime_common::{currency::*, time::*, BABE_GENESIS_EPOCH_CONFIG, MAXIMUM_BLOCK_WEIGHT}; use sp_runtime::generic::Era; /// Benchmarked pallet weights @@ -174,7 +174,7 @@ impl OnUnbalanced for DealWithFees { } } -pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 10 * MINUTES; +pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 2 * HOURS; pub const EPOCH_DURATION_IN_SLOTS: u64 = { const SLOT_FILL_RATE: f64 = MILLISECS_PER_BLOCK as f64 / SLOT_DURATION as f64; @@ -183,13 +183,10 @@ pub const EPOCH_DURATION_IN_SLOTS: u64 = { /// We assume that ~10% of the block weight is consumed by `on_initialize` handlers. /// This is used to limit the maximal weight of a single extrinsic. -const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); +const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(5); /// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used /// by Operational extrinsics. const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); -/// We allow for 2 seconds of compute with a 6 second average block time, with maximum proof size. -const MAXIMUM_BLOCK_WEIGHT: Weight = - Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), u64::MAX); parameter_types! { pub const BlockHashCount: BlockNumber = 2400; @@ -228,10 +225,24 @@ impl Contains for SafeModeWhitelistedCalls { } parameter_types! { - pub const EnterDuration: BlockNumber = 4 * HOURS; - pub const EnterDepositAmount: Balance = 2_000_000 * ANLOG; - pub const ExtendDuration: BlockNumber = 2 * HOURS; - pub const ExtendDepositAmount: Balance = 1_000_000 * ANLOG; + /// This represents duration of the networks safe mode. + /// Safe mode is typically activated in response to potential threats or instabilities + /// to restrict certain network operations. + pub const EnterDuration: BlockNumber = 1 * DAYS; + /// The deposit amount required to initiate the safe mode entry process. + /// This ensures that only participants with a significant economic stake (2,000,000 ANLOG tokens) + /// can trigger safe mode, preventing frivolous or malicious activations. + pub const EnterDepositAmount: Balance = 5_000_000 * ANLOG; // ~5.5% of overall supply + /// The safe mode duration (in blocks) can be to extended. + /// This represents an additional 2 hours before an extension can be applied, + /// ensuring that any continuation of safe mode is deliberate and considered. + pub const ExtendDuration: BlockNumber = 12 * HOURS; + /// This ensures that participants must provide a moderate economic stake (1,000,000 ANLOG tokens) + /// to request an extension of safe mode, making it a costly action to prolong the restricted state. + pub const ExtendDepositAmount: Balance = 2_000_000 * ANLOG; + /// The minimal duration a deposit will remain reserved after safe-mode is entered or extended, + /// unless ['Pallet::force_release_deposit'] is successfully called sooner, acts as a security buffer + /// to ensure stability and allow for safe recovery from critical events pub const ReleaseDelay: u32 = 2 * DAYS; } @@ -279,7 +290,8 @@ impl pallet_utility::Config for Runtime { } parameter_types! { - // One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes. + /// Base deposit required for storing a multisig execution, covering the cost of a single storage item. + // One storage item; key size is 32; value is size 4+4(block number)+16(balance)+32(account ID) bytes = 56 bytes. pub const DepositBase: Balance = deposit(1, 88); // Additional storage item size of 32 bytes. pub const DepositFactor: Balance = deposit(0, 32); @@ -299,9 +311,10 @@ parameter_types! { // One storage item; key size 32, value size 8; . pub const ProxyDepositBase: Balance = deposit(1, 8); // Additional storage item size of 33 bytes. + // 32 + proxy_type.encode().len() bytes of data. pub const ProxyDepositFactor: Balance = deposit(0, 33); - pub const AnnouncementDepositBase: Balance = deposit(1, 8); - pub const AnnouncementDepositFactor: Balance = deposit(0, 66); + pub const AnnouncementDepositBase: Balance = deposit(1, 16); + pub const AnnouncementDepositFactor: Balance = deposit(0, 68); } /// The type used to represent the kinds of proxying allowed. @@ -376,10 +389,20 @@ impl pallet_proxy::Config for Runtime { } parameter_types! { - // NOTE: Currently it is not possible to change the epoch duration after the chain has started. - // Attempting to do so will brick block production. + /// An epoch is a unit of time used for key operations in the consensus mechanism, such as validator + /// rotations and randomness generation. Once set at genesis, this value cannot be changed without + /// breaking block production. + /// + /// Note: Do not attempt to modify after chain launch, as it will cause serious issues with block production. pub const EpochDuration: u64 = EPOCH_DURATION_IN_SLOTS; + /// This defines the interval at which new blocks are produced in the blockchain. It impacts + /// the speed of transaction processing and finality, as well as the load on the network + /// and validators. The value is defined in milliseconds. pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; + /// This defines how long a misbehavior reports in the staking or consensus system + /// remains valid before it expires. It is based on the bonding + /// duration, sessions per era, and the epoch duration. The longer the bonding duration or + /// number of sessions per era, the longer reports remain valid. pub const ReportLongevity: u64 = BondingDuration::get() as u64 * SessionsPerEra::get() as u64 * EpochDuration::get(); } @@ -400,14 +423,14 @@ impl pallet_babe::Config for Runtime { #[cfg(not(feature = "runtime-benchmarks"))] parameter_types! { - // Minimum allowed account balance under which account will be reaped - pub const ExistentialDeposit: Balance = 1 * MILLIANLOG; + /// Minimum allowed account balance under which account will be reaped + pub const ExistentialDeposit: Balance = 1 * ANLOG; } #[cfg(feature = "runtime-benchmarks")] parameter_types! { // Use more u32 friendly value for benchmark runtime and AtLeast32Bit - pub const ExistentialDeposit: Balance = 1_000_000; + pub const ExistentialDeposit: Balance = 500 * MILLIANLOG; } parameter_types! { @@ -434,11 +457,23 @@ impl pallet_balances::Config for Runtime { } parameter_types! { - pub const TransactionByteFee: Balance = 10 * MILLIANLOG; + + /// Multiplier for operational fees, set to 5. pub const OperationalFeeMultiplier: u8 = 5; + + /// The target block fullness level, set to 25%. + /// This determines the block saturation level, and fees will adjust based on this value. pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25); + + /// Adjustment variable for fee calculation, set to 1/100,000. + /// This value influences how rapidly the fee multiplier changes. pub AdjustmentVariable: Multiplier = Multiplier::saturating_from_rational(1, 100_000); + + /// Minimum fee multiplier, set to 1/1,000,000,000. + /// This represents the smallest possible fee multiplier to prevent fees from dropping too low. pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000_000u128); + + /// Maximum fee multiplier, set to the maximum possible value of the `Multiplier` type. pub MaximumMultiplier: Multiplier = Bounded::max_value(); } @@ -446,11 +481,25 @@ parameter_types! { // #[allow(deprecated)] impl pallet_transaction_payment::Config for Runtime { + /// The event type that will be emitted for transaction payment events. type RuntimeEvent = RuntimeEvent; + + /// Specifies the currency adapter used for charging transaction fees. + /// The `CurrencyAdapter` is used to charge the fees and deal with any adjustments or redistribution of those fees. type OnChargeTransaction = CurrencyAdapter; + + /// The multiplier applied to operational transaction fees. + /// Operational fees are used for transactions that are essential for the network's operation. type OperationalFeeMultiplier = OperationalFeeMultiplier; - type WeightToFee = IdentityFee; - type LengthToFee = ConstantMultiplier; + + /// Defines how the weight of a transaction is converted to a fee. + type WeightToFee = WeightToFee; + + /// Defines a constant multiplier for the length (in bytes) of a transaction, applied as an additional fee. + type LengthToFee = ConstantMultiplier>; + + /// Defines how the fee multiplier is updated based on the block fullness. + /// The `TargetedFeeAdjustment` adjusts the fee multiplier to maintain the target block fullness. type FeeMultiplierUpdate = TargetedFeeAdjustment< Self, TargetBlockFullness, @@ -504,9 +553,9 @@ impl pallet_session::historical::Config for Runtime { pallet_staking_reward_curve::build! { const REWARD_CURVE: PiecewiseLinear<'static> = curve!( - min_inflation: 0_025_000, - max_inflation: 0_100_000, - ideal_stake: 0_500_000, + min_inflation: 0_020_000, + max_inflation: 0_080_000, + ideal_stake: 0_600_000, falloff: 0_050_000, max_piece_count: 40, test_precision: 0_005_000, @@ -514,14 +563,43 @@ pallet_staking_reward_curve::build! { } parameter_types! { - /// The number of session per era + /// The number of sessions that constitute an era. An era is the time period over which staking rewards + /// are distributed, and validator set changes can occur. The era duration is a function of the number of + /// sessions and the length of each session. pub const SessionsPerEra: sp_staking::SessionIndex = 6; - pub const BondingDuration: sp_staking::EraIndex = 24 * 28; - pub const SlashDeferDuration: sp_staking::EraIndex = 24 * 7; // 1/4 the bonding duration. + + /// The number of eras that a bonded stake must remain locked after the owner has requested to unbond. + /// This value represents 21 days, assuming each era is 24 hours long. This delay is intended to increase + /// network security by preventing stakers from immediately withdrawing funds after participating in staking. + pub const BondingDuration: sp_staking::EraIndex = 24 * 21; + + /// The number of eras after a slashing event before the slashing is enacted. This delay allows participants + /// to challenge slashes or react to slashing events. It is set to 1/4 of the BondingDuration. + pub const SlashDeferDuration: sp_staking::EraIndex = 24 * 7; + + /// The reward curve used for staking payouts. This curve defines how rewards are distributed across validators + /// and nominators, typically favoring higher stakes but ensuring diminishing returns as stakes increase. + /// The curve is piecewise linear, allowing for different reward distribution models. pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE; + + /// The maximum number of validators a nominator can nominate. This sets an upper limit on how many validators + /// can be supported by a single nominator. A higher number allows more decentralization but increases the + /// complexity of the staking system. pub const MaxNominators: u32 = 64; + + /// The maximum number of controllers that can be included in a deprecation batch when deprecated staking controllers + /// are being phased out. This helps manage the process of retiring controllers to prevent overwhelming the system + /// during upgrades. pub const MaxControllersInDeprecationBatch: u32 = 5900; + + /// The number of blocks before an off-chain worker repeats a task. Off-chain workers handle tasks that are performed + /// outside the main blockchain execution, such as fetching data or performing computation-heavy operations. This value + /// sets how frequently these tasks are repeated. pub OffchainRepeat: BlockNumber = 5; + + /// The number of eras that historical staking data is kept in storage. This depth determines how far back the system + /// keeps records of staking events and rewards for historical queries and audits. Older data beyond this depth will + /// be pruned to save storage. pub HistoryDepth: u32 = 84; } @@ -571,23 +649,47 @@ impl pallet_staking::Config for Runtime { } parameter_types! { - // phase durations. 1/4 of the last session for each. - pub const SignedPhase: u32 = EPOCH_DURATION_IN_BLOCKS / 4; + /// This phase determines the time window, in blocks, during which signed transactions (those that + /// are authorized by users with private keys, usually nominators or council members) can be submitted. + /// It is calculated as 1/3 of the total epoch duration, ensuring that signed + /// transactions are allowed for a quarter of the epoch. + pub const SignedPhase: u32 = EPOCH_DURATION_IN_BLOCKS / 3; + /// This phase determines the time window, in blocks, during which unsigned transactions (those + /// without authorization, usually by offchain workers) can be submitted. Like the signed phase, + /// it occupies 1/3 of the total epoch duration. pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_BLOCKS / 4; - // signed config + // Signed Config + /// This represents the fixed reward given to participants for submitting valid signed + /// transactions. It is set to 1 ANLOG token, meaning that any participant who successfully + /// submits a signed transaction will receive this base reward. pub const SignedRewardBase: Balance = 1 * ANLOG; + /// This deposit ensures that users have economic stakes in the submission of valid signed + /// transactions. It is currently set to 1 ANLOG, meaning participants must lock 1 ANLOG as pub const SignedFixedDeposit: Balance = 1 * ANLOG; + /// This percentage increase applies to deposits for multiple or repeated signed transactions. + /// It is set to 10%, meaning that each additional submission after the first will increase the + /// required deposit by 10%. This serves as a disincentive to spamming the system with repeated + /// submissions. pub const SignedDepositIncreaseFactor: Percent = Percent::from_percent(10); - pub const SignedDepositByte: Balance = 10 * MILLIANLOG; + /// This deposit ensures that larger signed transactions incur higher costs, reflecting the + /// increased resource consumption they require. It is set to 10 milliANLOG per byte. + pub const SignedDepositByte: Balance = deposit(0, 1); - // miner configs + // Miner Configs + /// This priority level determines the order in which unsigned transactions are included + /// in blocks relative to other transactions. pub const MultiPhaseUnsignedPriority: TransactionPriority = StakingUnsignedPriority::get() - 1u64; + /// The maximum weight (computational limit) allowed for miner operations in a block. + /// This ensures that the block has enough space left for miner operations while maintaining + /// a limit on overall block execution weight. pub MinerMaxWeight: Weight = RuntimeBlockWeights::get() .get(DispatchClass::Normal) .max_extrinsic.expect("Normal extrinsics have a weight limit configured; qed") .saturating_sub(BlockExecutionWeight::get()); - // Solution can occupy 90% of normal block size + /// This value is set to 90% of the maximum allowed block length for normal transactions. + /// It ensures that miner solutions do not consume too much block space, leaving enough + /// room for other transactions. pub MinerMaxLength: u32 = Perbill::from_rational(9u32, 10) * *RuntimeBlockLength::get() .max @@ -678,7 +780,7 @@ impl pallet_election_provider_multi_phase::MinerConfig for Runtime { type Solution = NposSolution16; type MaxVotesPerVoter = <::DataProvider as ElectionDataProvider>::MaxVotesPerVoter; - type MaxWinners = MaxActiveValidators; + type MaxWinners = ConstU32<100>; // The unsigned submissions have to respect the weight of the submit_unsigned call, thus their // weight estimate function is wired to this call's weight. @@ -716,7 +818,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime { type GovernanceFallback = onchain::OnChainExecution; type Solver = SequentialPhragmen, OffchainRandomBalancing>; type ForceOrigin = EnsureRootOrHalfTechnical; - type MaxWinners = MaxActiveValidators; + type MaxWinners = ConstU32<100>; type ElectionBounds = ElectionBoundsMultiPhase; type BenchmarkingConfig = ElectionProviderBenchmarkConfig; type WeightInfo = pallet_election_provider_multi_phase::weights::SubstrateWeight; @@ -741,7 +843,7 @@ parameter_types! { pub const PreimageHoldReason: RuntimeHoldReason = RuntimeHoldReason::Preimage(pallet_preimage::HoldReason::Preimage); /// TODO: Select good value pub const StorageBaseDeposit: Balance = 1 * ANLOG; - pub const StorageByteDeposit: Balance = 10 * MILLIANLOG; + pub const StorageByteDeposit: Balance = deposit(0,1); } impl pallet_preimage::Config for Runtime { @@ -991,11 +1093,11 @@ parameter_types! { pub const ProposalBond: Permill = Permill::from_percent(5); pub const ProposalBondMinimum: Balance = 1 * ANLOG; pub const SpendPeriod: BlockNumber = 1 * DAYS; - pub const Burn: Permill = Permill::from_percent(50); + pub const Burn: Permill = Permill::from_perthousand(1); pub const TipCountdown: BlockNumber = 1 * DAYS; pub const TipFindersFee: Percent = Percent::from_percent(20); pub const TipReportDepositBase: Balance = 1 * ANLOG; - pub const DataDepositPerByte: Balance = 10 * MILLIANLOG; + pub const DataDepositPerByte: Balance = deposit(0,1); pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); pub const MaximumReasonLength: u32 = 300; pub const MaxApprovals: u32 = 100; diff --git a/runtimes/testnet/Cargo.toml b/runtimes/testnet/Cargo.toml index c2277cebe..8dd989b76 100644 --- a/runtimes/testnet/Cargo.toml +++ b/runtimes/testnet/Cargo.toml @@ -117,6 +117,7 @@ runtime-benchmarks = [ "polkadot-sdk/pallet-election-provider-support-benchmarking", "polkadot-sdk/pallet-offences-benchmarking", "polkadot-sdk/pallet-session-benchmarking", + "polkadot-sdk/sp-genesis-builder", "pallet-elections/runtime-benchmarks", "pallet-members/runtime-benchmarks", diff --git a/runtimes/testnet/src/lib.rs b/runtimes/testnet/src/lib.rs index db744d1b1..9204dab10 100644 --- a/runtimes/testnet/src/lib.rs +++ b/runtimes/testnet/src/lib.rs @@ -28,7 +28,6 @@ use frame_support::{ tokens::{PayFromAccount, UnityAssetBalanceConversion}, Imbalance, }, - weights::constants::WEIGHT_REF_TIME_PER_SECOND, }; use frame_system::EnsureRootWithSuccess; use frame_system::{limits::BlockWeights, EnsureRoot}; @@ -65,13 +64,16 @@ use sp_std::prelude::*; use sp_version::NativeVersion; use sp_version::RuntimeVersion; +/// weightToFee implementation +use runtime_common::fee::WeightToFee; pub use runtime_common::{ currency::*, prod_or_dev, time::*, weights::{BlockExecutionWeight, ExtrinsicBaseWeight}, - BABE_GENESIS_EPOCH_CONFIG, + BABE_GENESIS_EPOCH_CONFIG, MAXIMUM_BLOCK_WEIGHT, }; + pub use time_primitives::{ AccountId, Balance, BatchId, BlockNumber, ChainName, ChainNetwork, Commitment, Gateway, GatewayMessage, MemberStatus, MembersInterface, NetworkId, NetworksInterface, PeerId, @@ -89,7 +91,7 @@ pub use frame_support::{ ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Currency, EnsureOrigin, InstanceFilter, KeyOwnerProofSystem, OnUnbalanced, Randomness, StorageInfo, }, - weights::{constants::ParityDbWeight, ConstantMultiplier, IdentityFee, Weight, WeightToFee}, + weights::{constants::ParityDbWeight, ConstantMultiplier, Weight}, PalletId, StorageValue, }; #[cfg(any(feature = "std", test))] @@ -121,9 +123,6 @@ pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); /// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used /// by Operational extrinsics. const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); -/// We allow for 2 seconds of compute with a 6 second average block time, with maximum proof size. -const MAXIMUM_BLOCK_WEIGHT: Weight = - Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), u64::MAX); const_assert!(NORMAL_DISPATCH_RATIO.deconstruct() >= AVERAGE_ON_INITIALIZE_RATIO.deconstruct()); @@ -759,7 +758,7 @@ impl pallet_transaction_payment::Config for Runtime { type OnChargeTransaction = CurrencyAdapter>; // multiplier to boost the priority of operational transactions type OperationalFeeMultiplier = ConstU8<5>; - type WeightToFee = IdentityFee; + type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier>; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; } @@ -1593,7 +1592,7 @@ impl_runtime_apis! { } } - #[cfg(feature = "development")] + #[cfg(any(feature = "development", feature = "runtime-benchmarks"))] impl sp_genesis_builder::GenesisBuilder for Runtime { fn build_state(config: Vec) -> sp_genesis_builder::Result { build_state::(config) From a32947c1aab8e3252aa966843c4d7c05204d39b6 Mon Sep 17 00:00:00 2001 From: Github Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 02:37:48 +0000 Subject: [PATCH 24/31] runtimes: update pallet weights --- runtimes/mainnet/src/weights/dmail.rs | 14 ++++---- runtimes/mainnet/src/weights/elections.rs | 6 ++-- runtimes/mainnet/src/weights/members.rs | 14 ++++---- runtimes/mainnet/src/weights/networks.rs | 16 ++++----- runtimes/mainnet/src/weights/shards.rs | 18 +++++----- runtimes/mainnet/src/weights/tasks.rs | 38 ++++++++++---------- runtimes/mainnet/src/weights/timegraph.rs | 42 +++++++++++------------ runtimes/testnet/src/weights/dmail.rs | 14 ++++---- runtimes/testnet/src/weights/elections.rs | 6 ++-- runtimes/testnet/src/weights/members.rs | 14 ++++---- runtimes/testnet/src/weights/networks.rs | 16 +++++---- runtimes/testnet/src/weights/shards.rs | 18 +++++----- runtimes/testnet/src/weights/tasks.rs | 38 ++++++++++---------- runtimes/testnet/src/weights/timegraph.rs | 42 +++++++++++------------ 14 files changed, 148 insertions(+), 148 deletions(-) diff --git a/runtimes/mainnet/src/weights/dmail.rs b/runtimes/mainnet/src/weights/dmail.rs index 2ae3bf2c0..973c6c402 100644 --- a/runtimes/mainnet/src/weights/dmail.rs +++ b/runtimes/mainnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,12 +41,12 @@ impl pallet_dmail::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_194_000 picoseconds. - Weight::from_parts(6_902_453, 0) + // Minimum execution time: 7_745_000 picoseconds. + Weight::from_parts(7_077_095, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 89 - .saturating_add(Weight::from_parts(2_112, 0).saturating_mul(a.into())) - // Standard Error: 89 - .saturating_add(Weight::from_parts(1_764, 0).saturating_mul(b.into())) + // Standard Error: 79 + .saturating_add(Weight::from_parts(1_367, 0).saturating_mul(a.into())) + // Standard Error: 79 + .saturating_add(Weight::from_parts(1_366, 0).saturating_mul(b.into())) } } diff --git a/runtimes/mainnet/src/weights/elections.rs b/runtimes/mainnet/src/weights/elections.rs index 7dcea34dd..71675bdaf 100644 --- a/runtimes/mainnet/src/weights/elections.rs +++ b/runtimes/mainnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_043_000 picoseconds. - Weight::from_parts(15_699_000, 0) + // Minimum execution time: 12_052_000 picoseconds. + Weight::from_parts(12_554_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/mainnet/src/weights/members.rs b/runtimes/mainnet/src/weights/members.rs index 4a8174dea..cefb75da5 100644 --- a/runtimes/mainnet/src/weights/members.rs +++ b/runtimes/mainnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 62_598_000 picoseconds. - Weight::from_parts(71_073_000, 0) + // Minimum execution time: 62_537_000 picoseconds. + Weight::from_parts(70_913_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 22_793_000 picoseconds. - Weight::from_parts(25_318_000, 0) + // Minimum execution time: 21_731_000 picoseconds. + Weight::from_parts(37_128_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 58_098_000 picoseconds. - Weight::from_parts(62_848_000, 0) + // Minimum execution time: 57_668_000 picoseconds. + Weight::from_parts(92_182_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/mainnet/src/weights/networks.rs b/runtimes/mainnet/src/weights/networks.rs index e032398b7..8804fa7d3 100644 --- a/runtimes/mainnet/src/weights/networks.rs +++ b/runtimes/mainnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -63,17 +63,13 @@ impl pallet_networks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 1000]`. /// The range of component `a` is `[1, 1000]`. /// The range of component `b` is `[1, 1000]`. - fn register_network(a: u32, b: u32, ) -> Weight { + fn register_network(_a: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 59_722_000 picoseconds. - Weight::from_parts(53_225_243, 0) + // Minimum execution time: 57_338_000 picoseconds. + Weight::from_parts(66_813_960, 0) .saturating_add(Weight::from_parts(0, 3583)) - // Standard Error: 951 - .saturating_add(Weight::from_parts(14_180, 0).saturating_mul(a.into())) - // Standard Error: 951 - .saturating_add(Weight::from_parts(8_256, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -91,8 +87,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 22_993_000 picoseconds. - Weight::from_parts(33_282_000, 0) + // Minimum execution time: 21_850_000 picoseconds. + Weight::from_parts(24_506_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/mainnet/src/weights/shards.rs b/runtimes/mainnet/src/weights/shards.rs index f25de6c64..6e82a9cb2 100644 --- a/runtimes/mainnet/src/weights/shards.rs +++ b/runtimes/mainnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 514_212_000 picoseconds. - Weight::from_parts(526_125_000, 0) + // Minimum execution time: 515_504_000 picoseconds. + Weight::from_parts(548_417_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 59_812_000 picoseconds. - Weight::from_parts(63_157_000, 0) + // Minimum execution time: 60_092_000 picoseconds. + Weight::from_parts(62_766_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 71_615_000 picoseconds. - Weight::from_parts(75_992_000, 0) + // Minimum execution time: 72_947_000 picoseconds. + Weight::from_parts(76_995_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_507_000 picoseconds. - Weight::from_parts(3_807_000, 0) + // Minimum execution time: 3_426_000 picoseconds. + Weight::from_parts(3_607_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/mainnet/src/weights/tasks.rs b/runtimes/mainnet/src/weights/tasks.rs index 9e31a0022..f70dc02c4 100644 --- a/runtimes/mainnet/src/weights/tasks.rs +++ b/runtimes/mainnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 624_318_000 picoseconds. - Weight::from_parts(698_456_000, 0) + // Minimum execution time: 624_469_000 picoseconds. + Weight::from_parts(661_136_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -81,33 +81,33 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// Proof: `Networks::NetworkShardTaskLimit` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::TaskShard` (r:1 w:1) /// Proof: `Tasks::TaskShard` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tasks::NetworkShards` (r:10001 w:0) + /// Storage: `Tasks::NetworkShards` (r:1501 w:0) /// Proof: `Tasks::NetworkShards` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTaskCount` (r:1 w:1) /// Proof: `Tasks::ShardTaskCount` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::Tasks` (r:1 w:0) /// Proof: `Tasks::Tasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Shards::ShardCommitment` (r:10000 w:0) + /// Storage: `Shards::ShardCommitment` (r:1500 w:0) /// Proof: `Shards::ShardCommitment` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardRegistered` (r:1 w:0) /// Proof: `Tasks::ShardRegistered` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTasks` (r:0 w:1) /// Proof: `Tasks::ShardTasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[1, 10000]`. - /// The range of component `b` is `[1, 10000]`. + /// The range of component `b` is `[1, 1500]`. + /// The range of component `b` is `[1, 1500]`. fn schedule_tasks(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `4412 + b * (91 ±0)` - // Estimated: `10028 + b * (2566 ±0)` - // Minimum execution time: 59_763_000 picoseconds. - Weight::from_parts(63_449_000, 0) - .saturating_add(Weight::from_parts(0, 10028)) - // Standard Error: 10_361 - .saturating_add(Weight::from_parts(11_731_446, 0).saturating_mul(b.into())) + // Measured: `2647 + b * (92 ±0)` + // Estimated: `8309 + b * (2568 ±0)` + // Minimum execution time: 60_322_000 picoseconds. + Weight::from_parts(62_317_000, 0) + .saturating_add(Weight::from_parts(0, 8309)) + // Standard Error: 9_364 + .saturating_add(Weight::from_parts(10_930_824, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 2566).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 2568).saturating_mul(b.into())) } /// Storage: `Tasks::ReadEventsTask` (r:2 w:0) /// Proof: `Tasks::ReadEventsTask` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 25_137_000 picoseconds. - Weight::from_parts(43_753_099, 0) + // Minimum execution time: 25_608_000 picoseconds. + Weight::from_parts(44_757_340, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 345 - .saturating_add(Weight::from_parts(14_169, 0).saturating_mul(b.into())) + // Standard Error: 409 + .saturating_add(Weight::from_parts(14_594, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/mainnet/src/weights/timegraph.rs b/runtimes/mainnet/src/weights/timegraph.rs index 387788342..d559a2caf 100644 --- a/runtimes/mainnet/src/weights/timegraph.rs +++ b/runtimes/mainnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -38,12 +38,12 @@ impl pallet_timegraph::WeightInfo for WeightInfo { fn deposit() -> Weight { // Proof Size summary in bytes: // Measured: `3` - // Estimated: `3593` - // Minimum execution time: 62_948_000 picoseconds. - Weight::from_parts(91_992_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + // Estimated: `3468` + // Minimum execution time: 35_767_000 picoseconds. + Weight::from_parts(40_986_000, 0) + .saturating_add(Weight::from_parts(0, 3468)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Timegraph::Threshold` (r:1 w:0) /// Proof: `Timegraph::Threshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -52,10 +52,10 @@ impl pallet_timegraph::WeightInfo for WeightInfo { fn withdraw() -> Weight { // Proof Size summary in bytes: // Measured: `3` - // Estimated: `3593` - // Minimum execution time: 62_627_000 picoseconds. - Weight::from_parts(68_719_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) + // Estimated: `3468` + // Minimum execution time: 34_814_000 picoseconds. + Weight::from_parts(38_622_000, 0) + .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -69,8 +69,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `272` // Estimated: `6196` - // Minimum execution time: 79_769_000 picoseconds. - Weight::from_parts(81_723_000, 0) + // Minimum execution time: 90_350_000 picoseconds. + Weight::from_parts(108_222_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -85,8 +85,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3593` - // Minimum execution time: 77_115_000 picoseconds. - Weight::from_parts(78_756_000, 0) + // Minimum execution time: 87_204_000 picoseconds. + Weight::from_parts(100_317_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_267_000 picoseconds. - Weight::from_parts(9_988_000, 0) + // Minimum execution time: 10_390_000 picoseconds. + Weight::from_parts(12_734_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,8 +109,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_318_000 picoseconds. - Weight::from_parts(10_038_000, 0) + // Minimum execution time: 9_768_000 picoseconds. + Weight::from_parts(16_190_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_117_000 picoseconds. - Weight::from_parts(9_678_000, 0) + // Minimum execution time: 9_356_000 picoseconds. + Weight::from_parts(11_601_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtimes/testnet/src/weights/dmail.rs b/runtimes/testnet/src/weights/dmail.rs index 007f1c91f..01ef7f8ce 100644 --- a/runtimes/testnet/src/weights/dmail.rs +++ b/runtimes/testnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,12 +41,12 @@ impl pallet_dmail::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_006_000 picoseconds. - Weight::from_parts(7_871_314, 0) + // Minimum execution time: 7_955_000 picoseconds. + Weight::from_parts(7_915_289, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 74 - .saturating_add(Weight::from_parts(941, 0).saturating_mul(a.into())) - // Standard Error: 74 - .saturating_add(Weight::from_parts(1_044, 0).saturating_mul(b.into())) + // Standard Error: 13 + .saturating_add(Weight::from_parts(627, 0).saturating_mul(a.into())) + // Standard Error: 13 + .saturating_add(Weight::from_parts(670, 0).saturating_mul(b.into())) } } diff --git a/runtimes/testnet/src/weights/elections.rs b/runtimes/testnet/src/weights/elections.rs index ddfd2dd3e..8595cc41a 100644 --- a/runtimes/testnet/src/weights/elections.rs +++ b/runtimes/testnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 11_972_000 picoseconds. - Weight::from_parts(14_357_000, 0) + // Minimum execution time: 12_193_000 picoseconds. + Weight::from_parts(13_697_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/testnet/src/weights/members.rs b/runtimes/testnet/src/weights/members.rs index d84085ead..d810522c8 100644 --- a/runtimes/testnet/src/weights/members.rs +++ b/runtimes/testnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 61_496_000 picoseconds. - Weight::from_parts(64_841_000, 0) + // Minimum execution time: 60_674_000 picoseconds. + Weight::from_parts(62_867_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 22_101_000 picoseconds. - Weight::from_parts(23_594_000, 0) + // Minimum execution time: 22_102_000 picoseconds. + Weight::from_parts(23_063_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 57_117_000 picoseconds. - Weight::from_parts(60_143_000, 0) + // Minimum execution time: 56_064_000 picoseconds. + Weight::from_parts(58_418_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/testnet/src/weights/networks.rs b/runtimes/testnet/src/weights/networks.rs index 756a5edb0..7016736a6 100644 --- a/runtimes/testnet/src/weights/networks.rs +++ b/runtimes/testnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -63,13 +63,17 @@ impl pallet_networks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 1000]`. /// The range of component `a` is `[1, 1000]`. /// The range of component `b` is `[1, 1000]`. - fn register_network(_a: u32, _b: u32, ) -> Weight { + fn register_network(a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 55_634_000 picoseconds. - Weight::from_parts(96_580_843, 0) + // Minimum execution time: 53_972_000 picoseconds. + Weight::from_parts(56_441_587, 0) .saturating_add(Weight::from_parts(0, 3583)) + // Standard Error: 351 + .saturating_add(Weight::from_parts(642, 0).saturating_mul(a.into())) + // Standard Error: 351 + .saturating_add(Weight::from_parts(1_923, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -87,8 +91,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 21_421_000 picoseconds. - Weight::from_parts(27_320_000, 0) + // Minimum execution time: 20_969_000 picoseconds. + Weight::from_parts(21_861_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/testnet/src/weights/shards.rs b/runtimes/testnet/src/weights/shards.rs index 4e513a617..1e9a7dcc8 100644 --- a/runtimes/testnet/src/weights/shards.rs +++ b/runtimes/testnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 511_876_000 picoseconds. - Weight::from_parts(533_108_000, 0) + // Minimum execution time: 533_517_000 picoseconds. + Weight::from_parts(558_064_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 58_870_000 picoseconds. - Weight::from_parts(61_526_000, 0) + // Minimum execution time: 60_504_000 picoseconds. + Weight::from_parts(63_700_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 71_064_000 picoseconds. - Weight::from_parts(73_317_000, 0) + // Minimum execution time: 73_177_000 picoseconds. + Weight::from_parts(76_683_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_536_000 picoseconds. - Weight::from_parts(3_796_000, 0) + // Minimum execution time: 3_376_000 picoseconds. + Weight::from_parts(3_717_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/testnet/src/weights/tasks.rs b/runtimes/testnet/src/weights/tasks.rs index 1acdb99ff..8fd19090a 100644 --- a/runtimes/testnet/src/weights/tasks.rs +++ b/runtimes/testnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 632_823_000 picoseconds. - Weight::from_parts(686_694_000, 0) + // Minimum execution time: 620_140_000 picoseconds. + Weight::from_parts(659_675_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -81,33 +81,33 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// Proof: `Networks::NetworkShardTaskLimit` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::TaskShard` (r:1 w:1) /// Proof: `Tasks::TaskShard` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tasks::NetworkShards` (r:10001 w:0) + /// Storage: `Tasks::NetworkShards` (r:1501 w:0) /// Proof: `Tasks::NetworkShards` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTaskCount` (r:1 w:1) /// Proof: `Tasks::ShardTaskCount` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::Tasks` (r:1 w:0) /// Proof: `Tasks::Tasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Shards::ShardCommitment` (r:10000 w:0) + /// Storage: `Shards::ShardCommitment` (r:1500 w:0) /// Proof: `Shards::ShardCommitment` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardRegistered` (r:1 w:0) /// Proof: `Tasks::ShardRegistered` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTasks` (r:0 w:1) /// Proof: `Tasks::ShardTasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[1, 10000]`. - /// The range of component `b` is `[1, 10000]`. + /// The range of component `b` is `[1, 1500]`. + /// The range of component `b` is `[1, 1500]`. fn schedule_tasks(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `4412 + b * (91 ±0)` - // Estimated: `10028 + b * (2566 ±0)` - // Minimum execution time: 60_142_000 picoseconds. - Weight::from_parts(62_126_000, 0) - .saturating_add(Weight::from_parts(0, 10028)) - // Standard Error: 10_840 - .saturating_add(Weight::from_parts(11_935_194, 0).saturating_mul(b.into())) + // Measured: `2647 + b * (92 ±0)` + // Estimated: `8309 + b * (2568 ±0)` + // Minimum execution time: 59_700_000 picoseconds. + Weight::from_parts(61_616_000, 0) + .saturating_add(Weight::from_parts(0, 8309)) + // Standard Error: 9_225 + .saturating_add(Weight::from_parts(10_660_462, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 2566).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 2568).saturating_mul(b.into())) } /// Storage: `Tasks::ReadEventsTask` (r:2 w:0) /// Proof: `Tasks::ReadEventsTask` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 25_127_000 picoseconds. - Weight::from_parts(46_252_164, 0) + // Minimum execution time: 25_507_000 picoseconds. + Weight::from_parts(51_189_409, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 461 - .saturating_add(Weight::from_parts(13_225, 0).saturating_mul(b.into())) + // Standard Error: 460 + .saturating_add(Weight::from_parts(9_164, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/testnet/src/weights/timegraph.rs b/runtimes/testnet/src/weights/timegraph.rs index a96b697de..560efcabd 100644 --- a/runtimes/testnet/src/weights/timegraph.rs +++ b/runtimes/testnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -38,12 +38,12 @@ impl pallet_timegraph::WeightInfo for WeightInfo { fn deposit() -> Weight { // Proof Size summary in bytes: // Measured: `3` - // Estimated: `3593` - // Minimum execution time: 62_337_000 picoseconds. - Weight::from_parts(66_425_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + // Estimated: `3468` + // Minimum execution time: 32_070_000 picoseconds. + Weight::from_parts(33_612_000, 0) + .saturating_add(Weight::from_parts(0, 3468)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Timegraph::Threshold` (r:1 w:0) /// Proof: `Timegraph::Threshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -52,10 +52,10 @@ impl pallet_timegraph::WeightInfo for WeightInfo { fn withdraw() -> Weight { // Proof Size summary in bytes: // Measured: `3` - // Estimated: `3593` - // Minimum execution time: 63_148_000 picoseconds. - Weight::from_parts(71_112_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) + // Estimated: `3468` + // Minimum execution time: 33_032_000 picoseconds. + Weight::from_parts(34_444_000, 0) + .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -69,8 +69,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `272` // Estimated: `6196` - // Minimum execution time: 89_538_000 picoseconds. - Weight::from_parts(95_037_000, 0) + // Minimum execution time: 81_621_000 picoseconds. + Weight::from_parts(83_928_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -85,8 +85,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3593` - // Minimum execution time: 86_432_000 picoseconds. - Weight::from_parts(90_750_000, 0) + // Minimum execution time: 79_518_000 picoseconds. + Weight::from_parts(81_071_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 10_049_000 picoseconds. - Weight::from_parts(11_462_000, 0) + // Minimum execution time: 9_287_000 picoseconds. + Weight::from_parts(9_939_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,8 +109,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_908_000 picoseconds. - Weight::from_parts(11_230_000, 0) + // Minimum execution time: 9_438_000 picoseconds. + Weight::from_parts(10_219_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_919_000 picoseconds. - Weight::from_parts(12_443_000, 0) + // Minimum execution time: 9_057_000 picoseconds. + Weight::from_parts(9_679_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) From 8472ffc3cd24c71046521b7c4bf4d5296a5b02d6 Mon Sep 17 00:00:00 2001 From: ana-junius Date: Thu, 10 Oct 2024 11:19:28 +0800 Subject: [PATCH 25/31] update Cargo file --- Cargo.lock | 2 -- pallets/timegraph/Cargo.toml | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a4dc1f2da..714285d05 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10363,12 +10363,10 @@ dependencies = [ name = "pallet-timegraph" version = "0.7.0" dependencies = [ - "log", "parity-scale-codec", "polkadot-sdk", "scale-info", "simple-mermaid", - "time-primitives", ] [[package]] diff --git a/pallets/timegraph/Cargo.toml b/pallets/timegraph/Cargo.toml index 19b3ae760..551f6727a 100644 --- a/pallets/timegraph/Cargo.toml +++ b/pallets/timegraph/Cargo.toml @@ -15,13 +15,11 @@ repository.workspace = true scale-codec = { workspace = true, features = [ "max-encoded-len" ] } scale-info.workspace = true simple-mermaid.workspace = true -log.workspace = true polkadot-sdk = { workspace = true, features = [ "frame-support", "frame-system", "sp-runtime" ] } -time-primitives.workspace = true [dev-dependencies] -polkadot-sdk = { workspace = true, features = [ "pallet-balances", "sp-core", "sp-io", "sp-tracing", "sp-runtime" ] } +polkadot-sdk = { workspace = true, features = [ "pallet-balances", "sp-core", "sp-io", "sp-tracing" ] } [features] @@ -31,7 +29,6 @@ std = [ "scale-info/std", "polkadot-sdk/std", - "time-primitives/std", ] runtime-benchmarks = [ "polkadot-sdk/runtime-benchmarks", From 714be8669a4d8a11e056f90af9f8193eec2dd561 Mon Sep 17 00:00:00 2001 From: Github Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 04:22:57 +0000 Subject: [PATCH 26/31] runtimes: update pallet weights --- runtimes/mainnet/src/weights/dmail.rs | 12 ++++------ runtimes/mainnet/src/weights/elections.rs | 4 ++-- runtimes/mainnet/src/weights/members.rs | 12 +++++----- runtimes/mainnet/src/weights/networks.rs | 12 ++++++---- runtimes/mainnet/src/weights/shards.rs | 16 ++++++------- runtimes/mainnet/src/weights/tasks.rs | 20 ++++++++-------- runtimes/mainnet/src/weights/timegraph.rs | 28 +++++++++++------------ runtimes/testnet/src/weights/dmail.rs | 12 +++++----- runtimes/testnet/src/weights/elections.rs | 4 ++-- runtimes/testnet/src/weights/members.rs | 12 +++++----- runtimes/testnet/src/weights/networks.rs | 16 ++++++------- runtimes/testnet/src/weights/shards.rs | 16 ++++++------- runtimes/testnet/src/weights/tasks.rs | 20 ++++++++-------- runtimes/testnet/src/weights/timegraph.rs | 28 +++++++++++------------ 14 files changed, 106 insertions(+), 106 deletions(-) diff --git a/runtimes/mainnet/src/weights/dmail.rs b/runtimes/mainnet/src/weights/dmail.rs index 973c6c402..48ee47ee6 100644 --- a/runtimes/mainnet/src/weights/dmail.rs +++ b/runtimes/mainnet/src/weights/dmail.rs @@ -37,16 +37,14 @@ impl pallet_dmail::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 1000]`. /// The range of component `a` is `[1, 1000]`. /// The range of component `b` is `[1, 1000]`. - fn send_email(a: u32, b: u32, ) -> Weight { + fn send_email(_a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_745_000 picoseconds. - Weight::from_parts(7_077_095, 0) + // Minimum execution time: 7_665_000 picoseconds. + Weight::from_parts(9_179_515, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 79 - .saturating_add(Weight::from_parts(1_367, 0).saturating_mul(a.into())) - // Standard Error: 79 - .saturating_add(Weight::from_parts(1_366, 0).saturating_mul(b.into())) + // Standard Error: 81 + .saturating_add(Weight::from_parts(916, 0).saturating_mul(b.into())) } } diff --git a/runtimes/mainnet/src/weights/elections.rs b/runtimes/mainnet/src/weights/elections.rs index 71675bdaf..d5955e1f0 100644 --- a/runtimes/mainnet/src/weights/elections.rs +++ b/runtimes/mainnet/src/weights/elections.rs @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_052_000 picoseconds. - Weight::from_parts(12_554_000, 0) + // Minimum execution time: 12_254_000 picoseconds. + Weight::from_parts(14_597_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/mainnet/src/weights/members.rs b/runtimes/mainnet/src/weights/members.rs index cefb75da5..e5b4dae79 100644 --- a/runtimes/mainnet/src/weights/members.rs +++ b/runtimes/mainnet/src/weights/members.rs @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 62_537_000 picoseconds. - Weight::from_parts(70_913_000, 0) + // Minimum execution time: 61_755_000 picoseconds. + Weight::from_parts(63_109_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 21_731_000 picoseconds. - Weight::from_parts(37_128_000, 0) + // Minimum execution time: 21_701_000 picoseconds. + Weight::from_parts(22_612_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 57_668_000 picoseconds. - Weight::from_parts(92_182_000, 0) + // Minimum execution time: 56_055_000 picoseconds. + Weight::from_parts(57_627_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/mainnet/src/weights/networks.rs b/runtimes/mainnet/src/weights/networks.rs index 8804fa7d3..8e06adeb1 100644 --- a/runtimes/mainnet/src/weights/networks.rs +++ b/runtimes/mainnet/src/weights/networks.rs @@ -63,13 +63,15 @@ impl pallet_networks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 1000]`. /// The range of component `a` is `[1, 1000]`. /// The range of component `b` is `[1, 1000]`. - fn register_network(_a: u32, _b: u32, ) -> Weight { + fn register_network(_a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 57_338_000 picoseconds. - Weight::from_parts(66_813_960, 0) + // Minimum execution time: 54_622_000 picoseconds. + Weight::from_parts(63_368_961, 0) .saturating_add(Weight::from_parts(0, 3583)) + // Standard Error: 302 + .saturating_add(Weight::from_parts(152, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -87,8 +89,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 21_850_000 picoseconds. - Weight::from_parts(24_506_000, 0) + // Minimum execution time: 21_551_000 picoseconds. + Weight::from_parts(24_305_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/mainnet/src/weights/shards.rs b/runtimes/mainnet/src/weights/shards.rs index 6e82a9cb2..e369fadda 100644 --- a/runtimes/mainnet/src/weights/shards.rs +++ b/runtimes/mainnet/src/weights/shards.rs @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 515_504_000 picoseconds. - Weight::from_parts(548_417_000, 0) + // Minimum execution time: 520_973_000 picoseconds. + Weight::from_parts(535_372_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 60_092_000 picoseconds. - Weight::from_parts(62_766_000, 0) + // Minimum execution time: 59_773_000 picoseconds. + Weight::from_parts(62_868_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 72_947_000 picoseconds. - Weight::from_parts(76_995_000, 0) + // Minimum execution time: 72_847_000 picoseconds. + Weight::from_parts(76_424_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_426_000 picoseconds. - Weight::from_parts(3_607_000, 0) + // Minimum execution time: 3_487_000 picoseconds. + Weight::from_parts(3_707_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/mainnet/src/weights/tasks.rs b/runtimes/mainnet/src/weights/tasks.rs index f70dc02c4..ba4aaaf31 100644 --- a/runtimes/mainnet/src/weights/tasks.rs +++ b/runtimes/mainnet/src/weights/tasks.rs @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 624_469_000 picoseconds. - Weight::from_parts(661_136_000, 0) + // Minimum execution time: 629_617_000 picoseconds. + Weight::from_parts(664_553_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -99,11 +99,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `2647 + b * (92 ±0)` // Estimated: `8309 + b * (2568 ±0)` - // Minimum execution time: 60_322_000 picoseconds. - Weight::from_parts(62_317_000, 0) + // Minimum execution time: 60_634_000 picoseconds. + Weight::from_parts(114_509_910, 0) .saturating_add(Weight::from_parts(0, 8309)) - // Standard Error: 9_364 - .saturating_add(Weight::from_parts(10_930_824, 0).saturating_mul(b.into())) + // Standard Error: 21_464 + .saturating_add(Weight::from_parts(10_781_369, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 25_608_000 picoseconds. - Weight::from_parts(44_757_340, 0) + // Minimum execution time: 25_498_000 picoseconds. + Weight::from_parts(45_985_582, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 409 - .saturating_add(Weight::from_parts(14_594, 0).saturating_mul(b.into())) + // Standard Error: 473 + .saturating_add(Weight::from_parts(14_981, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/mainnet/src/weights/timegraph.rs b/runtimes/mainnet/src/weights/timegraph.rs index d559a2caf..6c8c6b073 100644 --- a/runtimes/mainnet/src/weights/timegraph.rs +++ b/runtimes/mainnet/src/weights/timegraph.rs @@ -39,8 +39,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 35_767_000 picoseconds. - Weight::from_parts(40_986_000, 0) + // Minimum execution time: 33_403_000 picoseconds. + Weight::from_parts(52_739_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -53,8 +53,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 34_814_000 picoseconds. - Weight::from_parts(38_622_000, 0) + // Minimum execution time: 33_683_000 picoseconds. + Weight::from_parts(43_631_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -69,8 +69,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `272` // Estimated: `6196` - // Minimum execution time: 90_350_000 picoseconds. - Weight::from_parts(108_222_000, 0) + // Minimum execution time: 84_116_000 picoseconds. + Weight::from_parts(87_223_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -85,8 +85,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3593` - // Minimum execution time: 87_204_000 picoseconds. - Weight::from_parts(100_317_000, 0) + // Minimum execution time: 81_122_000 picoseconds. + Weight::from_parts(83_175_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 10_390_000 picoseconds. - Weight::from_parts(12_734_000, 0) + // Minimum execution time: 9_436_000 picoseconds. + Weight::from_parts(10_149_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,8 +109,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_768_000 picoseconds. - Weight::from_parts(16_190_000, 0) + // Minimum execution time: 9_358_000 picoseconds. + Weight::from_parts(9_959_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_356_000 picoseconds. - Weight::from_parts(11_601_000, 0) + // Minimum execution time: 9_207_000 picoseconds. + Weight::from_parts(10_490_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtimes/testnet/src/weights/dmail.rs b/runtimes/testnet/src/weights/dmail.rs index 01ef7f8ce..4f219fcc6 100644 --- a/runtimes/testnet/src/weights/dmail.rs +++ b/runtimes/testnet/src/weights/dmail.rs @@ -41,12 +41,12 @@ impl pallet_dmail::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_955_000 picoseconds. - Weight::from_parts(7_915_289, 0) + // Minimum execution time: 7_665_000 picoseconds. + Weight::from_parts(7_586_366, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 13 - .saturating_add(Weight::from_parts(627, 0).saturating_mul(a.into())) - // Standard Error: 13 - .saturating_add(Weight::from_parts(670, 0).saturating_mul(b.into())) + // Standard Error: 20 + .saturating_add(Weight::from_parts(729, 0).saturating_mul(a.into())) + // Standard Error: 20 + .saturating_add(Weight::from_parts(761, 0).saturating_mul(b.into())) } } diff --git a/runtimes/testnet/src/weights/elections.rs b/runtimes/testnet/src/weights/elections.rs index 8595cc41a..99a7d198f 100644 --- a/runtimes/testnet/src/weights/elections.rs +++ b/runtimes/testnet/src/weights/elections.rs @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_193_000 picoseconds. - Weight::from_parts(13_697_000, 0) + // Minimum execution time: 11_932_000 picoseconds. + Weight::from_parts(12_644_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/testnet/src/weights/members.rs b/runtimes/testnet/src/weights/members.rs index d810522c8..777305a43 100644 --- a/runtimes/testnet/src/weights/members.rs +++ b/runtimes/testnet/src/weights/members.rs @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 60_674_000 picoseconds. - Weight::from_parts(62_867_000, 0) + // Minimum execution time: 61_785_000 picoseconds. + Weight::from_parts(63_699_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 22_102_000 picoseconds. - Weight::from_parts(23_063_000, 0) + // Minimum execution time: 21_852_000 picoseconds. + Weight::from_parts(23_134_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 56_064_000 picoseconds. - Weight::from_parts(58_418_000, 0) + // Minimum execution time: 56_034_000 picoseconds. + Weight::from_parts(57_978_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/testnet/src/weights/networks.rs b/runtimes/testnet/src/weights/networks.rs index 7016736a6..e5eb2bf7a 100644 --- a/runtimes/testnet/src/weights/networks.rs +++ b/runtimes/testnet/src/weights/networks.rs @@ -67,13 +67,13 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 53_972_000 picoseconds. - Weight::from_parts(56_441_587, 0) + // Minimum execution time: 59_872_000 picoseconds. + Weight::from_parts(61_803_066, 0) .saturating_add(Weight::from_parts(0, 3583)) - // Standard Error: 351 - .saturating_add(Weight::from_parts(642, 0).saturating_mul(a.into())) - // Standard Error: 351 - .saturating_add(Weight::from_parts(1_923, 0).saturating_mul(b.into())) + // Standard Error: 166 + .saturating_add(Weight::from_parts(3_245, 0).saturating_mul(a.into())) + // Standard Error: 166 + .saturating_add(Weight::from_parts(745, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -91,8 +91,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 20_969_000 picoseconds. - Weight::from_parts(21_861_000, 0) + // Minimum execution time: 22_693_000 picoseconds. + Weight::from_parts(23_674_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/testnet/src/weights/shards.rs b/runtimes/testnet/src/weights/shards.rs index 1e9a7dcc8..dc3b6ee24 100644 --- a/runtimes/testnet/src/weights/shards.rs +++ b/runtimes/testnet/src/weights/shards.rs @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 533_517_000 picoseconds. - Weight::from_parts(558_064_000, 0) + // Minimum execution time: 515_706_000 picoseconds. + Weight::from_parts(523_459_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 60_504_000 picoseconds. - Weight::from_parts(63_700_000, 0) + // Minimum execution time: 59_541_000 picoseconds. + Weight::from_parts(61_636_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 73_177_000 picoseconds. - Weight::from_parts(76_683_000, 0) + // Minimum execution time: 70_832_000 picoseconds. + Weight::from_parts(73_588_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_376_000 picoseconds. - Weight::from_parts(3_717_000, 0) + // Minimum execution time: 3_496_000 picoseconds. + Weight::from_parts(3_687_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/testnet/src/weights/tasks.rs b/runtimes/testnet/src/weights/tasks.rs index 8fd19090a..5a1c02ba5 100644 --- a/runtimes/testnet/src/weights/tasks.rs +++ b/runtimes/testnet/src/weights/tasks.rs @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 620_140_000 picoseconds. - Weight::from_parts(659_675_000, 0) + // Minimum execution time: 646_580_000 picoseconds. + Weight::from_parts(672_679_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -99,11 +99,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `2647 + b * (92 ±0)` // Estimated: `8309 + b * (2568 ±0)` - // Minimum execution time: 59_700_000 picoseconds. - Weight::from_parts(61_616_000, 0) + // Minimum execution time: 61_084_000 picoseconds. + Weight::from_parts(63_669_000, 0) .saturating_add(Weight::from_parts(0, 8309)) - // Standard Error: 9_225 - .saturating_add(Weight::from_parts(10_660_462, 0).saturating_mul(b.into())) + // Standard Error: 11_922 + .saturating_add(Weight::from_parts(10_867_418, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 25_507_000 picoseconds. - Weight::from_parts(51_189_409, 0) + // Minimum execution time: 26_189_000 picoseconds. + Weight::from_parts(50_373_476, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 460 - .saturating_add(Weight::from_parts(9_164, 0).saturating_mul(b.into())) + // Standard Error: 429 + .saturating_add(Weight::from_parts(7_792, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/testnet/src/weights/timegraph.rs b/runtimes/testnet/src/weights/timegraph.rs index 560efcabd..0b4f70af1 100644 --- a/runtimes/testnet/src/weights/timegraph.rs +++ b/runtimes/testnet/src/weights/timegraph.rs @@ -39,8 +39,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 32_070_000 picoseconds. - Weight::from_parts(33_612_000, 0) + // Minimum execution time: 32_902_000 picoseconds. + Weight::from_parts(50_434_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -53,8 +53,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 33_032_000 picoseconds. - Weight::from_parts(34_444_000, 0) + // Minimum execution time: 33_113_000 picoseconds. + Weight::from_parts(53_590_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -69,8 +69,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `272` // Estimated: `6196` - // Minimum execution time: 81_621_000 picoseconds. - Weight::from_parts(83_928_000, 0) + // Minimum execution time: 83_225_000 picoseconds. + Weight::from_parts(87_904_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -85,8 +85,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3593` - // Minimum execution time: 79_518_000 picoseconds. - Weight::from_parts(81_071_000, 0) + // Minimum execution time: 81_053_000 picoseconds. + Weight::from_parts(84_729_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_287_000 picoseconds. - Weight::from_parts(9_939_000, 0) + // Minimum execution time: 9_307_000 picoseconds. + Weight::from_parts(9_999_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,8 +109,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_438_000 picoseconds. - Weight::from_parts(10_219_000, 0) + // Minimum execution time: 9_447_000 picoseconds. + Weight::from_parts(10_420_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_057_000 picoseconds. - Weight::from_parts(9_679_000, 0) + // Minimum execution time: 9_147_000 picoseconds. + Weight::from_parts(10_890_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) From 01393d5eeb0f0e149d23fd01ba8b40cb69adc4ee Mon Sep 17 00:00:00 2001 From: Github Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 04:26:16 +0000 Subject: [PATCH 27/31] runtimes: update pallet weights --- runtimes/mainnet/src/weights/dmail.rs | 10 +++--- runtimes/mainnet/src/weights/elections.rs | 6 ++-- runtimes/mainnet/src/weights/members.rs | 14 ++++----- runtimes/mainnet/src/weights/networks.rs | 16 +++++----- runtimes/mainnet/src/weights/shards.rs | 18 +++++------ runtimes/mainnet/src/weights/tasks.rs | 38 +++++++++++------------ runtimes/mainnet/src/weights/timegraph.rs | 30 +++++++++--------- runtimes/testnet/src/weights/dmail.rs | 14 ++++----- runtimes/testnet/src/weights/elections.rs | 6 ++-- runtimes/testnet/src/weights/members.rs | 14 ++++----- runtimes/testnet/src/weights/networks.rs | 18 +++++------ runtimes/testnet/src/weights/shards.rs | 18 +++++------ runtimes/testnet/src/weights/tasks.rs | 38 +++++++++++------------ runtimes/testnet/src/weights/timegraph.rs | 30 +++++++++--------- 14 files changed, 135 insertions(+), 135 deletions(-) diff --git a/runtimes/mainnet/src/weights/dmail.rs b/runtimes/mainnet/src/weights/dmail.rs index 48ee47ee6..e3191cb55 100644 --- a/runtimes/mainnet/src/weights/dmail.rs +++ b/runtimes/mainnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,10 +41,10 @@ impl pallet_dmail::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_665_000 picoseconds. - Weight::from_parts(9_179_515, 0) + // Minimum execution time: 7_835_000 picoseconds. + Weight::from_parts(10_963_473, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 81 - .saturating_add(Weight::from_parts(916, 0).saturating_mul(b.into())) + // Standard Error: 100 + .saturating_add(Weight::from_parts(349, 0).saturating_mul(b.into())) } } diff --git a/runtimes/mainnet/src/weights/elections.rs b/runtimes/mainnet/src/weights/elections.rs index d5955e1f0..7d21fa611 100644 --- a/runtimes/mainnet/src/weights/elections.rs +++ b/runtimes/mainnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_254_000 picoseconds. - Weight::from_parts(14_597_000, 0) + // Minimum execution time: 12_984_000 picoseconds. + Weight::from_parts(20_489_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/mainnet/src/weights/members.rs b/runtimes/mainnet/src/weights/members.rs index e5b4dae79..c20598d02 100644 --- a/runtimes/mainnet/src/weights/members.rs +++ b/runtimes/mainnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 61_755_000 picoseconds. - Weight::from_parts(63_109_000, 0) + // Minimum execution time: 62_717_000 picoseconds. + Weight::from_parts(81_002_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 21_701_000 picoseconds. - Weight::from_parts(22_612_000, 0) + // Minimum execution time: 22_051_000 picoseconds. + Weight::from_parts(22_923_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 56_055_000 picoseconds. - Weight::from_parts(57_627_000, 0) + // Minimum execution time: 57_487_000 picoseconds. + Weight::from_parts(59_472_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/mainnet/src/weights/networks.rs b/runtimes/mainnet/src/weights/networks.rs index 8e06adeb1..def6c1986 100644 --- a/runtimes/mainnet/src/weights/networks.rs +++ b/runtimes/mainnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -63,15 +63,15 @@ impl pallet_networks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 1000]`. /// The range of component `a` is `[1, 1000]`. /// The range of component `b` is `[1, 1000]`. - fn register_network(_a: u32, b: u32, ) -> Weight { + fn register_network(a: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 54_622_000 picoseconds. - Weight::from_parts(63_368_961, 0) + // Minimum execution time: 57_157_000 picoseconds. + Weight::from_parts(62_477_900, 0) .saturating_add(Weight::from_parts(0, 3583)) - // Standard Error: 302 - .saturating_add(Weight::from_parts(152, 0).saturating_mul(b.into())) + // Standard Error: 483 + .saturating_add(Weight::from_parts(1_292, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -89,8 +89,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 21_551_000 picoseconds. - Weight::from_parts(24_305_000, 0) + // Minimum execution time: 22_021_000 picoseconds. + Weight::from_parts(23_624_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/mainnet/src/weights/shards.rs b/runtimes/mainnet/src/weights/shards.rs index e369fadda..e96fc76f1 100644 --- a/runtimes/mainnet/src/weights/shards.rs +++ b/runtimes/mainnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 520_973_000 picoseconds. - Weight::from_parts(535_372_000, 0) + // Minimum execution time: 521_605_000 picoseconds. + Weight::from_parts(537_745_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 59_773_000 picoseconds. - Weight::from_parts(62_868_000, 0) + // Minimum execution time: 64_240_000 picoseconds. + Weight::from_parts(67_827_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 72_847_000 picoseconds. - Weight::from_parts(76_424_000, 0) + // Minimum execution time: 76_443_000 picoseconds. + Weight::from_parts(79_379_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_487_000 picoseconds. - Weight::from_parts(3_707_000, 0) + // Minimum execution time: 3_787_000 picoseconds. + Weight::from_parts(3_937_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/mainnet/src/weights/tasks.rs b/runtimes/mainnet/src/weights/tasks.rs index ba4aaaf31..426371392 100644 --- a/runtimes/mainnet/src/weights/tasks.rs +++ b/runtimes/mainnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 629_617_000 picoseconds. - Weight::from_parts(664_553_000, 0) + // Minimum execution time: 632_974_000 picoseconds. + Weight::from_parts(660_074_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -81,33 +81,33 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// Proof: `Networks::NetworkShardTaskLimit` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::TaskShard` (r:1 w:1) /// Proof: `Tasks::TaskShard` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tasks::NetworkShards` (r:1501 w:0) + /// Storage: `Tasks::NetworkShards` (r:501 w:0) /// Proof: `Tasks::NetworkShards` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTaskCount` (r:1 w:1) /// Proof: `Tasks::ShardTaskCount` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::Tasks` (r:1 w:0) /// Proof: `Tasks::Tasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Shards::ShardCommitment` (r:1500 w:0) + /// Storage: `Shards::ShardCommitment` (r:500 w:0) /// Proof: `Shards::ShardCommitment` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardRegistered` (r:1 w:0) /// Proof: `Tasks::ShardRegistered` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTasks` (r:0 w:1) /// Proof: `Tasks::ShardTasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[1, 1500]`. - /// The range of component `b` is `[1, 1500]`. + /// The range of component `b` is `[1, 500]`. + /// The range of component `b` is `[1, 500]`. fn schedule_tasks(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2647 + b * (92 ±0)` - // Estimated: `8309 + b * (2568 ±0)` - // Minimum execution time: 60_634_000 picoseconds. - Weight::from_parts(114_509_910, 0) - .saturating_add(Weight::from_parts(0, 8309)) - // Standard Error: 21_464 - .saturating_add(Weight::from_parts(10_781_369, 0).saturating_mul(b.into())) + // Measured: `1538 + b * (95 ±0)` + // Estimated: `7370 + b * (2571 ±0)` + // Minimum execution time: 61_554_000 picoseconds. + Weight::from_parts(63_880_000, 0) + .saturating_add(Weight::from_parts(0, 7370)) + // Standard Error: 18_869 + .saturating_add(Weight::from_parts(10_351_774, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 2568).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 2571).saturating_mul(b.into())) } /// Storage: `Tasks::ReadEventsTask` (r:2 w:0) /// Proof: `Tasks::ReadEventsTask` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 25_498_000 picoseconds. - Weight::from_parts(45_985_582, 0) + // Minimum execution time: 24_556_000 picoseconds. + Weight::from_parts(44_402_949, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 473 - .saturating_add(Weight::from_parts(14_981, 0).saturating_mul(b.into())) + // Standard Error: 393 + .saturating_add(Weight::from_parts(12_472, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/mainnet/src/weights/timegraph.rs b/runtimes/mainnet/src/weights/timegraph.rs index 6c8c6b073..64e82ae6c 100644 --- a/runtimes/mainnet/src/weights/timegraph.rs +++ b/runtimes/mainnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -39,8 +39,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 33_403_000 picoseconds. - Weight::from_parts(52_739_000, 0) + // Minimum execution time: 50_324_000 picoseconds. + Weight::from_parts(52_497_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -53,8 +53,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 33_683_000 picoseconds. - Weight::from_parts(43_631_000, 0) + // Minimum execution time: 51_376_000 picoseconds. + Weight::from_parts(53_188_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -69,8 +69,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `272` // Estimated: `6196` - // Minimum execution time: 84_116_000 picoseconds. - Weight::from_parts(87_223_000, 0) + // Minimum execution time: 128_610_000 picoseconds. + Weight::from_parts(134_261_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -85,8 +85,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3593` - // Minimum execution time: 81_122_000 picoseconds. - Weight::from_parts(83_175_000, 0) + // Minimum execution time: 123_631_000 picoseconds. + Weight::from_parts(129_832_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_436_000 picoseconds. - Weight::from_parts(10_149_000, 0) + // Minimum execution time: 14_417_000 picoseconds. + Weight::from_parts(15_609_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,8 +109,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_358_000 picoseconds. - Weight::from_parts(9_959_000, 0) + // Minimum execution time: 14_647_000 picoseconds. + Weight::from_parts(15_689_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_207_000 picoseconds. - Weight::from_parts(10_490_000, 0) + // Minimum execution time: 14_036_000 picoseconds. + Weight::from_parts(15_079_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtimes/testnet/src/weights/dmail.rs b/runtimes/testnet/src/weights/dmail.rs index 4f219fcc6..dc121157d 100644 --- a/runtimes/testnet/src/weights/dmail.rs +++ b/runtimes/testnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,12 +41,12 @@ impl pallet_dmail::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_665_000 picoseconds. - Weight::from_parts(7_586_366, 0) + // Minimum execution time: 7_895_000 picoseconds. + Weight::from_parts(8_328_656, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 20 - .saturating_add(Weight::from_parts(729, 0).saturating_mul(a.into())) - // Standard Error: 20 - .saturating_add(Weight::from_parts(761, 0).saturating_mul(b.into())) + // Standard Error: 53 + .saturating_add(Weight::from_parts(984, 0).saturating_mul(a.into())) + // Standard Error: 53 + .saturating_add(Weight::from_parts(279, 0).saturating_mul(b.into())) } } diff --git a/runtimes/testnet/src/weights/elections.rs b/runtimes/testnet/src/weights/elections.rs index 99a7d198f..cc32eb83f 100644 --- a/runtimes/testnet/src/weights/elections.rs +++ b/runtimes/testnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 11_932_000 picoseconds. - Weight::from_parts(12_644_000, 0) + // Minimum execution time: 12_604_000 picoseconds. + Weight::from_parts(14_397_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/testnet/src/weights/members.rs b/runtimes/testnet/src/weights/members.rs index 777305a43..e3bc24cce 100644 --- a/runtimes/testnet/src/weights/members.rs +++ b/runtimes/testnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 61_785_000 picoseconds. - Weight::from_parts(63_699_000, 0) + // Minimum execution time: 63_840_000 picoseconds. + Weight::from_parts(67_827_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 21_852_000 picoseconds. - Weight::from_parts(23_134_000, 0) + // Minimum execution time: 22_533_000 picoseconds. + Weight::from_parts(24_546_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 56_034_000 picoseconds. - Weight::from_parts(57_978_000, 0) + // Minimum execution time: 57_988_000 picoseconds. + Weight::from_parts(60_923_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/testnet/src/weights/networks.rs b/runtimes/testnet/src/weights/networks.rs index e5eb2bf7a..473f2f519 100644 --- a/runtimes/testnet/src/weights/networks.rs +++ b/runtimes/testnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -67,13 +67,13 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 59_872_000 picoseconds. - Weight::from_parts(61_803_066, 0) + // Minimum execution time: 56_837_000 picoseconds. + Weight::from_parts(59_053_203, 0) .saturating_add(Weight::from_parts(0, 3583)) - // Standard Error: 166 - .saturating_add(Weight::from_parts(3_245, 0).saturating_mul(a.into())) - // Standard Error: 166 - .saturating_add(Weight::from_parts(745, 0).saturating_mul(b.into())) + // Standard Error: 89 + .saturating_add(Weight::from_parts(881, 0).saturating_mul(a.into())) + // Standard Error: 89 + .saturating_add(Weight::from_parts(1_108, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -91,8 +91,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 22_693_000 picoseconds. - Weight::from_parts(23_674_000, 0) + // Minimum execution time: 21_872_000 picoseconds. + Weight::from_parts(22_502_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/testnet/src/weights/shards.rs b/runtimes/testnet/src/weights/shards.rs index dc3b6ee24..971d9af4f 100644 --- a/runtimes/testnet/src/weights/shards.rs +++ b/runtimes/testnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 515_706_000 picoseconds. - Weight::from_parts(523_459_000, 0) + // Minimum execution time: 515_915_000 picoseconds. + Weight::from_parts(525_763_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 59_541_000 picoseconds. - Weight::from_parts(61_636_000, 0) + // Minimum execution time: 60_874_000 picoseconds. + Weight::from_parts(64_801_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 70_832_000 picoseconds. - Weight::from_parts(73_588_000, 0) + // Minimum execution time: 72_396_000 picoseconds. + Weight::from_parts(127_308_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_496_000 picoseconds. - Weight::from_parts(3_687_000, 0) + // Minimum execution time: 3_667_000 picoseconds. + Weight::from_parts(5_731_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/testnet/src/weights/tasks.rs b/runtimes/testnet/src/weights/tasks.rs index 5a1c02ba5..b95520f0b 100644 --- a/runtimes/testnet/src/weights/tasks.rs +++ b/runtimes/testnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 646_580_000 picoseconds. - Weight::from_parts(672_679_000, 0) + // Minimum execution time: 625_159_000 picoseconds. + Weight::from_parts(653_221_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -81,33 +81,33 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// Proof: `Networks::NetworkShardTaskLimit` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::TaskShard` (r:1 w:1) /// Proof: `Tasks::TaskShard` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tasks::NetworkShards` (r:1501 w:0) + /// Storage: `Tasks::NetworkShards` (r:501 w:0) /// Proof: `Tasks::NetworkShards` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTaskCount` (r:1 w:1) /// Proof: `Tasks::ShardTaskCount` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::Tasks` (r:1 w:0) /// Proof: `Tasks::Tasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Shards::ShardCommitment` (r:1500 w:0) + /// Storage: `Shards::ShardCommitment` (r:500 w:0) /// Proof: `Shards::ShardCommitment` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardRegistered` (r:1 w:0) /// Proof: `Tasks::ShardRegistered` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTasks` (r:0 w:1) /// Proof: `Tasks::ShardTasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[1, 1500]`. - /// The range of component `b` is `[1, 1500]`. + /// The range of component `b` is `[1, 500]`. + /// The range of component `b` is `[1, 500]`. fn schedule_tasks(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2647 + b * (92 ±0)` - // Estimated: `8309 + b * (2568 ±0)` - // Minimum execution time: 61_084_000 picoseconds. - Weight::from_parts(63_669_000, 0) - .saturating_add(Weight::from_parts(0, 8309)) - // Standard Error: 11_922 - .saturating_add(Weight::from_parts(10_867_418, 0).saturating_mul(b.into())) + // Measured: `1538 + b * (95 ±0)` + // Estimated: `7370 + b * (2571 ±0)` + // Minimum execution time: 61_054_000 picoseconds. + Weight::from_parts(14_986_812, 0) + .saturating_add(Weight::from_parts(0, 7370)) + // Standard Error: 17_631 + .saturating_add(Weight::from_parts(10_764_711, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 2568).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 2571).saturating_mul(b.into())) } /// Storage: `Tasks::ReadEventsTask` (r:2 w:0) /// Proof: `Tasks::ReadEventsTask` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 26_189_000 picoseconds. - Weight::from_parts(50_373_476, 0) + // Minimum execution time: 25_388_000 picoseconds. + Weight::from_parts(42_950_330, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 429 - .saturating_add(Weight::from_parts(7_792, 0).saturating_mul(b.into())) + // Standard Error: 419 + .saturating_add(Weight::from_parts(17_692, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/testnet/src/weights/timegraph.rs b/runtimes/testnet/src/weights/timegraph.rs index 0b4f70af1..fbe29dbb6 100644 --- a/runtimes/testnet/src/weights/timegraph.rs +++ b/runtimes/testnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -39,8 +39,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 32_902_000 picoseconds. - Weight::from_parts(50_434_000, 0) + // Minimum execution time: 31_819_000 picoseconds. + Weight::from_parts(33_182_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -53,8 +53,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 33_113_000 picoseconds. - Weight::from_parts(53_590_000, 0) + // Minimum execution time: 31_739_000 picoseconds. + Weight::from_parts(33_823_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -69,8 +69,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `272` // Estimated: `6196` - // Minimum execution time: 83_225_000 picoseconds. - Weight::from_parts(87_904_000, 0) + // Minimum execution time: 80_731_000 picoseconds. + Weight::from_parts(83_156_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -85,8 +85,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3593` - // Minimum execution time: 81_053_000 picoseconds. - Weight::from_parts(84_729_000, 0) + // Minimum execution time: 77_937_000 picoseconds. + Weight::from_parts(79_698_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_307_000 picoseconds. - Weight::from_parts(9_999_000, 0) + // Minimum execution time: 9_067_000 picoseconds. + Weight::from_parts(9_758_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,8 +109,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_447_000 picoseconds. - Weight::from_parts(10_420_000, 0) + // Minimum execution time: 8_997_000 picoseconds. + Weight::from_parts(9_768_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_147_000 picoseconds. - Weight::from_parts(10_890_000, 0) + // Minimum execution time: 8_897_000 picoseconds. + Weight::from_parts(9_308_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) From d686fde288a55ad8b12e20825cd38519c568a733 Mon Sep 17 00:00:00 2001 From: Github Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 05:12:42 +0000 Subject: [PATCH 28/31] runtimes: update pallet weights --- runtimes/mainnet/src/weights/dmail.rs | 12 ++++++---- runtimes/mainnet/src/weights/elections.rs | 4 ++-- runtimes/mainnet/src/weights/members.rs | 12 +++++----- runtimes/mainnet/src/weights/networks.rs | 12 ++++------ runtimes/mainnet/src/weights/shards.rs | 16 ++++++------- runtimes/mainnet/src/weights/tasks.rs | 20 ++++++++-------- runtimes/mainnet/src/weights/timegraph.rs | 28 +++++++++++------------ runtimes/testnet/src/weights/dmail.rs | 12 +++++----- runtimes/testnet/src/weights/elections.rs | 4 ++-- runtimes/testnet/src/weights/members.rs | 12 +++++----- runtimes/testnet/src/weights/networks.rs | 16 ++++++------- runtimes/testnet/src/weights/shards.rs | 16 ++++++------- runtimes/testnet/src/weights/tasks.rs | 20 ++++++++-------- runtimes/testnet/src/weights/timegraph.rs | 28 +++++++++++------------ 14 files changed, 106 insertions(+), 106 deletions(-) diff --git a/runtimes/mainnet/src/weights/dmail.rs b/runtimes/mainnet/src/weights/dmail.rs index e3191cb55..02b724486 100644 --- a/runtimes/mainnet/src/weights/dmail.rs +++ b/runtimes/mainnet/src/weights/dmail.rs @@ -37,14 +37,16 @@ impl pallet_dmail::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 1000]`. /// The range of component `a` is `[1, 1000]`. /// The range of component `b` is `[1, 1000]`. - fn send_email(_a: u32, b: u32, ) -> Weight { + fn send_email(a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_835_000 picoseconds. - Weight::from_parts(10_963_473, 0) + // Minimum execution time: 7_955_000 picoseconds. + Weight::from_parts(8_837_643, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 100 - .saturating_add(Weight::from_parts(349, 0).saturating_mul(b.into())) + // Standard Error: 61 + .saturating_add(Weight::from_parts(714, 0).saturating_mul(a.into())) + // Standard Error: 61 + .saturating_add(Weight::from_parts(247, 0).saturating_mul(b.into())) } } diff --git a/runtimes/mainnet/src/weights/elections.rs b/runtimes/mainnet/src/weights/elections.rs index 7d21fa611..6812fe898 100644 --- a/runtimes/mainnet/src/weights/elections.rs +++ b/runtimes/mainnet/src/weights/elections.rs @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_984_000 picoseconds. - Weight::from_parts(20_489_000, 0) + // Minimum execution time: 12_253_000 picoseconds. + Weight::from_parts(20_789_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/mainnet/src/weights/members.rs b/runtimes/mainnet/src/weights/members.rs index c20598d02..bbf52f5c5 100644 --- a/runtimes/mainnet/src/weights/members.rs +++ b/runtimes/mainnet/src/weights/members.rs @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 62_717_000 picoseconds. - Weight::from_parts(81_002_000, 0) + // Minimum execution time: 66_505_000 picoseconds. + Weight::from_parts(69_059_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 22_051_000 picoseconds. - Weight::from_parts(22_923_000, 0) + // Minimum execution time: 23_083_000 picoseconds. + Weight::from_parts(30_076_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 57_487_000 picoseconds. - Weight::from_parts(59_472_000, 0) + // Minimum execution time: 60_665_000 picoseconds. + Weight::from_parts(62_377_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/mainnet/src/weights/networks.rs b/runtimes/mainnet/src/weights/networks.rs index def6c1986..4c88d6895 100644 --- a/runtimes/mainnet/src/weights/networks.rs +++ b/runtimes/mainnet/src/weights/networks.rs @@ -63,15 +63,13 @@ impl pallet_networks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 1000]`. /// The range of component `a` is `[1, 1000]`. /// The range of component `b` is `[1, 1000]`. - fn register_network(a: u32, _b: u32, ) -> Weight { + fn register_network(_a: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 57_157_000 picoseconds. - Weight::from_parts(62_477_900, 0) + // Minimum execution time: 55_694_000 picoseconds. + Weight::from_parts(71_347_478, 0) .saturating_add(Weight::from_parts(0, 3583)) - // Standard Error: 483 - .saturating_add(Weight::from_parts(1_292, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -89,8 +87,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 22_021_000 picoseconds. - Weight::from_parts(23_624_000, 0) + // Minimum execution time: 20_989_000 picoseconds. + Weight::from_parts(21_901_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/mainnet/src/weights/shards.rs b/runtimes/mainnet/src/weights/shards.rs index e96fc76f1..40611f07a 100644 --- a/runtimes/mainnet/src/weights/shards.rs +++ b/runtimes/mainnet/src/weights/shards.rs @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 521_605_000 picoseconds. - Weight::from_parts(537_745_000, 0) + // Minimum execution time: 517_398_000 picoseconds. + Weight::from_parts(746_196_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 64_240_000 picoseconds. - Weight::from_parts(67_827_000, 0) + // Minimum execution time: 60_784_000 picoseconds. + Weight::from_parts(73_346_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 76_443_000 picoseconds. - Weight::from_parts(79_379_000, 0) + // Minimum execution time: 73_308_000 picoseconds. + Weight::from_parts(76_554_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_787_000 picoseconds. - Weight::from_parts(3_937_000, 0) + // Minimum execution time: 3_537_000 picoseconds. + Weight::from_parts(3_736_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/mainnet/src/weights/tasks.rs b/runtimes/mainnet/src/weights/tasks.rs index 426371392..aeabcad9a 100644 --- a/runtimes/mainnet/src/weights/tasks.rs +++ b/runtimes/mainnet/src/weights/tasks.rs @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 632_974_000 picoseconds. - Weight::from_parts(660_074_000, 0) + // Minimum execution time: 631_372_000 picoseconds. + Weight::from_parts(842_857_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -99,11 +99,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1538 + b * (95 ±0)` // Estimated: `7370 + b * (2571 ±0)` - // Minimum execution time: 61_554_000 picoseconds. - Weight::from_parts(63_880_000, 0) + // Minimum execution time: 59_692_000 picoseconds. + Weight::from_parts(27_419_135, 0) .saturating_add(Weight::from_parts(0, 7370)) - // Standard Error: 18_869 - .saturating_add(Weight::from_parts(10_351_774, 0).saturating_mul(b.into())) + // Standard Error: 12_883 + .saturating_add(Weight::from_parts(10_370_094, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 24_556_000 picoseconds. - Weight::from_parts(44_402_949, 0) + // Minimum execution time: 24_476_000 picoseconds. + Weight::from_parts(42_860_431, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 393 - .saturating_add(Weight::from_parts(12_472, 0).saturating_mul(b.into())) + // Standard Error: 401 + .saturating_add(Weight::from_parts(15_528, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/mainnet/src/weights/timegraph.rs b/runtimes/mainnet/src/weights/timegraph.rs index 64e82ae6c..bd6061f17 100644 --- a/runtimes/mainnet/src/weights/timegraph.rs +++ b/runtimes/mainnet/src/weights/timegraph.rs @@ -39,8 +39,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 50_324_000 picoseconds. - Weight::from_parts(52_497_000, 0) + // Minimum execution time: 34_825_000 picoseconds. + Weight::from_parts(37_641_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -53,8 +53,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 51_376_000 picoseconds. - Weight::from_parts(53_188_000, 0) + // Minimum execution time: 35_066_000 picoseconds. + Weight::from_parts(37_440_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -69,8 +69,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `272` // Estimated: `6196` - // Minimum execution time: 128_610_000 picoseconds. - Weight::from_parts(134_261_000, 0) + // Minimum execution time: 89_207_000 picoseconds. + Weight::from_parts(94_487_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -85,8 +85,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3593` - // Minimum execution time: 123_631_000 picoseconds. - Weight::from_parts(129_832_000, 0) + // Minimum execution time: 86_251_000 picoseconds. + Weight::from_parts(89_177_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 14_417_000 picoseconds. - Weight::from_parts(15_609_000, 0) + // Minimum execution time: 9_928_000 picoseconds. + Weight::from_parts(15_729_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,8 +109,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 14_647_000 picoseconds. - Weight::from_parts(15_689_000, 0) + // Minimum execution time: 9_969_000 picoseconds. + Weight::from_parts(13_095_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 14_036_000 picoseconds. - Weight::from_parts(15_079_000, 0) + // Minimum execution time: 9_478_000 picoseconds. + Weight::from_parts(15_059_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtimes/testnet/src/weights/dmail.rs b/runtimes/testnet/src/weights/dmail.rs index dc121157d..641b92c0a 100644 --- a/runtimes/testnet/src/weights/dmail.rs +++ b/runtimes/testnet/src/weights/dmail.rs @@ -41,12 +41,12 @@ impl pallet_dmail::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_895_000 picoseconds. - Weight::from_parts(8_328_656, 0) + // Minimum execution time: 7_915_000 picoseconds. + Weight::from_parts(7_886_389, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 53 - .saturating_add(Weight::from_parts(984, 0).saturating_mul(a.into())) - // Standard Error: 53 - .saturating_add(Weight::from_parts(279, 0).saturating_mul(b.into())) + // Standard Error: 43 + .saturating_add(Weight::from_parts(760, 0).saturating_mul(a.into())) + // Standard Error: 43 + .saturating_add(Weight::from_parts(935, 0).saturating_mul(b.into())) } } diff --git a/runtimes/testnet/src/weights/elections.rs b/runtimes/testnet/src/weights/elections.rs index cc32eb83f..86fbb9670 100644 --- a/runtimes/testnet/src/weights/elections.rs +++ b/runtimes/testnet/src/weights/elections.rs @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_604_000 picoseconds. - Weight::from_parts(14_397_000, 0) + // Minimum execution time: 12_073_000 picoseconds. + Weight::from_parts(12_634_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/testnet/src/weights/members.rs b/runtimes/testnet/src/weights/members.rs index e3bc24cce..e87b2d3c2 100644 --- a/runtimes/testnet/src/weights/members.rs +++ b/runtimes/testnet/src/weights/members.rs @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 63_840_000 picoseconds. - Weight::from_parts(67_827_000, 0) + // Minimum execution time: 61_465_000 picoseconds. + Weight::from_parts(63_729_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 22_533_000 picoseconds. - Weight::from_parts(24_546_000, 0) + // Minimum execution time: 21_962_000 picoseconds. + Weight::from_parts(22_683_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 57_988_000 picoseconds. - Weight::from_parts(60_923_000, 0) + // Minimum execution time: 57_217_000 picoseconds. + Weight::from_parts(61_965_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/testnet/src/weights/networks.rs b/runtimes/testnet/src/weights/networks.rs index 473f2f519..ba5dee605 100644 --- a/runtimes/testnet/src/weights/networks.rs +++ b/runtimes/testnet/src/weights/networks.rs @@ -67,13 +67,13 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 56_837_000 picoseconds. - Weight::from_parts(59_053_203, 0) + // Minimum execution time: 55_464_000 picoseconds. + Weight::from_parts(65_293_737, 0) .saturating_add(Weight::from_parts(0, 3583)) - // Standard Error: 89 - .saturating_add(Weight::from_parts(881, 0).saturating_mul(a.into())) - // Standard Error: 89 - .saturating_add(Weight::from_parts(1_108, 0).saturating_mul(b.into())) + // Standard Error: 1_059 + .saturating_add(Weight::from_parts(2_603, 0).saturating_mul(a.into())) + // Standard Error: 1_059 + .saturating_add(Weight::from_parts(1_187, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -91,8 +91,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 21_872_000 picoseconds. - Weight::from_parts(22_502_000, 0) + // Minimum execution time: 20_939_000 picoseconds. + Weight::from_parts(22_041_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/testnet/src/weights/shards.rs b/runtimes/testnet/src/weights/shards.rs index 971d9af4f..af86b0140 100644 --- a/runtimes/testnet/src/weights/shards.rs +++ b/runtimes/testnet/src/weights/shards.rs @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 515_915_000 picoseconds. - Weight::from_parts(525_763_000, 0) + // Minimum execution time: 516_066_000 picoseconds. + Weight::from_parts(536_683_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 60_874_000 picoseconds. - Weight::from_parts(64_801_000, 0) + // Minimum execution time: 59_851_000 picoseconds. + Weight::from_parts(63_058_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 72_396_000 picoseconds. - Weight::from_parts(127_308_000, 0) + // Minimum execution time: 72_617_000 picoseconds. + Weight::from_parts(74_599_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_667_000 picoseconds. - Weight::from_parts(5_731_000, 0) + // Minimum execution time: 3_367_000 picoseconds. + Weight::from_parts(3_707_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/testnet/src/weights/tasks.rs b/runtimes/testnet/src/weights/tasks.rs index b95520f0b..5ec957e7b 100644 --- a/runtimes/testnet/src/weights/tasks.rs +++ b/runtimes/testnet/src/weights/tasks.rs @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 625_159_000 picoseconds. - Weight::from_parts(653_221_000, 0) + // Minimum execution time: 620_210_000 picoseconds. + Weight::from_parts(638_555_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -99,11 +99,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1538 + b * (95 ±0)` // Estimated: `7370 + b * (2571 ±0)` - // Minimum execution time: 61_054_000 picoseconds. - Weight::from_parts(14_986_812, 0) + // Minimum execution time: 58_780_000 picoseconds. + Weight::from_parts(60_031_000, 0) .saturating_add(Weight::from_parts(0, 7370)) - // Standard Error: 17_631 - .saturating_add(Weight::from_parts(10_764_711, 0).saturating_mul(b.into())) + // Standard Error: 9_941 + .saturating_add(Weight::from_parts(10_261_898, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 25_388_000 picoseconds. - Weight::from_parts(42_950_330, 0) + // Minimum execution time: 25_498_000 picoseconds. + Weight::from_parts(42_079_227, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 419 - .saturating_add(Weight::from_parts(17_692, 0).saturating_mul(b.into())) + // Standard Error: 371 + .saturating_add(Weight::from_parts(16_203, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/testnet/src/weights/timegraph.rs b/runtimes/testnet/src/weights/timegraph.rs index fbe29dbb6..082fd2267 100644 --- a/runtimes/testnet/src/weights/timegraph.rs +++ b/runtimes/testnet/src/weights/timegraph.rs @@ -39,8 +39,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 31_819_000 picoseconds. - Weight::from_parts(33_182_000, 0) + // Minimum execution time: 32_973_000 picoseconds. + Weight::from_parts(35_586_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -53,8 +53,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 31_739_000 picoseconds. - Weight::from_parts(33_823_000, 0) + // Minimum execution time: 33_142_000 picoseconds. + Weight::from_parts(35_687_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -69,8 +69,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `272` // Estimated: `6196` - // Minimum execution time: 80_731_000 picoseconds. - Weight::from_parts(83_156_000, 0) + // Minimum execution time: 85_290_000 picoseconds. + Weight::from_parts(88_756_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -85,8 +85,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3593` - // Minimum execution time: 77_937_000 picoseconds. - Weight::from_parts(79_698_000, 0) + // Minimum execution time: 82_194_000 picoseconds. + Weight::from_parts(84_709_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_067_000 picoseconds. - Weight::from_parts(9_758_000, 0) + // Minimum execution time: 9_748_000 picoseconds. + Weight::from_parts(15_919_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,8 +109,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 8_997_000 picoseconds. - Weight::from_parts(9_768_000, 0) + // Minimum execution time: 9_647_000 picoseconds. + Weight::from_parts(14_376_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 8_897_000 picoseconds. - Weight::from_parts(9_308_000, 0) + // Minimum execution time: 9_409_000 picoseconds. + Weight::from_parts(10_529_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) From 92de18119a39a4041a55c39e77db914cffa39c41 Mon Sep 17 00:00:00 2001 From: Github Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 04:46:02 +0000 Subject: [PATCH 29/31] runtimes: update pallet weights --- runtimes/mainnet/src/weights/dmail.rs | 14 +++++------ runtimes/mainnet/src/weights/elections.rs | 6 ++--- runtimes/mainnet/src/weights/members.rs | 14 +++++------ runtimes/mainnet/src/weights/networks.rs | 16 +++++++----- runtimes/mainnet/src/weights/shards.rs | 18 +++++++------- runtimes/mainnet/src/weights/tasks.rs | 22 ++++++++--------- runtimes/mainnet/src/weights/timegraph.rs | 30 +++++++++++------------ runtimes/testnet/src/weights/dmail.rs | 14 +++++------ runtimes/testnet/src/weights/elections.rs | 6 ++--- runtimes/testnet/src/weights/members.rs | 14 +++++------ runtimes/testnet/src/weights/networks.rs | 16 ++++++------ runtimes/testnet/src/weights/shards.rs | 18 +++++++------- runtimes/testnet/src/weights/tasks.rs | 22 ++++++++--------- runtimes/testnet/src/weights/timegraph.rs | 30 +++++++++++------------ 14 files changed, 121 insertions(+), 119 deletions(-) diff --git a/runtimes/mainnet/src/weights/dmail.rs b/runtimes/mainnet/src/weights/dmail.rs index 02b724486..e3b99ac25 100644 --- a/runtimes/mainnet/src/weights/dmail.rs +++ b/runtimes/mainnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,12 +41,12 @@ impl pallet_dmail::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_955_000 picoseconds. - Weight::from_parts(8_837_643, 0) + // Minimum execution time: 7_805_000 picoseconds. + Weight::from_parts(8_157_912, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 61 - .saturating_add(Weight::from_parts(714, 0).saturating_mul(a.into())) - // Standard Error: 61 - .saturating_add(Weight::from_parts(247, 0).saturating_mul(b.into())) + // Standard Error: 29 + .saturating_add(Weight::from_parts(695, 0).saturating_mul(a.into())) + // Standard Error: 29 + .saturating_add(Weight::from_parts(384, 0).saturating_mul(b.into())) } } diff --git a/runtimes/mainnet/src/weights/elections.rs b/runtimes/mainnet/src/weights/elections.rs index 6812fe898..11835dc7b 100644 --- a/runtimes/mainnet/src/weights/elections.rs +++ b/runtimes/mainnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_253_000 picoseconds. - Weight::from_parts(20_789_000, 0) + // Minimum execution time: 11_521_000 picoseconds. + Weight::from_parts(12_203_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/mainnet/src/weights/members.rs b/runtimes/mainnet/src/weights/members.rs index bbf52f5c5..642daa4de 100644 --- a/runtimes/mainnet/src/weights/members.rs +++ b/runtimes/mainnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 66_505_000 picoseconds. - Weight::from_parts(69_059_000, 0) + // Minimum execution time: 60_904_000 picoseconds. + Weight::from_parts(64_029_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 23_083_000 picoseconds. - Weight::from_parts(30_076_000, 0) + // Minimum execution time: 21_500_000 picoseconds. + Weight::from_parts(22_612_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 60_665_000 picoseconds. - Weight::from_parts(62_377_000, 0) + // Minimum execution time: 55_183_000 picoseconds. + Weight::from_parts(57_087_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/mainnet/src/weights/networks.rs b/runtimes/mainnet/src/weights/networks.rs index 4c88d6895..7a12e4526 100644 --- a/runtimes/mainnet/src/weights/networks.rs +++ b/runtimes/mainnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -63,13 +63,17 @@ impl pallet_networks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 1000]`. /// The range of component `a` is `[1, 1000]`. /// The range of component `b` is `[1, 1000]`. - fn register_network(_a: u32, _b: u32, ) -> Weight { + fn register_network(a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 55_694_000 picoseconds. - Weight::from_parts(71_347_478, 0) + // Minimum execution time: 55_012_000 picoseconds. + Weight::from_parts(58_699_969, 0) .saturating_add(Weight::from_parts(0, 3583)) + // Standard Error: 580 + .saturating_add(Weight::from_parts(2_086, 0).saturating_mul(a.into())) + // Standard Error: 580 + .saturating_add(Weight::from_parts(3_206, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -87,8 +91,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 20_989_000 picoseconds. - Weight::from_parts(21_901_000, 0) + // Minimum execution time: 22_041_000 picoseconds. + Weight::from_parts(23_965_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/mainnet/src/weights/shards.rs b/runtimes/mainnet/src/weights/shards.rs index 40611f07a..ca65e3c39 100644 --- a/runtimes/mainnet/src/weights/shards.rs +++ b/runtimes/mainnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 517_398_000 picoseconds. - Weight::from_parts(746_196_000, 0) + // Minimum execution time: 528_699_000 picoseconds. + Weight::from_parts(571_559_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 60_784_000 picoseconds. - Weight::from_parts(73_346_000, 0) + // Minimum execution time: 63_910_000 picoseconds. + Weight::from_parts(67_085_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 73_308_000 picoseconds. - Weight::from_parts(76_554_000, 0) + // Minimum execution time: 78_015_000 picoseconds. + Weight::from_parts(82_375_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_537_000 picoseconds. - Weight::from_parts(3_736_000, 0) + // Minimum execution time: 3_837_000 picoseconds. + Weight::from_parts(4_078_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/mainnet/src/weights/tasks.rs b/runtimes/mainnet/src/weights/tasks.rs index aeabcad9a..ca7104c76 100644 --- a/runtimes/mainnet/src/weights/tasks.rs +++ b/runtimes/mainnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 631_372_000 picoseconds. - Weight::from_parts(842_857_000, 0) + // Minimum execution time: 653_392_000 picoseconds. + Weight::from_parts(680_543_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -99,11 +99,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1538 + b * (95 ±0)` // Estimated: `7370 + b * (2571 ±0)` - // Minimum execution time: 59_692_000 picoseconds. - Weight::from_parts(27_419_135, 0) + // Minimum execution time: 62_067_000 picoseconds. + Weight::from_parts(5_317_421, 0) .saturating_add(Weight::from_parts(0, 7370)) - // Standard Error: 12_883 - .saturating_add(Weight::from_parts(10_370_094, 0).saturating_mul(b.into())) + // Standard Error: 19_805 + .saturating_add(Weight::from_parts(11_326_063, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 24_476_000 picoseconds. - Weight::from_parts(42_860_431, 0) + // Minimum execution time: 25_527_000 picoseconds. + Weight::from_parts(44_372_064, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 401 - .saturating_add(Weight::from_parts(15_528, 0).saturating_mul(b.into())) + // Standard Error: 277 + .saturating_add(Weight::from_parts(12_076, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/mainnet/src/weights/timegraph.rs b/runtimes/mainnet/src/weights/timegraph.rs index bd6061f17..d08babf14 100644 --- a/runtimes/mainnet/src/weights/timegraph.rs +++ b/runtimes/mainnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -39,8 +39,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 34_825_000 picoseconds. - Weight::from_parts(37_641_000, 0) + // Minimum execution time: 30_667_000 picoseconds. + Weight::from_parts(32_190_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -53,8 +53,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 35_066_000 picoseconds. - Weight::from_parts(37_440_000, 0) + // Minimum execution time: 31_288_000 picoseconds. + Weight::from_parts(32_721_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -69,8 +69,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `272` // Estimated: `6196` - // Minimum execution time: 89_207_000 picoseconds. - Weight::from_parts(94_487_000, 0) + // Minimum execution time: 78_747_000 picoseconds. + Weight::from_parts(81_072_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -85,8 +85,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3593` - // Minimum execution time: 86_251_000 picoseconds. - Weight::from_parts(89_177_000, 0) + // Minimum execution time: 75_582_000 picoseconds. + Weight::from_parts(78_016_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_928_000 picoseconds. - Weight::from_parts(15_729_000, 0) + // Minimum execution time: 8_948_000 picoseconds. + Weight::from_parts(9_707_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,8 +109,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_969_000 picoseconds. - Weight::from_parts(13_095_000, 0) + // Minimum execution time: 9_207_000 picoseconds. + Weight::from_parts(9_739_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_478_000 picoseconds. - Weight::from_parts(15_059_000, 0) + // Minimum execution time: 8_657_000 picoseconds. + Weight::from_parts(9_538_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtimes/testnet/src/weights/dmail.rs b/runtimes/testnet/src/weights/dmail.rs index 641b92c0a..8ee8cd2be 100644 --- a/runtimes/testnet/src/weights/dmail.rs +++ b/runtimes/testnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,12 +41,12 @@ impl pallet_dmail::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_915_000 picoseconds. - Weight::from_parts(7_886_389, 0) + // Minimum execution time: 7_754_000 picoseconds. + Weight::from_parts(8_010_406, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 43 - .saturating_add(Weight::from_parts(760, 0).saturating_mul(a.into())) - // Standard Error: 43 - .saturating_add(Weight::from_parts(935, 0).saturating_mul(b.into())) + // Standard Error: 40 + .saturating_add(Weight::from_parts(756, 0).saturating_mul(a.into())) + // Standard Error: 40 + .saturating_add(Weight::from_parts(727, 0).saturating_mul(b.into())) } } diff --git a/runtimes/testnet/src/weights/elections.rs b/runtimes/testnet/src/weights/elections.rs index 86fbb9670..68532fbb4 100644 --- a/runtimes/testnet/src/weights/elections.rs +++ b/runtimes/testnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_073_000 picoseconds. - Weight::from_parts(12_634_000, 0) + // Minimum execution time: 11_973_000 picoseconds. + Weight::from_parts(12_623_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/testnet/src/weights/members.rs b/runtimes/testnet/src/weights/members.rs index e87b2d3c2..4d01940a9 100644 --- a/runtimes/testnet/src/weights/members.rs +++ b/runtimes/testnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 61_465_000 picoseconds. - Weight::from_parts(63_729_000, 0) + // Minimum execution time: 60_634_000 picoseconds. + Weight::from_parts(62_396_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 21_962_000 picoseconds. - Weight::from_parts(22_683_000, 0) + // Minimum execution time: 21_510_000 picoseconds. + Weight::from_parts(22_641_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 57_217_000 picoseconds. - Weight::from_parts(61_965_000, 0) + // Minimum execution time: 55_404_000 picoseconds. + Weight::from_parts(58_059_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/testnet/src/weights/networks.rs b/runtimes/testnet/src/weights/networks.rs index ba5dee605..7ee10078e 100644 --- a/runtimes/testnet/src/weights/networks.rs +++ b/runtimes/testnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -63,17 +63,15 @@ impl pallet_networks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 1000]`. /// The range of component `a` is `[1, 1000]`. /// The range of component `b` is `[1, 1000]`. - fn register_network(a: u32, b: u32, ) -> Weight { + fn register_network(_a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 55_464_000 picoseconds. - Weight::from_parts(65_293_737, 0) + // Minimum execution time: 54_892_000 picoseconds. + Weight::from_parts(57_395_050, 0) .saturating_add(Weight::from_parts(0, 3583)) - // Standard Error: 1_059 - .saturating_add(Weight::from_parts(2_603, 0).saturating_mul(a.into())) - // Standard Error: 1_059 - .saturating_add(Weight::from_parts(1_187, 0).saturating_mul(b.into())) + // Standard Error: 386 + .saturating_add(Weight::from_parts(1_671, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -92,7 +90,7 @@ impl pallet_networks::WeightInfo for WeightInfo { // Measured: `277` // Estimated: `3742` // Minimum execution time: 20_939_000 picoseconds. - Weight::from_parts(22_041_000, 0) + Weight::from_parts(21_751_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/testnet/src/weights/shards.rs b/runtimes/testnet/src/weights/shards.rs index af86b0140..09718c411 100644 --- a/runtimes/testnet/src/weights/shards.rs +++ b/runtimes/testnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 516_066_000 picoseconds. - Weight::from_parts(536_683_000, 0) + // Minimum execution time: 522_116_000 picoseconds. + Weight::from_parts(624_208_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 59_851_000 picoseconds. - Weight::from_parts(63_058_000, 0) + // Minimum execution time: 63_488_000 picoseconds. + Weight::from_parts(70_132_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 72_617_000 picoseconds. - Weight::from_parts(74_599_000, 0) + // Minimum execution time: 77_105_000 picoseconds. + Weight::from_parts(88_846_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_367_000 picoseconds. - Weight::from_parts(3_707_000, 0) + // Minimum execution time: 3_757_000 picoseconds. + Weight::from_parts(4_038_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/testnet/src/weights/tasks.rs b/runtimes/testnet/src/weights/tasks.rs index 5ec957e7b..483a0328f 100644 --- a/runtimes/testnet/src/weights/tasks.rs +++ b/runtimes/testnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 620_210_000 picoseconds. - Weight::from_parts(638_555_000, 0) + // Minimum execution time: 654_504_000 picoseconds. + Weight::from_parts(679_862_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -99,11 +99,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1538 + b * (95 ±0)` // Estimated: `7370 + b * (2571 ±0)` - // Minimum execution time: 58_780_000 picoseconds. - Weight::from_parts(60_031_000, 0) + // Minimum execution time: 63_688_000 picoseconds. + Weight::from_parts(21_728_383, 0) .saturating_add(Weight::from_parts(0, 7370)) - // Standard Error: 9_941 - .saturating_add(Weight::from_parts(10_261_898, 0).saturating_mul(b.into())) + // Standard Error: 10_790 + .saturating_add(Weight::from_parts(11_091_598, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 25_498_000 picoseconds. - Weight::from_parts(42_079_227, 0) + // Minimum execution time: 26_320_000 picoseconds. + Weight::from_parts(45_495_436, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 371 - .saturating_add(Weight::from_parts(16_203, 0).saturating_mul(b.into())) + // Standard Error: 346 + .saturating_add(Weight::from_parts(14_092, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/testnet/src/weights/timegraph.rs b/runtimes/testnet/src/weights/timegraph.rs index 082fd2267..41cc3eb03 100644 --- a/runtimes/testnet/src/weights/timegraph.rs +++ b/runtimes/testnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -39,8 +39,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 32_973_000 picoseconds. - Weight::from_parts(35_586_000, 0) + // Minimum execution time: 34_183_000 picoseconds. + Weight::from_parts(35_997_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -53,8 +53,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 33_142_000 picoseconds. - Weight::from_parts(35_687_000, 0) + // Minimum execution time: 34_496_000 picoseconds. + Weight::from_parts(35_948_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -69,8 +69,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `272` // Estimated: `6196` - // Minimum execution time: 85_290_000 picoseconds. - Weight::from_parts(88_756_000, 0) + // Minimum execution time: 88_575_000 picoseconds. + Weight::from_parts(90_600_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -85,8 +85,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3593` - // Minimum execution time: 82_194_000 picoseconds. - Weight::from_parts(84_709_000, 0) + // Minimum execution time: 85_590_000 picoseconds. + Weight::from_parts(87_453_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_748_000 picoseconds. - Weight::from_parts(15_919_000, 0) + // Minimum execution time: 9_387_000 picoseconds. + Weight::from_parts(9_988_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,8 +109,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_647_000 picoseconds. - Weight::from_parts(14_376_000, 0) + // Minimum execution time: 9_218_000 picoseconds. + Weight::from_parts(9_849_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_409_000 picoseconds. - Weight::from_parts(10_529_000, 0) + // Minimum execution time: 9_117_000 picoseconds. + Weight::from_parts(9_587_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) From eb0b43a95ef532a73b00f1533b4abb25d043e812 Mon Sep 17 00:00:00 2001 From: ana-junius Date: Thu, 17 Oct 2024 13:50:19 +0800 Subject: [PATCH 30/31] remove default value method --- pallets/timegraph/src/lib.rs | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/pallets/timegraph/src/lib.rs b/pallets/timegraph/src/lib.rs index 0462b9aec..5cbcaecc4 100644 --- a/pallets/timegraph/src/lib.rs +++ b/pallets/timegraph/src/lib.rs @@ -86,24 +86,6 @@ pub mod pallet { type InitialRewardPoolAccount: Get; } - /// Default value from runtime configuration - #[pallet::type_value] - pub fn DefaultTimegraphAccount() -> T::AccountId { - T::InitialTimegraphAccount::get() - } - - /// Default value from runtime configuration - #[pallet::type_value] - pub fn DefaultRewardPoolAccount() -> T::AccountId { - T::InitialRewardPoolAccount::get() - } - - /// Default value from runtime configuration - #[pallet::type_value] - pub fn DefaultThreshold() -> BalanceOf { - T::InitialThreshold::get() - } - ///Stores the next deposit sequence number for each account. #[pallet::storage] #[pallet::getter(fn next_deposit_sequence)] @@ -119,16 +101,16 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn timegraph_account)] pub type TimegraphAccount = - StorageValue<_, T::AccountId, ValueQuery, DefaultTimegraphAccount>; + StorageValue<_, T::AccountId, ValueQuery, T::InitialTimegraphAccount>; #[pallet::storage] #[pallet::getter(fn reward_pool_account)] pub type RewardPoolAccount = - StorageValue<_, T::AccountId, ValueQuery, DefaultRewardPoolAccount>; + StorageValue<_, T::AccountId, ValueQuery, T::InitialRewardPoolAccount>; #[pallet::storage] #[pallet::getter(fn threshold)] - pub type Threshold = StorageValue<_, BalanceOf, ValueQuery, DefaultThreshold>; + pub type Threshold = StorageValue<_, BalanceOf, ValueQuery, T::InitialThreshold>; #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] From e2a7728be8059706ef5b20d6553ff47ae16a1872 Mon Sep 17 00:00:00 2001 From: Github Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 06:43:38 +0000 Subject: [PATCH 31/31] runtimes: update pallet weights --- runtimes/mainnet/src/weights/dmail.rs | 14 +++++------ runtimes/mainnet/src/weights/elections.rs | 6 ++--- runtimes/mainnet/src/weights/members.rs | 14 +++++------ runtimes/mainnet/src/weights/networks.rs | 16 +++++------- runtimes/mainnet/src/weights/shards.rs | 18 +++++++------- runtimes/mainnet/src/weights/tasks.rs | 22 ++++++++--------- runtimes/mainnet/src/weights/timegraph.rs | 30 +++++++++++------------ runtimes/testnet/src/weights/dmail.rs | 14 +++++------ runtimes/testnet/src/weights/elections.rs | 6 ++--- runtimes/testnet/src/weights/members.rs | 14 +++++------ runtimes/testnet/src/weights/networks.rs | 18 ++++++++------ runtimes/testnet/src/weights/shards.rs | 18 +++++++------- runtimes/testnet/src/weights/tasks.rs | 22 ++++++++--------- runtimes/testnet/src/weights/timegraph.rs | 30 +++++++++++------------ 14 files changed, 120 insertions(+), 122 deletions(-) diff --git a/runtimes/mainnet/src/weights/dmail.rs b/runtimes/mainnet/src/weights/dmail.rs index e3b99ac25..a6b819c3a 100644 --- a/runtimes/mainnet/src/weights/dmail.rs +++ b/runtimes/mainnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,12 +41,12 @@ impl pallet_dmail::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_805_000 picoseconds. - Weight::from_parts(8_157_912, 0) + // Minimum execution time: 8_055_000 picoseconds. + Weight::from_parts(8_869_443, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 29 - .saturating_add(Weight::from_parts(695, 0).saturating_mul(a.into())) - // Standard Error: 29 - .saturating_add(Weight::from_parts(384, 0).saturating_mul(b.into())) + // Standard Error: 36 + .saturating_add(Weight::from_parts(835, 0).saturating_mul(a.into())) + // Standard Error: 36 + .saturating_add(Weight::from_parts(750, 0).saturating_mul(b.into())) } } diff --git a/runtimes/mainnet/src/weights/elections.rs b/runtimes/mainnet/src/weights/elections.rs index 11835dc7b..acf486b65 100644 --- a/runtimes/mainnet/src/weights/elections.rs +++ b/runtimes/mainnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 11_521_000 picoseconds. - Weight::from_parts(12_203_000, 0) + // Minimum execution time: 12_003_000 picoseconds. + Weight::from_parts(12_654_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/mainnet/src/weights/members.rs b/runtimes/mainnet/src/weights/members.rs index 642daa4de..4017d9419 100644 --- a/runtimes/mainnet/src/weights/members.rs +++ b/runtimes/mainnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 60_904_000 picoseconds. - Weight::from_parts(64_029_000, 0) + // Minimum execution time: 61_975_000 picoseconds. + Weight::from_parts(64_350_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 21_500_000 picoseconds. - Weight::from_parts(22_612_000, 0) + // Minimum execution time: 22_001_000 picoseconds. + Weight::from_parts(23_513_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 55_183_000 picoseconds. - Weight::from_parts(57_087_000, 0) + // Minimum execution time: 56_625_000 picoseconds. + Weight::from_parts(58_380_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/mainnet/src/weights/networks.rs b/runtimes/mainnet/src/weights/networks.rs index 7a12e4526..5300efc42 100644 --- a/runtimes/mainnet/src/weights/networks.rs +++ b/runtimes/mainnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -63,17 +63,13 @@ impl pallet_networks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 1000]`. /// The range of component `a` is `[1, 1000]`. /// The range of component `b` is `[1, 1000]`. - fn register_network(a: u32, b: u32, ) -> Weight { + fn register_network(_a: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 55_012_000 picoseconds. - Weight::from_parts(58_699_969, 0) + // Minimum execution time: 60_023_000 picoseconds. + Weight::from_parts(83_802_835, 0) .saturating_add(Weight::from_parts(0, 3583)) - // Standard Error: 580 - .saturating_add(Weight::from_parts(2_086, 0).saturating_mul(a.into())) - // Standard Error: 580 - .saturating_add(Weight::from_parts(3_206, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -91,8 +87,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 22_041_000 picoseconds. - Weight::from_parts(23_965_000, 0) + // Minimum execution time: 23_184_000 picoseconds. + Weight::from_parts(36_999_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/mainnet/src/weights/shards.rs b/runtimes/mainnet/src/weights/shards.rs index ca65e3c39..9dce1b258 100644 --- a/runtimes/mainnet/src/weights/shards.rs +++ b/runtimes/mainnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 528_699_000 picoseconds. - Weight::from_parts(571_559_000, 0) + // Minimum execution time: 513_211_000 picoseconds. + Weight::from_parts(518_160_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 63_910_000 picoseconds. - Weight::from_parts(67_085_000, 0) + // Minimum execution time: 58_900_000 picoseconds. + Weight::from_parts(61_415_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 78_015_000 picoseconds. - Weight::from_parts(82_375_000, 0) + // Minimum execution time: 70_763_000 picoseconds. + Weight::from_parts(74_139_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_837_000 picoseconds. - Weight::from_parts(4_078_000, 0) + // Minimum execution time: 3_437_000 picoseconds. + Weight::from_parts(3_667_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/mainnet/src/weights/tasks.rs b/runtimes/mainnet/src/weights/tasks.rs index ca7104c76..5750e3be5 100644 --- a/runtimes/mainnet/src/weights/tasks.rs +++ b/runtimes/mainnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 653_392_000 picoseconds. - Weight::from_parts(680_543_000, 0) + // Minimum execution time: 619_449_000 picoseconds. + Weight::from_parts(636_430_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -99,11 +99,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1538 + b * (95 ±0)` // Estimated: `7370 + b * (2571 ±0)` - // Minimum execution time: 62_067_000 picoseconds. - Weight::from_parts(5_317_421, 0) + // Minimum execution time: 59_492_000 picoseconds. + Weight::from_parts(60_825_000, 0) .saturating_add(Weight::from_parts(0, 7370)) - // Standard Error: 19_805 - .saturating_add(Weight::from_parts(11_326_063, 0).saturating_mul(b.into())) + // Standard Error: 16_006 + .saturating_add(Weight::from_parts(10_373_801, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 25_527_000 picoseconds. - Weight::from_parts(44_372_064, 0) + // Minimum execution time: 24_886_000 picoseconds. + Weight::from_parts(46_097_548, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 277 - .saturating_add(Weight::from_parts(12_076, 0).saturating_mul(b.into())) + // Standard Error: 327 + .saturating_add(Weight::from_parts(10_346, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/mainnet/src/weights/timegraph.rs b/runtimes/mainnet/src/weights/timegraph.rs index d08babf14..5a065a4d0 100644 --- a/runtimes/mainnet/src/weights/timegraph.rs +++ b/runtimes/mainnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -39,8 +39,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 30_667_000 picoseconds. - Weight::from_parts(32_190_000, 0) + // Minimum execution time: 33_162_000 picoseconds. + Weight::from_parts(34_725_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -53,8 +53,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 31_288_000 picoseconds. - Weight::from_parts(32_721_000, 0) + // Minimum execution time: 32_971_000 picoseconds. + Weight::from_parts(34_445_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -69,8 +69,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `272` // Estimated: `6196` - // Minimum execution time: 78_747_000 picoseconds. - Weight::from_parts(81_072_000, 0) + // Minimum execution time: 84_187_000 picoseconds. + Weight::from_parts(85_631_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -85,8 +85,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3593` - // Minimum execution time: 75_582_000 picoseconds. - Weight::from_parts(78_016_000, 0) + // Minimum execution time: 81_293_000 picoseconds. + Weight::from_parts(82_704_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 8_948_000 picoseconds. - Weight::from_parts(9_707_000, 0) + // Minimum execution time: 9_378_000 picoseconds. + Weight::from_parts(9_898_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,8 +109,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_207_000 picoseconds. - Weight::from_parts(9_739_000, 0) + // Minimum execution time: 9_477_000 picoseconds. + Weight::from_parts(10_129_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 8_657_000 picoseconds. - Weight::from_parts(9_538_000, 0) + // Minimum execution time: 9_126_000 picoseconds. + Weight::from_parts(16_951_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtimes/testnet/src/weights/dmail.rs b/runtimes/testnet/src/weights/dmail.rs index 8ee8cd2be..3ecffb7e8 100644 --- a/runtimes/testnet/src/weights/dmail.rs +++ b/runtimes/testnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,12 +41,12 @@ impl pallet_dmail::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_754_000 picoseconds. - Weight::from_parts(8_010_406, 0) + // Minimum execution time: 7_654_000 picoseconds. + Weight::from_parts(6_116_844, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 40 - .saturating_add(Weight::from_parts(756, 0).saturating_mul(a.into())) - // Standard Error: 40 - .saturating_add(Weight::from_parts(727, 0).saturating_mul(b.into())) + // Standard Error: 129 + .saturating_add(Weight::from_parts(2_026, 0).saturating_mul(a.into())) + // Standard Error: 129 + .saturating_add(Weight::from_parts(3_401, 0).saturating_mul(b.into())) } } diff --git a/runtimes/testnet/src/weights/elections.rs b/runtimes/testnet/src/weights/elections.rs index 68532fbb4..e27428fa0 100644 --- a/runtimes/testnet/src/weights/elections.rs +++ b/runtimes/testnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 11_973_000 picoseconds. - Weight::from_parts(12_623_000, 0) + // Minimum execution time: 11_491_000 picoseconds. + Weight::from_parts(12_062_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/testnet/src/weights/members.rs b/runtimes/testnet/src/weights/members.rs index 4d01940a9..c6345afed 100644 --- a/runtimes/testnet/src/weights/members.rs +++ b/runtimes/testnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 60_634_000 picoseconds. - Weight::from_parts(62_396_000, 0) + // Minimum execution time: 65_542_000 picoseconds. + Weight::from_parts(69_010_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 21_510_000 picoseconds. - Weight::from_parts(22_641_000, 0) + // Minimum execution time: 22_693_000 picoseconds. + Weight::from_parts(24_525_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 55_404_000 picoseconds. - Weight::from_parts(58_059_000, 0) + // Minimum execution time: 59_099_000 picoseconds. + Weight::from_parts(62_786_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/testnet/src/weights/networks.rs b/runtimes/testnet/src/weights/networks.rs index 7ee10078e..b19ac9c60 100644 --- a/runtimes/testnet/src/weights/networks.rs +++ b/runtimes/testnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -63,15 +63,17 @@ impl pallet_networks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 1000]`. /// The range of component `a` is `[1, 1000]`. /// The range of component `b` is `[1, 1000]`. - fn register_network(_a: u32, b: u32, ) -> Weight { + fn register_network(a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 54_892_000 picoseconds. - Weight::from_parts(57_395_050, 0) + // Minimum execution time: 55_134_000 picoseconds. + Weight::from_parts(57_970_092, 0) .saturating_add(Weight::from_parts(0, 3583)) - // Standard Error: 386 - .saturating_add(Weight::from_parts(1_671, 0).saturating_mul(b.into())) + // Standard Error: 87 + .saturating_add(Weight::from_parts(574, 0).saturating_mul(a.into())) + // Standard Error: 87 + .saturating_add(Weight::from_parts(797, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -89,8 +91,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 20_939_000 picoseconds. - Weight::from_parts(21_751_000, 0) + // Minimum execution time: 21_601_000 picoseconds. + Weight::from_parts(22_211_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/testnet/src/weights/shards.rs b/runtimes/testnet/src/weights/shards.rs index 09718c411..95bdd203a 100644 --- a/runtimes/testnet/src/weights/shards.rs +++ b/runtimes/testnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 522_116_000 picoseconds. - Weight::from_parts(624_208_000, 0) + // Minimum execution time: 515_173_000 picoseconds. + Weight::from_parts(528_048_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 63_488_000 picoseconds. - Weight::from_parts(70_132_000, 0) + // Minimum execution time: 58_459_000 picoseconds. + Weight::from_parts(61_836_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 77_105_000 picoseconds. - Weight::from_parts(88_846_000, 0) + // Minimum execution time: 71_644_000 picoseconds. + Weight::from_parts(76_944_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_757_000 picoseconds. - Weight::from_parts(4_038_000, 0) + // Minimum execution time: 3_476_000 picoseconds. + Weight::from_parts(3_767_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/testnet/src/weights/tasks.rs b/runtimes/testnet/src/weights/tasks.rs index 483a0328f..3dd8694d9 100644 --- a/runtimes/testnet/src/weights/tasks.rs +++ b/runtimes/testnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 654_504_000 picoseconds. - Weight::from_parts(679_862_000, 0) + // Minimum execution time: 629_468_000 picoseconds. + Weight::from_parts(656_669_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -99,11 +99,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1538 + b * (95 ±0)` // Estimated: `7370 + b * (2571 ±0)` - // Minimum execution time: 63_688_000 picoseconds. - Weight::from_parts(21_728_383, 0) + // Minimum execution time: 60_694_000 picoseconds. + Weight::from_parts(61_965_000, 0) .saturating_add(Weight::from_parts(0, 7370)) - // Standard Error: 10_790 - .saturating_add(Weight::from_parts(11_091_598, 0).saturating_mul(b.into())) + // Standard Error: 6_794 + .saturating_add(Weight::from_parts(10_493_673, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 26_320_000 picoseconds. - Weight::from_parts(45_495_436, 0) + // Minimum execution time: 25_037_000 picoseconds. + Weight::from_parts(41_059_226, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 346 - .saturating_add(Weight::from_parts(14_092, 0).saturating_mul(b.into())) + // Standard Error: 348 + .saturating_add(Weight::from_parts(16_127, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/testnet/src/weights/timegraph.rs b/runtimes/testnet/src/weights/timegraph.rs index 41cc3eb03..823110025 100644 --- a/runtimes/testnet/src/weights/timegraph.rs +++ b/runtimes/testnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -39,8 +39,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 34_183_000 picoseconds. - Weight::from_parts(35_997_000, 0) + // Minimum execution time: 31_999_000 picoseconds. + Weight::from_parts(33_293_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -53,8 +53,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3468` - // Minimum execution time: 34_496_000 picoseconds. - Weight::from_parts(35_948_000, 0) + // Minimum execution time: 32_611_000 picoseconds. + Weight::from_parts(34_383_000, 0) .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -69,8 +69,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `272` // Estimated: `6196` - // Minimum execution time: 88_575_000 picoseconds. - Weight::from_parts(90_600_000, 0) + // Minimum execution time: 83_497_000 picoseconds. + Weight::from_parts(85_461_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -85,8 +85,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3593` - // Minimum execution time: 85_590_000 picoseconds. - Weight::from_parts(87_453_000, 0) + // Minimum execution time: 80_771_000 picoseconds. + Weight::from_parts(83_026_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_387_000 picoseconds. - Weight::from_parts(9_988_000, 0) + // Minimum execution time: 9_267_000 picoseconds. + Weight::from_parts(9_719_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,8 +109,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_218_000 picoseconds. - Weight::from_parts(9_849_000, 0) + // Minimum execution time: 9_137_000 picoseconds. + Weight::from_parts(9_798_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_117_000 picoseconds. - Weight::from_parts(9_587_000, 0) + // Minimum execution time: 9_106_000 picoseconds. + Weight::from_parts(9_578_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1))