From d3e81b2dc84050749de867aa76af347e513b80a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Mon, 4 Jan 2021 13:35:57 +0100 Subject: [PATCH] contracts: Lazy storage removal (#7740) * Do not evict a contract from within a call stack We don't want to trigger contract eviction automatically when a contract is called. This is because those changes can be reverted due to how storage transactions are used at the moment. More Information: https://github.com/paritytech/substrate/issues/6439#issuecomment-648754324 It can be re-introduced once the linked issue is resolved. In the meantime `claim_surcharge` must be called to evict a contract. * Lazily delete storage in on_initialize instead of when removing the contract * Add missing documentation of new error * Make Module::claim_surcharge public It being the only dispatchable that is private is an oversight. * review: Add final newline * review: Simplify assert statement * Add test that checks that partial remove of a contract works * Premote warning to error * Added missing docs for seal_terminate * Lazy deletion should only take AVERAGE_ON_INITIALIZE_RATIO of the block * Added informational about the lazy deletion throughput * Avoid lazy deletion in case the block is already full * Prevent queue decoding in case of an already full block * Add test that checks that on_initialize honors block limits --- bin/node/runtime/src/lib.rs | 12 + frame/contracts/src/benchmarking/mod.rs | 92 +- frame/contracts/src/exec.rs | 29 +- frame/contracts/src/lib.rs | 56 +- frame/contracts/src/rent.rs | 99 +-- frame/contracts/src/storage.rs | 131 ++- frame/contracts/src/tests.rs | 414 ++++++++- frame/contracts/src/wasm/runtime.rs | 2 + frame/contracts/src/weights.rs | 1038 ++++++++++++++--------- 9 files changed, 1348 insertions(+), 525 deletions(-) diff --git a/bin/node/runtime/src/lib.rs b/bin/node/runtime/src/lib.rs index 45f47f904e75b..a36448c470811 100644 --- a/bin/node/runtime/src/lib.rs +++ b/bin/node/runtime/src/lib.rs @@ -71,6 +71,7 @@ pub use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment, Currency use pallet_session::{historical as pallet_session_historical}; use sp_inherents::{InherentData, CheckInherentsResult}; use static_assertions::const_assert; +use pallet_contracts::WeightInfo; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -716,6 +717,15 @@ parameter_types! { pub const MaxDepth: u32 = 32; pub const StorageSizeOffset: u32 = 8; pub const MaxValueSize: u32 = 16 * 1024; + // The lazy deletion runs inside on_initialize. + pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO * + RuntimeBlockWeights::get().max_block; + // The weight needed for decoding the queue should be less or equal than a fifth + // of the overall weight dedicated to the lazy deletion. + pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / ( + ::WeightInfo::on_initialize_per_queue_item(1) - + ::WeightInfo::on_initialize_per_queue_item(0) + )) / 5) as u32; } impl pallet_contracts::Config for Runtime { @@ -735,6 +745,8 @@ impl pallet_contracts::Config for Runtime { type WeightPrice = pallet_transaction_payment::Module; type WeightInfo = pallet_contracts::weights::SubstrateWeight; type ChainExtension = (); + type DeletionQueueDepth = DeletionQueueDepth; + type DeletionWeightLimit = DeletionWeightLimit; } impl pallet_sudo::Config for Runtime { diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index d6092f40a67bb..d08f0ab5e65ec 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -39,7 +39,7 @@ use self::{ use frame_benchmarking::{benchmarks, account, whitelisted_caller}; use frame_system::{Module as System, RawOrigin}; use parity_wasm::elements::{Instruction, ValueType, BlockType}; -use sp_runtime::traits::{Hash, Bounded}; +use sp_runtime::traits::{Hash, Bounded, Zero}; use sp_std::{default::Default, convert::{TryInto}, vec::Vec, vec}; use pallet_contracts_primitives::RentProjection; @@ -209,37 +209,52 @@ where } } -/// A `Contract` that was evicted after accumulating some storage. +/// A `Contract` that contains some storage items. /// -/// This is used to benchmark contract resurrection. -struct Tombstone { +/// This is used to benchmark contract destruction and resurection. Those operations' +/// weight depend on the amount of storage accumulated. +struct ContractWithStorage { /// The contract that was evicted. contract: Contract, /// The storage the contract held when it was avicted. storage: Vec<(StorageKey, Vec)>, } -impl Tombstone +impl ContractWithStorage where T: Config, T::AccountId: UncheckedFrom + AsRef<[u8]>, { - /// Create and evict a new contract with the supplied storage item count and size each. + /// Same as [`Self::with_code`] but with dummy contract code. fn new(stor_num: u32, stor_size: u32) -> Result { - let contract = Contract::::new(WasmModule::dummy(), vec![], Endow::CollectRent)?; + Self::with_code(WasmModule::dummy(), stor_num, stor_size) + } + + /// Create and evict a new contract with the supplied storage item count and size each. + fn with_code(code: WasmModule, stor_num: u32, stor_size: u32) -> Result { + let contract = Contract::::new(code, vec![], Endow::CollectRent)?; let storage_items = create_storage::(stor_num, stor_size)?; contract.store(&storage_items)?; - System::::set_block_number( - contract.eviction_at()? + T::SignedClaimHandicap::get() + 5u32.into() - ); - Rent::::collect(&contract.account_id); - contract.ensure_tombstone()?; - - Ok(Tombstone { + Ok(Self { contract, storage: storage_items, }) } + + /// Increase the system block number so that this contract is eligible for eviction. + fn set_block_num_for_eviction(&self) -> Result<(), &'static str> { + System::::set_block_number( + self.contract.eviction_at()? + T::SignedClaimHandicap::get() + 5u32.into() + ); + Ok(()) + } + + /// Evict this contract. + fn evict(&mut self) -> Result<(), &'static str> { + self.set_block_num_for_eviction()?; + Rent::::snitch_contract_should_be_evicted(&self.contract.account_id, Zero::zero())?; + self.contract.ensure_tombstone() + } } /// Generate `stor_num` storage items. Each has the size `stor_size`. @@ -270,6 +285,30 @@ benchmarks! { _ { } + // The base weight without any actual work performed apart from the setup costs. + on_initialize {}: { + Storage::::process_deletion_queue_batch(Weight::max_value()) + } + + on_initialize_per_trie_key { + let k in 0..1024; + let instance = ContractWithStorage::::new(k, T::MaxValueSize::get())?; + Storage::::queue_trie_for_deletion(&instance.contract.alive_info()?)?; + }: { + Storage::::process_deletion_queue_batch(Weight::max_value()) + } + + on_initialize_per_queue_item { + let q in 0..1024.min(T::DeletionQueueDepth::get()); + for i in 0 .. q { + let instance = Contract::::with_index(i, WasmModule::dummy(), vec![], Endow::Max)?; + Storage::::queue_trie_for_deletion(&instance.alive_info()?)?; + ContractInfoOf::::remove(instance.account_id); + } + }: { + Storage::::process_deletion_queue_batch(Weight::max_value()) + } + // This extrinsic is pretty much constant as it is only a simple setter. update_schedule { let schedule = Schedule { @@ -650,7 +689,8 @@ benchmarks! { // Restore just moves the trie id from origin to destination and therefore // does not depend on the size of the destination contract. However, to not // trigger any edge case we won't use an empty contract as destination. - let tombstone = Tombstone::::new(10, T::MaxValueSize::get())?; + let mut tombstone = ContractWithStorage::::new(10, T::MaxValueSize::get())?; + tombstone.evict()?; let dest = tombstone.contract.account_id.encode(); let dest_len = dest.len(); @@ -723,7 +763,8 @@ benchmarks! { seal_restore_to_per_delta { let d in 0 .. API_BENCHMARK_BATCHES; - let tombstone = Tombstone::::new(0, 0)?; + let mut tombstone = ContractWithStorage::::new(0, 0)?; + tombstone.evict()?; let delta = create_storage::(d * API_BENCHMARK_BATCH_SIZE, T::MaxValueSize::get())?; let dest = tombstone.contract.account_id.encode(); @@ -2368,7 +2409,20 @@ benchmarks! { #[extra] print_schedule { #[cfg(feature = "std")] - println!("{:#?}", Schedule::::default()); + { + let weight_per_key = T::WeightInfo::on_initialize_per_trie_key(1) - + T::WeightInfo::on_initialize_per_trie_key(0); + let weight_per_queue_item = T::WeightInfo::on_initialize_per_queue_item(1) - + T::WeightInfo::on_initialize_per_queue_item(0); + let weight_limit = T::DeletionWeightLimit::get(); + let queue_depth: u64 = T::DeletionQueueDepth::get().into(); + println!("{:#?}", Schedule::::default()); + println!("###############################################"); + println!("Lazy deletion throughput per block (empty queue, full queue): {}, {}", + weight_limit / weight_per_key, + (weight_limit - weight_per_queue_item * queue_depth) / weight_per_key, + ); + } #[cfg(not(feature = "std"))] return Err("Run this bench with a native runtime in order to see the schedule."); }: {} @@ -2394,6 +2448,10 @@ mod tests { } } + create_test!(on_initialize); + create_test!(on_initialize_per_trie_key); + create_test!(on_initialize_per_queue_item); + create_test!(update_schedule); create_test!(put_code); create_test!(instantiate); diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index b5f4034b5bff1..47ff216cd23e7 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -268,12 +268,12 @@ where Err(Error::::MaxCallDepthReached)? } - // Assumption: `collect` doesn't collide with overlay because - // `collect` will be done on first call and destination contract and balance - // cannot be changed before the first call - // We do not allow 'calling' plain accounts. For transfering value - // `seal_transfer` must be used. - let contract = if let Some(ContractInfo::Alive(info)) = Rent::::collect(&dest) { + // This charges the rent and denies access to a contract that is in need of + // eviction by returning `None`. We cannot evict eagerly here because those + // changes would be rolled back in case this contract is called by another + // contract. + // See: https://github.com/paritytech/substrate/issues/6439#issuecomment-648754324 + let contract = if let Ok(Some(ContractInfo::Alive(info))) = Rent::::charge(&dest) { info } else { Err(Error::::NotCallable)? @@ -575,13 +575,16 @@ where value, self.ctx, )?; - let self_trie_id = self.ctx.self_trie_id.as_ref().expect( - "this function is only invoked by in the context of a contract;\ - a contract has a trie id;\ - this can't be None; qed", - ); - Storage::::destroy_contract(&self_id, self_trie_id); - Ok(()) + if let Some(ContractInfo::Alive(info)) = ContractInfoOf::::take(&self_id) { + Storage::::queue_trie_for_deletion(&info)?; + Ok(()) + } else { + panic!( + "this function is only invoked by in the context of a contract;\ + this contract is therefore alive;\ + qed" + ); + } } fn call( diff --git a/frame/contracts/src/lib.rs b/frame/contracts/src/lib.rs index ad694b0c877b2..7b919fe2172e7 100644 --- a/frame/contracts/src/lib.rs +++ b/frame/contracts/src/lib.rs @@ -123,7 +123,7 @@ use frame_support::{ dispatch::{DispatchResult, DispatchResultWithPostInfo}, traits::{OnUnbalanced, Currency, Get, Time, Randomness}, }; -use frame_system::{ensure_signed, ensure_root}; +use frame_system::{ensure_signed, ensure_root, Module as System}; use pallet_contracts_primitives::{ RentProjectionResult, GetStorageResult, ContractAccessError, ContractExecResult, ExecResult, }; @@ -325,6 +325,12 @@ pub trait Config: frame_system::Config { /// Type that allows the runtime authors to add new host functions for a contract to call. type ChainExtension: chain_extension::ChainExtension; + + /// The maximum number of tries that can be queued for deletion. + type DeletionQueueDepth: Get; + + /// The maximum amount of weight that can be consumed per block for lazy trie removal. + type DeletionWeightLimit: Get; } decl_error! { @@ -396,6 +402,17 @@ decl_error! { /// in this error. Note that this usually shouldn't happen as deploying such contracts /// is rejected. NoChainExtension, + /// Removal of a contract failed because the deletion queue is full. + /// + /// This can happen when either calling [`Module::claim_surcharge`] or `seal_terminate`. + /// The queue is filled by deleting contracts and emptied by a fixed amount each block. + /// Trying again during another block is the only way to resolve this issue. + DeletionQueueFull, + /// A contract could not be evicted because it has enough balance to pay rent. + /// + /// This can be returned from [`Module::claim_surcharge`] because the target + /// contract has enough balance to pay for its rent. + ContractNotEvictable, } } @@ -449,8 +466,24 @@ decl_module! { /// The maximum size of a storage value in bytes. A reasonable default is 16 KiB. const MaxValueSize: u32 = T::MaxValueSize::get(); + /// The maximum number of tries that can be queued for deletion. + const DeletionQueueDepth: u32 = T::DeletionQueueDepth::get(); + + /// The maximum amount of weight that can be consumed per block for lazy trie removal. + const DeletionWeightLimit: Weight = T::DeletionWeightLimit::get(); + fn deposit_event() = default; + fn on_initialize() -> Weight { + // We do not want to go above the block limit and rather avoid lazy deletion + // in that case. This should only happen on runtime upgrades. + let weight_limit = T::BlockWeights::get().max_block + .saturating_sub(System::::block_weight().total()) + .min(T::DeletionWeightLimit::get()); + Storage::::process_deletion_queue_batch(weight_limit) + .saturating_add(T::WeightInfo::on_initialize()) + } + /// Updates the schedule for metering contracts. /// /// The schedule must have a greater version than the stored schedule. @@ -549,10 +582,14 @@ decl_module! { /// Allows block producers to claim a small reward for evicting a contract. If a block producer /// fails to do so, a regular users will be allowed to claim the reward. /// - /// If contract is not evicted as a result of this call, no actions are taken and - /// the sender is not eligible for the reward. + /// If contract is not evicted as a result of this call, [`Error::ContractNotEvictable`] + /// is returned and the sender is not eligible for the reward. #[weight = T::WeightInfo::claim_surcharge()] - fn claim_surcharge(origin, dest: T::AccountId, aux_sender: Option) { + pub fn claim_surcharge( + origin, + dest: T::AccountId, + aux_sender: Option + ) -> DispatchResult { let origin = origin.into(); let (signed, rewarded) = match (origin, aux_sender) { (Ok(frame_system::RawOrigin::Signed(account)), None) => { @@ -574,8 +611,10 @@ decl_module! { }; // If poking the contract has lead to eviction of the contract, give out the rewards. - if Rent::::snitch_contract_should_be_evicted(&dest, handicap) { - T::Currency::deposit_into_existing(&rewarded, T::SurchargeReward::get())?; + if Rent::::snitch_contract_should_be_evicted(&dest, handicap)? { + T::Currency::deposit_into_existing(&rewarded, T::SurchargeReward::get()).map(|_| ()) + } else { + Err(Error::::ContractNotEvictable.into()) } } } @@ -733,6 +772,11 @@ decl_storage! { /// /// TWOX-NOTE: SAFE since `AccountId` is a secure hash. pub ContractInfoOf: map hasher(twox_64_concat) T::AccountId => Option>; + /// Evicted contracts that await child trie deletion. + /// + /// Child trie deletion is a heavy operation depending on the amount of storage items + /// stored in said trie. Therefore this operation is performed lazily in `on_initialize`. + pub DeletionQueue: Vec; } } diff --git a/frame/contracts/src/rent.rs b/frame/contracts/src/rent.rs index d31efd5f55261..f30b25b447a25 100644 --- a/frame/contracts/src/rent.rs +++ b/frame/contracts/src/rent.rs @@ -20,13 +20,16 @@ use crate::{ AliveContractInfo, BalanceOf, ContractInfo, ContractInfoOf, Module, RawEvent, TombstoneContractInfo, Config, CodeHash, ConfigCache, Error, + storage::Storage, }; use sp_std::prelude::*; use sp_io::hashing::blake2_256; use sp_core::crypto::UncheckedFrom; -use frame_support::storage::child; -use frame_support::traits::{Currency, ExistenceRequirement, Get, OnUnbalanced, WithdrawReasons}; -use frame_support::StorageMap; +use frame_support::{ + debug, StorageMap, + storage::child, + traits::{Currency, ExistenceRequirement, Get, OnUnbalanced, WithdrawReasons}, +}; use pallet_contracts_primitives::{ContractAccessError, RentProjection, RentProjectionResult}; use sp_runtime::{ DispatchError, @@ -74,10 +77,6 @@ enum Verdict { /// For example, it already paid its rent in the current block, or it has enough deposit for not /// paying rent at all. Exempt, - /// Funds dropped below the subsistence deposit. - /// - /// Remove the contract along with it's storage. - Kill, /// The contract cannot afford payment within its rent budget so it gets evicted. However, /// because its balance is greater than the subsistence threshold it leaves a tombstone. Evict { @@ -181,11 +180,17 @@ where let rent_budget = match Self::rent_budget(&total_balance, &free_balance, contract) { Some(rent_budget) => rent_budget, None => { - // The contract's total balance is already below subsistence threshold. That - // indicates that the contract cannot afford to leave a tombstone. - // - // So cleanly wipe the contract. - return Verdict::Kill; + // All functions that allow a contract to transfer balance enforce + // that the contract always stays above the subsistence threshold. + // We want the rent system to always leave a tombstone to prevent the + // accidental loss of a contract. Ony `seal_terminate` can remove a + // contract without a tombstone. Therefore this case should be never + // hit. + debug::error!( + "Tombstoned a contract that is below the subsistence threshold: {:?}", + account + ); + 0u32.into() } }; @@ -234,19 +239,19 @@ where alive_contract_info: AliveContractInfo, current_block_number: T::BlockNumber, verdict: Verdict, - ) -> Option> { + allow_eviction: bool, + ) -> Result>, DispatchError> { match verdict { - Verdict::Exempt => return Some(ContractInfo::Alive(alive_contract_info)), - Verdict::Kill => { - >::remove(account); - child::kill_storage( - &alive_contract_info.child_trie_info(), - None, - ); - >::deposit_event(RawEvent::Evicted(account.clone(), false)); - None + Verdict::Exempt => return Ok(Some(ContractInfo::Alive(alive_contract_info))), + Verdict::Evict { amount: _ } if !allow_eviction => { + Ok(None) } Verdict::Evict { amount } => { + // We need to remove the trie first because it is the only operation + // that can fail and this function is called without a storage + // transaction when called through `claim_surcharge`. + Storage::::queue_trie_for_deletion(&alive_contract_info)?; + if let Some(amount) = amount { amount.withdraw(account); } @@ -262,14 +267,8 @@ where ); let tombstone_info = ContractInfo::Tombstone(tombstone); >::insert(account, &tombstone_info); - - child::kill_storage( - &alive_contract_info.child_trie_info(), - None, - ); - >::deposit_event(RawEvent::Evicted(account.clone(), true)); - Some(tombstone_info) + Ok(Some(tombstone_info)) } Verdict::Charge { amount } => { let contract_info = ContractInfo::Alive(AliveContractInfo:: { @@ -278,21 +277,21 @@ where ..alive_contract_info }); >::insert(account, &contract_info); - amount.withdraw(account); - Some(contract_info) + Ok(Some(contract_info)) } } } /// Make account paying the rent for the current block number /// - /// NOTE this function performs eviction eagerly. All changes are read and written directly to - /// storage. - pub fn collect(account: &T::AccountId) -> Option> { + /// This functions does **not** evict the contract. It returns `None` in case the + /// contract is in need of eviction. [`snitch_contract_should_be_evicted`] must + /// be called to perform the eviction. + pub fn charge(account: &T::AccountId) -> Result>, DispatchError> { let contract_info = >::get(account); let alive_contract_info = match contract_info { - None | Some(ContractInfo::Tombstone(_)) => return contract_info, + None | Some(ContractInfo::Tombstone(_)) => return Ok(contract_info), Some(ContractInfo::Alive(contract)) => contract, }; @@ -303,7 +302,7 @@ where Zero::zero(), &alive_contract_info, ); - Self::enact_verdict(account, alive_contract_info, current_block_number, verdict) + Self::enact_verdict(account, alive_contract_info, current_block_number, verdict, false) } /// Process a report that a contract under the given address should be evicted. @@ -321,10 +320,10 @@ where pub fn snitch_contract_should_be_evicted( account: &T::AccountId, handicap: T::BlockNumber, - ) -> bool { - let contract_info = >::get(account); - let alive_contract_info = match contract_info { - None | Some(ContractInfo::Tombstone(_)) => return false, + ) -> Result { + let contract = >::get(account); + let contract = match contract { + None | Some(ContractInfo::Tombstone(_)) => return Ok(false), Some(ContractInfo::Alive(contract)) => contract, }; let current_block_number = >::block_number(); @@ -332,16 +331,16 @@ where account, current_block_number, handicap, - &alive_contract_info, + &contract, ); // Enact the verdict only if the contract gets removed. match verdict { - Verdict::Kill | Verdict::Evict { .. } => { - Self::enact_verdict(account, alive_contract_info, current_block_number, verdict); - true + Verdict::Evict { .. } => { + Self::enact_verdict(account, contract, current_block_number, verdict, true)?; + Ok(true) } - _ => false, + _ => Ok(false), } } @@ -359,9 +358,11 @@ where pub fn compute_projection( account: &T::AccountId, ) -> RentProjectionResult { + use ContractAccessError::IsTombstone; + let contract_info = >::get(account); let alive_contract_info = match contract_info { - None | Some(ContractInfo::Tombstone(_)) => return Err(ContractAccessError::IsTombstone), + None | Some(ContractInfo::Tombstone(_)) => return Err(IsTombstone), Some(ContractInfo::Alive(contract)) => contract, }; let current_block_number = >::block_number(); @@ -372,11 +373,11 @@ where &alive_contract_info, ); let new_contract_info = - Self::enact_verdict(account, alive_contract_info, current_block_number, verdict); + Self::enact_verdict(account, alive_contract_info, current_block_number, verdict, false); // Check what happened after enaction of the verdict. - let alive_contract_info = match new_contract_info { - None | Some(ContractInfo::Tombstone(_)) => return Err(ContractAccessError::IsTombstone), + let alive_contract_info = match new_contract_info.map_err(|_| IsTombstone)? { + None | Some(ContractInfo::Tombstone(_)) => return Err(IsTombstone), Some(ContractInfo::Alive(contract)) => contract, }; diff --git a/frame/contracts/src/storage.rs b/frame/contracts/src/storage.rs index 180ec7237ff0d..520a114986f46 100644 --- a/frame/contracts/src/storage.rs +++ b/frame/contracts/src/storage.rs @@ -20,20 +20,37 @@ use crate::{ exec::{AccountIdOf, StorageKey}, AliveContractInfo, BalanceOf, CodeHash, ContractInfo, ContractInfoOf, Config, TrieId, - AccountCounter, + AccountCounter, DeletionQueue, Error, + weights::WeightInfo, }; +use codec::{Encode, Decode}; use sp_std::prelude::*; use sp_std::marker::PhantomData; use sp_io::hashing::blake2_256; use sp_runtime::traits::Bounded; use sp_core::crypto::UncheckedFrom; -use frame_support::{storage::child, StorageMap}; +use frame_support::{ + dispatch::DispatchResult, + StorageMap, + debug, + storage::{child::{self, KillOutcome}, StorageValue}, + traits::Get, + weights::Weight, +}; /// An error that means that the account requested either doesn't exist or represents a tombstone /// account. #[cfg_attr(test, derive(PartialEq, Eq, Debug))] pub struct ContractAbsentError; +#[derive(Encode, Decode)] +pub struct DeletedContract { + pair_count: u32, + trie_id: TrieId, +} + + + pub struct Storage(PhantomData); impl Storage @@ -191,18 +208,105 @@ where }) } - /// Removes the contract and all the storage associated with it. + /// Push a contract's trie to the deletion queue for lazy removal. /// - /// This function doesn't affect the account. - pub fn destroy_contract(address: &AccountIdOf, trie_id: &TrieId) { - >::remove(address); - child::kill_storage(&crate::child_trie_info(&trie_id), None); + /// You must make sure that the contract is also removed or converted into a tombstone + /// when queuing the trie for deletion. + pub fn queue_trie_for_deletion(contract: &AliveContractInfo) -> DispatchResult { + if DeletionQueue::decode_len().unwrap_or(0) >= T::DeletionQueueDepth::get() as usize { + Err(Error::::DeletionQueueFull.into()) + } else { + DeletionQueue::append(DeletedContract { + pair_count: contract.total_pair_count, + trie_id: contract.trie_id.clone(), + }); + Ok(()) + } + } + + /// Calculates the weight that is necessary to remove one key from the trie and how many + /// of those keys can be deleted from the deletion queue given the supplied queue length + /// and weight limit. + pub fn deletion_budget(queue_len: usize, weight_limit: Weight) -> (u64, u32) { + let base_weight = T::WeightInfo::on_initialize(); + let weight_per_queue_item = T::WeightInfo::on_initialize_per_queue_item(1) - + T::WeightInfo::on_initialize_per_queue_item(0); + let weight_per_key = T::WeightInfo::on_initialize_per_trie_key(1) - + T::WeightInfo::on_initialize_per_trie_key(0); + let decoding_weight = weight_per_queue_item.saturating_mul(queue_len as Weight); + + // `weight_per_key` being zero makes no sense and would constitute a failure to + // benchmark properly. We opt for not removing any keys at all in this case. + let key_budget = weight_limit + .saturating_sub(base_weight) + .saturating_sub(decoding_weight) + .checked_div(weight_per_key) + .unwrap_or(0) as u32; + + (weight_per_key, key_budget) + } + + /// Delete as many items from the deletion queue possible within the supplied weight limit. + /// + /// It returns the amount of weight used for that task or `None` when no weight was used + /// apart from the base weight. + pub fn process_deletion_queue_batch(weight_limit: Weight) -> Weight { + let queue_len = DeletionQueue::decode_len().unwrap_or(0); + if queue_len == 0 { + return weight_limit; + } + + let (weight_per_key, mut remaining_key_budget) = Self::deletion_budget( + queue_len, + weight_limit, + ); + + // We want to check whether we have enough weight to decode the queue before + // proceeding. Too little weight for decoding might happen during runtime upgrades + // which consume the whole block before the other `on_initialize` blocks are called. + if remaining_key_budget == 0 { + return weight_limit; + } + + let mut queue = DeletionQueue::get(); + + while !queue.is_empty() && remaining_key_budget > 0 { + // Cannot panic due to loop condition + let trie = &mut queue[0]; + let pair_count = trie.pair_count; + let outcome = child::kill_storage( + &crate::child_trie_info(&trie.trie_id), + Some(remaining_key_budget), + ); + if pair_count > remaining_key_budget { + // Cannot underflow because of the if condition + trie.pair_count -= remaining_key_budget; + } else { + // We do not care to preserve order. The contract is deleted already and + // noone waits for the trie to be deleted. + let removed = queue.swap_remove(0); + match outcome { + // This should not happen as our budget was large enough to remove all keys. + KillOutcome::SomeRemaining => { + debug::error!( + "After deletion keys are remaining in this child trie: {:?}", + removed.trie_id, + ); + }, + KillOutcome::AllRemoved => (), + } + } + remaining_key_budget = remaining_key_budget + .saturating_sub(remaining_key_budget.min(pair_count)); + } + + DeletionQueue::put(queue); + weight_limit.saturating_sub(weight_per_key.saturating_mul(remaining_key_budget as Weight)) } /// This generator uses inner counter for account id and applies the hash over `AccountId + /// accountid_counter`. pub fn generate_trie_id(account_id: &AccountIdOf) -> TrieId { - use frame_support::StorageValue; use sp_runtime::traits::Hash; // Note that skipping a value due to error is not an issue here. // We only need uniqueness, not sequence. @@ -226,4 +330,15 @@ where .and_then(|i| i.as_alive().map(|i| i.code_hash)) .ok_or(ContractAbsentError) } + + /// Fill up the queue in order to exercise the limits during testing. + #[cfg(test)] + pub fn fill_queue_with_dummies() { + let queue: Vec<_> = (0..T::DeletionQueueDepth::get()).map(|_| DeletedContract { + pair_count: 0, + trie_id: vec![], + }) + .collect(); + DeletionQueue::put(queue); + } } diff --git a/frame/contracts/src/tests.rs b/frame/contracts/src/tests.rs index 1f069a9b4652b..d1a9521924f75 100644 --- a/frame/contracts/src/tests.rs +++ b/frame/contracts/src/tests.rs @@ -32,12 +32,14 @@ use sp_runtime::{ testing::{Header, H256}, AccountId32, }; +use sp_io::hashing::blake2_256; use frame_support::{ - assert_ok, assert_err_ignore_postinfo, impl_outer_dispatch, impl_outer_event, + assert_ok, assert_err, assert_err_ignore_postinfo, impl_outer_dispatch, impl_outer_event, impl_outer_origin, parameter_types, StorageMap, - traits::{Currency, ReservableCurrency}, - weights::{Weight, PostDispatchInfo}, + traits::{Currency, ReservableCurrency, OnInitialize}, + weights::{Weight, PostDispatchInfo, DispatchClass, constants::WEIGHT_PER_SECOND}, dispatch::DispatchErrorWithPostInfo, + storage::child, }; use frame_system::{self as system, EventRecord, Phase}; @@ -189,12 +191,12 @@ pub struct Test; parameter_types! { pub const BlockHashCount: u64 = 250; pub BlockWeights: frame_system::limits::BlockWeights = - frame_system::limits::BlockWeights::simple_max(1024); + frame_system::limits::BlockWeights::simple_max(2 * WEIGHT_PER_SECOND); pub static ExistentialDeposit: u64 = 0; } impl frame_system::Config for Test { type BaseCallFilter = (); - type BlockWeights = (); + type BlockWeights = BlockWeights; type BlockLength = (); type DbWeight = (); type Origin = Origin; @@ -243,6 +245,8 @@ parameter_types! { pub const SurchargeReward: u64 = 150; pub const MaxDepth: u32 = 100; pub const MaxValueSize: u32 = 16_384; + pub const DeletionQueueDepth: u32 = 1024; + pub const DeletionWeightLimit: Weight = 500_000_000_000; } parameter_types! { @@ -272,6 +276,8 @@ impl Config for Test { type WeightPrice = Self; type WeightInfo = (); type ChainExtension = TestExtension; + type DeletionQueueDepth = DeletionQueueDepth; + type DeletionWeightLimit = DeletionWeightLimit; } type Balances = pallet_balances::Module; @@ -859,15 +865,6 @@ fn deduct_blocks() { }); } -#[test] -fn call_contract_removals() { - removals(|addr| { - // Call on already-removed account might fail, and this is fine. - let _ = Contracts::call(Origin::signed(ALICE), addr, 0, GAS_LIMIT, call::null()); - true - }); -} - #[test] fn inherent_claim_surcharge_contract_removals() { removals(|addr| Contracts::claim_surcharge(Origin::none(), addr, Some(ALICE)).is_ok()); @@ -918,7 +915,7 @@ fn claim_surcharge(blocks: u64, trigger_call: impl Fn(AccountIdOf) -> bool initialize_block(blocks); // Trigger rent through call - assert!(trigger_call(addr.clone())); + assert_eq!(trigger_call(addr.clone()), removes); if removes { assert!(ContractInfoOf::::get(&addr).unwrap().get_tombstone().is_some()); @@ -956,7 +953,7 @@ fn removals(trigger_call: impl Fn(AccountIdOf) -> bool) { let subsistence_threshold = 50 /*existential_deposit*/ + 16 /*tombstone_deposit*/; // Trigger rent must have no effect - assert!(trigger_call(addr.clone())); + assert!(!trigger_call(addr.clone())); assert_eq!(ContractInfoOf::::get(&addr).unwrap().get_alive().unwrap().rent_allowance, 1_000); assert_eq!(Balances::free_balance(&addr), 100); @@ -972,7 +969,7 @@ fn removals(trigger_call: impl Fn(AccountIdOf) -> bool) { initialize_block(20); // Trigger rent must have no effect - assert!(trigger_call(addr.clone())); + assert!(!trigger_call(addr.clone())); assert!(ContractInfoOf::::get(&addr).unwrap().get_tombstone().is_some()); assert_eq!(Balances::free_balance(&addr), subsistence_threshold); }); @@ -996,7 +993,7 @@ fn removals(trigger_call: impl Fn(AccountIdOf) -> bool) { let addr = Contracts::contract_address(&ALICE, &code_hash, &[]); // Trigger rent must have no effect - assert!(trigger_call(addr.clone())); + assert!(!trigger_call(addr.clone())); assert_eq!( ContractInfoOf::::get(&addr) .unwrap() @@ -1023,7 +1020,7 @@ fn removals(trigger_call: impl Fn(AccountIdOf) -> bool) { initialize_block(20); // Trigger rent must have no effect - assert!(trigger_call(addr.clone())); + assert!(!trigger_call(addr.clone())); assert!(ContractInfoOf::::get(&addr) .unwrap() .get_tombstone() @@ -1052,7 +1049,7 @@ fn removals(trigger_call: impl Fn(AccountIdOf) -> bool) { let addr = Contracts::contract_address(&ALICE, &code_hash, &[]); // Trigger rent must have no effect - assert!(trigger_call(addr.clone())); + assert!(!trigger_call(addr.clone())); assert_eq!( ContractInfoOf::::get(&addr) .unwrap() @@ -1096,7 +1093,7 @@ fn removals(trigger_call: impl Fn(AccountIdOf) -> bool) { initialize_block(20); // Trigger rent must have no effect - assert!(trigger_call(addr.clone())); + assert!(!trigger_call(addr.clone())); assert_matches!(ContractInfoOf::::get(&addr), Some(ContractInfo::Tombstone(_))); assert_eq!(Balances::free_balance(&addr), subsistence_threshold); }); @@ -1131,25 +1128,23 @@ fn call_removed_contract() { // Advance blocks initialize_block(10); - // Calling contract should remove contract and fail. + // Calling contract should deny access because rent cannot be paid. assert_err_ignore_postinfo!( Contracts::call(Origin::signed(ALICE), addr.clone(), 0, GAS_LIMIT, call::null()), Error::::NotCallable ); - // Calling a contract that is about to evict shall emit an event. - assert_eq!(System::events(), vec![ - EventRecord { - phase: Phase::Initialization, - event: MetaEvent::contracts(RawEvent::Evicted(addr.clone(), true)), - topics: vec![], - }, - ]); + // No event is generated because the contract is not actually removed. + assert_eq!(System::events(), vec![]); // Subsequent contract calls should also fail. assert_err_ignore_postinfo!( - Contracts::call(Origin::signed(ALICE), addr, 0, GAS_LIMIT, call::null()), + Contracts::call(Origin::signed(ALICE), addr.clone(), 0, GAS_LIMIT, call::null()), Error::::NotCallable ); + + // A snitch can now remove the contract + assert_ok!(Contracts::claim_surcharge(Origin::none(), addr.clone(), Some(ALICE))); + assert!(ContractInfoOf::::get(&addr).unwrap().get_tombstone().is_some()); }) } @@ -1278,13 +1273,17 @@ fn restoration(test_different_storage: bool, test_restore_to_with_dirty_storage: initialize_block(5); // Call `BOB`, which makes it pay rent. Since the rent allowance is set to 0 - // we expect that it will get removed leaving tombstone. + // we expect that it is no longer callable but keeps existing until someone + // calls `claim_surcharge`. assert_err_ignore_postinfo!( Contracts::call( Origin::signed(ALICE), addr_bob.clone(), 0, GAS_LIMIT, call::null() ), Error::::NotCallable ); + assert!(System::events().is_empty()); + assert!(ContractInfoOf::::get(&addr_bob).unwrap().get_alive().is_some()); + assert_ok!(Contracts::claim_surcharge(Origin::none(), addr_bob.clone(), Some(ALICE))); assert!(ContractInfoOf::::get(&addr_bob).unwrap().get_tombstone().is_some()); assert_eq!(System::events(), vec![ EventRecord { @@ -2134,3 +2133,354 @@ fn chain_extension_works() { }); } +#[test] +fn lazy_removal_works() { + let (code, hash) = compile_module::("self_destruct").unwrap(); + ExtBuilder::default().existential_deposit(50).build().execute_with(|| { + let subsistence = ConfigCache::::subsistence_threshold_uncached(); + let _ = Balances::deposit_creating(&ALICE, 10 * subsistence); + assert_ok!(Contracts::put_code(Origin::signed(ALICE), code)); + + assert_ok!( + Contracts::instantiate( + Origin::signed(ALICE), + subsistence, + GAS_LIMIT, + hash.into(), + vec![], + vec![], + ), + ); + + let addr = Contracts::contract_address(&ALICE, &hash, &[]); + let info = >::get(&addr).unwrap().get_alive().unwrap(); + let trie = &info.child_trie_info(); + + // Put value into the contracts child trie + child::put(trie, &[99], &42); + + // Terminate the contract + assert_ok!(Contracts::call( + Origin::signed(ALICE), + addr.clone(), + 0, + GAS_LIMIT, + vec![], + )); + + // Contract info should be gone + assert!(!>::contains_key(&addr)); + + // But value should be still there as the lazy removal did not run, yet. + assert_matches!(child::get(trie, &[99]), Some(42)); + + // Run the lazy removal + Contracts::on_initialize(Weight::max_value()); + + // Value should be gone now + assert_matches!(child::get::(trie, &[99]), None); + }); +} + +#[test] +fn lazy_removal_partial_remove_works() { + let (code, hash) = compile_module::("self_destruct").unwrap(); + + // We create a contract with some extra keys above the weight limit + let extra_keys = 7u32; + let weight_limit = 5_000_000_000; + let (_, max_keys) = Storage::::deletion_budget(1, weight_limit); + let vals: Vec<_> = (0..max_keys + extra_keys).map(|i| { + (blake2_256(&i.encode()), (i as u32), (i as u32).encode()) + }) + .collect(); + + let mut ext = ExtBuilder::default().existential_deposit(50).build(); + + let trie = ext.execute_with(|| { + let subsistence = ConfigCache::::subsistence_threshold_uncached(); + let _ = Balances::deposit_creating(&ALICE, 10 * subsistence); + assert_ok!(Contracts::put_code(Origin::signed(ALICE), code)); + + assert_ok!( + Contracts::instantiate( + Origin::signed(ALICE), + subsistence, + GAS_LIMIT, + hash.into(), + vec![], + vec![], + ), + ); + + let addr = Contracts::contract_address(&ALICE, &hash, &[]); + let info = >::get(&addr).unwrap().get_alive().unwrap(); + let trie = &info.child_trie_info(); + + // Put value into the contracts child trie + for val in &vals { + Storage::::write( + &addr, + &info.trie_id, + &val.0, + Some(val.2.clone()), + ).unwrap(); + } + + // Terminate the contract + assert_ok!(Contracts::call( + Origin::signed(ALICE), + addr.clone(), + 0, + GAS_LIMIT, + vec![], + )); + + // Contract info should be gone + assert!(!>::contains_key(&addr)); + + // But value should be still there as the lazy removal did not run, yet. + for val in &vals { + assert_eq!(child::get::(trie, &blake2_256(&val.0)), Some(val.1)); + } + + trie.clone() + }); + + // The lazy removal limit only applies to the backend but not to the overlay. + // This commits all keys from the overlay to the backend. + ext.commit_all().unwrap(); + + ext.execute_with(|| { + // Run the lazy removal + let weight_used = Storage::::process_deletion_queue_batch(weight_limit); + + // Weight should be exhausted because we could not even delete all keys + assert_eq!(weight_used, weight_limit); + + let mut num_deleted = 0u32; + let mut num_remaining = 0u32; + + for val in &vals { + match child::get::(&trie, &blake2_256(&val.0)) { + None => num_deleted += 1, + Some(x) if x == val.1 => num_remaining += 1, + Some(_) => panic!("Unexpected value in contract storage"), + } + } + + // All but one key is removed + assert_eq!(num_deleted + num_remaining, vals.len() as u32); + assert_eq!(num_deleted, max_keys); + assert_eq!(num_remaining, extra_keys); + }); +} + +#[test] +fn lazy_removal_does_no_run_on_full_block() { + let (code, hash) = compile_module::("self_destruct").unwrap(); + ExtBuilder::default().existential_deposit(50).build().execute_with(|| { + let subsistence = ConfigCache::::subsistence_threshold_uncached(); + let _ = Balances::deposit_creating(&ALICE, 10 * subsistence); + assert_ok!(Contracts::put_code(Origin::signed(ALICE), code)); + + assert_ok!( + Contracts::instantiate( + Origin::signed(ALICE), + subsistence, + GAS_LIMIT, + hash.into(), + vec![], + vec![], + ), + ); + + let addr = Contracts::contract_address(&ALICE, &hash, &[]); + let info = >::get(&addr).unwrap().get_alive().unwrap(); + let trie = &info.child_trie_info(); + let max_keys = 30; + + // Create some storage items for the contract. + let vals: Vec<_> = (0..max_keys).map(|i| { + (blake2_256(&i.encode()), (i as u32), (i as u32).encode()) + }) + .collect(); + + // Put value into the contracts child trie + for val in &vals { + Storage::::write( + &addr, + &info.trie_id, + &val.0, + Some(val.2.clone()), + ).unwrap(); + } + + // Terminate the contract + assert_ok!(Contracts::call( + Origin::signed(ALICE), + addr.clone(), + 0, + GAS_LIMIT, + vec![], + )); + + // Contract info should be gone + assert!(!>::contains_key(&addr)); + + // But value should be still there as the lazy removal did not run, yet. + for val in &vals { + assert_eq!(child::get::(trie, &blake2_256(&val.0)), Some(val.1)); + } + + // Fill up the block which should prevent the lazy storage removal from running. + System::register_extra_weight_unchecked( + ::BlockWeights::get().max_block, + DispatchClass::Mandatory, + ); + + // Run the lazy removal without any limit so that all keys would be removed if there + // had been some weight left in the block. + let weight_used = Contracts::on_initialize(Weight::max_value()); + let base = <::WeightInfo as crate::WeightInfo>::on_initialize(); + assert_eq!(weight_used, base); + + // All the keys are still in place + for val in &vals { + assert_eq!(child::get::(trie, &blake2_256(&val.0)), Some(val.1)); + } + + // Run the lazy removal directly which disregards the block limits + Storage::::process_deletion_queue_batch(Weight::max_value()); + + // Now the keys should be gone + for val in &vals { + assert_eq!(child::get::(trie, &blake2_256(&val.0)), None); + } + }); +} + + +#[test] +fn lazy_removal_does_not_use_all_weight() { + let (code, hash) = compile_module::("self_destruct").unwrap(); + ExtBuilder::default().existential_deposit(50).build().execute_with(|| { + let subsistence = ConfigCache::::subsistence_threshold_uncached(); + let _ = Balances::deposit_creating(&ALICE, 10 * subsistence); + assert_ok!(Contracts::put_code(Origin::signed(ALICE), code)); + + assert_ok!( + Contracts::instantiate( + Origin::signed(ALICE), + subsistence, + GAS_LIMIT, + hash.into(), + vec![], + vec![], + ), + ); + + let addr = Contracts::contract_address(&ALICE, &hash, &[]); + let info = >::get(&addr).unwrap().get_alive().unwrap(); + let trie = &info.child_trie_info(); + let weight_limit = 5_000_000_000; + let (weight_per_key, max_keys) = Storage::::deletion_budget(1, weight_limit); + + // We create a contract with one less storage item than we can remove within the limit + let vals: Vec<_> = (0..max_keys - 1).map(|i| { + (blake2_256(&i.encode()), (i as u32), (i as u32).encode()) + }) + .collect(); + + // Put value into the contracts child trie + for val in &vals { + Storage::::write( + &addr, + &info.trie_id, + &val.0, + Some(val.2.clone()), + ).unwrap(); + } + + // Terminate the contract + assert_ok!(Contracts::call( + Origin::signed(ALICE), + addr.clone(), + 0, + GAS_LIMIT, + vec![], + )); + + // Contract info should be gone + assert!(!>::contains_key(&addr)); + + // But value should be still there as the lazy removal did not run, yet. + for val in &vals { + assert_eq!(child::get::(trie, &blake2_256(&val.0)), Some(val.1)); + } + + // Run the lazy removal + let weight_used = Storage::::process_deletion_queue_batch(weight_limit); + + // We have one less key in our trie than our weight limit suffices for + assert_eq!(weight_used, weight_limit - weight_per_key); + + // All the keys are removed + for val in vals { + assert_eq!(child::get::(trie, &blake2_256(&val.0)), None); + } + }); +} + +#[test] +fn deletion_queue_full() { + let (code, hash) = compile_module::("self_destruct").unwrap(); + ExtBuilder::default().existential_deposit(50).build().execute_with(|| { + let subsistence = ConfigCache::::subsistence_threshold_uncached(); + let _ = Balances::deposit_creating(&ALICE, 10 * subsistence); + assert_ok!(Contracts::put_code(Origin::signed(ALICE), code)); + + assert_ok!( + Contracts::instantiate( + Origin::signed(ALICE), + subsistence, + GAS_LIMIT, + hash.into(), + vec![], + vec![], + ), + ); + + let addr = Contracts::contract_address(&ALICE, &hash, &[]); + + // fill the deletion queue up until its limit + Storage::::fill_queue_with_dummies(); + + // Terminate the contract should fail + assert_err_ignore_postinfo!( + Contracts::call( + Origin::signed(ALICE), + addr.clone(), + 0, + GAS_LIMIT, + vec![], + ), + Error::::DeletionQueueFull, + ); + + // Contract should be alive because removal failed + >::get(&addr).unwrap().get_alive().unwrap(); + + // make the contract ripe for eviction + initialize_block(5); + + // eviction should fail for the same reason as termination + assert_err!( + Contracts::claim_surcharge(Origin::none(), addr.clone(), Some(ALICE)), + Error::::DeletionQueueFull, + ); + + // Contract should be alive because removal failed + >::get(&addr).unwrap().get_alive().unwrap(); + }); +} diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index 41ab3e390aea8..dd4e37b8e8fed 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -923,6 +923,8 @@ define_env!(Env, , // # Traps // // - The contract is live i.e is already on the call stack. + // - Failed to send the balance to the beneficiary. + // - The deletion queue is full. seal_terminate( ctx, beneficiary_ptr: u32, diff --git a/frame/contracts/src/weights.rs b/frame/contracts/src/weights.rs index b9d7bc6e1fcc7..8b1b77327665f 100644 --- a/frame/contracts/src/weights.rs +++ b/frame/contracts/src/weights.rs @@ -15,9 +15,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Weights for pallet_contracts +//! Autogenerated weights for pallet_contracts +//! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0 -//! DATE: 2020-11-10, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! DATE: 2020-12-12, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 // Executed Command: @@ -43,6 +44,9 @@ use sp_std::marker::PhantomData; /// Weight functions needed for pallet_contracts. pub trait WeightInfo { + fn on_initialize() -> Weight; + fn on_initialize_per_trie_key(k: u32, ) -> Weight; + fn on_initialize_per_queue_item(q: u32, ) -> Weight; fn update_schedule() -> Weight; fn put_code(n: u32, ) -> Weight; fn instantiate(n: u32, s: u32, ) -> Weight; @@ -145,948 +149,1182 @@ pub trait WeightInfo { /// Weights for pallet_contracts using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { + fn on_initialize() -> Weight { + (7_239_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + } + fn on_initialize_per_trie_key(k: u32, ) -> Weight { + (40_584_000 as Weight) + // Standard Error: 4_000 + .saturating_add((2_314_000 as Weight).saturating_mul(k as Weight)) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) + } + fn on_initialize_per_queue_item(q: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 175_000 + .saturating_add((135_919_000 as Weight).saturating_mul(q as Weight)) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + } fn update_schedule() -> Weight { - (35_214_000 as Weight) + (36_262_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn put_code(n: u32, ) -> Weight { - (0 as Weight) - .saturating_add((109_242_000 as Weight).saturating_mul(n as Weight)) + (22_510_000 as Weight) + // Standard Error: 209_000 + .saturating_add((113_251_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } fn instantiate(n: u32, s: u32, ) -> Weight { - (195_276_000 as Weight) - .saturating_add((35_000 as Weight).saturating_mul(n as Weight)) - .saturating_add((2_244_000 as Weight).saturating_mul(s as Weight)) + (216_181_000 as Weight) + // Standard Error: 1_000 + .saturating_add((6_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 1_000 + .saturating_add((2_240_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } fn call() -> Weight { - (207_142_000 as Weight) + (209_785_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } fn claim_surcharge() -> Weight { - (489_633_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + (302_124_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) } fn seal_caller(r: u32, ) -> Weight { - (136_550_000 as Weight) - .saturating_add((373_182_000 as Weight).saturating_mul(r as Weight)) + (138_697_000 as Weight) + // Standard Error: 412_000 + .saturating_add((390_370_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_address(r: u32, ) -> Weight { - (136_329_000 as Weight) - .saturating_add((373_392_000 as Weight).saturating_mul(r as Weight)) + (141_999_000 as Weight) + // Standard Error: 218_000 + .saturating_add((389_261_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_gas_left(r: u32, ) -> Weight { - (111_577_000 as Weight) - .saturating_add((373_536_000 as Weight).saturating_mul(r as Weight)) + (134_956_000 as Weight) + // Standard Error: 205_000 + .saturating_add((384_439_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_balance(r: u32, ) -> Weight { - (157_531_000 as Weight) - .saturating_add((810_382_000 as Weight).saturating_mul(r as Weight)) + (130_585_000 as Weight) + // Standard Error: 784_000 + .saturating_add((860_797_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) } fn seal_value_transferred(r: u32, ) -> Weight { - (143_801_000 as Weight) - .saturating_add((369_769_000 as Weight).saturating_mul(r as Weight)) + (138_382_000 as Weight) + // Standard Error: 163_000 + .saturating_add((384_676_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_minimum_balance(r: u32, ) -> Weight { - (133_546_000 as Weight) - .saturating_add((370_036_000 as Weight).saturating_mul(r as Weight)) + (137_766_000 as Weight) + // Standard Error: 218_000 + .saturating_add((386_002_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_tombstone_deposit(r: u32, ) -> Weight { - (138_568_000 as Weight) - .saturating_add((370_322_000 as Weight).saturating_mul(r as Weight)) + (144_552_000 as Weight) + // Standard Error: 187_000 + .saturating_add((384_754_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_rent_allowance(r: u32, ) -> Weight { - (144_431_000 as Weight) - .saturating_add((851_810_000 as Weight).saturating_mul(r as Weight)) + (150_812_000 as Weight) + // Standard Error: 276_000 + .saturating_add((903_965_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_block_number(r: u32, ) -> Weight { - (133_237_000 as Weight) - .saturating_add((369_156_000 as Weight).saturating_mul(r as Weight)) + (145_168_000 as Weight) + // Standard Error: 191_000 + .saturating_add((382_798_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_now(r: u32, ) -> Weight { - (139_700_000 as Weight) - .saturating_add((368_961_000 as Weight).saturating_mul(r as Weight)) + (145_806_000 as Weight) + // Standard Error: 195_000 + .saturating_add((382_888_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_weight_to_fee(r: u32, ) -> Weight { - (149_395_000 as Weight) - .saturating_add((625_812_000 as Weight).saturating_mul(r as Weight)) + (154_081_000 as Weight) + // Standard Error: 248_000 + .saturating_add((716_294_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) } fn seal_gas(r: u32, ) -> Weight { - (125_777_000 as Weight) - .saturating_add((187_585_000 as Weight).saturating_mul(r as Weight)) + (149_684_000 as Weight) + // Standard Error: 460_000 + .saturating_add((196_251_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_input(r: u32, ) -> Weight { - (132_584_000 as Weight) - .saturating_add((7_661_000 as Weight).saturating_mul(r as Weight)) + (135_447_000 as Weight) + // Standard Error: 75_000 + .saturating_add((8_362_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_input_per_kb(n: u32, ) -> Weight { - (143_408_000 as Weight) - .saturating_add((274_000 as Weight).saturating_mul(n as Weight)) + (146_099_000 as Weight) + // Standard Error: 0 + .saturating_add((270_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_return(r: u32, ) -> Weight { - (126_257_000 as Weight) - .saturating_add((5_455_000 as Weight).saturating_mul(r as Weight)) + (125_358_000 as Weight) + // Standard Error: 52_000 + .saturating_add((5_454_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_return_per_kb(n: u32, ) -> Weight { - (133_286_000 as Weight) - .saturating_add((698_000 as Weight).saturating_mul(n as Weight)) + (135_523_000 as Weight) + // Standard Error: 0 + .saturating_add((785_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_terminate(r: u32, ) -> Weight { - (130_607_000 as Weight) - .saturating_add((358_370_000 as Weight).saturating_mul(r as Weight)) + (135_321_000 as Weight) + // Standard Error: 100_000 + .saturating_add((110_300_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(r as Weight))) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(r as Weight))) + .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(r as Weight))) + .saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(r as Weight))) } fn seal_restore_to(r: u32, ) -> Weight { - (233_645_000 as Weight) - .saturating_add((135_355_000 as Weight).saturating_mul(r as Weight)) + (242_790_000 as Weight) + // Standard Error: 823_000 + .saturating_add((135_544_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(r as Weight))) } fn seal_restore_to_per_delta(d: u32, ) -> Weight { - (74_573_000 as Weight) - .saturating_add((3_768_682_000 as Weight).saturating_mul(d as Weight)) + (34_052_000 as Weight) + // Standard Error: 2_395_000 + .saturating_add((3_970_866_000 as Weight).saturating_mul(d as Weight)) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(d as Weight))) .saturating_add(T::DbWeight::get().writes(5 as Weight)) .saturating_add(T::DbWeight::get().writes((100 as Weight).saturating_mul(d as Weight))) } fn seal_random(r: u32, ) -> Weight { - (140_286_000 as Weight) - .saturating_add((950_890_000 as Weight).saturating_mul(r as Weight)) + (154_549_000 as Weight) + // Standard Error: 692_000 + .saturating_add((989_540_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) } fn seal_deposit_event(r: u32, ) -> Weight { - (167_735_000 as Weight) - .saturating_add((1_375_429_000 as Weight).saturating_mul(r as Weight)) + (125_367_000 as Weight) + // Standard Error: 977_000 + .saturating_add((1_424_216_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_deposit_event_per_topic_and_kb(t: u32, n: u32, ) -> Weight { - (1_715_857_000 as Weight) - .saturating_add((760_777_000 as Weight).saturating_mul(t as Weight)) - .saturating_add((241_853_000 as Weight).saturating_mul(n as Weight)) + (1_843_333_000 as Weight) + // Standard Error: 3_040_000 + .saturating_add((771_663_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 599_000 + .saturating_add((251_555_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(t as Weight))) .saturating_add(T::DbWeight::get().writes((100 as Weight).saturating_mul(t as Weight))) } fn seal_set_rent_allowance(r: u32, ) -> Weight { - (156_911_000 as Weight) - .saturating_add((1_006_139_000 as Weight).saturating_mul(r as Weight)) + (136_437_000 as Weight) + // Standard Error: 299_000 + .saturating_add((1_072_778_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn seal_set_storage(r: u32, ) -> Weight { - (0 as Weight) - .saturating_add((14_938_793_000 as Weight).saturating_mul(r as Weight)) + (182_452_000 as Weight) + // Standard Error: 26_839_000 + .saturating_add((15_911_876_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes((100 as Weight).saturating_mul(r as Weight))) } fn seal_set_storage_per_kb(n: u32, ) -> Weight { - (2_300_169_000 as Weight) - .saturating_add((204_543_000 as Weight).saturating_mul(n as Weight)) + (2_385_415_000 as Weight) + // Standard Error: 751_000 + .saturating_add((223_264_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } fn seal_clear_storage(r: u32, ) -> Weight { (0 as Weight) - .saturating_add((5_140_241_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 2_154_000 + .saturating_add((5_341_117_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes((100 as Weight).saturating_mul(r as Weight))) } fn seal_get_storage(r: u32, ) -> Weight { - (45_212_000 as Weight) - .saturating_add((1_131_504_000 as Weight).saturating_mul(r as Weight)) + (62_353_000 as Weight) + // Standard Error: 1_183_000 + .saturating_add((1_141_653_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) } fn seal_get_storage_per_kb(n: u32, ) -> Weight { - (885_531_000 as Weight) - .saturating_add((148_986_000 as Weight).saturating_mul(n as Weight)) + (905_905_000 as Weight) + // Standard Error: 363_000 + .saturating_add((155_161_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) } fn seal_transfer(r: u32, ) -> Weight { - (92_276_000 as Weight) - .saturating_add((6_216_852_000 as Weight).saturating_mul(r as Weight)) + (60_519_000 as Weight) + // Standard Error: 1_942_000 + .saturating_add((6_453_551_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes((100 as Weight).saturating_mul(r as Weight))) } fn seal_call(r: u32, ) -> Weight { - (0 as Weight) - .saturating_add((10_734_719_000 as Weight).saturating_mul(r as Weight)) + (192_122_000 as Weight) + // Standard Error: 7_851_000 + .saturating_add((10_736_771_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) } fn seal_call_per_transfer_input_output_kb(t: u32, i: u32, o: u32, ) -> Weight { - (12_735_614_000 as Weight) - .saturating_add((2_870_730_000 as Weight).saturating_mul(t as Weight)) - .saturating_add((52_569_000 as Weight).saturating_mul(i as Weight)) - .saturating_add((73_956_000 as Weight).saturating_mul(o as Weight)) + (10_599_501_000 as Weight) + // Standard Error: 133_182_000 + .saturating_add((5_423_848_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 47_000 + .saturating_add((60_108_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 50_000 + .saturating_add((82_691_000 as Weight).saturating_mul(o as Weight)) .saturating_add(T::DbWeight::get().reads(105 as Weight)) .saturating_add(T::DbWeight::get().reads((101 as Weight).saturating_mul(t as Weight))) .saturating_add(T::DbWeight::get().writes((101 as Weight).saturating_mul(t as Weight))) } fn seal_instantiate(r: u32, ) -> Weight { (0 as Weight) - .saturating_add((22_365_908_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 39_807_000 + .saturating_add((22_562_812_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().reads((300 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes((200 as Weight).saturating_mul(r as Weight))) } fn seal_instantiate_per_input_output_salt_kb(i: u32, o: u32, s: u32, ) -> Weight { - (18_899_296_000 as Weight) - .saturating_add((53_289_000 as Weight).saturating_mul(i as Weight)) - .saturating_add((76_026_000 as Weight).saturating_mul(o as Weight)) - .saturating_add((281_097_000 as Weight).saturating_mul(s as Weight)) + (19_823_256_000 as Weight) + // Standard Error: 153_000 + .saturating_add((60_707_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 153_000 + .saturating_add((83_770_000 as Weight).saturating_mul(o as Weight)) + // Standard Error: 153_000 + .saturating_add((284_423_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(207 as Weight)) .saturating_add(T::DbWeight::get().writes(202 as Weight)) } fn seal_hash_sha2_256(r: u32, ) -> Weight { - (136_601_000 as Weight) - .saturating_add((323_373_000 as Weight).saturating_mul(r as Weight)) + (142_838_000 as Weight) + // Standard Error: 243_000 + .saturating_add((332_354_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_hash_sha2_256_per_kb(n: u32, ) -> Weight { - (777_563_000 as Weight) - .saturating_add((423_353_000 as Weight).saturating_mul(n as Weight)) + (877_119_000 as Weight) + // Standard Error: 73_000 + .saturating_add((434_752_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_hash_keccak_256(r: u32, ) -> Weight { - (136_771_000 as Weight) - .saturating_add((337_881_000 as Weight).saturating_mul(r as Weight)) + (139_913_000 as Weight) + // Standard Error: 160_000 + .saturating_add((345_830_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_hash_keccak_256_per_kb(n: u32, ) -> Weight { - (337_906_000 as Weight) - .saturating_add((336_778_000 as Weight).saturating_mul(n as Weight)) + (723_122_000 as Weight) + // Standard Error: 29_000 + .saturating_add((343_949_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_hash_blake2_256(r: u32, ) -> Weight { - (131_040_000 as Weight) - .saturating_add((312_992_000 as Weight).saturating_mul(r as Weight)) + (137_249_000 as Weight) + // Standard Error: 168_000 + .saturating_add((320_295_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_hash_blake2_256_per_kb(n: u32, ) -> Weight { - (693_415_000 as Weight) - .saturating_add((152_745_000 as Weight).saturating_mul(n as Weight)) + (736_756_000 as Weight) + // Standard Error: 39_000 + .saturating_add((159_952_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_hash_blake2_128(r: u32, ) -> Weight { - (135_654_000 as Weight) - .saturating_add((311_271_000 as Weight).saturating_mul(r as Weight)) + (124_530_000 as Weight) + // Standard Error: 203_000 + .saturating_add((321_292_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn seal_hash_blake2_128_per_kb(n: u32, ) -> Weight { - (839_521_000 as Weight) - .saturating_add((153_146_000 as Weight).saturating_mul(n as Weight)) + (782_032_000 as Weight) + // Standard Error: 36_000 + .saturating_add((159_878_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } fn instr_i64const(r: u32, ) -> Weight { - (26_679_000 as Weight) - .saturating_add((3_155_000 as Weight).saturating_mul(r as Weight)) + (24_624_000 as Weight) + // Standard Error: 18_000 + .saturating_add((3_280_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64load(r: u32, ) -> Weight { - (28_920_000 as Weight) - .saturating_add((159_343_000 as Weight).saturating_mul(r as Weight)) + (27_171_000 as Weight) + // Standard Error: 62_000 + .saturating_add((161_737_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64store(r: u32, ) -> Weight { - (28_928_000 as Weight) - .saturating_add((227_286_000 as Weight).saturating_mul(r as Weight)) + (27_106_000 as Weight) + // Standard Error: 94_000 + .saturating_add((229_960_000 as Weight).saturating_mul(r as Weight)) } fn instr_select(r: u32, ) -> Weight { - (26_591_000 as Weight) - .saturating_add((12_591_000 as Weight).saturating_mul(r as Weight)) + (24_566_000 as Weight) + // Standard Error: 18_000 + .saturating_add((12_157_000 as Weight).saturating_mul(r as Weight)) } fn instr_if(r: u32, ) -> Weight { - (26_597_000 as Weight) - .saturating_add((12_258_000 as Weight).saturating_mul(r as Weight)) + (24_531_000 as Weight) + // Standard Error: 17_000 + .saturating_add((12_007_000 as Weight).saturating_mul(r as Weight)) } fn instr_br(r: u32, ) -> Weight { - (26_586_000 as Weight) - .saturating_add((5_811_000 as Weight).saturating_mul(r as Weight)) + (24_567_000 as Weight) + // Standard Error: 20_000 + .saturating_add((6_132_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_if(r: u32, ) -> Weight { - (26_581_000 as Weight) - .saturating_add((14_058_000 as Weight).saturating_mul(r as Weight)) + (24_628_000 as Weight) + // Standard Error: 21_000 + .saturating_add((13_480_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_table(r: u32, ) -> Weight { - (26_615_000 as Weight) - .saturating_add((15_687_000 as Weight).saturating_mul(r as Weight)) + (24_653_000 as Weight) + // Standard Error: 21_000 + .saturating_add((15_005_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_table_per_entry(e: u32, ) -> Weight { - (40_963_000 as Weight) - .saturating_add((92_000 as Weight).saturating_mul(e as Weight)) + (38_573_000 as Weight) + // Standard Error: 0 + .saturating_add((118_000 as Weight).saturating_mul(e as Weight)) } fn instr_call(r: u32, ) -> Weight { - (26_880_000 as Weight) - .saturating_add((97_523_000 as Weight).saturating_mul(r as Weight)) + (24_952_000 as Weight) + // Standard Error: 61_000 + .saturating_add((99_409_000 as Weight).saturating_mul(r as Weight)) } fn instr_call_indirect(r: u32, ) -> Weight { - (34_628_000 as Weight) - .saturating_add((201_913_000 as Weight).saturating_mul(r as Weight)) + (32_478_000 as Weight) + // Standard Error: 242_000 + .saturating_add((193_797_000 as Weight).saturating_mul(r as Weight)) } fn instr_call_indirect_per_param(p: u32, ) -> Weight { - (255_763_000 as Weight) - .saturating_add((3_612_000 as Weight).saturating_mul(p as Weight)) + (238_200_000 as Weight) + // Standard Error: 4_000 + .saturating_add((3_467_000 as Weight).saturating_mul(p as Weight)) } fn instr_local_get(r: u32, ) -> Weight { - (45_954_000 as Weight) - .saturating_add((3_439_000 as Weight).saturating_mul(r as Weight)) + (41_994_000 as Weight) + // Standard Error: 22_000 + .saturating_add((3_230_000 as Weight).saturating_mul(r as Weight)) } fn instr_local_set(r: u32, ) -> Weight { - (45_952_000 as Weight) - .saturating_add((3_601_000 as Weight).saturating_mul(r as Weight)) + (41_994_000 as Weight) + // Standard Error: 20_000 + .saturating_add((3_558_000 as Weight).saturating_mul(r as Weight)) } fn instr_local_tee(r: u32, ) -> Weight { - (45_883_000 as Weight) - .saturating_add((5_203_000 as Weight).saturating_mul(r as Weight)) + (41_965_000 as Weight) + // Standard Error: 33_000 + .saturating_add((4_806_000 as Weight).saturating_mul(r as Weight)) } fn instr_global_get(r: u32, ) -> Weight { - (29_895_000 as Weight) - .saturating_add((8_221_000 as Weight).saturating_mul(r as Weight)) + (27_997_000 as Weight) + // Standard Error: 26_000 + .saturating_add((7_859_000 as Weight).saturating_mul(r as Weight)) } fn instr_global_set(r: u32, ) -> Weight { - (29_916_000 as Weight) - .saturating_add((12_036_000 as Weight).saturating_mul(r as Weight)) + (28_118_000 as Weight) + // Standard Error: 33_000 + .saturating_add((11_825_000 as Weight).saturating_mul(r as Weight)) } fn instr_memory_current(r: u32, ) -> Weight { - (28_878_000 as Weight) - .saturating_add((3_794_000 as Weight).saturating_mul(r as Weight)) + (27_172_000 as Weight) + // Standard Error: 19_000 + .saturating_add((3_466_000 as Weight).saturating_mul(r as Weight)) } fn instr_memory_grow(r: u32, ) -> Weight { - (27_351_000 as Weight) - .saturating_add((2_302_301_000 as Weight).saturating_mul(r as Weight)) + (25_582_000 as Weight) + // Standard Error: 4_756_000 + .saturating_add((2_290_170_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64clz(r: u32, ) -> Weight { - (26_535_000 as Weight) - .saturating_add((5_450_000 as Weight).saturating_mul(r as Weight)) + (24_712_000 as Weight) + // Standard Error: 24_000 + .saturating_add((5_226_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ctz(r: u32, ) -> Weight { - (26_489_000 as Weight) - .saturating_add((5_410_000 as Weight).saturating_mul(r as Weight)) + (24_631_000 as Weight) + // Standard Error: 23_000 + .saturating_add((5_282_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64popcnt(r: u32, ) -> Weight { - (26_576_000 as Weight) - .saturating_add((5_976_000 as Weight).saturating_mul(r as Weight)) + (24_640_000 as Weight) + // Standard Error: 17_000 + .saturating_add((5_964_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64eqz(r: u32, ) -> Weight { - (26_521_000 as Weight) - .saturating_add((5_465_000 as Weight).saturating_mul(r as Weight)) + (24_631_000 as Weight) + // Standard Error: 11_000 + .saturating_add((5_128_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64extendsi32(r: u32, ) -> Weight { - (26_534_000 as Weight) - .saturating_add((5_375_000 as Weight).saturating_mul(r as Weight)) + (24_540_000 as Weight) + // Standard Error: 11_000 + .saturating_add((5_224_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64extendui32(r: u32, ) -> Weight { - (26_560_000 as Weight) - .saturating_add((5_284_000 as Weight).saturating_mul(r as Weight)) + (24_623_000 as Weight) + // Standard Error: 16_000 + .saturating_add((5_138_000 as Weight).saturating_mul(r as Weight)) } fn instr_i32wrapi64(r: u32, ) -> Weight { - (26_554_000 as Weight) - .saturating_add((5_358_000 as Weight).saturating_mul(r as Weight)) + (24_623_000 as Weight) + // Standard Error: 15_000 + .saturating_add((5_242_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64eq(r: u32, ) -> Weight { - (26_549_000 as Weight) - .saturating_add((7_402_000 as Weight).saturating_mul(r as Weight)) + (24_575_000 as Weight) + // Standard Error: 9_000 + .saturating_add((7_328_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ne(r: u32, ) -> Weight { - (26_582_000 as Weight) - .saturating_add((7_266_000 as Weight).saturating_mul(r as Weight)) + (24_674_000 as Weight) + // Standard Error: 14_000 + .saturating_add((7_147_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64lts(r: u32, ) -> Weight { - (26_558_000 as Weight) - .saturating_add((7_293_000 as Weight).saturating_mul(r as Weight)) + (24_645_000 as Weight) + // Standard Error: 20_000 + .saturating_add((7_158_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ltu(r: u32, ) -> Weight { - (26_569_000 as Weight) - .saturating_add((7_278_000 as Weight).saturating_mul(r as Weight)) + (24_688_000 as Weight) + // Standard Error: 16_000 + .saturating_add((7_226_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64gts(r: u32, ) -> Weight { - (26_516_000 as Weight) - .saturating_add((7_334_000 as Weight).saturating_mul(r as Weight)) + (24_579_000 as Weight) + // Standard Error: 13_000 + .saturating_add((7_187_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64gtu(r: u32, ) -> Weight { - (26_561_000 as Weight) - .saturating_add((7_283_000 as Weight).saturating_mul(r as Weight)) + (24_578_000 as Weight) + // Standard Error: 15_000 + .saturating_add((7_235_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64les(r: u32, ) -> Weight { - (26_589_000 as Weight) - .saturating_add((7_244_000 as Weight).saturating_mul(r as Weight)) + (24_625_000 as Weight) + // Standard Error: 17_000 + .saturating_add((7_089_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64leu(r: u32, ) -> Weight { - (26_593_000 as Weight) - .saturating_add((7_318_000 as Weight).saturating_mul(r as Weight)) + (24_589_000 as Weight) + // Standard Error: 9_000 + .saturating_add((7_078_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ges(r: u32, ) -> Weight { - (26_626_000 as Weight) - .saturating_add((7_348_000 as Weight).saturating_mul(r as Weight)) + (24_572_000 as Weight) + // Standard Error: 13_000 + .saturating_add((7_286_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64geu(r: u32, ) -> Weight { - (26_595_000 as Weight) - .saturating_add((7_330_000 as Weight).saturating_mul(r as Weight)) + (24_566_000 as Weight) + // Standard Error: 19_000 + .saturating_add((7_247_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64add(r: u32, ) -> Weight { - (26_568_000 as Weight) - .saturating_add((8_657_000 as Weight).saturating_mul(r as Weight)) + (24_581_000 as Weight) + // Standard Error: 18_000 + .saturating_add((7_190_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64sub(r: u32, ) -> Weight { - (27_393_000 as Weight) - .saturating_add((6_743_000 as Weight).saturating_mul(r as Weight)) + (24_565_000 as Weight) + // Standard Error: 10_000 + .saturating_add((7_242_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64mul(r: u32, ) -> Weight { - (26_571_000 as Weight) - .saturating_add((7_329_000 as Weight).saturating_mul(r as Weight)) + (24_542_000 as Weight) + // Standard Error: 11_000 + .saturating_add((7_216_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64divs(r: u32, ) -> Weight { - (26_585_000 as Weight) - .saturating_add((12_977_000 as Weight).saturating_mul(r as Weight)) + (24_608_000 as Weight) + // Standard Error: 16_000 + .saturating_add((12_966_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64divu(r: u32, ) -> Weight { - (26_554_000 as Weight) - .saturating_add((11_955_000 as Weight).saturating_mul(r as Weight)) + (24_564_000 as Weight) + // Standard Error: 1_424_000 + .saturating_add((13_665_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rems(r: u32, ) -> Weight { - (26_570_000 as Weight) - .saturating_add((12_903_000 as Weight).saturating_mul(r as Weight)) + (24_611_000 as Weight) + // Standard Error: 16_000 + .saturating_add((12_932_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64remu(r: u32, ) -> Weight { - (26_561_000 as Weight) - .saturating_add((12_112_000 as Weight).saturating_mul(r as Weight)) + (24_590_000 as Weight) + // Standard Error: 10_000 + .saturating_add((12_207_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64and(r: u32, ) -> Weight { - (26_587_000 as Weight) - .saturating_add((7_411_000 as Weight).saturating_mul(r as Weight)) + (24_622_000 as Weight) + // Standard Error: 15_000 + .saturating_add((7_172_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64or(r: u32, ) -> Weight { - (26_588_000 as Weight) - .saturating_add((7_479_000 as Weight).saturating_mul(r as Weight)) + (24_585_000 as Weight) + // Standard Error: 18_000 + .saturating_add((7_202_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64xor(r: u32, ) -> Weight { - (26_541_000 as Weight) - .saturating_add((7_386_000 as Weight).saturating_mul(r as Weight)) + (24_600_000 as Weight) + // Standard Error: 20_000 + .saturating_add((7_182_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shl(r: u32, ) -> Weight { - (26_562_000 as Weight) - .saturating_add((7_263_000 as Weight).saturating_mul(r as Weight)) + (24_621_000 as Weight) + // Standard Error: 11_000 + .saturating_add((7_226_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shrs(r: u32, ) -> Weight { - (26_569_000 as Weight) - .saturating_add((7_353_000 as Weight).saturating_mul(r as Weight)) + (24_643_000 as Weight) + // Standard Error: 22_000 + .saturating_add((7_254_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shru(r: u32, ) -> Weight { - (26_533_000 as Weight) - .saturating_add((7_342_000 as Weight).saturating_mul(r as Weight)) + (24_586_000 as Weight) + // Standard Error: 14_000 + .saturating_add((7_246_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rotl(r: u32, ) -> Weight { - (26_545_000 as Weight) - .saturating_add((7_362_000 as Weight).saturating_mul(r as Weight)) + (24_631_000 as Weight) + // Standard Error: 22_000 + .saturating_add((7_306_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rotr(r: u32, ) -> Weight { - (26_535_000 as Weight) - .saturating_add((7_330_000 as Weight).saturating_mul(r as Weight)) + (24_643_000 as Weight) + // Standard Error: 15_000 + .saturating_add((7_183_000 as Weight).saturating_mul(r as Weight)) } } // For backwards compatibility and tests impl WeightInfo for () { + fn on_initialize() -> Weight { + (7_239_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + } + fn on_initialize_per_trie_key(k: u32, ) -> Weight { + (40_584_000 as Weight) + // Standard Error: 4_000 + .saturating_add((2_314_000 as Weight).saturating_mul(k as Weight)) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) + } + fn on_initialize_per_queue_item(q: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 175_000 + .saturating_add((135_919_000 as Weight).saturating_mul(q as Weight)) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + } fn update_schedule() -> Weight { - (35_214_000 as Weight) + (36_262_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn put_code(n: u32, ) -> Weight { - (0 as Weight) - .saturating_add((109_242_000 as Weight).saturating_mul(n as Weight)) + (22_510_000 as Weight) + // Standard Error: 209_000 + .saturating_add((113_251_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } fn instantiate(n: u32, s: u32, ) -> Weight { - (195_276_000 as Weight) - .saturating_add((35_000 as Weight).saturating_mul(n as Weight)) - .saturating_add((2_244_000 as Weight).saturating_mul(s as Weight)) + (216_181_000 as Weight) + // Standard Error: 1_000 + .saturating_add((6_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 1_000 + .saturating_add((2_240_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } fn call() -> Weight { - (207_142_000 as Weight) + (209_785_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } fn claim_surcharge() -> Weight { - (489_633_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(3 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + (302_124_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } fn seal_caller(r: u32, ) -> Weight { - (136_550_000 as Weight) - .saturating_add((373_182_000 as Weight).saturating_mul(r as Weight)) + (138_697_000 as Weight) + // Standard Error: 412_000 + .saturating_add((390_370_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_address(r: u32, ) -> Weight { - (136_329_000 as Weight) - .saturating_add((373_392_000 as Weight).saturating_mul(r as Weight)) + (141_999_000 as Weight) + // Standard Error: 218_000 + .saturating_add((389_261_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_gas_left(r: u32, ) -> Weight { - (111_577_000 as Weight) - .saturating_add((373_536_000 as Weight).saturating_mul(r as Weight)) + (134_956_000 as Weight) + // Standard Error: 205_000 + .saturating_add((384_439_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_balance(r: u32, ) -> Weight { - (157_531_000 as Weight) - .saturating_add((810_382_000 as Weight).saturating_mul(r as Weight)) + (130_585_000 as Weight) + // Standard Error: 784_000 + .saturating_add((860_797_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) } fn seal_value_transferred(r: u32, ) -> Weight { - (143_801_000 as Weight) - .saturating_add((369_769_000 as Weight).saturating_mul(r as Weight)) + (138_382_000 as Weight) + // Standard Error: 163_000 + .saturating_add((384_676_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_minimum_balance(r: u32, ) -> Weight { - (133_546_000 as Weight) - .saturating_add((370_036_000 as Weight).saturating_mul(r as Weight)) + (137_766_000 as Weight) + // Standard Error: 218_000 + .saturating_add((386_002_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_tombstone_deposit(r: u32, ) -> Weight { - (138_568_000 as Weight) - .saturating_add((370_322_000 as Weight).saturating_mul(r as Weight)) + (144_552_000 as Weight) + // Standard Error: 187_000 + .saturating_add((384_754_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_rent_allowance(r: u32, ) -> Weight { - (144_431_000 as Weight) - .saturating_add((851_810_000 as Weight).saturating_mul(r as Weight)) + (150_812_000 as Weight) + // Standard Error: 276_000 + .saturating_add((903_965_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_block_number(r: u32, ) -> Weight { - (133_237_000 as Weight) - .saturating_add((369_156_000 as Weight).saturating_mul(r as Weight)) + (145_168_000 as Weight) + // Standard Error: 191_000 + .saturating_add((382_798_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_now(r: u32, ) -> Weight { - (139_700_000 as Weight) - .saturating_add((368_961_000 as Weight).saturating_mul(r as Weight)) + (145_806_000 as Weight) + // Standard Error: 195_000 + .saturating_add((382_888_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_weight_to_fee(r: u32, ) -> Weight { - (149_395_000 as Weight) - .saturating_add((625_812_000 as Weight).saturating_mul(r as Weight)) + (154_081_000 as Weight) + // Standard Error: 248_000 + .saturating_add((716_294_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) } fn seal_gas(r: u32, ) -> Weight { - (125_777_000 as Weight) - .saturating_add((187_585_000 as Weight).saturating_mul(r as Weight)) + (149_684_000 as Weight) + // Standard Error: 460_000 + .saturating_add((196_251_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_input(r: u32, ) -> Weight { - (132_584_000 as Weight) - .saturating_add((7_661_000 as Weight).saturating_mul(r as Weight)) + (135_447_000 as Weight) + // Standard Error: 75_000 + .saturating_add((8_362_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_input_per_kb(n: u32, ) -> Weight { - (143_408_000 as Weight) - .saturating_add((274_000 as Weight).saturating_mul(n as Weight)) + (146_099_000 as Weight) + // Standard Error: 0 + .saturating_add((270_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_return(r: u32, ) -> Weight { - (126_257_000 as Weight) - .saturating_add((5_455_000 as Weight).saturating_mul(r as Weight)) + (125_358_000 as Weight) + // Standard Error: 52_000 + .saturating_add((5_454_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_return_per_kb(n: u32, ) -> Weight { - (133_286_000 as Weight) - .saturating_add((698_000 as Weight).saturating_mul(n as Weight)) + (135_523_000 as Weight) + // Standard Error: 0 + .saturating_add((785_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_terminate(r: u32, ) -> Weight { - (130_607_000 as Weight) - .saturating_add((358_370_000 as Weight).saturating_mul(r as Weight)) + (135_321_000 as Weight) + // Standard Error: 100_000 + .saturating_add((110_300_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(r as Weight))) - .saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(r as Weight))) + .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(r as Weight))) + .saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(r as Weight))) } fn seal_restore_to(r: u32, ) -> Weight { - (233_645_000 as Weight) - .saturating_add((135_355_000 as Weight).saturating_mul(r as Weight)) + (242_790_000 as Weight) + // Standard Error: 823_000 + .saturating_add((135_544_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(r as Weight))) } fn seal_restore_to_per_delta(d: u32, ) -> Weight { - (74_573_000 as Weight) - .saturating_add((3_768_682_000 as Weight).saturating_mul(d as Weight)) + (34_052_000 as Weight) + // Standard Error: 2_395_000 + .saturating_add((3_970_866_000 as Weight).saturating_mul(d as Weight)) .saturating_add(RocksDbWeight::get().reads(7 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(d as Weight))) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) .saturating_add(RocksDbWeight::get().writes((100 as Weight).saturating_mul(d as Weight))) } fn seal_random(r: u32, ) -> Weight { - (140_286_000 as Weight) - .saturating_add((950_890_000 as Weight).saturating_mul(r as Weight)) + (154_549_000 as Weight) + // Standard Error: 692_000 + .saturating_add((989_540_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) } fn seal_deposit_event(r: u32, ) -> Weight { - (167_735_000 as Weight) - .saturating_add((1_375_429_000 as Weight).saturating_mul(r as Weight)) + (125_367_000 as Weight) + // Standard Error: 977_000 + .saturating_add((1_424_216_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_deposit_event_per_topic_and_kb(t: u32, n: u32, ) -> Weight { - (1_715_857_000 as Weight) - .saturating_add((760_777_000 as Weight).saturating_mul(t as Weight)) - .saturating_add((241_853_000 as Weight).saturating_mul(n as Weight)) + (1_843_333_000 as Weight) + // Standard Error: 3_040_000 + .saturating_add((771_663_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 599_000 + .saturating_add((251_555_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(t as Weight))) .saturating_add(RocksDbWeight::get().writes((100 as Weight).saturating_mul(t as Weight))) } fn seal_set_rent_allowance(r: u32, ) -> Weight { - (156_911_000 as Weight) - .saturating_add((1_006_139_000 as Weight).saturating_mul(r as Weight)) + (136_437_000 as Weight) + // Standard Error: 299_000 + .saturating_add((1_072_778_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn seal_set_storage(r: u32, ) -> Weight { - (0 as Weight) - .saturating_add((14_938_793_000 as Weight).saturating_mul(r as Weight)) + (182_452_000 as Weight) + // Standard Error: 26_839_000 + .saturating_add((15_911_876_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) .saturating_add(RocksDbWeight::get().writes((100 as Weight).saturating_mul(r as Weight))) } fn seal_set_storage_per_kb(n: u32, ) -> Weight { - (2_300_169_000 as Weight) - .saturating_add((204_543_000 as Weight).saturating_mul(n as Weight)) + (2_385_415_000 as Weight) + // Standard Error: 751_000 + .saturating_add((223_264_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } fn seal_clear_storage(r: u32, ) -> Weight { (0 as Weight) - .saturating_add((5_140_241_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 2_154_000 + .saturating_add((5_341_117_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) .saturating_add(RocksDbWeight::get().writes((100 as Weight).saturating_mul(r as Weight))) } fn seal_get_storage(r: u32, ) -> Weight { - (45_212_000 as Weight) - .saturating_add((1_131_504_000 as Weight).saturating_mul(r as Weight)) + (62_353_000 as Weight) + // Standard Error: 1_183_000 + .saturating_add((1_141_653_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) } fn seal_get_storage_per_kb(n: u32, ) -> Weight { - (885_531_000 as Weight) - .saturating_add((148_986_000 as Weight).saturating_mul(n as Weight)) + (905_905_000 as Weight) + // Standard Error: 363_000 + .saturating_add((155_161_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) } fn seal_transfer(r: u32, ) -> Weight { - (92_276_000 as Weight) - .saturating_add((6_216_852_000 as Weight).saturating_mul(r as Weight)) + (60_519_000 as Weight) + // Standard Error: 1_942_000 + .saturating_add((6_453_551_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) .saturating_add(RocksDbWeight::get().writes((100 as Weight).saturating_mul(r as Weight))) } fn seal_call(r: u32, ) -> Weight { - (0 as Weight) - .saturating_add((10_734_719_000 as Weight).saturating_mul(r as Weight)) + (192_122_000 as Weight) + // Standard Error: 7_851_000 + .saturating_add((10_736_771_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) } fn seal_call_per_transfer_input_output_kb(t: u32, i: u32, o: u32, ) -> Weight { - (12_735_614_000 as Weight) - .saturating_add((2_870_730_000 as Weight).saturating_mul(t as Weight)) - .saturating_add((52_569_000 as Weight).saturating_mul(i as Weight)) - .saturating_add((73_956_000 as Weight).saturating_mul(o as Weight)) + (10_599_501_000 as Weight) + // Standard Error: 133_182_000 + .saturating_add((5_423_848_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 47_000 + .saturating_add((60_108_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 50_000 + .saturating_add((82_691_000 as Weight).saturating_mul(o as Weight)) .saturating_add(RocksDbWeight::get().reads(105 as Weight)) .saturating_add(RocksDbWeight::get().reads((101 as Weight).saturating_mul(t as Weight))) .saturating_add(RocksDbWeight::get().writes((101 as Weight).saturating_mul(t as Weight))) } fn seal_instantiate(r: u32, ) -> Weight { (0 as Weight) - .saturating_add((22_365_908_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 39_807_000 + .saturating_add((22_562_812_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().reads((300 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes((200 as Weight).saturating_mul(r as Weight))) } fn seal_instantiate_per_input_output_salt_kb(i: u32, o: u32, s: u32, ) -> Weight { - (18_899_296_000 as Weight) - .saturating_add((53_289_000 as Weight).saturating_mul(i as Weight)) - .saturating_add((76_026_000 as Weight).saturating_mul(o as Weight)) - .saturating_add((281_097_000 as Weight).saturating_mul(s as Weight)) + (19_823_256_000 as Weight) + // Standard Error: 153_000 + .saturating_add((60_707_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 153_000 + .saturating_add((83_770_000 as Weight).saturating_mul(o as Weight)) + // Standard Error: 153_000 + .saturating_add((284_423_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(207 as Weight)) .saturating_add(RocksDbWeight::get().writes(202 as Weight)) } fn seal_hash_sha2_256(r: u32, ) -> Weight { - (136_601_000 as Weight) - .saturating_add((323_373_000 as Weight).saturating_mul(r as Weight)) + (142_838_000 as Weight) + // Standard Error: 243_000 + .saturating_add((332_354_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_hash_sha2_256_per_kb(n: u32, ) -> Weight { - (777_563_000 as Weight) - .saturating_add((423_353_000 as Weight).saturating_mul(n as Weight)) + (877_119_000 as Weight) + // Standard Error: 73_000 + .saturating_add((434_752_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_hash_keccak_256(r: u32, ) -> Weight { - (136_771_000 as Weight) - .saturating_add((337_881_000 as Weight).saturating_mul(r as Weight)) + (139_913_000 as Weight) + // Standard Error: 160_000 + .saturating_add((345_830_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_hash_keccak_256_per_kb(n: u32, ) -> Weight { - (337_906_000 as Weight) - .saturating_add((336_778_000 as Weight).saturating_mul(n as Weight)) + (723_122_000 as Weight) + // Standard Error: 29_000 + .saturating_add((343_949_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_hash_blake2_256(r: u32, ) -> Weight { - (131_040_000 as Weight) - .saturating_add((312_992_000 as Weight).saturating_mul(r as Weight)) + (137_249_000 as Weight) + // Standard Error: 168_000 + .saturating_add((320_295_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_hash_blake2_256_per_kb(n: u32, ) -> Weight { - (693_415_000 as Weight) - .saturating_add((152_745_000 as Weight).saturating_mul(n as Weight)) + (736_756_000 as Weight) + // Standard Error: 39_000 + .saturating_add((159_952_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_hash_blake2_128(r: u32, ) -> Weight { - (135_654_000 as Weight) - .saturating_add((311_271_000 as Weight).saturating_mul(r as Weight)) + (124_530_000 as Weight) + // Standard Error: 203_000 + .saturating_add((321_292_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn seal_hash_blake2_128_per_kb(n: u32, ) -> Weight { - (839_521_000 as Weight) - .saturating_add((153_146_000 as Weight).saturating_mul(n as Weight)) + (782_032_000 as Weight) + // Standard Error: 36_000 + .saturating_add((159_878_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } fn instr_i64const(r: u32, ) -> Weight { - (26_679_000 as Weight) - .saturating_add((3_155_000 as Weight).saturating_mul(r as Weight)) + (24_624_000 as Weight) + // Standard Error: 18_000 + .saturating_add((3_280_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64load(r: u32, ) -> Weight { - (28_920_000 as Weight) - .saturating_add((159_343_000 as Weight).saturating_mul(r as Weight)) + (27_171_000 as Weight) + // Standard Error: 62_000 + .saturating_add((161_737_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64store(r: u32, ) -> Weight { - (28_928_000 as Weight) - .saturating_add((227_286_000 as Weight).saturating_mul(r as Weight)) + (27_106_000 as Weight) + // Standard Error: 94_000 + .saturating_add((229_960_000 as Weight).saturating_mul(r as Weight)) } fn instr_select(r: u32, ) -> Weight { - (26_591_000 as Weight) - .saturating_add((12_591_000 as Weight).saturating_mul(r as Weight)) + (24_566_000 as Weight) + // Standard Error: 18_000 + .saturating_add((12_157_000 as Weight).saturating_mul(r as Weight)) } fn instr_if(r: u32, ) -> Weight { - (26_597_000 as Weight) - .saturating_add((12_258_000 as Weight).saturating_mul(r as Weight)) + (24_531_000 as Weight) + // Standard Error: 17_000 + .saturating_add((12_007_000 as Weight).saturating_mul(r as Weight)) } fn instr_br(r: u32, ) -> Weight { - (26_586_000 as Weight) - .saturating_add((5_811_000 as Weight).saturating_mul(r as Weight)) + (24_567_000 as Weight) + // Standard Error: 20_000 + .saturating_add((6_132_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_if(r: u32, ) -> Weight { - (26_581_000 as Weight) - .saturating_add((14_058_000 as Weight).saturating_mul(r as Weight)) + (24_628_000 as Weight) + // Standard Error: 21_000 + .saturating_add((13_480_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_table(r: u32, ) -> Weight { - (26_615_000 as Weight) - .saturating_add((15_687_000 as Weight).saturating_mul(r as Weight)) + (24_653_000 as Weight) + // Standard Error: 21_000 + .saturating_add((15_005_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_table_per_entry(e: u32, ) -> Weight { - (40_963_000 as Weight) - .saturating_add((92_000 as Weight).saturating_mul(e as Weight)) + (38_573_000 as Weight) + // Standard Error: 0 + .saturating_add((118_000 as Weight).saturating_mul(e as Weight)) } fn instr_call(r: u32, ) -> Weight { - (26_880_000 as Weight) - .saturating_add((97_523_000 as Weight).saturating_mul(r as Weight)) + (24_952_000 as Weight) + // Standard Error: 61_000 + .saturating_add((99_409_000 as Weight).saturating_mul(r as Weight)) } fn instr_call_indirect(r: u32, ) -> Weight { - (34_628_000 as Weight) - .saturating_add((201_913_000 as Weight).saturating_mul(r as Weight)) + (32_478_000 as Weight) + // Standard Error: 242_000 + .saturating_add((193_797_000 as Weight).saturating_mul(r as Weight)) } fn instr_call_indirect_per_param(p: u32, ) -> Weight { - (255_763_000 as Weight) - .saturating_add((3_612_000 as Weight).saturating_mul(p as Weight)) + (238_200_000 as Weight) + // Standard Error: 4_000 + .saturating_add((3_467_000 as Weight).saturating_mul(p as Weight)) } fn instr_local_get(r: u32, ) -> Weight { - (45_954_000 as Weight) - .saturating_add((3_439_000 as Weight).saturating_mul(r as Weight)) + (41_994_000 as Weight) + // Standard Error: 22_000 + .saturating_add((3_230_000 as Weight).saturating_mul(r as Weight)) } fn instr_local_set(r: u32, ) -> Weight { - (45_952_000 as Weight) - .saturating_add((3_601_000 as Weight).saturating_mul(r as Weight)) + (41_994_000 as Weight) + // Standard Error: 20_000 + .saturating_add((3_558_000 as Weight).saturating_mul(r as Weight)) } fn instr_local_tee(r: u32, ) -> Weight { - (45_883_000 as Weight) - .saturating_add((5_203_000 as Weight).saturating_mul(r as Weight)) + (41_965_000 as Weight) + // Standard Error: 33_000 + .saturating_add((4_806_000 as Weight).saturating_mul(r as Weight)) } fn instr_global_get(r: u32, ) -> Weight { - (29_895_000 as Weight) - .saturating_add((8_221_000 as Weight).saturating_mul(r as Weight)) + (27_997_000 as Weight) + // Standard Error: 26_000 + .saturating_add((7_859_000 as Weight).saturating_mul(r as Weight)) } fn instr_global_set(r: u32, ) -> Weight { - (29_916_000 as Weight) - .saturating_add((12_036_000 as Weight).saturating_mul(r as Weight)) + (28_118_000 as Weight) + // Standard Error: 33_000 + .saturating_add((11_825_000 as Weight).saturating_mul(r as Weight)) } fn instr_memory_current(r: u32, ) -> Weight { - (28_878_000 as Weight) - .saturating_add((3_794_000 as Weight).saturating_mul(r as Weight)) + (27_172_000 as Weight) + // Standard Error: 19_000 + .saturating_add((3_466_000 as Weight).saturating_mul(r as Weight)) } fn instr_memory_grow(r: u32, ) -> Weight { - (27_351_000 as Weight) - .saturating_add((2_302_301_000 as Weight).saturating_mul(r as Weight)) + (25_582_000 as Weight) + // Standard Error: 4_756_000 + .saturating_add((2_290_170_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64clz(r: u32, ) -> Weight { - (26_535_000 as Weight) - .saturating_add((5_450_000 as Weight).saturating_mul(r as Weight)) + (24_712_000 as Weight) + // Standard Error: 24_000 + .saturating_add((5_226_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ctz(r: u32, ) -> Weight { - (26_489_000 as Weight) - .saturating_add((5_410_000 as Weight).saturating_mul(r as Weight)) + (24_631_000 as Weight) + // Standard Error: 23_000 + .saturating_add((5_282_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64popcnt(r: u32, ) -> Weight { - (26_576_000 as Weight) - .saturating_add((5_976_000 as Weight).saturating_mul(r as Weight)) + (24_640_000 as Weight) + // Standard Error: 17_000 + .saturating_add((5_964_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64eqz(r: u32, ) -> Weight { - (26_521_000 as Weight) - .saturating_add((5_465_000 as Weight).saturating_mul(r as Weight)) + (24_631_000 as Weight) + // Standard Error: 11_000 + .saturating_add((5_128_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64extendsi32(r: u32, ) -> Weight { - (26_534_000 as Weight) - .saturating_add((5_375_000 as Weight).saturating_mul(r as Weight)) + (24_540_000 as Weight) + // Standard Error: 11_000 + .saturating_add((5_224_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64extendui32(r: u32, ) -> Weight { - (26_560_000 as Weight) - .saturating_add((5_284_000 as Weight).saturating_mul(r as Weight)) + (24_623_000 as Weight) + // Standard Error: 16_000 + .saturating_add((5_138_000 as Weight).saturating_mul(r as Weight)) } fn instr_i32wrapi64(r: u32, ) -> Weight { - (26_554_000 as Weight) - .saturating_add((5_358_000 as Weight).saturating_mul(r as Weight)) + (24_623_000 as Weight) + // Standard Error: 15_000 + .saturating_add((5_242_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64eq(r: u32, ) -> Weight { - (26_549_000 as Weight) - .saturating_add((7_402_000 as Weight).saturating_mul(r as Weight)) + (24_575_000 as Weight) + // Standard Error: 9_000 + .saturating_add((7_328_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ne(r: u32, ) -> Weight { - (26_582_000 as Weight) - .saturating_add((7_266_000 as Weight).saturating_mul(r as Weight)) + (24_674_000 as Weight) + // Standard Error: 14_000 + .saturating_add((7_147_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64lts(r: u32, ) -> Weight { - (26_558_000 as Weight) - .saturating_add((7_293_000 as Weight).saturating_mul(r as Weight)) + (24_645_000 as Weight) + // Standard Error: 20_000 + .saturating_add((7_158_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ltu(r: u32, ) -> Weight { - (26_569_000 as Weight) - .saturating_add((7_278_000 as Weight).saturating_mul(r as Weight)) + (24_688_000 as Weight) + // Standard Error: 16_000 + .saturating_add((7_226_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64gts(r: u32, ) -> Weight { - (26_516_000 as Weight) - .saturating_add((7_334_000 as Weight).saturating_mul(r as Weight)) + (24_579_000 as Weight) + // Standard Error: 13_000 + .saturating_add((7_187_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64gtu(r: u32, ) -> Weight { - (26_561_000 as Weight) - .saturating_add((7_283_000 as Weight).saturating_mul(r as Weight)) + (24_578_000 as Weight) + // Standard Error: 15_000 + .saturating_add((7_235_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64les(r: u32, ) -> Weight { - (26_589_000 as Weight) - .saturating_add((7_244_000 as Weight).saturating_mul(r as Weight)) + (24_625_000 as Weight) + // Standard Error: 17_000 + .saturating_add((7_089_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64leu(r: u32, ) -> Weight { - (26_593_000 as Weight) - .saturating_add((7_318_000 as Weight).saturating_mul(r as Weight)) + (24_589_000 as Weight) + // Standard Error: 9_000 + .saturating_add((7_078_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ges(r: u32, ) -> Weight { - (26_626_000 as Weight) - .saturating_add((7_348_000 as Weight).saturating_mul(r as Weight)) + (24_572_000 as Weight) + // Standard Error: 13_000 + .saturating_add((7_286_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64geu(r: u32, ) -> Weight { - (26_595_000 as Weight) - .saturating_add((7_330_000 as Weight).saturating_mul(r as Weight)) + (24_566_000 as Weight) + // Standard Error: 19_000 + .saturating_add((7_247_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64add(r: u32, ) -> Weight { - (26_568_000 as Weight) - .saturating_add((8_657_000 as Weight).saturating_mul(r as Weight)) + (24_581_000 as Weight) + // Standard Error: 18_000 + .saturating_add((7_190_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64sub(r: u32, ) -> Weight { - (27_393_000 as Weight) - .saturating_add((6_743_000 as Weight).saturating_mul(r as Weight)) + (24_565_000 as Weight) + // Standard Error: 10_000 + .saturating_add((7_242_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64mul(r: u32, ) -> Weight { - (26_571_000 as Weight) - .saturating_add((7_329_000 as Weight).saturating_mul(r as Weight)) + (24_542_000 as Weight) + // Standard Error: 11_000 + .saturating_add((7_216_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64divs(r: u32, ) -> Weight { - (26_585_000 as Weight) - .saturating_add((12_977_000 as Weight).saturating_mul(r as Weight)) + (24_608_000 as Weight) + // Standard Error: 16_000 + .saturating_add((12_966_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64divu(r: u32, ) -> Weight { - (26_554_000 as Weight) - .saturating_add((11_955_000 as Weight).saturating_mul(r as Weight)) + (24_564_000 as Weight) + // Standard Error: 1_424_000 + .saturating_add((13_665_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rems(r: u32, ) -> Weight { - (26_570_000 as Weight) - .saturating_add((12_903_000 as Weight).saturating_mul(r as Weight)) + (24_611_000 as Weight) + // Standard Error: 16_000 + .saturating_add((12_932_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64remu(r: u32, ) -> Weight { - (26_561_000 as Weight) - .saturating_add((12_112_000 as Weight).saturating_mul(r as Weight)) + (24_590_000 as Weight) + // Standard Error: 10_000 + .saturating_add((12_207_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64and(r: u32, ) -> Weight { - (26_587_000 as Weight) - .saturating_add((7_411_000 as Weight).saturating_mul(r as Weight)) + (24_622_000 as Weight) + // Standard Error: 15_000 + .saturating_add((7_172_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64or(r: u32, ) -> Weight { - (26_588_000 as Weight) - .saturating_add((7_479_000 as Weight).saturating_mul(r as Weight)) + (24_585_000 as Weight) + // Standard Error: 18_000 + .saturating_add((7_202_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64xor(r: u32, ) -> Weight { - (26_541_000 as Weight) - .saturating_add((7_386_000 as Weight).saturating_mul(r as Weight)) + (24_600_000 as Weight) + // Standard Error: 20_000 + .saturating_add((7_182_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shl(r: u32, ) -> Weight { - (26_562_000 as Weight) - .saturating_add((7_263_000 as Weight).saturating_mul(r as Weight)) + (24_621_000 as Weight) + // Standard Error: 11_000 + .saturating_add((7_226_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shrs(r: u32, ) -> Weight { - (26_569_000 as Weight) - .saturating_add((7_353_000 as Weight).saturating_mul(r as Weight)) + (24_643_000 as Weight) + // Standard Error: 22_000 + .saturating_add((7_254_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shru(r: u32, ) -> Weight { - (26_533_000 as Weight) - .saturating_add((7_342_000 as Weight).saturating_mul(r as Weight)) + (24_586_000 as Weight) + // Standard Error: 14_000 + .saturating_add((7_246_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rotl(r: u32, ) -> Weight { - (26_545_000 as Weight) - .saturating_add((7_362_000 as Weight).saturating_mul(r as Weight)) + (24_631_000 as Weight) + // Standard Error: 22_000 + .saturating_add((7_306_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rotr(r: u32, ) -> Weight { - (26_535_000 as Weight) - .saturating_add((7_330_000 as Weight).saturating_mul(r as Weight)) + (24_643_000 as Weight) + // Standard Error: 15_000 + .saturating_add((7_183_000 as Weight).saturating_mul(r as Weight)) } }