From cea198bb0a78f619c495bcc0c93bffa26af1b962 Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Fri, 14 Feb 2025 17:17:36 +0000 Subject: [PATCH 01/26] add reconsider deposit extrinsic for pallet-indices --- substrate/frame/indices/src/benchmarking.rs | 17 +++ substrate/frame/indices/src/lib.rs | 53 ++++++++ substrate/frame/indices/src/mock.rs | 13 +- substrate/frame/indices/src/tests.rs | 127 +++++++++++++++++++- substrate/frame/indices/src/weights.rs | 14 +++ 5 files changed, 220 insertions(+), 4 deletions(-) diff --git a/substrate/frame/indices/src/benchmarking.rs b/substrate/frame/indices/src/benchmarking.rs index 28f5e3bf5cf08..60d9efee36a9a 100644 --- a/substrate/frame/indices/src/benchmarking.rs +++ b/substrate/frame/indices/src/benchmarking.rs @@ -112,6 +112,23 @@ mod benchmarks { Ok(()) } + #[benchmark] + fn reconsider() -> Result<(), BenchmarkError> { + let account_index = T::AccountIndex::from(SEED); + // Setup accounts + let caller: T::AccountId = whitelisted_caller(); + T::Currency::make_free_balance_be(&caller, BalanceOf::::max_value()); + // Claim the index + Pallet::::claim(RawOrigin::Signed(caller.clone()).into(), account_index)?; + + #[extrinsic_call] + _(RawOrigin::Signed(caller.clone()), account_index); + + assert!(Accounts::::contains_key(account_index)); + assert_eq!(Accounts::::get(account_index).unwrap().0, caller); + Ok(()) + } + // TODO in another PR: lookup and unlookup trait weights (not critical) impl_benchmark_test_suite!(Pallet, mock::new_test_ext(), mock::Test); diff --git a/substrate/frame/indices/src/lib.rs b/substrate/frame/indices/src/lib.rs index 740d69365df3e..60bf89048858e 100644 --- a/substrate/frame/indices/src/lib.rs +++ b/substrate/frame/indices/src/lib.rs @@ -232,6 +232,57 @@ pub mod pallet { Self::deposit_event(Event::IndexFrozen { index, who }); Ok(()) } + + /// Reconsider the deposit reserved for an index. + /// + /// The dispatch origin for this call must be _Signed_ and the signing account must have a + /// non-frozen account `index`. + /// + /// The transaction fees is waived if the deposit is changed after reconsideration. + /// + /// - `index`: the index whose deposit is to be reconsidered. + /// + /// Emits `DepositReconsidered` if successful. + /// + /// ## Complexity + /// - `O(1)`. + #[pallet::call_index(5)] + #[pallet::weight(T::WeightInfo::reconsider())] + pub fn reconsider(origin: OriginFor, index: T::AccountIndex) -> DispatchResultWithPostInfo { + let who = ensure_signed(origin)?; + + Accounts::::try_mutate(index, |maybe_value| -> DispatchResultWithPostInfo { + let (account, old_amount, perm) = maybe_value.take().ok_or(Error::::NotAssigned)?; + ensure!(!perm, Error::::Permanent); + ensure!(account == who, Error::::NotOwner); + + let new_amount = T::Deposit::get(); + + if new_amount > old_amount { + // Need to reserve more + let extra = new_amount.saturating_sub(old_amount); + T::Currency::reserve(&who, extra)?; + } else if new_amount < old_amount { + // Need to unreserve some + let excess = old_amount.saturating_sub(new_amount); + T::Currency::unreserve(&who, excess); + } + + *maybe_value = Some((account, new_amount, perm)); + + if old_amount != new_amount { + Self::deposit_event(Event::DepositReconsidered { + who, + index, + old_deposit: old_amount, + new_deposit: new_amount, + }); + Ok(Pays::No.into()) + } else { + Ok(Pays::Yes.into()) + } + }) + } } #[pallet::event] @@ -243,6 +294,8 @@ pub mod pallet { IndexFreed { index: T::AccountIndex }, /// A account index has been frozen to its current account ID. IndexFrozen { index: T::AccountIndex, who: T::AccountId }, + /// A deposit to reserve an index has been reconsidered. + DepositReconsidered { who: T::AccountId, index: T::AccountIndex, old_deposit: BalanceOf, new_deposit: BalanceOf }, } #[pallet::error] diff --git a/substrate/frame/indices/src/mock.rs b/substrate/frame/indices/src/mock.rs index 80d0a88881f97..41cd0603c4af8 100644 --- a/substrate/frame/indices/src/mock.rs +++ b/substrate/frame/indices/src/mock.rs @@ -20,11 +20,15 @@ #![cfg(test)] use crate::{self as pallet_indices, Config}; -use frame_support::{derive_impl, traits::ConstU64}; +use frame_support::{derive_impl, parameter_types}; use sp_runtime::BuildStorage; type Block = frame_system::mocking::MockBlock; +parameter_types! { + pub static IndexDeposit: u64 = 1; +} + frame_support::construct_runtime!( pub enum Test { @@ -50,7 +54,7 @@ impl pallet_balances::Config for Test { impl Config for Test { type AccountIndex = u64; type Currency = Balances; - type Deposit = ConstU64<1>; + type Deposit = IndexDeposit; type RuntimeEvent = RuntimeEvent; type WeightInfo = (); } @@ -63,5 +67,8 @@ pub fn new_test_ext() -> sp_io::TestExternalities { } .assimilate_storage(&mut t) .unwrap(); - t.into() + let mut ext: sp_io::TestExternalities = t.into(); + // Initialize the block number to 1 for event registration + ext.execute_with(|| System::set_block_number(1)); + ext } diff --git a/substrate/frame/indices/src/tests.rs b/substrate/frame/indices/src/tests.rs index 56b1019000389..7937d2e652f1f 100644 --- a/substrate/frame/indices/src/tests.rs +++ b/substrate/frame/indices/src/tests.rs @@ -20,7 +20,7 @@ #![cfg(test)] use super::{mock::*, *}; -use frame_support::{assert_noop, assert_ok}; +use frame_support::{assert_noop, assert_ok, pallet_prelude::Pays}; use pallet_balances::Error as BalancesError; use sp_runtime::MultiAddress::Id; @@ -119,3 +119,128 @@ fn force_transfer_index_on_free_should_work() { assert_eq!(Indices::lookup_index(0), Some(3)); }); } + +#[test] +fn reconsider_should_fail_for_unassigned_index() { + new_test_ext().execute_with(|| { + assert_noop!( + Indices::reconsider(Some(1).into(), 0), + Error::::NotAssigned + ); + }); +} + +#[test] +fn reconsider_should_fail_for_wrong_owner() { + new_test_ext().execute_with(|| { + assert_ok!(Indices::claim(Some(1).into(), 0)); + assert_noop!( + Indices::reconsider(Some(2).into(), 0), + Error::::NotOwner + ); + }); +} + +#[test] +fn reconsider_should_fail_for_permanent_index() { + new_test_ext().execute_with(|| { + assert_ok!(Indices::claim(Some(1).into(), 0)); + assert_ok!(Indices::freeze(Some(1).into(), 0)); + assert_noop!( + Indices::reconsider(Some(1).into(), 0), + Error::::Permanent + ); + }); +} + +#[test] +fn reconsider_should_fail_for_insufficient_balance() { + new_test_ext().execute_with(|| { + assert_ok!(Indices::claim(Some(1).into(), 0)); + + // Set deposit higher than available balance + IndexDeposit::set(1000); + + assert_noop!( + Indices::reconsider(Some(1).into(), 0), + BalancesError::::InsufficientBalance + ); + }); +} + +#[test] +fn reconsider_should_work_when_deposit_increases() { + new_test_ext().execute_with(|| { + assert_ok!(Indices::claim(Some(1).into(), 0)); + assert_eq!(Balances::reserved_balance(1), 1); + + // Change deposit to 2 + IndexDeposit::set(2); + + // Reconsider should work and be free + let initial_balance = Balances::free_balance(1); + let result = Indices::reconsider(Some(1).into(), 0); + assert_ok!(result.as_ref()); + let post_info = result.unwrap(); + assert_eq!(post_info.pays_fee, Pays::No); + assert_eq!(Balances::reserved_balance(1), 2); + + // Balance should only reduce by the deposit difference + assert_eq!(Balances::free_balance(1), initial_balance - 1); + + System::assert_has_event(Event::DepositReconsidered { + who: 1, + index: 0, + old_deposit: 1, + new_deposit: 2 + }.into()); + }); +} + +#[test] +fn reconsider_should_work_when_deposit_decreases() { + new_test_ext().execute_with(|| { + // Set initial deposit to 2 + IndexDeposit::set(2); + assert_ok!(Indices::claim(Some(1).into(), 0)); + assert_eq!(Balances::reserved_balance(1), 2); + + // Change deposit to 1 + IndexDeposit::set(1); + + let initial_balance = Balances::free_balance(1); + let result = Indices::reconsider(Some(1).into(), 0); + assert_ok!(result.as_ref()); + let post_info = result.unwrap(); + assert_eq!(post_info.pays_fee, Pays::No); + assert_eq!(Balances::reserved_balance(1), 1); + + // Balance should increase by the unreserved amount + assert_eq!(Balances::free_balance(1), initial_balance + 1); + + System::assert_has_event(Event::DepositReconsidered { + who: 1, + index: 0, + old_deposit: 2, + new_deposit: 1 + }.into()); + }); +} + +#[test] +fn reconsider_should_charge_fee_when_deposit_unchanged() { + new_test_ext().execute_with(|| { + assert_ok!(Indices::claim(Some(1).into(), 0)); + assert_eq!(Balances::reserved_balance(1), 1); + + // Reconsider with same deposit amount + let result = Indices::reconsider(Some(1).into(), 0); + assert_ok!(result.as_ref()); + // Verify fee payment + let post_info = result.unwrap(); + assert_eq!(post_info.pays_fee, Pays::Yes); + + // Reserved balance should remain the same + assert_eq!(Balances::reserved_balance(1), 1); + }); +} diff --git a/substrate/frame/indices/src/weights.rs b/substrate/frame/indices/src/weights.rs index 567e9bab54bdf..a32403dc6f970 100644 --- a/substrate/frame/indices/src/weights.rs +++ b/substrate/frame/indices/src/weights.rs @@ -56,6 +56,7 @@ pub trait WeightInfo { fn free() -> Weight; fn force_transfer() -> Weight; fn freeze() -> Weight; + fn reconsider() -> Weight; } /// Weights for `pallet_indices` using the Substrate node and recommended hardware. @@ -120,6 +121,12 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } + // TO-DO: Implement this. + fn reconsider() -> Weight { + Weight::from_parts(31_036_000, 3534) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } } // For backwards compatibility and tests. @@ -183,4 +190,11 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } + + // TO-DO: Implement this. + fn reconsider() -> Weight { + Weight::from_parts(31_036_000, 3534) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } } From 045dd00303c02a957e102cd42a021560aee8a0a9 Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Sun, 16 Feb 2025 23:12:58 +0000 Subject: [PATCH 02/26] add benchmark --- substrate/frame/indices/src/benchmarking.rs | 9 +++++++++ substrate/frame/indices/src/weights.rs | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/substrate/frame/indices/src/benchmarking.rs b/substrate/frame/indices/src/benchmarking.rs index 60d9efee36a9a..d886075076ad4 100644 --- a/substrate/frame/indices/src/benchmarking.rs +++ b/substrate/frame/indices/src/benchmarking.rs @@ -118,14 +118,23 @@ mod benchmarks { // Setup accounts let caller: T::AccountId = whitelisted_caller(); T::Currency::make_free_balance_be(&caller, BalanceOf::::max_value()); + // Set initial deposit to 10 + mock::IndexDeposit::set(10); + assert_eq!(T::Deposit::get(), 10u64.into()); // Claim the index Pallet::::claim(RawOrigin::Signed(caller.clone()).into(), account_index)?; + // Verify the initial deposit amount in storage + assert_eq!(Accounts::::get(account_index).unwrap().1, 10u64.into()); + // Set new deposit value to 1 + mock::IndexDeposit::set(1); + assert_eq!(T::Deposit::get(), 1u64.into()); #[extrinsic_call] _(RawOrigin::Signed(caller.clone()), account_index); assert!(Accounts::::contains_key(account_index)); assert_eq!(Accounts::::get(account_index).unwrap().0, caller); + assert_eq!(Accounts::::get(account_index).unwrap().1, 1u64.into()); Ok(()) } diff --git a/substrate/frame/indices/src/weights.rs b/substrate/frame/indices/src/weights.rs index a32403dc6f970..aa5ef9b8f76c3 100644 --- a/substrate/frame/indices/src/weights.rs +++ b/substrate/frame/indices/src/weights.rs @@ -121,7 +121,7 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - // TO-DO: Implement this. + // TO-DO: Run CI cmd bot to generate real weights. fn reconsider() -> Weight { Weight::from_parts(31_036_000, 3534) .saturating_add(RocksDbWeight::get().reads(1_u64)) @@ -191,7 +191,7 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().writes(1_u64)) } - // TO-DO: Implement this. + // TO-DO: Run CI cmd bot to generate real weights. fn reconsider() -> Weight { Weight::from_parts(31_036_000, 3534) .saturating_add(RocksDbWeight::get().reads(1_u64)) From 99e464433dd1485aff07678481c1543b7924a6af Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 00:46:50 +0000 Subject: [PATCH 03/26] Update from UtkarshBhardwaj007 running command 'prdoc' --- prdoc/pr_7587.prdoc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 prdoc/pr_7587.prdoc diff --git a/prdoc/pr_7587.prdoc b/prdoc/pr_7587.prdoc new file mode 100644 index 0000000000000..28c442431069f --- /dev/null +++ b/prdoc/pr_7587.prdoc @@ -0,0 +1,24 @@ +title: Poke deposits +doc: +- audience: Todo + description: |- + # Description + + * This PR adds a new extrinsic `reconsider` to `pallet-indices`. This extrinsic will be used to re-adjust the deposits made in the pallet. + * Part of #5591 + + ## Review Notes + + * Added a new extrinsic `reconsider` in `pallet-indices`. + * Added a new event `DepositReconsidered` to be emitted upon a successful call of the extrinsic. + * Although the immediate use of the extrinsic will be to give back some of the deposit after the AH-migration, the extrinsic is written such that it can work if the deposit decreases or increases (both). + * The call to the extrinsic would be `free` if an actual adjustment is made to the deposit and `paid` otherwise. + * Added tests to test all scenarios. + * Added a benchmark to test the "worst case" (maximum compute) flow of the extrinsic which is when the deposit amount is updated to a new value. + + ## TO-DOs + + * [ ] Run CI cmd bot to benchmark +crates: +- name: pallet-indices + bump: major From 2e5cd44305a9376445f03b400cee1bad70159026 Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Mon, 17 Feb 2025 00:49:40 +0000 Subject: [PATCH 04/26] add prdoc --- prdoc/pr_7587.prdoc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/prdoc/pr_7587.prdoc b/prdoc/pr_7587.prdoc index 28c442431069f..7f41acf53f088 100644 --- a/prdoc/pr_7587.prdoc +++ b/prdoc/pr_7587.prdoc @@ -1,6 +1,6 @@ title: Poke deposits doc: -- audience: Todo +- audience: Runtime Dev description: |- # Description @@ -15,10 +15,6 @@ doc: * The call to the extrinsic would be `free` if an actual adjustment is made to the deposit and `paid` otherwise. * Added tests to test all scenarios. * Added a benchmark to test the "worst case" (maximum compute) flow of the extrinsic which is when the deposit amount is updated to a new value. - - ## TO-DOs - - * [ ] Run CI cmd bot to benchmark crates: - name: pallet-indices bump: major From 933450249b17bdb420ab7300de8a3db3dd5ff91d Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Mon, 17 Feb 2025 10:36:58 +0000 Subject: [PATCH 05/26] exit early in reconsider if deposit is unchanged --- substrate/frame/indices/src/lib.rs | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/substrate/frame/indices/src/lib.rs b/substrate/frame/indices/src/lib.rs index 60bf89048858e..a2e7cbe8b2e20 100644 --- a/substrate/frame/indices/src/lib.rs +++ b/substrate/frame/indices/src/lib.rs @@ -258,7 +258,10 @@ pub mod pallet { let new_amount = T::Deposit::get(); - if new_amount > old_amount { + if old_amount == new_amount { + *maybe_value = Some((account, old_amount, perm)); + return Ok(Pays::Yes.into()); + } else if new_amount > old_amount { // Need to reserve more let extra = new_amount.saturating_sub(old_amount); T::Currency::reserve(&who, extra)?; @@ -270,17 +273,13 @@ pub mod pallet { *maybe_value = Some((account, new_amount, perm)); - if old_amount != new_amount { - Self::deposit_event(Event::DepositReconsidered { - who, - index, - old_deposit: old_amount, - new_deposit: new_amount, - }); - Ok(Pays::No.into()) - } else { - Ok(Pays::Yes.into()) - } + Self::deposit_event(Event::DepositReconsidered { + who, + index, + old_deposit: old_amount, + new_deposit: new_amount, + }); + Ok(Pays::No.into()) }) } } From 2db6c3af0f3dfc46321c46581f4d24258556b5d8 Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Mon, 17 Feb 2025 11:44:43 +0000 Subject: [PATCH 06/26] fix reconsider benchmark --- substrate/frame/indices/src/benchmarking.rs | 27 +++++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/substrate/frame/indices/src/benchmarking.rs b/substrate/frame/indices/src/benchmarking.rs index d886075076ad4..a2650a0e69fdb 100644 --- a/substrate/frame/indices/src/benchmarking.rs +++ b/substrate/frame/indices/src/benchmarking.rs @@ -21,6 +21,7 @@ use crate::*; use frame_benchmarking::v2::*; +use frame_support::traits::Get; use frame_system::RawOrigin; use sp_runtime::traits::Bounded; @@ -118,23 +119,33 @@ mod benchmarks { // Setup accounts let caller: T::AccountId = whitelisted_caller(); T::Currency::make_free_balance_be(&caller, BalanceOf::::max_value()); - // Set initial deposit to 10 - mock::IndexDeposit::set(10); - assert_eq!(T::Deposit::get(), 10u64.into()); + + let original_deposit = T::Deposit::get(); + // Claim the index Pallet::::claim(RawOrigin::Signed(caller.clone()).into(), account_index)?; // Verify the initial deposit amount in storage - assert_eq!(Accounts::::get(account_index).unwrap().1, 10u64.into()); - // Set new deposit value to 1 - mock::IndexDeposit::set(1); - assert_eq!(T::Deposit::get(), 1u64.into()); + assert_eq!(Accounts::::get(account_index).unwrap().1, original_deposit); + + // Double the deposited amount in storage + Accounts::::try_mutate(account_index, |maybe_value| -> Result<(), BenchmarkError> { + let (account, amount, perm) = maybe_value.take().ok_or(BenchmarkError::Skip)?; + *maybe_value = Some((account, amount.saturating_mul(2u32.into()), perm)); + Ok(()) + })?; + + // Verify the deposit was doubled + assert_eq!( + Accounts::::get(account_index).unwrap().1, + original_deposit.saturating_mul(2u32.into()) + ); #[extrinsic_call] _(RawOrigin::Signed(caller.clone()), account_index); assert!(Accounts::::contains_key(account_index)); assert_eq!(Accounts::::get(account_index).unwrap().0, caller); - assert_eq!(Accounts::::get(account_index).unwrap().1, 1u64.into()); + assert_eq!(Accounts::::get(account_index).unwrap().1, original_deposit); Ok(()) } From b7f23457c359a0fa664b2cba9c04ac1d01672bce Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Mon, 17 Feb 2025 16:08:33 +0000 Subject: [PATCH 07/26] add dummy weights to allow benchmarking to run in CI --- polkadot/runtime/rococo/src/weights/pallet_indices.rs | 6 ++++++ polkadot/runtime/westend/src/weights/pallet_indices.rs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/polkadot/runtime/rococo/src/weights/pallet_indices.rs b/polkadot/runtime/rococo/src/weights/pallet_indices.rs index 434db97d4a79f..97358594a2bd8 100644 --- a/polkadot/runtime/rococo/src/weights/pallet_indices.rs +++ b/polkadot/runtime/rococo/src/weights/pallet_indices.rs @@ -114,4 +114,10 @@ impl pallet_indices::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } + // TO-DO: Run CI cmd bot to generate real weights. + fn reconsider() -> Weight { + Weight::from_parts(31_036_000, 3534) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } } diff --git a/polkadot/runtime/westend/src/weights/pallet_indices.rs b/polkadot/runtime/westend/src/weights/pallet_indices.rs index 42316cd907801..abf1e3788e095 100644 --- a/polkadot/runtime/westend/src/weights/pallet_indices.rs +++ b/polkadot/runtime/westend/src/weights/pallet_indices.rs @@ -114,4 +114,10 @@ impl pallet_indices::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } + // TO-DO: Run CI cmd bot to generate real weights. + fn reconsider() -> Weight { + Weight::from_parts(31_036_000, 3534) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } } From 3aa10dd70e2f1b6a15278f6b547a58e7db4a6954 Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Mon, 17 Feb 2025 16:08:33 +0000 Subject: [PATCH 08/26] add dummy weights to allow benchmarking to run in CI --- polkadot/runtime/rococo/src/weights/pallet_indices.rs | 7 ++++--- polkadot/runtime/westend/src/weights/pallet_indices.rs | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/polkadot/runtime/rococo/src/weights/pallet_indices.rs b/polkadot/runtime/rococo/src/weights/pallet_indices.rs index 97358594a2bd8..b37dcd5b1d495 100644 --- a/polkadot/runtime/rococo/src/weights/pallet_indices.rs +++ b/polkadot/runtime/rococo/src/weights/pallet_indices.rs @@ -116,8 +116,9 @@ impl pallet_indices::WeightInfo for WeightInfo { } // TO-DO: Run CI cmd bot to generate real weights. fn reconsider() -> Weight { - Weight::from_parts(31_036_000, 3534) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + Weight::from_parts(21_023_000, 0) + .saturating_add(Weight::from_parts(0, 3534)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/polkadot/runtime/westend/src/weights/pallet_indices.rs b/polkadot/runtime/westend/src/weights/pallet_indices.rs index abf1e3788e095..86ba7618fa8a9 100644 --- a/polkadot/runtime/westend/src/weights/pallet_indices.rs +++ b/polkadot/runtime/westend/src/weights/pallet_indices.rs @@ -116,8 +116,9 @@ impl pallet_indices::WeightInfo for WeightInfo { } // TO-DO: Run CI cmd bot to generate real weights. fn reconsider() -> Weight { - Weight::from_parts(31_036_000, 3534) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + Weight::from_parts(28_136_000, 0) + .saturating_add(Weight::from_parts(0, 3534)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } } From 0495c20def2f1c9879f46841de9bc01ee1e9c7b5 Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 21:31:01 +0000 Subject: [PATCH 09/26] Update from UtkarshBhardwaj007 running command 'bench --pallet pallet_indices pallet_xcm_benchmarks::generic' --- .../rococo/src/weights/pallet_indices.rs | 54 ++--- .../xcm/pallet_xcm_benchmarks_generic.rs | 191 ++++++++++-------- .../westend/src/weights/pallet_indices.rs | 94 +++++---- .../xcm/pallet_xcm_benchmarks_generic.rs | 169 ++++++++-------- 4 files changed, 272 insertions(+), 236 deletions(-) diff --git a/polkadot/runtime/rococo/src/weights/pallet_indices.rs b/polkadot/runtime/rococo/src/weights/pallet_indices.rs index b37dcd5b1d495..a815866bf0933 100644 --- a/polkadot/runtime/rococo/src/weights/pallet_indices.rs +++ b/polkadot/runtime/rococo/src/weights/pallet_indices.rs @@ -17,27 +17,28 @@ //! Autogenerated weights for `pallet_indices` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-02-29, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-02-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-bn-ce5rx-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("rococo-dev")`, DB CACHE: 1024 +//! HOSTNAME: `7f503db40d1f`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/production/polkadot +// frame-omni-bencher +// v1 // benchmark // pallet -// --chain=rococo-dev +// --extrinsic=* +// --runtime=target/production/wbuild/rococo-runtime/rococo_runtime.wasm +// --pallet=pallet_indices +// --header=/__w/polkadot-sdk/polkadot-sdk/polkadot/file_header.txt +// --output=./polkadot/runtime/rococo/src/weights +// --wasm-execution=compiled // --steps=50 // --repeat=20 +// --heap-pages=4096 // --no-storage-info -// --no-median-slopes // --no-min-squares -// --pallet=pallet_indices -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --header=./polkadot/file_header.txt -// --output=./polkadot/runtime/rococo/src/weights/ +// --no-median-slopes #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -56,8 +57,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `4` // Estimated: `3534` - // Minimum execution time: 18_092_000 picoseconds. - Weight::from_parts(18_533_000, 0) + // Minimum execution time: 22_198_000 picoseconds. + Weight::from_parts(22_968_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -70,8 +71,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `203` // Estimated: `3593` - // Minimum execution time: 31_616_000 picoseconds. - Weight::from_parts(32_556_000, 0) + // Minimum execution time: 35_178_000 picoseconds. + Weight::from_parts(36_177_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -82,8 +83,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `100` // Estimated: `3534` - // Minimum execution time: 19_593_000 picoseconds. - Weight::from_parts(20_100_000, 0) + // Minimum execution time: 23_620_000 picoseconds. + Weight::from_parts(24_166_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -96,8 +97,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `203` // Estimated: `3593` - // Minimum execution time: 21_429_000 picoseconds. - Weight::from_parts(22_146_000, 0) + // Minimum execution time: 26_221_000 picoseconds. + Weight::from_parts(27_386_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -108,15 +109,20 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `100` // Estimated: `3534` - // Minimum execution time: 20_425_000 picoseconds. - Weight::from_parts(21_023_000, 0) + // Minimum execution time: 26_565_000 picoseconds. + Weight::from_parts(27_534_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - // TO-DO: Run CI cmd bot to generate real weights. + /// Storage: `Indices::Accounts` (r:1 w:1) + /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn reconsider() -> Weight { - Weight::from_parts(21_023_000, 0) + // Proof Size summary in bytes: + // Measured: `100` + // Estimated: `3534` + // Minimum execution time: 23_314_000 picoseconds. + Weight::from_parts(24_462_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/polkadot/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/polkadot/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 2dc8880c83265..42892e9b57c76 100644 --- a/polkadot/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/polkadot/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -17,26 +17,29 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-11-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-02-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-vcatxqpx-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024 +//! HOSTNAME: `7f503db40d1f`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: -// target/production/polkadot +// frame-omni-bencher +// v1 // benchmark // pallet -// --steps=50 -// --repeat=20 // --extrinsic=* +// --runtime=target/production/wbuild/rococo-runtime/rococo_runtime.wasm +// --pallet=pallet_xcm_benchmarks::generic +// --header=/__w/polkadot-sdk/polkadot-sdk/polkadot/file_header.txt +// --output=./polkadot/runtime/rococo/src/weights/xcm // --wasm-execution=compiled +// --steps=50 +// --repeat=20 // --heap-pages=4096 -// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json -// --pallet=pallet_xcm_benchmarks::generic -// --chain=rococo-dev -// --header=./polkadot/file_header.txt -// --template=./polkadot/xcm/pallet-xcm-benchmarks/template.hbs -// --output=./polkadot/runtime/rococo/src/weights/xcm/ +// --template=polkadot/xcm/pallet-xcm-benchmarks/template.hbs +// --no-storage-info +// --no-min-squares +// --no-median-slopes #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -55,39 +58,41 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Paras::Heads` (r:1 w:0) + /// Proof: `Paras::Heads` (`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`) /// Storage: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn report_holding() -> Weight { // Proof Size summary in bytes: - // Measured: `281` - // Estimated: `3746` - // Minimum execution time: 65_164_000 picoseconds. - Weight::from_parts(66_965_000, 3746) - .saturating_add(T::DbWeight::get().reads(5)) + // Measured: `346` + // Estimated: `3811` + // Minimum execution time: 75_278_000 picoseconds. + Weight::from_parts(79_252_000, 3811) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } pub(crate) fn buy_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 675_000 picoseconds. - Weight::from_parts(745_000, 0) + // Minimum execution time: 685_000 picoseconds. + Weight::from_parts(764_000, 0) } pub(crate) fn pay_fees() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_899_000 picoseconds. - Weight::from_parts(3_090_000, 0) + // Minimum execution time: 3_505_000 picoseconds. + Weight::from_parts(3_680_000, 0) } pub(crate) fn asset_claimer() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 669_000 picoseconds. - Weight::from_parts(714_000, 0) + // Minimum execution time: 783_000 picoseconds. + Weight::from_parts(853_000, 0) } /// Storage: `XcmPallet::Queries` (r:1 w:0) /// Proof: `XcmPallet::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -95,65 +100,65 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 6_004_000 picoseconds. - Weight::from_parts(6_152_000, 3465) + // Minimum execution time: 6_261_000 picoseconds. + Weight::from_parts(6_520_000, 3465) .saturating_add(T::DbWeight::get().reads(1)) } pub(crate) fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_296_000 picoseconds. - Weight::from_parts(7_533_000, 0) + // Minimum execution time: 7_976_000 picoseconds. + Weight::from_parts(8_240_000, 0) } pub(crate) fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_292_000 picoseconds. - Weight::from_parts(1_414_000, 0) + // Minimum execution time: 1_306_000 picoseconds. + Weight::from_parts(1_392_000, 0) } pub(crate) fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 741_000 picoseconds. - Weight::from_parts(775_000, 0) + // Minimum execution time: 689_000 picoseconds. + Weight::from_parts(767_000, 0) } pub(crate) fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 702_000 picoseconds. - Weight::from_parts(770_000, 0) + // Minimum execution time: 741_000 picoseconds. + Weight::from_parts(800_000, 0) } pub(crate) fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 648_000 picoseconds. - Weight::from_parts(744_000, 0) + // Minimum execution time: 658_000 picoseconds. + Weight::from_parts(725_000, 0) } pub(crate) fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 731_000 picoseconds. - Weight::from_parts(772_000, 0) + // Minimum execution time: 777_000 picoseconds. + Weight::from_parts(831_000, 0) } pub(crate) fn execute_with_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 790_000 picoseconds. - Weight::from_parts(843_000, 0) + // Minimum execution time: 774_000 picoseconds. + Weight::from_parts(849_000, 0) } pub(crate) fn clear_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 647_000 picoseconds. - Weight::from_parts(731_000, 0) + // Minimum execution time: 692_000 picoseconds. + Weight::from_parts(777_000, 0) } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -161,17 +166,19 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Paras::Heads` (r:1 w:0) + /// Proof: `Paras::Heads` (`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`) /// Storage: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn report_error() -> Weight { // Proof Size summary in bytes: - // Measured: `281` - // Estimated: `3746` - // Minimum execution time: 62_808_000 picoseconds. - Weight::from_parts(64_413_000, 3746) - .saturating_add(T::DbWeight::get().reads(5)) + // Measured: `346` + // Estimated: `3811` + // Minimum execution time: 71_492_000 picoseconds. + Weight::from_parts(74_979_000, 3811) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `XcmPallet::AssetTraps` (r:1 w:1) @@ -180,8 +187,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `23` // Estimated: `3488` - // Minimum execution time: 9_298_000 picoseconds. - Weight::from_parts(9_541_000, 3488) + // Minimum execution time: 9_609_000 picoseconds. + Weight::from_parts(10_017_000, 3488) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -189,8 +196,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 696_000 picoseconds. - Weight::from_parts(732_000, 0) + // Minimum execution time: 656_000 picoseconds. + Weight::from_parts(733_000, 0) } /// Storage: `XcmPallet::VersionNotifyTargets` (r:1 w:1) /// Proof: `XcmPallet::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -200,15 +207,17 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Paras::Heads` (r:1 w:0) + /// Proof: `Paras::Heads` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn subscribe_version() -> Weight { // Proof Size summary in bytes: - // Measured: `180` - // Estimated: `3645` - // Minimum execution time: 30_585_000 picoseconds. - Weight::from_parts(31_622_000, 3645) - .saturating_add(T::DbWeight::get().reads(5)) + // Measured: `245` + // Estimated: `3710` + // Minimum execution time: 38_223_000 picoseconds. + Weight::from_parts(39_642_000, 3710) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `XcmPallet::VersionNotifyTargets` (r:0 w:1) @@ -217,44 +226,44 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_036_000 picoseconds. - Weight::from_parts(3_196_000, 0) + // Minimum execution time: 3_225_000 picoseconds. + Weight::from_parts(3_342_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } pub(crate) fn burn_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_035_000 picoseconds. - Weight::from_parts(1_133_000, 0) + // Minimum execution time: 1_158_000 picoseconds. + Weight::from_parts(1_236_000, 0) } pub(crate) fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 764_000 picoseconds. - Weight::from_parts(802_000, 0) + // Minimum execution time: 833_000 picoseconds. + Weight::from_parts(897_000, 0) } pub(crate) fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 682_000 picoseconds. - Weight::from_parts(724_000, 0) + // Minimum execution time: 686_000 picoseconds. + Weight::from_parts(737_000, 0) } pub(crate) fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 653_000 picoseconds. - Weight::from_parts(713_000, 0) + // Minimum execution time: 663_000 picoseconds. + Weight::from_parts(740_000, 0) } pub(crate) fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 857_000 picoseconds. - Weight::from_parts(917_000, 0) + // Minimum execution time: 831_000 picoseconds. + Weight::from_parts(933_000, 0) } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -262,25 +271,27 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Paras::Heads` (r:1 w:0) + /// Proof: `Paras::Heads` (`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`) /// Storage: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn query_pallet() -> Weight { // Proof Size summary in bytes: - // Measured: `281` - // Estimated: `3746` - // Minimum execution time: 72_331_000 picoseconds. - Weight::from_parts(74_740_000, 3746) - .saturating_add(T::DbWeight::get().reads(5)) + // Measured: `346` + // Estimated: `3811` + // Minimum execution time: 83_351_000 picoseconds. + Weight::from_parts(87_839_000, 3811) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } pub(crate) fn expect_pallet() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_963_000 picoseconds. - Weight::from_parts(9_183_000, 0) + // Minimum execution time: 9_149_000 picoseconds. + Weight::from_parts(9_375_000, 0) } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -288,52 +299,54 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Paras::Heads` (r:1 w:0) + /// Proof: `Paras::Heads` (`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`) /// Storage: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn report_transact_status() -> Weight { // Proof Size summary in bytes: - // Measured: `281` - // Estimated: `3746` - // Minimum execution time: 62_555_000 picoseconds. - Weight::from_parts(64_824_000, 3746) - .saturating_add(T::DbWeight::get().reads(5)) + // Measured: `346` + // Estimated: `3811` + // Minimum execution time: 73_238_000 picoseconds. + Weight::from_parts(75_951_000, 3811) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } pub(crate) fn clear_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 740_000 picoseconds. - Weight::from_parts(773_000, 0) + // Minimum execution time: 695_000 picoseconds. + Weight::from_parts(808_000, 0) } pub(crate) fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 678_000 picoseconds. - Weight::from_parts(714_000, 0) + // Minimum execution time: 669_000 picoseconds. + Weight::from_parts(750_000, 0) } pub(crate) fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 656_000 picoseconds. - Weight::from_parts(703_000, 0) + // Minimum execution time: 710_000 picoseconds. + Weight::from_parts(809_000, 0) } pub(crate) fn set_fees_mode() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 672_000 picoseconds. - Weight::from_parts(725_000, 0) + // Minimum execution time: 677_000 picoseconds. + Weight::from_parts(743_000, 0) } pub(crate) fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 798_000 picoseconds. - Weight::from_parts(845_000, 0) + // Minimum execution time: 701_000 picoseconds. + Weight::from_parts(813_000, 0) } } diff --git a/polkadot/runtime/westend/src/weights/pallet_indices.rs b/polkadot/runtime/westend/src/weights/pallet_indices.rs index 86ba7618fa8a9..a7baef730b734 100644 --- a/polkadot/runtime/westend/src/weights/pallet_indices.rs +++ b/polkadot/runtime/westend/src/weights/pallet_indices.rs @@ -16,28 +16,29 @@ //! Autogenerated weights for `pallet_indices` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2025-02-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner--ss9ysm1-project-163-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024 +//! HOSTNAME: `7f503db40d1f`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/production/polkadot +// frame-omni-bencher +// v1 // benchmark // pallet -// --chain=westend-dev +// --extrinsic=* +// --runtime=target/production/wbuild/westend-runtime/westend_runtime.wasm +// --pallet=pallet_indices +// --header=/__w/polkadot-sdk/polkadot-sdk/polkadot/file_header.txt +// --output=./polkadot/runtime/westend/src/weights +// --wasm-execution=compiled // --steps=50 // --repeat=20 +// --heap-pages=4096 // --no-storage-info -// --no-median-slopes // --no-min-squares -// --pallet=pallet_indices -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --header=./file_header.txt -// --output=./runtime/westend/src/weights/ +// --no-median-slopes #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -50,73 +51,78 @@ use core::marker::PhantomData; /// Weight functions for `pallet_indices`. pub struct WeightInfo(PhantomData); impl pallet_indices::WeightInfo for WeightInfo { - /// Storage: Indices Accounts (r:1 w:1) - /// Proof: Indices Accounts (max_values: None, max_size: Some(69), added: 2544, mode: MaxEncodedLen) + /// Storage: `Indices::Accounts` (r:1 w:1) + /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn claim() -> Weight { // Proof Size summary in bytes: - // Measured: `142` + // Measured: `4` // Estimated: `3534` - // Minimum execution time: 24_553_000 picoseconds. - Weight::from_parts(25_288_000, 0) + // Minimum execution time: 26_302_000 picoseconds. + Weight::from_parts(27_551_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Indices Accounts (r:1 w:1) - /// Proof: Indices Accounts (max_values: None, max_size: Some(69), added: 2544, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: `Indices::Accounts` (r:1 w:1) + /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `341` + // Measured: `203` // Estimated: `3593` - // Minimum execution time: 35_932_000 picoseconds. - Weight::from_parts(36_801_000, 0) + // Minimum execution time: 40_405_000 picoseconds. + Weight::from_parts(42_668_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Indices Accounts (r:1 w:1) - /// Proof: Indices Accounts (max_values: None, max_size: Some(69), added: 2544, mode: MaxEncodedLen) + /// Storage: `Indices::Accounts` (r:1 w:1) + /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn free() -> Weight { // Proof Size summary in bytes: - // Measured: `238` + // Measured: `100` // Estimated: `3534` - // Minimum execution time: 25_574_000 picoseconds. - Weight::from_parts(26_123_000, 0) + // Minimum execution time: 27_680_000 picoseconds. + Weight::from_parts(28_989_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Indices Accounts (r:1 w:1) - /// Proof: Indices Accounts (max_values: None, max_size: Some(69), added: 2544, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: `Indices::Accounts` (r:1 w:1) + /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn force_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `341` + // Measured: `203` // Estimated: `3593` - // Minimum execution time: 27_605_000 picoseconds. - Weight::from_parts(28_569_000, 0) + // Minimum execution time: 29_933_000 picoseconds. + Weight::from_parts(31_376_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Indices Accounts (r:1 w:1) - /// Proof: Indices Accounts (max_values: None, max_size: Some(69), added: 2544, mode: MaxEncodedLen) + /// Storage: `Indices::Accounts` (r:1 w:1) + /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn freeze() -> Weight { // Proof Size summary in bytes: - // Measured: `238` + // Measured: `100` // Estimated: `3534` - // Minimum execution time: 27_447_000 picoseconds. - Weight::from_parts(28_136_000, 0) + // Minimum execution time: 30_979_000 picoseconds. + Weight::from_parts(31_804_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - // TO-DO: Run CI cmd bot to generate real weights. + /// Storage: `Indices::Accounts` (r:1 w:1) + /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn reconsider() -> Weight { - Weight::from_parts(28_136_000, 0) + // Proof Size summary in bytes: + // Measured: `100` + // Estimated: `3534` + // Minimum execution time: 27_536_000 picoseconds. + Weight::from_parts(28_517_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/polkadot/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/polkadot/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 4e10e72356ab0..a6f97f35d1676 100644 --- a/polkadot/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/polkadot/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -17,17 +17,18 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-12-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-02-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `aa8403b52523`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024 +//! HOSTNAME: `7f503db40d1f`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: -// target/production/polkadot +// frame-omni-bencher +// v1 // benchmark // pallet // --extrinsic=* -// --chain=westend-dev +// --runtime=target/production/wbuild/westend-runtime/westend_runtime.wasm // --pallet=pallet_xcm_benchmarks::generic // --header=/__w/polkadot-sdk/polkadot-sdk/polkadot/file_header.txt // --output=./polkadot/runtime/westend/src/weights/xcm @@ -57,39 +58,41 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Paras::Heads` (r:1 w:0) + /// Proof: `Paras::Heads` (`max_values`: None, `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: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn report_holding() -> Weight { // Proof Size summary in bytes: - // Measured: `351` + // Measured: `416` // Estimated: `6196` - // Minimum execution time: 74_868_000 picoseconds. - Weight::from_parts(77_531_000, 6196) - .saturating_add(T::DbWeight::get().reads(6)) + // Minimum execution time: 83_237_000 picoseconds. + Weight::from_parts(86_371_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(4)) } pub(crate) fn buy_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 688_000 picoseconds. - Weight::from_parts(733_000, 0) + // Minimum execution time: 675_000 picoseconds. + Weight::from_parts(746_000, 0) } pub(crate) fn pay_fees() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_491_000 picoseconds. - Weight::from_parts(3_667_000, 0) + // Minimum execution time: 3_505_000 picoseconds. + Weight::from_parts(3_752_000, 0) } pub(crate) fn asset_claimer() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 757_000 picoseconds. - Weight::from_parts(804_000, 0) + // Minimum execution time: 692_000 picoseconds. + Weight::from_parts(793_000, 0) } /// Storage: `XcmPallet::Queries` (r:1 w:0) /// Proof: `XcmPallet::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -97,65 +100,65 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 6_322_000 picoseconds. - Weight::from_parts(6_565_000, 3465) + // Minimum execution time: 6_346_000 picoseconds. + Weight::from_parts(6_600_000, 3465) .saturating_add(T::DbWeight::get().reads(1)) } pub(crate) fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_841_000 picoseconds. - Weight::from_parts(8_240_000, 0) + // Minimum execution time: 7_612_000 picoseconds. + Weight::from_parts(8_049_000, 0) } pub(crate) fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_327_000 picoseconds. - Weight::from_parts(1_460_000, 0) + // Minimum execution time: 1_307_000 picoseconds. + Weight::from_parts(1_401_000, 0) } pub(crate) fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 680_000 picoseconds. - Weight::from_parts(752_000, 0) + // Minimum execution time: 684_000 picoseconds. + Weight::from_parts(767_000, 0) } pub(crate) fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 712_000 picoseconds. - Weight::from_parts(764_000, 0) + // Minimum execution time: 724_000 picoseconds. + Weight::from_parts(778_000, 0) } pub(crate) fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 663_000 picoseconds. - Weight::from_parts(712_000, 0) + // Minimum execution time: 668_000 picoseconds. + Weight::from_parts(732_000, 0) } pub(crate) fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 756_000 picoseconds. - Weight::from_parts(801_000, 0) + // Minimum execution time: 727_000 picoseconds. + Weight::from_parts(779_000, 0) } pub(crate) fn execute_with_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 773_000 picoseconds. - Weight::from_parts(822_000, 0) + // Minimum execution time: 808_000 picoseconds. + Weight::from_parts(859_000, 0) } pub(crate) fn clear_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 669_000 picoseconds. - Weight::from_parts(750_000, 0) + // Minimum execution time: 714_000 picoseconds. + Weight::from_parts(768_000, 0) } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -163,17 +166,19 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Paras::Heads` (r:1 w:0) + /// Proof: `Paras::Heads` (`max_values`: None, `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: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn report_error() -> Weight { // Proof Size summary in bytes: - // Measured: `351` + // Measured: `416` // Estimated: `6196` - // Minimum execution time: 73_173_000 picoseconds. - Weight::from_parts(75_569_000, 6196) - .saturating_add(T::DbWeight::get().reads(6)) + // Minimum execution time: 81_018_000 picoseconds. + Weight::from_parts(83_909_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: `XcmPallet::AssetTraps` (r:1 w:1) @@ -182,8 +187,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `23` // Estimated: `3488` - // Minimum execution time: 9_851_000 picoseconds. - Weight::from_parts(10_087_000, 3488) + // Minimum execution time: 9_636_000 picoseconds. + Weight::from_parts(9_973_000, 3488) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -191,8 +196,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 673_000 picoseconds. - Weight::from_parts(744_000, 0) + // Minimum execution time: 629_000 picoseconds. + Weight::from_parts(727_000, 0) } /// Storage: `XcmPallet::VersionNotifyTargets` (r:1 w:1) /// Proof: `XcmPallet::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -202,15 +207,17 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Paras::Heads` (r:1 w:0) + /// Proof: `Paras::Heads` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn subscribe_version() -> Weight { // Proof Size summary in bytes: - // Measured: `147` - // Estimated: `3612` - // Minimum execution time: 35_714_000 picoseconds. - Weight::from_parts(36_987_000, 3612) - .saturating_add(T::DbWeight::get().reads(5)) + // Measured: `212` + // Estimated: `3677` + // Minimum execution time: 42_829_000 picoseconds. + Weight::from_parts(44_173_000, 3677) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `XcmPallet::VersionNotifyTargets` (r:0 w:1) @@ -219,44 +226,44 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_128_000 picoseconds. - Weight::from_parts(3_364_000, 0) + // Minimum execution time: 3_237_000 picoseconds. + Weight::from_parts(3_424_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } pub(crate) fn burn_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_070_000 picoseconds. + // Minimum execution time: 1_132_000 picoseconds. Weight::from_parts(1_188_000, 0) } pub(crate) fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 764_000 picoseconds. - Weight::from_parts(863_000, 0) + // Minimum execution time: 842_000 picoseconds. + Weight::from_parts(908_000, 0) } pub(crate) fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 675_000 picoseconds. - Weight::from_parts(755_000, 0) + // Minimum execution time: 692_000 picoseconds. + Weight::from_parts(736_000, 0) } pub(crate) fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 666_000 picoseconds. - Weight::from_parts(745_000, 0) + // Minimum execution time: 675_000 picoseconds. + Weight::from_parts(720_000, 0) } pub(crate) fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 838_000 picoseconds. - Weight::from_parts(918_000, 0) + // Minimum execution time: 837_000 picoseconds. + Weight::from_parts(923_000, 0) } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -264,25 +271,27 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Paras::Heads` (r:1 w:0) + /// Proof: `Paras::Heads` (`max_values`: None, `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: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn query_pallet() -> Weight { // Proof Size summary in bytes: - // Measured: `351` + // Measured: `416` // Estimated: `6196` - // Minimum execution time: 82_721_000 picoseconds. - Weight::from_parts(85_411_000, 6196) - .saturating_add(T::DbWeight::get().reads(6)) + // Minimum execution time: 92_276_000 picoseconds. + Weight::from_parts(94_218_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(4)) } pub(crate) fn expect_pallet() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_138_000 picoseconds. - Weight::from_parts(8_344_000, 0) + // Minimum execution time: 8_304_000 picoseconds. + Weight::from_parts(8_503_000, 0) } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -290,59 +299,61 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Paras::Heads` (r:1 w:0) + /// Proof: `Paras::Heads` (`max_values`: None, `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: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn report_transact_status() -> Weight { // Proof Size summary in bytes: - // Measured: `351` + // Measured: `416` // Estimated: `6196` - // Minimum execution time: 73_617_000 picoseconds. - Weight::from_parts(76_999_000, 6196) - .saturating_add(T::DbWeight::get().reads(6)) + // Minimum execution time: 85_089_000 picoseconds. + Weight::from_parts(95_774_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(4)) } pub(crate) fn clear_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 714_000 picoseconds. - Weight::from_parts(806_000, 0) + // Minimum execution time: 724_000 picoseconds. + Weight::from_parts(852_000, 0) } pub(crate) fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 676_000 picoseconds. - Weight::from_parts(720_000, 0) + // Minimum execution time: 679_000 picoseconds. + Weight::from_parts(718_000, 0) } pub(crate) fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 666_000 picoseconds. - Weight::from_parts(731_000, 0) + // Minimum execution time: 673_000 picoseconds. + Weight::from_parts(743_000, 0) } pub(crate) fn set_fees_mode() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 662_000 picoseconds. - Weight::from_parts(696_000, 0) + // Minimum execution time: 644_000 picoseconds. + Weight::from_parts(728_000, 0) } pub(crate) fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 693_000 picoseconds. - Weight::from_parts(760_000, 0) + // Minimum execution time: 691_000 picoseconds. + Weight::from_parts(750_000, 0) } pub(crate) fn alias_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 705_000 picoseconds. - Weight::from_parts(746_000, 0) + // Minimum execution time: 691_000 picoseconds. + Weight::from_parts(768_000, 0) } } From 634b981be64debfb130940a4a6cfe7dfa274fafc Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Tue, 18 Feb 2025 12:01:51 +0000 Subject: [PATCH 10/26] revert benching xcm pallets --- .../xcm/pallet_xcm_benchmarks_generic.rs | 193 ++++++++---------- .../xcm/pallet_xcm_benchmarks_generic.rs | 171 ++++++++-------- 2 files changed, 170 insertions(+), 194 deletions(-) diff --git a/polkadot/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/polkadot/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 42892e9b57c76..40b648feae1c9 100644 --- a/polkadot/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/polkadot/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -17,29 +17,26 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-11-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `7f503db40d1f`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 +//! HOSTNAME: `runner-vcatxqpx-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024 // Executed Command: -// frame-omni-bencher -// v1 +// target/production/polkadot // benchmark // pallet -// --extrinsic=* -// --runtime=target/production/wbuild/rococo-runtime/rococo_runtime.wasm -// --pallet=pallet_xcm_benchmarks::generic -// --header=/__w/polkadot-sdk/polkadot-sdk/polkadot/file_header.txt -// --output=./polkadot/runtime/rococo/src/weights/xcm -// --wasm-execution=compiled // --steps=50 // --repeat=20 +// --extrinsic=* +// --wasm-execution=compiled // --heap-pages=4096 -// --template=polkadot/xcm/pallet-xcm-benchmarks/template.hbs -// --no-storage-info -// --no-min-squares -// --no-median-slopes +// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json +// --pallet=pallet_xcm_benchmarks::generic +// --chain=rococo-dev +// --header=./polkadot/file_header.txt +// --template=./polkadot/xcm/pallet-xcm-benchmarks/template.hbs +// --output=./polkadot/runtime/rococo/src/weights/xcm/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -58,41 +55,39 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Paras::Heads` (r:1 w:0) - /// Proof: `Paras::Heads` (`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`) /// Storage: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn report_holding() -> Weight { // Proof Size summary in bytes: - // Measured: `346` - // Estimated: `3811` - // Minimum execution time: 75_278_000 picoseconds. - Weight::from_parts(79_252_000, 3811) - .saturating_add(T::DbWeight::get().reads(6)) + // Measured: `281` + // Estimated: `3746` + // Minimum execution time: 65_164_000 picoseconds. + Weight::from_parts(66_965_000, 3746) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } pub(crate) fn buy_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 685_000 picoseconds. - Weight::from_parts(764_000, 0) + // Minimum execution time: 675_000 picoseconds. + Weight::from_parts(745_000, 0) } pub(crate) fn pay_fees() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_505_000 picoseconds. - Weight::from_parts(3_680_000, 0) + // Minimum execution time: 2_899_000 picoseconds. + Weight::from_parts(3_090_000, 0) } pub(crate) fn asset_claimer() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 783_000 picoseconds. - Weight::from_parts(853_000, 0) + // Minimum execution time: 669_000 picoseconds. + Weight::from_parts(714_000, 0) } /// Storage: `XcmPallet::Queries` (r:1 w:0) /// Proof: `XcmPallet::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -100,65 +95,65 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 6_261_000 picoseconds. - Weight::from_parts(6_520_000, 3465) + // Minimum execution time: 6_004_000 picoseconds. + Weight::from_parts(6_152_000, 3465) .saturating_add(T::DbWeight::get().reads(1)) } pub(crate) fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_976_000 picoseconds. - Weight::from_parts(8_240_000, 0) + // Minimum execution time: 7_296_000 picoseconds. + Weight::from_parts(7_533_000, 0) } pub(crate) fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_306_000 picoseconds. - Weight::from_parts(1_392_000, 0) + // Minimum execution time: 1_292_000 picoseconds. + Weight::from_parts(1_414_000, 0) } pub(crate) fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 689_000 picoseconds. - Weight::from_parts(767_000, 0) + // Minimum execution time: 741_000 picoseconds. + Weight::from_parts(775_000, 0) } pub(crate) fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 741_000 picoseconds. - Weight::from_parts(800_000, 0) + // Minimum execution time: 702_000 picoseconds. + Weight::from_parts(770_000, 0) } pub(crate) fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 658_000 picoseconds. - Weight::from_parts(725_000, 0) + // Minimum execution time: 648_000 picoseconds. + Weight::from_parts(744_000, 0) } pub(crate) fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 777_000 picoseconds. - Weight::from_parts(831_000, 0) + // Minimum execution time: 731_000 picoseconds. + Weight::from_parts(772_000, 0) } pub(crate) fn execute_with_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 774_000 picoseconds. - Weight::from_parts(849_000, 0) + // Minimum execution time: 790_000 picoseconds. + Weight::from_parts(843_000, 0) } pub(crate) fn clear_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 692_000 picoseconds. - Weight::from_parts(777_000, 0) + // Minimum execution time: 647_000 picoseconds. + Weight::from_parts(731_000, 0) } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -166,19 +161,17 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Paras::Heads` (r:1 w:0) - /// Proof: `Paras::Heads` (`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`) /// Storage: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn report_error() -> Weight { // Proof Size summary in bytes: - // Measured: `346` - // Estimated: `3811` - // Minimum execution time: 71_492_000 picoseconds. - Weight::from_parts(74_979_000, 3811) - .saturating_add(T::DbWeight::get().reads(6)) + // Measured: `281` + // Estimated: `3746` + // Minimum execution time: 62_808_000 picoseconds. + Weight::from_parts(64_413_000, 3746) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `XcmPallet::AssetTraps` (r:1 w:1) @@ -187,8 +180,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `23` // Estimated: `3488` - // Minimum execution time: 9_609_000 picoseconds. - Weight::from_parts(10_017_000, 3488) + // Minimum execution time: 9_298_000 picoseconds. + Weight::from_parts(9_541_000, 3488) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -196,8 +189,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 656_000 picoseconds. - Weight::from_parts(733_000, 0) + // Minimum execution time: 696_000 picoseconds. + Weight::from_parts(732_000, 0) } /// Storage: `XcmPallet::VersionNotifyTargets` (r:1 w:1) /// Proof: `XcmPallet::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -207,17 +200,15 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Paras::Heads` (r:1 w:0) - /// Proof: `Paras::Heads` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn subscribe_version() -> Weight { // Proof Size summary in bytes: - // Measured: `245` - // Estimated: `3710` - // Minimum execution time: 38_223_000 picoseconds. - Weight::from_parts(39_642_000, 3710) - .saturating_add(T::DbWeight::get().reads(6)) + // Measured: `180` + // Estimated: `3645` + // Minimum execution time: 30_585_000 picoseconds. + Weight::from_parts(31_622_000, 3645) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `XcmPallet::VersionNotifyTargets` (r:0 w:1) @@ -226,44 +217,44 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_225_000 picoseconds. - Weight::from_parts(3_342_000, 0) + // Minimum execution time: 3_036_000 picoseconds. + Weight::from_parts(3_196_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } pub(crate) fn burn_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_158_000 picoseconds. - Weight::from_parts(1_236_000, 0) + // Minimum execution time: 1_035_000 picoseconds. + Weight::from_parts(1_133_000, 0) } pub(crate) fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 833_000 picoseconds. - Weight::from_parts(897_000, 0) + // Minimum execution time: 764_000 picoseconds. + Weight::from_parts(802_000, 0) } pub(crate) fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 686_000 picoseconds. - Weight::from_parts(737_000, 0) + // Minimum execution time: 682_000 picoseconds. + Weight::from_parts(724_000, 0) } pub(crate) fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 663_000 picoseconds. - Weight::from_parts(740_000, 0) + // Minimum execution time: 653_000 picoseconds. + Weight::from_parts(713_000, 0) } pub(crate) fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 831_000 picoseconds. - Weight::from_parts(933_000, 0) + // Minimum execution time: 857_000 picoseconds. + Weight::from_parts(917_000, 0) } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -271,27 +262,25 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Paras::Heads` (r:1 w:0) - /// Proof: `Paras::Heads` (`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`) /// Storage: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn query_pallet() -> Weight { // Proof Size summary in bytes: - // Measured: `346` - // Estimated: `3811` - // Minimum execution time: 83_351_000 picoseconds. - Weight::from_parts(87_839_000, 3811) - .saturating_add(T::DbWeight::get().reads(6)) + // Measured: `281` + // Estimated: `3746` + // Minimum execution time: 72_331_000 picoseconds. + Weight::from_parts(74_740_000, 3746) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } pub(crate) fn expect_pallet() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_149_000 picoseconds. - Weight::from_parts(9_375_000, 0) + // Minimum execution time: 8_963_000 picoseconds. + Weight::from_parts(9_183_000, 0) } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -299,54 +288,52 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Paras::Heads` (r:1 w:0) - /// Proof: `Paras::Heads` (`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`) /// Storage: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn report_transact_status() -> Weight { // Proof Size summary in bytes: - // Measured: `346` - // Estimated: `3811` - // Minimum execution time: 73_238_000 picoseconds. - Weight::from_parts(75_951_000, 3811) - .saturating_add(T::DbWeight::get().reads(6)) + // Measured: `281` + // Estimated: `3746` + // Minimum execution time: 62_555_000 picoseconds. + Weight::from_parts(64_824_000, 3746) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } pub(crate) fn clear_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 695_000 picoseconds. - Weight::from_parts(808_000, 0) + // Minimum execution time: 740_000 picoseconds. + Weight::from_parts(773_000, 0) } pub(crate) fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 669_000 picoseconds. - Weight::from_parts(750_000, 0) + // Minimum execution time: 678_000 picoseconds. + Weight::from_parts(714_000, 0) } pub(crate) fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 710_000 picoseconds. - Weight::from_parts(809_000, 0) + // Minimum execution time: 656_000 picoseconds. + Weight::from_parts(703_000, 0) } pub(crate) fn set_fees_mode() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 677_000 picoseconds. - Weight::from_parts(743_000, 0) + // Minimum execution time: 672_000 picoseconds. + Weight::from_parts(725_000, 0) } pub(crate) fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 701_000 picoseconds. - Weight::from_parts(813_000, 0) + // Minimum execution time: 798_000 picoseconds. + Weight::from_parts(845_000, 0) } -} +} \ No newline at end of file diff --git a/polkadot/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/polkadot/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index a6f97f35d1676..b6ccdcb3963b3 100644 --- a/polkadot/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/polkadot/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -17,18 +17,17 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-12-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `7f503db40d1f`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 +//! HOSTNAME: `aa8403b52523`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024 // Executed Command: -// frame-omni-bencher -// v1 +// target/production/polkadot // benchmark // pallet // --extrinsic=* -// --runtime=target/production/wbuild/westend-runtime/westend_runtime.wasm +// --chain=westend-dev // --pallet=pallet_xcm_benchmarks::generic // --header=/__w/polkadot-sdk/polkadot-sdk/polkadot/file_header.txt // --output=./polkadot/runtime/westend/src/weights/xcm @@ -58,41 +57,39 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Paras::Heads` (r:1 w:0) - /// Proof: `Paras::Heads` (`max_values`: None, `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: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn report_holding() -> Weight { // Proof Size summary in bytes: - // Measured: `416` + // Measured: `351` // Estimated: `6196` - // Minimum execution time: 83_237_000 picoseconds. - Weight::from_parts(86_371_000, 6196) - .saturating_add(T::DbWeight::get().reads(7)) + // Minimum execution time: 74_868_000 picoseconds. + Weight::from_parts(77_531_000, 6196) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } pub(crate) fn buy_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 675_000 picoseconds. - Weight::from_parts(746_000, 0) + // Minimum execution time: 688_000 picoseconds. + Weight::from_parts(733_000, 0) } pub(crate) fn pay_fees() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_505_000 picoseconds. - Weight::from_parts(3_752_000, 0) + // Minimum execution time: 3_491_000 picoseconds. + Weight::from_parts(3_667_000, 0) } pub(crate) fn asset_claimer() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 692_000 picoseconds. - Weight::from_parts(793_000, 0) + // Minimum execution time: 757_000 picoseconds. + Weight::from_parts(804_000, 0) } /// Storage: `XcmPallet::Queries` (r:1 w:0) /// Proof: `XcmPallet::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -100,65 +97,65 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 6_346_000 picoseconds. - Weight::from_parts(6_600_000, 3465) + // Minimum execution time: 6_322_000 picoseconds. + Weight::from_parts(6_565_000, 3465) .saturating_add(T::DbWeight::get().reads(1)) } pub(crate) fn transact() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_612_000 picoseconds. - Weight::from_parts(8_049_000, 0) + // Minimum execution time: 7_841_000 picoseconds. + Weight::from_parts(8_240_000, 0) } pub(crate) fn refund_surplus() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_307_000 picoseconds. - Weight::from_parts(1_401_000, 0) + // Minimum execution time: 1_327_000 picoseconds. + Weight::from_parts(1_460_000, 0) } pub(crate) fn set_error_handler() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 684_000 picoseconds. - Weight::from_parts(767_000, 0) + // Minimum execution time: 680_000 picoseconds. + Weight::from_parts(752_000, 0) } pub(crate) fn set_appendix() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 724_000 picoseconds. - Weight::from_parts(778_000, 0) + // Minimum execution time: 712_000 picoseconds. + Weight::from_parts(764_000, 0) } pub(crate) fn clear_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 668_000 picoseconds. - Weight::from_parts(732_000, 0) + // Minimum execution time: 663_000 picoseconds. + Weight::from_parts(712_000, 0) } pub(crate) fn descend_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 727_000 picoseconds. - Weight::from_parts(779_000, 0) + // Minimum execution time: 756_000 picoseconds. + Weight::from_parts(801_000, 0) } pub(crate) fn execute_with_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 808_000 picoseconds. - Weight::from_parts(859_000, 0) + // Minimum execution time: 773_000 picoseconds. + Weight::from_parts(822_000, 0) } pub(crate) fn clear_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 714_000 picoseconds. - Weight::from_parts(768_000, 0) + // Minimum execution time: 669_000 picoseconds. + Weight::from_parts(750_000, 0) } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -166,19 +163,17 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Paras::Heads` (r:1 w:0) - /// Proof: `Paras::Heads` (`max_values`: None, `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: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn report_error() -> Weight { // Proof Size summary in bytes: - // Measured: `416` + // Measured: `351` // Estimated: `6196` - // Minimum execution time: 81_018_000 picoseconds. - Weight::from_parts(83_909_000, 6196) - .saturating_add(T::DbWeight::get().reads(7)) + // Minimum execution time: 73_173_000 picoseconds. + Weight::from_parts(75_569_000, 6196) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: `XcmPallet::AssetTraps` (r:1 w:1) @@ -187,8 +182,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `23` // Estimated: `3488` - // Minimum execution time: 9_636_000 picoseconds. - Weight::from_parts(9_973_000, 3488) + // Minimum execution time: 9_851_000 picoseconds. + Weight::from_parts(10_087_000, 3488) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -196,8 +191,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 629_000 picoseconds. - Weight::from_parts(727_000, 0) + // Minimum execution time: 673_000 picoseconds. + Weight::from_parts(744_000, 0) } /// Storage: `XcmPallet::VersionNotifyTargets` (r:1 w:1) /// Proof: `XcmPallet::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -207,17 +202,15 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Paras::Heads` (r:1 w:0) - /// Proof: `Paras::Heads` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn subscribe_version() -> Weight { // Proof Size summary in bytes: - // Measured: `212` - // Estimated: `3677` - // Minimum execution time: 42_829_000 picoseconds. - Weight::from_parts(44_173_000, 3677) - .saturating_add(T::DbWeight::get().reads(6)) + // Measured: `147` + // Estimated: `3612` + // Minimum execution time: 35_714_000 picoseconds. + Weight::from_parts(36_987_000, 3612) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `XcmPallet::VersionNotifyTargets` (r:0 w:1) @@ -226,44 +219,44 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_237_000 picoseconds. - Weight::from_parts(3_424_000, 0) + // Minimum execution time: 3_128_000 picoseconds. + Weight::from_parts(3_364_000, 0) .saturating_add(T::DbWeight::get().writes(1)) } pub(crate) fn burn_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_132_000 picoseconds. + // Minimum execution time: 1_070_000 picoseconds. Weight::from_parts(1_188_000, 0) } pub(crate) fn expect_asset() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 842_000 picoseconds. - Weight::from_parts(908_000, 0) + // Minimum execution time: 764_000 picoseconds. + Weight::from_parts(863_000, 0) } pub(crate) fn expect_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 692_000 picoseconds. - Weight::from_parts(736_000, 0) + // Minimum execution time: 675_000 picoseconds. + Weight::from_parts(755_000, 0) } pub(crate) fn expect_error() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 675_000 picoseconds. - Weight::from_parts(720_000, 0) + // Minimum execution time: 666_000 picoseconds. + Weight::from_parts(745_000, 0) } pub(crate) fn expect_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 837_000 picoseconds. - Weight::from_parts(923_000, 0) + // Minimum execution time: 838_000 picoseconds. + Weight::from_parts(918_000, 0) } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -271,27 +264,25 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Paras::Heads` (r:1 w:0) - /// Proof: `Paras::Heads` (`max_values`: None, `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: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn query_pallet() -> Weight { // Proof Size summary in bytes: - // Measured: `416` + // Measured: `351` // Estimated: `6196` - // Minimum execution time: 92_276_000 picoseconds. - Weight::from_parts(94_218_000, 6196) - .saturating_add(T::DbWeight::get().reads(7)) + // Minimum execution time: 82_721_000 picoseconds. + Weight::from_parts(85_411_000, 6196) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } pub(crate) fn expect_pallet() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_304_000 picoseconds. - Weight::from_parts(8_503_000, 0) + // Minimum execution time: 8_138_000 picoseconds. + Weight::from_parts(8_344_000, 0) } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -299,61 +290,59 @@ impl WeightInfo { /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Paras::Heads` (r:1 w:0) - /// Proof: `Paras::Heads` (`max_values`: None, `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: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) pub(crate) fn report_transact_status() -> Weight { // Proof Size summary in bytes: - // Measured: `416` + // Measured: `351` // Estimated: `6196` - // Minimum execution time: 85_089_000 picoseconds. - Weight::from_parts(95_774_000, 6196) - .saturating_add(T::DbWeight::get().reads(7)) + // Minimum execution time: 73_617_000 picoseconds. + Weight::from_parts(76_999_000, 6196) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } pub(crate) fn clear_transact_status() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 724_000 picoseconds. - Weight::from_parts(852_000, 0) + // Minimum execution time: 714_000 picoseconds. + Weight::from_parts(806_000, 0) } pub(crate) fn set_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 679_000 picoseconds. - Weight::from_parts(718_000, 0) + // Minimum execution time: 676_000 picoseconds. + Weight::from_parts(720_000, 0) } pub(crate) fn clear_topic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 673_000 picoseconds. - Weight::from_parts(743_000, 0) + // Minimum execution time: 666_000 picoseconds. + Weight::from_parts(731_000, 0) } pub(crate) fn set_fees_mode() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 644_000 picoseconds. - Weight::from_parts(728_000, 0) + // Minimum execution time: 662_000 picoseconds. + Weight::from_parts(696_000, 0) } pub(crate) fn unpaid_execution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 691_000 picoseconds. - Weight::from_parts(750_000, 0) + // Minimum execution time: 693_000 picoseconds. + Weight::from_parts(760_000, 0) } pub(crate) fn alias_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 691_000 picoseconds. - Weight::from_parts(768_000, 0) + // Minimum execution time: 705_000 picoseconds. + Weight::from_parts(746_000, 0) } -} +} \ No newline at end of file From a3f95b4d5c69d51939a8ad4e166c8c46323cc559 Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 12:02:48 +0000 Subject: [PATCH 11/26] Update from UtkarshBhardwaj007 running command 'fmt' --- substrate/frame/indices/src/lib.rs | 25 ++++++++++++++------- substrate/frame/indices/src/tests.rs | 33 ++++++++-------------------- 2 files changed, 26 insertions(+), 32 deletions(-) diff --git a/substrate/frame/indices/src/lib.rs b/substrate/frame/indices/src/lib.rs index a2e7cbe8b2e20..1587df4406a1a 100644 --- a/substrate/frame/indices/src/lib.rs +++ b/substrate/frame/indices/src/lib.rs @@ -234,25 +234,29 @@ pub mod pallet { } /// Reconsider the deposit reserved for an index. - /// + /// /// The dispatch origin for this call must be _Signed_ and the signing account must have a /// non-frozen account `index`. - /// + /// /// The transaction fees is waived if the deposit is changed after reconsideration. - /// + /// /// - `index`: the index whose deposit is to be reconsidered. - /// + /// /// Emits `DepositReconsidered` if successful. - /// + /// /// ## Complexity /// - `O(1)`. #[pallet::call_index(5)] #[pallet::weight(T::WeightInfo::reconsider())] - pub fn reconsider(origin: OriginFor, index: T::AccountIndex) -> DispatchResultWithPostInfo { + pub fn reconsider( + origin: OriginFor, + index: T::AccountIndex, + ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; Accounts::::try_mutate(index, |maybe_value| -> DispatchResultWithPostInfo { - let (account, old_amount, perm) = maybe_value.take().ok_or(Error::::NotAssigned)?; + let (account, old_amount, perm) = + maybe_value.take().ok_or(Error::::NotAssigned)?; ensure!(!perm, Error::::Permanent); ensure!(account == who, Error::::NotOwner); @@ -294,7 +298,12 @@ pub mod pallet { /// A account index has been frozen to its current account ID. IndexFrozen { index: T::AccountIndex, who: T::AccountId }, /// A deposit to reserve an index has been reconsidered. - DepositReconsidered { who: T::AccountId, index: T::AccountIndex, old_deposit: BalanceOf, new_deposit: BalanceOf }, + DepositReconsidered { + who: T::AccountId, + index: T::AccountIndex, + old_deposit: BalanceOf, + new_deposit: BalanceOf, + }, } #[pallet::error] diff --git a/substrate/frame/indices/src/tests.rs b/substrate/frame/indices/src/tests.rs index 7937d2e652f1f..e8af37998b283 100644 --- a/substrate/frame/indices/src/tests.rs +++ b/substrate/frame/indices/src/tests.rs @@ -123,10 +123,7 @@ fn force_transfer_index_on_free_should_work() { #[test] fn reconsider_should_fail_for_unassigned_index() { new_test_ext().execute_with(|| { - assert_noop!( - Indices::reconsider(Some(1).into(), 0), - Error::::NotAssigned - ); + assert_noop!(Indices::reconsider(Some(1).into(), 0), Error::::NotAssigned); }); } @@ -134,10 +131,7 @@ fn reconsider_should_fail_for_unassigned_index() { fn reconsider_should_fail_for_wrong_owner() { new_test_ext().execute_with(|| { assert_ok!(Indices::claim(Some(1).into(), 0)); - assert_noop!( - Indices::reconsider(Some(2).into(), 0), - Error::::NotOwner - ); + assert_noop!(Indices::reconsider(Some(2).into(), 0), Error::::NotOwner); }); } @@ -146,10 +140,7 @@ fn reconsider_should_fail_for_permanent_index() { new_test_ext().execute_with(|| { assert_ok!(Indices::claim(Some(1).into(), 0)); assert_ok!(Indices::freeze(Some(1).into(), 0)); - assert_noop!( - Indices::reconsider(Some(1).into(), 0), - Error::::Permanent - ); + assert_noop!(Indices::reconsider(Some(1).into(), 0), Error::::Permanent); }); } @@ -188,12 +179,9 @@ fn reconsider_should_work_when_deposit_increases() { // Balance should only reduce by the deposit difference assert_eq!(Balances::free_balance(1), initial_balance - 1); - System::assert_has_event(Event::DepositReconsidered { - who: 1, - index: 0, - old_deposit: 1, - new_deposit: 2 - }.into()); + System::assert_has_event( + Event::DepositReconsidered { who: 1, index: 0, old_deposit: 1, new_deposit: 2 }.into(), + ); }); } @@ -218,12 +206,9 @@ fn reconsider_should_work_when_deposit_decreases() { // Balance should increase by the unreserved amount assert_eq!(Balances::free_balance(1), initial_balance + 1); - System::assert_has_event(Event::DepositReconsidered { - who: 1, - index: 0, - old_deposit: 2, - new_deposit: 1 - }.into()); + System::assert_has_event( + Event::DepositReconsidered { who: 1, index: 0, old_deposit: 2, new_deposit: 1 }.into(), + ); }); } From b81f6a874b012f511377aafaa9db6eccd4d71c69 Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Tue, 18 Feb 2025 12:10:10 +0000 Subject: [PATCH 12/26] Revert changes in pallet_xcm_benchmarks_generic.rs --- .../rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs | 2 +- .../westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/polkadot/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/polkadot/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 40b648feae1c9..2dc8880c83265 100644 --- a/polkadot/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/polkadot/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -336,4 +336,4 @@ impl WeightInfo { // Minimum execution time: 798_000 picoseconds. Weight::from_parts(845_000, 0) } -} \ No newline at end of file +} diff --git a/polkadot/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/polkadot/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index b6ccdcb3963b3..4e10e72356ab0 100644 --- a/polkadot/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/polkadot/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -345,4 +345,4 @@ impl WeightInfo { // Minimum execution time: 705_000 picoseconds. Weight::from_parts(746_000, 0) } -} \ No newline at end of file +} From 8b059d229b1c1db21db84581762f78ede7a15b30 Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Tue, 18 Feb 2025 12:31:06 +0000 Subject: [PATCH 13/26] delete prdoc to allow CI cmd bot to create new prdoc --- prdoc/pr_7587.prdoc | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 prdoc/pr_7587.prdoc diff --git a/prdoc/pr_7587.prdoc b/prdoc/pr_7587.prdoc deleted file mode 100644 index 7f41acf53f088..0000000000000 --- a/prdoc/pr_7587.prdoc +++ /dev/null @@ -1,20 +0,0 @@ -title: Poke deposits -doc: -- audience: Runtime Dev - description: |- - # Description - - * This PR adds a new extrinsic `reconsider` to `pallet-indices`. This extrinsic will be used to re-adjust the deposits made in the pallet. - * Part of #5591 - - ## Review Notes - - * Added a new extrinsic `reconsider` in `pallet-indices`. - * Added a new event `DepositReconsidered` to be emitted upon a successful call of the extrinsic. - * Although the immediate use of the extrinsic will be to give back some of the deposit after the AH-migration, the extrinsic is written such that it can work if the deposit decreases or increases (both). - * The call to the extrinsic would be `free` if an actual adjustment is made to the deposit and `paid` otherwise. - * Added tests to test all scenarios. - * Added a benchmark to test the "worst case" (maximum compute) flow of the extrinsic which is when the deposit amount is updated to a new value. -crates: -- name: pallet-indices - bump: major From b7de8d2c907a0f474ba1b9aa17705f451d2e4063 Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 12:34:57 +0000 Subject: [PATCH 14/26] Update from UtkarshBhardwaj007 running command 'prdoc' --- prdoc/pr_7587.prdoc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 prdoc/pr_7587.prdoc diff --git a/prdoc/pr_7587.prdoc b/prdoc/pr_7587.prdoc new file mode 100644 index 0000000000000..70f0f3aea4b0e --- /dev/null +++ b/prdoc/pr_7587.prdoc @@ -0,0 +1,28 @@ +title: '[AHM] Poke deposits: Indices pallet' +doc: +- audience: Todo + description: |- + # Description + + * This PR adds a new extrinsic `reconsider` to `pallet-indices`. This extrinsic will be used to re-adjust the deposits made in the pallet. + * Part of #5591 + + ## Review Notes + + * Added a new extrinsic `reconsider` in `pallet-indices`. + * Added a new event `DepositReconsidered` to be emitted upon a successful call of the extrinsic. + * Although the immediate use of the extrinsic will be to give back some of the deposit after the AH-migration, the extrinsic is written such that it can work if the deposit decreases or increases (both). + * The call to the extrinsic would be `free` if an actual adjustment is made to the deposit and `paid` otherwise. + * Added tests to test all scenarios. + * Added a benchmark to test the "worst case" (maximum compute) flow of the extrinsic which is when the deposit amount is updated to a new value. + + ## TO-DOs + + * [x] Run CI cmd bot to benchmark +crates: +- name: pallet-indices + bump: major +- name: rococo-runtime + bump: major +- name: westend-runtime + bump: major From 0975fe7528c62a6aae33f3166cd3d848cffeaa44 Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Tue, 18 Feb 2025 12:51:23 +0000 Subject: [PATCH 15/26] update prdoc --- prdoc/pr_7587.prdoc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/prdoc/pr_7587.prdoc b/prdoc/pr_7587.prdoc index 70f0f3aea4b0e..5a34474d94e08 100644 --- a/prdoc/pr_7587.prdoc +++ b/prdoc/pr_7587.prdoc @@ -1,6 +1,6 @@ title: '[AHM] Poke deposits: Indices pallet' doc: -- audience: Todo +- audience: Runtime Dev description: |- # Description @@ -15,14 +15,10 @@ doc: * The call to the extrinsic would be `free` if an actual adjustment is made to the deposit and `paid` otherwise. * Added tests to test all scenarios. * Added a benchmark to test the "worst case" (maximum compute) flow of the extrinsic which is when the deposit amount is updated to a new value. - - ## TO-DOs - - * [x] Run CI cmd bot to benchmark crates: - name: pallet-indices - bump: major + bump: minor - name: rococo-runtime - bump: major + bump: patch - name: westend-runtime - bump: major + bump: patch From b07bd1470286bd7668d351510b2060221d3ec854 Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Tue, 18 Feb 2025 15:48:13 +0000 Subject: [PATCH 16/26] address comments --- prdoc/pr_7587.prdoc | 21 ++++------------- substrate/frame/indices/src/benchmarking.rs | 10 ++++----- substrate/frame/indices/src/lib.rs | 3 --- substrate/frame/indices/src/tests.rs | 16 ++++++------- substrate/frame/indices/src/weights.rs | 25 +++++++++++++++------ 5 files changed, 35 insertions(+), 40 deletions(-) diff --git a/prdoc/pr_7587.prdoc b/prdoc/pr_7587.prdoc index 5a34474d94e08..a48f55237f336 100644 --- a/prdoc/pr_7587.prdoc +++ b/prdoc/pr_7587.prdoc @@ -1,24 +1,11 @@ title: '[AHM] Poke deposits: Indices pallet' doc: - audience: Runtime Dev - description: |- - # Description - - * This PR adds a new extrinsic `reconsider` to `pallet-indices`. This extrinsic will be used to re-adjust the deposits made in the pallet. - * Part of #5591 - - ## Review Notes - - * Added a new extrinsic `reconsider` in `pallet-indices`. - * Added a new event `DepositReconsidered` to be emitted upon a successful call of the extrinsic. - * Although the immediate use of the extrinsic will be to give back some of the deposit after the AH-migration, the extrinsic is written such that it can work if the deposit decreases or increases (both). - * The call to the extrinsic would be `free` if an actual adjustment is made to the deposit and `paid` otherwise. - * Added tests to test all scenarios. - * Added a benchmark to test the "worst case" (maximum compute) flow of the extrinsic which is when the deposit amount is updated to a new value. + description: Add a new extrinsic `reconsider` to `pallet-indices`. This extrinsic will be used to re-adjust the deposits made in the pallet after Asset Hub Migration. crates: - name: pallet-indices - bump: minor + bump: major - name: rococo-runtime - bump: patch + bump: major - name: westend-runtime - bump: patch + bump: major diff --git a/substrate/frame/indices/src/benchmarking.rs b/substrate/frame/indices/src/benchmarking.rs index a2650a0e69fdb..26fa550d86a39 100644 --- a/substrate/frame/indices/src/benchmarking.rs +++ b/substrate/frame/indices/src/benchmarking.rs @@ -127,17 +127,17 @@ mod benchmarks { // Verify the initial deposit amount in storage assert_eq!(Accounts::::get(account_index).unwrap().1, original_deposit); - // Double the deposited amount in storage + // Increase the deposited amount in storage by 2 Accounts::::try_mutate(account_index, |maybe_value| -> Result<(), BenchmarkError> { - let (account, amount, perm) = maybe_value.take().ok_or(BenchmarkError::Skip)?; - *maybe_value = Some((account, amount.saturating_mul(2u32.into()), perm)); + let (account, amount, perm) = maybe_value.take().ok_or(BenchmarkError::Stop("Mutating storage to change deposits failed"))?; + *maybe_value = Some((account, amount.saturating_add(2u32.into()), perm)); Ok(()) })?; - // Verify the deposit was doubled + // Verify the deposit was increased by 2 assert_eq!( Accounts::::get(account_index).unwrap().1, - original_deposit.saturating_mul(2u32.into()) + original_deposit.saturating_add(2u32.into()) ); #[extrinsic_call] diff --git a/substrate/frame/indices/src/lib.rs b/substrate/frame/indices/src/lib.rs index 1587df4406a1a..d1dbc0966b665 100644 --- a/substrate/frame/indices/src/lib.rs +++ b/substrate/frame/indices/src/lib.rs @@ -243,9 +243,6 @@ pub mod pallet { /// - `index`: the index whose deposit is to be reconsidered. /// /// Emits `DepositReconsidered` if successful. - /// - /// ## Complexity - /// - `O(1)`. #[pallet::call_index(5)] #[pallet::weight(T::WeightInfo::reconsider())] pub fn reconsider( diff --git a/substrate/frame/indices/src/tests.rs b/substrate/frame/indices/src/tests.rs index e8af37998b283..12a1884bb77f4 100644 --- a/substrate/frame/indices/src/tests.rs +++ b/substrate/frame/indices/src/tests.rs @@ -166,7 +166,7 @@ fn reconsider_should_work_when_deposit_increases() { assert_eq!(Balances::reserved_balance(1), 1); // Change deposit to 2 - IndexDeposit::set(2); + IndexDeposit::set(3); // Reconsider should work and be free let initial_balance = Balances::free_balance(1); @@ -174,13 +174,13 @@ fn reconsider_should_work_when_deposit_increases() { assert_ok!(result.as_ref()); let post_info = result.unwrap(); assert_eq!(post_info.pays_fee, Pays::No); - assert_eq!(Balances::reserved_balance(1), 2); + assert_eq!(Balances::reserved_balance(1), 3); // Balance should only reduce by the deposit difference - assert_eq!(Balances::free_balance(1), initial_balance - 1); + assert_eq!(Balances::free_balance(1), initial_balance - 2); System::assert_has_event( - Event::DepositReconsidered { who: 1, index: 0, old_deposit: 1, new_deposit: 2 }.into(), + Event::DepositReconsidered { who: 1, index: 0, old_deposit: 1, new_deposit: 3 }.into(), ); }); } @@ -189,9 +189,9 @@ fn reconsider_should_work_when_deposit_increases() { fn reconsider_should_work_when_deposit_decreases() { new_test_ext().execute_with(|| { // Set initial deposit to 2 - IndexDeposit::set(2); + IndexDeposit::set(3); assert_ok!(Indices::claim(Some(1).into(), 0)); - assert_eq!(Balances::reserved_balance(1), 2); + assert_eq!(Balances::reserved_balance(1), 3); // Change deposit to 1 IndexDeposit::set(1); @@ -204,10 +204,10 @@ fn reconsider_should_work_when_deposit_decreases() { assert_eq!(Balances::reserved_balance(1), 1); // Balance should increase by the unreserved amount - assert_eq!(Balances::free_balance(1), initial_balance + 1); + assert_eq!(Balances::free_balance(1), initial_balance + 2); System::assert_has_event( - Event::DepositReconsidered { who: 1, index: 0, old_deposit: 2, new_deposit: 1 }.into(), + Event::DepositReconsidered { who: 1, index: 0, old_deposit: 3, new_deposit: 1 }.into(), ); }); } diff --git a/substrate/frame/indices/src/weights.rs b/substrate/frame/indices/src/weights.rs index aa5ef9b8f76c3..d519fb6b916b2 100644 --- a/substrate/frame/indices/src/weights.rs +++ b/substrate/frame/indices/src/weights.rs @@ -121,11 +121,17 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - // TO-DO: Run CI cmd bot to generate real weights. + /// Storage: `Indices::Accounts` (r:1 w:1) + /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn reconsider() -> Weight { - Weight::from_parts(31_036_000, 3534) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + // Proof Size summary in bytes: + // Measured: `100` + // Estimated: `3534` + // Minimum execution time: 27_536_000 picoseconds. + Weight::from_parts(28_517_000, 0) + .saturating_add(Weight::from_parts(0, 3534)) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } } @@ -190,10 +196,15 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - - // TO-DO: Run CI cmd bot to generate real weights. + /// Storage: `Indices::Accounts` (r:1 w:1) + /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn reconsider() -> Weight { - Weight::from_parts(31_036_000, 3534) + // Proof Size summary in bytes: + // Measured: `100` + // Estimated: `3534` + // Minimum execution time: 27_536_000 picoseconds. + Weight::from_parts(28_517_000, 0) + .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } From 423cdf299c0b04f7aa3e86d1df13fa584e5d0e2a Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 15:57:48 +0000 Subject: [PATCH 17/26] Update from UtkarshBhardwaj007 running command 'fmt' --- substrate/frame/indices/src/benchmarking.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/substrate/frame/indices/src/benchmarking.rs b/substrate/frame/indices/src/benchmarking.rs index 26fa550d86a39..f11d529cc03cf 100644 --- a/substrate/frame/indices/src/benchmarking.rs +++ b/substrate/frame/indices/src/benchmarking.rs @@ -129,7 +129,9 @@ mod benchmarks { // Increase the deposited amount in storage by 2 Accounts::::try_mutate(account_index, |maybe_value| -> Result<(), BenchmarkError> { - let (account, amount, perm) = maybe_value.take().ok_or(BenchmarkError::Stop("Mutating storage to change deposits failed"))?; + let (account, amount, perm) = maybe_value + .take() + .ok_or(BenchmarkError::Stop("Mutating storage to change deposits failed"))?; *maybe_value = Some((account, amount.saturating_add(2u32.into()), perm)); Ok(()) })?; From b8f22a0619f34321ee3116eb9cf325a9e35c833b Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 17:26:33 +0000 Subject: [PATCH 18/26] Update from UtkarshBhardwaj007 running command 'bench --pallet pallet_indices' --- .../rococo/src/weights/pallet_indices.rs | 28 ++-- .../westend/src/weights/pallet_indices.rs | 26 ++-- substrate/frame/indices/src/weights.rs | 121 ++++++++++-------- 3 files changed, 97 insertions(+), 78 deletions(-) diff --git a/polkadot/runtime/rococo/src/weights/pallet_indices.rs b/polkadot/runtime/rococo/src/weights/pallet_indices.rs index a815866bf0933..5e74960fa2401 100644 --- a/polkadot/runtime/rococo/src/weights/pallet_indices.rs +++ b/polkadot/runtime/rococo/src/weights/pallet_indices.rs @@ -17,9 +17,9 @@ //! Autogenerated weights for `pallet_indices` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-02-18, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `7f503db40d1f`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `53f5d6898572`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -57,8 +57,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `4` // Estimated: `3534` - // Minimum execution time: 22_198_000 picoseconds. - Weight::from_parts(22_968_000, 0) + // Minimum execution time: 23_055_000 picoseconds. + Weight::from_parts(23_806_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -71,8 +71,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `203` // Estimated: `3593` - // Minimum execution time: 35_178_000 picoseconds. - Weight::from_parts(36_177_000, 0) + // Minimum execution time: 35_687_000 picoseconds. + Weight::from_parts(36_860_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -83,8 +83,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `100` // Estimated: `3534` - // Minimum execution time: 23_620_000 picoseconds. - Weight::from_parts(24_166_000, 0) + // Minimum execution time: 23_881_000 picoseconds. + Weight::from_parts(24_862_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `203` // Estimated: `3593` - // Minimum execution time: 26_221_000 picoseconds. - Weight::from_parts(27_386_000, 0) + // Minimum execution time: 26_595_000 picoseconds. + Weight::from_parts(27_566_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -109,8 +109,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `100` // Estimated: `3534` - // Minimum execution time: 26_565_000 picoseconds. - Weight::from_parts(27_534_000, 0) + // Minimum execution time: 27_324_000 picoseconds. + Weight::from_parts(28_015_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `100` // Estimated: `3534` - // Minimum execution time: 23_314_000 picoseconds. - Weight::from_parts(24_462_000, 0) + // Minimum execution time: 24_398_000 picoseconds. + Weight::from_parts(24_970_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/polkadot/runtime/westend/src/weights/pallet_indices.rs b/polkadot/runtime/westend/src/weights/pallet_indices.rs index a7baef730b734..ff4279204cdb4 100644 --- a/polkadot/runtime/westend/src/weights/pallet_indices.rs +++ b/polkadot/runtime/westend/src/weights/pallet_indices.rs @@ -17,9 +17,9 @@ //! Autogenerated weights for `pallet_indices` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-02-18, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `7f503db40d1f`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `53f5d6898572`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -57,8 +57,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `4` // Estimated: `3534` - // Minimum execution time: 26_302_000 picoseconds. - Weight::from_parts(27_551_000, 0) + // Minimum execution time: 26_446_000 picoseconds. + Weight::from_parts(27_476_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -71,8 +71,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `203` // Estimated: `3593` - // Minimum execution time: 40_405_000 picoseconds. - Weight::from_parts(42_668_000, 0) + // Minimum execution time: 39_720_000 picoseconds. + Weight::from_parts(41_065_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -84,7 +84,7 @@ impl pallet_indices::WeightInfo for WeightInfo { // Measured: `100` // Estimated: `3534` // Minimum execution time: 27_680_000 picoseconds. - Weight::from_parts(28_989_000, 0) + Weight::from_parts(28_628_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `203` // Estimated: `3593` - // Minimum execution time: 29_933_000 picoseconds. - Weight::from_parts(31_376_000, 0) + // Minimum execution time: 30_427_000 picoseconds. + Weight::from_parts(31_437_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -109,8 +109,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `100` // Estimated: `3534` - // Minimum execution time: 30_979_000 picoseconds. - Weight::from_parts(31_804_000, 0) + // Minimum execution time: 31_455_000 picoseconds. + Weight::from_parts(32_478_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `100` // Estimated: `3534` - // Minimum execution time: 27_536_000 picoseconds. - Weight::from_parts(28_517_000, 0) + // Minimum execution time: 28_193_000 picoseconds. + Weight::from_parts(29_139_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/substrate/frame/indices/src/weights.rs b/substrate/frame/indices/src/weights.rs index d519fb6b916b2..3887308af6cde 100644 --- a/substrate/frame/indices/src/weights.rs +++ b/substrate/frame/indices/src/weights.rs @@ -15,36 +15,57 @@ // See the License for the specific language governing permissions and // limitations under the License. +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Autogenerated weights for `pallet_indices` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-11-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-02-18, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-wiukf8gn-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! HOSTNAME: `53f5d6898572`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: -// ./target/production/substrate-node +// frame-omni-bencher +// v1 // benchmark // pallet -// --chain=dev +// --extrinsic=* +// --runtime=target/production/wbuild/kitchensink-runtime/kitchensink_runtime.wasm +// --pallet=pallet_indices +// --header=/__w/polkadot-sdk/polkadot-sdk/substrate/HEADER-APACHE2 +// --output=/__w/polkadot-sdk/polkadot-sdk/substrate/frame/indices/src/weights.rs +// --wasm-execution=compiled // --steps=50 // --repeat=20 -// --pallet=pallet_indices +// --heap-pages=4096 +// --template=substrate/.maintain/frame-weight-template.hbs // --no-storage-info -// --no-median-slopes // --no-min-squares -// --extrinsic=* -// --wasm-execution=compiled -// --heap-pages=4096 -// --output=./substrate/frame/indices/src/weights.rs -// --header=./substrate/HEADER-APACHE2 -// --template=./substrate/.maintain/frame-weight-template.hbs +// --no-median-slopes +// --genesis-builder-policy=none +// --exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic,pallet_nomination_pools,pallet_remark,pallet_transaction_storage,pallet_election_provider_multi_block,pallet_election_provider_multi_block::signed,pallet_election_provider_multi_block::unsigned,pallet_election_provider_multi_block::verifier #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] #![allow(missing_docs)] +#![allow(dead_code)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use core::marker::PhantomData; @@ -66,10 +87,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn claim() -> Weight { // Proof Size summary in bytes: - // Measured: `76` + // Measured: `0` // Estimated: `3534` - // Minimum execution time: 23_283_000 picoseconds. - Weight::from_parts(24_326_000, 3534) + // Minimum execution time: 19_056_000 picoseconds. + Weight::from_parts(19_817_000, 3534) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -79,10 +100,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `312` + // Measured: `178` // Estimated: `3593` - // Minimum execution time: 40_906_000 picoseconds. - Weight::from_parts(42_117_000, 3593) + // Minimum execution time: 32_327_000 picoseconds. + Weight::from_parts(33_356_000, 3593) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -90,10 +111,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn free() -> Weight { // Proof Size summary in bytes: - // Measured: `172` + // Measured: `75` // Estimated: `3534` - // Minimum execution time: 27_419_000 picoseconds. - Weight::from_parts(28_544_000, 3534) + // Minimum execution time: 19_818_000 picoseconds. + Weight::from_parts(20_339_000, 3534) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -103,10 +124,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn force_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `275` + // Measured: `177` // Estimated: `3593` - // Minimum execution time: 30_098_000 picoseconds. - Weight::from_parts(31_368_000, 3593) + // Minimum execution time: 23_804_000 picoseconds. + Weight::from_parts(24_514_000, 3593) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -114,10 +135,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn freeze() -> Weight { // Proof Size summary in bytes: - // Measured: `172` + // Measured: `75` // Estimated: `3534` - // Minimum execution time: 30_356_000 picoseconds. - Weight::from_parts(31_036_000, 3534) + // Minimum execution time: 22_451_000 picoseconds. + Weight::from_parts(23_244_000, 3534) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -125,11 +146,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn reconsider() -> Weight { // Proof Size summary in bytes: - // Measured: `100` + // Measured: `75` // Estimated: `3534` - // Minimum execution time: 27_536_000 picoseconds. - Weight::from_parts(28_517_000, 0) - .saturating_add(Weight::from_parts(0, 3534)) + // Minimum execution time: 19_615_000 picoseconds. + Weight::from_parts(20_569_000, 3534) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -141,10 +161,10 @@ impl WeightInfo for () { /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn claim() -> Weight { // Proof Size summary in bytes: - // Measured: `76` + // Measured: `0` // Estimated: `3534` - // Minimum execution time: 23_283_000 picoseconds. - Weight::from_parts(24_326_000, 3534) + // Minimum execution time: 19_056_000 picoseconds. + Weight::from_parts(19_817_000, 3534) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -154,10 +174,10 @@ impl WeightInfo for () { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `312` + // Measured: `178` // Estimated: `3593` - // Minimum execution time: 40_906_000 picoseconds. - Weight::from_parts(42_117_000, 3593) + // Minimum execution time: 32_327_000 picoseconds. + Weight::from_parts(33_356_000, 3593) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -165,10 +185,10 @@ impl WeightInfo for () { /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn free() -> Weight { // Proof Size summary in bytes: - // Measured: `172` + // Measured: `75` // Estimated: `3534` - // Minimum execution time: 27_419_000 picoseconds. - Weight::from_parts(28_544_000, 3534) + // Minimum execution time: 19_818_000 picoseconds. + Weight::from_parts(20_339_000, 3534) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -178,10 +198,10 @@ impl WeightInfo for () { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn force_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `275` + // Measured: `177` // Estimated: `3593` - // Minimum execution time: 30_098_000 picoseconds. - Weight::from_parts(31_368_000, 3593) + // Minimum execution time: 23_804_000 picoseconds. + Weight::from_parts(24_514_000, 3593) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -189,10 +209,10 @@ impl WeightInfo for () { /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn freeze() -> Weight { // Proof Size summary in bytes: - // Measured: `172` + // Measured: `75` // Estimated: `3534` - // Minimum execution time: 30_356_000 picoseconds. - Weight::from_parts(31_036_000, 3534) + // Minimum execution time: 22_451_000 picoseconds. + Weight::from_parts(23_244_000, 3534) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -200,11 +220,10 @@ impl WeightInfo for () { /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn reconsider() -> Weight { // Proof Size summary in bytes: - // Measured: `100` + // Measured: `75` // Estimated: `3534` - // Minimum execution time: 27_536_000 picoseconds. - Weight::from_parts(28_517_000, 0) - .saturating_add(Weight::from_parts(0, 3534)) + // Minimum execution time: 19_615_000 picoseconds. + Weight::from_parts(20_569_000, 3534) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } From 4e5a61189419e1afe1bc8084faaeb3c2d33474f0 Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Tue, 18 Feb 2025 18:37:25 +0000 Subject: [PATCH 19/26] minor fixes --- substrate/frame/indices/src/tests.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/substrate/frame/indices/src/tests.rs b/substrate/frame/indices/src/tests.rs index 12a1884bb77f4..9120107b752ec 100644 --- a/substrate/frame/indices/src/tests.rs +++ b/substrate/frame/indices/src/tests.rs @@ -165,7 +165,7 @@ fn reconsider_should_work_when_deposit_increases() { assert_ok!(Indices::claim(Some(1).into(), 0)); assert_eq!(Balances::reserved_balance(1), 1); - // Change deposit to 2 + // Change deposit to 3 IndexDeposit::set(3); // Reconsider should work and be free @@ -188,7 +188,7 @@ fn reconsider_should_work_when_deposit_increases() { #[test] fn reconsider_should_work_when_deposit_decreases() { new_test_ext().execute_with(|| { - // Set initial deposit to 2 + // Set initial deposit to 3 IndexDeposit::set(3); assert_ok!(Indices::claim(Some(1).into(), 0)); assert_eq!(Balances::reserved_balance(1), 3); @@ -227,5 +227,11 @@ fn reconsider_should_charge_fee_when_deposit_unchanged() { // Reserved balance should remain the same assert_eq!(Balances::reserved_balance(1), 1); + + // Verify no DepositReconsidered event was emitted + assert!(!System::events().iter().any(|record| matches!( + record.event, + RuntimeEvent::Indices(Event::DepositReconsidered { .. }) + ))); }); } From b4e52f94c4aacf2dbe6cf93a845444486ea75576 Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Wed, 19 Feb 2025 11:37:42 +0000 Subject: [PATCH 20/26] add defensive logging --- substrate/frame/indices/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/substrate/frame/indices/src/lib.rs b/substrate/frame/indices/src/lib.rs index d1dbc0966b665..676570896ba5c 100644 --- a/substrate/frame/indices/src/lib.rs +++ b/substrate/frame/indices/src/lib.rs @@ -269,7 +269,14 @@ pub mod pallet { } else if new_amount < old_amount { // Need to unreserve some let excess = old_amount.saturating_sub(new_amount); - T::Currency::unreserve(&who, excess); + let unreserved = T::Currency::unreserve(&who, excess); + // Defensive logging if we can't unreserve the full amount. + if !unreserved.is_zero() { + defensive!( + "Failed to unreserve for index {:?}", + format!("{:?} (requested: {:?}, actual: {:?})", index, excess, unreserved) + ); + } } *maybe_value = Some((account, new_amount, perm)); From acc67efe8ab9fbe2ca87d574dd00b7527e8ca826 Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Wed, 19 Feb 2025 13:16:02 +0000 Subject: [PATCH 21/26] change extrinsic name to poke_deposit --- .../rococo/src/weights/pallet_indices.rs | 2 +- .../westend/src/weights/pallet_indices.rs | 2 +- prdoc/pr_7587.prdoc | 2 +- substrate/frame/indices/src/benchmarking.rs | 2 +- substrate/frame/indices/src/lib.rs | 18 ++++----- substrate/frame/indices/src/tests.rs | 40 +++++++++---------- substrate/frame/indices/src/weights.rs | 6 +-- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/polkadot/runtime/rococo/src/weights/pallet_indices.rs b/polkadot/runtime/rococo/src/weights/pallet_indices.rs index 5e74960fa2401..aa079eb78274d 100644 --- a/polkadot/runtime/rococo/src/weights/pallet_indices.rs +++ b/polkadot/runtime/rococo/src/weights/pallet_indices.rs @@ -117,7 +117,7 @@ impl pallet_indices::WeightInfo for WeightInfo { } /// Storage: `Indices::Accounts` (r:1 w:1) /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) - fn reconsider() -> Weight { + fn poke_deposit() -> Weight { // Proof Size summary in bytes: // Measured: `100` // Estimated: `3534` diff --git a/polkadot/runtime/westend/src/weights/pallet_indices.rs b/polkadot/runtime/westend/src/weights/pallet_indices.rs index ff4279204cdb4..bfa5137c352f7 100644 --- a/polkadot/runtime/westend/src/weights/pallet_indices.rs +++ b/polkadot/runtime/westend/src/weights/pallet_indices.rs @@ -117,7 +117,7 @@ impl pallet_indices::WeightInfo for WeightInfo { } /// Storage: `Indices::Accounts` (r:1 w:1) /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) - fn reconsider() -> Weight { + fn poke_deposit() -> Weight { // Proof Size summary in bytes: // Measured: `100` // Estimated: `3534` diff --git a/prdoc/pr_7587.prdoc b/prdoc/pr_7587.prdoc index a48f55237f336..22796fde9e080 100644 --- a/prdoc/pr_7587.prdoc +++ b/prdoc/pr_7587.prdoc @@ -1,7 +1,7 @@ title: '[AHM] Poke deposits: Indices pallet' doc: - audience: Runtime Dev - description: Add a new extrinsic `reconsider` to `pallet-indices`. This extrinsic will be used to re-adjust the deposits made in the pallet after Asset Hub Migration. + description: Add a new extrinsic `poke_deposit` to `pallet-indices`. This extrinsic will be used to re-adjust the deposits made in the pallet after Asset Hub Migration. crates: - name: pallet-indices bump: major diff --git a/substrate/frame/indices/src/benchmarking.rs b/substrate/frame/indices/src/benchmarking.rs index f11d529cc03cf..efe02d6521ab2 100644 --- a/substrate/frame/indices/src/benchmarking.rs +++ b/substrate/frame/indices/src/benchmarking.rs @@ -114,7 +114,7 @@ mod benchmarks { } #[benchmark] - fn reconsider() -> Result<(), BenchmarkError> { + fn poke_deposit() -> Result<(), BenchmarkError> { let account_index = T::AccountIndex::from(SEED); // Setup accounts let caller: T::AccountId = whitelisted_caller(); diff --git a/substrate/frame/indices/src/lib.rs b/substrate/frame/indices/src/lib.rs index 676570896ba5c..91a76e1da4724 100644 --- a/substrate/frame/indices/src/lib.rs +++ b/substrate/frame/indices/src/lib.rs @@ -233,19 +233,19 @@ pub mod pallet { Ok(()) } - /// Reconsider the deposit reserved for an index. + /// Poke the deposit reserved for an index. /// /// The dispatch origin for this call must be _Signed_ and the signing account must have a /// non-frozen account `index`. /// - /// The transaction fees is waived if the deposit is changed after reconsideration. + /// The transaction fees is waived if the deposit is changed after poking/reconsideration. /// - /// - `index`: the index whose deposit is to be reconsidered. + /// - `index`: the index whose deposit is to be poked/reconsidered. /// - /// Emits `DepositReconsidered` if successful. + /// Emits `DepositPoked` if successful. #[pallet::call_index(5)] - #[pallet::weight(T::WeightInfo::reconsider())] - pub fn reconsider( + #[pallet::weight(T::WeightInfo::poke_deposit())] + pub fn poke_deposit( origin: OriginFor, index: T::AccountIndex, ) -> DispatchResultWithPostInfo { @@ -281,7 +281,7 @@ pub mod pallet { *maybe_value = Some((account, new_amount, perm)); - Self::deposit_event(Event::DepositReconsidered { + Self::deposit_event(Event::DepositPoked { who, index, old_deposit: old_amount, @@ -301,8 +301,8 @@ pub mod pallet { IndexFreed { index: T::AccountIndex }, /// A account index has been frozen to its current account ID. IndexFrozen { index: T::AccountIndex, who: T::AccountId }, - /// A deposit to reserve an index has been reconsidered. - DepositReconsidered { + /// A deposit to reserve an index has been poked/reconsidered. + DepositPoked { who: T::AccountId, index: T::AccountIndex, old_deposit: BalanceOf, diff --git a/substrate/frame/indices/src/tests.rs b/substrate/frame/indices/src/tests.rs index 9120107b752ec..5792737f27536 100644 --- a/substrate/frame/indices/src/tests.rs +++ b/substrate/frame/indices/src/tests.rs @@ -121,31 +121,31 @@ fn force_transfer_index_on_free_should_work() { } #[test] -fn reconsider_should_fail_for_unassigned_index() { +fn poke_deposit_should_fail_for_unassigned_index() { new_test_ext().execute_with(|| { - assert_noop!(Indices::reconsider(Some(1).into(), 0), Error::::NotAssigned); + assert_noop!(Indices::poke_deposit(Some(1).into(), 0), Error::::NotAssigned); }); } #[test] -fn reconsider_should_fail_for_wrong_owner() { +fn poke_deposit_should_fail_for_wrong_owner() { new_test_ext().execute_with(|| { assert_ok!(Indices::claim(Some(1).into(), 0)); - assert_noop!(Indices::reconsider(Some(2).into(), 0), Error::::NotOwner); + assert_noop!(Indices::poke_deposit(Some(2).into(), 0), Error::::NotOwner); }); } #[test] -fn reconsider_should_fail_for_permanent_index() { +fn poke_deposit_should_fail_for_permanent_index() { new_test_ext().execute_with(|| { assert_ok!(Indices::claim(Some(1).into(), 0)); assert_ok!(Indices::freeze(Some(1).into(), 0)); - assert_noop!(Indices::reconsider(Some(1).into(), 0), Error::::Permanent); + assert_noop!(Indices::poke_deposit(Some(1).into(), 0), Error::::Permanent); }); } #[test] -fn reconsider_should_fail_for_insufficient_balance() { +fn poke_deposit_should_fail_for_insufficient_balance() { new_test_ext().execute_with(|| { assert_ok!(Indices::claim(Some(1).into(), 0)); @@ -153,14 +153,14 @@ fn reconsider_should_fail_for_insufficient_balance() { IndexDeposit::set(1000); assert_noop!( - Indices::reconsider(Some(1).into(), 0), + Indices::poke_deposit(Some(1).into(), 0), BalancesError::::InsufficientBalance ); }); } #[test] -fn reconsider_should_work_when_deposit_increases() { +fn poke_deposit_should_work_when_deposit_increases() { new_test_ext().execute_with(|| { assert_ok!(Indices::claim(Some(1).into(), 0)); assert_eq!(Balances::reserved_balance(1), 1); @@ -168,9 +168,9 @@ fn reconsider_should_work_when_deposit_increases() { // Change deposit to 3 IndexDeposit::set(3); - // Reconsider should work and be free + // poke_deposit should work and be free let initial_balance = Balances::free_balance(1); - let result = Indices::reconsider(Some(1).into(), 0); + let result = Indices::poke_deposit(Some(1).into(), 0); assert_ok!(result.as_ref()); let post_info = result.unwrap(); assert_eq!(post_info.pays_fee, Pays::No); @@ -180,13 +180,13 @@ fn reconsider_should_work_when_deposit_increases() { assert_eq!(Balances::free_balance(1), initial_balance - 2); System::assert_has_event( - Event::DepositReconsidered { who: 1, index: 0, old_deposit: 1, new_deposit: 3 }.into(), + Event::DepositPoked { who: 1, index: 0, old_deposit: 1, new_deposit: 3 }.into(), ); }); } #[test] -fn reconsider_should_work_when_deposit_decreases() { +fn poke_deposit_should_work_when_deposit_decreases() { new_test_ext().execute_with(|| { // Set initial deposit to 3 IndexDeposit::set(3); @@ -197,7 +197,7 @@ fn reconsider_should_work_when_deposit_decreases() { IndexDeposit::set(1); let initial_balance = Balances::free_balance(1); - let result = Indices::reconsider(Some(1).into(), 0); + let result = Indices::poke_deposit(Some(1).into(), 0); assert_ok!(result.as_ref()); let post_info = result.unwrap(); assert_eq!(post_info.pays_fee, Pays::No); @@ -207,19 +207,19 @@ fn reconsider_should_work_when_deposit_decreases() { assert_eq!(Balances::free_balance(1), initial_balance + 2); System::assert_has_event( - Event::DepositReconsidered { who: 1, index: 0, old_deposit: 3, new_deposit: 1 }.into(), + Event::DepositPoked { who: 1, index: 0, old_deposit: 3, new_deposit: 1 }.into(), ); }); } #[test] -fn reconsider_should_charge_fee_when_deposit_unchanged() { +fn poke_deposit_should_charge_fee_when_deposit_unchanged() { new_test_ext().execute_with(|| { assert_ok!(Indices::claim(Some(1).into(), 0)); assert_eq!(Balances::reserved_balance(1), 1); - // Reconsider with same deposit amount - let result = Indices::reconsider(Some(1).into(), 0); + // poke_deposit with same deposit amount + let result = Indices::poke_deposit(Some(1).into(), 0); assert_ok!(result.as_ref()); // Verify fee payment let post_info = result.unwrap(); @@ -228,10 +228,10 @@ fn reconsider_should_charge_fee_when_deposit_unchanged() { // Reserved balance should remain the same assert_eq!(Balances::reserved_balance(1), 1); - // Verify no DepositReconsidered event was emitted + // Verify no DepositPoked event was emitted assert!(!System::events().iter().any(|record| matches!( record.event, - RuntimeEvent::Indices(Event::DepositReconsidered { .. }) + RuntimeEvent::Indices(Event::DepositPoked { .. }) ))); }); } diff --git a/substrate/frame/indices/src/weights.rs b/substrate/frame/indices/src/weights.rs index 3887308af6cde..92d899ad7987c 100644 --- a/substrate/frame/indices/src/weights.rs +++ b/substrate/frame/indices/src/weights.rs @@ -77,7 +77,7 @@ pub trait WeightInfo { fn free() -> Weight; fn force_transfer() -> Weight; fn freeze() -> Weight; - fn reconsider() -> Weight; + fn poke_deposit() -> Weight; } /// Weights for `pallet_indices` using the Substrate node and recommended hardware. @@ -144,7 +144,7 @@ impl WeightInfo for SubstrateWeight { } /// Storage: `Indices::Accounts` (r:1 w:1) /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) - fn reconsider() -> Weight { + fn poke_deposit() -> Weight { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3534` @@ -218,7 +218,7 @@ impl WeightInfo for () { } /// Storage: `Indices::Accounts` (r:1 w:1) /// Proof: `Indices::Accounts` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) - fn reconsider() -> Weight { + fn poke_deposit() -> Weight { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3534` From 65d22919988a419802c4cc9a9650e266c775b252 Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 13:19:45 +0000 Subject: [PATCH 22/26] Update from UtkarshBhardwaj007 running command 'fmt' --- substrate/frame/indices/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/substrate/frame/indices/src/lib.rs b/substrate/frame/indices/src/lib.rs index 91a76e1da4724..a41c2754d1b8d 100644 --- a/substrate/frame/indices/src/lib.rs +++ b/substrate/frame/indices/src/lib.rs @@ -274,7 +274,10 @@ pub mod pallet { if !unreserved.is_zero() { defensive!( "Failed to unreserve for index {:?}", - format!("{:?} (requested: {:?}, actual: {:?})", index, excess, unreserved) + format!( + "{:?} (requested: {:?}, actual: {:?})", + index, excess, unreserved + ) ); } } From d9e94a972f503831b0d5a27da7dc4b632f116b64 Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Wed, 19 Feb 2025 13:55:04 +0000 Subject: [PATCH 23/26] minor: fix defensive logging --- substrate/frame/indices/src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/substrate/frame/indices/src/lib.rs b/substrate/frame/indices/src/lib.rs index a41c2754d1b8d..93fe797f19d1a 100644 --- a/substrate/frame/indices/src/lib.rs +++ b/substrate/frame/indices/src/lib.rs @@ -273,9 +273,7 @@ pub mod pallet { // Defensive logging if we can't unreserve the full amount. if !unreserved.is_zero() { defensive!( - "Failed to unreserve for index {:?}", - format!( - "{:?} (requested: {:?}, actual: {:?})", + "Failed to unreserve full amount. (Index, Requested, Actual): ", ( index, excess, unreserved ) ); From 325bc1469cbb396ddf5e3d445a84b03417bdfbe1 Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 13:58:59 +0000 Subject: [PATCH 24/26] Update from UtkarshBhardwaj007 running command 'fmt' --- substrate/frame/indices/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/substrate/frame/indices/src/lib.rs b/substrate/frame/indices/src/lib.rs index 93fe797f19d1a..308e839479b85 100644 --- a/substrate/frame/indices/src/lib.rs +++ b/substrate/frame/indices/src/lib.rs @@ -273,9 +273,8 @@ pub mod pallet { // Defensive logging if we can't unreserve the full amount. if !unreserved.is_zero() { defensive!( - "Failed to unreserve full amount. (Index, Requested, Actual): ", ( - index, excess, unreserved - ) + "Failed to unreserve full amount. (Index, Requested, Actual): ", + (index, excess, unreserved) ); } } From d07362ff48ea018a3def6a760a74f9b9ae1a1aae Mon Sep 17 00:00:00 2001 From: UtkarshBhardwaj007 Date: Wed, 19 Feb 2025 16:40:43 +0000 Subject: [PATCH 25/26] reserve additional funds in poke_deposit benchmark --- substrate/frame/indices/src/benchmarking.rs | 25 ++++++++++++++++----- substrate/frame/indices/src/lib.rs | 6 ++--- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/substrate/frame/indices/src/benchmarking.rs b/substrate/frame/indices/src/benchmarking.rs index efe02d6521ab2..9e81915df153b 100644 --- a/substrate/frame/indices/src/benchmarking.rs +++ b/substrate/frame/indices/src/benchmarking.rs @@ -124,22 +124,36 @@ mod benchmarks { // Claim the index Pallet::::claim(RawOrigin::Signed(caller.clone()).into(), account_index)?; - // Verify the initial deposit amount in storage + + // Verify the initial deposit amount in storage and reserved balance assert_eq!(Accounts::::get(account_index).unwrap().1, original_deposit); + assert_eq!(T::Currency::reserved_balance(&caller), original_deposit); + + // The additional amount we'll add to the deposit for the index + let additional_amount = 2u32.into(); + + // Reserve the additional amount from the caller's balance + T::Currency::reserve(&caller, additional_amount)?; + + // Verify the additional amount was reserved + assert_eq!( + T::Currency::reserved_balance(&caller), + original_deposit.saturating_add(additional_amount) + ); - // Increase the deposited amount in storage by 2 + // Increase the deposited amount in storage by additional_amount Accounts::::try_mutate(account_index, |maybe_value| -> Result<(), BenchmarkError> { let (account, amount, perm) = maybe_value .take() .ok_or(BenchmarkError::Stop("Mutating storage to change deposits failed"))?; - *maybe_value = Some((account, amount.saturating_add(2u32.into()), perm)); + *maybe_value = Some((account, amount.saturating_add(additional_amount), perm)); Ok(()) })?; - // Verify the deposit was increased by 2 + // Verify the deposit was increased by additional_amount assert_eq!( Accounts::::get(account_index).unwrap().1, - original_deposit.saturating_add(2u32.into()) + original_deposit.saturating_add(additional_amount) ); #[extrinsic_call] @@ -148,6 +162,7 @@ mod benchmarks { assert!(Accounts::::contains_key(account_index)); assert_eq!(Accounts::::get(account_index).unwrap().0, caller); assert_eq!(Accounts::::get(account_index).unwrap().1, original_deposit); + assert_eq!(T::Currency::reserved_balance(&caller), original_deposit); Ok(()) } diff --git a/substrate/frame/indices/src/lib.rs b/substrate/frame/indices/src/lib.rs index 308e839479b85..1629a730176f7 100644 --- a/substrate/frame/indices/src/lib.rs +++ b/substrate/frame/indices/src/lib.rs @@ -269,12 +269,12 @@ pub mod pallet { } else if new_amount < old_amount { // Need to unreserve some let excess = old_amount.saturating_sub(new_amount); - let unreserved = T::Currency::unreserve(&who, excess); + let remaining_unreserved = T::Currency::unreserve(&who, excess); // Defensive logging if we can't unreserve the full amount. - if !unreserved.is_zero() { + if !remaining_unreserved.is_zero() { defensive!( "Failed to unreserve full amount. (Index, Requested, Actual): ", - (index, excess, unreserved) + (index, excess, excess - remaining_unreserved) ); } } From 7abe8c81547c169be7ffa7407c9366613b49e03d Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 17:39:55 +0000 Subject: [PATCH 26/26] Update from UtkarshBhardwaj007 running command 'bench --pallet pallet_indices' --- .../rococo/src/weights/pallet_indices.rs | 28 +++++----- .../westend/src/weights/pallet_indices.rs | 28 +++++----- substrate/frame/indices/src/weights.rs | 52 +++++++++---------- 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/polkadot/runtime/rococo/src/weights/pallet_indices.rs b/polkadot/runtime/rococo/src/weights/pallet_indices.rs index aa079eb78274d..900863d436844 100644 --- a/polkadot/runtime/rococo/src/weights/pallet_indices.rs +++ b/polkadot/runtime/rococo/src/weights/pallet_indices.rs @@ -17,9 +17,9 @@ //! Autogenerated weights for `pallet_indices` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-18, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-02-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `53f5d6898572`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `52baa5cae416`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -57,8 +57,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `4` // Estimated: `3534` - // Minimum execution time: 23_055_000 picoseconds. - Weight::from_parts(23_806_000, 0) + // Minimum execution time: 22_250_000 picoseconds. + Weight::from_parts(23_442_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -71,8 +71,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `203` // Estimated: `3593` - // Minimum execution time: 35_687_000 picoseconds. - Weight::from_parts(36_860_000, 0) + // Minimum execution time: 35_315_000 picoseconds. + Weight::from_parts(37_456_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -83,8 +83,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `100` // Estimated: `3534` - // Minimum execution time: 23_881_000 picoseconds. - Weight::from_parts(24_862_000, 0) + // Minimum execution time: 23_413_000 picoseconds. + Weight::from_parts(24_307_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `203` // Estimated: `3593` - // Minimum execution time: 26_595_000 picoseconds. - Weight::from_parts(27_566_000, 0) + // Minimum execution time: 25_799_000 picoseconds. + Weight::from_parts(26_614_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -109,8 +109,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `100` // Estimated: `3534` - // Minimum execution time: 27_324_000 picoseconds. - Weight::from_parts(28_015_000, 0) + // Minimum execution time: 26_905_000 picoseconds. + Weight::from_parts(27_574_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `100` // Estimated: `3534` - // Minimum execution time: 24_398_000 picoseconds. - Weight::from_parts(24_970_000, 0) + // Minimum execution time: 23_596_000 picoseconds. + Weight::from_parts(24_227_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/polkadot/runtime/westend/src/weights/pallet_indices.rs b/polkadot/runtime/westend/src/weights/pallet_indices.rs index bfa5137c352f7..c10ec047953f2 100644 --- a/polkadot/runtime/westend/src/weights/pallet_indices.rs +++ b/polkadot/runtime/westend/src/weights/pallet_indices.rs @@ -17,9 +17,9 @@ //! Autogenerated weights for `pallet_indices` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-18, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-02-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `53f5d6898572`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `52baa5cae416`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -57,8 +57,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `4` // Estimated: `3534` - // Minimum execution time: 26_446_000 picoseconds. - Weight::from_parts(27_476_000, 0) + // Minimum execution time: 25_952_000 picoseconds. + Weight::from_parts(27_224_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -71,8 +71,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `203` // Estimated: `3593` - // Minimum execution time: 39_720_000 picoseconds. - Weight::from_parts(41_065_000, 0) + // Minimum execution time: 38_643_000 picoseconds. + Weight::from_parts(39_612_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -83,8 +83,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `100` // Estimated: `3534` - // Minimum execution time: 27_680_000 picoseconds. - Weight::from_parts(28_628_000, 0) + // Minimum execution time: 26_744_000 picoseconds. + Weight::from_parts(28_195_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `203` // Estimated: `3593` - // Minimum execution time: 30_427_000 picoseconds. - Weight::from_parts(31_437_000, 0) + // Minimum execution time: 29_213_000 picoseconds. + Weight::from_parts(30_369_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -109,8 +109,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `100` // Estimated: `3534` - // Minimum execution time: 31_455_000 picoseconds. - Weight::from_parts(32_478_000, 0) + // Minimum execution time: 30_370_000 picoseconds. + Weight::from_parts(31_164_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_indices::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `100` // Estimated: `3534` - // Minimum execution time: 28_193_000 picoseconds. - Weight::from_parts(29_139_000, 0) + // Minimum execution time: 27_134_000 picoseconds. + Weight::from_parts(28_175_000, 0) .saturating_add(Weight::from_parts(0, 3534)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/substrate/frame/indices/src/weights.rs b/substrate/frame/indices/src/weights.rs index 92d899ad7987c..f868e3f9c627b 100644 --- a/substrate/frame/indices/src/weights.rs +++ b/substrate/frame/indices/src/weights.rs @@ -35,9 +35,9 @@ //! Autogenerated weights for `pallet_indices` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-18, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-02-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `53f5d6898572`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `52baa5cae416`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: @@ -89,8 +89,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3534` - // Minimum execution time: 19_056_000 picoseconds. - Weight::from_parts(19_817_000, 3534) + // Minimum execution time: 19_421_000 picoseconds. + Weight::from_parts(19_829_000, 3534) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -102,8 +102,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `178` // Estimated: `3593` - // Minimum execution time: 32_327_000 picoseconds. - Weight::from_parts(33_356_000, 3593) + // Minimum execution time: 33_020_000 picoseconds. + Weight::from_parts(33_682_000, 3593) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -113,8 +113,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3534` - // Minimum execution time: 19_818_000 picoseconds. - Weight::from_parts(20_339_000, 3534) + // Minimum execution time: 20_137_000 picoseconds. + Weight::from_parts(20_374_000, 3534) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -126,8 +126,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `177` // Estimated: `3593` - // Minimum execution time: 23_804_000 picoseconds. - Weight::from_parts(24_514_000, 3593) + // Minimum execution time: 23_914_000 picoseconds. + Weight::from_parts(24_248_000, 3593) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -137,8 +137,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3534` - // Minimum execution time: 22_451_000 picoseconds. - Weight::from_parts(23_244_000, 3534) + // Minimum execution time: 23_055_000 picoseconds. + Weight::from_parts(23_461_000, 3534) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -148,8 +148,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3534` - // Minimum execution time: 19_615_000 picoseconds. - Weight::from_parts(20_569_000, 3534) + // Minimum execution time: 20_179_000 picoseconds. + Weight::from_parts(20_464_000, 3534) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -163,8 +163,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3534` - // Minimum execution time: 19_056_000 picoseconds. - Weight::from_parts(19_817_000, 3534) + // Minimum execution time: 19_421_000 picoseconds. + Weight::from_parts(19_829_000, 3534) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -176,8 +176,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `178` // Estimated: `3593` - // Minimum execution time: 32_327_000 picoseconds. - Weight::from_parts(33_356_000, 3593) + // Minimum execution time: 33_020_000 picoseconds. + Weight::from_parts(33_682_000, 3593) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -187,8 +187,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3534` - // Minimum execution time: 19_818_000 picoseconds. - Weight::from_parts(20_339_000, 3534) + // Minimum execution time: 20_137_000 picoseconds. + Weight::from_parts(20_374_000, 3534) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -200,8 +200,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `177` // Estimated: `3593` - // Minimum execution time: 23_804_000 picoseconds. - Weight::from_parts(24_514_000, 3593) + // Minimum execution time: 23_914_000 picoseconds. + Weight::from_parts(24_248_000, 3593) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -211,8 +211,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3534` - // Minimum execution time: 22_451_000 picoseconds. - Weight::from_parts(23_244_000, 3534) + // Minimum execution time: 23_055_000 picoseconds. + Weight::from_parts(23_461_000, 3534) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -222,8 +222,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `75` // Estimated: `3534` - // Minimum execution time: 19_615_000 picoseconds. - Weight::from_parts(20_569_000, 3534) + // Minimum execution time: 20_179_000 picoseconds. + Weight::from_parts(20_464_000, 3534) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) }