From b1908057c94d0b40a7b483cf964fa8ad498ab80e Mon Sep 17 00:00:00 2001 From: PraetorP Date: Wed, 15 Feb 2023 10:21:35 +0000 Subject: [PATCH] fix(app-promo): benchmarks --- --- a/pallets/app-promotion/src/benchmarking.rs +++ b/pallets/app-promotion/src/benchmarking.rs @@ -65,7 +65,7 @@ let staker = account::("staker", index, SEED); ::Currency::make_free_balance_be(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); PromototionPallet::::stake(RawOrigin::Signed(staker.clone()).into(), Into::>::into(100u128) * T::Nominal::get())?; - PromototionPallet::::unstake_all(RawOrigin::Signed(staker.clone()).into()).map_err(|e| e.error)?; + PromototionPallet::::unstake_all(RawOrigin::Signed(staker.clone()).into())?; Result::<(), sp_runtime::DispatchError>::Ok(()) })?; let block_number = >::current_block_number() + T::PendingInterval::get(); --- a/pallets/app-promotion/src/weights.rs +++ b/pallets/app-promotion/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_app_promotion //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-14, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-15, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -53,16 +53,16 @@ // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn on_initialize(b: u32, ) -> Weight { - Weight::from_ref_time(2_562_275 as u64) - // Standard Error: 21_950 - .saturating_add(Weight::from_ref_time(7_177_129 as u64).saturating_mul(b as u64)) + Weight::from_ref_time(2_592_346 as u64) + // Standard Error: 23_629 + .saturating_add(Weight::from_ref_time(7_523_802 as u64).saturating_mul(b as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(b as u64))) .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(b as u64))) } // Storage: AppPromotion Admin (r:0 w:1) fn set_admin_address() -> Weight { - Weight::from_ref_time(6_146_000 as u64) + Weight::from_ref_time(6_209_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) @@ -74,9 +74,9 @@ // Storage: Balances Locks (r:1 w:1) // Storage: AppPromotion TotalStaked (r:1 w:1) fn payout_stakers(b: u32, ) -> Weight { - Weight::from_ref_time(64_035_000 as u64) - // Standard Error: 19_434 - .saturating_add(Weight::from_ref_time(47_251_111 as u64).saturating_mul(b as u64)) + Weight::from_ref_time(64_917_000 as u64) + // Standard Error: 34_206 + .saturating_add(Weight::from_ref_time(51_518_500 as u64).saturating_mul(b as u64)) .saturating_add(T::DbWeight::get().reads(7 as u64)) .saturating_add(T::DbWeight::get().reads((12 as u64).saturating_mul(b as u64))) .saturating_add(T::DbWeight::get().writes(3 as u64)) @@ -90,7 +90,7 @@ // Storage: AppPromotion Staked (r:1 w:1) // Storage: AppPromotion TotalStaked (r:1 w:1) fn stake() -> Weight { - Weight::from_ref_time(18_078_000 as u64) + Weight::from_ref_time(18_208_000 as u64) .saturating_add(T::DbWeight::get().reads(7 as u64)) .saturating_add(T::DbWeight::get().writes(5 as u64)) } @@ -100,7 +100,7 @@ // Storage: AppPromotion TotalStaked (r:1 w:1) // Storage: AppPromotion StakesPerAccount (r:0 w:1) fn unstake_all() -> Weight { - Weight::from_ref_time(45_038_000 as u64) + Weight::from_ref_time(45_018_000 as u64) .saturating_add(T::DbWeight::get().reads(14 as u64)) .saturating_add(T::DbWeight::get().writes(13 as u64)) } @@ -110,35 +110,35 @@ // Storage: AppPromotion TotalStaked (r:1 w:1) // Storage: AppPromotion StakesPerAccount (r:1 w:1) fn unstake_partial() -> Weight { - Weight::from_ref_time(48_863_000 as u64) + Weight::from_ref_time(49_066_000 as u64) .saturating_add(T::DbWeight::get().reads(15 as u64)) .saturating_add(T::DbWeight::get().writes(13 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn sponsor_collection() -> Weight { - Weight::from_ref_time(14_808_000 as u64) + Weight::from_ref_time(15_039_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn stop_sponsoring_collection() -> Weight { - Weight::from_ref_time(14_587_000 as u64) + Weight::from_ref_time(14_692_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:0 w:1) fn sponsor_contract() -> Weight { - Weight::from_ref_time(11_791_000 as u64) + Weight::from_ref_time(11_810_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:1 w:1) fn stop_sponsoring_contract() -> Weight { - Weight::from_ref_time(13_576_000 as u64) + Weight::from_ref_time(13_570_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -150,16 +150,16 @@ // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn on_initialize(b: u32, ) -> Weight { - Weight::from_ref_time(2_562_275 as u64) - // Standard Error: 21_950 - .saturating_add(Weight::from_ref_time(7_177_129 as u64).saturating_mul(b as u64)) + Weight::from_ref_time(2_592_346 as u64) + // Standard Error: 23_629 + .saturating_add(Weight::from_ref_time(7_523_802 as u64).saturating_mul(b as u64)) .saturating_add(RocksDbWeight::get().reads(1 as u64)) .saturating_add(RocksDbWeight::get().reads((2 as u64).saturating_mul(b as u64))) .saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(b as u64))) } // Storage: AppPromotion Admin (r:0 w:1) fn set_admin_address() -> Weight { - Weight::from_ref_time(6_146_000 as u64) + Weight::from_ref_time(6_209_000 as u64) .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) @@ -171,9 +171,9 @@ // Storage: Balances Locks (r:1 w:1) // Storage: AppPromotion TotalStaked (r:1 w:1) fn payout_stakers(b: u32, ) -> Weight { - Weight::from_ref_time(64_035_000 as u64) - // Standard Error: 19_434 - .saturating_add(Weight::from_ref_time(47_251_111 as u64).saturating_mul(b as u64)) + Weight::from_ref_time(64_917_000 as u64) + // Standard Error: 34_206 + .saturating_add(Weight::from_ref_time(51_518_500 as u64).saturating_mul(b as u64)) .saturating_add(RocksDbWeight::get().reads(7 as u64)) .saturating_add(RocksDbWeight::get().reads((12 as u64).saturating_mul(b as u64))) .saturating_add(RocksDbWeight::get().writes(3 as u64)) @@ -187,7 +187,7 @@ // Storage: AppPromotion Staked (r:1 w:1) // Storage: AppPromotion TotalStaked (r:1 w:1) fn stake() -> Weight { - Weight::from_ref_time(18_078_000 as u64) + Weight::from_ref_time(18_208_000 as u64) .saturating_add(RocksDbWeight::get().reads(7 as u64)) .saturating_add(RocksDbWeight::get().writes(5 as u64)) } @@ -197,7 +197,7 @@ // Storage: AppPromotion TotalStaked (r:1 w:1) // Storage: AppPromotion StakesPerAccount (r:0 w:1) fn unstake_all() -> Weight { - Weight::from_ref_time(45_038_000 as u64) + Weight::from_ref_time(45_018_000 as u64) .saturating_add(RocksDbWeight::get().reads(14 as u64)) .saturating_add(RocksDbWeight::get().writes(13 as u64)) } @@ -207,35 +207,35 @@ // Storage: AppPromotion TotalStaked (r:1 w:1) // Storage: AppPromotion StakesPerAccount (r:1 w:1) fn unstake_partial() -> Weight { - Weight::from_ref_time(48_863_000 as u64) + Weight::from_ref_time(49_066_000 as u64) .saturating_add(RocksDbWeight::get().reads(15 as u64)) .saturating_add(RocksDbWeight::get().writes(13 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn sponsor_collection() -> Weight { - Weight::from_ref_time(14_808_000 as u64) + Weight::from_ref_time(15_039_000 as u64) .saturating_add(RocksDbWeight::get().reads(2 as u64)) .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn stop_sponsoring_collection() -> Weight { - Weight::from_ref_time(14_587_000 as u64) + Weight::from_ref_time(14_692_000 as u64) .saturating_add(RocksDbWeight::get().reads(2 as u64)) .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:0 w:1) fn sponsor_contract() -> Weight { - Weight::from_ref_time(11_791_000 as u64) + Weight::from_ref_time(11_810_000 as u64) .saturating_add(RocksDbWeight::get().reads(1 as u64)) .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:1 w:1) fn stop_sponsoring_contract() -> Weight { - Weight::from_ref_time(13_576_000 as u64) + Weight::from_ref_time(13_570_000 as u64) .saturating_add(RocksDbWeight::get().reads(2 as u64)) .saturating_add(RocksDbWeight::get().writes(1 as u64)) } -- gitstuff