diff --git a/api/lib/src/queries.rs b/api/lib/src/queries.rs index 3081a966286..e5e999c3471 100644 --- a/api/lib/src/queries.rs +++ b/api/lib/src/queries.rs @@ -133,7 +133,7 @@ impl QueryApi { Ok(self .state_chain_client - .storage_map_entry::>( + .storage_map_entry::>( block_hash, &account_id, ) diff --git a/state-chain/pallets/cf-funding/src/benchmarking.rs b/state-chain/pallets/cf-funding/src/benchmarking.rs index ed44af1c44d..d6fea4c9aa7 100644 --- a/state-chain/pallets/cf-funding/src/benchmarking.rs +++ b/state-chain/pallets/cf-funding/src/benchmarking.rs @@ -183,7 +183,7 @@ benchmarks! { let caller: T::AccountId = whitelisted_caller(); }:_(RawOrigin::Signed(caller.clone()), Default::default()) verify { - assert!(BoundAddress::::contains_key(&caller)); + assert!(BoundRedeemAddress::::contains_key(&caller)); } update_restricted_addresses { @@ -204,5 +204,12 @@ benchmarks! { let _ = call.dispatch_bypass_filter(T::EnsureGovernance::try_successful_origin().unwrap()); } + bind_executor_address { + let caller: T::AccountId = whitelisted_caller(); + }:_(RawOrigin::Signed(caller.clone()), Default::default()) + verify { + assert!(BoundExecutorAddress::::contains_key(&caller)); + } + impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test,); } diff --git a/state-chain/pallets/cf-funding/src/lib.rs b/state-chain/pallets/cf-funding/src/lib.rs index d841be48997..daa20cfae9a 100644 --- a/state-chain/pallets/cf-funding/src/lib.rs +++ b/state-chain/pallets/cf-funding/src/lib.rs @@ -134,6 +134,11 @@ pub mod pallet { #[pallet::storage] pub type RedemptionTTLSeconds = StorageValue<_, u64, ValueQuery>; + /// Registered addresses for an executor. + #[pallet::storage] + pub type BoundExecutorAddress = + StorageMap<_, Blake2_128Concat, AccountId, EthereumAddress, OptionQuery>; + /// List of restricted addresses #[pallet::storage] pub type RestrictedAddresses = @@ -151,7 +156,7 @@ pub mod pallet { /// Map of bound addresses for accounts. #[pallet::storage] - pub type BoundAddress = + pub type BoundRedeemAddress = StorageMap<_, Blake2_128Concat, AccountId, EthereumAddress>; /// The fee levied for every redemption request. Can be updated by Governance. @@ -233,6 +238,9 @@ pub mod pallet { /// An account has been bound to an address. BoundRedeemAddress { account_id: AccountId, address: EthereumAddress }, + + /// An account has been bound to an executor address. + BoundExecutorAddress { account_id: AccountId, address: EthereumAddress }, } #[pallet::error] @@ -288,6 +296,12 @@ pub mod pallet { /// Stop Bidding is disabled due to Safe Mode. StopBiddingDisabled, + + /// The executor for this account is bound to another address. + ExecutorBindingRestrictionViolated, + + /// The account is already bound to an executor address. + ExecutorAddressAlreadyBound, } #[pallet::call] @@ -354,6 +368,13 @@ pub mod pallet { ) -> DispatchResultWithPostInfo { let account_id = ensure_signed(origin)?; + if let Some(executor_addr) = BoundExecutorAddress::::get(&account_id) { + ensure!( + executor_addr == executor.unwrap_or_default(), + Error::::ExecutorBindingRestrictionViolated + ); + } + ensure!(T::SafeMode::get().redeem_enabled, Error::::RedeemDisabled); // Not allowed to redeem if we are an active bidder in the auction phase @@ -370,7 +391,7 @@ pub mod pallet { let mut restricted_balances = RestrictedBalances::::get(&account_id); let redemption_fee = RedemptionTax::::get(); - if let Some(bound_address) = BoundAddress::::get(&account_id) { + if let Some(bound_address) = BoundRedeemAddress::::get(&account_id) { ensure!( bound_address == address || restricted_balances.keys().any(|res_address| res_address == &address), @@ -612,7 +633,7 @@ pub mod pallet { /// /// - [BadOrigin](frame_support::error::BadOrigin) #[pallet::call_index(7)] - #[pallet::weight(T::WeightInfo::update_restricted_addresses(addresses_to_add.len() as u32, addresses_to_remove.len() as u32))] + #[pallet::weight(T::WeightInfo::update_restricted_addresses(addresses_to_add.len() as u32, addresses_to_remove.len() as u32, 10_u32))] pub fn update_restricted_addresses( origin: OriginFor, addresses_to_add: Vec, @@ -651,8 +672,11 @@ pub mod pallet { address: EthereumAddress, ) -> DispatchResultWithPostInfo { let account_id = ensure_signed(origin)?; - ensure!(!BoundAddress::::contains_key(&account_id), Error::::AccountAlreadyBound); - BoundAddress::::insert(&account_id, address); + ensure!( + !BoundRedeemAddress::::contains_key(&account_id), + Error::::AccountAlreadyBound + ); + BoundRedeemAddress::::insert(&account_id, address); Self::deposit_event(Event::BoundRedeemAddress { account_id, address }); Ok(().into()) } @@ -673,6 +697,35 @@ pub mod pallet { Self::deposit_event(Event::::RedemptionTaxAmountUpdated { amount }); Ok(()) } + + /// Binds executor address to an account. + /// + /// ## Events + /// + /// - [BoundExecutorAddress](Event::BoundExecutorAddress) + /// + /// ## Errors + /// + /// - [ExecutorAddressAlreadyBound](Error::ExecutorAddressAlreadyBound) + /// - [BadOrigin](frame_support::error::BadOrigin) + #[pallet::call_index(10)] + #[pallet::weight(T::WeightInfo::bind_executor_address())] + pub fn bind_executor_address( + origin: OriginFor, + executor_address: EthereumAddress, + ) -> DispatchResultWithPostInfo { + let account_id = ensure_signed(origin)?; + ensure!( + !BoundExecutorAddress::::contains_key(&account_id), + Error::::ExecutorAddressAlreadyBound, + ); + BoundExecutorAddress::::insert(account_id.clone(), executor_address); + Self::deposit_event(Event::BoundExecutorAddress { + account_id, + address: executor_address, + }); + Ok(().into()) + } } #[pallet::genesis_config] diff --git a/state-chain/pallets/cf-funding/src/tests.rs b/state-chain/pallets/cf-funding/src/tests.rs index aea7eadb55c..8628f1839ef 100644 --- a/state-chain/pallets/cf-funding/src/tests.rs +++ b/state-chain/pallets/cf-funding/src/tests.rs @@ -1,6 +1,6 @@ use crate::{ - mock::*, pallet, ActiveBidder, Error, EthereumAddress, PendingRedemptions, RedemptionAmount, - RedemptionTax, RestrictedAddresses, RestrictedBalances, + mock::*, pallet, ActiveBidder, BoundExecutorAddress, Error, EthereumAddress, + PendingRedemptions, RedemptionAmount, RedemptionTax, RestrictedAddresses, RestrictedBalances, }; use cf_primitives::FlipBalance; use cf_test_utilities::assert_event_sequence; @@ -10,7 +10,7 @@ use cf_traits::{ }; use sp_core::H160; -use crate::BoundAddress; +use crate::BoundRedeemAddress; use frame_support::{assert_noop, assert_ok}; use pallet_cf_flip::Bonder; use sp_runtime::{traits::BadOrigin, DispatchError}; @@ -862,7 +862,7 @@ fn can_only_redeem_funds_to_bound_address() { const UNRESTRICTED_ADDRESS: EthereumAddress = H160([0x03; 20]); const AMOUNT: u128 = 100; RestrictedAddresses::::insert(RESTRICTED_ADDRESS_1, ()); - BoundAddress::::insert(ALICE, BOUND_ADDRESS); + BoundRedeemAddress::::insert(ALICE, BOUND_ADDRESS); assert_ok!(Funding::funded( RuntimeOrigin::root(), ALICE, @@ -903,7 +903,7 @@ fn redeem_funds_until_restricted_balance_is_zero_and_then_redeem_to_redeem_addre const UNRESTRICTED_ADDRESS: EthereumAddress = H160([0x03; 20]); const AMOUNT: u128 = 100; RestrictedAddresses::::insert(RESTRICTED_ADDRESS, ()); - BoundAddress::::insert(ALICE, REDEEM_ADDRESS); + BoundRedeemAddress::::insert(ALICE, REDEEM_ADDRESS); assert_ok!(Funding::funded( RuntimeOrigin::root(), ALICE, @@ -1277,8 +1277,8 @@ fn can_bind_redeem_address() { address, }) if address == REDEEM_ADDRESS, ); - assert!(BoundAddress::::contains_key(ALICE)); - assert_eq!(BoundAddress::::get(ALICE).unwrap(), REDEEM_ADDRESS); + assert!(BoundRedeemAddress::::contains_key(ALICE)); + assert_eq!(BoundRedeemAddress::::get(ALICE).unwrap(), REDEEM_ADDRESS); }); } @@ -1467,3 +1467,42 @@ fn check_restricted_balances_are_getting_removed() { assert!(RestrictedBalances::::get(ALICE).get(&RESTRICTED_ADDRESS).is_none()); }); } + +#[test] +fn bind_executor_address() { + new_test_ext().execute_with(|| { + const EXECUTOR_ADDRESS: EthereumAddress = H160([0x01; 20]); + assert_ok!(Funding::bind_executor_address(RuntimeOrigin::signed(ALICE), EXECUTOR_ADDRESS)); + assert_event_sequence!( + Test, + RuntimeEvent::Funding(crate::Event::BoundExecutorAddress { + account_id: ALICE, + address, + }) if address == EXECUTOR_ADDRESS, + ); + assert!(BoundExecutorAddress::::contains_key(ALICE)); + assert_eq!(BoundExecutorAddress::::get(ALICE).unwrap(), EXECUTOR_ADDRESS); + assert_noop!( + Funding::bind_executor_address(RuntimeOrigin::signed(ALICE), EXECUTOR_ADDRESS), + Error::::ExecutorAddressAlreadyBound + ); + }); +} + +#[test] +fn detect_wrong_executor_address() { + new_test_ext().execute_with(|| { + const EXECUTOR_ADDRESS: EthereumAddress = H160([0x01; 20]); + const WRONG_EXECUTOR_ADDRESS: EthereumAddress = H160([0x02; 20]); + assert_ok!(Funding::bind_executor_address(RuntimeOrigin::signed(ALICE), EXECUTOR_ADDRESS)); + assert_noop!( + Funding::redeem( + RuntimeOrigin::signed(ALICE), + 100.into(), + ETH_DUMMY_ADDR, + Some(WRONG_EXECUTOR_ADDRESS) + ), + Error::::ExecutorBindingRestrictionViolated + ); + }); +} diff --git a/state-chain/pallets/cf-funding/src/weights.rs b/state-chain/pallets/cf-funding/src/weights.rs index ac53b37389b..92e89c2088f 100644 --- a/state-chain/pallets/cf-funding/src/weights.rs +++ b/state-chain/pallets/cf-funding/src/weights.rs @@ -2,9 +2,10 @@ //! Autogenerated weights for pallet_cf_funding //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-06, STEPS: `20`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-09-14, STEPS: `20`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `janislav030.localdomain`, CPU: `` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 +//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: // ./target/release/chainflip-node @@ -24,9 +25,10 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] +#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; +use core::marker::PhantomData; /// Weight functions needed for pallet_cf_funding. pub trait WeightInfo { @@ -40,368 +42,659 @@ pub trait WeightInfo { fn update_minimum_funding() -> Weight; fn update_redemption_tax() -> Weight; fn bind_redeem_address() -> Weight; - fn update_restricted_addresses(a: u32, b: u32, ) -> Weight; + fn update_restricted_addresses(a: u32, b: u32, c: u32, ) -> Weight; + fn bind_executor_address() -> Weight; } /// Weights for pallet_cf_funding using the Substrate node and recommended hardware. pub struct PalletWeight(PhantomData); impl WeightInfo for PalletWeight { - // Storage: Flip OffchainFunds (r:1 w:1) - // Storage: Flip Account (r:1 w:1) - // Storage: Flip TotalIssuance (r:1 w:1) - // Storage: Validator CurrentAuthorities (r:1 w:0) - // Storage: Validator Backups (r:1 w:1) - // Storage: Funding RestrictedAddresses (r:1 w:0) - // Storage: AccountRoles AccountRoles (r:0 w:1) + /// Storage: `Flip::OffchainFunds` (r:1 w:1) + /// Proof: `Flip::OffchainFunds` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Flip::Account` (r:1 w:1) + /// Proof: `Flip::Account` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `Flip::TotalIssuance` (r:1 w:1) + /// Proof: `Flip::TotalIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Validator::CurrentAuthorities` (r:1 w:0) + /// Proof: `Validator::CurrentAuthorities` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::Backups` (r:1 w:1) + /// Proof: `Validator::Backups` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Funding::RestrictedAddresses` (r:1 w:0) + /// Proof: `Funding::RestrictedAddresses` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AccountRoles::AccountRoles` (r:0 w:1) + /// Proof: `AccountRoles::AccountRoles` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) fn funded() -> Weight { - // Minimum execution time: 91_000 nanoseconds. - Weight::from_parts(94_000_000, 0) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(5)) + // Proof Size summary in bytes: + // Measured: `890` + // Estimated: `4355` + // Minimum execution time: 68_000_000 picoseconds. + Weight::from_parts(71_000_000, 4355) + .saturating_add(T::DbWeight::get().reads(6_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64)) } - // Storage: Environment CurrentSystemState (r:1 w:0) - // Storage: Funding RedemptionTax (r:1 w:0) - // Storage: Validator CurrentRotationPhase (r:1 w:0) - // Storage: Validator CurrentEpochStartedAt (r:1 w:0) - // Storage: Validator BlocksPerEpoch (r:1 w:0) - // Storage: Validator RedemptionPeriodAsPercentage (r:1 w:0) - // Storage: Funding PendingRedemptions (r:1 w:1) - // Storage: Funding RestrictedBalances (r:1 w:0) - // Storage: Funding BoundAddress (r:1 w:0) - // Storage: Flip Account (r:1 w:1) - // Storage: Funding MinimumFunding (r:1 w:0) - // Storage: Flip TotalIssuance (r:1 w:1) - // Storage: Validator CurrentAuthorities (r:1 w:0) - // Storage: Validator Backups (r:1 w:1) - // Storage: Timestamp Now (r:1 w:0) - // Storage: Funding RedemptionTTLSeconds (r:1 w:0) - // Storage: Environment EthereumSignatureNonce (r:1 w:1) - // Storage: Environment EthereumChainId (r:1 w:0) - // Storage: Environment EthereumKeyManagerAddress (r:1 w:0) - // Storage: Environment EthereumStateChainGatewayAddress (r:1 w:0) - // Storage: EthereumBroadcaster BroadcastIdCounter (r:1 w:1) - // Storage: EthereumThresholdSigner ThresholdSignatureRequestIdCounter (r:1 w:1) - // Storage: EthereumVault CurrentVaultEpochAndState (r:1 w:0) - // Storage: EthereumVault Vaults (r:1 w:0) - // Storage: Validator HistoricalAuthorities (r:1 w:0) - // Storage: Reputation Suspensions (r:3 w:0) - // Storage: EthereumVault CeremonyIdCounter (r:1 w:1) - // Storage: EthereumThresholdSigner ThresholdSignatureResponseTimeout (r:1 w:0) - // Storage: EthereumThresholdSigner CeremonyRetryQueues (r:1 w:1) - // Storage: EthereumThresholdSigner Signature (r:0 w:1) - // Storage: EthereumThresholdSigner PendingCeremonies (r:0 w:1) - // Storage: EthereumThresholdSigner RequestCallback (r:0 w:1) - // Storage: Flip PendingRedemptionsReserve (r:0 w:1) - // Storage: EthereumBroadcaster RotationBroadcast (r:0 w:1) + /// Storage: `Funding::BoundExecutorAddress` (r:1 w:0) + /// Proof: `Funding::BoundExecutorAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Environment::RuntimeSafeMode` (r:1 w:0) + /// Proof: `Environment::RuntimeSafeMode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::CurrentRotationPhase` (r:1 w:0) + /// Proof: `Validator::CurrentRotationPhase` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::CurrentEpochStartedAt` (r:1 w:0) + /// Proof: `Validator::CurrentEpochStartedAt` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::RedemptionPeriodAsPercentage` (r:1 w:0) + /// Proof: `Validator::RedemptionPeriodAsPercentage` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::BlocksPerEpoch` (r:1 w:0) + /// Proof: `Validator::BlocksPerEpoch` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Funding::PendingRedemptions` (r:1 w:1) + /// Proof: `Funding::PendingRedemptions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Funding::RestrictedBalances` (r:1 w:0) + /// Proof: `Funding::RestrictedBalances` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Funding::RedemptionTax` (r:1 w:0) + /// Proof: `Funding::RedemptionTax` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Funding::BoundRedeemAddress` (r:1 w:0) + /// Proof: `Funding::BoundRedeemAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Flip::Account` (r:1 w:1) + /// Proof: `Flip::Account` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `Flip::TotalIssuance` (r:1 w:1) + /// Proof: `Flip::TotalIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Funding::MinimumFunding` (r:1 w:0) + /// Proof: `Funding::MinimumFunding` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::CurrentAuthorities` (r:1 w:0) + /// Proof: `Validator::CurrentAuthorities` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::Backups` (r:1 w:1) + /// Proof: `Validator::Backups` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Funding::RedemptionTTLSeconds` (r:1 w:0) + /// Proof: `Funding::RedemptionTTLSeconds` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Environment::EthereumStateChainGatewayAddress` (r:1 w:0) + /// Proof: `Environment::EthereumStateChainGatewayAddress` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Environment::EthereumSignatureNonce` (r:1 w:1) + /// Proof: `Environment::EthereumSignatureNonce` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Environment::EthereumChainId` (r:1 w:0) + /// Proof: `Environment::EthereumChainId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Environment::EthereumKeyManagerAddress` (r:1 w:0) + /// Proof: `Environment::EthereumKeyManagerAddress` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumBroadcaster::BroadcastIdCounter` (r:1 w:1) + /// Proof: `EthereumBroadcaster::BroadcastIdCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::ThresholdSignatureRequestIdCounter` (r:1 w:1) + /// Proof: `EthereumThresholdSigner::ThresholdSignatureRequestIdCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumVault::CurrentVaultEpochAndState` (r:1 w:0) + /// Proof: `EthereumVault::CurrentVaultEpochAndState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumVault::Vaults` (r:1 w:0) + /// Proof: `EthereumVault::Vaults` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Validator::HistoricalAuthorities` (r:1 w:0) + /// Proof: `Validator::HistoricalAuthorities` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Reputation::Suspensions` (r:3 w:0) + /// Proof: `Reputation::Suspensions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `EthereumVault::CeremonyIdCounter` (r:1 w:1) + /// Proof: `EthereumVault::CeremonyIdCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::ThresholdSignatureResponseTimeout` (r:1 w:0) + /// Proof: `EthereumThresholdSigner::ThresholdSignatureResponseTimeout` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::CeremonyRetryQueues` (r:1 w:1) + /// Proof: `EthereumThresholdSigner::CeremonyRetryQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::Signature` (r:0 w:1) + /// Proof: `EthereumThresholdSigner::Signature` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::PendingCeremonies` (r:0 w:1) + /// Proof: `EthereumThresholdSigner::PendingCeremonies` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::RequestCallback` (r:0 w:1) + /// Proof: `EthereumThresholdSigner::RequestCallback` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Flip::PendingRedemptionsReserve` (r:0 w:1) + /// Proof: `Flip::PendingRedemptionsReserve` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) fn redeem() -> Weight { - // Minimum execution time: 229_000 nanoseconds. - Weight::from_parts(248_000_000, 0) - .saturating_add(T::DbWeight::get().reads(31)) - .saturating_add(T::DbWeight::get().writes(14)) + // Proof Size summary in bytes: + // Measured: `1939` + // Estimated: `10354` + // Minimum execution time: 208_000_000 picoseconds. + Weight::from_parts(211_000_000, 10354) + .saturating_add(T::DbWeight::get().reads(32_u64)) + .saturating_add(T::DbWeight::get().writes(13_u64)) } - // Storage: Environment CurrentSystemState (r:1 w:0) - // Storage: Flip Account (r:1 w:1) - // Storage: Funding RedemptionTax (r:1 w:0) - // Storage: Validator CurrentRotationPhase (r:1 w:0) - // Storage: Validator CurrentEpochStartedAt (r:1 w:0) - // Storage: Validator BlocksPerEpoch (r:1 w:0) - // Storage: Validator RedemptionPeriodAsPercentage (r:1 w:0) - // Storage: Funding PendingRedemptions (r:1 w:1) - // Storage: Funding RestrictedBalances (r:1 w:0) - // Storage: Funding BoundAddress (r:1 w:0) - // Storage: Flip TotalIssuance (r:1 w:1) - // Storage: Validator CurrentAuthorities (r:1 w:0) - // Storage: Validator Backups (r:1 w:1) - // Storage: Timestamp Now (r:1 w:0) - // Storage: Funding RedemptionTTLSeconds (r:1 w:0) - // Storage: Environment EthereumSignatureNonce (r:1 w:1) - // Storage: Environment EthereumChainId (r:1 w:0) - // Storage: Environment EthereumKeyManagerAddress (r:1 w:0) - // Storage: Environment EthereumStateChainGatewayAddress (r:1 w:0) - // Storage: EthereumBroadcaster BroadcastIdCounter (r:1 w:1) - // Storage: EthereumThresholdSigner ThresholdSignatureRequestIdCounter (r:1 w:1) - // Storage: EthereumVault CurrentVaultEpochAndState (r:1 w:0) - // Storage: EthereumVault Vaults (r:1 w:0) - // Storage: Validator HistoricalAuthorities (r:1 w:0) - // Storage: Reputation Suspensions (r:3 w:0) - // Storage: EthereumVault CeremonyIdCounter (r:1 w:1) - // Storage: EthereumThresholdSigner ThresholdSignatureResponseTimeout (r:1 w:0) - // Storage: EthereumThresholdSigner CeremonyRetryQueues (r:1 w:1) - // Storage: EthereumThresholdSigner Signature (r:0 w:1) - // Storage: EthereumThresholdSigner PendingCeremonies (r:0 w:1) - // Storage: EthereumThresholdSigner RequestCallback (r:0 w:1) - // Storage: Flip PendingRedemptionsReserve (r:0 w:1) - // Storage: EthereumBroadcaster RotationBroadcast (r:0 w:1) + /// Storage: `Funding::BoundExecutorAddress` (r:1 w:0) + /// Proof: `Funding::BoundExecutorAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Environment::RuntimeSafeMode` (r:1 w:0) + /// Proof: `Environment::RuntimeSafeMode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::CurrentRotationPhase` (r:1 w:0) + /// Proof: `Validator::CurrentRotationPhase` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::CurrentEpochStartedAt` (r:1 w:0) + /// Proof: `Validator::CurrentEpochStartedAt` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::RedemptionPeriodAsPercentage` (r:1 w:0) + /// Proof: `Validator::RedemptionPeriodAsPercentage` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::BlocksPerEpoch` (r:1 w:0) + /// Proof: `Validator::BlocksPerEpoch` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Funding::PendingRedemptions` (r:1 w:1) + /// Proof: `Funding::PendingRedemptions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Funding::RestrictedBalances` (r:1 w:0) + /// Proof: `Funding::RestrictedBalances` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Funding::RedemptionTax` (r:1 w:0) + /// Proof: `Funding::RedemptionTax` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Funding::BoundRedeemAddress` (r:1 w:0) + /// Proof: `Funding::BoundRedeemAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Flip::Account` (r:1 w:1) + /// Proof: `Flip::Account` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `Flip::TotalIssuance` (r:1 w:1) + /// Proof: `Flip::TotalIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Validator::CurrentAuthorities` (r:1 w:0) + /// Proof: `Validator::CurrentAuthorities` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::Backups` (r:1 w:1) + /// Proof: `Validator::Backups` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Funding::RedemptionTTLSeconds` (r:1 w:0) + /// Proof: `Funding::RedemptionTTLSeconds` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Environment::EthereumStateChainGatewayAddress` (r:1 w:0) + /// Proof: `Environment::EthereumStateChainGatewayAddress` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Environment::EthereumSignatureNonce` (r:1 w:1) + /// Proof: `Environment::EthereumSignatureNonce` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Environment::EthereumChainId` (r:1 w:0) + /// Proof: `Environment::EthereumChainId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Environment::EthereumKeyManagerAddress` (r:1 w:0) + /// Proof: `Environment::EthereumKeyManagerAddress` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumBroadcaster::BroadcastIdCounter` (r:1 w:1) + /// Proof: `EthereumBroadcaster::BroadcastIdCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::ThresholdSignatureRequestIdCounter` (r:1 w:1) + /// Proof: `EthereumThresholdSigner::ThresholdSignatureRequestIdCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumVault::CurrentVaultEpochAndState` (r:1 w:0) + /// Proof: `EthereumVault::CurrentVaultEpochAndState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumVault::Vaults` (r:1 w:0) + /// Proof: `EthereumVault::Vaults` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Validator::HistoricalAuthorities` (r:1 w:0) + /// Proof: `Validator::HistoricalAuthorities` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Reputation::Suspensions` (r:3 w:0) + /// Proof: `Reputation::Suspensions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `EthereumVault::CeremonyIdCounter` (r:1 w:1) + /// Proof: `EthereumVault::CeremonyIdCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::ThresholdSignatureResponseTimeout` (r:1 w:0) + /// Proof: `EthereumThresholdSigner::ThresholdSignatureResponseTimeout` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::CeremonyRetryQueues` (r:1 w:1) + /// Proof: `EthereumThresholdSigner::CeremonyRetryQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::Signature` (r:0 w:1) + /// Proof: `EthereumThresholdSigner::Signature` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::PendingCeremonies` (r:0 w:1) + /// Proof: `EthereumThresholdSigner::PendingCeremonies` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::RequestCallback` (r:0 w:1) + /// Proof: `EthereumThresholdSigner::RequestCallback` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Flip::PendingRedemptionsReserve` (r:0 w:1) + /// Proof: `Flip::PendingRedemptionsReserve` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) fn redeem_all() -> Weight { - // Minimum execution time: 237_000 nanoseconds. - Weight::from_parts(248_000_000, 0) - .saturating_add(T::DbWeight::get().reads(30)) - .saturating_add(T::DbWeight::get().writes(14)) + // Proof Size summary in bytes: + // Measured: `1936` + // Estimated: `10351` + // Minimum execution time: 206_000_000 picoseconds. + Weight::from_parts(211_000_000, 10351) + .saturating_add(T::DbWeight::get().reads(31_u64)) + .saturating_add(T::DbWeight::get().writes(13_u64)) } - // Storage: Funding PendingRedemptions (r:1 w:1) - // Storage: Flip PendingRedemptionsReserve (r:1 w:1) - // Storage: Flip OffchainFunds (r:1 w:1) - // Storage: Flip Account (r:1 w:1) - // Storage: Flip TotalIssuance (r:1 w:1) - // Storage: Validator AccountPeerMapping (r:1 w:0) - // Storage: Validator VanityNames (r:1 w:1) - // Storage: Reputation LastHeartbeat (r:0 w:1) - // Storage: Reputation Reputations (r:0 w:1) - // Storage: Reputation OffenceTimeSlotTracker (r:0 w:1) - // Storage: AccountRoles AccountRoles (r:0 w:1) - // Storage: Funding ActiveBidder (r:0 w:1) + /// Storage: `Funding::PendingRedemptions` (r:1 w:1) + /// Proof: `Funding::PendingRedemptions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Flip::PendingRedemptionsReserve` (r:1 w:1) + /// Proof: `Flip::PendingRedemptionsReserve` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) + /// Storage: `Flip::OffchainFunds` (r:1 w:1) + /// Proof: `Flip::OffchainFunds` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Flip::Account` (r:1 w:0) + /// Proof: `Flip::Account` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) fn redeemed() -> Weight { - // Minimum execution time: 125_000 nanoseconds. - Weight::from_parts(129_000_000, 0) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(11)) + // Proof Size summary in bytes: + // Measured: `771` + // Estimated: `4236` + // Minimum execution time: 38_000_000 picoseconds. + Weight::from_parts(40_000_000, 4236) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } - // Storage: Funding PendingRedemptions (r:1 w:1) - // Storage: Flip PendingRedemptionsReserve (r:1 w:1) - // Storage: Flip Account (r:1 w:1) - // Storage: Flip TotalIssuance (r:1 w:1) - // Storage: Validator CurrentAuthorities (r:1 w:0) - // Storage: Validator Backups (r:1 w:1) + /// Storage: `Funding::PendingRedemptions` (r:1 w:1) + /// Proof: `Funding::PendingRedemptions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Flip::PendingRedemptionsReserve` (r:1 w:1) + /// Proof: `Flip::PendingRedemptionsReserve` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) + /// Storage: `Flip::Account` (r:1 w:1) + /// Proof: `Flip::Account` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `Flip::TotalIssuance` (r:1 w:1) + /// Proof: `Flip::TotalIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Validator::CurrentAuthorities` (r:1 w:0) + /// Proof: `Validator::CurrentAuthorities` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::Backups` (r:1 w:1) + /// Proof: `Validator::Backups` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn redemption_expired() -> Weight { - // Minimum execution time: 74_000 nanoseconds. - Weight::from_parts(78_000_000, 0) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(5)) + // Proof Size summary in bytes: + // Measured: `1129` + // Estimated: `4594` + // Minimum execution time: 58_000_000 picoseconds. + Weight::from_parts(59_000_000, 4594) + .saturating_add(T::DbWeight::get().reads(6_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64)) } - // Storage: AccountRoles AccountRoles (r:1 w:0) - // Storage: Validator CurrentRotationPhase (r:1 w:0) - // Storage: Validator CurrentEpochStartedAt (r:1 w:0) - // Storage: Validator BlocksPerEpoch (r:1 w:0) - // Storage: Validator RedemptionPeriodAsPercentage (r:1 w:0) - // Storage: Funding ActiveBidder (r:1 w:1) + /// Storage: `Environment::RuntimeSafeMode` (r:1 w:0) + /// Proof: `Environment::RuntimeSafeMode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AccountRoles::AccountRoles` (r:1 w:0) + /// Proof: `AccountRoles::AccountRoles` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) + /// Storage: `Validator::CurrentRotationPhase` (r:1 w:0) + /// Proof: `Validator::CurrentRotationPhase` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::CurrentEpochStartedAt` (r:1 w:0) + /// Proof: `Validator::CurrentEpochStartedAt` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::RedemptionPeriodAsPercentage` (r:1 w:0) + /// Proof: `Validator::RedemptionPeriodAsPercentage` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::BlocksPerEpoch` (r:1 w:0) + /// Proof: `Validator::BlocksPerEpoch` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Funding::ActiveBidder` (r:1 w:1) + /// Proof: `Funding::ActiveBidder` (`max_values`: None, `max_size`: None, mode: `Measured`) fn stop_bidding() -> Weight { - // Minimum execution time: 62_000 nanoseconds. - Weight::from_parts(67_000_000, 0) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(1)) + // Proof Size summary in bytes: + // Measured: `1254` + // Estimated: `4719` + // Minimum execution time: 51_000_000 picoseconds. + Weight::from_parts(52_000_000, 4719) + .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } - // Storage: AccountRoles AccountRoles (r:1 w:0) - // Storage: Funding ActiveBidder (r:1 w:1) + /// Storage: `Environment::RuntimeSafeMode` (r:1 w:0) + /// Proof: `Environment::RuntimeSafeMode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AccountRoles::AccountRoles` (r:1 w:0) + /// Proof: `AccountRoles::AccountRoles` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) + /// Storage: `Funding::ActiveBidder` (r:1 w:1) + /// Proof: `Funding::ActiveBidder` (`max_values`: None, `max_size`: None, mode: `Measured`) fn start_bidding() -> Weight { - // Minimum execution time: 44_000 nanoseconds. - Weight::from_parts(47_000_000, 0) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) + // Proof Size summary in bytes: + // Measured: `891` + // Estimated: `4356` + // Minimum execution time: 34_000_000 picoseconds. + Weight::from_parts(36_000_000, 4356) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } - // Storage: Funding RedemptionTax (r:1 w:0) - // Storage: Funding MinimumFunding (r:0 w:1) + /// Storage: `Funding::RedemptionTax` (r:1 w:0) + /// Proof: `Funding::RedemptionTax` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Funding::MinimumFunding` (r:0 w:1) + /// Proof: `Funding::MinimumFunding` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn update_minimum_funding() -> Weight { - // Minimum execution time: 32_000 nanoseconds. - Weight::from_parts(33_000_000, 0) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Proof Size summary in bytes: + // Measured: `139` + // Estimated: `1624` + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 1624) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } - // Storage: Funding MinimumFunding (r:1 w:0) - // Storage: Funding RedemptionTax (r:0 w:1) + /// Storage: `Funding::MinimumFunding` (r:1 w:0) + /// Proof: `Funding::MinimumFunding` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Funding::RedemptionTax` (r:0 w:1) + /// Proof: `Funding::RedemptionTax` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn update_redemption_tax() -> Weight { - // Minimum execution time: 33_000 nanoseconds. - Weight::from_parts(33_000_000, 0) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Proof Size summary in bytes: + // Measured: `139` + // Estimated: `1624` + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 1624) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } - // Storage: Funding BoundAddress (r:1 w:1) + /// Storage: `Funding::BoundRedeemAddress` (r:1 w:1) + /// Proof: `Funding::BoundRedeemAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) fn bind_redeem_address() -> Weight { - // Minimum execution time: 17_000 nanoseconds. - Weight::from_parts(18_000_000, 0) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Proof Size summary in bytes: + // Measured: `136` + // Estimated: `3601` + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(20_000_000, 3601) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } - // Storage: Funding RestrictedAddresses (r:0 w:1) + /// Storage: `Funding::RestrictedBalances` (r:101 w:100) + /// Proof: `Funding::RestrictedBalances` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Funding::RestrictedAddresses` (r:0 w:1) + /// Proof: `Funding::RestrictedAddresses` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `a` is `[1, 100]`. /// The range of component `b` is `[1, 100]`. - fn update_restricted_addresses(a: u32, b: u32, ) -> Weight { - // Minimum execution time: 894_000 nanoseconds. - Weight::from_parts(995_413, 0) - // Standard Error: 47_147 - .saturating_add(Weight::from_parts(9_110_754, 0).saturating_mul(a.into())) - // Standard Error: 47_147 - .saturating_add(Weight::from_parts(9_085_808, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().writes(1)) + /// The range of component `c` is `[1, 100]`. + fn update_restricted_addresses(_a: u32, b: u32, c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `166 + c * (92 ±0)` + // Estimated: `3629 + b * (9 ±1) + c * (2567 ±1)` + // Minimum execution time: 908_000_000 picoseconds. + Weight::from_parts(920_000_000, 3629) + // Standard Error: 6_632_935 + .saturating_add(Weight::from_parts(339_664_961, 0).saturating_mul(b.into())) + // Standard Error: 6_632_935 + .saturating_add(Weight::from_parts(323_344_893, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) + .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) + .saturating_add(Weight::from_parts(0, 9).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 2567).saturating_mul(c.into())) + } + /// Storage: `Funding::BoundExecutorAddress` (r:1 w:1) + /// Proof: `Funding::BoundExecutorAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn bind_executor_address() -> Weight { + // Proof Size summary in bytes: + // Measured: `136` + // Estimated: `3601` + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 3601) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } } // For backwards compatibility and tests impl WeightInfo for () { - // Storage: Flip OffchainFunds (r:1 w:1) - // Storage: Flip Account (r:1 w:1) - // Storage: Flip TotalIssuance (r:1 w:1) - // Storage: Validator CurrentAuthorities (r:1 w:0) - // Storage: Validator Backups (r:1 w:1) - // Storage: Funding RestrictedAddresses (r:1 w:0) - // Storage: AccountRoles AccountRoles (r:0 w:1) + /// Storage: `Flip::OffchainFunds` (r:1 w:1) + /// Proof: `Flip::OffchainFunds` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Flip::Account` (r:1 w:1) + /// Proof: `Flip::Account` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `Flip::TotalIssuance` (r:1 w:1) + /// Proof: `Flip::TotalIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Validator::CurrentAuthorities` (r:1 w:0) + /// Proof: `Validator::CurrentAuthorities` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::Backups` (r:1 w:1) + /// Proof: `Validator::Backups` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Funding::RestrictedAddresses` (r:1 w:0) + /// Proof: `Funding::RestrictedAddresses` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AccountRoles::AccountRoles` (r:0 w:1) + /// Proof: `AccountRoles::AccountRoles` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) fn funded() -> Weight { - // Minimum execution time: 91_000 nanoseconds. - Weight::from_parts(94_000_000, 0) - .saturating_add(RocksDbWeight::get().reads(6)) - .saturating_add(RocksDbWeight::get().writes(5)) + // Proof Size summary in bytes: + // Measured: `890` + // Estimated: `4355` + // Minimum execution time: 68_000_000 picoseconds. + Weight::from_parts(71_000_000, 4355) + .saturating_add(RocksDbWeight::get().reads(6_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64)) } - // Storage: Environment CurrentSystemState (r:1 w:0) - // Storage: Funding RedemptionTax (r:1 w:0) - // Storage: Validator CurrentRotationPhase (r:1 w:0) - // Storage: Validator CurrentEpochStartedAt (r:1 w:0) - // Storage: Validator BlocksPerEpoch (r:1 w:0) - // Storage: Validator RedemptionPeriodAsPercentage (r:1 w:0) - // Storage: Funding PendingRedemptions (r:1 w:1) - // Storage: Funding RestrictedBalances (r:1 w:0) - // Storage: Funding BoundAddress (r:1 w:0) - // Storage: Flip Account (r:1 w:1) - // Storage: Funding MinimumFunding (r:1 w:0) - // Storage: Flip TotalIssuance (r:1 w:1) - // Storage: Validator CurrentAuthorities (r:1 w:0) - // Storage: Validator Backups (r:1 w:1) - // Storage: Timestamp Now (r:1 w:0) - // Storage: Funding RedemptionTTLSeconds (r:1 w:0) - // Storage: Environment EthereumSignatureNonce (r:1 w:1) - // Storage: Environment EthereumChainId (r:1 w:0) - // Storage: Environment EthereumKeyManagerAddress (r:1 w:0) - // Storage: Environment EthereumStateChainGatewayAddress (r:1 w:0) - // Storage: EthereumBroadcaster BroadcastIdCounter (r:1 w:1) - // Storage: EthereumThresholdSigner ThresholdSignatureRequestIdCounter (r:1 w:1) - // Storage: EthereumVault CurrentVaultEpochAndState (r:1 w:0) - // Storage: EthereumVault Vaults (r:1 w:0) - // Storage: Validator HistoricalAuthorities (r:1 w:0) - // Storage: Reputation Suspensions (r:3 w:0) - // Storage: EthereumVault CeremonyIdCounter (r:1 w:1) - // Storage: EthereumThresholdSigner ThresholdSignatureResponseTimeout (r:1 w:0) - // Storage: EthereumThresholdSigner CeremonyRetryQueues (r:1 w:1) - // Storage: EthereumThresholdSigner Signature (r:0 w:1) - // Storage: EthereumThresholdSigner PendingCeremonies (r:0 w:1) - // Storage: EthereumThresholdSigner RequestCallback (r:0 w:1) - // Storage: Flip PendingRedemptionsReserve (r:0 w:1) - // Storage: EthereumBroadcaster RotationBroadcast (r:0 w:1) + /// Storage: `Funding::BoundExecutorAddress` (r:1 w:0) + /// Proof: `Funding::BoundExecutorAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Environment::RuntimeSafeMode` (r:1 w:0) + /// Proof: `Environment::RuntimeSafeMode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::CurrentRotationPhase` (r:1 w:0) + /// Proof: `Validator::CurrentRotationPhase` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::CurrentEpochStartedAt` (r:1 w:0) + /// Proof: `Validator::CurrentEpochStartedAt` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::RedemptionPeriodAsPercentage` (r:1 w:0) + /// Proof: `Validator::RedemptionPeriodAsPercentage` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::BlocksPerEpoch` (r:1 w:0) + /// Proof: `Validator::BlocksPerEpoch` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Funding::PendingRedemptions` (r:1 w:1) + /// Proof: `Funding::PendingRedemptions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Funding::RestrictedBalances` (r:1 w:0) + /// Proof: `Funding::RestrictedBalances` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Funding::RedemptionTax` (r:1 w:0) + /// Proof: `Funding::RedemptionTax` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Funding::BoundRedeemAddress` (r:1 w:0) + /// Proof: `Funding::BoundRedeemAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Flip::Account` (r:1 w:1) + /// Proof: `Flip::Account` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `Flip::TotalIssuance` (r:1 w:1) + /// Proof: `Flip::TotalIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Funding::MinimumFunding` (r:1 w:0) + /// Proof: `Funding::MinimumFunding` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::CurrentAuthorities` (r:1 w:0) + /// Proof: `Validator::CurrentAuthorities` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::Backups` (r:1 w:1) + /// Proof: `Validator::Backups` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Funding::RedemptionTTLSeconds` (r:1 w:0) + /// Proof: `Funding::RedemptionTTLSeconds` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Environment::EthereumStateChainGatewayAddress` (r:1 w:0) + /// Proof: `Environment::EthereumStateChainGatewayAddress` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Environment::EthereumSignatureNonce` (r:1 w:1) + /// Proof: `Environment::EthereumSignatureNonce` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Environment::EthereumChainId` (r:1 w:0) + /// Proof: `Environment::EthereumChainId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Environment::EthereumKeyManagerAddress` (r:1 w:0) + /// Proof: `Environment::EthereumKeyManagerAddress` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumBroadcaster::BroadcastIdCounter` (r:1 w:1) + /// Proof: `EthereumBroadcaster::BroadcastIdCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::ThresholdSignatureRequestIdCounter` (r:1 w:1) + /// Proof: `EthereumThresholdSigner::ThresholdSignatureRequestIdCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumVault::CurrentVaultEpochAndState` (r:1 w:0) + /// Proof: `EthereumVault::CurrentVaultEpochAndState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumVault::Vaults` (r:1 w:0) + /// Proof: `EthereumVault::Vaults` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Validator::HistoricalAuthorities` (r:1 w:0) + /// Proof: `Validator::HistoricalAuthorities` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Reputation::Suspensions` (r:3 w:0) + /// Proof: `Reputation::Suspensions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `EthereumVault::CeremonyIdCounter` (r:1 w:1) + /// Proof: `EthereumVault::CeremonyIdCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::ThresholdSignatureResponseTimeout` (r:1 w:0) + /// Proof: `EthereumThresholdSigner::ThresholdSignatureResponseTimeout` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::CeremonyRetryQueues` (r:1 w:1) + /// Proof: `EthereumThresholdSigner::CeremonyRetryQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::Signature` (r:0 w:1) + /// Proof: `EthereumThresholdSigner::Signature` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::PendingCeremonies` (r:0 w:1) + /// Proof: `EthereumThresholdSigner::PendingCeremonies` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::RequestCallback` (r:0 w:1) + /// Proof: `EthereumThresholdSigner::RequestCallback` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Flip::PendingRedemptionsReserve` (r:0 w:1) + /// Proof: `Flip::PendingRedemptionsReserve` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) fn redeem() -> Weight { - // Minimum execution time: 229_000 nanoseconds. - Weight::from_parts(248_000_000, 0) - .saturating_add(RocksDbWeight::get().reads(31)) - .saturating_add(RocksDbWeight::get().writes(14)) + // Proof Size summary in bytes: + // Measured: `1939` + // Estimated: `10354` + // Minimum execution time: 208_000_000 picoseconds. + Weight::from_parts(211_000_000, 10354) + .saturating_add(RocksDbWeight::get().reads(32_u64)) + .saturating_add(RocksDbWeight::get().writes(13_u64)) } - // Storage: Environment CurrentSystemState (r:1 w:0) - // Storage: Flip Account (r:1 w:1) - // Storage: Funding RedemptionTax (r:1 w:0) - // Storage: Validator CurrentRotationPhase (r:1 w:0) - // Storage: Validator CurrentEpochStartedAt (r:1 w:0) - // Storage: Validator BlocksPerEpoch (r:1 w:0) - // Storage: Validator RedemptionPeriodAsPercentage (r:1 w:0) - // Storage: Funding PendingRedemptions (r:1 w:1) - // Storage: Funding RestrictedBalances (r:1 w:0) - // Storage: Funding BoundAddress (r:1 w:0) - // Storage: Flip TotalIssuance (r:1 w:1) - // Storage: Validator CurrentAuthorities (r:1 w:0) - // Storage: Validator Backups (r:1 w:1) - // Storage: Timestamp Now (r:1 w:0) - // Storage: Funding RedemptionTTLSeconds (r:1 w:0) - // Storage: Environment EthereumSignatureNonce (r:1 w:1) - // Storage: Environment EthereumChainId (r:1 w:0) - // Storage: Environment EthereumKeyManagerAddress (r:1 w:0) - // Storage: Environment EthereumStateChainGatewayAddress (r:1 w:0) - // Storage: EthereumBroadcaster BroadcastIdCounter (r:1 w:1) - // Storage: EthereumThresholdSigner ThresholdSignatureRequestIdCounter (r:1 w:1) - // Storage: EthereumVault CurrentVaultEpochAndState (r:1 w:0) - // Storage: EthereumVault Vaults (r:1 w:0) - // Storage: Validator HistoricalAuthorities (r:1 w:0) - // Storage: Reputation Suspensions (r:3 w:0) - // Storage: EthereumVault CeremonyIdCounter (r:1 w:1) - // Storage: EthereumThresholdSigner ThresholdSignatureResponseTimeout (r:1 w:0) - // Storage: EthereumThresholdSigner CeremonyRetryQueues (r:1 w:1) - // Storage: EthereumThresholdSigner Signature (r:0 w:1) - // Storage: EthereumThresholdSigner PendingCeremonies (r:0 w:1) - // Storage: EthereumThresholdSigner RequestCallback (r:0 w:1) - // Storage: Flip PendingRedemptionsReserve (r:0 w:1) - // Storage: EthereumBroadcaster RotationBroadcast (r:0 w:1) + /// Storage: `Funding::BoundExecutorAddress` (r:1 w:0) + /// Proof: `Funding::BoundExecutorAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Environment::RuntimeSafeMode` (r:1 w:0) + /// Proof: `Environment::RuntimeSafeMode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::CurrentRotationPhase` (r:1 w:0) + /// Proof: `Validator::CurrentRotationPhase` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::CurrentEpochStartedAt` (r:1 w:0) + /// Proof: `Validator::CurrentEpochStartedAt` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::RedemptionPeriodAsPercentage` (r:1 w:0) + /// Proof: `Validator::RedemptionPeriodAsPercentage` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::BlocksPerEpoch` (r:1 w:0) + /// Proof: `Validator::BlocksPerEpoch` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Funding::PendingRedemptions` (r:1 w:1) + /// Proof: `Funding::PendingRedemptions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Funding::RestrictedBalances` (r:1 w:0) + /// Proof: `Funding::RestrictedBalances` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Funding::RedemptionTax` (r:1 w:0) + /// Proof: `Funding::RedemptionTax` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Funding::BoundRedeemAddress` (r:1 w:0) + /// Proof: `Funding::BoundRedeemAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Flip::Account` (r:1 w:1) + /// Proof: `Flip::Account` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `Flip::TotalIssuance` (r:1 w:1) + /// Proof: `Flip::TotalIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Validator::CurrentAuthorities` (r:1 w:0) + /// Proof: `Validator::CurrentAuthorities` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::Backups` (r:1 w:1) + /// Proof: `Validator::Backups` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Funding::RedemptionTTLSeconds` (r:1 w:0) + /// Proof: `Funding::RedemptionTTLSeconds` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Environment::EthereumStateChainGatewayAddress` (r:1 w:0) + /// Proof: `Environment::EthereumStateChainGatewayAddress` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Environment::EthereumSignatureNonce` (r:1 w:1) + /// Proof: `Environment::EthereumSignatureNonce` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Environment::EthereumChainId` (r:1 w:0) + /// Proof: `Environment::EthereumChainId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Environment::EthereumKeyManagerAddress` (r:1 w:0) + /// Proof: `Environment::EthereumKeyManagerAddress` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumBroadcaster::BroadcastIdCounter` (r:1 w:1) + /// Proof: `EthereumBroadcaster::BroadcastIdCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::ThresholdSignatureRequestIdCounter` (r:1 w:1) + /// Proof: `EthereumThresholdSigner::ThresholdSignatureRequestIdCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumVault::CurrentVaultEpochAndState` (r:1 w:0) + /// Proof: `EthereumVault::CurrentVaultEpochAndState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumVault::Vaults` (r:1 w:0) + /// Proof: `EthereumVault::Vaults` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Validator::HistoricalAuthorities` (r:1 w:0) + /// Proof: `Validator::HistoricalAuthorities` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Reputation::Suspensions` (r:3 w:0) + /// Proof: `Reputation::Suspensions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `EthereumVault::CeremonyIdCounter` (r:1 w:1) + /// Proof: `EthereumVault::CeremonyIdCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::ThresholdSignatureResponseTimeout` (r:1 w:0) + /// Proof: `EthereumThresholdSigner::ThresholdSignatureResponseTimeout` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::CeremonyRetryQueues` (r:1 w:1) + /// Proof: `EthereumThresholdSigner::CeremonyRetryQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::Signature` (r:0 w:1) + /// Proof: `EthereumThresholdSigner::Signature` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::PendingCeremonies` (r:0 w:1) + /// Proof: `EthereumThresholdSigner::PendingCeremonies` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `EthereumThresholdSigner::RequestCallback` (r:0 w:1) + /// Proof: `EthereumThresholdSigner::RequestCallback` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Flip::PendingRedemptionsReserve` (r:0 w:1) + /// Proof: `Flip::PendingRedemptionsReserve` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) fn redeem_all() -> Weight { - // Minimum execution time: 237_000 nanoseconds. - Weight::from_parts(248_000_000, 0) - .saturating_add(RocksDbWeight::get().reads(30)) - .saturating_add(RocksDbWeight::get().writes(14)) + // Proof Size summary in bytes: + // Measured: `1936` + // Estimated: `10351` + // Minimum execution time: 206_000_000 picoseconds. + Weight::from_parts(211_000_000, 10351) + .saturating_add(RocksDbWeight::get().reads(31_u64)) + .saturating_add(RocksDbWeight::get().writes(13_u64)) } - // Storage: Funding PendingRedemptions (r:1 w:1) - // Storage: Flip PendingRedemptionsReserve (r:1 w:1) - // Storage: Flip OffchainFunds (r:1 w:1) - // Storage: Flip Account (r:1 w:1) - // Storage: Flip TotalIssuance (r:1 w:1) - // Storage: Validator AccountPeerMapping (r:1 w:0) - // Storage: Validator VanityNames (r:1 w:1) - // Storage: Reputation LastHeartbeat (r:0 w:1) - // Storage: Reputation Reputations (r:0 w:1) - // Storage: Reputation OffenceTimeSlotTracker (r:0 w:1) - // Storage: AccountRoles AccountRoles (r:0 w:1) - // Storage: Funding ActiveBidder (r:0 w:1) + /// Storage: `Funding::PendingRedemptions` (r:1 w:1) + /// Proof: `Funding::PendingRedemptions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Flip::PendingRedemptionsReserve` (r:1 w:1) + /// Proof: `Flip::PendingRedemptionsReserve` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) + /// Storage: `Flip::OffchainFunds` (r:1 w:1) + /// Proof: `Flip::OffchainFunds` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Flip::Account` (r:1 w:0) + /// Proof: `Flip::Account` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) fn redeemed() -> Weight { - // Minimum execution time: 125_000 nanoseconds. - Weight::from_parts(129_000_000, 0) - .saturating_add(RocksDbWeight::get().reads(7)) - .saturating_add(RocksDbWeight::get().writes(11)) + // Proof Size summary in bytes: + // Measured: `771` + // Estimated: `4236` + // Minimum execution time: 38_000_000 picoseconds. + Weight::from_parts(40_000_000, 4236) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } - // Storage: Funding PendingRedemptions (r:1 w:1) - // Storage: Flip PendingRedemptionsReserve (r:1 w:1) - // Storage: Flip Account (r:1 w:1) - // Storage: Flip TotalIssuance (r:1 w:1) - // Storage: Validator CurrentAuthorities (r:1 w:0) - // Storage: Validator Backups (r:1 w:1) + /// Storage: `Funding::PendingRedemptions` (r:1 w:1) + /// Proof: `Funding::PendingRedemptions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Flip::PendingRedemptionsReserve` (r:1 w:1) + /// Proof: `Flip::PendingRedemptionsReserve` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) + /// Storage: `Flip::Account` (r:1 w:1) + /// Proof: `Flip::Account` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `Flip::TotalIssuance` (r:1 w:1) + /// Proof: `Flip::TotalIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Validator::CurrentAuthorities` (r:1 w:0) + /// Proof: `Validator::CurrentAuthorities` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::Backups` (r:1 w:1) + /// Proof: `Validator::Backups` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn redemption_expired() -> Weight { - // Minimum execution time: 74_000 nanoseconds. - Weight::from_parts(78_000_000, 0) - .saturating_add(RocksDbWeight::get().reads(6)) - .saturating_add(RocksDbWeight::get().writes(5)) + // Proof Size summary in bytes: + // Measured: `1129` + // Estimated: `4594` + // Minimum execution time: 58_000_000 picoseconds. + Weight::from_parts(59_000_000, 4594) + .saturating_add(RocksDbWeight::get().reads(6_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64)) } - // Storage: AccountRoles AccountRoles (r:1 w:0) - // Storage: Validator CurrentRotationPhase (r:1 w:0) - // Storage: Validator CurrentEpochStartedAt (r:1 w:0) - // Storage: Validator BlocksPerEpoch (r:1 w:0) - // Storage: Validator RedemptionPeriodAsPercentage (r:1 w:0) - // Storage: Funding ActiveBidder (r:1 w:1) + /// Storage: `Environment::RuntimeSafeMode` (r:1 w:0) + /// Proof: `Environment::RuntimeSafeMode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AccountRoles::AccountRoles` (r:1 w:0) + /// Proof: `AccountRoles::AccountRoles` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) + /// Storage: `Validator::CurrentRotationPhase` (r:1 w:0) + /// Proof: `Validator::CurrentRotationPhase` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::CurrentEpochStartedAt` (r:1 w:0) + /// Proof: `Validator::CurrentEpochStartedAt` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::RedemptionPeriodAsPercentage` (r:1 w:0) + /// Proof: `Validator::RedemptionPeriodAsPercentage` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Validator::BlocksPerEpoch` (r:1 w:0) + /// Proof: `Validator::BlocksPerEpoch` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Funding::ActiveBidder` (r:1 w:1) + /// Proof: `Funding::ActiveBidder` (`max_values`: None, `max_size`: None, mode: `Measured`) fn stop_bidding() -> Weight { - // Minimum execution time: 62_000 nanoseconds. - Weight::from_parts(67_000_000, 0) - .saturating_add(RocksDbWeight::get().reads(6)) - .saturating_add(RocksDbWeight::get().writes(1)) + // Proof Size summary in bytes: + // Measured: `1254` + // Estimated: `4719` + // Minimum execution time: 51_000_000 picoseconds. + Weight::from_parts(52_000_000, 4719) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } - // Storage: AccountRoles AccountRoles (r:1 w:0) - // Storage: Funding ActiveBidder (r:1 w:1) + /// Storage: `Environment::RuntimeSafeMode` (r:1 w:0) + /// Proof: `Environment::RuntimeSafeMode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AccountRoles::AccountRoles` (r:1 w:0) + /// Proof: `AccountRoles::AccountRoles` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) + /// Storage: `Funding::ActiveBidder` (r:1 w:1) + /// Proof: `Funding::ActiveBidder` (`max_values`: None, `max_size`: None, mode: `Measured`) fn start_bidding() -> Weight { - // Minimum execution time: 44_000 nanoseconds. - Weight::from_parts(47_000_000, 0) - .saturating_add(RocksDbWeight::get().reads(2)) - .saturating_add(RocksDbWeight::get().writes(1)) + // Proof Size summary in bytes: + // Measured: `891` + // Estimated: `4356` + // Minimum execution time: 34_000_000 picoseconds. + Weight::from_parts(36_000_000, 4356) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } - // Storage: Funding RedemptionTax (r:1 w:0) - // Storage: Funding MinimumFunding (r:0 w:1) + /// Storage: `Funding::RedemptionTax` (r:1 w:0) + /// Proof: `Funding::RedemptionTax` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Funding::MinimumFunding` (r:0 w:1) + /// Proof: `Funding::MinimumFunding` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn update_minimum_funding() -> Weight { - // Minimum execution time: 32_000 nanoseconds. - Weight::from_parts(33_000_000, 0) - .saturating_add(RocksDbWeight::get().reads(1)) - .saturating_add(RocksDbWeight::get().writes(1)) + // Proof Size summary in bytes: + // Measured: `139` + // Estimated: `1624` + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 1624) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } - // Storage: Funding MinimumFunding (r:1 w:0) - // Storage: Funding RedemptionTax (r:0 w:1) + /// Storage: `Funding::MinimumFunding` (r:1 w:0) + /// Proof: `Funding::MinimumFunding` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Funding::RedemptionTax` (r:0 w:1) + /// Proof: `Funding::RedemptionTax` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn update_redemption_tax() -> Weight { - // Minimum execution time: 33_000 nanoseconds. - Weight::from_parts(33_000_000, 0) - .saturating_add(RocksDbWeight::get().reads(1)) - .saturating_add(RocksDbWeight::get().writes(1)) + // Proof Size summary in bytes: + // Measured: `139` + // Estimated: `1624` + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(18_000_000, 1624) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } - // Storage: Funding BoundAddress (r:1 w:1) + /// Storage: `Funding::BoundRedeemAddress` (r:1 w:1) + /// Proof: `Funding::BoundRedeemAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) fn bind_redeem_address() -> Weight { - // Minimum execution time: 17_000 nanoseconds. - Weight::from_parts(18_000_000, 0) - .saturating_add(RocksDbWeight::get().reads(1)) - .saturating_add(RocksDbWeight::get().writes(1)) + // Proof Size summary in bytes: + // Measured: `136` + // Estimated: `3601` + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(20_000_000, 3601) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } - // Storage: Funding RestrictedAddresses (r:0 w:1) + /// Storage: `Funding::RestrictedBalances` (r:101 w:100) + /// Proof: `Funding::RestrictedBalances` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Funding::RestrictedAddresses` (r:0 w:1) + /// Proof: `Funding::RestrictedAddresses` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `a` is `[1, 100]`. /// The range of component `b` is `[1, 100]`. - fn update_restricted_addresses(a: u32, b: u32, ) -> Weight { - // Minimum execution time: 894_000 nanoseconds. - Weight::from_parts(995_413, 0) - // Standard Error: 47_147 - .saturating_add(Weight::from_parts(9_110_754, 0).saturating_mul(a.into())) - // Standard Error: 47_147 - .saturating_add(Weight::from_parts(9_085_808, 0).saturating_mul(b.into())) - .saturating_add(RocksDbWeight::get().writes(1)) + /// The range of component `c` is `[1, 100]`. + fn update_restricted_addresses(_a: u32, b: u32, c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `166 + c * (92 ±0)` + // Estimated: `3629 + b * (9 ±1) + c * (2567 ±1)` + // Minimum execution time: 908_000_000 picoseconds. + Weight::from_parts(920_000_000, 3629) + // Standard Error: 6_632_935 + .saturating_add(Weight::from_parts(339_664_961, 0).saturating_mul(b.into())) + // Standard Error: 6_632_935 + .saturating_add(Weight::from_parts(323_344_893, 0).saturating_mul(c.into())) + .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(c.into()))) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(c.into()))) + .saturating_add(Weight::from_parts(0, 9).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 2567).saturating_mul(c.into())) + } + /// Storage: `Funding::BoundExecutorAddress` (r:1 w:1) + /// Proof: `Funding::BoundExecutorAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn bind_executor_address() -> Weight { + // Proof Size summary in bytes: + // Measured: `136` + // Estimated: `3601` + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(21_000_000, 3601) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } } diff --git a/state-chain/runtime/src/lib.rs b/state-chain/runtime/src/lib.rs index 848ac72be6f..218fafd5465 100644 --- a/state-chain/runtime/src/lib.rs +++ b/state-chain/runtime/src/lib.rs @@ -932,7 +932,7 @@ impl_runtime_apis! { let is_current_authority = pallet_cf_validator::CurrentAuthorities::::get().contains(&account_id); let is_bidding = pallet_cf_funding::ActiveBidder::::get(&account_id); let account_info_v1 = Self::cf_account_info(account_id.clone()); - let bound_redeem_address = pallet_cf_funding::BoundAddress::::get(&account_id); + let bound_redeem_address = pallet_cf_funding::BoundRedeemAddress::::get(&account_id); RuntimeApiAccountInfoV2 { balance: account_info_v1.balance, bond: account_info_v1.bond,