diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index a15911c21f65..0fdf58dce566 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -711,6 +711,7 @@ impl pallet_recovery::Config for Runtime { type FriendDepositFactor = FriendDepositFactor; type MaxFriends = MaxFriends; type RecoveryDeposit = RecoveryDeposit; + type RuntimeHoldReason = RuntimeHoldReason; } parameter_types! { @@ -1377,7 +1378,7 @@ construct_runtime! { Society: pallet_society::{Pallet, Call, Storage, Event} = 26, // Social recovery module. - Recovery: pallet_recovery::{Pallet, Call, Storage, Event} = 27, + Recovery: pallet_recovery::{Pallet, Call, Storage, Event, HoldReason} = 27, // Vesting. Usable initially, but removed once all vesting is finished. Vesting: pallet_vesting::{Pallet, Call, Storage, Event, Config} = 28, diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index fb54bec509b3..26593520ae78 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -935,6 +935,7 @@ impl pallet_recovery::Config for Runtime { type FriendDepositFactor = FriendDepositFactor; type MaxFriends = MaxFriends; type RecoveryDeposit = RecoveryDeposit; + type RuntimeHoldReason = RuntimeHoldReason; } parameter_types! { @@ -1437,7 +1438,7 @@ construct_runtime! { Identity: pallet_identity::{Pallet, Call, Storage, Event} = 17, // Social recovery module. - Recovery: pallet_recovery::{Pallet, Call, Storage, Event} = 18, + Recovery: pallet_recovery::{Pallet, Call, Storage, Event, HoldReason} = 18, // Vesting. Usable initially, but removed once all vesting is finished. Vesting: pallet_vesting::{Pallet, Call, Storage, Event, Config} = 19, diff --git a/substrate/bin/node/runtime/src/lib.rs b/substrate/bin/node/runtime/src/lib.rs index 4d409a791ba2..5dad05d87340 100644 --- a/substrate/bin/node/runtime/src/lib.rs +++ b/substrate/bin/node/runtime/src/lib.rs @@ -1514,6 +1514,7 @@ impl pallet_recovery::Config for Runtime { type FriendDepositFactor = FriendDepositFactor; type MaxFriends = MaxFriends; type RecoveryDeposit = RecoveryDeposit; + type RuntimeHoldReason = RuntimeHoldReason; } parameter_types! { diff --git a/substrate/frame/recovery/src/benchmarking.rs b/substrate/frame/recovery/src/benchmarking.rs index 72f77336212d..38a84aa0eb01 100644 --- a/substrate/frame/recovery/src/benchmarking.rs +++ b/substrate/frame/recovery/src/benchmarking.rs @@ -21,9 +21,8 @@ use super::*; use crate::Pallet; use frame_benchmarking::v1::{account, benchmarks, whitelisted_caller}; -use frame_support::traits::{Currency, Get}; +use frame_support::traits::Get; use frame_system::RawOrigin; -use sp_runtime::traits::Bounded; const SEED: u32 = 0; const DEFAULT_DELAY: u32 = 0; @@ -34,8 +33,7 @@ fn assert_last_event(generic_event: ::RuntimeEvent) { fn get_total_deposit( bounded_friends: &FriendsOf, -) -> Option<<::Currency as Currency<::AccountId>>::Balance> -{ +) -> Option<<::Currency as Inspect<::AccountId>>::Balance> { let friend_deposit = T::FriendDepositFactor::get() .checked_mul(&bounded_friends.len().saturated_into()) .unwrap(); @@ -51,9 +49,9 @@ fn generate_friends(num: u32) -> Vec<::Acc for friend in 0..friends.len() { // Top up accounts of friends - T::Currency::make_free_balance_be( + T::Currency::set_balance( &friends.get(friend).unwrap(), - BalanceOf::::max_value(), + T::Currency::minimum_balance() * 10000u32.into(), ); } @@ -67,7 +65,7 @@ fn add_caller_and_generate_friends( // Create friends let mut friends = generate_friends::(num - 1); - T::Currency::make_free_balance_be(&caller, BalanceOf::::max_value()); + T::Currency::set_balance(&caller, T::Currency::minimum_balance() * 10000u32.into()); friends.push(caller); @@ -78,7 +76,7 @@ fn add_caller_and_generate_friends( } fn insert_recovery_account(caller: &T::AccountId, account: &T::AccountId) { - T::Currency::make_free_balance_be(&account, BalanceOf::::max_value()); + T::Currency::set_balance(&account, T::Currency::minimum_balance() * 10000u32.into()); let n = T::MaxFriends::get(); @@ -96,8 +94,8 @@ fn insert_recovery_account(caller: &T::AccountId, account: &T::Accoun threshold: n as u16, }; - // Reserve deposit for recovery - T::Currency::reserve(&caller, total_deposit).unwrap(); + // Hold deposit for recovery + T::Currency::hold(&HoldReason::RecoveryProcessDeposit.into(), &caller, total_deposit).unwrap(); >::insert(&account, recovery_config); } @@ -138,7 +136,7 @@ benchmarks! { let n in 1 .. T::MaxFriends::get(); let caller: T::AccountId = whitelisted_caller(); - T::Currency::make_free_balance_be(&caller, BalanceOf::::max_value()); + T::Currency::set_balance(&caller, T::Currency::minimum_balance() * 10000u32.into()); // Create friends let friends = generate_friends::(n); @@ -153,7 +151,7 @@ benchmarks! { initiate_recovery { let caller: T::AccountId = whitelisted_caller(); - T::Currency::make_free_balance_be(&caller, BalanceOf::::max_value()); + T::Currency::set_balance(&caller, T::Currency::minimum_balance() * 10000u32.into()); let lost_account: T::AccountId = account("lost_account", 0, SEED); let lost_account_lookup = T::Lookup::unlookup(lost_account.clone()); @@ -198,8 +196,8 @@ benchmarks! { // Create the recovery config storage item >::insert(&lost_account, recovery_config.clone()); - // Reserve deposit for recovery - T::Currency::reserve(&caller, total_deposit).unwrap(); + // Hold deposit for configuration + T::Currency::hold(&HoldReason::ConfigurationDeposit.into(), &caller, total_deposit).unwrap(); // Create an active recovery status let recovery_status = ActiveRecovery { @@ -232,7 +230,7 @@ benchmarks! { let lost_account: T::AccountId = account("lost_account", 0, SEED); let lost_account_lookup = T::Lookup::unlookup(lost_account.clone()); - T::Currency::make_free_balance_be(&caller, BalanceOf::::max_value()); + T::Currency::set_balance(&caller, T::Currency::minimum_balance() * 10000u32.into()); // Create friends let friends = generate_friends::(n); @@ -251,8 +249,8 @@ benchmarks! { // Create the recovery config storage item >::insert(&lost_account, recovery_config.clone()); - // Reserve deposit for recovery - T::Currency::reserve(&caller, total_deposit).unwrap(); + // Hold deposit for configuration + T::Currency::hold(&HoldReason::ConfigurationDeposit.into(), &caller, total_deposit).unwrap(); // Create an active recovery status let recovery_status = ActiveRecovery { @@ -282,8 +280,8 @@ benchmarks! { let n in 1 .. T::MaxFriends::get(); - T::Currency::make_free_balance_be(&caller, BalanceOf::::max_value()); - T::Currency::make_free_balance_be(&rescuer_account, BalanceOf::::max_value()); + T::Currency::set_balance(&caller, T::Currency::minimum_balance() * 10000u32.into()); + T::Currency::set_balance(&rescuer_account, T::Currency::minimum_balance() * 10000u32.into()); // Create friends let friends = generate_friends::(n); @@ -302,8 +300,8 @@ benchmarks! { // Create the recovery config storage item >::insert(&caller, recovery_config.clone()); - // Reserve deposit for recovery - T::Currency::reserve(&caller, total_deposit).unwrap(); + // Hold deposit for configuration + T::Currency::hold(&HoldReason::ConfigurationDeposit.into(), &caller, total_deposit).unwrap(); // Create an active recovery status let recovery_status = ActiveRecovery { @@ -331,7 +329,7 @@ benchmarks! { let caller: T::AccountId = whitelisted_caller(); - T::Currency::make_free_balance_be(&caller, BalanceOf::::max_value()); + T::Currency::set_balance(&caller, T::Currency::minimum_balance() * 10000u32.into()); // Create friends let friends = generate_friends::(n); @@ -350,8 +348,8 @@ benchmarks! { // Create the recovery config storage item >::insert(&caller, recovery_config); - // Reserve deposit for recovery - T::Currency::reserve(&caller, total_deposit).unwrap(); + // Hold deposit for configuration + T::Currency::hold(&HoldReason::ConfigurationDeposit.into(), &caller, total_deposit).unwrap(); }: _( RawOrigin::Signed(caller.clone()) ) verify { diff --git a/substrate/frame/recovery/src/lib.rs b/substrate/frame/recovery/src/lib.rs index 5673147c8e00..231d176b3423 100644 --- a/substrate/frame/recovery/src/lib.rs +++ b/substrate/frame/recovery/src/lib.rs @@ -68,10 +68,10 @@ //! configuration on the recovered account and reclaim the recovery configuration deposit they //! placed. //! 9. Using `as_recovered`, the account owner is able to call any other pallets to clean up their -//! state and reclaim any reserved or locked funds. They can then transfer all funds from the +//! state and reclaim any held or locked funds. They can then transfer all funds from the //! recovered account to the new account. -//! 10. When the recovered account becomes reaped (i.e. its free and reserved balance drops to -//! zero), the final recovery link is removed. +//! 10. When the recovered account becomes reaped (i.e. its free and held balance drops to zero), +//! the final recovery link is removed. //! //! ### Malicious Recovery Attempts //! @@ -158,9 +158,14 @@ use sp_runtime::{ }; use sp_std::prelude::*; +#[cfg(feature = "runtime-benchmarks")] +use frame_support::traits::fungible::Mutate; use frame_support::{ dispatch::{GetDispatchInfo, PostDispatchInfo}, - traits::{BalanceStatus, Currency, ReservableCurrency}, + traits::{ + fungible::{Inspect, MutateHold}, + tokens::{Fortitude, Precision, Restriction}, + }, BoundedVec, }; @@ -177,7 +182,7 @@ mod tests; pub mod weights; type BalanceOf = - <::Currency as Currency<::AccountId>>::Balance; + <::Currency as Inspect<::AccountId>>::Balance; type FriendsOf = BoundedVec<::AccountId, ::MaxFriends>; type AccountIdLookupOf = <::Lookup as StaticLookup>::Source; @@ -187,7 +192,7 @@ type AccountIdLookupOf = <::Lookup as StaticLookup pub struct ActiveRecovery { /// The block number when the recovery process started. created: BlockNumber, - /// The amount held in reserve of the `depositor`, + /// The amount held the `depositor`, /// To be returned once this recovery process is closed. deposit: Balance, /// The friends which have vouched so far. Always sorted. @@ -200,7 +205,7 @@ pub struct RecoveryConfig { /// The minimum number of blocks since the start of the recovery process before the account /// can be recovered. delay_period: BlockNumber, - /// The amount held in reserve of the `depositor`, + /// The amount held of the `depositor`, /// to be returned once this configuration is removed. deposit: Balance, /// The list of friends which can help recover an account. Always sorted. @@ -235,9 +240,15 @@ pub mod pallet { + From>; /// The currency mechanism. - type Currency: ReservableCurrency; + #[cfg(feature = "runtime-benchmarks")] + type Currency: Mutate + + MutateHold; + + /// The currency mechanism. + #[cfg(not(feature = "runtime-benchmarks"))] + type Currency: MutateHold; - /// The base amount of currency needed to reserve for creating a recovery configuration. + /// The base amount of currency needed to hold for creating a recovery configuration. /// /// This is held for an additional storage item whose value size is /// `2 + sizeof(BlockNumber, Balance)` bytes. @@ -254,14 +265,14 @@ pub mod pallet { /// The maximum amount of friends allowed in a recovery configuration. /// - /// NOTE: The threshold programmed in this Pallet uses u16, so it does - /// not really make sense to have a limit here greater than u16::MAX. + /// NOTE: The threshold programmed in this Pallet uses u32, so it does + /// not really make sense to have a limit here greater than u32::MAX. /// But also, that is a lot more than you should probably set this value /// to anyway... #[pallet::constant] type MaxFriends: Get; - /// The base amount of currency needed to reserve for starting a recovery. + /// The base amount of currency needed to hold for starting a recovery. /// /// This is primarily held for deterring malicious recovery attempts, and should /// have a value large enough that a bad actor would choose not to place this @@ -270,6 +281,9 @@ pub mod pallet { /// threshold. #[pallet::constant] type RecoveryDeposit: Get>; + + /// The overarching hold reason. + type RuntimeHoldReason: From; } /// Events type. @@ -330,6 +344,16 @@ pub mod pallet { BadState, } + /// The reasons for the pallet recovery placing holds on funds. + #[pallet::composite_enum] + pub enum HoldReason { + /// The Pallet holds it as the initial Configuration Deposit, when the Recovery + /// Configuration is created. + ConfigurationDeposit, + /// The Pallet holds it as the Deposit for starting a Recovery Process. + RecoveryProcessDeposit, + } + /// The set of recoverable accounts and their recovery configuration. #[pallet::storage] #[pallet::getter(fn recovery_config)] @@ -424,7 +448,7 @@ pub mod pallet { /// Create a recovery configuration for your account. This makes your account recoverable. /// /// Payment: `ConfigDepositBase` + `FriendDepositFactor` * #_of_friends balance - /// will be reserved for storing the recovery configuration. This deposit is returned + /// will be held for storing the recovery configuration. This deposit is returned /// in full when the user calls `remove_recovery`. /// /// The dispatch origin for this call must be _Signed_. @@ -462,8 +486,8 @@ pub mod pallet { let total_deposit = T::ConfigDepositBase::get() .checked_add(&friend_deposit) .ok_or(ArithmeticError::Overflow)?; - // Reserve the deposit - T::Currency::reserve(&who, total_deposit)?; + // Hold the deposit + T::Currency::hold(&HoldReason::ConfigurationDeposit.into(), &who, total_deposit)?; // Create the recovery configuration let recovery_config = RecoveryConfig { delay_period, @@ -480,7 +504,7 @@ pub mod pallet { /// Initiate the process for recovering a recoverable account. /// - /// Payment: `RecoveryDeposit` balance will be reserved for initiating the + /// Payment: `RecoveryDeposit` balance will be held for initiating the /// recovery process. This deposit will always be repatriated to the account /// trying to be recovered. See `close_recovery`. /// @@ -506,7 +530,7 @@ pub mod pallet { ); // Take recovery deposit let recovery_deposit = T::RecoveryDeposit::get(); - T::Currency::reserve(&who, recovery_deposit)?; + T::Currency::hold(&HoldReason::RecoveryProcessDeposit.into(), &who, recovery_deposit)?; // Create an active recovery status let recovery_status = ActiveRecovery { created: >::block_number(), @@ -637,13 +661,16 @@ pub mod pallet { // Take the active recovery process started by the rescuer for this account. let active_recovery = >::take(&who, &rescuer).ok_or(Error::::NotStarted)?; - // Move the reserved funds from the rescuer to the rescued account. + // Move the held funds from the rescuer to the rescued account. // Acts like a slashing mechanism for those who try to maliciously recover accounts. - let res = T::Currency::repatriate_reserved( + let res = T::Currency::transfer_on_hold( + &HoldReason::RecoveryProcessDeposit.into(), &rescuer, &who, active_recovery.deposit, - BalanceStatus::Free, + Precision::BestEffort, + Restriction::Free, + Fortitude::Force, ); debug_assert!(res.is_ok()); Self::deposit_event(Event::::RecoveryClosed { @@ -658,7 +685,7 @@ pub mod pallet { /// NOTE: The user must make sure to call `close_recovery` on all active /// recovery attempts before calling this function else it will fail. /// - /// Payment: By calling this function the recoverable account will unreserve + /// Payment: By calling this function the recoverable account will release /// their recovery configuration deposit. /// (`ConfigDepositBase` + `FriendDepositFactor` * #_of_friends) /// @@ -674,8 +701,13 @@ pub mod pallet { // Take the recovery configuration for this account. let recovery_config = >::take(&who).ok_or(Error::::NotRecoverable)?; - // Unreserve the initial deposit for the recovery configuration. - T::Currency::unreserve(&who, recovery_config.deposit); + // Release the initial deposit for the recovery configuration. + let _ = T::Currency::release( + &HoldReason::ConfigurationDeposit.into(), + &who, + recovery_config.deposit, + Precision::BestEffort, + ); Self::deposit_event(Event::::RecoveryRemoved { lost_account: who }); Ok(()) } diff --git a/substrate/frame/recovery/src/mock.rs b/substrate/frame/recovery/src/mock.rs index 44cbeec09862..56be0d6badd6 100644 --- a/substrate/frame/recovery/src/mock.rs +++ b/substrate/frame/recovery/src/mock.rs @@ -37,7 +37,7 @@ frame_support::construct_runtime!( { System: frame_system::{Pallet, Call, Config, Storage, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Recovery: recovery::{Pallet, Call, Storage, Event}, + Recovery: recovery::{Pallet, Call, Storage, Event, HoldReason}, } ); @@ -84,9 +84,9 @@ impl pallet_balances::Config for Test { type WeightInfo = (); type FreezeIdentifier = (); type MaxFreezes = (); - type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); + type RuntimeHoldReason = RuntimeHoldReason; + type MaxHolds = ConstU32<1>; } parameter_types! { @@ -106,6 +106,7 @@ impl Config for Test { type FriendDepositFactor = FriendDepositFactor; type MaxFriends = MaxFriends; type RecoveryDeposit = RecoveryDeposit; + type RuntimeHoldReason = RuntimeHoldReason; } pub type BalancesCall = pallet_balances::Call; diff --git a/substrate/frame/recovery/src/tests.rs b/substrate/frame/recovery/src/tests.rs index 93df07015852..010632906b18 100644 --- a/substrate/frame/recovery/src/tests.rs +++ b/substrate/frame/recovery/src/tests.rs @@ -18,10 +18,10 @@ //! Tests for the module. use super::*; -use frame_support::{assert_noop, assert_ok, traits::Currency}; +use frame_support::{assert_noop, assert_ok}; use mock::{ - new_test_ext, run_to_block, Balances, BalancesCall, MaxFriends, Recovery, RecoveryCall, - RuntimeCall, RuntimeOrigin, Test, + new_test_ext, run_to_block, BalancesCall, MaxFriends, Recovery, RecoveryCall, RuntimeCall, + RuntimeOrigin, Test, }; use sp_runtime::{bounded_vec, traits::BadOrigin}; @@ -33,7 +33,7 @@ fn basic_setup_works() { assert_eq!(Recovery::active_recovery(&1, &2), None); assert_eq!(Recovery::recovery_config(&1), None); // Everyone should have starting balance of 100 - assert_eq!(Balances::free_balance(1), 100); + assert_eq!(::Currency::free_balance(1), 100); }); } @@ -51,8 +51,8 @@ fn set_recovered_works() { })); assert_ok!(Recovery::as_recovered(RuntimeOrigin::signed(1), 5, call)); // Account 1 has successfully drained the funds from account 5 - assert_eq!(Balances::free_balance(1), 200); - assert_eq!(Balances::free_balance(5), 0); + assert_eq!(::Currency::free_balance(1), 200); + assert_eq!(::Currency::free_balance(5), 0); }); } @@ -95,15 +95,15 @@ fn recovery_life_cycle_works() { let call = Box::new(RuntimeCall::Recovery(RecoveryCall::remove_recovery {})); assert_ok!(Recovery::as_recovered(RuntimeOrigin::signed(1), 5, call)); // Account 1 should now be able to make a call through account 5 to get all of their funds - assert_eq!(Balances::free_balance(5), 110); + assert_eq!(::Currency::free_balance(5), 110); let call = Box::new(RuntimeCall::Balances(BalancesCall::transfer_allow_death { dest: 1, value: 110, })); assert_ok!(Recovery::as_recovered(RuntimeOrigin::signed(1), 5, call)); // All funds have been fully recovered! - assert_eq!(Balances::free_balance(1), 200); - assert_eq!(Balances::free_balance(5), 0); + assert_eq!(::Currency::free_balance(1), 200); + assert_eq!(::Currency::free_balance(5), 0); // Remove the proxy link. assert_ok!(Recovery::cancel_recovered(RuntimeOrigin::signed(1), 5)); @@ -154,9 +154,9 @@ fn malicious_recovery_fails() { // Account 5 can close the recovery process before account 1 can claim it assert_ok!(Recovery::close_recovery(RuntimeOrigin::signed(5), 1)); // By doing so, account 5 has now claimed the deposit originally reserved by account 1 - assert_eq!(Balances::total_balance(&1), 90); + assert_eq!(::Currency::total_balance(&1), 90); // Thanks for the free money! - assert_eq!(Balances::total_balance(&5), 110); + assert_eq!(::Currency::total_balance(&5), 110); // The recovery process has been closed, so account 1 can't make the claim run_to_block(20); assert_noop!( @@ -236,7 +236,7 @@ fn create_recovery_works() { )); // Deposit is taken, and scales with the number of friends they pick // Base 10 + 1 per friends = 13 total reserved - assert_eq!(Balances::reserved_balance(5), 13); + assert_eq!(::Currency::reserved_balance(5), 13); // Recovery configuration is correctly stored let recovery_config = RecoveryConfig { delay_period, @@ -273,7 +273,7 @@ fn initiate_recovery_handles_basic_errors() { Error::::AlreadyStarted ); // No double deposit - assert_eq!(Balances::reserved_balance(1), 10); + assert_eq!(::Currency::reserved_balance(1), 10); }); } @@ -293,7 +293,7 @@ fn initiate_recovery_works() { // Recovery can be initiated assert_ok!(Recovery::initiate_recovery(RuntimeOrigin::signed(1), 5)); // Deposit is reserved - assert_eq!(Balances::reserved_balance(1), 10); + assert_eq!(::Currency::reserved_balance(1), 10); // Recovery status object is created correctly let recovery_status = ActiveRecovery { created: 0, deposit: 10, friends: Default::default() }; diff --git a/substrate/frame/recovery/src/weights.rs b/substrate/frame/recovery/src/weights.rs index 84b19ae694ee..59c1c07880df 100644 --- a/substrate/frame/recovery/src/weights.rs +++ b/substrate/frame/recovery/src/weights.rs @@ -15,32 +15,29 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Autogenerated weights for pallet_recovery +//! Autogenerated weights for `pallet_recovery` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-16, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-e8ezs4ez-project-145-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `runner-nbnwcyh-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: -// ./target/production/substrate +// target/production/substrate-node // benchmark // pallet -// --chain=dev // --steps=50 // --repeat=20 -// --pallet=pallet_recovery -// --no-storage-info -// --no-median-slopes -// --no-min-squares // --extrinsic=* -// --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./frame/recovery/src/weights.rs -// --header=./HEADER-APACHE2 -// --template=./.maintain/frame-weight-template.hbs +// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json +// --pallet=pallet_recovery +// --chain=dev +// --header=./substrate/HEADER-APACHE2 +// --output=./substrate/frame/recovery/src/weights.rs +// --template=./substrate/.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -50,7 +47,7 @@ use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use core::marker::PhantomData; -/// Weight functions needed for pallet_recovery. +/// Weight functions needed for `pallet_recovery`. pub trait WeightInfo { fn as_recovered() -> Weight; fn set_recovered() -> Weight; @@ -63,258 +60,278 @@ pub trait WeightInfo { fn cancel_recovered() -> Weight; } -/// Weights for pallet_recovery using the Substrate node and recommended hardware. +/// Weights for `pallet_recovery` using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { - /// Storage: Recovery Proxy (r:1 w:0) - /// Proof: Recovery Proxy (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// Storage: `Recovery::Proxy` (r:1 w:0) + /// Proof: `Recovery::Proxy` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) + /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `TxPause::PausedCalls` (r:1 w:0) + /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) fn as_recovered() -> Weight { // Proof Size summary in bytes: - // Measured: `281` - // Estimated: `3545` - // Minimum execution time: 9_360_000 picoseconds. - Weight::from_parts(9_773_000, 3545) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Measured: `497` + // Estimated: `3997` + // Minimum execution time: 14_978_000 picoseconds. + Weight::from_parts(15_426_000, 3997) + .saturating_add(T::DbWeight::get().reads(3_u64)) } - /// Storage: Recovery Proxy (r:0 w:1) - /// Proof: Recovery Proxy (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// Storage: `Recovery::Proxy` (r:0 w:1) + /// Proof: `Recovery::Proxy` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) fn set_recovered() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_146_000 picoseconds. - Weight::from_parts(9_507_000, 0) + // Minimum execution time: 7_215_000 picoseconds. + Weight::from_parts(7_533_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: Recovery Recoverable (r:1 w:1) - /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) + /// Storage: `Recovery::Recoverable` (r:1 w:1) + /// Proof: `Recovery::Recoverable` (`max_values`: None, `max_size`: Some(351), added: 2826, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 9]`. - fn create_recovery(n: u32, ) -> Weight { + fn create_recovery(_n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `175` + // Measured: `246` // Estimated: `3816` - // Minimum execution time: 26_472_000 picoseconds. - Weight::from_parts(27_917_651, 3816) - // Standard Error: 7_129 - .saturating_add(Weight::from_parts(59_239, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 40_846_000 picoseconds. + Weight::from_parts(43_003_881, 3816) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) } - /// Storage: Recovery Recoverable (r:1 w:0) - /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) - /// Storage: Recovery ActiveRecoveries (r:1 w:1) - /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) + /// Storage: `Recovery::Recoverable` (r:1 w:0) + /// Proof: `Recovery::Recoverable` (`max_values`: None, `max_size`: Some(351), added: 2826, mode: `MaxEncodedLen`) + /// Storage: `Recovery::ActiveRecoveries` (r:1 w:1) + /// Proof: `Recovery::ActiveRecoveries` (`max_values`: None, `max_size`: Some(389), added: 2864, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`) fn initiate_recovery() -> Weight { // Proof Size summary in bytes: - // Measured: `272` + // Measured: `399` // Estimated: `3854` - // Minimum execution time: 29_618_000 picoseconds. - Weight::from_parts(30_192_000, 3854) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 46_415_000 picoseconds. + Weight::from_parts(47_838_000, 3854) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) } - /// Storage: Recovery Recoverable (r:1 w:0) - /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) - /// Storage: Recovery ActiveRecoveries (r:1 w:1) - /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) + /// Storage: `Recovery::Recoverable` (r:1 w:0) + /// Proof: `Recovery::Recoverable` (`max_values`: None, `max_size`: Some(351), added: 2826, mode: `MaxEncodedLen`) + /// Storage: `Recovery::ActiveRecoveries` (r:1 w:1) + /// Proof: `Recovery::ActiveRecoveries` (`max_values`: None, `max_size`: Some(389), added: 2864, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 9]`. fn vouch_recovery(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `360 + n * (64 ±0)` + // Measured: `431 + n * (64 ±0)` // Estimated: `3854` - // Minimum execution time: 19_464_000 picoseconds. - Weight::from_parts(20_642_522, 3854) - // Standard Error: 5_974 - .saturating_add(Weight::from_parts(142_308, 0).saturating_mul(n.into())) + // Minimum execution time: 17_650_000 picoseconds. + Weight::from_parts(18_549_554, 3854) + // Standard Error: 5_639 + .saturating_add(Weight::from_parts(165_063, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: Recovery Recoverable (r:1 w:0) - /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) - /// Storage: Recovery ActiveRecoveries (r:1 w:0) - /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) - /// Storage: Recovery Proxy (r:1 w:1) - /// Proof: Recovery Proxy (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// Storage: `Recovery::Recoverable` (r:1 w:0) + /// Proof: `Recovery::Recoverable` (`max_values`: None, `max_size`: Some(351), added: 2826, mode: `MaxEncodedLen`) + /// Storage: `Recovery::ActiveRecoveries` (r:1 w:0) + /// Proof: `Recovery::ActiveRecoveries` (`max_values`: None, `max_size`: Some(389), added: 2864, mode: `MaxEncodedLen`) + /// Storage: `Recovery::Proxy` (r:1 w:1) + /// Proof: `Recovery::Proxy` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 9]`. fn claim_recovery(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `392 + n * (64 ±0)` + // Measured: `463 + n * (64 ±0)` // Estimated: `3854` - // Minimum execution time: 23_656_000 picoseconds. - Weight::from_parts(24_903_269, 3854) - // Standard Error: 5_771 - .saturating_add(Weight::from_parts(117_343, 0).saturating_mul(n.into())) + // Minimum execution time: 22_116_000 picoseconds. + Weight::from_parts(23_394_422, 3854) + // Standard Error: 6_460 + .saturating_add(Weight::from_parts(123_990, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: Recovery ActiveRecoveries (r:1 w:1) - /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: `Recovery::ActiveRecoveries` (r:1 w:1) + /// Proof: `Recovery::ActiveRecoveries` (`max_values`: None, `max_size`: Some(389), added: 2864, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 9]`. fn close_recovery(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `513 + n * (32 ±0)` + // Measured: `640 + n * (32 ±0)` // Estimated: `3854` - // Minimum execution time: 34_866_000 picoseconds. - Weight::from_parts(36_368_748, 3854) - // Standard Error: 6_600 - .saturating_add(Weight::from_parts(118_610, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Minimum execution time: 33_055_000 picoseconds. + Weight::from_parts(33_866_688, 3854) + // Standard Error: 11_055 + .saturating_add(Weight::from_parts(375_493, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } - /// Storage: Recovery ActiveRecoveries (r:1 w:0) - /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) - /// Storage: Recovery Recoverable (r:1 w:1) - /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) + /// Storage: `Recovery::ActiveRecoveries` (r:1 w:0) + /// Proof: `Recovery::ActiveRecoveries` (`max_values`: None, `max_size`: Some(389), added: 2864, mode: `MaxEncodedLen`) + /// Storage: `Recovery::Recoverable` (r:1 w:1) + /// Proof: `Recovery::Recoverable` (`max_values`: None, `max_size`: Some(351), added: 2826, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 9]`. fn remove_recovery(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `270 + n * (32 ±0)` + // Measured: `397 + n * (32 ±0)` // Estimated: `3854` - // Minimum execution time: 31_405_000 picoseconds. - Weight::from_parts(32_552_838, 3854) - // Standard Error: 8_043 - .saturating_add(Weight::from_parts(171_605, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 41_769_000 picoseconds. + Weight::from_parts(43_418_125, 3854) + // Standard Error: 8_521 + .saturating_add(Weight::from_parts(175_925, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) } - /// Storage: Recovery Proxy (r:1 w:1) - /// Proof: Recovery Proxy (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// Storage: `Recovery::Proxy` (r:1 w:1) + /// Proof: `Recovery::Proxy` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) fn cancel_recovered() -> Weight { // Proof Size summary in bytes: - // Measured: `281` + // Measured: `352` // Estimated: `3545` - // Minimum execution time: 11_530_000 picoseconds. - Weight::from_parts(11_851_000, 3545) + // Minimum execution time: 11_635_000 picoseconds. + Weight::from_parts(12_200_000, 3545) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } } -// For backwards compatibility and tests +// For backwards compatibility and tests. impl WeightInfo for () { - /// Storage: Recovery Proxy (r:1 w:0) - /// Proof: Recovery Proxy (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// Storage: `Recovery::Proxy` (r:1 w:0) + /// Proof: `Recovery::Proxy` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `SafeMode::EnteredUntil` (r:1 w:0) + /// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `TxPause::PausedCalls` (r:1 w:0) + /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) fn as_recovered() -> Weight { // Proof Size summary in bytes: - // Measured: `281` - // Estimated: `3545` - // Minimum execution time: 9_360_000 picoseconds. - Weight::from_parts(9_773_000, 3545) - .saturating_add(RocksDbWeight::get().reads(1_u64)) + // Measured: `497` + // Estimated: `3997` + // Minimum execution time: 14_978_000 picoseconds. + Weight::from_parts(15_426_000, 3997) + .saturating_add(RocksDbWeight::get().reads(3_u64)) } - /// Storage: Recovery Proxy (r:0 w:1) - /// Proof: Recovery Proxy (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// Storage: `Recovery::Proxy` (r:0 w:1) + /// Proof: `Recovery::Proxy` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) fn set_recovered() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_146_000 picoseconds. - Weight::from_parts(9_507_000, 0) + // Minimum execution time: 7_215_000 picoseconds. + Weight::from_parts(7_533_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: Recovery Recoverable (r:1 w:1) - /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) + /// Storage: `Recovery::Recoverable` (r:1 w:1) + /// Proof: `Recovery::Recoverable` (`max_values`: None, `max_size`: Some(351), added: 2826, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 9]`. - fn create_recovery(n: u32, ) -> Weight { + fn create_recovery(_n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `175` + // Measured: `246` // Estimated: `3816` - // Minimum execution time: 26_472_000 picoseconds. - Weight::from_parts(27_917_651, 3816) - // Standard Error: 7_129 - .saturating_add(Weight::from_parts(59_239, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + // Minimum execution time: 40_846_000 picoseconds. + Weight::from_parts(43_003_881, 3816) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Storage: Recovery Recoverable (r:1 w:0) - /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) - /// Storage: Recovery ActiveRecoveries (r:1 w:1) - /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) + /// Storage: `Recovery::Recoverable` (r:1 w:0) + /// Proof: `Recovery::Recoverable` (`max_values`: None, `max_size`: Some(351), added: 2826, mode: `MaxEncodedLen`) + /// Storage: `Recovery::ActiveRecoveries` (r:1 w:1) + /// Proof: `Recovery::ActiveRecoveries` (`max_values`: None, `max_size`: Some(389), added: 2864, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`) fn initiate_recovery() -> Weight { // Proof Size summary in bytes: - // Measured: `272` + // Measured: `399` // Estimated: `3854` - // Minimum execution time: 29_618_000 picoseconds. - Weight::from_parts(30_192_000, 3854) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + // Minimum execution time: 46_415_000 picoseconds. + Weight::from_parts(47_838_000, 3854) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Storage: Recovery Recoverable (r:1 w:0) - /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) - /// Storage: Recovery ActiveRecoveries (r:1 w:1) - /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) + /// Storage: `Recovery::Recoverable` (r:1 w:0) + /// Proof: `Recovery::Recoverable` (`max_values`: None, `max_size`: Some(351), added: 2826, mode: `MaxEncodedLen`) + /// Storage: `Recovery::ActiveRecoveries` (r:1 w:1) + /// Proof: `Recovery::ActiveRecoveries` (`max_values`: None, `max_size`: Some(389), added: 2864, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 9]`. fn vouch_recovery(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `360 + n * (64 ±0)` + // Measured: `431 + n * (64 ±0)` // Estimated: `3854` - // Minimum execution time: 19_464_000 picoseconds. - Weight::from_parts(20_642_522, 3854) - // Standard Error: 5_974 - .saturating_add(Weight::from_parts(142_308, 0).saturating_mul(n.into())) + // Minimum execution time: 17_650_000 picoseconds. + Weight::from_parts(18_549_554, 3854) + // Standard Error: 5_639 + .saturating_add(Weight::from_parts(165_063, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: Recovery Recoverable (r:1 w:0) - /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) - /// Storage: Recovery ActiveRecoveries (r:1 w:0) - /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) - /// Storage: Recovery Proxy (r:1 w:1) - /// Proof: Recovery Proxy (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// Storage: `Recovery::Recoverable` (r:1 w:0) + /// Proof: `Recovery::Recoverable` (`max_values`: None, `max_size`: Some(351), added: 2826, mode: `MaxEncodedLen`) + /// Storage: `Recovery::ActiveRecoveries` (r:1 w:0) + /// Proof: `Recovery::ActiveRecoveries` (`max_values`: None, `max_size`: Some(389), added: 2864, mode: `MaxEncodedLen`) + /// Storage: `Recovery::Proxy` (r:1 w:1) + /// Proof: `Recovery::Proxy` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 9]`. fn claim_recovery(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `392 + n * (64 ±0)` + // Measured: `463 + n * (64 ±0)` // Estimated: `3854` - // Minimum execution time: 23_656_000 picoseconds. - Weight::from_parts(24_903_269, 3854) - // Standard Error: 5_771 - .saturating_add(Weight::from_parts(117_343, 0).saturating_mul(n.into())) + // Minimum execution time: 22_116_000 picoseconds. + Weight::from_parts(23_394_422, 3854) + // Standard Error: 6_460 + .saturating_add(Weight::from_parts(123_990, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: Recovery ActiveRecoveries (r:1 w:1) - /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: `Recovery::ActiveRecoveries` (r:1 w:1) + /// Proof: `Recovery::ActiveRecoveries` (`max_values`: None, `max_size`: Some(389), added: 2864, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 9]`. fn close_recovery(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `513 + n * (32 ±0)` + // Measured: `640 + n * (32 ±0)` // Estimated: `3854` - // Minimum execution time: 34_866_000 picoseconds. - Weight::from_parts(36_368_748, 3854) - // Standard Error: 6_600 - .saturating_add(Weight::from_parts(118_610, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) + // Minimum execution time: 33_055_000 picoseconds. + Weight::from_parts(33_866_688, 3854) + // Standard Error: 11_055 + .saturating_add(Weight::from_parts(375_493, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: Recovery ActiveRecoveries (r:1 w:0) - /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) - /// Storage: Recovery Recoverable (r:1 w:1) - /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) + /// Storage: `Recovery::ActiveRecoveries` (r:1 w:0) + /// Proof: `Recovery::ActiveRecoveries` (`max_values`: None, `max_size`: Some(389), added: 2864, mode: `MaxEncodedLen`) + /// Storage: `Recovery::Recoverable` (r:1 w:1) + /// Proof: `Recovery::Recoverable` (`max_values`: None, `max_size`: Some(351), added: 2826, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 9]`. fn remove_recovery(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `270 + n * (32 ±0)` + // Measured: `397 + n * (32 ±0)` // Estimated: `3854` - // Minimum execution time: 31_405_000 picoseconds. - Weight::from_parts(32_552_838, 3854) - // Standard Error: 8_043 - .saturating_add(Weight::from_parts(171_605, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + // Minimum execution time: 41_769_000 picoseconds. + Weight::from_parts(43_418_125, 3854) + // Standard Error: 8_521 + .saturating_add(Weight::from_parts(175_925, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Storage: Recovery Proxy (r:1 w:1) - /// Proof: Recovery Proxy (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// Storage: `Recovery::Proxy` (r:1 w:1) + /// Proof: `Recovery::Proxy` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) fn cancel_recovered() -> Weight { // Proof Size summary in bytes: - // Measured: `281` + // Measured: `352` // Estimated: `3545` - // Minimum execution time: 11_530_000 picoseconds. - Weight::from_parts(11_851_000, 3545) + // Minimum execution time: 11_635_000 picoseconds. + Weight::from_parts(12_200_000, 3545) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) }