From 5966a01914fae3556638265f3a13f9560c3b382e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Tue, 7 Jan 2025 12:26:20 +0100 Subject: [PATCH 01/41] Include immutable deposit in base deposit --- .../create_storage_and_instantiate.rs | 13 +- .../contracts/locking_delegate_dependency.rs | 77 ---- .../fixtures/contracts/self_destruct.rs | 5 +- .../frame/revive/src/benchmarking/mod.rs | 54 +-- substrate/frame/revive/src/exec.rs | 289 ++++++-------- substrate/frame/revive/src/lib.rs | 11 +- substrate/frame/revive/src/limits.rs | 3 - substrate/frame/revive/src/storage.rs | 101 +---- substrate/frame/revive/src/storage/meter.rs | 55 +-- substrate/frame/revive/src/tests.rs | 362 +++++------------- substrate/frame/revive/src/wasm/mod.rs | 37 +- substrate/frame/revive/src/wasm/runtime.rs | 59 +-- substrate/frame/revive/src/weights.rs | 60 +-- substrate/frame/revive/uapi/src/host.rs | 23 -- .../frame/revive/uapi/src/host/riscv64.rs | 12 - 15 files changed, 318 insertions(+), 843 deletions(-) delete mode 100644 substrate/frame/revive/fixtures/contracts/locking_delegate_dependency.rs diff --git a/substrate/frame/revive/fixtures/contracts/create_storage_and_instantiate.rs b/substrate/frame/revive/fixtures/contracts/create_storage_and_instantiate.rs index f627bc8ba6c41..4b95ca5585395 100644 --- a/substrate/frame/revive/fixtures/contracts/create_storage_and_instantiate.rs +++ b/substrate/frame/revive/fixtures/contracts/create_storage_and_instantiate.rs @@ -20,7 +20,9 @@ #![no_main] use common::{input, u256_bytes}; -use uapi::{HostFn, HostFnImpl as api}; +use uapi::{HostFn, HostFnImpl as api, StorageFlags}; + +static BUFFER: [u8; 16 * 1024 + 1] = [0u8; 16 * 1024 + 1]; #[no_mangle] #[polkavm_derive::polkavm_export] @@ -30,11 +32,16 @@ pub extern "C" fn deploy() {} #[polkavm_derive::polkavm_export] pub extern "C" fn call() { input!( - input: [u8; 4], + len: u32, code_hash: &[u8; 32], deposit_limit: &[u8; 32], ); + let data = &BUFFER[..len as usize]; + let mut key = [0u8; 32]; + key[0] = 1; + api::set_storage(StorageFlags::empty(), &key, data); + let value = u256_bytes(10_000u64); let salt = [0u8; 32]; let mut address = [0u8; 20]; @@ -45,7 +52,7 @@ pub extern "C" fn call() { u64::MAX, // How much proof_size weight to devote for the execution. u64::MAX = use all. deposit_limit, &value, - input, + &len.to_le_bytes(), Some(&mut address), None, Some(&salt), diff --git a/substrate/frame/revive/fixtures/contracts/locking_delegate_dependency.rs b/substrate/frame/revive/fixtures/contracts/locking_delegate_dependency.rs deleted file mode 100644 index 6be5d5c72f9ac..0000000000000 --- a/substrate/frame/revive/fixtures/contracts/locking_delegate_dependency.rs +++ /dev/null @@ -1,77 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! This contract tests the behavior of locking / unlocking delegate_dependencies when delegate -//! calling into a contract. -#![no_std] -#![no_main] - -use common::input; -use uapi::{HostFn, HostFnImpl as api}; - -const ALICE_FALLBACK: [u8; 20] = [1u8; 20]; - -/// Load input data and perform the action specified by the input. -/// If `delegate_call` is true, then delegate call into the contract. -fn load_input(delegate_call: bool) { - input!( - action: u32, - address: &[u8; 20], - code_hash: &[u8; 32], - ); - - match action { - // 1 = Lock delegate dependency - 1 => { - api::lock_delegate_dependency(code_hash); - }, - // 2 = Unlock delegate dependency - 2 => { - api::unlock_delegate_dependency(code_hash); - }, - // 3 = Terminate - 3 => { - api::terminate(&ALICE_FALLBACK); - }, - // Everything else is a noop - _ => {}, - } - - if delegate_call { - api::delegate_call( - uapi::CallFlags::empty(), - address, - u64::MAX, - u64::MAX, - &[u8::MAX; 32], - &[], - None - ).unwrap(); - } -} - -#[no_mangle] -#[polkavm_derive::polkavm_export] -pub extern "C" fn deploy() { - load_input(false); -} - -#[no_mangle] -#[polkavm_derive::polkavm_export] -pub extern "C" fn call() { - load_input(true); -} diff --git a/substrate/frame/revive/fixtures/contracts/self_destruct.rs b/substrate/frame/revive/fixtures/contracts/self_destruct.rs index 053e545deb19e..eed7f40ddfed7 100644 --- a/substrate/frame/revive/fixtures/contracts/self_destruct.rs +++ b/substrate/frame/revive/fixtures/contracts/self_destruct.rs @@ -25,7 +25,10 @@ const DJANGO_FALLBACK: [u8; 20] = [4u8; 20]; #[no_mangle] #[polkavm_derive::polkavm_export] -pub extern "C" fn deploy() {} +pub extern "C" fn deploy() { + // make sure that the deposit for the immutable data is refunded + api::set_immutable_data(&[1, 2, 3, 4, 5]) +} #[no_mangle] #[polkavm_derive::polkavm_export] diff --git a/substrate/frame/revive/src/benchmarking/mod.rs b/substrate/frame/revive/src/benchmarking/mod.rs index 16bdd6d1a18a0..1f343926d5997 100644 --- a/substrate/frame/revive/src/benchmarking/mod.rs +++ b/substrate/frame/revive/src/benchmarking/mod.rs @@ -24,7 +24,7 @@ mod code; use self::{call_builder::CallSetup, code::WasmModule}; use crate::{ evm::runtime::GAS_PRICE, - exec::{Key, MomentOf}, + exec::{Ext, Key, MomentOf}, limits, storage::WriteOutcome, Pallet as Contracts, *, @@ -1011,24 +1011,11 @@ mod benchmarks { } #[benchmark(pov_mode = Measured)] - fn seal_terminate( - n: Linear<0, { limits::DELEGATE_DEPENDENCIES }>, - ) -> Result<(), BenchmarkError> { + fn seal_terminate() -> Result<(), BenchmarkError> { let beneficiary = account::("beneficiary", 0, 0); - let caller = whitelisted_caller(); - T::Currency::set_balance(&caller, caller_funding::()); - let origin = RawOrigin::Signed(caller); - let storage_deposit = default_deposit_limit::(); build_runtime!(runtime, memory: [beneficiary.encode(),]); - (0..n).for_each(|i| { - let new_code = WasmModule::dummy_unique(65 + i); - Contracts::::bare_upload_code(origin.clone().into(), new_code.code, storage_deposit) - .unwrap(); - runtime.ext().lock_delegate_dependency(new_code.hash).unwrap(); - }); - let result; #[block] { @@ -1930,43 +1917,6 @@ mod benchmarks { Ok(()) } - #[benchmark(pov_mode = Measured)] - fn lock_delegate_dependency() -> Result<(), BenchmarkError> { - let code_hash = Contract::::with_index(1, WasmModule::dummy_unique(1), vec![])? - .info()? - .code_hash; - - build_runtime!(runtime, memory: [ code_hash.encode(),]); - - let result; - #[block] - { - result = runtime.bench_lock_delegate_dependency(memory.as_mut_slice(), 0); - } - - assert_ok!(result); - Ok(()) - } - - #[benchmark] - fn unlock_delegate_dependency() -> Result<(), BenchmarkError> { - let code_hash = Contract::::with_index(1, WasmModule::dummy_unique(1), vec![])? - .info()? - .code_hash; - - build_runtime!(runtime, memory: [ code_hash.encode(),]); - runtime.bench_lock_delegate_dependency(memory.as_mut_slice(), 0).unwrap(); - - let result; - #[block] - { - result = runtime.bench_unlock_delegate_dependency(memory.as_mut_slice(), 0); - } - - assert_ok!(result); - Ok(()) - } - // Benchmark the execution of instructions. #[benchmark(pov_mode = Ignored)] fn instr(r: Linear<0, INSTR_BENCHMARK_RUNS>) { diff --git a/substrate/frame/revive/src/exec.rs b/substrate/frame/revive/src/exec.rs index d2ef6c9c7ba6c..e9fb02d2d764e 100644 --- a/substrate/frame/revive/src/exec.rs +++ b/substrate/frame/revive/src/exec.rs @@ -32,7 +32,6 @@ use core::{fmt::Debug, marker::PhantomData, mem}; use frame_support::{ crypto::ecdsa::ECDSAExt, dispatch::{DispatchResult, DispatchResultWithPostInfo}, - ensure, storage::{with_transaction, TransactionOutcome}, traits::{ fungible::{Inspect, Mutate}, @@ -49,7 +48,7 @@ use frame_system::{ use sp_core::{ ecdsa::Public as ECDSAPublic, sr25519::{Public as SR25519Public, Signature as SR25519Signature}, - ConstU32, Get, H160, H256, U256, + ConstU32, H160, H256, U256, }; use sp_io::{crypto::secp256k1_ecdsa_recover_compressed, hashing::blake2_256}; use sp_runtime::{ @@ -323,6 +322,12 @@ pub trait Ext: sealing::Sealed { ::AddressMapper::to_address(self.account_id()) } + /// Get the length of the immutable data. + /// + /// This query is free as it does not need to load the immutable data from storage. + /// Useful when we need a constant time lookup of the length. + fn immutable_data_len(&mut self) -> u32; + /// Returns the immutable data of the current contract. /// /// Returns `Err(InvalidImmutableAccess)` if called from a constructor. @@ -406,51 +411,6 @@ pub trait Ext: sealing::Sealed { /// Sets new code hash and immutable data for an existing contract. fn set_code_hash(&mut self, hash: H256) -> DispatchResult; - /// Returns the number of times the specified contract exists on the call stack. Delegated calls - /// Increment the reference count of a of a stored code by one. - /// - /// # Errors - /// - /// [`Error::CodeNotFound`] is returned if no stored code found having the specified - /// `code_hash`. - fn increment_refcount(code_hash: H256) -> DispatchResult; - - /// Decrement the reference count of a stored code by one. - /// - /// # Note - /// - /// A contract whose reference count dropped to zero isn't automatically removed. A - /// `remove_code` transaction must be submitted by the original uploader to do so. - fn decrement_refcount(code_hash: H256); - - /// Adds a delegate dependency to [`ContractInfo`]'s `delegate_dependencies` field. - /// - /// This ensures that the delegated contract is not removed while it is still in use. It - /// increases the reference count of the code hash and charges a fraction (see - /// [`Config::CodeHashLockupDepositPercent`]) of the code deposit. - /// - /// # Errors - /// - /// - [`Error::MaxDelegateDependenciesReached`] - /// - [`Error::CannotAddSelfAsDelegateDependency`] - /// - [`Error::DelegateDependencyAlreadyExists`] - fn lock_delegate_dependency(&mut self, code_hash: H256) -> DispatchResult; - - /// Removes a delegate dependency from [`ContractInfo`]'s `delegate_dependencies` field. - /// - /// This is the counterpart of [`Self::lock_delegate_dependency`]. It decreases the reference - /// count and refunds the deposit that was charged by [`Self::lock_delegate_dependency`]. - /// - /// # Errors - /// - /// - [`Error::DelegateDependencyNotFound`] - fn unlock_delegate_dependency(&mut self, code_hash: &H256) -> DispatchResult; - - /// Returns the number of locked delegate dependencies. - /// - /// Note: Requires &mut self to access the contract info. - fn locked_delegate_dependencies_count(&mut self) -> usize; - /// Check if running in read-only context. fn is_read_only(&self) -> bool; @@ -1061,23 +1021,33 @@ where let value_transferred = frame.value_transferred; let account_id = &frame.account_id.clone(); - // We need to charge the storage deposit before the initial transfer so that - // it can create the account in case the initial transfer is < ed. + // We need to make sure that the contract's account exists before calling its + // constructor. if entry_point == ExportedFunction::Constructor { // Root origin can't be used to instantiate a contract, so it is safe to assume that // if we reached this point the origin has an associated account. let origin = &self.origin.account_id()?; - frame.nested_storage.charge_instantiate( - origin, - &account_id, - frame.contract_info.get(&account_id), - executable.code_info(), - self.skip_transfer, - )?; + let ed = >::min_balance(); + frame.nested_storage.record_charge(&StorageDeposit::Charge(ed)); + if self.skip_transfer { + T::Currency::set_balance(account_id, ed); + } else { + T::Currency::transfer(origin, account_id, ed, Preservation::Preserve)?; + } + + // A consumer is added at account creation and removed it on termination, otherwise + // the runtime could remove the account. As long as a contract exists its + // account must exist. With the consumer, a correct runtime cannot remove the + // account. + >::inc_consumers(&frame.account_id)?; + // Needs to be incremented before calling into the code so that it is visible // in case of recursion. >::inc_account_nonce(caller.account_id()?); + + // The incremented refcount should be visible to the constructor. + >::increment_refcount(*executable.code_hash())?; } // Every non delegate call or instantiate also optionally transfers the balance. @@ -1094,6 +1064,7 @@ where let contract_address = T::AddressMapper::to_address(account_id); let maybe_caller_address = caller.account_id().map(T::AddressMapper::to_address); + let code_deposit = executable.code_info().deposit(); if_tracing(|tracer| { tracer.enter_child_span( @@ -1128,6 +1099,15 @@ where let frame = self.top_frame_mut(); + // The deposit we charge for a contract depends on the size of the immutable data. + // Hence we need to delay charging the base deposit after execution. + if entry_point == ExportedFunction::Constructor { + let deposit = frame.contract_info().update_base_deposit(code_deposit); + frame + .nested_storage + .charge_deposit(frame.account_id.clone(), StorageDeposit::Charge(deposit)); + } + // The storage deposit is only charged at the end of every call stack. // To make sure that no sub call uses more than it is allowed to, // the limit is manually enforced here. @@ -1137,13 +1117,6 @@ where .enforce_limit(contract) .map_err(|e| ExecError { error: e, origin: ErrorOrigin::Callee })?; - // It is not allowed to terminate a contract inside its constructor. - if entry_point == ExportedFunction::Constructor && - matches!(frame.contract_info, CachedContract::Terminated) - { - return Err(Error::::TerminatedInConstructor.into()); - } - Ok(output) }; @@ -1531,6 +1504,9 @@ where return Err(Error::::TerminatedWhileReentrant.into()); } let frame = self.top_frame_mut(); + if frame.entry_point == ExportedFunction::Constructor { + return Err(Error::::TerminatedInConstructor.into()); + } let info = frame.terminate(); let beneficiary_account = T::AddressMapper::to_account_id(beneficiary); frame.nested_storage.terminate(&info, beneficiary_account); @@ -1539,14 +1515,7 @@ where let account_address = T::AddressMapper::to_address(&frame.account_id); ContractInfoOf::::remove(&account_address); ImmutableDataOf::::remove(&account_address); - Self::decrement_refcount(info.code_hash); - - for (code_hash, deposit) in info.delegate_dependencies() { - Self::decrement_refcount(*code_hash); - frame - .nested_storage - .charge_deposit(frame.account_id.clone(), StorageDeposit::Refund(*deposit)); - } + >::decrement_refcount(info.code_hash); Ok(()) } @@ -1652,6 +1621,10 @@ where self.caller_is_origin() && self.origin == Origin::Root } + fn immutable_data_len(&mut self) -> u32 { + self.top_frame_mut().contract_info().immutable_data_len() + } + fn get_immutable_data(&mut self) -> Result { if self.top_frame().entry_point == ExportedFunction::Constructor { return Err(Error::::InvalidImmutableAccess.into()); @@ -1668,17 +1641,12 @@ where } fn set_immutable_data(&mut self, data: ImmutableData) -> Result<(), DispatchError> { - if self.top_frame().entry_point == ExportedFunction::Call { + let frame = self.top_frame_mut(); + if frame.entry_point == ExportedFunction::Call || data.is_empty() { return Err(Error::::InvalidImmutableAccess.into()); } - - let account_id = self.account_id().clone(); - let len = data.len() as u32; - let amount = self.top_frame_mut().contract_info().set_immutable_data_len(len)?; - self.top_frame_mut().nested_storage.charge_deposit(account_id.clone(), amount); - - >::insert(T::AddressMapper::to_address(&account_id), &data); - + frame.contract_info().set_immutable_data_len(data.len() as u32); + >::insert(T::AddressMapper::to_address(&frame.account_id), &data); Ok(()) } @@ -1796,68 +1764,17 @@ where let code_info = CodeInfoOf::::get(hash).ok_or(Error::::CodeNotFound)?; let old_base_deposit = info.storage_base_deposit(); - let new_base_deposit = info.update_base_deposit(&code_info); + let new_base_deposit = info.update_base_deposit(code_info.deposit()); let deposit = StorageDeposit::Charge(new_base_deposit) .saturating_sub(&StorageDeposit::Charge(old_base_deposit)); frame.nested_storage.charge_deposit(frame.account_id.clone(), deposit); - Self::increment_refcount(hash)?; - Self::decrement_refcount(prev_hash); - Ok(()) - } - - fn increment_refcount(code_hash: H256) -> DispatchResult { - >::mutate(code_hash, |existing| -> Result<(), DispatchError> { - if let Some(info) = existing { - *info.refcount_mut() = info.refcount().saturating_add(1); - Ok(()) - } else { - Err(Error::::CodeNotFound.into()) - } - }) - } - - fn decrement_refcount(code_hash: H256) { - >::mutate(code_hash, |existing| { - if let Some(info) = existing { - *info.refcount_mut() = info.refcount().saturating_sub(1); - } - }); - } - - fn lock_delegate_dependency(&mut self, code_hash: H256) -> DispatchResult { - let frame = self.top_frame_mut(); - let info = frame.contract_info.get(&frame.account_id); - ensure!(code_hash != info.code_hash, Error::::CannotAddSelfAsDelegateDependency); - - let code_info = CodeInfoOf::::get(code_hash).ok_or(Error::::CodeNotFound)?; - let deposit = T::CodeHashLockupDepositPercent::get().mul_ceil(code_info.deposit()); - - info.lock_delegate_dependency(code_hash, deposit)?; - Self::increment_refcount(code_hash)?; - frame - .nested_storage - .charge_deposit(frame.account_id.clone(), StorageDeposit::Charge(deposit)); + >::increment_refcount(hash)?; + >::decrement_refcount(prev_hash); Ok(()) } - fn unlock_delegate_dependency(&mut self, code_hash: &H256) -> DispatchResult { - let frame = self.top_frame_mut(); - let info = frame.contract_info.get(&frame.account_id); - - let deposit = info.unlock_delegate_dependency(code_hash)?; - Self::decrement_refcount(*code_hash); - frame - .nested_storage - .charge_deposit(frame.account_id.clone(), StorageDeposit::Refund(deposit)); - Ok(()) - } - - fn locked_delegate_dependencies_count(&mut self) -> usize { - self.top_frame_mut().contract_info().delegate_dependencies_count() - } - fn is_read_only(&self) -> bool { self.top_frame().read_only } @@ -1932,7 +1849,7 @@ mod tests { #[derive(Clone)] struct MockExecutable { func: Rc Fn(MockCtx<'a>, &Self) -> ExecResult + 'static>, - func_type: ExportedFunction, + constructor: Rc Fn(MockCtx<'a>, &Self) -> ExecResult + 'static>, code_hash: H256, code_info: CodeInfo, } @@ -1951,6 +1868,39 @@ mod tests { fn insert( func_type: ExportedFunction, f: impl Fn(MockCtx, &MockExecutable) -> ExecResult + 'static, + ) -> H256 { + Loader::mutate(|loader| { + // Generate code hashes from contract index value. + let hash = H256(keccak_256(&loader.counter.to_le_bytes())); + loader.counter += 1; + if func_type == ExportedFunction::Constructor { + loader.map.insert( + hash, + MockExecutable { + func: Rc::new(|_, _| exec_success()), + constructor: Rc::new(f), + code_hash: hash, + code_info: CodeInfo::::new(ALICE), + }, + ); + } else { + loader.map.insert( + hash, + MockExecutable { + func: Rc::new(f), + constructor: Rc::new(|_, _| exec_success()), + code_hash: hash, + code_info: CodeInfo::::new(ALICE), + }, + ); + } + hash + }) + } + + fn insert_both( + constructor: impl Fn(MockCtx, &MockExecutable) -> ExecResult + 'static, + call: impl Fn(MockCtx, &MockExecutable) -> ExecResult + 'static, ) -> H256 { Loader::mutate(|loader| { // Generate code hashes from contract index value. @@ -1959,8 +1909,8 @@ mod tests { loader.map.insert( hash, MockExecutable { - func: Rc::new(f), - func_type, + func: Rc::new(call), + constructor: Rc::new(constructor), code_hash: hash, code_info: CodeInfo::::new(ALICE), }, @@ -1986,9 +1936,6 @@ mod tests { function: ExportedFunction, input_data: Vec, ) -> ExecResult { - if let Constructor = function { - E::increment_refcount(self.code_hash).unwrap(); - } // # Safety // // We know that we **always** call execute with a `MockStack` in this test. @@ -1999,10 +1946,10 @@ mod tests { // `E: Ext`. However, `MockExecutable` can't be generic over `E` as it would // constitute a cycle. let ext = unsafe { mem::transmute(ext) }; - if function == self.func_type { - (self.func)(MockCtx { ext, input_data }, &self) + if function == ExportedFunction::Constructor { + (self.constructor)(MockCtx { ext, input_data }, &self) } else { - exec_success() + (self.func)(MockCtx { ext, input_data }, &self) } } @@ -3156,7 +3103,7 @@ mod tests { #[test] fn termination_from_instantiate_fails() { let terminate_ch = MockLoader::insert(Constructor, |ctx, _| { - ctx.ext.terminate(&ALICE_ADDR).unwrap(); + ctx.ext.terminate(&ALICE_ADDR)?; exec_success() }); @@ -3184,7 +3131,10 @@ mod tests { Some(&[0; 32]), false, ), - Err(Error::::TerminatedInConstructor.into()) + Err(ExecError { + error: Error::::TerminatedInConstructor.into(), + origin: ErrorOrigin::Callee + }) ); assert_eq!(&events(), &[]); @@ -4696,41 +4646,46 @@ mod tests { } #[test] - fn immutable_data_set_works_only_once() { - let dummy_ch = MockLoader::insert(Constructor, move |ctx, _| { - // Calling `set_immutable_data` the first time should work - assert_ok!(ctx.ext.set_immutable_data(vec![0, 1, 2, 3].try_into().unwrap())); - // Calling `set_immutable_data` the second time should error out - assert_eq!( - ctx.ext.set_immutable_data(vec![0, 1, 2, 3].try_into().unwrap()), - Err(Error::::InvalidImmutableAccess.into()) - ); - exec_success() - }); - let instantiator_ch = MockLoader::insert(Call, { + fn immutable_data_set_overrides() { + let hash = MockLoader::insert_both( move |ctx, _| { - let value = ::Currency::minimum_balance().into(); - ctx.ext - .instantiate(Weight::MAX, U256::MAX, dummy_ch, value, vec![], None) - .unwrap(); - + // Calling `set_immutable_data` the first time should work + assert_ok!(ctx.ext.set_immutable_data(vec![0, 1, 2, 3].try_into().unwrap())); + // Calling `set_immutable_data` the second time overrides the original one + assert_ok!(ctx.ext.set_immutable_data(vec![7, 5].try_into().unwrap())); exec_success() - } - }); + }, + move |ctx, _| { + assert_eq!(ctx.ext.get_immutable_data().unwrap().into_inner(), vec![7, 5]); + exec_success() + }, + ); ExtBuilder::default() .with_code_hashes(MockLoader::code_hashes()) .existential_deposit(15) .build() .execute_with(|| { set_balance(&ALICE, 1000); - set_balance(&BOB, 100); - place_contract(&BOB, instantiator_ch); let origin = Origin::from_account_id(ALICE); let mut storage_meter = storage::meter::Meter::new(&origin, 200, 0).unwrap(); + let mut gas_meter = GasMeter::::new(GAS_LIMIT); + + let addr = MockStack::run_instantiate( + ALICE, + MockExecutable::from_storage(hash, &mut gas_meter).unwrap(), + &mut gas_meter, + &mut storage_meter, + U256::zero(), + vec![], + None, + false, + ) + .unwrap() + .0; MockStack::run_call( origin, - BOB_ADDR, + addr, &mut GasMeter::::new(GAS_LIMIT), &mut storage_meter, U256::zero(), diff --git a/substrate/frame/revive/src/lib.rs b/substrate/frame/revive/src/lib.rs index c36cb3f47caed..ff7cc02044737 100644 --- a/substrate/frame/revive/src/lib.rs +++ b/substrate/frame/revive/src/lib.rs @@ -45,7 +45,7 @@ use crate::{ runtime::{gas_from_fee, GAS_PRICE}, GasEncoder, GenericTransaction, }, - exec::{AccountIdOf, ExecError, Executable, Ext, Key, Stack as ExecStack}, + exec::{AccountIdOf, ExecError, Executable, Key, Stack as ExecStack}, gas::GasMeter, storage::{meter::Meter as StorageMeter, ContractInfo, DeletionQueueManager}, wasm::{CodeInfo, RuntimeCosts, WasmBlob}, @@ -211,9 +211,8 @@ pub mod pallet { type DepositPerItem: Get>; /// The percentage of the storage deposit that should be held for using a code hash. - /// Instantiating a contract, or calling [`chain_extension::Ext::lock_delegate_dependency`] - /// protects the code from being removed. In order to prevent abuse these actions are - /// protected with a percentage of the code deposit. + /// Instantiating a contract, protects the code from being removed. In order to prevent + /// abuse these actions are protected with a percentage of the code deposit. #[pallet::constant] type CodeHashLockupDepositPercent: Get; @@ -907,8 +906,8 @@ pub mod pallet { } else { return Err(>::ContractNotFound.into()); }; - >>::increment_refcount(code_hash)?; - >>::decrement_refcount(contract.code_hash); + >::increment_refcount(code_hash)?; + >::decrement_refcount(contract.code_hash); contract.code_hash = code_hash; Ok(()) }) diff --git a/substrate/frame/revive/src/limits.rs b/substrate/frame/revive/src/limits.rs index f101abf0ea7e9..355d9b6616e00 100644 --- a/substrate/frame/revive/src/limits.rs +++ b/substrate/frame/revive/src/limits.rs @@ -43,9 +43,6 @@ pub const CALL_STACK_DEPTH: u32 = 5; /// We set it to the same limit that ethereum has. It is unlikely to change. pub const NUM_EVENT_TOPICS: u32 = 4; -/// The maximum number of code hashes a contract can lock. -pub const DELEGATE_DEPENDENCIES: u32 = 32; - /// Maximum size of events (including topics) and storage values. pub const PAYLOAD_BYTES: u32 = 448; diff --git a/substrate/frame/revive/src/storage.rs b/substrate/frame/revive/src/storage.rs index b7156588d44c6..a761223aadfdd 100644 --- a/substrate/frame/revive/src/storage.rs +++ b/substrate/frame/revive/src/storage.rs @@ -22,11 +22,10 @@ pub mod meter; use crate::{ address::AddressMapper, exec::{AccountIdOf, Key}, - limits, storage::meter::Diff, weights::WeightInfo, - BalanceOf, CodeInfo, Config, ContractInfoOf, DeletionQueue, DeletionQueueCounter, Error, - StorageDeposit, TrieId, SENTINEL, + BalanceOf, Config, ContractInfoOf, DeletionQueue, DeletionQueueCounter, Error, TrieId, + SENTINEL, }; use alloc::vec::Vec; use codec::{Decode, Encode, MaxEncodedLen}; @@ -36,18 +35,14 @@ use frame_support::{ weights::{Weight, WeightMeter}, CloneNoBound, DefaultNoBound, }; -use meter::DepositOf; use scale_info::TypeInfo; -use sp_core::{ConstU32, Get, H160}; +use sp_core::{Get, H160}; use sp_io::KillStorageResult; use sp_runtime::{ traits::{Hash, Saturating, Zero}, - BoundedBTreeMap, DispatchError, DispatchResult, RuntimeDebug, + DispatchError, RuntimeDebug, }; -type DelegateDependencyMap = - BoundedBTreeMap, ConstU32<{ limits::DELEGATE_DEPENDENCIES }>>; - /// Information for managing an account and its sub trie abstraction. /// This is the required info to cache for an account. #[derive(Encode, Decode, CloneNoBound, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] @@ -70,12 +65,6 @@ pub struct ContractInfo { /// We need to store this information separately so it is not used when calculating any refunds /// since the base deposit can only ever be refunded on contract termination. storage_base_deposit: BalanceOf, - /// Map of code hashes and deposit balances. - /// - /// Tracks the code hash and deposit held for locking delegate dependencies. Dependencies added - /// to the map can not be removed from the chain state and can be safely used for delegate - /// calls. - delegate_dependencies: DelegateDependencyMap, /// The size of the immutable data of this contract. immutable_data_len: u32, } @@ -110,18 +99,12 @@ impl ContractInfo { storage_byte_deposit: Zero::zero(), storage_item_deposit: Zero::zero(), storage_base_deposit: Zero::zero(), - delegate_dependencies: Default::default(), immutable_data_len: 0, }; Ok(contract) } - /// Returns the number of locked delegate dependencies. - pub fn delegate_dependencies_count(&self) -> usize { - self.delegate_dependencies.len() - } - /// Associated child trie unique id is built from the hash part of the trie id. pub fn child_trie_info(&self) -> ChildInfo { ChildInfo::new_default(self.trie_id.as_ref()) @@ -240,58 +223,27 @@ impl ContractInfo { /// Sets and returns the contract base deposit. /// /// The base deposit is updated when the `code_hash` of the contract changes, as it depends on - /// the deposit paid to upload the contract's code. - pub fn update_base_deposit(&mut self, code_info: &CodeInfo) -> BalanceOf { - let info_deposit = - Diff { bytes_added: self.encoded_size() as u32, items_added: 1, ..Default::default() } - .update_contract::(None) - .charge_or_zero(); + /// the deposit paid to upload the contract's code. It also depends on the size of immutable + /// storage which is also changed when the code hash of a contract is changed. + pub fn update_base_deposit(&mut self, code_deposit: BalanceOf) -> BalanceOf { + let contract_deposit = Diff { + bytes_added: (self.encoded_size() as u32).saturating_add(self.immutable_data_len), + items_added: if self.immutable_data_len == 0 { 1 } else { 2 }, + ..Default::default() + } + .update_contract::(None) + .charge_or_zero(); // Instantiating the contract prevents its code to be deleted, therefore the base deposit // includes a fraction (`T::CodeHashLockupDepositPercent`) of the original storage deposit // to prevent abuse. - let upload_deposit = T::CodeHashLockupDepositPercent::get().mul_ceil(code_info.deposit()); + let code_deposit = T::CodeHashLockupDepositPercent::get().mul_ceil(code_deposit); - let deposit = info_deposit.saturating_add(upload_deposit); + let deposit = contract_deposit.saturating_add(code_deposit); self.storage_base_deposit = deposit; deposit } - /// Adds a new delegate dependency to the contract. - /// The `amount` is the amount of funds that will be reserved for the dependency. - /// - /// Returns an error if the maximum number of delegate_dependencies is reached or if - /// the delegate dependency already exists. - pub fn lock_delegate_dependency( - &mut self, - code_hash: sp_core::H256, - amount: BalanceOf, - ) -> DispatchResult { - self.delegate_dependencies - .try_insert(code_hash, amount) - .map_err(|_| Error::::MaxDelegateDependenciesReached)? - .map_or(Ok(()), |_| Err(Error::::DelegateDependencyAlreadyExists)) - .map_err(Into::into) - } - - /// Removes the delegate dependency from the contract and returns the deposit held for this - /// dependency. - /// - /// Returns an error if the entry doesn't exist. - pub fn unlock_delegate_dependency( - &mut self, - code_hash: &sp_core::H256, - ) -> Result, DispatchError> { - self.delegate_dependencies - .remove(code_hash) - .ok_or(Error::::DelegateDependencyNotFound.into()) - } - - /// Returns the delegate_dependencies of the contract. - pub fn delegate_dependencies(&self) -> &DelegateDependencyMap { - &self.delegate_dependencies - } - /// Push a contract's trie to the deletion queue for lazy removal. /// /// You must make sure that the contract is also removed when queuing the trie for deletion. @@ -367,27 +319,8 @@ impl ContractInfo { } /// Set the number of immutable bytes of this contract. - /// - /// On success, returns the storage deposit to be charged. - /// - /// Returns `Err(InvalidImmutableAccess)` if: - /// - The immutable bytes of this contract are not 0. This indicates that the immutable data - /// have already been set; it is only valid to set the immutable data exactly once. - /// - The provided `immutable_data_len` value was 0; it is invalid to set empty immutable data. - pub fn set_immutable_data_len( - &mut self, - immutable_data_len: u32, - ) -> Result, DispatchError> { - if self.immutable_data_len != 0 || immutable_data_len == 0 { - return Err(Error::::InvalidImmutableAccess.into()); - } - + pub fn set_immutable_data_len(&mut self, immutable_data_len: u32) { self.immutable_data_len = immutable_data_len; - - let amount = T::DepositPerByte::get() - .saturating_mul(immutable_data_len.into()) - .saturating_add(T::DepositPerItem::get()); - Ok(StorageDeposit::Charge(amount)) } } diff --git a/substrate/frame/revive/src/storage/meter.rs b/substrate/frame/revive/src/storage/meter.rs index cd390c86f63ae..b1bd102dc2322 100644 --- a/substrate/frame/revive/src/storage/meter.rs +++ b/substrate/frame/revive/src/storage/meter.rs @@ -18,8 +18,8 @@ //! This module contains functions to meter the storage deposit. use crate::{ - storage::ContractInfo, AccountIdOf, BalanceOf, CodeInfo, Config, Error, HoldReason, Inspect, - Origin, Pallet, StorageDeposit as Deposit, System, LOG_TARGET, + storage::ContractInfo, AccountIdOf, BalanceOf, Config, Error, HoldReason, Inspect, Origin, + StorageDeposit as Deposit, System, LOG_TARGET, }; use alloc::vec::Vec; use core::{fmt::Debug, marker::PhantomData}; @@ -404,49 +404,26 @@ impl> RawMeter { }; } - /// Adds a deposit charge. + /// Adds a charge without recording it in the contract info. /// /// Use this method instead of [`Self::charge`] when the charge is not the result of a storage - /// change. This is the case when a `delegate_dependency` is added or removed, or when the - /// `code_hash` is updated. [`Self::charge`] cannot be used here because we keep track of the - /// deposit charge separately from the storage charge. + /// change within the contract's child trie. This is the case when when the `code_hash` is + /// updated. [`Self::charge`] cannot be used here because we keep track of the deposit charge + /// separately from the storage charge. + /// + /// If this functions is used the amount of the charge has to be stored by the caller somewhere + /// alese in order to be able to refund it. pub fn charge_deposit(&mut self, contract: T::AccountId, amount: DepositOf) { - self.total_deposit = self.total_deposit.saturating_add(&amount); + self.record_charge(&amount); self.charges.push(Charge { contract, amount, state: ContractState::Alive }); } - /// Charges from `origin` a storage deposit for contract instantiation. + /// Record a charge that has taken place externally. /// - /// This immediately transfers the balance in order to create the account. - pub fn charge_instantiate( - &mut self, - origin: &T::AccountId, - contract: &T::AccountId, - contract_info: &mut ContractInfo, - code_info: &CodeInfo, - skip_transfer: bool, - ) -> Result<(), DispatchError> { - debug_assert!(matches!(self.contract_state(), ContractState::Alive)); - - // We need to make sure that the contract's account exists. - let ed = Pallet::::min_balance(); - self.total_deposit = Deposit::Charge(ed); - if skip_transfer { - T::Currency::set_balance(contract, ed); - } else { - T::Currency::transfer(origin, contract, ed, Preservation::Preserve)?; - } - - // A consumer is added at account creation and removed it on termination, otherwise the - // runtime could remove the account. As long as a contract exists its account must exist. - // With the consumer, a correct runtime cannot remove the account. - System::::inc_consumers(contract)?; - - let deposit = contract_info.update_base_deposit(&code_info); - let deposit = Deposit::Charge(deposit); - - self.charge_deposit(contract.clone(), deposit); - Ok(()) + /// This will not perform a charge. It just records it to reflect it in the + /// total amount of storage required for a transaction. + pub fn record_charge(&mut self, amount: &DepositOf) { + self.total_deposit = self.total_deposit.saturating_add(&amount); } /// Call to tell the meter that the currently executing contract was terminated. @@ -475,6 +452,7 @@ impl> RawMeter { self.own_contribution = Contribution::Checked(deposit); } if let Deposit::Charge(amount) = total_deposit { + println!("Enforcing {:?} < {:?}", amount, self.limit); if amount > self.limit { log::debug!( target: LOG_TARGET, "Storage deposit limit exhausted: {:?} > {:?}", amount, self.limit); return Err(>::StorageDepositLimitExhausted.into()) @@ -660,7 +638,6 @@ mod tests { storage_byte_deposit: info.bytes_deposit, storage_item_deposit: info.items_deposit, storage_base_deposit: Default::default(), - delegate_dependencies: Default::default(), immutable_data_len: info.immutable_data_len, } } diff --git a/substrate/frame/revive/src/tests.rs b/substrate/frame/revive/src/tests.rs index 90b9f053a03fb..f5bf0709f3338 100644 --- a/substrate/frame/revive/src/tests.rs +++ b/substrate/frame/revive/src/tests.rs @@ -28,7 +28,6 @@ use crate::{ evm::{runtime::GAS_PRICE, CallTrace, CallTracer, CallType, GenericTransaction}, exec::Key, limits, - primitives::CodeUploadReturnValue, storage::DeletionQueueManager, test_utils::*, tests::test_utils::{get_contract, get_contract_checked}, @@ -57,7 +56,7 @@ use frame_support::{ weights::{constants::WEIGHT_REF_TIME_PER_SECOND, FixedFee, IdentityFee, Weight, WeightMeter}, }; use frame_system::{EventRecord, Phase}; -use pallet_revive_fixtures::{bench::dummy_unique, compile_module}; +use pallet_revive_fixtures::compile_module; use pallet_revive_uapi::ReturnErrorCode as RuntimeReturnCode; use pallet_transaction_payment::{ConstFeeMultiplier, Multiplier}; use pretty_assertions::{assert_eq, assert_ne}; @@ -100,7 +99,7 @@ macro_rules! assert_refcount { } pub mod test_utils { - use super::{Contracts, DepositPerByte, DepositPerItem, Test}; + use super::{CodeHashLockupDepositPercent, Contracts, DepositPerByte, DepositPerItem, Test}; use crate::{ address::AddressMapper, exec::AccountIdOf, BalanceOf, CodeInfo, CodeInfoOf, Config, ContractInfo, ContractInfoOf, PristineCode, @@ -138,20 +137,26 @@ pub mod test_utils { pub fn get_code_deposit(code_hash: &sp_core::H256) -> BalanceOf { crate::CodeInfoOf::::get(code_hash).unwrap().deposit() } - pub fn contract_info_storage_deposit(addr: &H160) -> BalanceOf { + pub fn lockup_deposit(code_hash: &sp_core::H256) -> BalanceOf { + CodeHashLockupDepositPercent::get().mul_ceil(get_code_deposit(code_hash)).into() + } + pub fn contract_base_deposit(addr: &H160) -> BalanceOf { let contract_info = self::get_contract(&addr); let info_size = contract_info.encoded_size() as u64; - let info_deposit = DepositPerByte::get() + let code_deposit = CodeHashLockupDepositPercent::get() + .mul_ceil(get_code_deposit(&contract_info.code_hash)); + let deposit = DepositPerByte::get() .saturating_mul(info_size) - .saturating_add(DepositPerItem::get()); + .saturating_add(DepositPerItem::get()) + .saturating_add(code_deposit); let immutable_size = contract_info.immutable_data_len() as u64; if immutable_size > 0 { let immutable_deposit = DepositPerByte::get() .saturating_mul(immutable_size) .saturating_add(DepositPerItem::get()); - info_deposit.saturating_add(immutable_deposit) + deposit.saturating_add(immutable_deposit) } else { - info_deposit + deposit } } pub fn expected_deposit(code_len: usize) -> u64 { @@ -435,7 +440,7 @@ impl pallet_dummy::Config for Test {} parameter_types! { pub static DepositPerByte: BalanceOf = 1; pub const DepositPerItem: BalanceOf = 2; - pub static CodeHashLockupDepositPercent: Perbill = Perbill::from_percent(0); + pub const CodeHashLockupDepositPercent: Perbill = Perbill::from_percent(30); pub static ChainId: u64 = 448; } @@ -1187,7 +1192,7 @@ fn transfer_expendable_cannot_kill_account() { assert_eq!( test_utils::get_balance_on_hold(&HoldReason::StorageDepositReserve.into(), &account), - test_utils::contract_info_storage_deposit(&addr) + test_utils::contract_base_deposit(&addr) ); // Some or the total balance is held, so it can't be transferred. @@ -1229,7 +1234,7 @@ fn cannot_self_destruct_through_draining() { // Make sure the account wasn't remove by sending all free balance away. assert_eq!( ::Currency::total_balance(&account), - value + test_utils::contract_info_storage_deposit(&addr) + min_balance, + value + test_utils::contract_base_deposit(&addr) + min_balance, ); }); } @@ -1243,7 +1248,7 @@ fn cannot_self_destruct_through_storage_refund_after_price_change() { // Instantiate the BOB contract. let contract = builder::bare_instantiate(Code::Upload(wasm)).build_and_unwrap_contract(); - let info_deposit = test_utils::contract_info_storage_deposit(&contract.addr); + let info_deposit = test_utils::contract_base_deposit(&contract.addr); // Check that the contract has been instantiated and has the minimum balance assert_eq!(get_contract(&contract.addr).total_deposit(), info_deposit); @@ -2572,7 +2577,7 @@ fn instantiate_with_zero_balance_works() { assert_eq!(::Currency::free_balance(&account_id), min_balance); assert_eq!( ::Currency::total_balance(&account_id), - min_balance + test_utils::contract_info_storage_deposit(&addr) + min_balance + test_utils::contract_base_deposit(&addr) ); assert_eq!( @@ -2629,7 +2634,7 @@ fn instantiate_with_below_existential_deposit_works() { assert_eq!(::Currency::free_balance(&account_id), min_balance + value); assert_eq!( ::Currency::total_balance(&account_id), - min_balance + value + test_utils::contract_info_storage_deposit(&addr) + min_balance + value + test_utils::contract_base_deposit(&addr) ); assert_eq!( @@ -2682,7 +2687,7 @@ fn storage_deposit_works() { let Contract { addr, account_id } = builder::bare_instantiate(Code::Upload(wasm)).build_and_unwrap_contract(); - let mut deposit = test_utils::contract_info_storage_deposit(&addr); + let mut deposit = test_utils::contract_base_deposit(&addr); // Drop previous events initialize_block(2); @@ -2744,7 +2749,7 @@ fn storage_deposit_callee_works() { assert_eq!(test_utils::get_balance(&account_id), min_balance); assert_eq!( callee.total_deposit(), - deposit + test_utils::contract_info_storage_deposit(&addr_callee) + deposit + test_utils::contract_base_deposit(&addr_callee) ); }); } @@ -2828,7 +2833,7 @@ fn slash_cannot_kill_account() { // Drop previous events initialize_block(2); - let info_deposit = test_utils::contract_info_storage_deposit(&addr); + let info_deposit = test_utils::contract_base_deposit(&addr); assert_eq!( test_utils::get_balance_on_hold(&HoldReason::StorageDepositReserve.into(), &account_id), @@ -2967,7 +2972,7 @@ fn storage_deposit_limit_is_enforced() { let Contract { addr, account_id } = builder::bare_instantiate(Code::Upload(wasm)).build_and_unwrap_contract(); - let info_deposit = test_utils::contract_info_storage_deposit(&addr); + let info_deposit = test_utils::contract_base_deposit(&addr); // Check that the BOB contract has been instantiated and has the minimum balance assert_eq!(get_contract(&addr).total_deposit(), info_deposit); assert_eq!( @@ -3113,73 +3118,82 @@ fn deposit_limit_in_nested_instantiate() { .data(vec![0, 0, 0, 0]) .build_and_unwrap_contract(); - let callee_info_len = ContractInfoOf::::get(&addr).unwrap().encoded_size() as u64; - - // We don't set a special deposit limit for the nested instantiation. + // This is the deposit we expect to be charged just for instantiatiting the callee. // - // The deposit limit set for the parent is insufficient for the instantiation, which - // requires: - // - callee_info_len + 2 for storing the new contract info, - // - ED for deployed contract account, + // - callee_info_len + 2 for storing the new contract info + // - the deposit for depending on a code hash + // - ED for deployed contract account // - 2 for the storage item of 0 bytes being created in the callee constructor - // or (callee_info_len + 2 + ED + 2) Balance in total. + let callee_min_deposit = { + let callee_info_len = ContractInfoOf::::get(&addr).unwrap().encoded_size() as u64; + let code_deposit = test_utils::lockup_deposit(&code_hash_callee); + callee_info_len + code_deposit + 2 + ED + 2 + }; + + // The parent just stores an item of the passed size so at least + // we need to pay for the item itself. + let caller_min_deposit = callee_min_deposit + 2; + + // Fail in callee. // - // Provided the limit is set to be 1 Balance less, - // this call should fail on the return from the caller contract. + // We still fail in the sub call because we enforce limits on return from a contract. + // Sub calls return first to they are checked first. let ret = builder::bare_call(addr_caller) .origin(RuntimeOrigin::signed(BOB)) - .storage_deposit_limit(DepositLimit::Balance(callee_info_len + 2 + ED + 1)) - .data((0u32, &code_hash_callee, &U256::MAX.to_little_endian()).encode()) + .storage_deposit_limit(DepositLimit::Balance(0)) + .data((100u32, &code_hash_callee, &U256::MAX.to_little_endian()).encode()) .build_and_unwrap_result(); assert_return_code!(ret, RuntimeReturnCode::OutOfResources); // The charges made on instantiation should be rolled back. assert_eq!(::Currency::free_balance(&BOB), 1_000_000); - // Now we give enough limit for the instantiation itself, but require for 1 more storage - // byte in the constructor. Hence +1 Balance to the limit is needed. This should fail on - // the return from constructor. + // Fail in the caller. + // + // For that we need to supply enough storage deposit so that the sub call + // succeeds but the parent call runs out of storage. let ret = builder::bare_call(addr_caller) .origin(RuntimeOrigin::signed(BOB)) - .storage_deposit_limit(DepositLimit::Balance(callee_info_len + 2 + ED + 2)) - .data((1u32, &code_hash_callee, U256::from(0u64)).encode()) - .build_and_unwrap_result(); - assert_return_code!(ret, RuntimeReturnCode::OutOfResources); + .storage_deposit_limit(DepositLimit::Balance(callee_min_deposit)) + .data((0u32, &code_hash_callee, &U256::MAX.to_little_endian()).encode()) + .build(); + assert_err!(ret.result, >::StorageDepositLimitExhausted); // The charges made on the instantiation should be rolled back. assert_eq!(::Currency::free_balance(&BOB), 1_000_000); - // Now we set enough limit in parent call, but an insufficient limit for child - // instantiate. This should fail during the charging for the instantiation in - // `RawMeter::charge_instantiate()` + // Fail in the callee with bytes. + // + // Same as above but stores one byte in both caller and callee. let ret = builder::bare_call(addr_caller) .origin(RuntimeOrigin::signed(BOB)) - .storage_deposit_limit(DepositLimit::Balance(callee_info_len + 2 + ED + 2)) - .data((0u32, &code_hash_callee, U256::from(callee_info_len + 2 + ED + 1)).encode()) + .storage_deposit_limit(DepositLimit::Balance(caller_min_deposit + 1)) + .data((1u32, &code_hash_callee, U256::from(callee_min_deposit)).encode()) .build_and_unwrap_result(); assert_return_code!(ret, RuntimeReturnCode::OutOfResources); // The charges made on the instantiation should be rolled back. assert_eq!(::Currency::free_balance(&BOB), 1_000_000); - // Same as above but requires for single added storage - // item of 1 byte to be covered by the limit, which implies 3 more Balance. - // Now we set enough limit for the parent call, but insufficient limit for child - // instantiate. This should fail right after the constructor execution. + // Fail in the caller with bytes. + // + // Same as above but stores one byte in both caller and callee. let ret = builder::bare_call(addr_caller) .origin(RuntimeOrigin::signed(BOB)) - .storage_deposit_limit(DepositLimit::Balance(callee_info_len + 2 + ED + 3)) // enough parent limit - .data((1u32, &code_hash_callee, U256::from(callee_info_len + 2 + ED + 2)).encode()) - .build_and_unwrap_result(); - assert_return_code!(ret, RuntimeReturnCode::OutOfResources); + .storage_deposit_limit(DepositLimit::Balance(callee_min_deposit + 1)) + .data((1u32, &code_hash_callee, U256::from(callee_min_deposit + 1)).encode()) + .build(); + assert_err!(ret.result, >::StorageDepositLimitExhausted); // The charges made on the instantiation should be rolled back. assert_eq!(::Currency::free_balance(&BOB), 1_000_000); // Set enough deposit limit for the child instantiate. This should succeed. let result = builder::bare_call(addr_caller) .origin(RuntimeOrigin::signed(BOB)) - .storage_deposit_limit((callee_info_len + 2 + ED + 4 + 2).into()) - .data((1u32, &code_hash_callee, U256::from(callee_info_len + 2 + ED + 3 + 2)).encode()) + .storage_deposit_limit((caller_min_deposit + 2).into()) + .data((1u32, &code_hash_callee, U256::from(callee_min_deposit + 1)).encode()) .build(); let returned = result.result.unwrap(); + assert!(!returned.did_revert()); + // All balance of the caller except ED has been transferred to the callee. // No deposit has been taken from it. assert_eq!(::Currency::free_balance(&caller_id), ED); @@ -3189,17 +3203,12 @@ fn deposit_limit_in_nested_instantiate() { // 10_000 should be sent to callee from the caller contract, plus ED to be sent from the // origin. assert_eq!(::Currency::free_balance(&callee_account_id), 10_000 + ED); - // The origin should be charged with: - // - callee instantiation deposit = (callee_info_len + 2) - // - callee account ED - // - for writing an item of 1 byte to storage = 3 Balance - // - Immutable data storage item deposit + // The origin should be charged with what the outer call consumed assert_eq!( ::Currency::free_balance(&BOB), - 1_000_000 - (callee_info_len + 2 + ED + 3) + 1_000_000 - (caller_min_deposit + 2), ); - // Check that deposit due to be charged still includes these 3 Balance - assert_eq!(result.storage_deposit.charge_or_zero(), (callee_info_len + 2 + ED + 3)) + assert_eq!(result.storage_deposit.charge_or_zero(), (caller_min_deposit + 2)) }); } @@ -3216,7 +3225,7 @@ fn deposit_limit_honors_liquidity_restrictions() { let Contract { addr, account_id } = builder::bare_instantiate(Code::Upload(wasm)).build_and_unwrap_contract(); - let info_deposit = test_utils::contract_info_storage_deposit(&addr); + let info_deposit = test_utils::contract_base_deposit(&addr); // Check that the contract has been instantiated and has the minimum balance assert_eq!(get_contract(&addr).total_deposit(), info_deposit); assert_eq!( @@ -3255,7 +3264,7 @@ fn deposit_limit_honors_existential_deposit() { let Contract { addr, account_id } = builder::bare_instantiate(Code::Upload(wasm)).build_and_unwrap_contract(); - let info_deposit = test_utils::contract_info_storage_deposit(&addr); + let info_deposit = test_utils::contract_base_deposit(&addr); // Check that the contract has been instantiated and has the minimum balance assert_eq!(get_contract(&addr).total_deposit(), info_deposit); @@ -3289,7 +3298,7 @@ fn deposit_limit_honors_min_leftover() { let Contract { addr, account_id } = builder::bare_instantiate(Code::Upload(wasm)).build_and_unwrap_contract(); - let info_deposit = test_utils::contract_info_storage_deposit(&addr); + let info_deposit = test_utils::contract_base_deposit(&addr); // Check that the contract has been instantiated and has the minimum balance and the // storage deposit @@ -3316,195 +3325,11 @@ fn deposit_limit_honors_min_leftover() { }); } -#[test] -fn locking_delegate_dependency_works() { - // set hash lock up deposit to 30%, to test deposit calculation. - CODE_HASH_LOCKUP_DEPOSIT_PERCENT.with(|c| *c.borrow_mut() = Perbill::from_percent(30)); - - let (wasm_caller, self_code_hash) = compile_module("locking_delegate_dependency").unwrap(); - let callee_codes: Vec<_> = - (0..limits::DELEGATE_DEPENDENCIES + 1).map(|idx| dummy_unique(idx)).collect(); - let callee_hashes: Vec<_> = callee_codes - .iter() - .map(|c| sp_core::H256(sp_io::hashing::keccak_256(c))) - .collect(); - - let hash2addr = |code_hash: &H256| { - let mut addr = H160::zero(); - addr.as_bytes_mut().copy_from_slice(&code_hash.as_ref()[..20]); - addr - }; - - // Define inputs with various actions to test locking / unlocking delegate_dependencies. - // See the contract for more details. - let noop_input = (0u32, callee_hashes[0]); - let lock_delegate_dependency_input = (1u32, callee_hashes[0]); - let unlock_delegate_dependency_input = (2u32, callee_hashes[0]); - let terminate_input = (3u32, callee_hashes[0]); - - // Instantiate the caller contract with the given input. - let instantiate = |input: &(u32, H256)| { - let (action, code_hash) = input; - builder::bare_instantiate(Code::Upload(wasm_caller.clone())) - .origin(RuntimeOrigin::signed(ALICE_FALLBACK)) - .data((action, hash2addr(code_hash), code_hash).encode()) - .build() - }; - - // Call contract with the given input. - let call = |addr_caller: &H160, input: &(u32, H256)| { - let (action, code_hash) = input; - builder::bare_call(*addr_caller) - .origin(RuntimeOrigin::signed(ALICE_FALLBACK)) - .data((action, hash2addr(code_hash), code_hash).encode()) - .build() - }; - const ED: u64 = 2000; - ExtBuilder::default().existential_deposit(ED).build().execute_with(|| { - let _ = Balances::set_balance(&ALICE_FALLBACK, 1_000_000); - - // Instantiate with lock_delegate_dependency should fail since the code is not yet on - // chain. - assert_err!( - instantiate(&lock_delegate_dependency_input).result, - Error::::CodeNotFound - ); - - // Upload all the delegated codes (they all have the same size) - let mut deposit = Default::default(); - for code in callee_codes.iter() { - let CodeUploadReturnValue { deposit: deposit_per_code, code_hash } = - Contracts::bare_upload_code( - RuntimeOrigin::signed(ALICE_FALLBACK), - code.clone(), - deposit_limit::(), - ) - .unwrap(); - deposit = deposit_per_code; - // Mock contract info by using first 20 bytes of code_hash as address. - let addr = hash2addr(&code_hash); - ContractInfoOf::::set(&addr, ContractInfo::new(&addr, 0, code_hash).ok()); - } - - // Instantiate should now work. - let addr_caller = instantiate(&lock_delegate_dependency_input).result.unwrap().addr; - let caller_account_id = ::AddressMapper::to_account_id(&addr_caller); - - // There should be a dependency and a deposit. - let contract = test_utils::get_contract(&addr_caller); - - let dependency_deposit = &CodeHashLockupDepositPercent::get().mul_ceil(deposit); - assert_eq!( - contract.delegate_dependencies().get(&callee_hashes[0]), - Some(dependency_deposit) - ); - assert_eq!( - test_utils::get_balance_on_hold( - &HoldReason::StorageDepositReserve.into(), - &caller_account_id - ), - dependency_deposit + contract.storage_base_deposit() - ); - - // Removing the code should fail, since we have added a dependency. - assert_err!( - Contracts::remove_code(RuntimeOrigin::signed(ALICE_FALLBACK), callee_hashes[0]), - >::CodeInUse - ); - - // Locking an already existing dependency should fail. - assert_err!( - call(&addr_caller, &lock_delegate_dependency_input).result, - Error::::DelegateDependencyAlreadyExists - ); - - // Locking self should fail. - assert_err!( - builder::bare_call(addr_caller) - .origin(RuntimeOrigin::signed(ALICE_FALLBACK)) - .data((1u32, &addr_caller, self_code_hash).encode()) - .build() - .result, - Error::::CannotAddSelfAsDelegateDependency - ); - - // Locking more than the maximum allowed delegate_dependencies should fail. - for hash in &callee_hashes[1..callee_hashes.len() - 1] { - call(&addr_caller, &(1u32, *hash)).result.unwrap(); - } - assert_err!( - call(&addr_caller, &(1u32, *callee_hashes.last().unwrap())).result, - Error::::MaxDelegateDependenciesReached - ); - - // Unlocking all dependency should work. - for hash in &callee_hashes[..callee_hashes.len() - 1] { - call(&addr_caller, &(2u32, *hash)).result.unwrap(); - } - - // Dependency should be removed, and deposit should be returned. - let contract = test_utils::get_contract(&addr_caller); - assert!(contract.delegate_dependencies().is_empty()); - assert_eq!( - test_utils::get_balance_on_hold( - &HoldReason::StorageDepositReserve.into(), - &caller_account_id - ), - contract.storage_base_deposit() - ); - - // Removing a nonexistent dependency should fail. - assert_err!( - call(&addr_caller, &unlock_delegate_dependency_input).result, - Error::::DelegateDependencyNotFound - ); - - // Locking a dependency with a storage limit too low should fail. - assert_err!( - builder::bare_call(addr_caller) - .storage_deposit_limit((dependency_deposit - 1).into()) - .data((1u32, hash2addr(&callee_hashes[0]), callee_hashes[0]).encode()) - .build() - .result, - Error::::StorageDepositLimitExhausted - ); - - // Since we unlocked the dependency we should now be able to remove the code. - assert_ok!(Contracts::remove_code(RuntimeOrigin::signed(ALICE_FALLBACK), callee_hashes[0])); - - // Calling should fail since the delegated contract is not on chain anymore. - assert_err!(call(&addr_caller, &noop_input).result, Error::::CodeNotFound); - - // Add the dependency back. - Contracts::upload_code( - RuntimeOrigin::signed(ALICE_FALLBACK), - callee_codes[0].clone(), - deposit_limit::(), - ) - .unwrap(); - call(&addr_caller, &lock_delegate_dependency_input).result.unwrap(); - - // Call terminate should work, and return the deposit. - let balance_before = test_utils::get_balance(&ALICE_FALLBACK); - assert_ok!(call(&addr_caller, &terminate_input).result); - assert_eq!( - test_utils::get_balance(&ALICE_FALLBACK), - ED + balance_before + contract.storage_base_deposit() + dependency_deposit - ); - - // Terminate should also remove the dependency, so we can remove the code. - assert_ok!(Contracts::remove_code(RuntimeOrigin::signed(ALICE_FALLBACK), callee_hashes[0])); - }); -} - #[test] fn native_dependency_deposit_works() { let (wasm, code_hash) = compile_module("set_code_hash").unwrap(); let (dummy_wasm, dummy_code_hash) = compile_module("dummy").unwrap(); - // Set hash lock up deposit to 30%, to test deposit calculation. - CODE_HASH_LOCKUP_DEPOSIT_PERCENT.with(|c| *c.borrow_mut() = Perbill::from_percent(30)); - // Test with both existing and uploaded code for code in [Code::Upload(wasm.clone()), Code::Existing(code_hash)] { ExtBuilder::default().build().execute_with(|| { @@ -3538,33 +3363,34 @@ fn native_dependency_deposit_works() { let addr = res.result.unwrap().addr; let account_id = ::AddressMapper::to_account_id(&addr); - let base_deposit = test_utils::contract_info_storage_deposit(&addr); + let base_deposit = test_utils::contract_base_deposit(&addr); let upload_deposit = test_utils::get_code_deposit(&code_hash); let extra_deposit = add_upload_deposit.then(|| upload_deposit).unwrap_or_default(); - // Check initial storage_deposit - // The base deposit should be: contract_info_storage_deposit + 30% * deposit - let deposit = - extra_deposit + base_deposit + lockup_deposit_percent.mul_ceil(upload_deposit); - - assert_eq!(res.storage_deposit.charge_or_zero(), deposit + Contracts::min_balance()); + assert_eq!( + res.storage_deposit.charge_or_zero(), + extra_deposit + base_deposit + Contracts::min_balance() + ); // call set_code_hash builder::bare_call(addr) .data(dummy_code_hash.encode()) .build_and_unwrap_result(); - // Check updated storage_deposit - let code_deposit = test_utils::get_code_deposit(&dummy_code_hash); - let deposit = base_deposit + lockup_deposit_percent.mul_ceil(code_deposit); - assert_eq!(test_utils::get_contract(&addr).storage_base_deposit(), deposit); + // Check updated storage_deposit due to code size changes + let deposit_diff = lockup_deposit_percent + .mul_ceil(test_utils::get_code_deposit(&code_hash)) - + lockup_deposit_percent.mul_ceil(test_utils::get_code_deposit(&dummy_code_hash)); + let new_base_deposit = test_utils::contract_base_deposit(&addr); + assert_ne!(deposit_diff, 0); + assert_eq!(base_deposit - new_base_deposit, deposit_diff); assert_eq!( test_utils::get_balance_on_hold( &HoldReason::StorageDepositReserve.into(), &account_id ), - deposit + new_base_deposit ); }); } @@ -4158,15 +3984,21 @@ fn immutable_data_works() { .data(data.to_vec()) .build_and_unwrap_contract(); + let contract = test_utils::get_contract(&addr); + let account = ::AddressMapper::to_account_id(&addr); + let actual_deposit = + test_utils::get_balance_on_hold(&HoldReason::StorageDepositReserve.into(), &account); + + assert_eq!(contract.immutable_data_len(), data.len() as u32); + // Storing immmutable data charges storage deposit; verify it explicitly. + assert_eq!(actual_deposit, test_utils::contract_base_deposit(&addr)); + + // make sure it is also recorded in the base deposit assert_eq!( - test_utils::get_balance_on_hold( - &HoldReason::StorageDepositReserve.into(), - &::AddressMapper::to_account_id(&addr) - ), - test_utils::contract_info_storage_deposit(&addr) + test_utils::get_balance_on_hold(&HoldReason::StorageDepositReserve.into(), &account), + contract.storage_base_deposit(), ); - assert_eq!(test_utils::get_contract(&addr).immutable_data_len(), data.len() as u32); // Call the contract: Asserts the input to equal the immutable data assert_ok!(builder::call(addr).data(data.to_vec()).build()); diff --git a/substrate/frame/revive/src/wasm/mod.rs b/substrate/frame/revive/src/wasm/mod.rs index 527cf16309540..e22f97d864fac 100644 --- a/substrate/frame/revive/src/wasm/mod.rs +++ b/substrate/frame/revive/src/wasm/mod.rs @@ -232,6 +232,38 @@ impl CodeInfo { pub fn code_len(&self) -> u64 { self.code_len.into() } + + /// Returns the number of times the specified contract exists on the call stack. Delegated calls + /// Increment the reference count of a of a stored code by one. + /// + /// # Errors + /// + /// [`Error::CodeNotFound`] is returned if no stored code found having the specified + /// `code_hash`. + pub fn increment_refcount(code_hash: H256) -> DispatchResult { + >::mutate(code_hash, |existing| -> Result<(), DispatchError> { + if let Some(info) = existing { + *info.refcount_mut() = info.refcount().saturating_add(1); + Ok(()) + } else { + Err(Error::::CodeNotFound.into()) + } + }) + } + + /// Decrement the reference count of a stored code by one. + /// + /// # Note + /// + /// A contract whose reference count dropped to zero isn't automatically removed. A + /// `remove_code` transaction must be submitted by the original uploader to do so. + pub fn decrement_refcount(code_hash: H256) { + >::mutate(code_hash, |existing| { + if let Some(info) = existing { + *info.refcount_mut() = info.refcount().saturating_sub(1); + } + }); + } } pub struct PreparedCall<'a, E: Ext> { @@ -309,11 +341,6 @@ impl WasmBlob { Error::::CodeRejected })?; - // Increment before execution so that the constructor sees the correct refcount - if let ExportedFunction::Constructor = entry_point { - E::increment_refcount(self.code_hash)?; - } - instance.set_gas(gas_limit_polkavm); instance.prepare_call_untyped(entry_program_counter, &[]); diff --git a/substrate/frame/revive/src/wasm/runtime.rs b/substrate/frame/revive/src/wasm/runtime.rs index 4fbcfe1b47f5b..de1fd90e4ed0a 100644 --- a/substrate/frame/revive/src/wasm/runtime.rs +++ b/substrate/frame/revive/src/wasm/runtime.rs @@ -337,8 +337,8 @@ pub enum RuntimeCosts { GasLimit, /// Weight of calling `seal_weight_to_fee`. WeightToFee, - /// Weight of calling `seal_terminate`, passing the number of locked dependencies. - Terminate(u32), + /// Weight of calling `seal_terminate`. + Terminate, /// Weight of calling `seal_deposit_event` with the given number of topics and event size. DepositEvent { num_topic: u32, len: u32 }, /// Weight of calling `seal_set_storage` for the given storage item sizes. @@ -393,10 +393,6 @@ pub enum RuntimeCosts { SetCodeHash, /// Weight of calling `ecdsa_to_eth_address` EcdsaToEthAddress, - /// Weight of calling `lock_delegate_dependency` - LockDelegateDependency, - /// Weight of calling `unlock_delegate_dependency` - UnlockDelegateDependency, /// Weight of calling `get_immutable_dependency` GetImmutableData(u32), /// Weight of calling `set_immutable_dependency` @@ -488,7 +484,7 @@ impl Token for RuntimeCosts { Now => T::WeightInfo::seal_now(), GasLimit => T::WeightInfo::seal_gas_limit(), WeightToFee => T::WeightInfo::seal_weight_to_fee(), - Terminate(locked_dependencies) => T::WeightInfo::seal_terminate(locked_dependencies), + Terminate => T::WeightInfo::seal_terminate(), DepositEvent { num_topic, len } => T::WeightInfo::seal_deposit_event(num_topic, len), SetStorage { new_bytes, old_bytes } => { cost_storage!(write, seal_set_storage, new_bytes, old_bytes) @@ -526,8 +522,6 @@ impl Token for RuntimeCosts { ChainExtension(weight) | CallRuntime(weight) | CallXcmExecute(weight) => weight, SetCodeHash => T::WeightInfo::seal_set_code_hash(), EcdsaToEthAddress => T::WeightInfo::seal_ecdsa_to_eth_address(), - LockDelegateDependency => T::WeightInfo::lock_delegate_dependency(), - UnlockDelegateDependency => T::WeightInfo::unlock_delegate_dependency(), GetImmutableData(len) => T::WeightInfo::seal_get_immutable_data(len), SetImmutableData(len) => T::WeightInfo::seal_set_immutable_data(len), } @@ -1132,15 +1126,6 @@ impl<'a, E: Ext, M: ?Sized + Memory> Runtime<'a, E, M> { Err(err) => Ok(Self::exec_error_into_return_code(err)?), } } - - fn terminate(&mut self, memory: &M, beneficiary_ptr: u32) -> Result<(), TrapReason> { - let count = self.ext.locked_delegate_dependencies_count() as _; - self.charge_gas(RuntimeCosts::Terminate(count))?; - - let beneficiary = memory.read_h160(beneficiary_ptr)?; - self.ext.terminate(&beneficiary)?; - Err(TrapReason::Termination) - } } // This is the API exposed to contracts. @@ -1475,9 +1460,10 @@ pub mod env { out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason> { - let charged = self.charge_gas(RuntimeCosts::GetImmutableData(limits::IMMUTABLE_BYTES))?; + // quering the length is free as it is stored with the contract metadata + let len = self.ext.immutable_data_len(); + self.charge_gas(RuntimeCosts::GetImmutableData(len))?; let data = self.ext.get_immutable_data()?; - self.adjust_gas(charged, RuntimeCosts::GetImmutableData(data.len() as u32)); self.write_sandbox_output(memory, out_ptr, out_len_ptr, &data, false, already_charged)?; Ok(()) } @@ -1933,20 +1919,6 @@ pub mod env { Ok(self.ext.is_contract(&address) as u32) } - /// Adds a new delegate dependency to the contract. - /// See [`pallet_revive_uapi::HostFn::lock_delegate_dependency`]. - #[mutating] - fn lock_delegate_dependency( - &mut self, - memory: &mut M, - code_hash_ptr: u32, - ) -> Result<(), TrapReason> { - self.charge_gas(RuntimeCosts::LockDelegateDependency)?; - let code_hash = memory.read_h256(code_hash_ptr)?; - self.ext.lock_delegate_dependency(code_hash)?; - Ok(()) - } - /// Stores the minimum balance (a.k.a. existential deposit) into the supplied buffer. /// See [`pallet_revive_uapi::HostFn::minimum_balance`]. fn minimum_balance(&mut self, memory: &mut M, out_ptr: u32) -> Result<(), TrapReason> { @@ -2014,20 +1986,6 @@ pub mod env { } } - /// Removes the delegate dependency from the contract. - /// see [`pallet_revive_uapi::HostFn::unlock_delegate_dependency`]. - #[mutating] - fn unlock_delegate_dependency( - &mut self, - memory: &mut M, - code_hash_ptr: u32, - ) -> Result<(), TrapReason> { - self.charge_gas(RuntimeCosts::UnlockDelegateDependency)?; - let code_hash = memory.read_h256(code_hash_ptr)?; - self.ext.unlock_delegate_dependency(&code_hash)?; - Ok(()) - } - /// Retrieve and remove the value under the given key from storage. /// See [`pallet_revive_uapi::HostFn::take_storage`] #[mutating] @@ -2047,7 +2005,10 @@ pub mod env { /// See [`pallet_revive_uapi::HostFn::terminate`]. #[mutating] fn terminate(&mut self, memory: &mut M, beneficiary_ptr: u32) -> Result<(), TrapReason> { - self.terminate(memory, beneficiary_ptr) + self.charge_gas(RuntimeCosts::Terminate)?; + let beneficiary = memory.read_h160(beneficiary_ptr)?; + self.ext.terminate(&beneficiary)?; + Err(TrapReason::Termination) } /// Stores the amount of weight left into the supplied buffer. diff --git a/substrate/frame/revive/src/weights.rs b/substrate/frame/revive/src/weights.rs index 52153d74ca758..25d5d21e6dc07 100644 --- a/substrate/frame/revive/src/weights.rs +++ b/substrate/frame/revive/src/weights.rs @@ -95,7 +95,7 @@ pub trait WeightInfo { fn seal_call_data_load() -> Weight; fn seal_call_data_copy(n: u32, ) -> Weight; fn seal_return(n: u32, ) -> Weight; - fn seal_terminate(n: u32, ) -> Weight; + fn seal_terminate() -> Weight; fn seal_deposit_event(t: u32, n: u32, ) -> Weight; fn get_storage_empty() -> Weight; fn get_storage_full() -> Weight; @@ -127,8 +127,6 @@ pub trait WeightInfo { fn seal_ecdsa_recover() -> Weight; fn seal_ecdsa_to_eth_address() -> Weight; fn seal_set_code_hash() -> Weight; - fn lock_delegate_dependency() -> Weight; - fn unlock_delegate_dependency() -> Weight; fn instr(r: u32, ) -> Weight; } @@ -626,19 +624,15 @@ impl WeightInfo for SubstrateWeight { /// Storage: `Revive::ImmutableDataOf` (r:0 w:1) /// Proof: `Revive::ImmutableDataOf` (`max_values`: None, `max_size`: Some(4118), added: 6593, mode: `Measured`) /// The range of component `n` is `[0, 32]`. - fn seal_terminate(n: u32, ) -> Weight { + fn seal_terminate() -> Weight { // Proof Size summary in bytes: // Measured: `322 + n * (88 ±0)` // Estimated: `3787 + n * (2563 ±0)` // Minimum execution time: 21_920_000 picoseconds. Weight::from_parts(21_725_868, 3787) // Standard Error: 11_165 - .saturating_add(Weight::from_parts(4_317_986, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(4_u64)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 2563).saturating_mul(n.into())) } /// The range of component `t` is `[0, 4]`. /// The range of component `n` is `[0, 448]`. @@ -995,28 +989,6 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: `Revive::CodeInfoOf` (r:1 w:1) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) - fn lock_delegate_dependency() -> Weight { - // Proof Size summary in bytes: - // Measured: `338` - // Estimated: `3803` - // Minimum execution time: 13_650_000 picoseconds. - Weight::from_parts(14_209_000, 3803) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: `Revive::CodeInfoOf` (r:1 w:1) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) - fn unlock_delegate_dependency() -> Weight { - // Proof Size summary in bytes: - // Measured: `338` - // Estimated: `3561` - // Minimum execution time: 12_341_000 picoseconds. - Weight::from_parts(13_011_000, 3561) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } /// The range of component `r` is `[0, 5000]`. fn instr(r: u32, ) -> Weight { // Proof Size summary in bytes: @@ -1522,19 +1494,15 @@ impl WeightInfo for () { /// Storage: `Revive::ImmutableDataOf` (r:0 w:1) /// Proof: `Revive::ImmutableDataOf` (`max_values`: None, `max_size`: Some(4118), added: 6593, mode: `Measured`) /// The range of component `n` is `[0, 32]`. - fn seal_terminate(n: u32, ) -> Weight { + fn seal_terminate() -> Weight { // Proof Size summary in bytes: // Measured: `322 + n * (88 ±0)` // Estimated: `3787 + n * (2563 ±0)` // Minimum execution time: 21_920_000 picoseconds. Weight::from_parts(21_725_868, 3787) // Standard Error: 11_165 - .saturating_add(Weight::from_parts(4_317_986, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes(4_u64)) - .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 2563).saturating_mul(n.into())) } /// The range of component `t` is `[0, 4]`. /// The range of component `n` is `[0, 448]`. @@ -1891,28 +1859,6 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: `Revive::CodeInfoOf` (r:1 w:1) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) - fn lock_delegate_dependency() -> Weight { - // Proof Size summary in bytes: - // Measured: `338` - // Estimated: `3803` - // Minimum execution time: 13_650_000 picoseconds. - Weight::from_parts(14_209_000, 3803) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: `Revive::CodeInfoOf` (r:1 w:1) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) - fn unlock_delegate_dependency() -> Weight { - // Proof Size summary in bytes: - // Measured: `338` - // Estimated: `3561` - // Minimum execution time: 12_341_000 picoseconds. - Weight::from_parts(13_011_000, 3561) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } /// The range of component `r` is `[0, 5000]`. fn instr(r: u32, ) -> Weight { // Proof Size summary in bytes: diff --git a/substrate/frame/revive/uapi/src/host.rs b/substrate/frame/revive/uapi/src/host.rs index 3e5cf0eb0c243..b6ca4fb0747b3 100644 --- a/substrate/frame/revive/uapi/src/host.rs +++ b/substrate/frame/revive/uapi/src/host.rs @@ -615,18 +615,6 @@ pub trait HostFn: private::Sealed { #[unstable_hostfn] fn is_contract(address: &[u8; 20]) -> bool; - /// Lock a new delegate dependency to the contract. - /// - /// Traps if the maximum number of delegate_dependencies is reached or if - /// the delegate dependency already exists. - /// - /// # Parameters - /// - /// - `code_hash`: The code hash of the dependency. Should be decodable as an `T::Hash`. Traps - /// otherwise. - #[unstable_hostfn] - fn lock_delegate_dependency(code_hash: &[u8; 32]); - /// Stores the minimum balance (a.k.a. existential deposit) into the supplied buffer. /// /// # Parameters @@ -717,17 +705,6 @@ pub trait HostFn: private::Sealed { #[unstable_hostfn] fn terminate(beneficiary: &[u8; 20]) -> !; - /// Removes the delegate dependency from the contract. - /// - /// Traps if the delegate dependency does not exist. - /// - /// # Parameters - /// - /// - `code_hash`: The code hash of the dependency. Should be decodable as an `T::Hash`. Traps - /// otherwise. - #[unstable_hostfn] - fn unlock_delegate_dependency(code_hash: &[u8; 32]); - /// Stores the amount of weight left into the supplied buffer. /// The data is encoded as Weight. /// diff --git a/substrate/frame/revive/uapi/src/host/riscv64.rs b/substrate/frame/revive/uapi/src/host/riscv64.rs index 3726564e26eba..bea73795a18af 100644 --- a/substrate/frame/revive/uapi/src/host/riscv64.rs +++ b/substrate/frame/revive/uapi/src/host/riscv64.rs @@ -125,8 +125,6 @@ mod sys { pub fn set_code_hash(code_hash_ptr: *const u8); pub fn ecdsa_to_eth_address(key_ptr: *const u8, out_ptr: *mut u8) -> ReturnCode; pub fn instantiation_nonce() -> u64; - pub fn lock_delegate_dependency(code_hash_ptr: *const u8); - pub fn unlock_delegate_dependency(code_hash_ptr: *const u8); pub fn xcm_execute(msg_ptr: *const u8, msg_len: u32) -> ReturnCode; pub fn xcm_send( dest_ptr: *const u8, @@ -563,11 +561,6 @@ impl HostFn for HostFnImpl { ret_val.into_bool() } - #[unstable_hostfn] - fn lock_delegate_dependency(code_hash: &[u8; 32]) { - unsafe { sys::lock_delegate_dependency(code_hash.as_ptr()) } - } - #[unstable_hostfn] fn minimum_balance(output: &mut [u8; 32]) { unsafe { sys::minimum_balance(output.as_mut_ptr()) } @@ -620,11 +613,6 @@ impl HostFn for HostFnImpl { panic!("terminate does not return"); } - #[unstable_hostfn] - fn unlock_delegate_dependency(code_hash: &[u8; 32]) { - unsafe { sys::unlock_delegate_dependency(code_hash.as_ptr()) } - } - #[unstable_hostfn] fn weight_left(output: &mut &mut [u8]) { let mut output_len = output.len() as u32; From ba7d704b7c6c97bfa2de956f1343d1c5aeb6fa54 Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Sat, 18 Jan 2025 00:13:34 +0000 Subject: [PATCH 02/41] Update from athei running command 'prdoc --audience runtime_dev' --- prdoc/pr_7230.prdoc | 46 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 prdoc/pr_7230.prdoc diff --git a/prdoc/pr_7230.prdoc b/prdoc/pr_7230.prdoc new file mode 100644 index 0000000000000..c627b0d9cb0b1 --- /dev/null +++ b/prdoc/pr_7230.prdoc @@ -0,0 +1,46 @@ +title: 'revive: Include immutable storage deposit into the contracts `storage_base_deposit`' +doc: +- audience: Runtime Dev + description: |- + This PR is centered around a main fix regarding the base deposit and a bunch of drive by or related fixtures that make sense to resolve in one go. It could be broken down more but I am constantly rebasing this PR and would appreciate getting those fixes in as-one. + + ## Record the deposit for immutable data into the `storage_base_deposit` + + The `storage_base_deposit` are all the deposit a contract has to pay for existing. It included the deposit for its own metadata and a deposit proportional (< 1.0x) to the size of its code. However, the immutable code size was not recorded there. This would lead to the situation where on terminate this portion wouldn't be refunded staying locked into the contract. It would also make the calculation of the deposit changes on `set_code_hash` more complicated when it updates the immutable data (to be done in #6985). Reason is because it didn't know how much was payed before since the storage prices could have changed in the mean time. + + In order for this solution to work I needed to delay the deposit calculation for a new contract for after the contract is done executing is constructor as only then we know the immutable data size. Before, we just charged this eagerly in `charge_instantiate` before we execute the constructor. Now, we merely send the ED as free balance before the constructor in order to create the account. After the constructor is done we calculate the contract base deposit and charge it. This will make `set_code_hash` much easier to implement. + + As a side effect it is now legal to call `set_immutable_data` multiple times per constructor (even though I see no reason to do so). It simply overrides the immutable data with the new value. The deposit accounting will be done after the constructor returns (as mentioned above) instead of when setting the immutable data. + + ## Don't pre-charge for reading immutable data + + I noticed that we were pre-charging weight for the max allowable immutable data when reading those values and then refunding after read. This is not necessary as we know its length without reading the storage as we store it out of band in contract metadata. This makes reading it free. Less pre-charging less problems. + + ## Remove delegate locking + + Fixes #7092 + + This is also in the spirit of making #6985 easier to implement. The locking complicates `set_code_hash` as we might need to block settings the code hash when locks exist. Check #7092 for further rationale. + + ## Enforce "no terminate in constructor" eagerly + + We used to enforce this rule after the contract execution returned. Now we error out early in the host call. This makes it easier to be sure to argue that a contract info still exists (wasn't terminated) when a constructor successfully returns. All around this his just much simpler than dealing this check. + + ## Moved refcount functions to `CodeInfo` + + They never really made sense to exist on `Stack`. But now with the locking gone this makes even less sense. The refcount is stored inside `CodeInfo` to lets just move them there. + + ## Set `CodeHashLockupDepositPercent` for test runtime + + The test runtime was setting `CodeHashLockupDepositPercent` to zero. This was trivializing many code paths and excluded them from testing. I set it to `30%` which is our default value and fixed up all the tests that broke. This should give us confidence that the lockup doeposit collections properly works. + + ## Reworked the `MockExecutable` to have both a `deploy` and a `call` entry point + + This type used for testing could only have either entry points but not both. In order to fix the `immutable_data_set_overrides` I needed to a new function `add_both` to `MockExecutable` that allows to have both entry points. Make sure to make use of it in the future :) +crates: +- name: pallet-revive-fixtures + bump: major +- name: pallet-revive + bump: major +- name: pallet-revive-uapi + bump: major From 1a6feb7bbb41a5182fcd7281de3f038c14f583cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Sat, 18 Jan 2025 01:23:41 +0100 Subject: [PATCH 03/41] Remove left over debug logging --- substrate/frame/revive/src/storage/meter.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/substrate/frame/revive/src/storage/meter.rs b/substrate/frame/revive/src/storage/meter.rs index b1bd102dc2322..ddd4a3bae87f0 100644 --- a/substrate/frame/revive/src/storage/meter.rs +++ b/substrate/frame/revive/src/storage/meter.rs @@ -452,7 +452,6 @@ impl> RawMeter { self.own_contribution = Contribution::Checked(deposit); } if let Deposit::Charge(amount) = total_deposit { - println!("Enforcing {:?} < {:?}", amount, self.limit); if amount > self.limit { log::debug!( target: LOG_TARGET, "Storage deposit limit exhausted: {:?} > {:?}", amount, self.limit); return Err(>::StorageDepositLimitExhausted.into()) From 2f1a82596b5c9e3d341051245d28a7be54243e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Sat, 18 Jan 2025 01:34:22 +0100 Subject: [PATCH 04/41] Correct prdoc bumps --- prdoc/pr_7230.prdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prdoc/pr_7230.prdoc b/prdoc/pr_7230.prdoc index c627b0d9cb0b1..027694f604fe9 100644 --- a/prdoc/pr_7230.prdoc +++ b/prdoc/pr_7230.prdoc @@ -39,8 +39,8 @@ doc: This type used for testing could only have either entry points but not both. In order to fix the `immutable_data_set_overrides` I needed to a new function `add_both` to `MockExecutable` that allows to have both entry points. Make sure to make use of it in the future :) crates: - name: pallet-revive-fixtures - bump: major + bump: patch - name: pallet-revive - bump: major + bump: patch - name: pallet-revive-uapi bump: major From 131e6229e6cf9c5207bb9ec980d79c00f3f13615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Wed, 22 Jan 2025 01:44:06 +0100 Subject: [PATCH 05/41] Add ResetPallet --- Cargo.lock | 1 + .../assets/asset-hub-westend/Cargo.toml | 4 + .../assets/asset-hub-westend/src/lib.rs | 28 +++ .../asset-hub-westend/src/weights/mod.rs | 1 + .../src/weights/pallet_migrations.rs | 172 ++++++++++++++++++ substrate/frame/migrations/src/lib.rs | 4 + substrate/frame/support/src/migrations.rs | 57 +++++- substrate/frame/support/src/traits/hooks.rs | 4 + 8 files changed, 268 insertions(+), 3 deletions(-) create mode 100644 cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_migrations.rs diff --git a/Cargo.lock b/Cargo.lock index da4e85511919d..7734a5ee9bd78 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1126,6 +1126,7 @@ dependencies = [ "pallet-balances 28.0.0", "pallet-collator-selection 9.0.0", "pallet-message-queue 31.0.0", + "pallet-migrations 1.0.0", "pallet-multisig 28.0.0", "pallet-nft-fractionalization 10.0.0", "pallet-nfts 22.0.0", diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml b/cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml index 65ef63a7fb356..f7fb858de62e8 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml @@ -36,6 +36,7 @@ pallet-assets-freezer = { workspace = true } pallet-aura = { workspace = true } pallet-authorship = { workspace = true } pallet-balances = { workspace = true } +pallet-migrations = { workspace = true } pallet-multisig = { workspace = true } pallet-nft-fractionalization = { workspace = true } pallet-nfts = { workspace = true } @@ -133,6 +134,7 @@ runtime-benchmarks = [ "pallet-balances/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", "pallet-message-queue/runtime-benchmarks", + "pallet-migrations/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", "pallet-nft-fractionalization/runtime-benchmarks", "pallet-nfts/runtime-benchmarks", @@ -177,6 +179,7 @@ try-runtime = [ "pallet-balances/try-runtime", "pallet-collator-selection/try-runtime", "pallet-message-queue/try-runtime", + "pallet-migrations/try-runtime", "pallet-multisig/try-runtime", "pallet-nft-fractionalization/try-runtime", "pallet-nfts/try-runtime", @@ -230,6 +233,7 @@ std = [ "pallet-balances/std", "pallet-collator-selection/std", "pallet-message-queue/std", + "pallet-migrations/std", "pallet-multisig/std", "pallet-nft-fractionalization/std", "pallet-nfts-runtime-api/std", diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index 41f29fe2c56a0..6aa1a70a5fdb8 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -185,6 +185,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = frame_support::traits::ConstU32<16>; + type MultiBlockMigrator = MultiBlockMigrations; } impl cumulus_pallet_weight_reclaim::Config for Runtime { @@ -1094,6 +1095,31 @@ impl TryFrom for pallet_revive::Call { } } +parameter_types! { + pub MbmServiceWeight: Weight = Perbill::from_percent(80) * RuntimeBlockWeights::get().max_block; +} + +impl pallet_migrations::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + #[cfg(not(feature = "runtime-benchmarks"))] + type Migrations = frame_support::migrations::ResetPallet< + Revive, + ::DbWeight, + (), // BuildGenesisConfig (Revive doesn't have one) + (), // Get + true, // re-init the pallet (storage version and genesis builder) + >; + // Benchmarks need mocked migrations to guarantee that they succeed. + #[cfg(feature = "runtime-benchmarks")] + type Migrations = pallet_migrations::mock_helpers::MockedMigrations; + type CursorMaxLen = ConstU32<65_536>; + type IdentifierMaxLen = ConstU32<256>; + type MigrationStatusHandler = (); + type FailedMigrationHandler = frame_support::migrations::FreezeChainOnFailedMigration; + type MaxServiceWeight = MbmServiceWeight; + type WeightInfo = weights::pallet_migrations::WeightInfo; +} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub enum Runtime @@ -1105,6 +1131,7 @@ construct_runtime!( Timestamp: pallet_timestamp = 3, ParachainInfo: parachain_info = 4, WeightReclaim: cumulus_pallet_weight_reclaim = 5, + MultiBlockMigrations: pallet_migrations = 6, // Monetary stuff. Balances: pallet_balances = 10, @@ -1429,6 +1456,7 @@ mod benches { [pallet_asset_conversion_tx_payment, AssetTxPayment] [pallet_balances, Balances] [pallet_message_queue, MessageQueue] + [pallet_migrations, MultiBlockMigrations] [pallet_multisig, Multisig] [pallet_nft_fractionalization, NftFractionalization] [pallet_nfts, Nfts] diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs index d653838ad80e6..86cd12507401f 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs @@ -30,6 +30,7 @@ pub mod pallet_assets_pool; pub mod pallet_balances; pub mod pallet_collator_selection; pub mod pallet_message_queue; +pub mod pallet_migrations; pub mod pallet_multisig; pub mod pallet_nft_fractionalization; pub mod pallet_nfts; diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_migrations.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_migrations.rs new file mode 100644 index 0000000000000..61857ac8202a0 --- /dev/null +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_migrations.rs @@ -0,0 +1,172 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Need to rerun! + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_migrations`. +pub struct WeightInfo(PhantomData); +impl pallet_migrations::WeightInfo for WeightInfo { + /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:1) + /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) + /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) + fn onboard_new_mbms() -> Weight { + // Proof Size summary in bytes: + // Measured: `276` + // Estimated: `67035` + // Minimum execution time: 7_762_000 picoseconds. + Weight::from_parts(8_100_000, 67035) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) + /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) + fn progress_mbms_none() -> Weight { + // Proof Size summary in bytes: + // Measured: `142` + // Estimated: `67035` + // Minimum execution time: 2_077_000 picoseconds. + Weight::from_parts(2_138_000, 67035) + .saturating_add(T::DbWeight::get().reads(1_u64)) + } + /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) + /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) + /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) + fn exec_migration_completed() -> Weight { + // Proof Size summary in bytes: + // Measured: `134` + // Estimated: `3599` + // Minimum execution time: 5_868_000 picoseconds. + Weight::from_parts(6_143_000, 3599) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) + /// Storage: `MultiBlockMigrations::Historic` (r:1 w:0) + /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) + fn exec_migration_skipped_historic() -> Weight { + // Proof Size summary in bytes: + // Measured: `330` + // Estimated: `3795` + // Minimum execution time: 10_283_000 picoseconds. + Weight::from_parts(10_964_000, 3795) + .saturating_add(T::DbWeight::get().reads(2_u64)) + } + /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) + /// Storage: `MultiBlockMigrations::Historic` (r:1 w:0) + /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) + fn exec_migration_advance() -> Weight { + // Proof Size summary in bytes: + // Measured: `276` + // Estimated: `3741` + // Minimum execution time: 9_900_000 picoseconds. + Weight::from_parts(10_396_000, 3741) + .saturating_add(T::DbWeight::get().reads(2_u64)) + } + /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) + /// Storage: `MultiBlockMigrations::Historic` (r:1 w:1) + /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) + fn exec_migration_complete() -> Weight { + // Proof Size summary in bytes: + // Measured: `276` + // Estimated: `3741` + // Minimum execution time: 11_411_000 picoseconds. + Weight::from_parts(11_956_000, 3741) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) + /// Storage: `MultiBlockMigrations::Historic` (r:1 w:0) + /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) + /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) + /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) + fn exec_migration_fail() -> Weight { + // Proof Size summary in bytes: + // Measured: `276` + // Estimated: `3741` + // Minimum execution time: 12_398_000 picoseconds. + Weight::from_parts(12_910_000, 3741) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + fn on_init_loop() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 166_000 picoseconds. + Weight::from_parts(193_000, 0) + } + /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) + /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) + fn force_set_cursor() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_686_000 picoseconds. + Weight::from_parts(2_859_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) + /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) + fn force_set_active_cursor() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_070_000 picoseconds. + Weight::from_parts(3_250_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) + /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) + /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) + fn force_onboard_mbms() -> Weight { + // Proof Size summary in bytes: + // Measured: `251` + // Estimated: `67035` + // Minimum execution time: 5_901_000 picoseconds. + Weight::from_parts(6_320_000, 67035) + .saturating_add(T::DbWeight::get().reads(2_u64)) + } + /// Storage: `MultiBlockMigrations::Historic` (r:256 w:256) + /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) + /// The range of component `n` is `[0, 256]`. + fn clear_historic(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1122 + n * (271 ±0)` + // Estimated: `3834 + n * (2740 ±0)` + // Minimum execution time: 15_952_000 picoseconds. + Weight::from_parts(14_358_665, 3834) + // Standard Error: 3_358 + .saturating_add(Weight::from_parts(1_323_674, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) + .saturating_add(Weight::from_parts(0, 2740).saturating_mul(n.into())) + } +} \ No newline at end of file diff --git a/substrate/frame/migrations/src/lib.rs b/substrate/frame/migrations/src/lib.rs index d9490e7dcfe99..63e638118b07e 100644 --- a/substrate/frame/migrations/src/lib.rs +++ b/substrate/frame/migrations/src/lib.rs @@ -298,7 +298,11 @@ type PreUpgradeBytes = pub mod pallet { use super::*; + /// The in-code storage version. + const STORAGE_VERSION: StorageVersion = StorageVersion::new(0); + #[pallet::pallet] + #[pallet::storage_version(STORAGE_VERSION)] pub struct Pallet(_); #[pallet::config(with_default)] diff --git a/substrate/frame/support/src/migrations.rs b/substrate/frame/support/src/migrations.rs index 3fdf8d6edc958..8ba80393ca21f 100644 --- a/substrate/frame/support/src/migrations.rs +++ b/substrate/frame/support/src/migrations.rs @@ -19,8 +19,8 @@ use crate::{ defensive, storage::{storage_prefix, transactional::with_transaction_opaque_err}, traits::{ - Defensive, GetStorageVersion, NoStorageVersionSet, PalletInfoAccess, SafeMode, - StorageVersion, + BuildGenesisConfig, Defensive, GetStorageVersion, NoStorageVersionSet, OnGenesis, + PalletInfoAccess, SafeMode, StorageVersion, }, weights::{RuntimeDbWeight, Weight, WeightMeter}, }; @@ -31,7 +31,7 @@ use impl_trait_for_tuples::impl_for_tuples; use sp_arithmetic::traits::Bounded; use sp_core::Get; use sp_io::{hashing::twox_128, storage::clear_prefix, KillStorageResult}; -use sp_runtime::traits::Zero; +use sp_runtime::{traits::Zero, SaturatedConversion}; /// Handles storage migration pallet versioning. /// @@ -260,6 +260,57 @@ pub fn migrate_from_pallet_version_to_storage_version< Pallets::migrate(db_weight) } +pub struct ResetPallet(PhantomData<(P, W, B, G)>); + +impl SteppedMigration for ResetPallet +where + P: PalletInfoAccess + OnGenesis, + W: Get, + B: BuildGenesisConfig, + G: Get, +{ + type Cursor = (); + type Identifier = [u8; 16]; + + fn id() -> Self::Identifier { + ("RemovePallet::", P::name()).using_encoded(twox_128) + } + + fn step( + _cursor: Option, + meter: &mut WeightMeter, + ) -> Result, SteppedMigrationError> { + let weight_per_key = W::get().writes(1); + let key_budget = meter + .remaining() + .checked_div_per_component(&weight_per_key) + .expect("costs not zero") + .saturated_into(); + + if key_budget == 0 { + return Err(SteppedMigrationError::InsufficientWeight { required: weight_per_key }) + } + + let hashed_prefix = twox_128(P::name().as_bytes()); + let (keys_removed, cursor) = match clear_prefix(&hashed_prefix, Some(key_budget)) { + KillStorageResult::AllRemoved(value) => (value.into(), None), + KillStorageResult::SomeRemaining(value) => (value.into(), Some(())), + }; + + meter.consume(W::get().writes(keys_removed)); + + if REINIT && cursor.is_none() { + // sets pallet version to current in-code version + P::on_genesis(); + + // write the genesis state to storage + G::get().build(); + } + + Ok(cursor) + } +} + /// `RemovePallet` is a utility struct used to remove all storage items associated with a specific /// pallet. /// diff --git a/substrate/frame/support/src/traits/hooks.rs b/substrate/frame/support/src/traits/hooks.rs index 012a74d0ae92f..51209cb542467 100644 --- a/substrate/frame/support/src/traits/hooks.rs +++ b/substrate/frame/support/src/traits/hooks.rs @@ -584,6 +584,10 @@ pub trait BuildGenesisConfig: sp_runtime::traits::MaybeSerializeDeserialize { fn build(&self); } +impl BuildGenesisConfig for () { + fn build(&self) {} +} + /// A trait to define the build function of a genesis config, T and I are placeholder for pallet /// trait and pallet instance. #[deprecated( From 09b80be2eceeb79558641528395f6f1c1a679fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Thu, 23 Jan 2025 13:54:58 +0100 Subject: [PATCH 06/41] Refine ResetRuntime --- .../assets/asset-hub-westend/src/lib.rs | 9 +-- substrate/frame/support/src/migrations.rs | 60 +++++++++++++++++-- 2 files changed, 57 insertions(+), 12 deletions(-) diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index cb73a6ff79b85..99853a1d93228 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -1102,13 +1102,8 @@ parameter_types! { impl pallet_migrations::Config for Runtime { type RuntimeEvent = RuntimeEvent; #[cfg(not(feature = "runtime-benchmarks"))] - type Migrations = frame_support::migrations::ResetPallet< - Revive, - ::DbWeight, - (), // BuildGenesisConfig (Revive doesn't have one) - (), // Get - true, // re-init the pallet (storage version and genesis builder) - >; + type Migrations = + frame_support::migrations::ResetPallet::DbWeight>; // Benchmarks need mocked migrations to guarantee that they succeed. #[cfg(feature = "runtime-benchmarks")] type Migrations = pallet_migrations::mock_helpers::MockedMigrations; diff --git a/substrate/frame/support/src/migrations.rs b/substrate/frame/support/src/migrations.rs index 8ba80393ca21f..59abe6b84dfd9 100644 --- a/substrate/frame/support/src/migrations.rs +++ b/substrate/frame/support/src/migrations.rs @@ -260,9 +260,39 @@ pub fn migrate_from_pallet_version_to_storage_version< Pallets::migrate(db_weight) } -pub struct ResetPallet(PhantomData<(P, W, B, G)>); +/// Remove all of a pallet's state and re-initializes it to the current in-code storage version. +/// +/// It uses the multi block migration frame. Hence it is safe to use even on +/// pallets that contain a lot of storage. +/// +/// # Parameters +/// +/// - P: The pallet to resetted as defined in construct runtime +/// - W: The weight definition for storage access. +/// - B, G: Optional. Can be used if the pallet needs to be initialized via [`BuildGenesisConfig`]. +/// +/// # Note +/// +/// The costs to set the optional genesis state are not accounted for. This should be fine as long +/// as no massive amounts of data are written. +pub struct ResetPallet(PhantomData<(P, W, B, G)>); -impl SteppedMigration for ResetPallet +impl ResetPallet +where + P: PalletInfoAccess, +{ + fn hashed_prefix() -> [u8; 16] { + twox_128(P::name().as_bytes()) + } + + #[cfg(feature = "try-runtime")] + fn num_keys() -> u64 { + let prefix = Self::hashed_prefix().to_vec(); + crate::storage::KeyPrefixIterator::new(prefix.clone(), prefix, |_| Ok(())).count() as _ + } +} + +impl SteppedMigration for ResetPallet where P: PalletInfoAccess + OnGenesis, W: Get, @@ -291,15 +321,14 @@ where return Err(SteppedMigrationError::InsufficientWeight { required: weight_per_key }) } - let hashed_prefix = twox_128(P::name().as_bytes()); - let (keys_removed, cursor) = match clear_prefix(&hashed_prefix, Some(key_budget)) { + let (keys_removed, cursor) = match clear_prefix(&Self::hashed_prefix(), Some(key_budget)) { KillStorageResult::AllRemoved(value) => (value.into(), None), KillStorageResult::SomeRemaining(value) => (value.into(), Some(())), }; meter.consume(W::get().writes(keys_removed)); - if REINIT && cursor.is_none() { + if cursor.is_none() { // sets pallet version to current in-code version P::on_genesis(); @@ -309,6 +338,27 @@ where Ok(cursor) } + + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { + let num_keys: u64 = Self::num_keys(); + log::info!("ResetPallet<{}>: Trying to remove {num_keys} keys.", P::name()); + Ok(num_keys.encode()) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { + let keys_before = u64::decode(&mut state.as_ref()).expect("We encoded as u64 above; qed"); + let keys_now = Self::num_keys(); + log::info!("ResetPallet<{}>: Keys remaining after migration: {keys_now}", P::name()); + + if !(keys_before > keys_now) { + log::error!("ResetPallet<{}>: Removed suspiciously low number of keys.", P::name()); + Err("ResetPallet failed")?; + } + + Ok(()) + } } /// `RemovePallet` is a utility struct used to remove all storage items associated with a specific From 1f2f51efbe2fecbe7ef4785703b0aae5a4e6e739 Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 17:22:58 +0000 Subject: [PATCH 07/41] Update from athei running command 'bench-omni --runtime asset-hub-westend --pallet pallet_migrations --fail-fast --clean' --- .../src/weights/pallet_migrations.rs | 175 +++++++++++------- 1 file changed, 106 insertions(+), 69 deletions(-) diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_migrations.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_migrations.rs index 61857ac8202a0..998ef58895de3 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_migrations.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_migrations.rs @@ -1,19 +1,44 @@ // Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 +// This file is part of Cumulus. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. -// Need to rerun! +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_migrations` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2025-01-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `c6b61d7f408b`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// frame-omni-bencher +// v1 +// benchmark +// pallet +// --extrinsic=* +// --runtime=target/production/wbuild/asset-hub-westend-runtime/asset_hub_westend_runtime.wasm +// --pallet=pallet_migrations +// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt +// --output=./cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights +// --wasm-execution=compiled +// --steps=50 +// --repeat=20 +// --heap-pages=4096 +// --no-storage-info +// --no-min-squares +// --no-median-slopes #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -32,22 +57,24 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) fn onboard_new_mbms() -> Weight { // Proof Size summary in bytes: - // Measured: `276` + // Measured: `171` // Estimated: `67035` - // Minimum execution time: 7_762_000 picoseconds. - Weight::from_parts(8_100_000, 67035) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 10_385_000 picoseconds. + Weight::from_parts(10_929_000, 0) + .saturating_add(Weight::from_parts(0, 67035)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn progress_mbms_none() -> Weight { // Proof Size summary in bytes: - // Measured: `142` + // Measured: `42` // Estimated: `67035` - // Minimum execution time: 2_077_000 picoseconds. - Weight::from_parts(2_138_000, 67035) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Minimum execution time: 3_268_000 picoseconds. + Weight::from_parts(3_410_000, 0) + .saturating_add(Weight::from_parts(0, 67035)) + .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -55,12 +82,13 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn exec_migration_completed() -> Weight { // Proof Size summary in bytes: - // Measured: `134` - // Estimated: `3599` - // Minimum execution time: 5_868_000 picoseconds. - Weight::from_parts(6_143_000, 3599) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `129` + // Estimated: `3594` + // Minimum execution time: 7_879_000 picoseconds. + Weight::from_parts(8_298_000, 0) + .saturating_add(Weight::from_parts(0, 3594)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -68,11 +96,12 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_skipped_historic() -> Weight { // Proof Size summary in bytes: - // Measured: `330` - // Estimated: `3795` - // Minimum execution time: 10_283_000 picoseconds. - Weight::from_parts(10_964_000, 3795) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `225` + // Estimated: `3731` + // Minimum execution time: 14_882_000 picoseconds. + Weight::from_parts(15_278_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -80,11 +109,12 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_advance() -> Weight { // Proof Size summary in bytes: - // Measured: `276` - // Estimated: `3741` - // Minimum execution time: 9_900_000 picoseconds. - Weight::from_parts(10_396_000, 3741) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `171` + // Estimated: `3731` + // Minimum execution time: 14_337_000 picoseconds. + Weight::from_parts(14_736_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -92,12 +122,13 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_complete() -> Weight { // Proof Size summary in bytes: - // Measured: `276` - // Estimated: `3741` - // Minimum execution time: 11_411_000 picoseconds. - Weight::from_parts(11_956_000, 3741) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `171` + // Estimated: `3731` + // Minimum execution time: 16_557_000 picoseconds. + Weight::from_parts(17_061_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -107,19 +138,21 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn exec_migration_fail() -> Weight { // Proof Size summary in bytes: - // Measured: `276` - // Estimated: `3741` - // Minimum execution time: 12_398_000 picoseconds. - Weight::from_parts(12_910_000, 3741) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `171` + // Estimated: `3731` + // Minimum execution time: 17_377_000 picoseconds. + Weight::from_parts(17_775_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } fn on_init_loop() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 166_000 picoseconds. - Weight::from_parts(193_000, 0) + // Minimum execution time: 253_000 picoseconds. + Weight::from_parts(290_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) @@ -127,9 +160,10 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_686_000 picoseconds. - Weight::from_parts(2_859_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 3_813_000 picoseconds. + Weight::from_parts(4_025_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) @@ -137,9 +171,10 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_070_000 picoseconds. - Weight::from_parts(3_250_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 4_459_000 picoseconds. + Weight::from_parts(4_682_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) @@ -147,26 +182,28 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) fn force_onboard_mbms() -> Weight { // Proof Size summary in bytes: - // Measured: `251` + // Measured: `147` // Estimated: `67035` - // Minimum execution time: 5_901_000 picoseconds. - Weight::from_parts(6_320_000, 67035) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Minimum execution time: 8_040_000 picoseconds. + Weight::from_parts(8_345_000, 0) + .saturating_add(Weight::from_parts(0, 67035)) + .saturating_add(T::DbWeight::get().reads(2)) } /// Storage: `MultiBlockMigrations::Historic` (r:256 w:256) /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) /// The range of component `n` is `[0, 256]`. fn clear_historic(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1122 + n * (271 ±0)` + // Measured: `1022 + n * (271 ±0)` // Estimated: `3834 + n * (2740 ±0)` - // Minimum execution time: 15_952_000 picoseconds. - Weight::from_parts(14_358_665, 3834) - // Standard Error: 3_358 - .saturating_add(Weight::from_parts(1_323_674, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Minimum execution time: 19_643_000 picoseconds. + Weight::from_parts(19_906_409, 0) + .saturating_add(Weight::from_parts(0, 3834)) + // Standard Error: 3_212 + .saturating_add(Weight::from_parts(1_568_857, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) .saturating_add(Weight::from_parts(0, 2740).saturating_mul(n.into())) } -} \ No newline at end of file +} From 73d42f87b67376bae9f1370248fab978e97ee121 Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 19:13:30 +0000 Subject: [PATCH 08/41] Update from athei running command 'bench-omni --dev --pallet pallet_revive --fail-fast --clean' --- .../src/weights/pallet_revive.rs | 986 +++++++++++++ substrate/frame/revive/src/weights.rs | 1225 ++++++++--------- 2 files changed, 1594 insertions(+), 617 deletions(-) create mode 100644 cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_revive.rs diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_revive.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_revive.rs new file mode 100644 index 0000000000000..bc4e6129d4d37 --- /dev/null +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_revive.rs @@ -0,0 +1,986 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_revive` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2025-01-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `985569d2aee4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// frame-omni-bencher +// v1 +// benchmark +// pallet +// --extrinsic=* +// --runtime=target/production/wbuild/asset-hub-westend-runtime/asset_hub_westend_runtime.wasm +// --pallet=pallet_revive +// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt +// --output=./cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights +// --wasm-execution=compiled +// --steps=50 +// --repeat=20 +// --heap-pages=4096 +// --no-storage-info +// --no-min-squares +// --no-median-slopes + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_revive`. +pub struct WeightInfo(PhantomData); +impl pallet_revive::WeightInfo for WeightInfo { + /// Storage: `Revive::DeletionQueueCounter` (r:1 w:0) + /// Proof: `Revive::DeletionQueueCounter` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + fn on_process_deletion_queue_batch() -> Weight { + // Proof Size summary in bytes: + // Measured: `109` + // Estimated: `1594` + // Minimum execution time: 3_227_000 picoseconds. + Weight::from_parts(3_430_000, 0) + .saturating_add(Weight::from_parts(0, 1594)) + .saturating_add(T::DbWeight::get().reads(1)) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `k` is `[0, 1024]`. + fn on_initialize_per_trie_key(k: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `430 + k * (69 ±0)` + // Estimated: `420 + k * (70 ±0)` + // Minimum execution time: 16_885_000 picoseconds. + Weight::from_parts(17_299_000, 0) + .saturating_add(Weight::from_parts(0, 420)) + // Standard Error: 1_406 + .saturating_add(Weight::from_parts(1_310_709, 0).saturating_mul(k.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) + .saturating_add(Weight::from_parts(0, 70).saturating_mul(k.into())) + } + /// Storage: `Revive::AddressSuffix` (r:2 w:0) + /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) + /// Storage: `Revive::ContractInfoOf` (r:1 w:1) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) + /// Storage: `Revive::CodeInfoOf` (r:1 w:0) + /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) + /// Storage: `Revive::PristineCode` (r:1 w:0) + /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// The range of component `c` is `[0, 262144]`. + fn call_with_code_per_byte(_c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1362` + // Estimated: `7302` + // Minimum execution time: 118_030_000 picoseconds. + Weight::from_parts(123_592_986, 0) + .saturating_add(Weight::from_parts(0, 7302)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Revive::CodeInfoOf` (r:1 w:1) + /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) + /// Storage: `Balances::Holds` (r:2 w:2) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `Measured`) + /// Storage: `Revive::AddressSuffix` (r:1 w:0) + /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) + /// Storage: `Revive::ContractInfoOf` (r:1 w:1) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Revive::PristineCode` (r:0 w:1) + /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) + /// The range of component `c` is `[0, 262144]`. + /// The range of component `i` is `[0, 262144]`. + fn instantiate_with_code(_c: u32, i: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `263` + // Estimated: `6202` + // Minimum execution time: 222_873_000 picoseconds. + Weight::from_parts(211_975_311, 0) + .saturating_add(Weight::from_parts(0, 6202)) + // Standard Error: 9 + .saturating_add(Weight::from_parts(4_308, 0).saturating_mul(i.into())) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `Revive::CodeInfoOf` (r:1 w:1) + /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) + /// Storage: `Revive::PristineCode` (r:1 w:0) + /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) + /// Storage: `Revive::AddressSuffix` (r:1 w:0) + /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) + /// Storage: `Revive::ContractInfoOf` (r:1 w:1) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `Measured`) + /// The range of component `i` is `[0, 262144]`. + fn instantiate(i: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1154` + // Estimated: `4626` + // Minimum execution time: 185_926_000 picoseconds. + Weight::from_parts(179_728_952, 0) + .saturating_add(Weight::from_parts(0, 4626)) + // Standard Error: 11 + .saturating_add(Weight::from_parts(4_357, 0).saturating_mul(i.into())) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `Revive::AddressSuffix` (r:2 w:0) + /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) + /// Storage: `Revive::ContractInfoOf` (r:1 w:1) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) + /// Storage: `Revive::CodeInfoOf` (r:1 w:0) + /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) + /// Storage: `Revive::PristineCode` (r:1 w:0) + /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + fn call() -> Weight { + // Proof Size summary in bytes: + // Measured: `1362` + // Estimated: `7302` + // Minimum execution time: 172_792_000 picoseconds. + Weight::from_parts(176_869_000, 0) + .saturating_add(Weight::from_parts(0, 7302)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Revive::CodeInfoOf` (r:1 w:1) + /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `Measured`) + /// Storage: `Revive::PristineCode` (r:0 w:1) + /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) + /// The range of component `c` is `[0, 262144]`. + fn upload_code(_c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `109` + // Estimated: `3574` + // Minimum execution time: 58_970_000 picoseconds. + Weight::from_parts(61_559_363, 0) + .saturating_add(Weight::from_parts(0, 3574)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Revive::CodeInfoOf` (r:1 w:1) + /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `Measured`) + /// Storage: `Revive::PristineCode` (r:0 w:1) + /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) + fn remove_code() -> Weight { + // Proof Size summary in bytes: + // Measured: `282` + // Estimated: `3747` + // Minimum execution time: 47_502_000 picoseconds. + Weight::from_parts(48_337_000, 0) + .saturating_add(Weight::from_parts(0, 3747)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Revive::ContractInfoOf` (r:1 w:1) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) + /// Storage: `Revive::CodeInfoOf` (r:2 w:2) + /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) + fn set_code() -> Weight { + // Proof Size summary in bytes: + // Measured: `524` + // Estimated: `6464` + // Minimum execution time: 25_716_000 picoseconds. + Weight::from_parts(26_630_000, 0) + .saturating_add(Weight::from_parts(0, 6464)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Revive::AddressSuffix` (r:1 w:1) + /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `Measured`) + fn map_account() -> Weight { + // Proof Size summary in bytes: + // Measured: `109` + // Estimated: `3574` + // Minimum execution time: 52_608_000 picoseconds. + Weight::from_parts(53_095_000, 0) + .saturating_add(Weight::from_parts(0, 3574)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `Measured`) + /// Storage: `Revive::AddressSuffix` (r:0 w:1) + /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) + fn unmap_account() -> Weight { + // Proof Size summary in bytes: + // Measured: `55` + // Estimated: `3520` + // Minimum execution time: 41_476_000 picoseconds. + Weight::from_parts(42_403_000, 0) + .saturating_add(Weight::from_parts(0, 3520)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + fn dispatch_as_fallback_account() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_757_000 picoseconds. + Weight::from_parts(6_089_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// The range of component `r` is `[0, 1600]`. + fn noop_host_fn(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 7_642_000 picoseconds. + Weight::from_parts(8_689_155, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 189 + .saturating_add(Weight::from_parts(162_118, 0).saturating_mul(r.into())) + } + fn seal_caller() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 379_000 picoseconds. + Weight::from_parts(433_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn seal_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 382_000 picoseconds. + Weight::from_parts(409_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `Revive::ContractInfoOf` (r:1 w:0) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) + fn seal_is_contract() -> Weight { + // Proof Size summary in bytes: + // Measured: `306` + // Estimated: `3771` + // Minimum execution time: 7_617_000 picoseconds. + Weight::from_parts(7_872_000, 0) + .saturating_add(Weight::from_parts(0, 3771)) + .saturating_add(T::DbWeight::get().reads(1)) + } + /// Storage: `Revive::AddressSuffix` (r:1 w:0) + /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) + fn seal_to_account_id() -> Weight { + // Proof Size summary in bytes: + // Measured: `248` + // Estimated: `3713` + // Minimum execution time: 7_250_000 picoseconds. + Weight::from_parts(7_559_000, 0) + .saturating_add(Weight::from_parts(0, 3713)) + .saturating_add(T::DbWeight::get().reads(1)) + } + /// Storage: `Revive::ContractInfoOf` (r:1 w:0) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) + fn seal_code_hash() -> Weight { + // Proof Size summary in bytes: + // Measured: `402` + // Estimated: `3867` + // Minimum execution time: 8_733_000 picoseconds. + Weight::from_parts(9_077_000, 0) + .saturating_add(Weight::from_parts(0, 3867)) + .saturating_add(T::DbWeight::get().reads(1)) + } + fn seal_own_code_hash() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 350_000 picoseconds. + Weight::from_parts(410_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `Revive::ContractInfoOf` (r:1 w:0) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) + /// Storage: `Revive::CodeInfoOf` (r:1 w:0) + /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) + fn seal_code_size() -> Weight { + // Proof Size summary in bytes: + // Measured: `470` + // Estimated: `3935` + // Minimum execution time: 12_852_000 picoseconds. + Weight::from_parts(13_345_000, 0) + .saturating_add(Weight::from_parts(0, 3935)) + .saturating_add(T::DbWeight::get().reads(2)) + } + fn seal_caller_is_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 417_000 picoseconds. + Weight::from_parts(461_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn seal_caller_is_root() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 367_000 picoseconds. + Weight::from_parts(434_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn seal_address() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 377_000 picoseconds. + Weight::from_parts(411_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn seal_weight_left() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 851_000 picoseconds. + Weight::from_parts(917_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn seal_ref_time_left() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 349_000 picoseconds. + Weight::from_parts(376_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn seal_balance() -> Weight { + // Proof Size summary in bytes: + // Measured: `103` + // Estimated: `0` + // Minimum execution time: 5_825_000 picoseconds. + Weight::from_parts(6_135_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `Revive::AddressSuffix` (r:1 w:0) + /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + fn seal_balance_of() -> Weight { + // Proof Size summary in bytes: + // Measured: `264` + // Estimated: `3729` + // Minimum execution time: 10_492_000 picoseconds. + Weight::from_parts(10_821_000, 0) + .saturating_add(Weight::from_parts(0, 3729)) + .saturating_add(T::DbWeight::get().reads(2)) + } + /// Storage: `Revive::ImmutableDataOf` (r:1 w:0) + /// Proof: `Revive::ImmutableDataOf` (`max_values`: None, `max_size`: Some(4118), added: 6593, mode: `Measured`) + /// The range of component `n` is `[1, 4096]`. + fn seal_get_immutable_data(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `238 + n * (1 ±0)` + // Estimated: `3703 + n * (1 ±0)` + // Minimum execution time: 6_665_000 picoseconds. + Weight::from_parts(7_463_260, 0) + .saturating_add(Weight::from_parts(0, 3703)) + // Standard Error: 5 + .saturating_add(Weight::from_parts(717, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) + } + /// Storage: `Revive::ImmutableDataOf` (r:0 w:1) + /// Proof: `Revive::ImmutableDataOf` (`max_values`: None, `max_size`: Some(4118), added: 6593, mode: `Measured`) + /// The range of component `n` is `[1, 4096]`. + fn seal_set_immutable_data(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_546_000 picoseconds. + Weight::from_parts(2_774_529, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 3 + .saturating_add(Weight::from_parts(645, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().writes(1)) + } + fn seal_value_transferred() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 379_000 picoseconds. + Weight::from_parts(407_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn seal_minimum_balance() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 371_000 picoseconds. + Weight::from_parts(424_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn seal_return_data_size() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 370_000 picoseconds. + Weight::from_parts(417_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn seal_call_data_size() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 358_000 picoseconds. + Weight::from_parts(406_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn seal_gas_limit() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 519_000 picoseconds. + Weight::from_parts(584_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn seal_gas_price() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 353_000 picoseconds. + Weight::from_parts(403_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn seal_base_fee() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 379_000 picoseconds. + Weight::from_parts(429_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn seal_block_number() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 337_000 picoseconds. + Weight::from_parts(377_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `System::BlockHash` (r:1 w:0) + /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `Measured`) + fn seal_block_hash() -> Weight { + // Proof Size summary in bytes: + // Measured: `30` + // Estimated: `3495` + // Minimum execution time: 4_595_000 picoseconds. + Weight::from_parts(4_770_000, 0) + .saturating_add(Weight::from_parts(0, 3495)) + .saturating_add(T::DbWeight::get().reads(1)) + } + fn seal_now() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 368_000 picoseconds. + Weight::from_parts(418_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn seal_weight_to_fee() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_195_000 picoseconds. + Weight::from_parts(2_319_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// The range of component `n` is `[0, 262140]`. + fn seal_copy_to_contract(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 530_000 picoseconds. + Weight::from_parts(779_792, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 0 + .saturating_add(Weight::from_parts(295, 0).saturating_mul(n.into())) + } + fn seal_call_data_load() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 371_000 picoseconds. + Weight::from_parts(419_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// The range of component `n` is `[0, 262144]`. + fn seal_call_data_copy(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 367_000 picoseconds. + Weight::from_parts(372_110, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 0 + .saturating_add(Weight::from_parts(150, 0).saturating_mul(n.into())) + } + /// The range of component `n` is `[0, 262140]`. + fn seal_return(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 390_000 picoseconds. + Weight::from_parts(390_156, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 0 + .saturating_add(Weight::from_parts(298, 0).saturating_mul(n.into())) + } + /// Storage: `Revive::AddressSuffix` (r:1 w:0) + /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) + /// Storage: `Revive::DeletionQueueCounter` (r:1 w:1) + /// Proof: `Revive::DeletionQueueCounter` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `Revive::CodeInfoOf` (r:1 w:1) + /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) + /// Storage: `Revive::DeletionQueue` (r:0 w:1) + /// Proof: `Revive::DeletionQueue` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `Measured`) + /// Storage: `Revive::ImmutableDataOf` (r:0 w:1) + /// Proof: `Revive::ImmutableDataOf` (`max_values`: None, `max_size`: Some(4118), added: 6593, mode: `Measured`) + fn seal_terminate() -> Weight { + // Proof Size summary in bytes: + // Measured: `317` + // Estimated: `3782` + // Minimum execution time: 18_491_000 picoseconds. + Weight::from_parts(19_213_000, 0) + .saturating_add(Weight::from_parts(0, 3782)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// The range of component `t` is `[0, 4]`. + /// The range of component `n` is `[0, 448]`. + fn seal_deposit_event(t: u32, n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_473_000 picoseconds. + Weight::from_parts(5_467_645, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 3_589 + .saturating_add(Weight::from_parts(259_510, 0).saturating_mul(t.into())) + // Standard Error: 36 + .saturating_add(Weight::from_parts(1_218, 0).saturating_mul(n.into())) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn get_storage_empty() -> Weight { + // Proof Size summary in bytes: + // Measured: `685` + // Estimated: `685` + // Minimum execution time: 9_696_000 picoseconds. + Weight::from_parts(10_284_000, 0) + .saturating_add(Weight::from_parts(0, 685)) + .saturating_add(T::DbWeight::get().reads(1)) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn get_storage_full() -> Weight { + // Proof Size summary in bytes: + // Measured: `10695` + // Estimated: `10695` + // Minimum execution time: 44_006_000 picoseconds. + Weight::from_parts(46_013_000, 0) + .saturating_add(Weight::from_parts(0, 10695)) + .saturating_add(T::DbWeight::get().reads(1)) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn set_storage_empty() -> Weight { + // Proof Size summary in bytes: + // Measured: `685` + // Estimated: `685` + // Minimum execution time: 11_025_000 picoseconds. + Weight::from_parts(11_572_000, 0) + .saturating_add(Weight::from_parts(0, 685)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn set_storage_full() -> Weight { + // Proof Size summary in bytes: + // Measured: `10695` + // Estimated: `10695` + // Minimum execution time: 46_432_000 picoseconds. + Weight::from_parts(48_360_000, 0) + .saturating_add(Weight::from_parts(0, 10695)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 448]`. + /// The range of component `o` is `[0, 448]`. + fn seal_set_storage(n: u32, o: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `253 + o * (1 ±0)` + // Estimated: `252 + o * (1 ±0)` + // Minimum execution time: 11_752_000 picoseconds. + Weight::from_parts(12_657_378, 0) + .saturating_add(Weight::from_parts(0, 252)) + // Standard Error: 60 + .saturating_add(Weight::from_parts(386, 0).saturating_mul(n.into())) + // Standard Error: 60 + .saturating_add(Weight::from_parts(591, 0).saturating_mul(o.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(o.into())) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 448]`. + fn seal_clear_storage(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `253 + n * (1 ±0)` + // Estimated: `252 + n * (1 ±0)` + // Minimum execution time: 11_317_000 picoseconds. + Weight::from_parts(12_361_811, 0) + .saturating_add(Weight::from_parts(0, 252)) + // Standard Error: 81 + .saturating_add(Weight::from_parts(954, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 448]`. + fn seal_get_storage(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `253 + n * (1 ±0)` + // Estimated: `252 + n * (1 ±0)` + // Minimum execution time: 10_785_000 picoseconds. + Weight::from_parts(11_924_771, 0) + .saturating_add(Weight::from_parts(0, 252)) + // Standard Error: 90 + .saturating_add(Weight::from_parts(1_871, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 448]`. + fn seal_contains_storage(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `253 + n * (1 ±0)` + // Estimated: `252 + n * (1 ±0)` + // Minimum execution time: 9_995_000 picoseconds. + Weight::from_parts(11_238_158, 0) + .saturating_add(Weight::from_parts(0, 252)) + // Standard Error: 82 + .saturating_add(Weight::from_parts(757, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 448]`. + fn seal_take_storage(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `253 + n * (1 ±0)` + // Estimated: `252 + n * (1 ±0)` + // Minimum execution time: 12_020_000 picoseconds. + Weight::from_parts(13_238_417, 0) + .saturating_add(Weight::from_parts(0, 252)) + // Standard Error: 83 + .saturating_add(Weight::from_parts(1_535, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) + } + fn set_transient_storage_empty() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 1_812_000 picoseconds. + Weight::from_parts(1_959_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn set_transient_storage_full() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_227_000 picoseconds. + Weight::from_parts(2_401_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn get_transient_storage_empty() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 1_797_000 picoseconds. + Weight::from_parts(1_889_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn get_transient_storage_full() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 1_991_000 picoseconds. + Weight::from_parts(2_077_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn rollback_transient_storage() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 1_204_000 picoseconds. + Weight::from_parts(1_324_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// The range of component `n` is `[0, 448]`. + /// The range of component `o` is `[0, 448]`. + fn seal_set_transient_storage(n: u32, o: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_695_000 picoseconds. + Weight::from_parts(2_981_114, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 15 + .saturating_add(Weight::from_parts(360, 0).saturating_mul(n.into())) + // Standard Error: 15 + .saturating_add(Weight::from_parts(370, 0).saturating_mul(o.into())) + } + /// The range of component `n` is `[0, 448]`. + fn seal_clear_transient_storage(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_453_000 picoseconds. + Weight::from_parts(2_856_117, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 22 + .saturating_add(Weight::from_parts(368, 0).saturating_mul(n.into())) + } + /// The range of component `n` is `[0, 448]`. + fn seal_get_transient_storage(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_333_000 picoseconds. + Weight::from_parts(2_491_149, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 15 + .saturating_add(Weight::from_parts(393, 0).saturating_mul(n.into())) + } + /// The range of component `n` is `[0, 448]`. + fn seal_contains_transient_storage(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_087_000 picoseconds. + Weight::from_parts(2_351_674, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 19 + .saturating_add(Weight::from_parts(238, 0).saturating_mul(n.into())) + } + /// The range of component `n` is `[0, 448]`. + fn seal_take_transient_storage(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_037_000 picoseconds. + Weight::from_parts(3_299_553, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 18 + .saturating_add(Weight::from_parts(6, 0).saturating_mul(n.into())) + } + /// Storage: `Revive::AddressSuffix` (r:1 w:0) + /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) + /// Storage: `Revive::ContractInfoOf` (r:1 w:0) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) + /// Storage: `Revive::CodeInfoOf` (r:1 w:0) + /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) + /// Storage: `Revive::PristineCode` (r:1 w:0) + /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// The range of component `t` is `[0, 1]`. + /// The range of component `i` is `[0, 262144]`. + fn seal_call(t: u32, i: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1291 + t * (206 ±0)` + // Estimated: `4756 + t * (2481 ±0)` + // Minimum execution time: 42_906_000 picoseconds. + Weight::from_parts(44_016_242, 0) + .saturating_add(Weight::from_parts(0, 4756)) + // Standard Error: 59_276 + .saturating_add(Weight::from_parts(7_432_557, 0).saturating_mul(t.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(4, 0).saturating_mul(i.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(t.into()))) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 2481).saturating_mul(t.into())) + } + /// Storage: `Revive::ContractInfoOf` (r:1 w:0) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) + /// Storage: `Revive::CodeInfoOf` (r:1 w:0) + /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) + /// Storage: `Revive::PristineCode` (r:1 w:0) + /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) + fn seal_delegate_call() -> Weight { + // Proof Size summary in bytes: + // Measured: `1234` + // Estimated: `4699` + // Minimum execution time: 35_555_000 picoseconds. + Weight::from_parts(36_949_000, 0) + .saturating_add(Weight::from_parts(0, 4699)) + .saturating_add(T::DbWeight::get().reads(3)) + } + /// Storage: `Revive::CodeInfoOf` (r:1 w:1) + /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) + /// Storage: `Revive::PristineCode` (r:1 w:0) + /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) + /// Storage: `Revive::ContractInfoOf` (r:1 w:1) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// The range of component `i` is `[0, 262144]`. + fn seal_instantiate(i: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1219` + // Estimated: `4712` + // Minimum execution time: 148_635_000 picoseconds. + Weight::from_parts(143_195_864, 0) + .saturating_add(Weight::from_parts(0, 4712)) + // Standard Error: 8 + .saturating_add(Weight::from_parts(4_088, 0).saturating_mul(i.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// The range of component `n` is `[0, 262144]`. + fn seal_hash_sha2_256(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 871_000 picoseconds. + Weight::from_parts(5_089_784, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 3 + .saturating_add(Weight::from_parts(1_465, 0).saturating_mul(n.into())) + } + /// The range of component `n` is `[0, 262144]`. + fn seal_hash_keccak_256(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 1_349_000 picoseconds. + Weight::from_parts(4_340_331, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 3 + .saturating_add(Weight::from_parts(3_651, 0).saturating_mul(n.into())) + } + /// The range of component `n` is `[0, 262144]`. + fn seal_hash_blake2_256(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 879_000 picoseconds. + Weight::from_parts(4_465_070, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 3 + .saturating_add(Weight::from_parts(1_616, 0).saturating_mul(n.into())) + } + /// The range of component `n` is `[0, 262144]`. + fn seal_hash_blake2_128(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 854_000 picoseconds. + Weight::from_parts(5_157_484, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 3 + .saturating_add(Weight::from_parts(1_652, 0).saturating_mul(n.into())) + } + /// The range of component `n` is `[0, 261889]`. + fn seal_sr25519_verify(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 45_140_000 picoseconds. + Weight::from_parts(35_105_376, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 9 + .saturating_add(Weight::from_parts(5_548, 0).saturating_mul(n.into())) + } + fn seal_ecdsa_recover() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 48_012_000 picoseconds. + Weight::from_parts(49_358_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + fn seal_ecdsa_to_eth_address() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_007_000 picoseconds. + Weight::from_parts(13_211_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `Revive::CodeInfoOf` (r:1 w:1) + /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) + fn seal_set_code_hash() -> Weight { + // Proof Size summary in bytes: + // Measured: `298` + // Estimated: `3763` + // Minimum execution time: 12_462_000 picoseconds. + Weight::from_parts(12_976_000, 0) + .saturating_add(Weight::from_parts(0, 3763)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// The range of component `r` is `[0, 5000]`. + fn instr(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 9_600_000 picoseconds. + Weight::from_parts(11_394_904, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 97 + .saturating_add(Weight::from_parts(73_509, 0).saturating_mul(r.into())) + } +} diff --git a/substrate/frame/revive/src/weights.rs b/substrate/frame/revive/src/weights.rs index 25d5d21e6dc07..6e9e82b891641 100644 --- a/substrate/frame/revive/src/weights.rs +++ b/substrate/frame/revive/src/weights.rs @@ -18,17 +18,18 @@ //! Autogenerated weights for `pallet_revive` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-12-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-01-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `19e0eeaa3bc2`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! HOSTNAME: `985569d2aee4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: -// target/production/substrate-node +// frame-omni-bencher +// v1 // benchmark // pallet // --extrinsic=* -// --chain=dev +// --runtime=target/production/wbuild/kitchensink-runtime/kitchensink_runtime.wasm // --pallet=pallet_revive // --header=/__w/polkadot-sdk/polkadot-sdk/substrate/HEADER-APACHE2 // --output=/__w/polkadot-sdk/polkadot-sdk/substrate/frame/revive/src/weights.rs @@ -40,6 +41,8 @@ // --no-storage-info // --no-min-squares // --no-median-slopes +// --genesis-builder-policy=none +// --exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic,pallet_nomination_pools,pallet_remark,pallet_transaction_storage #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -137,10 +140,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Revive::DeletionQueueCounter` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) fn on_process_deletion_queue_batch() -> Weight { // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `1594` - // Minimum execution time: 2_859_000 picoseconds. - Weight::from_parts(3_007_000, 1594) + // Measured: `0` + // Estimated: `1485` + // Minimum execution time: 950_000 picoseconds. + Weight::from_parts(983_000, 1485) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -148,12 +151,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `k` is `[0, 1024]`. fn on_initialize_per_trie_key(k: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `425 + k * (69 ±0)` - // Estimated: `415 + k * (70 ±0)` - // Minimum execution time: 15_640_000 picoseconds. - Weight::from_parts(1_609_026, 415) - // Standard Error: 1_359 - .saturating_add(Weight::from_parts(1_204_420, 0).saturating_mul(k.into())) + // Measured: `230 + k * (69 ±0)` + // Estimated: `222 + k * (70 ±0)` + // Minimum execution time: 13_673_000 picoseconds. + Weight::from_parts(13_960_000, 222) + // Standard Error: 1_211 + .saturating_add(Weight::from_parts(1_297_439, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -163,7 +166,7 @@ impl WeightInfo for SubstrateWeight { /// Storage: `Revive::AddressSuffix` (r:2 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:1 w:0) @@ -173,23 +176,25 @@ impl WeightInfo for SubstrateWeight { /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. - fn call_with_code_per_byte(_c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1463` - // Estimated: `7403` - // Minimum execution time: 89_437_000 picoseconds. - Weight::from_parts(94_285_182, 7403) + fn call_with_code_per_byte(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1194` + // Estimated: `7134` + // Minimum execution time: 105_290_000 picoseconds. + Weight::from_parts(108_709_819, 7134) + // Standard Error: 1 + .saturating_add(Weight::from_parts(4, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Balances::Holds` (r:2 w:2) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Timestamp::Now` (r:1 w:0) /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) @@ -198,16 +203,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. /// The range of component `i` is `[0, 262144]`. - fn instantiate_with_code(c: u32, i: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `364` - // Estimated: `6327` - // Minimum execution time: 187_904_000 picoseconds. - Weight::from_parts(153_252_081, 6327) - // Standard Error: 11 - .saturating_add(Weight::from_parts(49, 0).saturating_mul(c.into())) - // Standard Error: 11 - .saturating_add(Weight::from_parts(4_528, 0).saturating_mul(i.into())) + fn instantiate_with_code(_c: u32, i: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `93` + // Estimated: `6033` + // Minimum execution time: 212_951_000 picoseconds. + Weight::from_parts(200_939_222, 6033) + // Standard Error: 9 + .saturating_add(Weight::from_parts(4_382, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -218,29 +221,29 @@ impl WeightInfo for SubstrateWeight { /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Timestamp::Now` (r:1 w:0) /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// The range of component `i` is `[0, 262144]`. fn instantiate(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1296` - // Estimated: `4758` - // Minimum execution time: 154_656_000 picoseconds. - Weight::from_parts(139_308_398, 4758) - // Standard Error: 16 - .saturating_add(Weight::from_parts(4_421, 0).saturating_mul(i.into())) + // Measured: `987` + // Estimated: `4452` + // Minimum execution time: 175_725_000 picoseconds. + Weight::from_parts(168_149_107, 4452) + // Standard Error: 11 + .saturating_add(Weight::from_parts(4_280, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } /// Storage: `Revive::AddressSuffix` (r:2 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:1 w:0) @@ -251,82 +254,80 @@ impl WeightInfo for SubstrateWeight { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) fn call() -> Weight { // Proof Size summary in bytes: - // Measured: `1463` - // Estimated: `7403` - // Minimum execution time: 138_815_000 picoseconds. - Weight::from_parts(149_067_000, 7403) + // Measured: `1194` + // Estimated: `7134` + // Minimum execution time: 154_639_000 picoseconds. + Weight::from_parts(161_309_000, 7134) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:0 w:1) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. - fn upload_code(c: u32, ) -> Weight { + fn upload_code(_c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `3574` - // Minimum execution time: 49_978_000 picoseconds. - Weight::from_parts(51_789_325, 3574) - // Standard Error: 0 - .saturating_add(Weight::from_parts(1, 0).saturating_mul(c.into())) + // Measured: `0` + // Estimated: `3465` + // Minimum execution time: 55_321_000 picoseconds. + Weight::from_parts(57_273_933, 3465) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:0 w:1) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) fn remove_code() -> Weight { // Proof Size summary in bytes: - // Measured: `285` - // Estimated: `3750` - // Minimum execution time: 43_833_000 picoseconds. - Weight::from_parts(44_660_000, 3750) + // Measured: `181` + // Estimated: `3646` + // Minimum execution time: 45_472_000 picoseconds. + Weight::from_parts(46_113_000, 3646) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:2 w:2) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) fn set_code() -> Weight { // Proof Size summary in bytes: - // Measured: `529` - // Estimated: `6469` - // Minimum execution time: 26_717_000 picoseconds. - Weight::from_parts(28_566_000, 6469) + // Measured: `424` + // Estimated: `6364` + // Minimum execution time: 22_721_000 picoseconds. + Weight::from_parts(23_444_000, 6364) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: `Revive::AddressSuffix` (r:1 w:1) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) fn map_account() -> Weight { // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `3574` - // Minimum execution time: 39_401_000 picoseconds. - Weight::from_parts(40_542_000, 3574) + // Measured: `0` + // Estimated: `3465` + // Minimum execution time: 48_548_000 picoseconds. + Weight::from_parts(49_276_000, 3465) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// Storage: `Revive::AddressSuffix` (r:0 w:1) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) fn unmap_account() -> Weight { // Proof Size summary in bytes: // Measured: `56` // Estimated: `3521` - // Minimum execution time: 31_570_000 picoseconds. - Weight::from_parts(32_302_000, 3521) + // Minimum execution time: 40_265_000 picoseconds. + Weight::from_parts(41_104_000, 3521) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -336,10 +337,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `Measured`) fn dispatch_as_fallback_account() -> Weight { // Proof Size summary in bytes: - // Measured: `145` - // Estimated: `3610` - // Minimum execution time: 13_607_000 picoseconds. - Weight::from_parts(13_903_000, 3610) + // Measured: `0` + // Estimated: `3465` + // Minimum execution time: 8_703_000 picoseconds. + Weight::from_parts(8_822_000, 3465) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// The range of component `r` is `[0, 1600]`. @@ -347,115 +348,115 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_400_000 picoseconds. - Weight::from_parts(8_388_251, 0) - // Standard Error: 283 - .saturating_add(Weight::from_parts(165_630, 0).saturating_mul(r.into())) + // Minimum execution time: 7_015_000 picoseconds. + Weight::from_parts(8_115_063, 0) + // Standard Error: 231 + .saturating_add(Weight::from_parts(161_848, 0).saturating_mul(r.into())) } fn seal_caller() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 275_000 picoseconds. - Weight::from_parts(305_000, 0) + // Minimum execution time: 387_000 picoseconds. + Weight::from_parts(416_000, 0) } fn seal_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 224_000 picoseconds. - Weight::from_parts(265_000, 0) + // Minimum execution time: 357_000 picoseconds. + Weight::from_parts(379_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) fn seal_is_contract() -> Weight { // Proof Size summary in bytes: - // Measured: `306` - // Estimated: `3771` - // Minimum execution time: 10_004_000 picoseconds. - Weight::from_parts(10_336_000, 3771) + // Measured: `202` + // Estimated: `3667` + // Minimum execution time: 7_013_000 picoseconds. + Weight::from_parts(7_319_000, 3667) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) fn seal_to_account_id() -> Weight { // Proof Size summary in bytes: - // Measured: `212` - // Estimated: `3677` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(4_000_000, 3677) + // Measured: `144` + // Estimated: `3609` + // Minimum execution time: 6_938_000 picoseconds. + Weight::from_parts(7_168_000, 3609) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) fn seal_code_hash() -> Weight { // Proof Size summary in bytes: - // Measured: `403` - // Estimated: `3868` - // Minimum execution time: 11_054_000 picoseconds. - Weight::from_parts(11_651_000, 3868) + // Measured: `298` + // Estimated: `3763` + // Minimum execution time: 8_142_000 picoseconds. + Weight::from_parts(8_425_000, 3763) .saturating_add(T::DbWeight::get().reads(1_u64)) } fn seal_own_code_hash() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 252_000 picoseconds. - Weight::from_parts(305_000, 0) + // Minimum execution time: 375_000 picoseconds. + Weight::from_parts(396_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) fn seal_code_size() -> Weight { // Proof Size summary in bytes: - // Measured: `473` - // Estimated: `3938` - // Minimum execution time: 14_461_000 picoseconds. - Weight::from_parts(15_049_000, 3938) + // Measured: `368` + // Estimated: `3833` + // Minimum execution time: 12_130_000 picoseconds. + Weight::from_parts(12_491_000, 3833) .saturating_add(T::DbWeight::get().reads(2_u64)) } fn seal_caller_is_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 312_000 picoseconds. - Weight::from_parts(338_000, 0) + // Minimum execution time: 432_000 picoseconds. + Weight::from_parts(477_000, 0) } fn seal_caller_is_root() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 243_000 picoseconds. - Weight::from_parts(299_000, 0) + // Minimum execution time: 377_000 picoseconds. + Weight::from_parts(403_000, 0) } fn seal_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 231_000 picoseconds. - Weight::from_parts(271_000, 0) + // Minimum execution time: 362_000 picoseconds. + Weight::from_parts(382_000, 0) } fn seal_weight_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 683_000 picoseconds. - Weight::from_parts(732_000, 0) + // Minimum execution time: 835_000 picoseconds. + Weight::from_parts(883_000, 0) } fn seal_ref_time_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 226_000 picoseconds. - Weight::from_parts(273_000, 0) + // Minimum execution time: 352_000 picoseconds. + Weight::from_parts(384_000, 0) } fn seal_balance() -> Weight { // Proof Size summary in bytes: - // Measured: `102` + // Measured: `51` // Estimated: `0` - // Minimum execution time: 4_626_000 picoseconds. - Weight::from_parts(4_842_000, 0) + // Minimum execution time: 4_322_000 picoseconds. + Weight::from_parts(4_520_000, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) @@ -463,10 +464,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) fn seal_balance_of() -> Weight { // Proof Size summary in bytes: - // Measured: `264` - // Estimated: `3729` - // Minimum execution time: 12_309_000 picoseconds. - Weight::from_parts(12_653_000, 3729) + // Measured: `159` + // Estimated: `3624` + // Minimum execution time: 10_002_000 picoseconds. + Weight::from_parts(10_312_000, 3624) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `Revive::ImmutableDataOf` (r:1 w:0) @@ -474,12 +475,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[1, 4096]`. fn seal_get_immutable_data(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `238 + n * (1 ±0)` - // Estimated: `3703 + n * (1 ±0)` - // Minimum execution time: 5_838_000 picoseconds. - Weight::from_parts(9_570_778, 3703) - // Standard Error: 19 - .saturating_add(Weight::from_parts(721, 0).saturating_mul(n.into())) + // Measured: `134 + n * (1 ±0)` + // Estimated: `3599 + n * (1 ±0)` + // Minimum execution time: 6_651_000 picoseconds. + Weight::from_parts(7_144_357, 3599) + // Standard Error: 2 + .saturating_add(Weight::from_parts(627, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -490,147 +491,145 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_910_000 picoseconds. - Weight::from_parts(2_205_396, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(538, 0).saturating_mul(n.into())) + // Minimum execution time: 2_288_000 picoseconds. + Weight::from_parts(2_449_229, 0) + // Standard Error: 1 + .saturating_add(Weight::from_parts(577, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().writes(1_u64)) } fn seal_value_transferred() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 224_000 picoseconds. - Weight::from_parts(274_000, 0) + // Minimum execution time: 369_000 picoseconds. + Weight::from_parts(390_000, 0) } fn seal_minimum_balance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 231_000 picoseconds. - Weight::from_parts(279_000, 0) + // Minimum execution time: 352_000 picoseconds. + Weight::from_parts(378_000, 0) } fn seal_return_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 229_000 picoseconds. - Weight::from_parts(267_000, 0) + // Minimum execution time: 351_000 picoseconds. + Weight::from_parts(388_000, 0) } fn seal_call_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 218_000 picoseconds. - Weight::from_parts(267_000, 0) + // Minimum execution time: 370_000 picoseconds. + Weight::from_parts(391_000, 0) } fn seal_gas_limit() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 225_000 picoseconds. - Weight::from_parts(280_000, 0) + // Minimum execution time: 403_000 picoseconds. + Weight::from_parts(433_000, 0) } fn seal_gas_price() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 274_000 picoseconds. - Weight::from_parts(323_000, 0) + // Minimum execution time: 356_000 picoseconds. + Weight::from_parts(377_000, 0) } fn seal_base_fee() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 239_000 picoseconds. - Weight::from_parts(290_000, 0) + // Minimum execution time: 364_000 picoseconds. + Weight::from_parts(384_000, 0) } fn seal_block_number() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 224_000 picoseconds. - Weight::from_parts(274_000, 0) + // Minimum execution time: 358_000 picoseconds. + Weight::from_parts(375_000, 0) } /// Storage: `System::BlockHash` (r:1 w:0) /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `Measured`) fn seal_block_hash() -> Weight { // Proof Size summary in bytes: - // Measured: `30` - // Estimated: `3495` - // Minimum execution time: 3_430_000 picoseconds. - Weight::from_parts(3_692_000, 3495) + // Measured: `0` + // Estimated: `3465` + // Minimum execution time: 3_052_000 picoseconds. + Weight::from_parts(3_196_000, 3465) .saturating_add(T::DbWeight::get().reads(1_u64)) } fn seal_now() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 241_000 picoseconds. - Weight::from_parts(290_000, 0) + // Minimum execution time: 365_000 picoseconds. + Weight::from_parts(382_000, 0) } fn seal_weight_to_fee() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_355_000 picoseconds. - Weight::from_parts(1_493_000, 0) + // Minimum execution time: 1_563_000 picoseconds. + Weight::from_parts(1_637_000, 0) } /// The range of component `n` is `[0, 262140]`. fn seal_copy_to_contract(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 348_000 picoseconds. - Weight::from_parts(1_004_890, 0) + // Minimum execution time: 510_000 picoseconds. + Weight::from_parts(816_426, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(202, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(236, 0).saturating_mul(n.into())) } fn seal_call_data_load() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 222_000 picoseconds. - Weight::from_parts(256_000, 0) + // Minimum execution time: 369_000 picoseconds. + Weight::from_parts(391_000, 0) } /// The range of component `n` is `[0, 262144]`. fn seal_call_data_copy(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 240_000 picoseconds. - Weight::from_parts(330_609, 0) + // Minimum execution time: 373_000 picoseconds. + Weight::from_parts(475_229, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(114, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(148, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262140]`. fn seal_return(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 232_000 picoseconds. - Weight::from_parts(264_000, 0) + // Minimum execution time: 376_000 picoseconds. + Weight::from_parts(377_040, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(208, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(239, 0).saturating_mul(n.into())) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::DeletionQueueCounter` (r:1 w:1) /// Proof: `Revive::DeletionQueueCounter` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) - /// Storage: `Revive::CodeInfoOf` (r:33 w:33) + /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::DeletionQueue` (r:0 w:1) /// Proof: `Revive::DeletionQueue` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `Measured`) /// Storage: `Revive::ImmutableDataOf` (r:0 w:1) /// Proof: `Revive::ImmutableDataOf` (`max_values`: None, `max_size`: Some(4118), added: 6593, mode: `Measured`) - /// The range of component `n` is `[0, 32]`. fn seal_terminate() -> Weight { // Proof Size summary in bytes: - // Measured: `322 + n * (88 ±0)` - // Estimated: `3787 + n * (2563 ±0)` - // Minimum execution time: 21_920_000 picoseconds. - Weight::from_parts(21_725_868, 3787) - // Standard Error: 11_165 + // Measured: `215` + // Estimated: `3680` + // Minimum execution time: 17_543_000 picoseconds. + Weight::from_parts(18_000_000, 3680) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -640,41 +639,41 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_140_000 picoseconds. - Weight::from_parts(4_259_301, 0) - // Standard Error: 3_362 - .saturating_add(Weight::from_parts(194_546, 0).saturating_mul(t.into())) - // Standard Error: 34 - .saturating_add(Weight::from_parts(774, 0).saturating_mul(n.into())) + // Minimum execution time: 4_971_000 picoseconds. + Weight::from_parts(4_896_502, 0) + // Standard Error: 2_696 + .saturating_add(Weight::from_parts(245_882, 0).saturating_mul(t.into())) + // Standard Error: 27 + .saturating_add(Weight::from_parts(1_057, 0).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) fn get_storage_empty() -> Weight { // Proof Size summary in bytes: - // Measured: `680` - // Estimated: `680` - // Minimum execution time: 10_747_000 picoseconds. - Weight::from_parts(11_276_000, 680) + // Measured: `584` + // Estimated: `584` + // Minimum execution time: 6_654_000 picoseconds. + Weight::from_parts(6_957_000, 584) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) fn get_storage_full() -> Weight { // Proof Size summary in bytes: - // Measured: `10690` - // Estimated: `10690` - // Minimum execution time: 42_076_000 picoseconds. - Weight::from_parts(43_381_000, 10690) + // Measured: `10594` + // Estimated: `10594` + // Minimum execution time: 43_275_000 picoseconds. + Weight::from_parts(44_652_000, 10594) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_storage_empty() -> Weight { // Proof Size summary in bytes: - // Measured: `680` - // Estimated: `680` - // Minimum execution time: 11_703_000 picoseconds. - Weight::from_parts(12_308_000, 680) + // Measured: `584` + // Estimated: `584` + // Minimum execution time: 7_686_000 picoseconds. + Weight::from_parts(8_036_000, 584) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -682,10 +681,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_storage_full() -> Weight { // Proof Size summary in bytes: - // Measured: `10690` - // Estimated: `10690` - // Minimum execution time: 43_460_000 picoseconds. - Weight::from_parts(45_165_000, 10690) + // Measured: `10594` + // Estimated: `10594` + // Minimum execution time: 44_696_000 picoseconds. + Weight::from_parts(46_250_000, 10594) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -695,14 +694,14 @@ impl WeightInfo for SubstrateWeight { /// The range of component `o` is `[0, 448]`. fn seal_set_storage(n: u32, o: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `248 + o * (1 ±0)` - // Estimated: `247 + o * (1 ±0)` - // Minimum execution time: 9_087_000 picoseconds. - Weight::from_parts(11_787_486, 247) - // Standard Error: 179 - .saturating_add(Weight::from_parts(976, 0).saturating_mul(n.into())) - // Standard Error: 179 - .saturating_add(Weight::from_parts(3_151, 0).saturating_mul(o.into())) + // Measured: `152 + o * (1 ±0)` + // Estimated: `151 + o * (1 ±0)` + // Minimum execution time: 8_553_000 picoseconds. + Weight::from_parts(8_987_197, 151) + // Standard Error: 53 + .saturating_add(Weight::from_parts(501, 0).saturating_mul(n.into())) + // Standard Error: 53 + .saturating_add(Weight::from_parts(422, 0).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(o.into())) @@ -712,12 +711,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 448]`. fn seal_clear_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `248 + n * (1 ±0)` - // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_611_000 picoseconds. - Weight::from_parts(11_791_390, 247) - // Standard Error: 308 - .saturating_add(Weight::from_parts(3_943, 0).saturating_mul(n.into())) + // Measured: `152 + n * (1 ±0)` + // Estimated: `151 + n * (1 ±0)` + // Minimum execution time: 8_104_000 picoseconds. + Weight::from_parts(8_704_225, 151) + // Standard Error: 48 + .saturating_add(Weight::from_parts(511, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) @@ -727,12 +726,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 448]`. fn seal_get_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `248 + n * (1 ±0)` - // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_389_000 picoseconds. - Weight::from_parts(11_625_480, 247) - // Standard Error: 315 - .saturating_add(Weight::from_parts(4_487, 0).saturating_mul(n.into())) + // Measured: `152 + n * (1 ±0)` + // Estimated: `151 + n * (1 ±0)` + // Minimum execution time: 7_528_000 picoseconds. + Weight::from_parts(8_374_996, 151) + // Standard Error: 56 + .saturating_add(Weight::from_parts(1_330, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -741,12 +740,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 448]`. fn seal_contains_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `248 + n * (1 ±0)` - // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 7_947_000 picoseconds. - Weight::from_parts(10_970_587, 247) - // Standard Error: 310 - .saturating_add(Weight::from_parts(3_675, 0).saturating_mul(n.into())) + // Measured: `152 + n * (1 ±0)` + // Estimated: `151 + n * (1 ±0)` + // Minimum execution time: 7_277_000 picoseconds. + Weight::from_parts(7_837_467, 151) + // Standard Error: 41 + .saturating_add(Weight::from_parts(449, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -755,12 +754,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 448]`. fn seal_take_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `248 + n * (1 ±0)` - // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 9_071_000 picoseconds. - Weight::from_parts(12_525_027, 247) - // Standard Error: 328 - .saturating_add(Weight::from_parts(4_427, 0).saturating_mul(n.into())) + // Measured: `152 + n * (1 ±0)` + // Estimated: `151 + n * (1 ±0)` + // Minimum execution time: 8_620_000 picoseconds. + Weight::from_parts(9_440_899, 151) + // Standard Error: 59 + .saturating_add(Weight::from_parts(1_222, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) @@ -769,36 +768,36 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_487_000 picoseconds. - Weight::from_parts(1_611_000, 0) + // Minimum execution time: 1_772_000 picoseconds. + Weight::from_parts(1_862_000, 0) } fn set_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_852_000 picoseconds. - Weight::from_parts(1_982_000, 0) + // Minimum execution time: 2_226_000 picoseconds. + Weight::from_parts(2_294_000, 0) } fn get_transient_storage_empty() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_467_000 picoseconds. - Weight::from_parts(1_529_000, 0) + // Minimum execution time: 1_725_000 picoseconds. + Weight::from_parts(1_846_000, 0) } fn get_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_630_000 picoseconds. - Weight::from_parts(1_712_000, 0) + // Minimum execution time: 1_860_000 picoseconds. + Weight::from_parts(1_978_000, 0) } fn rollback_transient_storage() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_188_000 picoseconds. - Weight::from_parts(1_268_000, 0) + // Minimum execution time: 1_207_000 picoseconds. + Weight::from_parts(1_257_000, 0) } /// The range of component `n` is `[0, 448]`. /// The range of component `o` is `[0, 448]`. @@ -806,57 +805,55 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_197_000 picoseconds. - Weight::from_parts(2_464_654, 0) - // Standard Error: 17 - .saturating_add(Weight::from_parts(296, 0).saturating_mul(n.into())) - // Standard Error: 17 - .saturating_add(Weight::from_parts(342, 0).saturating_mul(o.into())) + // Minimum execution time: 2_569_000 picoseconds. + Weight::from_parts(2_799_621, 0) + // Standard Error: 15 + .saturating_add(Weight::from_parts(259, 0).saturating_mul(n.into())) + // Standard Error: 15 + .saturating_add(Weight::from_parts(352, 0).saturating_mul(o.into())) } /// The range of component `n` is `[0, 448]`. fn seal_clear_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_005_000 picoseconds. - Weight::from_parts(2_381_053, 0) - // Standard Error: 23 - .saturating_add(Weight::from_parts(322, 0).saturating_mul(n.into())) + // Minimum execution time: 2_283_000 picoseconds. + Weight::from_parts(2_617_432, 0) + // Standard Error: 20 + .saturating_add(Weight::from_parts(356, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 448]`. fn seal_get_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_853_000 picoseconds. - Weight::from_parts(2_082_772, 0) - // Standard Error: 20 - .saturating_add(Weight::from_parts(322, 0).saturating_mul(n.into())) + // Minimum execution time: 2_092_000 picoseconds. + Weight::from_parts(2_328_854, 0) + // Standard Error: 15 + .saturating_add(Weight::from_parts(409, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 448]`. fn seal_contains_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_711_000 picoseconds. - Weight::from_parts(1_899_649, 0) - // Standard Error: 16 - .saturating_add(Weight::from_parts(208, 0).saturating_mul(n.into())) + // Minimum execution time: 1_938_000 picoseconds. + Weight::from_parts(2_158_558, 0) + // Standard Error: 13 + .saturating_add(Weight::from_parts(224, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 448]`. - fn seal_take_transient_storage(n: u32, ) -> Weight { + fn seal_take_transient_storage(_n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_460_000 picoseconds. - Weight::from_parts(2_684_364, 0) - // Standard Error: 22 - .saturating_add(Weight::from_parts(56, 0).saturating_mul(n.into())) + // Minimum execution time: 2_753_000 picoseconds. + Weight::from_parts(3_047_513, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:1 w:0) @@ -867,31 +864,31 @@ impl WeightInfo for SubstrateWeight { /// The range of component `i` is `[0, 262144]`. fn seal_call(t: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1292 + t * (203 ±0)` - // Estimated: `4757 + t * (2480 ±0)` - // Minimum execution time: 40_031_000 picoseconds. - Weight::from_parts(41_527_691, 4757) - // Standard Error: 50_351 - .saturating_add(Weight::from_parts(1_112_950, 0).saturating_mul(t.into())) + // Measured: `1165 + t * (154 ±0)` + // Estimated: `4630 + t * (2392 ±0)` + // Minimum execution time: 36_345_000 picoseconds. + Weight::from_parts(37_090_824, 4630) + // Standard Error: 34_336 + .saturating_add(Weight::from_parts(6_362_713, 0).saturating_mul(t.into())) // Standard Error: 0 - .saturating_add(Weight::from_parts(1, 0).saturating_mul(i.into())) + .saturating_add(Weight::from_parts(2, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(t.into()))) .saturating_add(T::DbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_parts(0, 2480).saturating_mul(t.into())) + .saturating_add(Weight::from_parts(0, 2392).saturating_mul(t.into())) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:1 w:0) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) fn seal_delegate_call() -> Weight { // Proof Size summary in bytes: - // Measured: `1237` - // Estimated: `4702` - // Minimum execution time: 35_759_000 picoseconds. - Weight::from_parts(37_086_000, 4702) + // Measured: `1108` + // Estimated: `4573` + // Minimum execution time: 29_895_000 picoseconds. + Weight::from_parts(30_589_000, 4573) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) @@ -899,18 +896,18 @@ impl WeightInfo for SubstrateWeight { /// Storage: `Revive::PristineCode` (r:1 w:0) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// The range of component `i` is `[0, 262144]`. fn seal_instantiate(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1271` - // Estimated: `4710` - // Minimum execution time: 116_485_000 picoseconds. - Weight::from_parts(108_907_717, 4710) - // Standard Error: 12 - .saturating_add(Weight::from_parts(4_125, 0).saturating_mul(i.into())) + // Measured: `1041` + // Estimated: `4516` + // Minimum execution time: 133_320_000 picoseconds. + Weight::from_parts(127_179_909, 4516) + // Standard Error: 8 + .saturating_add(Weight::from_parts(4_050, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -919,73 +916,73 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 651_000 picoseconds. - Weight::from_parts(3_867_609, 0) + // Minimum execution time: 870_000 picoseconds. + Weight::from_parts(4_190_352, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(1_384, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_413, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_keccak_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_090_000 picoseconds. - Weight::from_parts(5_338_460, 0) + // Minimum execution time: 1_271_000 picoseconds. + Weight::from_parts(4_339_297, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(3_601, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(3_585, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_blake2_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 717_000 picoseconds. - Weight::from_parts(2_629_461, 0) + // Minimum execution time: 806_000 picoseconds. + Weight::from_parts(3_729_623, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(1_528, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_554, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_blake2_128(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 660_000 picoseconds. - Weight::from_parts(4_807_814, 0) + // Minimum execution time: 847_000 picoseconds. + Weight::from_parts(3_003_601, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(1_509, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_565, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 261889]`. fn seal_sr25519_verify(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 42_829_000 picoseconds. - Weight::from_parts(24_650_992, 0) - // Standard Error: 14 - .saturating_add(Weight::from_parts(5_212, 0).saturating_mul(n.into())) + // Minimum execution time: 44_840_000 picoseconds. + Weight::from_parts(32_690_260, 0) + // Standard Error: 10 + .saturating_add(Weight::from_parts(5_486, 0).saturating_mul(n.into())) } fn seal_ecdsa_recover() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 46_902_000 picoseconds. - Weight::from_parts(48_072_000, 0) + // Minimum execution time: 47_074_000 picoseconds. + Weight::from_parts(48_708_000, 0) } fn seal_ecdsa_to_eth_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_713_000 picoseconds. - Weight::from_parts(12_847_000, 0) + // Minimum execution time: 12_590_000 picoseconds. + Weight::from_parts(12_753_000, 0) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) fn seal_set_code_hash() -> Weight { // Proof Size summary in bytes: - // Measured: `300` - // Estimated: `3765` - // Minimum execution time: 17_657_000 picoseconds. - Weight::from_parts(18_419_000, 3765) + // Measured: `196` + // Estimated: `3661` + // Minimum execution time: 12_087_000 picoseconds. + Weight::from_parts(12_420_000, 3661) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -994,10 +991,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_899_000 picoseconds. - Weight::from_parts(10_489_171, 0) - // Standard Error: 104 - .saturating_add(Weight::from_parts(73_814, 0).saturating_mul(r.into())) + // Minimum execution time: 8_816_000 picoseconds. + Weight::from_parts(9_682_348, 0) + // Standard Error: 70 + .saturating_add(Weight::from_parts(73_858, 0).saturating_mul(r.into())) } } @@ -1007,10 +1004,10 @@ impl WeightInfo for () { /// Proof: `Revive::DeletionQueueCounter` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) fn on_process_deletion_queue_batch() -> Weight { // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `1594` - // Minimum execution time: 2_859_000 picoseconds. - Weight::from_parts(3_007_000, 1594) + // Measured: `0` + // Estimated: `1485` + // Minimum execution time: 950_000 picoseconds. + Weight::from_parts(983_000, 1485) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -1018,12 +1015,12 @@ impl WeightInfo for () { /// The range of component `k` is `[0, 1024]`. fn on_initialize_per_trie_key(k: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `425 + k * (69 ±0)` - // Estimated: `415 + k * (70 ±0)` - // Minimum execution time: 15_640_000 picoseconds. - Weight::from_parts(1_609_026, 415) - // Standard Error: 1_359 - .saturating_add(Weight::from_parts(1_204_420, 0).saturating_mul(k.into())) + // Measured: `230 + k * (69 ±0)` + // Estimated: `222 + k * (70 ±0)` + // Minimum execution time: 13_673_000 picoseconds. + Weight::from_parts(13_960_000, 222) + // Standard Error: 1_211 + .saturating_add(Weight::from_parts(1_297_439, 0).saturating_mul(k.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -1033,7 +1030,7 @@ impl WeightInfo for () { /// Storage: `Revive::AddressSuffix` (r:2 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:1 w:0) @@ -1043,23 +1040,25 @@ impl WeightInfo for () { /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. - fn call_with_code_per_byte(_c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1463` - // Estimated: `7403` - // Minimum execution time: 89_437_000 picoseconds. - Weight::from_parts(94_285_182, 7403) + fn call_with_code_per_byte(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1194` + // Estimated: `7134` + // Minimum execution time: 105_290_000 picoseconds. + Weight::from_parts(108_709_819, 7134) + // Standard Error: 1 + .saturating_add(Weight::from_parts(4, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Balances::Holds` (r:2 w:2) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Timestamp::Now` (r:1 w:0) /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) @@ -1068,16 +1067,14 @@ impl WeightInfo for () { /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. /// The range of component `i` is `[0, 262144]`. - fn instantiate_with_code(c: u32, i: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `364` - // Estimated: `6327` - // Minimum execution time: 187_904_000 picoseconds. - Weight::from_parts(153_252_081, 6327) - // Standard Error: 11 - .saturating_add(Weight::from_parts(49, 0).saturating_mul(c.into())) - // Standard Error: 11 - .saturating_add(Weight::from_parts(4_528, 0).saturating_mul(i.into())) + fn instantiate_with_code(_c: u32, i: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `93` + // Estimated: `6033` + // Minimum execution time: 212_951_000 picoseconds. + Weight::from_parts(200_939_222, 6033) + // Standard Error: 9 + .saturating_add(Weight::from_parts(4_382, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -1088,29 +1085,29 @@ impl WeightInfo for () { /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Timestamp::Now` (r:1 w:0) /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// The range of component `i` is `[0, 262144]`. fn instantiate(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1296` - // Estimated: `4758` - // Minimum execution time: 154_656_000 picoseconds. - Weight::from_parts(139_308_398, 4758) - // Standard Error: 16 - .saturating_add(Weight::from_parts(4_421, 0).saturating_mul(i.into())) + // Measured: `987` + // Estimated: `4452` + // Minimum execution time: 175_725_000 picoseconds. + Weight::from_parts(168_149_107, 4452) + // Standard Error: 11 + .saturating_add(Weight::from_parts(4_280, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } /// Storage: `Revive::AddressSuffix` (r:2 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:1 w:0) @@ -1121,82 +1118,80 @@ impl WeightInfo for () { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) fn call() -> Weight { // Proof Size summary in bytes: - // Measured: `1463` - // Estimated: `7403` - // Minimum execution time: 138_815_000 picoseconds. - Weight::from_parts(149_067_000, 7403) + // Measured: `1194` + // Estimated: `7134` + // Minimum execution time: 154_639_000 picoseconds. + Weight::from_parts(161_309_000, 7134) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:0 w:1) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. - fn upload_code(c: u32, ) -> Weight { + fn upload_code(_c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `3574` - // Minimum execution time: 49_978_000 picoseconds. - Weight::from_parts(51_789_325, 3574) - // Standard Error: 0 - .saturating_add(Weight::from_parts(1, 0).saturating_mul(c.into())) + // Measured: `0` + // Estimated: `3465` + // Minimum execution time: 55_321_000 picoseconds. + Weight::from_parts(57_273_933, 3465) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:0 w:1) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) fn remove_code() -> Weight { // Proof Size summary in bytes: - // Measured: `285` - // Estimated: `3750` - // Minimum execution time: 43_833_000 picoseconds. - Weight::from_parts(44_660_000, 3750) + // Measured: `181` + // Estimated: `3646` + // Minimum execution time: 45_472_000 picoseconds. + Weight::from_parts(46_113_000, 3646) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:2 w:2) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) fn set_code() -> Weight { // Proof Size summary in bytes: - // Measured: `529` - // Estimated: `6469` - // Minimum execution time: 26_717_000 picoseconds. - Weight::from_parts(28_566_000, 6469) + // Measured: `424` + // Estimated: `6364` + // Minimum execution time: 22_721_000 picoseconds. + Weight::from_parts(23_444_000, 6364) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: `Revive::AddressSuffix` (r:1 w:1) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) fn map_account() -> Weight { // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `3574` - // Minimum execution time: 39_401_000 picoseconds. - Weight::from_parts(40_542_000, 3574) + // Measured: `0` + // Estimated: `3465` + // Minimum execution time: 48_548_000 picoseconds. + Weight::from_parts(49_276_000, 3465) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// Storage: `Revive::AddressSuffix` (r:0 w:1) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) fn unmap_account() -> Weight { // Proof Size summary in bytes: // Measured: `56` // Estimated: `3521` - // Minimum execution time: 31_570_000 picoseconds. - Weight::from_parts(32_302_000, 3521) + // Minimum execution time: 40_265_000 picoseconds. + Weight::from_parts(41_104_000, 3521) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1206,10 +1201,10 @@ impl WeightInfo for () { /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `Measured`) fn dispatch_as_fallback_account() -> Weight { // Proof Size summary in bytes: - // Measured: `145` - // Estimated: `3610` - // Minimum execution time: 13_607_000 picoseconds. - Weight::from_parts(13_903_000, 3610) + // Measured: `0` + // Estimated: `3465` + // Minimum execution time: 8_703_000 picoseconds. + Weight::from_parts(8_822_000, 3465) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// The range of component `r` is `[0, 1600]`. @@ -1217,115 +1212,115 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_400_000 picoseconds. - Weight::from_parts(8_388_251, 0) - // Standard Error: 283 - .saturating_add(Weight::from_parts(165_630, 0).saturating_mul(r.into())) + // Minimum execution time: 7_015_000 picoseconds. + Weight::from_parts(8_115_063, 0) + // Standard Error: 231 + .saturating_add(Weight::from_parts(161_848, 0).saturating_mul(r.into())) } fn seal_caller() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 275_000 picoseconds. - Weight::from_parts(305_000, 0) + // Minimum execution time: 387_000 picoseconds. + Weight::from_parts(416_000, 0) } fn seal_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 224_000 picoseconds. - Weight::from_parts(265_000, 0) + // Minimum execution time: 357_000 picoseconds. + Weight::from_parts(379_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) fn seal_is_contract() -> Weight { // Proof Size summary in bytes: - // Measured: `306` - // Estimated: `3771` - // Minimum execution time: 10_004_000 picoseconds. - Weight::from_parts(10_336_000, 3771) + // Measured: `202` + // Estimated: `3667` + // Minimum execution time: 7_013_000 picoseconds. + Weight::from_parts(7_319_000, 3667) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) fn seal_to_account_id() -> Weight { // Proof Size summary in bytes: - // Measured: `212` - // Estimated: `3677` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(4_000_000, 3677) + // Measured: `144` + // Estimated: `3609` + // Minimum execution time: 6_938_000 picoseconds. + Weight::from_parts(7_168_000, 3609) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) fn seal_code_hash() -> Weight { // Proof Size summary in bytes: - // Measured: `403` - // Estimated: `3868` - // Minimum execution time: 11_054_000 picoseconds. - Weight::from_parts(11_651_000, 3868) + // Measured: `298` + // Estimated: `3763` + // Minimum execution time: 8_142_000 picoseconds. + Weight::from_parts(8_425_000, 3763) .saturating_add(RocksDbWeight::get().reads(1_u64)) } fn seal_own_code_hash() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 252_000 picoseconds. - Weight::from_parts(305_000, 0) + // Minimum execution time: 375_000 picoseconds. + Weight::from_parts(396_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) fn seal_code_size() -> Weight { // Proof Size summary in bytes: - // Measured: `473` - // Estimated: `3938` - // Minimum execution time: 14_461_000 picoseconds. - Weight::from_parts(15_049_000, 3938) + // Measured: `368` + // Estimated: `3833` + // Minimum execution time: 12_130_000 picoseconds. + Weight::from_parts(12_491_000, 3833) .saturating_add(RocksDbWeight::get().reads(2_u64)) } fn seal_caller_is_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 312_000 picoseconds. - Weight::from_parts(338_000, 0) + // Minimum execution time: 432_000 picoseconds. + Weight::from_parts(477_000, 0) } fn seal_caller_is_root() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 243_000 picoseconds. - Weight::from_parts(299_000, 0) + // Minimum execution time: 377_000 picoseconds. + Weight::from_parts(403_000, 0) } fn seal_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 231_000 picoseconds. - Weight::from_parts(271_000, 0) + // Minimum execution time: 362_000 picoseconds. + Weight::from_parts(382_000, 0) } fn seal_weight_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 683_000 picoseconds. - Weight::from_parts(732_000, 0) + // Minimum execution time: 835_000 picoseconds. + Weight::from_parts(883_000, 0) } fn seal_ref_time_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 226_000 picoseconds. - Weight::from_parts(273_000, 0) + // Minimum execution time: 352_000 picoseconds. + Weight::from_parts(384_000, 0) } fn seal_balance() -> Weight { // Proof Size summary in bytes: - // Measured: `102` + // Measured: `51` // Estimated: `0` - // Minimum execution time: 4_626_000 picoseconds. - Weight::from_parts(4_842_000, 0) + // Minimum execution time: 4_322_000 picoseconds. + Weight::from_parts(4_520_000, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) @@ -1333,10 +1328,10 @@ impl WeightInfo for () { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) fn seal_balance_of() -> Weight { // Proof Size summary in bytes: - // Measured: `264` - // Estimated: `3729` - // Minimum execution time: 12_309_000 picoseconds. - Weight::from_parts(12_653_000, 3729) + // Measured: `159` + // Estimated: `3624` + // Minimum execution time: 10_002_000 picoseconds. + Weight::from_parts(10_312_000, 3624) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `Revive::ImmutableDataOf` (r:1 w:0) @@ -1344,12 +1339,12 @@ impl WeightInfo for () { /// The range of component `n` is `[1, 4096]`. fn seal_get_immutable_data(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `238 + n * (1 ±0)` - // Estimated: `3703 + n * (1 ±0)` - // Minimum execution time: 5_838_000 picoseconds. - Weight::from_parts(9_570_778, 3703) - // Standard Error: 19 - .saturating_add(Weight::from_parts(721, 0).saturating_mul(n.into())) + // Measured: `134 + n * (1 ±0)` + // Estimated: `3599 + n * (1 ±0)` + // Minimum execution time: 6_651_000 picoseconds. + Weight::from_parts(7_144_357, 3599) + // Standard Error: 2 + .saturating_add(Weight::from_parts(627, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1360,147 +1355,145 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_910_000 picoseconds. - Weight::from_parts(2_205_396, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(538, 0).saturating_mul(n.into())) + // Minimum execution time: 2_288_000 picoseconds. + Weight::from_parts(2_449_229, 0) + // Standard Error: 1 + .saturating_add(Weight::from_parts(577, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().writes(1_u64)) } fn seal_value_transferred() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 224_000 picoseconds. - Weight::from_parts(274_000, 0) + // Minimum execution time: 369_000 picoseconds. + Weight::from_parts(390_000, 0) } fn seal_minimum_balance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 231_000 picoseconds. - Weight::from_parts(279_000, 0) + // Minimum execution time: 352_000 picoseconds. + Weight::from_parts(378_000, 0) } fn seal_return_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 229_000 picoseconds. - Weight::from_parts(267_000, 0) + // Minimum execution time: 351_000 picoseconds. + Weight::from_parts(388_000, 0) } fn seal_call_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 218_000 picoseconds. - Weight::from_parts(267_000, 0) + // Minimum execution time: 370_000 picoseconds. + Weight::from_parts(391_000, 0) } fn seal_gas_limit() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 225_000 picoseconds. - Weight::from_parts(280_000, 0) + // Minimum execution time: 403_000 picoseconds. + Weight::from_parts(433_000, 0) } fn seal_gas_price() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 274_000 picoseconds. - Weight::from_parts(323_000, 0) + // Minimum execution time: 356_000 picoseconds. + Weight::from_parts(377_000, 0) } fn seal_base_fee() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 239_000 picoseconds. - Weight::from_parts(290_000, 0) + // Minimum execution time: 364_000 picoseconds. + Weight::from_parts(384_000, 0) } fn seal_block_number() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 224_000 picoseconds. - Weight::from_parts(274_000, 0) + // Minimum execution time: 358_000 picoseconds. + Weight::from_parts(375_000, 0) } /// Storage: `System::BlockHash` (r:1 w:0) /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `Measured`) fn seal_block_hash() -> Weight { // Proof Size summary in bytes: - // Measured: `30` - // Estimated: `3495` - // Minimum execution time: 3_430_000 picoseconds. - Weight::from_parts(3_692_000, 3495) + // Measured: `0` + // Estimated: `3465` + // Minimum execution time: 3_052_000 picoseconds. + Weight::from_parts(3_196_000, 3465) .saturating_add(RocksDbWeight::get().reads(1_u64)) } fn seal_now() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 241_000 picoseconds. - Weight::from_parts(290_000, 0) + // Minimum execution time: 365_000 picoseconds. + Weight::from_parts(382_000, 0) } fn seal_weight_to_fee() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_355_000 picoseconds. - Weight::from_parts(1_493_000, 0) + // Minimum execution time: 1_563_000 picoseconds. + Weight::from_parts(1_637_000, 0) } /// The range of component `n` is `[0, 262140]`. fn seal_copy_to_contract(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 348_000 picoseconds. - Weight::from_parts(1_004_890, 0) + // Minimum execution time: 510_000 picoseconds. + Weight::from_parts(816_426, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(202, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(236, 0).saturating_mul(n.into())) } fn seal_call_data_load() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 222_000 picoseconds. - Weight::from_parts(256_000, 0) + // Minimum execution time: 369_000 picoseconds. + Weight::from_parts(391_000, 0) } /// The range of component `n` is `[0, 262144]`. fn seal_call_data_copy(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 240_000 picoseconds. - Weight::from_parts(330_609, 0) + // Minimum execution time: 373_000 picoseconds. + Weight::from_parts(475_229, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(114, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(148, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262140]`. fn seal_return(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 232_000 picoseconds. - Weight::from_parts(264_000, 0) + // Minimum execution time: 376_000 picoseconds. + Weight::from_parts(377_040, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(208, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(239, 0).saturating_mul(n.into())) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::DeletionQueueCounter` (r:1 w:1) /// Proof: `Revive::DeletionQueueCounter` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) - /// Storage: `Revive::CodeInfoOf` (r:33 w:33) + /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::DeletionQueue` (r:0 w:1) /// Proof: `Revive::DeletionQueue` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `Measured`) /// Storage: `Revive::ImmutableDataOf` (r:0 w:1) /// Proof: `Revive::ImmutableDataOf` (`max_values`: None, `max_size`: Some(4118), added: 6593, mode: `Measured`) - /// The range of component `n` is `[0, 32]`. fn seal_terminate() -> Weight { // Proof Size summary in bytes: - // Measured: `322 + n * (88 ±0)` - // Estimated: `3787 + n * (2563 ±0)` - // Minimum execution time: 21_920_000 picoseconds. - Weight::from_parts(21_725_868, 3787) - // Standard Error: 11_165 + // Measured: `215` + // Estimated: `3680` + // Minimum execution time: 17_543_000 picoseconds. + Weight::from_parts(18_000_000, 3680) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -1510,41 +1503,41 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_140_000 picoseconds. - Weight::from_parts(4_259_301, 0) - // Standard Error: 3_362 - .saturating_add(Weight::from_parts(194_546, 0).saturating_mul(t.into())) - // Standard Error: 34 - .saturating_add(Weight::from_parts(774, 0).saturating_mul(n.into())) + // Minimum execution time: 4_971_000 picoseconds. + Weight::from_parts(4_896_502, 0) + // Standard Error: 2_696 + .saturating_add(Weight::from_parts(245_882, 0).saturating_mul(t.into())) + // Standard Error: 27 + .saturating_add(Weight::from_parts(1_057, 0).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) fn get_storage_empty() -> Weight { // Proof Size summary in bytes: - // Measured: `680` - // Estimated: `680` - // Minimum execution time: 10_747_000 picoseconds. - Weight::from_parts(11_276_000, 680) + // Measured: `584` + // Estimated: `584` + // Minimum execution time: 6_654_000 picoseconds. + Weight::from_parts(6_957_000, 584) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) fn get_storage_full() -> Weight { // Proof Size summary in bytes: - // Measured: `10690` - // Estimated: `10690` - // Minimum execution time: 42_076_000 picoseconds. - Weight::from_parts(43_381_000, 10690) + // Measured: `10594` + // Estimated: `10594` + // Minimum execution time: 43_275_000 picoseconds. + Weight::from_parts(44_652_000, 10594) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_storage_empty() -> Weight { // Proof Size summary in bytes: - // Measured: `680` - // Estimated: `680` - // Minimum execution time: 11_703_000 picoseconds. - Weight::from_parts(12_308_000, 680) + // Measured: `584` + // Estimated: `584` + // Minimum execution time: 7_686_000 picoseconds. + Weight::from_parts(8_036_000, 584) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1552,10 +1545,10 @@ impl WeightInfo for () { /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_storage_full() -> Weight { // Proof Size summary in bytes: - // Measured: `10690` - // Estimated: `10690` - // Minimum execution time: 43_460_000 picoseconds. - Weight::from_parts(45_165_000, 10690) + // Measured: `10594` + // Estimated: `10594` + // Minimum execution time: 44_696_000 picoseconds. + Weight::from_parts(46_250_000, 10594) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1565,14 +1558,14 @@ impl WeightInfo for () { /// The range of component `o` is `[0, 448]`. fn seal_set_storage(n: u32, o: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `248 + o * (1 ±0)` - // Estimated: `247 + o * (1 ±0)` - // Minimum execution time: 9_087_000 picoseconds. - Weight::from_parts(11_787_486, 247) - // Standard Error: 179 - .saturating_add(Weight::from_parts(976, 0).saturating_mul(n.into())) - // Standard Error: 179 - .saturating_add(Weight::from_parts(3_151, 0).saturating_mul(o.into())) + // Measured: `152 + o * (1 ±0)` + // Estimated: `151 + o * (1 ±0)` + // Minimum execution time: 8_553_000 picoseconds. + Weight::from_parts(8_987_197, 151) + // Standard Error: 53 + .saturating_add(Weight::from_parts(501, 0).saturating_mul(n.into())) + // Standard Error: 53 + .saturating_add(Weight::from_parts(422, 0).saturating_mul(o.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(o.into())) @@ -1582,12 +1575,12 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 448]`. fn seal_clear_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `248 + n * (1 ±0)` - // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_611_000 picoseconds. - Weight::from_parts(11_791_390, 247) - // Standard Error: 308 - .saturating_add(Weight::from_parts(3_943, 0).saturating_mul(n.into())) + // Measured: `152 + n * (1 ±0)` + // Estimated: `151 + n * (1 ±0)` + // Minimum execution time: 8_104_000 picoseconds. + Weight::from_parts(8_704_225, 151) + // Standard Error: 48 + .saturating_add(Weight::from_parts(511, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) @@ -1597,12 +1590,12 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 448]`. fn seal_get_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `248 + n * (1 ±0)` - // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_389_000 picoseconds. - Weight::from_parts(11_625_480, 247) - // Standard Error: 315 - .saturating_add(Weight::from_parts(4_487, 0).saturating_mul(n.into())) + // Measured: `152 + n * (1 ±0)` + // Estimated: `151 + n * (1 ±0)` + // Minimum execution time: 7_528_000 picoseconds. + Weight::from_parts(8_374_996, 151) + // Standard Error: 56 + .saturating_add(Weight::from_parts(1_330, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1611,12 +1604,12 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 448]`. fn seal_contains_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `248 + n * (1 ±0)` - // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 7_947_000 picoseconds. - Weight::from_parts(10_970_587, 247) - // Standard Error: 310 - .saturating_add(Weight::from_parts(3_675, 0).saturating_mul(n.into())) + // Measured: `152 + n * (1 ±0)` + // Estimated: `151 + n * (1 ±0)` + // Minimum execution time: 7_277_000 picoseconds. + Weight::from_parts(7_837_467, 151) + // Standard Error: 41 + .saturating_add(Weight::from_parts(449, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1625,12 +1618,12 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 448]`. fn seal_take_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `248 + n * (1 ±0)` - // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 9_071_000 picoseconds. - Weight::from_parts(12_525_027, 247) - // Standard Error: 328 - .saturating_add(Weight::from_parts(4_427, 0).saturating_mul(n.into())) + // Measured: `152 + n * (1 ±0)` + // Estimated: `151 + n * (1 ±0)` + // Minimum execution time: 8_620_000 picoseconds. + Weight::from_parts(9_440_899, 151) + // Standard Error: 59 + .saturating_add(Weight::from_parts(1_222, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) @@ -1639,36 +1632,36 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_487_000 picoseconds. - Weight::from_parts(1_611_000, 0) + // Minimum execution time: 1_772_000 picoseconds. + Weight::from_parts(1_862_000, 0) } fn set_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_852_000 picoseconds. - Weight::from_parts(1_982_000, 0) + // Minimum execution time: 2_226_000 picoseconds. + Weight::from_parts(2_294_000, 0) } fn get_transient_storage_empty() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_467_000 picoseconds. - Weight::from_parts(1_529_000, 0) + // Minimum execution time: 1_725_000 picoseconds. + Weight::from_parts(1_846_000, 0) } fn get_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_630_000 picoseconds. - Weight::from_parts(1_712_000, 0) + // Minimum execution time: 1_860_000 picoseconds. + Weight::from_parts(1_978_000, 0) } fn rollback_transient_storage() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_188_000 picoseconds. - Weight::from_parts(1_268_000, 0) + // Minimum execution time: 1_207_000 picoseconds. + Weight::from_parts(1_257_000, 0) } /// The range of component `n` is `[0, 448]`. /// The range of component `o` is `[0, 448]`. @@ -1676,57 +1669,55 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_197_000 picoseconds. - Weight::from_parts(2_464_654, 0) - // Standard Error: 17 - .saturating_add(Weight::from_parts(296, 0).saturating_mul(n.into())) - // Standard Error: 17 - .saturating_add(Weight::from_parts(342, 0).saturating_mul(o.into())) + // Minimum execution time: 2_569_000 picoseconds. + Weight::from_parts(2_799_621, 0) + // Standard Error: 15 + .saturating_add(Weight::from_parts(259, 0).saturating_mul(n.into())) + // Standard Error: 15 + .saturating_add(Weight::from_parts(352, 0).saturating_mul(o.into())) } /// The range of component `n` is `[0, 448]`. fn seal_clear_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_005_000 picoseconds. - Weight::from_parts(2_381_053, 0) - // Standard Error: 23 - .saturating_add(Weight::from_parts(322, 0).saturating_mul(n.into())) + // Minimum execution time: 2_283_000 picoseconds. + Weight::from_parts(2_617_432, 0) + // Standard Error: 20 + .saturating_add(Weight::from_parts(356, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 448]`. fn seal_get_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_853_000 picoseconds. - Weight::from_parts(2_082_772, 0) - // Standard Error: 20 - .saturating_add(Weight::from_parts(322, 0).saturating_mul(n.into())) + // Minimum execution time: 2_092_000 picoseconds. + Weight::from_parts(2_328_854, 0) + // Standard Error: 15 + .saturating_add(Weight::from_parts(409, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 448]`. fn seal_contains_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_711_000 picoseconds. - Weight::from_parts(1_899_649, 0) - // Standard Error: 16 - .saturating_add(Weight::from_parts(208, 0).saturating_mul(n.into())) + // Minimum execution time: 1_938_000 picoseconds. + Weight::from_parts(2_158_558, 0) + // Standard Error: 13 + .saturating_add(Weight::from_parts(224, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 448]`. - fn seal_take_transient_storage(n: u32, ) -> Weight { + fn seal_take_transient_storage(_n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_460_000 picoseconds. - Weight::from_parts(2_684_364, 0) - // Standard Error: 22 - .saturating_add(Weight::from_parts(56, 0).saturating_mul(n.into())) + // Minimum execution time: 2_753_000 picoseconds. + Weight::from_parts(3_047_513, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:1 w:0) @@ -1737,31 +1728,31 @@ impl WeightInfo for () { /// The range of component `i` is `[0, 262144]`. fn seal_call(t: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1292 + t * (203 ±0)` - // Estimated: `4757 + t * (2480 ±0)` - // Minimum execution time: 40_031_000 picoseconds. - Weight::from_parts(41_527_691, 4757) - // Standard Error: 50_351 - .saturating_add(Weight::from_parts(1_112_950, 0).saturating_mul(t.into())) + // Measured: `1165 + t * (154 ±0)` + // Estimated: `4630 + t * (2392 ±0)` + // Minimum execution time: 36_345_000 picoseconds. + Weight::from_parts(37_090_824, 4630) + // Standard Error: 34_336 + .saturating_add(Weight::from_parts(6_362_713, 0).saturating_mul(t.into())) // Standard Error: 0 - .saturating_add(Weight::from_parts(1, 0).saturating_mul(i.into())) + .saturating_add(Weight::from_parts(2, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(t.into()))) .saturating_add(RocksDbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_parts(0, 2480).saturating_mul(t.into())) + .saturating_add(Weight::from_parts(0, 2392).saturating_mul(t.into())) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:1 w:0) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) fn seal_delegate_call() -> Weight { // Proof Size summary in bytes: - // Measured: `1237` - // Estimated: `4702` - // Minimum execution time: 35_759_000 picoseconds. - Weight::from_parts(37_086_000, 4702) + // Measured: `1108` + // Estimated: `4573` + // Minimum execution time: 29_895_000 picoseconds. + Weight::from_parts(30_589_000, 4573) .saturating_add(RocksDbWeight::get().reads(3_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) @@ -1769,18 +1760,18 @@ impl WeightInfo for () { /// Storage: `Revive::PristineCode` (r:1 w:0) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// The range of component `i` is `[0, 262144]`. fn seal_instantiate(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1271` - // Estimated: `4710` - // Minimum execution time: 116_485_000 picoseconds. - Weight::from_parts(108_907_717, 4710) - // Standard Error: 12 - .saturating_add(Weight::from_parts(4_125, 0).saturating_mul(i.into())) + // Measured: `1041` + // Estimated: `4516` + // Minimum execution time: 133_320_000 picoseconds. + Weight::from_parts(127_179_909, 4516) + // Standard Error: 8 + .saturating_add(Weight::from_parts(4_050, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1789,73 +1780,73 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 651_000 picoseconds. - Weight::from_parts(3_867_609, 0) + // Minimum execution time: 870_000 picoseconds. + Weight::from_parts(4_190_352, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(1_384, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_413, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_keccak_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_090_000 picoseconds. - Weight::from_parts(5_338_460, 0) + // Minimum execution time: 1_271_000 picoseconds. + Weight::from_parts(4_339_297, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(3_601, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(3_585, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_blake2_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 717_000 picoseconds. - Weight::from_parts(2_629_461, 0) + // Minimum execution time: 806_000 picoseconds. + Weight::from_parts(3_729_623, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(1_528, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_554, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_blake2_128(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 660_000 picoseconds. - Weight::from_parts(4_807_814, 0) + // Minimum execution time: 847_000 picoseconds. + Weight::from_parts(3_003_601, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(1_509, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_565, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 261889]`. fn seal_sr25519_verify(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 42_829_000 picoseconds. - Weight::from_parts(24_650_992, 0) - // Standard Error: 14 - .saturating_add(Weight::from_parts(5_212, 0).saturating_mul(n.into())) + // Minimum execution time: 44_840_000 picoseconds. + Weight::from_parts(32_690_260, 0) + // Standard Error: 10 + .saturating_add(Weight::from_parts(5_486, 0).saturating_mul(n.into())) } fn seal_ecdsa_recover() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 46_902_000 picoseconds. - Weight::from_parts(48_072_000, 0) + // Minimum execution time: 47_074_000 picoseconds. + Weight::from_parts(48_708_000, 0) } fn seal_ecdsa_to_eth_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_713_000 picoseconds. - Weight::from_parts(12_847_000, 0) + // Minimum execution time: 12_590_000 picoseconds. + Weight::from_parts(12_753_000, 0) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) fn seal_set_code_hash() -> Weight { // Proof Size summary in bytes: - // Measured: `300` - // Estimated: `3765` - // Minimum execution time: 17_657_000 picoseconds. - Weight::from_parts(18_419_000, 3765) + // Measured: `196` + // Estimated: `3661` + // Minimum execution time: 12_087_000 picoseconds. + Weight::from_parts(12_420_000, 3661) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1864,9 +1855,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_899_000 picoseconds. - Weight::from_parts(10_489_171, 0) - // Standard Error: 104 - .saturating_add(Weight::from_parts(73_814, 0).saturating_mul(r.into())) + // Minimum execution time: 8_816_000 picoseconds. + Weight::from_parts(9_682_348, 0) + // Standard Error: 70 + .saturating_add(Weight::from_parts(73_858, 0).saturating_mul(r.into())) } } From e833c2fd8e215580131fac201fcf18bb4507356d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Fri, 24 Jan 2025 16:49:24 +0100 Subject: [PATCH 09/41] Make refcounting fallible --- substrate/frame/revive/src/exec.rs | 4 ++-- substrate/frame/revive/src/lib.rs | 4 +++- substrate/frame/revive/src/wasm/mod.rs | 23 ++++++++++++++--------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/substrate/frame/revive/src/exec.rs b/substrate/frame/revive/src/exec.rs index 60a078d9b11dd..5d02581bf6855 100644 --- a/substrate/frame/revive/src/exec.rs +++ b/substrate/frame/revive/src/exec.rs @@ -1515,7 +1515,7 @@ where let account_address = T::AddressMapper::to_address(&frame.account_id); ContractInfoOf::::remove(&account_address); ImmutableDataOf::::remove(&account_address); - >::decrement_refcount(info.code_hash); + >::decrement_refcount(info.code_hash)?; Ok(()) } @@ -1771,7 +1771,7 @@ where frame.nested_storage.charge_deposit(frame.account_id.clone(), deposit); >::increment_refcount(hash)?; - >::decrement_refcount(prev_hash); + >::decrement_refcount(prev_hash)?; Ok(()) } diff --git a/substrate/frame/revive/src/lib.rs b/substrate/frame/revive/src/lib.rs index 3ac89376bb3f2..2aecbc8e37dcb 100644 --- a/substrate/frame/revive/src/lib.rs +++ b/substrate/frame/revive/src/lib.rs @@ -488,6 +488,8 @@ pub mod pallet { AccountAlreadyMapped, /// The transaction used to dry-run a contract is invalid. InvalidGenericTransaction, + /// The refcount of a code either over or underflowed. + RefcountOverOrUnderflow, } /// A reason for the pallet contracts placing a hold on funds. @@ -904,7 +906,7 @@ pub mod pallet { return Err(>::ContractNotFound.into()); }; >::increment_refcount(code_hash)?; - >::decrement_refcount(contract.code_hash); + >::decrement_refcount(contract.code_hash)?; contract.code_hash = code_hash; Ok(()) }) diff --git a/substrate/frame/revive/src/wasm/mod.rs b/substrate/frame/revive/src/wasm/mod.rs index e22f97d864fac..7a3b5c56c9738 100644 --- a/substrate/frame/revive/src/wasm/mod.rs +++ b/substrate/frame/revive/src/wasm/mod.rs @@ -214,15 +214,11 @@ impl CodeInfo { } /// Returns reference count of the module. + #[cfg(test)] pub fn refcount(&self) -> u64 { self.refcount } - /// Return mutable reference to the refcount of the module. - pub fn refcount_mut(&mut self) -> &mut u64 { - &mut self.refcount - } - /// Returns the deposit of the module. pub fn deposit(&self) -> BalanceOf { self.deposit @@ -243,7 +239,10 @@ impl CodeInfo { pub fn increment_refcount(code_hash: H256) -> DispatchResult { >::mutate(code_hash, |existing| -> Result<(), DispatchError> { if let Some(info) = existing { - *info.refcount_mut() = info.refcount().saturating_add(1); + info.refcount = info + .refcount + .checked_add(1) + .ok_or_else(|| >::RefcountOverOrUnderflow)?; Ok(()) } else { Err(Error::::CodeNotFound.into()) @@ -257,12 +256,18 @@ impl CodeInfo { /// /// A contract whose reference count dropped to zero isn't automatically removed. A /// `remove_code` transaction must be submitted by the original uploader to do so. - pub fn decrement_refcount(code_hash: H256) { + pub fn decrement_refcount(code_hash: H256) -> DispatchResult { >::mutate(code_hash, |existing| { if let Some(info) = existing { - *info.refcount_mut() = info.refcount().saturating_sub(1); + info.refcount = info + .refcount + .checked_sub(1) + .ok_or_else(|| >::RefcountOverOrUnderflow)?; + Ok(()) + } else { + Err(Error::::CodeNotFound.into()) } - }); + }) } } From b8e4b31be13c98ed880aef4550846b3fe6c8c596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Fri, 24 Jan 2025 16:50:50 +0100 Subject: [PATCH 10/41] No need to reference into the frame --- substrate/frame/revive/src/exec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/revive/src/exec.rs b/substrate/frame/revive/src/exec.rs index 5d02581bf6855..54941fe557919 100644 --- a/substrate/frame/revive/src/exec.rs +++ b/substrate/frame/revive/src/exec.rs @@ -1040,7 +1040,7 @@ where // the runtime could remove the account. As long as a contract exists its // account must exist. With the consumer, a correct runtime cannot remove the // account. - >::inc_consumers(&frame.account_id)?; + >::inc_consumers(account_id)?; // Needs to be incremented before calling into the code so that it is visible // in case of recursion. From 0073dafbd3f41a97085957612ded9f1d55808d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Fri, 24 Jan 2025 16:51:43 +0100 Subject: [PATCH 11/41] Update substrate/frame/revive/src/wasm/mod.rs Co-authored-by: PG Herveou --- substrate/frame/revive/src/wasm/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/revive/src/wasm/mod.rs b/substrate/frame/revive/src/wasm/mod.rs index 7a3b5c56c9738..d22e0c6dc0b27 100644 --- a/substrate/frame/revive/src/wasm/mod.rs +++ b/substrate/frame/revive/src/wasm/mod.rs @@ -230,7 +230,7 @@ impl CodeInfo { } /// Returns the number of times the specified contract exists on the call stack. Delegated calls - /// Increment the reference count of a of a stored code by one. + /// Increment the reference count of a stored code by one. /// /// # Errors /// From 7b492cbdee3fbeb722903d49d83bf565a940b67d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Fri, 24 Jan 2025 17:33:36 +0100 Subject: [PATCH 12/41] Remove unused weight file --- .../src/weights/pallet_revive.rs | 986 ------------------ 1 file changed, 986 deletions(-) delete mode 100644 cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_revive.rs diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_revive.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_revive.rs deleted file mode 100644 index bc4e6129d4d37..0000000000000 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_revive.rs +++ /dev/null @@ -1,986 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// This file is part of Cumulus. - -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . - -//! Autogenerated weights for `pallet_revive` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-01-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `985569d2aee4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/asset-hub-westend-runtime/asset_hub_westend_runtime.wasm -// --pallet=pallet_revive -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(missing_docs)] - -use frame_support::{traits::Get, weights::Weight}; -use core::marker::PhantomData; - -/// Weight functions for `pallet_revive`. -pub struct WeightInfo(PhantomData); -impl pallet_revive::WeightInfo for WeightInfo { - /// Storage: `Revive::DeletionQueueCounter` (r:1 w:0) - /// Proof: `Revive::DeletionQueueCounter` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) - fn on_process_deletion_queue_batch() -> Weight { - // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `1594` - // Minimum execution time: 3_227_000 picoseconds. - Weight::from_parts(3_430_000, 0) - .saturating_add(Weight::from_parts(0, 1594)) - .saturating_add(T::DbWeight::get().reads(1)) - } - /// Storage: `Skipped::Metadata` (r:0 w:0) - /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `k` is `[0, 1024]`. - fn on_initialize_per_trie_key(k: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `430 + k * (69 ±0)` - // Estimated: `420 + k * (70 ±0)` - // Minimum execution time: 16_885_000 picoseconds. - Weight::from_parts(17_299_000, 0) - .saturating_add(Weight::from_parts(0, 420)) - // Standard Error: 1_406 - .saturating_add(Weight::from_parts(1_310_709, 0).saturating_mul(k.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) - .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) - .saturating_add(Weight::from_parts(0, 70).saturating_mul(k.into())) - } - /// Storage: `Revive::AddressSuffix` (r:2 w:0) - /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) - /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) - /// Storage: `Revive::CodeInfoOf` (r:1 w:0) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) - /// Storage: `Revive::PristineCode` (r:1 w:0) - /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) - /// Storage: `Timestamp::Now` (r:1 w:0) - /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) - /// The range of component `c` is `[0, 262144]`. - fn call_with_code_per_byte(_c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1362` - // Estimated: `7302` - // Minimum execution time: 118_030_000 picoseconds. - Weight::from_parts(123_592_986, 0) - .saturating_add(Weight::from_parts(0, 7302)) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Revive::CodeInfoOf` (r:1 w:1) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) - /// Storage: `Balances::Holds` (r:2 w:2) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `Measured`) - /// Storage: `Revive::AddressSuffix` (r:1 w:0) - /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) - /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) - /// Storage: `Timestamp::Now` (r:1 w:0) - /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) - /// Storage: `Revive::PristineCode` (r:0 w:1) - /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) - /// The range of component `c` is `[0, 262144]`. - /// The range of component `i` is `[0, 262144]`. - fn instantiate_with_code(_c: u32, i: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `263` - // Estimated: `6202` - // Minimum execution time: 222_873_000 picoseconds. - Weight::from_parts(211_975_311, 0) - .saturating_add(Weight::from_parts(0, 6202)) - // Standard Error: 9 - .saturating_add(Weight::from_parts(4_308, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(6)) - } - /// Storage: `Revive::CodeInfoOf` (r:1 w:1) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) - /// Storage: `Revive::PristineCode` (r:1 w:0) - /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) - /// Storage: `Revive::AddressSuffix` (r:1 w:0) - /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) - /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) - /// Storage: `Timestamp::Now` (r:1 w:0) - /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) - /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `Measured`) - /// The range of component `i` is `[0, 262144]`. - fn instantiate(i: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1154` - // Estimated: `4626` - // Minimum execution time: 185_926_000 picoseconds. - Weight::from_parts(179_728_952, 0) - .saturating_add(Weight::from_parts(0, 4626)) - // Standard Error: 11 - .saturating_add(Weight::from_parts(4_357, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: `Revive::AddressSuffix` (r:2 w:0) - /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) - /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) - /// Storage: `Revive::CodeInfoOf` (r:1 w:0) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) - /// Storage: `Revive::PristineCode` (r:1 w:0) - /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) - /// Storage: `Timestamp::Now` (r:1 w:0) - /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) - fn call() -> Weight { - // Proof Size summary in bytes: - // Measured: `1362` - // Estimated: `7302` - // Minimum execution time: 172_792_000 picoseconds. - Weight::from_parts(176_869_000, 0) - .saturating_add(Weight::from_parts(0, 7302)) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Revive::CodeInfoOf` (r:1 w:1) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) - /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `Measured`) - /// Storage: `Revive::PristineCode` (r:0 w:1) - /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) - /// The range of component `c` is `[0, 262144]`. - fn upload_code(_c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `3574` - // Minimum execution time: 58_970_000 picoseconds. - Weight::from_parts(61_559_363, 0) - .saturating_add(Weight::from_parts(0, 3574)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `Revive::CodeInfoOf` (r:1 w:1) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) - /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `Measured`) - /// Storage: `Revive::PristineCode` (r:0 w:1) - /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) - fn remove_code() -> Weight { - // Proof Size summary in bytes: - // Measured: `282` - // Estimated: `3747` - // Minimum execution time: 47_502_000 picoseconds. - Weight::from_parts(48_337_000, 0) - .saturating_add(Weight::from_parts(0, 3747)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) - /// Storage: `Revive::CodeInfoOf` (r:2 w:2) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) - fn set_code() -> Weight { - // Proof Size summary in bytes: - // Measured: `524` - // Estimated: `6464` - // Minimum execution time: 25_716_000 picoseconds. - Weight::from_parts(26_630_000, 0) - .saturating_add(Weight::from_parts(0, 6464)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `Revive::AddressSuffix` (r:1 w:1) - /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) - /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `Measured`) - fn map_account() -> Weight { - // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `3574` - // Minimum execution time: 52_608_000 picoseconds. - Weight::from_parts(53_095_000, 0) - .saturating_add(Weight::from_parts(0, 3574)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `Measured`) - /// Storage: `Revive::AddressSuffix` (r:0 w:1) - /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) - fn unmap_account() -> Weight { - // Proof Size summary in bytes: - // Measured: `55` - // Estimated: `3520` - // Minimum execution time: 41_476_000 picoseconds. - Weight::from_parts(42_403_000, 0) - .saturating_add(Weight::from_parts(0, 3520)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) - } - fn dispatch_as_fallback_account() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_757_000 picoseconds. - Weight::from_parts(6_089_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// The range of component `r` is `[0, 1600]`. - fn noop_host_fn(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 7_642_000 picoseconds. - Weight::from_parts(8_689_155, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 189 - .saturating_add(Weight::from_parts(162_118, 0).saturating_mul(r.into())) - } - fn seal_caller() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 379_000 picoseconds. - Weight::from_parts(433_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn seal_origin() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 382_000 picoseconds. - Weight::from_parts(409_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) - fn seal_is_contract() -> Weight { - // Proof Size summary in bytes: - // Measured: `306` - // Estimated: `3771` - // Minimum execution time: 7_617_000 picoseconds. - Weight::from_parts(7_872_000, 0) - .saturating_add(Weight::from_parts(0, 3771)) - .saturating_add(T::DbWeight::get().reads(1)) - } - /// Storage: `Revive::AddressSuffix` (r:1 w:0) - /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) - fn seal_to_account_id() -> Weight { - // Proof Size summary in bytes: - // Measured: `248` - // Estimated: `3713` - // Minimum execution time: 7_250_000 picoseconds. - Weight::from_parts(7_559_000, 0) - .saturating_add(Weight::from_parts(0, 3713)) - .saturating_add(T::DbWeight::get().reads(1)) - } - /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) - fn seal_code_hash() -> Weight { - // Proof Size summary in bytes: - // Measured: `402` - // Estimated: `3867` - // Minimum execution time: 8_733_000 picoseconds. - Weight::from_parts(9_077_000, 0) - .saturating_add(Weight::from_parts(0, 3867)) - .saturating_add(T::DbWeight::get().reads(1)) - } - fn seal_own_code_hash() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 350_000 picoseconds. - Weight::from_parts(410_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) - /// Storage: `Revive::CodeInfoOf` (r:1 w:0) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) - fn seal_code_size() -> Weight { - // Proof Size summary in bytes: - // Measured: `470` - // Estimated: `3935` - // Minimum execution time: 12_852_000 picoseconds. - Weight::from_parts(13_345_000, 0) - .saturating_add(Weight::from_parts(0, 3935)) - .saturating_add(T::DbWeight::get().reads(2)) - } - fn seal_caller_is_origin() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 417_000 picoseconds. - Weight::from_parts(461_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn seal_caller_is_root() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 367_000 picoseconds. - Weight::from_parts(434_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn seal_address() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 377_000 picoseconds. - Weight::from_parts(411_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn seal_weight_left() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 851_000 picoseconds. - Weight::from_parts(917_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn seal_ref_time_left() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 349_000 picoseconds. - Weight::from_parts(376_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn seal_balance() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `0` - // Minimum execution time: 5_825_000 picoseconds. - Weight::from_parts(6_135_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// Storage: `Revive::AddressSuffix` (r:1 w:0) - /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) - fn seal_balance_of() -> Weight { - // Proof Size summary in bytes: - // Measured: `264` - // Estimated: `3729` - // Minimum execution time: 10_492_000 picoseconds. - Weight::from_parts(10_821_000, 0) - .saturating_add(Weight::from_parts(0, 3729)) - .saturating_add(T::DbWeight::get().reads(2)) - } - /// Storage: `Revive::ImmutableDataOf` (r:1 w:0) - /// Proof: `Revive::ImmutableDataOf` (`max_values`: None, `max_size`: Some(4118), added: 6593, mode: `Measured`) - /// The range of component `n` is `[1, 4096]`. - fn seal_get_immutable_data(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `238 + n * (1 ±0)` - // Estimated: `3703 + n * (1 ±0)` - // Minimum execution time: 6_665_000 picoseconds. - Weight::from_parts(7_463_260, 0) - .saturating_add(Weight::from_parts(0, 3703)) - // Standard Error: 5 - .saturating_add(Weight::from_parts(717, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) - } - /// Storage: `Revive::ImmutableDataOf` (r:0 w:1) - /// Proof: `Revive::ImmutableDataOf` (`max_values`: None, `max_size`: Some(4118), added: 6593, mode: `Measured`) - /// The range of component `n` is `[1, 4096]`. - fn seal_set_immutable_data(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_546_000 picoseconds. - Weight::from_parts(2_774_529, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3 - .saturating_add(Weight::from_parts(645, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().writes(1)) - } - fn seal_value_transferred() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 379_000 picoseconds. - Weight::from_parts(407_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn seal_minimum_balance() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 371_000 picoseconds. - Weight::from_parts(424_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn seal_return_data_size() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 370_000 picoseconds. - Weight::from_parts(417_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn seal_call_data_size() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 358_000 picoseconds. - Weight::from_parts(406_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn seal_gas_limit() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 519_000 picoseconds. - Weight::from_parts(584_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn seal_gas_price() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 353_000 picoseconds. - Weight::from_parts(403_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn seal_base_fee() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 379_000 picoseconds. - Weight::from_parts(429_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn seal_block_number() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 337_000 picoseconds. - Weight::from_parts(377_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// Storage: `System::BlockHash` (r:1 w:0) - /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `Measured`) - fn seal_block_hash() -> Weight { - // Proof Size summary in bytes: - // Measured: `30` - // Estimated: `3495` - // Minimum execution time: 4_595_000 picoseconds. - Weight::from_parts(4_770_000, 0) - .saturating_add(Weight::from_parts(0, 3495)) - .saturating_add(T::DbWeight::get().reads(1)) - } - fn seal_now() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 368_000 picoseconds. - Weight::from_parts(418_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn seal_weight_to_fee() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_195_000 picoseconds. - Weight::from_parts(2_319_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// The range of component `n` is `[0, 262140]`. - fn seal_copy_to_contract(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 530_000 picoseconds. - Weight::from_parts(779_792, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 0 - .saturating_add(Weight::from_parts(295, 0).saturating_mul(n.into())) - } - fn seal_call_data_load() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 371_000 picoseconds. - Weight::from_parts(419_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// The range of component `n` is `[0, 262144]`. - fn seal_call_data_copy(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 367_000 picoseconds. - Weight::from_parts(372_110, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 0 - .saturating_add(Weight::from_parts(150, 0).saturating_mul(n.into())) - } - /// The range of component `n` is `[0, 262140]`. - fn seal_return(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 390_000 picoseconds. - Weight::from_parts(390_156, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 0 - .saturating_add(Weight::from_parts(298, 0).saturating_mul(n.into())) - } - /// Storage: `Revive::AddressSuffix` (r:1 w:0) - /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) - /// Storage: `Revive::DeletionQueueCounter` (r:1 w:1) - /// Proof: `Revive::DeletionQueueCounter` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) - /// Storage: `Revive::CodeInfoOf` (r:1 w:1) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) - /// Storage: `Revive::DeletionQueue` (r:0 w:1) - /// Proof: `Revive::DeletionQueue` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `Measured`) - /// Storage: `Revive::ImmutableDataOf` (r:0 w:1) - /// Proof: `Revive::ImmutableDataOf` (`max_values`: None, `max_size`: Some(4118), added: 6593, mode: `Measured`) - fn seal_terminate() -> Weight { - // Proof Size summary in bytes: - // Measured: `317` - // Estimated: `3782` - // Minimum execution time: 18_491_000 picoseconds. - Weight::from_parts(19_213_000, 0) - .saturating_add(Weight::from_parts(0, 3782)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// The range of component `t` is `[0, 4]`. - /// The range of component `n` is `[0, 448]`. - fn seal_deposit_event(t: u32, n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_473_000 picoseconds. - Weight::from_parts(5_467_645, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3_589 - .saturating_add(Weight::from_parts(259_510, 0).saturating_mul(t.into())) - // Standard Error: 36 - .saturating_add(Weight::from_parts(1_218, 0).saturating_mul(n.into())) - } - /// Storage: `Skipped::Metadata` (r:0 w:0) - /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn get_storage_empty() -> Weight { - // Proof Size summary in bytes: - // Measured: `685` - // Estimated: `685` - // Minimum execution time: 9_696_000 picoseconds. - Weight::from_parts(10_284_000, 0) - .saturating_add(Weight::from_parts(0, 685)) - .saturating_add(T::DbWeight::get().reads(1)) - } - /// Storage: `Skipped::Metadata` (r:0 w:0) - /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn get_storage_full() -> Weight { - // Proof Size summary in bytes: - // Measured: `10695` - // Estimated: `10695` - // Minimum execution time: 44_006_000 picoseconds. - Weight::from_parts(46_013_000, 0) - .saturating_add(Weight::from_parts(0, 10695)) - .saturating_add(T::DbWeight::get().reads(1)) - } - /// Storage: `Skipped::Metadata` (r:0 w:0) - /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn set_storage_empty() -> Weight { - // Proof Size summary in bytes: - // Measured: `685` - // Estimated: `685` - // Minimum execution time: 11_025_000 picoseconds. - Weight::from_parts(11_572_000, 0) - .saturating_add(Weight::from_parts(0, 685)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Skipped::Metadata` (r:0 w:0) - /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn set_storage_full() -> Weight { - // Proof Size summary in bytes: - // Measured: `10695` - // Estimated: `10695` - // Minimum execution time: 46_432_000 picoseconds. - Weight::from_parts(48_360_000, 0) - .saturating_add(Weight::from_parts(0, 10695)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Skipped::Metadata` (r:0 w:0) - /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `n` is `[0, 448]`. - /// The range of component `o` is `[0, 448]`. - fn seal_set_storage(n: u32, o: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `253 + o * (1 ±0)` - // Estimated: `252 + o * (1 ±0)` - // Minimum execution time: 11_752_000 picoseconds. - Weight::from_parts(12_657_378, 0) - .saturating_add(Weight::from_parts(0, 252)) - // Standard Error: 60 - .saturating_add(Weight::from_parts(386, 0).saturating_mul(n.into())) - // Standard Error: 60 - .saturating_add(Weight::from_parts(591, 0).saturating_mul(o.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(Weight::from_parts(0, 1).saturating_mul(o.into())) - } - /// Storage: `Skipped::Metadata` (r:0 w:0) - /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `n` is `[0, 448]`. - fn seal_clear_storage(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `253 + n * (1 ±0)` - // Estimated: `252 + n * (1 ±0)` - // Minimum execution time: 11_317_000 picoseconds. - Weight::from_parts(12_361_811, 0) - .saturating_add(Weight::from_parts(0, 252)) - // Standard Error: 81 - .saturating_add(Weight::from_parts(954, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) - } - /// Storage: `Skipped::Metadata` (r:0 w:0) - /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `n` is `[0, 448]`. - fn seal_get_storage(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `253 + n * (1 ±0)` - // Estimated: `252 + n * (1 ±0)` - // Minimum execution time: 10_785_000 picoseconds. - Weight::from_parts(11_924_771, 0) - .saturating_add(Weight::from_parts(0, 252)) - // Standard Error: 90 - .saturating_add(Weight::from_parts(1_871, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) - } - /// Storage: `Skipped::Metadata` (r:0 w:0) - /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `n` is `[0, 448]`. - fn seal_contains_storage(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `253 + n * (1 ±0)` - // Estimated: `252 + n * (1 ±0)` - // Minimum execution time: 9_995_000 picoseconds. - Weight::from_parts(11_238_158, 0) - .saturating_add(Weight::from_parts(0, 252)) - // Standard Error: 82 - .saturating_add(Weight::from_parts(757, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) - } - /// Storage: `Skipped::Metadata` (r:0 w:0) - /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `n` is `[0, 448]`. - fn seal_take_storage(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `253 + n * (1 ±0)` - // Estimated: `252 + n * (1 ±0)` - // Minimum execution time: 12_020_000 picoseconds. - Weight::from_parts(13_238_417, 0) - .saturating_add(Weight::from_parts(0, 252)) - // Standard Error: 83 - .saturating_add(Weight::from_parts(1_535, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) - } - fn set_transient_storage_empty() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_812_000 picoseconds. - Weight::from_parts(1_959_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn set_transient_storage_full() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_227_000 picoseconds. - Weight::from_parts(2_401_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn get_transient_storage_empty() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_797_000 picoseconds. - Weight::from_parts(1_889_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn get_transient_storage_full() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_991_000 picoseconds. - Weight::from_parts(2_077_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn rollback_transient_storage() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_204_000 picoseconds. - Weight::from_parts(1_324_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// The range of component `n` is `[0, 448]`. - /// The range of component `o` is `[0, 448]`. - fn seal_set_transient_storage(n: u32, o: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_695_000 picoseconds. - Weight::from_parts(2_981_114, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 15 - .saturating_add(Weight::from_parts(360, 0).saturating_mul(n.into())) - // Standard Error: 15 - .saturating_add(Weight::from_parts(370, 0).saturating_mul(o.into())) - } - /// The range of component `n` is `[0, 448]`. - fn seal_clear_transient_storage(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_453_000 picoseconds. - Weight::from_parts(2_856_117, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 22 - .saturating_add(Weight::from_parts(368, 0).saturating_mul(n.into())) - } - /// The range of component `n` is `[0, 448]`. - fn seal_get_transient_storage(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_333_000 picoseconds. - Weight::from_parts(2_491_149, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 15 - .saturating_add(Weight::from_parts(393, 0).saturating_mul(n.into())) - } - /// The range of component `n` is `[0, 448]`. - fn seal_contains_transient_storage(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_087_000 picoseconds. - Weight::from_parts(2_351_674, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 19 - .saturating_add(Weight::from_parts(238, 0).saturating_mul(n.into())) - } - /// The range of component `n` is `[0, 448]`. - fn seal_take_transient_storage(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_037_000 picoseconds. - Weight::from_parts(3_299_553, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 18 - .saturating_add(Weight::from_parts(6, 0).saturating_mul(n.into())) - } - /// Storage: `Revive::AddressSuffix` (r:1 w:0) - /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) - /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) - /// Storage: `Revive::CodeInfoOf` (r:1 w:0) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) - /// Storage: `Revive::PristineCode` (r:1 w:0) - /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) - /// The range of component `t` is `[0, 1]`. - /// The range of component `i` is `[0, 262144]`. - fn seal_call(t: u32, i: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1291 + t * (206 ±0)` - // Estimated: `4756 + t * (2481 ±0)` - // Minimum execution time: 42_906_000 picoseconds. - Weight::from_parts(44_016_242, 0) - .saturating_add(Weight::from_parts(0, 4756)) - // Standard Error: 59_276 - .saturating_add(Weight::from_parts(7_432_557, 0).saturating_mul(t.into())) - // Standard Error: 0 - .saturating_add(Weight::from_parts(4, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(t.into()))) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(Weight::from_parts(0, 2481).saturating_mul(t.into())) - } - /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) - /// Storage: `Revive::CodeInfoOf` (r:1 w:0) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) - /// Storage: `Revive::PristineCode` (r:1 w:0) - /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) - fn seal_delegate_call() -> Weight { - // Proof Size summary in bytes: - // Measured: `1234` - // Estimated: `4699` - // Minimum execution time: 35_555_000 picoseconds. - Weight::from_parts(36_949_000, 0) - .saturating_add(Weight::from_parts(0, 4699)) - .saturating_add(T::DbWeight::get().reads(3)) - } - /// Storage: `Revive::CodeInfoOf` (r:1 w:1) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) - /// Storage: `Revive::PristineCode` (r:1 w:0) - /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) - /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) - /// The range of component `i` is `[0, 262144]`. - fn seal_instantiate(i: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1219` - // Estimated: `4712` - // Minimum execution time: 148_635_000 picoseconds. - Weight::from_parts(143_195_864, 0) - .saturating_add(Weight::from_parts(0, 4712)) - // Standard Error: 8 - .saturating_add(Weight::from_parts(4_088, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// The range of component `n` is `[0, 262144]`. - fn seal_hash_sha2_256(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 871_000 picoseconds. - Weight::from_parts(5_089_784, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3 - .saturating_add(Weight::from_parts(1_465, 0).saturating_mul(n.into())) - } - /// The range of component `n` is `[0, 262144]`. - fn seal_hash_keccak_256(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_349_000 picoseconds. - Weight::from_parts(4_340_331, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3 - .saturating_add(Weight::from_parts(3_651, 0).saturating_mul(n.into())) - } - /// The range of component `n` is `[0, 262144]`. - fn seal_hash_blake2_256(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 879_000 picoseconds. - Weight::from_parts(4_465_070, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3 - .saturating_add(Weight::from_parts(1_616, 0).saturating_mul(n.into())) - } - /// The range of component `n` is `[0, 262144]`. - fn seal_hash_blake2_128(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 854_000 picoseconds. - Weight::from_parts(5_157_484, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3 - .saturating_add(Weight::from_parts(1_652, 0).saturating_mul(n.into())) - } - /// The range of component `n` is `[0, 261889]`. - fn seal_sr25519_verify(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 45_140_000 picoseconds. - Weight::from_parts(35_105_376, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 9 - .saturating_add(Weight::from_parts(5_548, 0).saturating_mul(n.into())) - } - fn seal_ecdsa_recover() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 48_012_000 picoseconds. - Weight::from_parts(49_358_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn seal_ecdsa_to_eth_address() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 13_007_000 picoseconds. - Weight::from_parts(13_211_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// Storage: `Revive::CodeInfoOf` (r:1 w:1) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) - fn seal_set_code_hash() -> Weight { - // Proof Size summary in bytes: - // Measured: `298` - // Estimated: `3763` - // Minimum execution time: 12_462_000 picoseconds. - Weight::from_parts(12_976_000, 0) - .saturating_add(Weight::from_parts(0, 3763)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// The range of component `r` is `[0, 5000]`. - fn instr(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 9_600_000 picoseconds. - Weight::from_parts(11_394_904, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 97 - .saturating_add(Weight::from_parts(73_509, 0).saturating_mul(r.into())) - } -} From 1dcc86d7074b8aa2b1adcf16334a483ee756a690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Fri, 24 Jan 2025 21:30:03 +0100 Subject: [PATCH 13/41] Move ResetPallet to pallet_migration --- .../assets/asset-hub-westend/src/lib.rs | 6 +- substrate/frame/migrations/Cargo.toml | 3 +- substrate/frame/migrations/src/lib.rs | 1 + substrate/frame/migrations/src/migrations.rs | 129 ++++++++++++++++++ substrate/frame/support/src/migrations.rs | 107 +-------------- 5 files changed, 139 insertions(+), 107 deletions(-) create mode 100644 substrate/frame/migrations/src/migrations.rs diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index f8dc14b45fd40..94d03d0a04e77 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -1102,8 +1102,10 @@ parameter_types! { impl pallet_migrations::Config for Runtime { type RuntimeEvent = RuntimeEvent; #[cfg(not(feature = "runtime-benchmarks"))] - type Migrations = - frame_support::migrations::ResetPallet::DbWeight>; + type Migrations = pallet_migrations::migrations::ResetPallet< + Revive, + ::DbWeight, + >; // Benchmarks need mocked migrations to guarantee that they succeed. #[cfg(feature = "runtime-benchmarks")] type Migrations = pallet_migrations::mock_helpers::MockedMigrations; diff --git a/substrate/frame/migrations/Cargo.toml b/substrate/frame/migrations/Cargo.toml index 469592780beb8..c6ae9fa26928b 100644 --- a/substrate/frame/migrations/Cargo.toml +++ b/substrate/frame/migrations/Cargo.toml @@ -22,13 +22,13 @@ frame-benchmarking = { optional = true, workspace = true } frame-support = { workspace = true } frame-system = { workspace = true } sp-core = { workspace = true } +sp-io = { workspace = true } sp-runtime = { workspace = true } [dev-dependencies] frame-executive = { workspace = true, default-features = true } sp-api = { features = ["std"], workspace = true, default-features = true } sp-block-builder = { features = ["std"], workspace = true, default-features = true } -sp-io = { features = ["std"], workspace = true, default-features = true } sp-tracing = { features = ["std"], workspace = true, default-features = true } sp-version = { features = ["std"], workspace = true, default-features = true } @@ -45,6 +45,7 @@ std = [ "log/std", "scale-info/std", "sp-core/std", + "sp-io/std", "sp-runtime/std", ] diff --git a/substrate/frame/migrations/src/lib.rs b/substrate/frame/migrations/src/lib.rs index 63e638118b07e..fef61468e6e4e 100644 --- a/substrate/frame/migrations/src/lib.rs +++ b/substrate/frame/migrations/src/lib.rs @@ -145,6 +145,7 @@ #![cfg_attr(not(feature = "std"), no_std)] mod benchmarking; +pub mod migrations; mod mock; pub mod mock_helpers; mod tests; diff --git a/substrate/frame/migrations/src/migrations.rs b/substrate/frame/migrations/src/migrations.rs new file mode 100644 index 0000000000000..b7d4c7c1bf7e9 --- /dev/null +++ b/substrate/frame/migrations/src/migrations.rs @@ -0,0 +1,129 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Generic multi block migrations not specific to any pallet. + +use codec::Encode; +use core::marker::PhantomData; +use frame_support::{ + migrations::{SteppedMigration, SteppedMigrationError}, + traits::{BuildGenesisConfig, OnGenesis, PalletInfoAccess}, + weights::{RuntimeDbWeight, WeightMeter}, +}; +use sp_core::{twox_128, Get}; +use sp_io::{storage::clear_prefix, KillStorageResult}; +use sp_runtime::SaturatedConversion; + +/// Remove all of a pallet's state and re-initializes it to the current in-code storage version. +/// +/// It uses the multi block migration frame. Hence it is safe to use even on +/// pallets that contain a lot of storage. +/// +/// # Parameters +/// +/// - P: The pallet to resetted as defined in construct runtime +/// - W: The weight definition for storage access. +/// - B, G: Optional. Can be used if the pallet needs to be initialized via [`BuildGenesisConfig`]. +/// +/// # Note +/// +/// The costs to set the optional genesis state are not accounted for. This should be fine as long +/// as no massive amounts of data are written. +pub struct ResetPallet(PhantomData<(P, W, B, G)>); + +impl ResetPallet +where + P: PalletInfoAccess, +{ + fn hashed_prefix() -> [u8; 16] { + twox_128(P::name().as_bytes()) + } + + #[cfg(feature = "try-runtime")] + fn num_keys() -> u64 { + let prefix = Self::hashed_prefix().to_vec(); + crate::storage::KeyPrefixIterator::new(prefix.clone(), prefix, |_| Ok(())).count() as _ + } +} + +impl SteppedMigration for ResetPallet +where + P: PalletInfoAccess + OnGenesis, + W: Get, + B: BuildGenesisConfig, + G: Get, +{ + type Cursor = (); + type Identifier = [u8; 16]; + + fn id() -> Self::Identifier { + ("RemovePallet::", P::name()).using_encoded(twox_128) + } + + fn step( + _cursor: Option, + meter: &mut WeightMeter, + ) -> Result, SteppedMigrationError> { + let weight_per_key = W::get().writes(1); + let key_budget = meter + .remaining() + .checked_div_per_component(&weight_per_key) + .expect("costs not zero") + .saturated_into(); + + if key_budget == 0 { + return Err(SteppedMigrationError::InsufficientWeight { required: weight_per_key }) + } + + let (keys_removed, cursor) = match clear_prefix(&Self::hashed_prefix(), Some(key_budget)) { + KillStorageResult::AllRemoved(value) => (value.into(), None), + KillStorageResult::SomeRemaining(value) => (value.into(), Some(())), + }; + + meter.consume(W::get().writes(keys_removed)); + + if cursor.is_none() { + // sets pallet version to current in-code version + P::on_genesis(); + + // write the genesis state to storage + G::get().build(); + } + + Ok(cursor) + } + + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { + let num_keys: u64 = Self::num_keys(); + log::info!("ResetPallet<{}>: Trying to remove {num_keys} keys.", P::name()); + Ok(num_keys.encode()) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(state: alloc::vec::Vec) -> Result<(), sp_runtime::TryRuntimeError> { + use codec::Decode; + let keys_before = u64::decode(&mut state.as_ref()).expect("We encoded as u64 above; qed"); + let keys_now = Self::num_keys(); + log::info!("ResetPallet<{}>: Keys remaining after migration: {keys_now}", P::name()); + + if !(keys_before > keys_now) { + log::error!("ResetPallet<{}>: Removed suspiciously low number of keys.", P::name()); + Err("ResetPallet failed")?; + } + + Ok(()) + } +} diff --git a/substrate/frame/support/src/migrations.rs b/substrate/frame/support/src/migrations.rs index 59abe6b84dfd9..3fdf8d6edc958 100644 --- a/substrate/frame/support/src/migrations.rs +++ b/substrate/frame/support/src/migrations.rs @@ -19,8 +19,8 @@ use crate::{ defensive, storage::{storage_prefix, transactional::with_transaction_opaque_err}, traits::{ - BuildGenesisConfig, Defensive, GetStorageVersion, NoStorageVersionSet, OnGenesis, - PalletInfoAccess, SafeMode, StorageVersion, + Defensive, GetStorageVersion, NoStorageVersionSet, PalletInfoAccess, SafeMode, + StorageVersion, }, weights::{RuntimeDbWeight, Weight, WeightMeter}, }; @@ -31,7 +31,7 @@ use impl_trait_for_tuples::impl_for_tuples; use sp_arithmetic::traits::Bounded; use sp_core::Get; use sp_io::{hashing::twox_128, storage::clear_prefix, KillStorageResult}; -use sp_runtime::{traits::Zero, SaturatedConversion}; +use sp_runtime::traits::Zero; /// Handles storage migration pallet versioning. /// @@ -260,107 +260,6 @@ pub fn migrate_from_pallet_version_to_storage_version< Pallets::migrate(db_weight) } -/// Remove all of a pallet's state and re-initializes it to the current in-code storage version. -/// -/// It uses the multi block migration frame. Hence it is safe to use even on -/// pallets that contain a lot of storage. -/// -/// # Parameters -/// -/// - P: The pallet to resetted as defined in construct runtime -/// - W: The weight definition for storage access. -/// - B, G: Optional. Can be used if the pallet needs to be initialized via [`BuildGenesisConfig`]. -/// -/// # Note -/// -/// The costs to set the optional genesis state are not accounted for. This should be fine as long -/// as no massive amounts of data are written. -pub struct ResetPallet(PhantomData<(P, W, B, G)>); - -impl ResetPallet -where - P: PalletInfoAccess, -{ - fn hashed_prefix() -> [u8; 16] { - twox_128(P::name().as_bytes()) - } - - #[cfg(feature = "try-runtime")] - fn num_keys() -> u64 { - let prefix = Self::hashed_prefix().to_vec(); - crate::storage::KeyPrefixIterator::new(prefix.clone(), prefix, |_| Ok(())).count() as _ - } -} - -impl SteppedMigration for ResetPallet -where - P: PalletInfoAccess + OnGenesis, - W: Get, - B: BuildGenesisConfig, - G: Get, -{ - type Cursor = (); - type Identifier = [u8; 16]; - - fn id() -> Self::Identifier { - ("RemovePallet::", P::name()).using_encoded(twox_128) - } - - fn step( - _cursor: Option, - meter: &mut WeightMeter, - ) -> Result, SteppedMigrationError> { - let weight_per_key = W::get().writes(1); - let key_budget = meter - .remaining() - .checked_div_per_component(&weight_per_key) - .expect("costs not zero") - .saturated_into(); - - if key_budget == 0 { - return Err(SteppedMigrationError::InsufficientWeight { required: weight_per_key }) - } - - let (keys_removed, cursor) = match clear_prefix(&Self::hashed_prefix(), Some(key_budget)) { - KillStorageResult::AllRemoved(value) => (value.into(), None), - KillStorageResult::SomeRemaining(value) => (value.into(), Some(())), - }; - - meter.consume(W::get().writes(keys_removed)); - - if cursor.is_none() { - // sets pallet version to current in-code version - P::on_genesis(); - - // write the genesis state to storage - G::get().build(); - } - - Ok(cursor) - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { - let num_keys: u64 = Self::num_keys(); - log::info!("ResetPallet<{}>: Trying to remove {num_keys} keys.", P::name()); - Ok(num_keys.encode()) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade(state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { - let keys_before = u64::decode(&mut state.as_ref()).expect("We encoded as u64 above; qed"); - let keys_now = Self::num_keys(); - log::info!("ResetPallet<{}>: Keys remaining after migration: {keys_now}", P::name()); - - if !(keys_before > keys_now) { - log::error!("ResetPallet<{}>: Removed suspiciously low number of keys.", P::name()); - Err("ResetPallet failed")?; - } - - Ok(()) - } -} - /// `RemovePallet` is a utility struct used to remove all storage items associated with a specific /// pallet. /// From 8b49073ff523b5985096b3f9a1ea92f3eaf9012a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Sat, 25 Jan 2025 00:53:09 +0100 Subject: [PATCH 14/41] Add benchmark --- .../frame/migrations/src/benchmarking.rs | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/substrate/frame/migrations/src/benchmarking.rs b/substrate/frame/migrations/src/benchmarking.rs index c076d40bb05cd..c779f9e8cbc5c 100644 --- a/substrate/frame/migrations/src/benchmarking.rs +++ b/substrate/frame/migrations/src/benchmarking.rs @@ -19,8 +19,11 @@ use super::*; +use core::array; use frame_benchmarking::{v2::*, BenchmarkError}; use frame_system::{Pallet as System, RawOrigin}; +use sp_core::{twox_128, Get}; +use sp_io::{storage, KillStorageResult}; use sp_runtime::traits::One; fn assert_last_event(generic_event: ::RuntimeEvent) { @@ -204,6 +207,32 @@ mod benches { ); } + #[benchmark(skip_meta, pov_mode = Measured)] + fn reset_pallet_migration(n: Linear<0, 2048>) -> Result<(), BenchmarkError> { + let prefix: [u8; 16] = twox_128(b"__ResetPalletBenchmarkPrefix__"); + + for i in 0..n { + // we need to avoid allocations here + let mut iter = prefix.into_iter().chain(i.to_le_bytes()); + let key: [u8; 20] = array::from_fn(|_| iter.next().unwrap()); + storage::set(&key, &[42]); + } + + let result; + + #[block] + { + result = storage::clear_prefix(&prefix, None); + } + + match result { + KillStorageResult::AllRemoved(i) if i == n => (), + _ => Err("Unexpected number of keys were removed")?, + } + + Ok(()) + } + fn cursor() -> CursorOf { // Note: The weight of a function can depend on the weight of reading the `inner_cursor`. // `Cursor` is a user provided type. Now instead of requiring something like `Cursor: From e77590185eb3b42b6ba1454840134fd7f5cee9cf Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 Jan 2025 01:18:07 +0000 Subject: [PATCH 15/41] Update from athei running command 'bench-omni --runtime asset-hub-westend --pallet pallet_migrations --fail-fast --clean' --- .../src/weights/pallet_migrations.rs | 72 +++++++++++-------- 1 file changed, 44 insertions(+), 28 deletions(-) diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_migrations.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_migrations.rs index 998ef58895de3..d24f60f568c7b 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_migrations.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_migrations.rs @@ -17,9 +17,9 @@ //! Autogenerated weights for `pallet_migrations` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-01-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-01-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `c6b61d7f408b`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `9595a9c017ce`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -59,8 +59,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `171` // Estimated: `67035` - // Minimum execution time: 10_385_000 picoseconds. - Weight::from_parts(10_929_000, 0) + // Minimum execution time: 8_604_000 picoseconds. + Weight::from_parts(8_997_000, 0) .saturating_add(Weight::from_parts(0, 67035)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -71,8 +71,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `67035` - // Minimum execution time: 3_268_000 picoseconds. - Weight::from_parts(3_410_000, 0) + // Minimum execution time: 2_747_000 picoseconds. + Weight::from_parts(2_863_000, 0) .saturating_add(Weight::from_parts(0, 67035)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -84,8 +84,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `129` // Estimated: `3594` - // Minimum execution time: 7_879_000 picoseconds. - Weight::from_parts(8_298_000, 0) + // Minimum execution time: 6_118_000 picoseconds. + Weight::from_parts(6_428_000, 0) .saturating_add(Weight::from_parts(0, 3594)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -98,8 +98,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `225` // Estimated: `3731` - // Minimum execution time: 14_882_000 picoseconds. - Weight::from_parts(15_278_000, 0) + // Minimum execution time: 12_052_000 picoseconds. + Weight::from_parts(12_433_000, 0) .saturating_add(Weight::from_parts(0, 3731)) .saturating_add(T::DbWeight::get().reads(2)) } @@ -111,8 +111,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `171` // Estimated: `3731` - // Minimum execution time: 14_337_000 picoseconds. - Weight::from_parts(14_736_000, 0) + // Minimum execution time: 11_400_000 picoseconds. + Weight::from_parts(11_815_000, 0) .saturating_add(Weight::from_parts(0, 3731)) .saturating_add(T::DbWeight::get().reads(2)) } @@ -124,8 +124,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `171` // Estimated: `3731` - // Minimum execution time: 16_557_000 picoseconds. - Weight::from_parts(17_061_000, 0) + // Minimum execution time: 12_895_000 picoseconds. + Weight::from_parts(13_408_000, 0) .saturating_add(Weight::from_parts(0, 3731)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -140,8 +140,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `171` // Estimated: `3731` - // Minimum execution time: 17_377_000 picoseconds. - Weight::from_parts(17_775_000, 0) + // Minimum execution time: 13_680_000 picoseconds. + Weight::from_parts(14_206_000, 0) .saturating_add(Weight::from_parts(0, 3731)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -150,8 +150,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 253_000 picoseconds. - Weight::from_parts(290_000, 0) + // Minimum execution time: 160_000 picoseconds. + Weight::from_parts(184_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) @@ -160,8 +160,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_813_000 picoseconds. - Weight::from_parts(4_025_000, 0) + // Minimum execution time: 2_642_000 picoseconds. + Weight::from_parts(2_921_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -171,8 +171,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_459_000 picoseconds. - Weight::from_parts(4_682_000, 0) + // Minimum execution time: 2_885_000 picoseconds. + Weight::from_parts(3_176_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -184,8 +184,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `147` // Estimated: `67035` - // Minimum execution time: 8_040_000 picoseconds. - Weight::from_parts(8_345_000, 0) + // Minimum execution time: 6_435_000 picoseconds. + Weight::from_parts(6_838_000, 0) .saturating_add(Weight::from_parts(0, 67035)) .saturating_add(T::DbWeight::get().reads(2)) } @@ -196,14 +196,30 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1022 + n * (271 ±0)` // Estimated: `3834 + n * (2740 ±0)` - // Minimum execution time: 19_643_000 picoseconds. - Weight::from_parts(19_906_409, 0) + // Minimum execution time: 15_997_000 picoseconds. + Weight::from_parts(14_171_357, 0) .saturating_add(Weight::from_parts(0, 3834)) - // Standard Error: 3_212 - .saturating_add(Weight::from_parts(1_568_857, 0).saturating_mul(n.into())) + // Standard Error: 3_298 + .saturating_add(Weight::from_parts(1_457_875, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) .saturating_add(Weight::from_parts(0, 2740).saturating_mul(n.into())) } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 2048]`. + fn reset_pallet_migration(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1053 + n * (6 ±0)` + // Estimated: `612 + n * (7 ±0)` + // Minimum execution time: 2_182_000 picoseconds. + Weight::from_parts(2_281_000, 0) + .saturating_add(Weight::from_parts(0, 612)) + // Standard Error: 494 + .saturating_add(Weight::from_parts(630_585, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) + .saturating_add(Weight::from_parts(0, 7).saturating_mul(n.into())) + } } From 52c4d34c01484f5fb28768858da5276bb3f8bd6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Sat, 25 Jan 2025 11:36:24 +0100 Subject: [PATCH 16/41] Remove no longer needed 64bit check on call --- substrate/frame/revive/src/wasm/mod.rs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/substrate/frame/revive/src/wasm/mod.rs b/substrate/frame/revive/src/wasm/mod.rs index d22e0c6dc0b27..dc49fae26fdaa 100644 --- a/substrate/frame/revive/src/wasm/mod.rs +++ b/substrate/frame/revive/src/wasm/mod.rs @@ -324,15 +324,6 @@ impl WasmBlob { Error::::CodeRejected })?; - // This is checked at deploy time but we also want to reject pre-existing - // 32bit programs. - // TODO: Remove when we reset the test net. - // https://github.com/paritytech/contract-issues/issues/11 - if !module.is_64_bit() { - log::debug!(target: LOG_TARGET, "32bit programs are not supported."); - Err(Error::::CodeRejected)?; - } - let entry_program_counter = module .exports() .find(|export| export.symbol().as_bytes() == entry_point.identifier().as_bytes()) From abbbb7f5bf4c482e84c659cd3cee84892648653d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Sat, 25 Jan 2025 16:14:16 +0100 Subject: [PATCH 17/41] Manually add new weights to the substrate weight file --- substrate/frame/migrations/src/weights.rs | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/substrate/frame/migrations/src/weights.rs b/substrate/frame/migrations/src/weights.rs index 49ae379dba020..e5788e7a5c1f3 100644 --- a/substrate/frame/migrations/src/weights.rs +++ b/substrate/frame/migrations/src/weights.rs @@ -63,6 +63,7 @@ pub trait WeightInfo { fn force_set_active_cursor() -> Weight; fn force_onboard_mbms() -> Weight; fn clear_historic(n: u32, ) -> Weight; + fn reset_pallet_migration(n: u32, ) -> Weight; } /// Weights for `pallet_migrations` using the Substrate node and recommended hardware. @@ -211,6 +212,22 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) .saturating_add(Weight::from_parts(0, 2740).saturating_mul(n.into())) } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 2048]`. + fn reset_pallet_migration(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1053 + n * (6 ±0)` + // Estimated: `612 + n * (7 ±0)` + // Minimum execution time: 2_182_000 picoseconds. + Weight::from_parts(2_281_000, 0) + .saturating_add(Weight::from_parts(0, 612)) + // Standard Error: 494 + .saturating_add(Weight::from_parts(630_585, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) + .saturating_add(Weight::from_parts(0, 7).saturating_mul(n.into())) + } } // For backwards compatibility and tests. @@ -358,4 +375,20 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into()))) .saturating_add(Weight::from_parts(0, 2740).saturating_mul(n.into())) } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 2048]`. + fn reset_pallet_migration(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1053 + n * (6 ±0)` + // Estimated: `612 + n * (7 ±0)` + // Minimum execution time: 2_182_000 picoseconds. + Weight::from_parts(2_281_000, 0) + .saturating_add(Weight::from_parts(0, 612)) + // Standard Error: 494 + .saturating_add(Weight::from_parts(630_585, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into()))) + .saturating_add(Weight::from_parts(0, 7).saturating_mul(n.into())) + } } From c998988524c1b8ceded1576fe88e354a47cc4271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Sat, 25 Jan 2025 16:47:58 +0100 Subject: [PATCH 18/41] Manually add new benchmark to all runtimes --- .../src/weights/pallet_migrations.rs | 18 +++++++++++++++++- .../src/weights/pallet_migrations.rs | 18 +++++++++++++++++- .../rococo/src/weights/pallet_migrations.rs | 18 +++++++++++++++++- .../westend/src/weights/pallet_migrations.rs | 18 +++++++++++++++++- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_migrations.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_migrations.rs index 61857ac8202a0..0826be749de7c 100644 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_migrations.rs +++ b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_migrations.rs @@ -169,4 +169,20 @@ impl pallet_migrations::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) .saturating_add(Weight::from_parts(0, 2740).saturating_mul(n.into())) } -} \ No newline at end of file + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 2048]`. + fn reset_pallet_migration(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1053 + n * (6 ±0)` + // Estimated: `612 + n * (7 ±0)` + // Minimum execution time: 2_182_000 picoseconds. + Weight::from_parts(2_281_000, 0) + .saturating_add(Weight::from_parts(0, 612)) + // Standard Error: 494 + .saturating_add(Weight::from_parts(630_585, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) + .saturating_add(Weight::from_parts(0, 7).saturating_mul(n.into())) + } +} diff --git a/cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_migrations.rs b/cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_migrations.rs index 61857ac8202a0..0826be749de7c 100644 --- a/cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_migrations.rs +++ b/cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_migrations.rs @@ -169,4 +169,20 @@ impl pallet_migrations::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) .saturating_add(Weight::from_parts(0, 2740).saturating_mul(n.into())) } -} \ No newline at end of file + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 2048]`. + fn reset_pallet_migration(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1053 + n * (6 ±0)` + // Estimated: `612 + n * (7 ±0)` + // Minimum execution time: 2_182_000 picoseconds. + Weight::from_parts(2_281_000, 0) + .saturating_add(Weight::from_parts(0, 612)) + // Standard Error: 494 + .saturating_add(Weight::from_parts(630_585, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) + .saturating_add(Weight::from_parts(0, 7).saturating_mul(n.into())) + } +} diff --git a/polkadot/runtime/rococo/src/weights/pallet_migrations.rs b/polkadot/runtime/rococo/src/weights/pallet_migrations.rs index 4fa07a23bb8ab..f013b1299f2cc 100644 --- a/polkadot/runtime/rococo/src/weights/pallet_migrations.rs +++ b/polkadot/runtime/rococo/src/weights/pallet_migrations.rs @@ -170,4 +170,20 @@ impl pallet_migrations::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) .saturating_add(Weight::from_parts(0, 2740).saturating_mul(n.into())) } -} \ No newline at end of file + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 2048]`. + fn reset_pallet_migration(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1053 + n * (6 ±0)` + // Estimated: `612 + n * (7 ±0)` + // Minimum execution time: 2_182_000 picoseconds. + Weight::from_parts(2_281_000, 0) + .saturating_add(Weight::from_parts(0, 612)) + // Standard Error: 494 + .saturating_add(Weight::from_parts(630_585, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) + .saturating_add(Weight::from_parts(0, 7).saturating_mul(n.into())) + } +} diff --git a/polkadot/runtime/westend/src/weights/pallet_migrations.rs b/polkadot/runtime/westend/src/weights/pallet_migrations.rs index 4fa07a23bb8ab..f013b1299f2cc 100644 --- a/polkadot/runtime/westend/src/weights/pallet_migrations.rs +++ b/polkadot/runtime/westend/src/weights/pallet_migrations.rs @@ -170,4 +170,20 @@ impl pallet_migrations::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) .saturating_add(Weight::from_parts(0, 2740).saturating_mul(n.into())) } -} \ No newline at end of file + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 2048]`. + fn reset_pallet_migration(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1053 + n * (6 ±0)` + // Estimated: `612 + n * (7 ±0)` + // Minimum execution time: 2_182_000 picoseconds. + Weight::from_parts(2_281_000, 0) + .saturating_add(Weight::from_parts(0, 612)) + // Standard Error: 494 + .saturating_add(Weight::from_parts(630_585, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) + .saturating_add(Weight::from_parts(0, 7).saturating_mul(n.into())) + } +} From c137bd71df3efc907606bde1a8c48860f0fb07c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Sun, 26 Jan 2025 12:34:11 +0100 Subject: [PATCH 19/41] clippy: Simplify boolean expression --- substrate/frame/migrations/src/migrations.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/migrations/src/migrations.rs b/substrate/frame/migrations/src/migrations.rs index b7d4c7c1bf7e9..bd2ac3ee9ace0 100644 --- a/substrate/frame/migrations/src/migrations.rs +++ b/substrate/frame/migrations/src/migrations.rs @@ -119,7 +119,7 @@ where let keys_now = Self::num_keys(); log::info!("ResetPallet<{}>: Keys remaining after migration: {keys_now}", P::name()); - if !(keys_before > keys_now) { + if keys_before <= keys_now { log::error!("ResetPallet<{}>: Removed suspiciously low number of keys.", P::name()); Err("ResetPallet failed")?; } From d273bbe6e63fe513ac38edecf60a2edb7e955285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Sun, 26 Jan 2025 12:51:07 +0100 Subject: [PATCH 20/41] Use benchmarked weight in migration --- .../assets/asset-hub-westend/src/lib.rs | 5 +---- substrate/frame/migrations/src/migrations.rs | 17 ++++++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index 94d03d0a04e77..7c0b3305d33f5 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -1102,10 +1102,7 @@ parameter_types! { impl pallet_migrations::Config for Runtime { type RuntimeEvent = RuntimeEvent; #[cfg(not(feature = "runtime-benchmarks"))] - type Migrations = pallet_migrations::migrations::ResetPallet< - Revive, - ::DbWeight, - >; + type Migrations = pallet_migrations::migrations::ResetPallet; // Benchmarks need mocked migrations to guarantee that they succeed. #[cfg(feature = "runtime-benchmarks")] type Migrations = pallet_migrations::mock_helpers::MockedMigrations; diff --git a/substrate/frame/migrations/src/migrations.rs b/substrate/frame/migrations/src/migrations.rs index bd2ac3ee9ace0..0d0089b0eaf10 100644 --- a/substrate/frame/migrations/src/migrations.rs +++ b/substrate/frame/migrations/src/migrations.rs @@ -15,12 +15,13 @@ //! Generic multi block migrations not specific to any pallet. +use crate::{weights::WeightInfo, Config}; use codec::Encode; use core::marker::PhantomData; use frame_support::{ migrations::{SteppedMigration, SteppedMigrationError}, traits::{BuildGenesisConfig, OnGenesis, PalletInfoAccess}, - weights::{RuntimeDbWeight, WeightMeter}, + weights::WeightMeter, }; use sp_core::{twox_128, Get}; use sp_io::{storage::clear_prefix, KillStorageResult}; @@ -41,9 +42,9 @@ use sp_runtime::SaturatedConversion; /// /// The costs to set the optional genesis state are not accounted for. This should be fine as long /// as no massive amounts of data are written. -pub struct ResetPallet(PhantomData<(P, W, B, G)>); +pub struct ResetPallet(PhantomData<(T, P, B, G)>); -impl ResetPallet +impl ResetPallet where P: PalletInfoAccess, { @@ -58,10 +59,10 @@ where } } -impl SteppedMigration for ResetPallet +impl SteppedMigration for ResetPallet where + T: Config, P: PalletInfoAccess + OnGenesis, - W: Get, B: BuildGenesisConfig, G: Get, { @@ -76,9 +77,11 @@ where _cursor: Option, meter: &mut WeightMeter, ) -> Result, SteppedMigrationError> { - let weight_per_key = W::get().writes(1); + let base_weight = T::WeightInfo::reset_pallet_migration(0); + let weight_per_key = T::WeightInfo::reset_pallet_migration(1) - base_weight; let key_budget = meter .remaining() + .saturating_sub(base_weight) .checked_div_per_component(&weight_per_key) .expect("costs not zero") .saturated_into(); @@ -92,7 +95,7 @@ where KillStorageResult::SomeRemaining(value) => (value.into(), Some(())), }; - meter.consume(W::get().writes(keys_removed)); + meter.consume(T::WeightInfo::reset_pallet_migration(keys_removed)); if cursor.is_none() { // sets pallet version to current in-code version From 99abd1384e44b5a36c5649701beed8ee9b054c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Mon, 27 Jan 2025 12:00:38 +0100 Subject: [PATCH 21/41] Use value size of 32bytes --- substrate/frame/migrations/src/benchmarking.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/substrate/frame/migrations/src/benchmarking.rs b/substrate/frame/migrations/src/benchmarking.rs index c779f9e8cbc5c..88bde8c54916a 100644 --- a/substrate/frame/migrations/src/benchmarking.rs +++ b/substrate/frame/migrations/src/benchmarking.rs @@ -215,7 +215,9 @@ mod benches { // we need to avoid allocations here let mut iter = prefix.into_iter().chain(i.to_le_bytes()); let key: [u8; 20] = array::from_fn(|_| iter.next().unwrap()); - storage::set(&key, &[42]); + // 32 byte will trigger the worst case where the value is + // no longer stored inline + storage::set(&key, &[0u8; 32]); } let result; From a259955ae3238420e1af1817a32e667c46fa46c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Mon, 27 Jan 2025 13:06:31 +0100 Subject: [PATCH 22/41] Clippy --- substrate/frame/migrations/src/migrations.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/substrate/frame/migrations/src/migrations.rs b/substrate/frame/migrations/src/migrations.rs index 0d0089b0eaf10..889860c9d4a13 100644 --- a/substrate/frame/migrations/src/migrations.rs +++ b/substrate/frame/migrations/src/migrations.rs @@ -91,8 +91,8 @@ where } let (keys_removed, cursor) = match clear_prefix(&Self::hashed_prefix(), Some(key_budget)) { - KillStorageResult::AllRemoved(value) => (value.into(), None), - KillStorageResult::SomeRemaining(value) => (value.into(), Some(())), + KillStorageResult::AllRemoved(value) => (value, None), + KillStorageResult::SomeRemaining(value) => (value, Some(())), }; meter.consume(T::WeightInfo::reset_pallet_migration(keys_removed)); From fee7935ae4d4b5f36e697d20ce44d5a0975b7365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Mon, 27 Jan 2025 13:26:32 +0100 Subject: [PATCH 23/41] Update docs --- substrate/frame/migrations/src/migrations.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/substrate/frame/migrations/src/migrations.rs b/substrate/frame/migrations/src/migrations.rs index 889860c9d4a13..2a16d6d2d485c 100644 --- a/substrate/frame/migrations/src/migrations.rs +++ b/substrate/frame/migrations/src/migrations.rs @@ -35,13 +35,12 @@ use sp_runtime::SaturatedConversion; /// # Parameters /// /// - P: The pallet to resetted as defined in construct runtime -/// - W: The weight definition for storage access. /// - B, G: Optional. Can be used if the pallet needs to be initialized via [`BuildGenesisConfig`]. /// /// # Note /// -/// The costs to set the optional genesis state are not accounted for. This should be fine as long -/// as no massive amounts of data are written. +/// The costs to set the optional genesis state are not accounted for. Make sure that there is enough +/// space in the block when supplying those parameters. pub struct ResetPallet(PhantomData<(T, P, B, G)>); impl ResetPallet From dba9a1f47668549667d14f73b99bef78942dac3b Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 14:12:59 +0000 Subject: [PATCH 24/41] Update from mordamax running command 'bench-omni --runtime dev asset-hub-westend people-rococo people-westend rococo westend --pallet pallet_migrations --fail-fast --clean' --- .../src/weights/pallet_migrations.rs | 72 +++--- .../src/weights/pallet_migrations.rs | 191 +++++++++------ .../src/weights/pallet_migrations.rs | 191 +++++++++------ .../rococo/src/weights/pallet_migrations.rs | 164 ++++++++----- .../westend/src/weights/pallet_migrations.rs | 164 ++++++++----- substrate/frame/migrations/src/weights.rs | 222 +++++++++--------- 6 files changed, 577 insertions(+), 427 deletions(-) diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_migrations.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_migrations.rs index d24f60f568c7b..e771059cec859 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_migrations.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_migrations.rs @@ -17,9 +17,9 @@ //! Autogenerated weights for `pallet_migrations` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-01-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `9595a9c017ce`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `17938671047b`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -59,8 +59,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `171` // Estimated: `67035` - // Minimum execution time: 8_604_000 picoseconds. - Weight::from_parts(8_997_000, 0) + // Minimum execution time: 8_697_000 picoseconds. + Weight::from_parts(8_998_000, 0) .saturating_add(Weight::from_parts(0, 67035)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -71,8 +71,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `67035` - // Minimum execution time: 2_747_000 picoseconds. - Weight::from_parts(2_863_000, 0) + // Minimum execution time: 2_737_000 picoseconds. + Weight::from_parts(2_813_000, 0) .saturating_add(Weight::from_parts(0, 67035)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -84,8 +84,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `129` // Estimated: `3594` - // Minimum execution time: 6_118_000 picoseconds. - Weight::from_parts(6_428_000, 0) + // Minimum execution time: 6_181_000 picoseconds. + Weight::from_parts(6_458_000, 0) .saturating_add(Weight::from_parts(0, 3594)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -98,8 +98,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `225` // Estimated: `3731` - // Minimum execution time: 12_052_000 picoseconds. - Weight::from_parts(12_433_000, 0) + // Minimum execution time: 11_932_000 picoseconds. + Weight::from_parts(12_539_000, 0) .saturating_add(Weight::from_parts(0, 3731)) .saturating_add(T::DbWeight::get().reads(2)) } @@ -111,8 +111,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `171` // Estimated: `3731` - // Minimum execution time: 11_400_000 picoseconds. - Weight::from_parts(11_815_000, 0) + // Minimum execution time: 11_127_000 picoseconds. + Weight::from_parts(11_584_000, 0) .saturating_add(Weight::from_parts(0, 3731)) .saturating_add(T::DbWeight::get().reads(2)) } @@ -124,8 +124,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `171` // Estimated: `3731` - // Minimum execution time: 12_895_000 picoseconds. - Weight::from_parts(13_408_000, 0) + // Minimum execution time: 12_930_000 picoseconds. + Weight::from_parts(13_272_000, 0) .saturating_add(Weight::from_parts(0, 3731)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -140,8 +140,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `171` // Estimated: `3731` - // Minimum execution time: 13_680_000 picoseconds. - Weight::from_parts(14_206_000, 0) + // Minimum execution time: 13_709_000 picoseconds. + Weight::from_parts(14_123_000, 0) .saturating_add(Weight::from_parts(0, 3731)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -150,8 +150,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 160_000 picoseconds. - Weight::from_parts(184_000, 0) + // Minimum execution time: 162_000 picoseconds. + Weight::from_parts(188_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) @@ -160,8 +160,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_642_000 picoseconds. - Weight::from_parts(2_921_000, 0) + // Minimum execution time: 2_737_000 picoseconds. + Weight::from_parts(2_919_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -171,8 +171,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_885_000 picoseconds. - Weight::from_parts(3_176_000, 0) + // Minimum execution time: 3_087_000 picoseconds. + Weight::from_parts(3_320_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -184,8 +184,8 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `147` // Estimated: `67035` - // Minimum execution time: 6_435_000 picoseconds. - Weight::from_parts(6_838_000, 0) + // Minimum execution time: 6_470_000 picoseconds. + Weight::from_parts(6_760_000, 0) .saturating_add(Weight::from_parts(0, 67035)) .saturating_add(T::DbWeight::get().reads(2)) } @@ -196,11 +196,11 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1022 + n * (271 ±0)` // Estimated: `3834 + n * (2740 ±0)` - // Minimum execution time: 15_997_000 picoseconds. - Weight::from_parts(14_171_357, 0) + // Minimum execution time: 15_864_000 picoseconds. + Weight::from_parts(24_535_162, 0) .saturating_add(Weight::from_parts(0, 3834)) - // Standard Error: 3_298 - .saturating_add(Weight::from_parts(1_457_875, 0).saturating_mul(n.into())) + // Standard Error: 8_688 + .saturating_add(Weight::from_parts(1_530_542, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -211,15 +211,15 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// The range of component `n` is `[0, 2048]`. fn reset_pallet_migration(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1053 + n * (6 ±0)` - // Estimated: `612 + n * (7 ±0)` - // Minimum execution time: 2_182_000 picoseconds. - Weight::from_parts(2_281_000, 0) - .saturating_add(Weight::from_parts(0, 612)) - // Standard Error: 494 - .saturating_add(Weight::from_parts(630_585, 0).saturating_mul(n.into())) + // Measured: `1680 + n * (38 ±0)` + // Estimated: `758 + n * (39 ±0)` + // Minimum execution time: 2_168_000 picoseconds. + Weight::from_parts(2_226_000, 0) + .saturating_add(Weight::from_parts(0, 758)) + // Standard Error: 2_841 + .saturating_add(Weight::from_parts(935_438, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 7).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 39).saturating_mul(n.into())) } } diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_migrations.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_migrations.rs index 0826be749de7c..57048b6e7095c 100644 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_migrations.rs +++ b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_migrations.rs @@ -1,19 +1,46 @@ // Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 +// This file is part of Cumulus. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. -// Need to rerun! +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_migrations` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `17938671047b`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// frame-omni-bencher +// v1 +// benchmark +// pallet +// --extrinsic=* +// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm +// --pallet=pallet_migrations +// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt +// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights +// --wasm-execution=compiled +// --steps=50 +// --repeat=20 +// --heap-pages=4096 +// --no-storage-info +// --no-min-squares +// --no-median-slopes +// --genesis-builder-policy=none +// --exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -32,22 +59,24 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) fn onboard_new_mbms() -> Weight { // Proof Size summary in bytes: - // Measured: `276` + // Measured: `0` // Estimated: `67035` - // Minimum execution time: 7_762_000 picoseconds. - Weight::from_parts(8_100_000, 67035) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 4_483_000 picoseconds. + Weight::from_parts(4_781_000, 0) + .saturating_add(Weight::from_parts(0, 67035)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn progress_mbms_none() -> Weight { // Proof Size summary in bytes: - // Measured: `142` + // Measured: `0` // Estimated: `67035` - // Minimum execution time: 2_077_000 picoseconds. - Weight::from_parts(2_138_000, 67035) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Minimum execution time: 864_000 picoseconds. + Weight::from_parts(907_000, 0) + .saturating_add(Weight::from_parts(0, 67035)) + .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -55,12 +84,13 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn exec_migration_completed() -> Weight { // Proof Size summary in bytes: - // Measured: `134` - // Estimated: `3599` - // Minimum execution time: 5_868_000 picoseconds. - Weight::from_parts(6_143_000, 3599) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `0` + // Estimated: `3465` + // Minimum execution time: 3_978_000 picoseconds. + Weight::from_parts(4_149_000, 0) + .saturating_add(Weight::from_parts(0, 3465)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -68,11 +98,12 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_skipped_historic() -> Weight { // Proof Size summary in bytes: - // Measured: `330` - // Estimated: `3795` - // Minimum execution time: 10_283_000 picoseconds. - Weight::from_parts(10_964_000, 3795) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `34` + // Estimated: `3731` + // Minimum execution time: 7_432_000 picoseconds. + Weight::from_parts(7_663_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -80,11 +111,12 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_advance() -> Weight { // Proof Size summary in bytes: - // Measured: `276` - // Estimated: `3741` - // Minimum execution time: 9_900_000 picoseconds. - Weight::from_parts(10_396_000, 3741) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `0` + // Estimated: `3731` + // Minimum execution time: 6_915_000 picoseconds. + Weight::from_parts(7_112_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -92,12 +124,13 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_complete() -> Weight { // Proof Size summary in bytes: - // Measured: `276` - // Estimated: `3741` - // Minimum execution time: 11_411_000 picoseconds. - Weight::from_parts(11_956_000, 3741) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `0` + // Estimated: `3731` + // Minimum execution time: 8_561_000 picoseconds. + Weight::from_parts(8_701_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -107,19 +140,21 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn exec_migration_fail() -> Weight { // Proof Size summary in bytes: - // Measured: `276` - // Estimated: `3741` - // Minimum execution time: 12_398_000 picoseconds. - Weight::from_parts(12_910_000, 3741) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `0` + // Estimated: `3731` + // Minimum execution time: 8_998_000 picoseconds. + Weight::from_parts(9_348_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } fn on_init_loop() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 166_000 picoseconds. - Weight::from_parts(193_000, 0) + // Minimum execution time: 145_000 picoseconds. + Weight::from_parts(183_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) @@ -127,9 +162,10 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_686_000 picoseconds. - Weight::from_parts(2_859_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 2_137_000 picoseconds. + Weight::from_parts(2_275_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) @@ -137,9 +173,10 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_070_000 picoseconds. - Weight::from_parts(3_250_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 2_625_000 picoseconds. + Weight::from_parts(2_748_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) @@ -147,24 +184,26 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) fn force_onboard_mbms() -> Weight { // Proof Size summary in bytes: - // Measured: `251` + // Measured: `0` // Estimated: `67035` - // Minimum execution time: 5_901_000 picoseconds. - Weight::from_parts(6_320_000, 67035) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Minimum execution time: 3_010_000 picoseconds. + Weight::from_parts(3_170_000, 0) + .saturating_add(Weight::from_parts(0, 67035)) + .saturating_add(T::DbWeight::get().reads(2)) } /// Storage: `MultiBlockMigrations::Historic` (r:256 w:256) /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) /// The range of component `n` is `[0, 256]`. fn clear_historic(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1122 + n * (271 ±0)` + // Measured: `960 + n * (271 ±0)` // Estimated: `3834 + n * (2740 ±0)` - // Minimum execution time: 15_952_000 picoseconds. - Weight::from_parts(14_358_665, 3834) - // Standard Error: 3_358 - .saturating_add(Weight::from_parts(1_323_674, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Minimum execution time: 15_088_000 picoseconds. + Weight::from_parts(27_216_754, 0) + .saturating_add(Weight::from_parts(0, 3834)) + // Standard Error: 5_635 + .saturating_add(Weight::from_parts(1_399_330, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) .saturating_add(Weight::from_parts(0, 2740).saturating_mul(n.into())) @@ -174,15 +213,15 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// The range of component `n` is `[0, 2048]`. fn reset_pallet_migration(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1053 + n * (6 ±0)` - // Estimated: `612 + n * (7 ±0)` - // Minimum execution time: 2_182_000 picoseconds. - Weight::from_parts(2_281_000, 0) - .saturating_add(Weight::from_parts(0, 612)) - // Standard Error: 494 - .saturating_add(Weight::from_parts(630_585, 0).saturating_mul(n.into())) + // Measured: `1605 + n * (38 ±0)` + // Estimated: `686 + n * (39 ±0)` + // Minimum execution time: 1_168_000 picoseconds. + Weight::from_parts(1_235_000, 0) + .saturating_add(Weight::from_parts(0, 686)) + // Standard Error: 2_626 + .saturating_add(Weight::from_parts(936_331, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 7).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 39).saturating_mul(n.into())) } } diff --git a/cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_migrations.rs b/cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_migrations.rs index 0826be749de7c..ecc52360a3ce1 100644 --- a/cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_migrations.rs +++ b/cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_migrations.rs @@ -1,19 +1,46 @@ // Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 +// This file is part of Cumulus. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. -// Need to rerun! +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_migrations` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `17938671047b`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// frame-omni-bencher +// v1 +// benchmark +// pallet +// --extrinsic=* +// --runtime=target/production/wbuild/people-westend-runtime/people_westend_runtime.wasm +// --pallet=pallet_migrations +// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt +// --output=./cumulus/parachains/runtimes/people/people-westend/src/weights +// --wasm-execution=compiled +// --steps=50 +// --repeat=20 +// --heap-pages=4096 +// --no-storage-info +// --no-min-squares +// --no-median-slopes +// --genesis-builder-policy=none +// --exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -32,22 +59,24 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) fn onboard_new_mbms() -> Weight { // Proof Size summary in bytes: - // Measured: `276` + // Measured: `0` // Estimated: `67035` - // Minimum execution time: 7_762_000 picoseconds. - Weight::from_parts(8_100_000, 67035) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 4_484_000 picoseconds. + Weight::from_parts(4_646_000, 0) + .saturating_add(Weight::from_parts(0, 67035)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn progress_mbms_none() -> Weight { // Proof Size summary in bytes: - // Measured: `142` + // Measured: `0` // Estimated: `67035` - // Minimum execution time: 2_077_000 picoseconds. - Weight::from_parts(2_138_000, 67035) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Minimum execution time: 777_000 picoseconds. + Weight::from_parts(841_000, 0) + .saturating_add(Weight::from_parts(0, 67035)) + .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -55,12 +84,13 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn exec_migration_completed() -> Weight { // Proof Size summary in bytes: - // Measured: `134` - // Estimated: `3599` - // Minimum execution time: 5_868_000 picoseconds. - Weight::from_parts(6_143_000, 3599) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `0` + // Estimated: `3465` + // Minimum execution time: 3_883_000 picoseconds. + Weight::from_parts(4_097_000, 0) + .saturating_add(Weight::from_parts(0, 3465)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -68,11 +98,12 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_skipped_historic() -> Weight { // Proof Size summary in bytes: - // Measured: `330` - // Estimated: `3795` - // Minimum execution time: 10_283_000 picoseconds. - Weight::from_parts(10_964_000, 3795) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `34` + // Estimated: `3731` + // Minimum execution time: 7_695_000 picoseconds. + Weight::from_parts(8_015_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -80,11 +111,12 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_advance() -> Weight { // Proof Size summary in bytes: - // Measured: `276` - // Estimated: `3741` - // Minimum execution time: 9_900_000 picoseconds. - Weight::from_parts(10_396_000, 3741) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `0` + // Estimated: `3731` + // Minimum execution time: 6_999_000 picoseconds. + Weight::from_parts(7_323_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -92,12 +124,13 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_complete() -> Weight { // Proof Size summary in bytes: - // Measured: `276` - // Estimated: `3741` - // Minimum execution time: 11_411_000 picoseconds. - Weight::from_parts(11_956_000, 3741) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `0` + // Estimated: `3731` + // Minimum execution time: 8_302_000 picoseconds. + Weight::from_parts(8_589_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -107,19 +140,21 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn exec_migration_fail() -> Weight { // Proof Size summary in bytes: - // Measured: `276` - // Estimated: `3741` - // Minimum execution time: 12_398_000 picoseconds. - Weight::from_parts(12_910_000, 3741) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `0` + // Estimated: `3731` + // Minimum execution time: 9_122_000 picoseconds. + Weight::from_parts(9_541_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } fn on_init_loop() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 166_000 picoseconds. - Weight::from_parts(193_000, 0) + // Minimum execution time: 146_000 picoseconds. + Weight::from_parts(168_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) @@ -127,9 +162,10 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_686_000 picoseconds. - Weight::from_parts(2_859_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 2_271_000 picoseconds. + Weight::from_parts(2_367_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) @@ -137,9 +173,10 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_070_000 picoseconds. - Weight::from_parts(3_250_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 2_653_000 picoseconds. + Weight::from_parts(2_798_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) @@ -147,24 +184,26 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) fn force_onboard_mbms() -> Weight { // Proof Size summary in bytes: - // Measured: `251` + // Measured: `0` // Estimated: `67035` - // Minimum execution time: 5_901_000 picoseconds. - Weight::from_parts(6_320_000, 67035) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Minimum execution time: 3_084_000 picoseconds. + Weight::from_parts(3_233_000, 0) + .saturating_add(Weight::from_parts(0, 67035)) + .saturating_add(T::DbWeight::get().reads(2)) } /// Storage: `MultiBlockMigrations::Historic` (r:256 w:256) /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) /// The range of component `n` is `[0, 256]`. fn clear_historic(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1122 + n * (271 ±0)` + // Measured: `960 + n * (271 ±0)` // Estimated: `3834 + n * (2740 ±0)` - // Minimum execution time: 15_952_000 picoseconds. - Weight::from_parts(14_358_665, 3834) - // Standard Error: 3_358 - .saturating_add(Weight::from_parts(1_323_674, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Minimum execution time: 18_761_000 picoseconds. + Weight::from_parts(22_980_278, 0) + .saturating_add(Weight::from_parts(0, 3834)) + // Standard Error: 5_634 + .saturating_add(Weight::from_parts(1_419_653, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) .saturating_add(Weight::from_parts(0, 2740).saturating_mul(n.into())) @@ -174,15 +213,15 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// The range of component `n` is `[0, 2048]`. fn reset_pallet_migration(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1053 + n * (6 ±0)` - // Estimated: `612 + n * (7 ±0)` - // Minimum execution time: 2_182_000 picoseconds. - Weight::from_parts(2_281_000, 0) - .saturating_add(Weight::from_parts(0, 612)) - // Standard Error: 494 - .saturating_add(Weight::from_parts(630_585, 0).saturating_mul(n.into())) + // Measured: `1605 + n * (38 ±0)` + // Estimated: `686 + n * (39 ±0)` + // Minimum execution time: 1_174_000 picoseconds. + Weight::from_parts(1_216_000, 0) + .saturating_add(Weight::from_parts(0, 686)) + // Standard Error: 3_009 + .saturating_add(Weight::from_parts(952_922, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 7).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 39).saturating_mul(n.into())) } } diff --git a/polkadot/runtime/rococo/src/weights/pallet_migrations.rs b/polkadot/runtime/rococo/src/weights/pallet_migrations.rs index f013b1299f2cc..a0623a9c95133 100644 --- a/polkadot/runtime/rococo/src/weights/pallet_migrations.rs +++ b/polkadot/runtime/rococo/src/weights/pallet_migrations.rs @@ -14,7 +14,31 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -// Need to rerun! +//! Autogenerated weights for `pallet_migrations` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `17938671047b`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// frame-omni-bencher +// v1 +// benchmark +// pallet +// --extrinsic=* +// --runtime=target/production/wbuild/rococo-runtime/rococo_runtime.wasm +// --pallet=pallet_migrations +// --header=/__w/polkadot-sdk/polkadot-sdk/polkadot/file_header.txt +// --output=./polkadot/runtime/rococo/src/weights +// --wasm-execution=compiled +// --steps=50 +// --repeat=20 +// --heap-pages=4096 +// --no-storage-info +// --no-min-squares +// --no-median-slopes #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -33,22 +57,24 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) fn onboard_new_mbms() -> Weight { // Proof Size summary in bytes: - // Measured: `276` + // Measured: `100` // Estimated: `67035` - // Minimum execution time: 7_762_000 picoseconds. - Weight::from_parts(8_100_000, 67035) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 8_300_000 picoseconds. + Weight::from_parts(8_664_000, 0) + .saturating_add(Weight::from_parts(0, 67035)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn progress_mbms_none() -> Weight { // Proof Size summary in bytes: - // Measured: `142` + // Measured: `4` // Estimated: `67035` - // Minimum execution time: 2_077_000 picoseconds. - Weight::from_parts(2_138_000, 67035) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Minimum execution time: 2_017_000 picoseconds. + Weight::from_parts(2_129_000, 0) + .saturating_add(Weight::from_parts(0, 67035)) + .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -56,12 +82,13 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn exec_migration_completed() -> Weight { // Proof Size summary in bytes: - // Measured: `134` - // Estimated: `3599` - // Minimum execution time: 5_868_000 picoseconds. - Weight::from_parts(6_143_000, 3599) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `96` + // Estimated: `3561` + // Minimum execution time: 6_414_000 picoseconds. + Weight::from_parts(6_644_000, 0) + .saturating_add(Weight::from_parts(0, 3561)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -69,11 +96,12 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_skipped_historic() -> Weight { // Proof Size summary in bytes: - // Measured: `330` - // Estimated: `3795` - // Minimum execution time: 10_283_000 picoseconds. - Weight::from_parts(10_964_000, 3795) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `154` + // Estimated: `3731` + // Minimum execution time: 11_600_000 picoseconds. + Weight::from_parts(12_137_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -81,11 +109,12 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_advance() -> Weight { // Proof Size summary in bytes: - // Measured: `276` - // Estimated: `3741` - // Minimum execution time: 9_900_000 picoseconds. - Weight::from_parts(10_396_000, 3741) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `100` + // Estimated: `3731` + // Minimum execution time: 10_944_000 picoseconds. + Weight::from_parts(11_354_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -93,12 +122,13 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_complete() -> Weight { // Proof Size summary in bytes: - // Measured: `276` - // Estimated: `3741` - // Minimum execution time: 11_411_000 picoseconds. - Weight::from_parts(11_956_000, 3741) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `100` + // Estimated: `3731` + // Minimum execution time: 12_525_000 picoseconds. + Weight::from_parts(12_890_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -108,19 +138,21 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn exec_migration_fail() -> Weight { // Proof Size summary in bytes: - // Measured: `276` - // Estimated: `3741` - // Minimum execution time: 12_398_000 picoseconds. - Weight::from_parts(12_910_000, 3741) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `100` + // Estimated: `3731` + // Minimum execution time: 13_749_000 picoseconds. + Weight::from_parts(14_411_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } fn on_init_loop() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 166_000 picoseconds. - Weight::from_parts(193_000, 0) + // Minimum execution time: 174_000 picoseconds. + Weight::from_parts(232_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) @@ -128,9 +160,10 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_686_000 picoseconds. - Weight::from_parts(2_859_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 2_906_000 picoseconds. + Weight::from_parts(3_195_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) @@ -138,9 +171,10 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_070_000 picoseconds. - Weight::from_parts(3_250_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 3_313_000 picoseconds. + Weight::from_parts(3_469_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) @@ -148,24 +182,26 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) fn force_onboard_mbms() -> Weight { // Proof Size summary in bytes: - // Measured: `251` + // Measured: `76` // Estimated: `67035` - // Minimum execution time: 5_901_000 picoseconds. - Weight::from_parts(6_320_000, 67035) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Minimum execution time: 5_960_000 picoseconds. + Weight::from_parts(6_262_000, 0) + .saturating_add(Weight::from_parts(0, 67035)) + .saturating_add(T::DbWeight::get().reads(2)) } /// Storage: `MultiBlockMigrations::Historic` (r:256 w:256) /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) /// The range of component `n` is `[0, 256]`. fn clear_historic(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1122 + n * (271 ±0)` + // Measured: `984 + n * (271 ±0)` // Estimated: `3834 + n * (2740 ±0)` - // Minimum execution time: 15_952_000 picoseconds. - Weight::from_parts(14_358_665, 3834) - // Standard Error: 3_358 - .saturating_add(Weight::from_parts(1_323_674, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Minimum execution time: 24_007_000 picoseconds. + Weight::from_parts(19_756_256, 0) + .saturating_add(Weight::from_parts(0, 3834)) + // Standard Error: 6_508 + .saturating_add(Weight::from_parts(1_553_207, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) .saturating_add(Weight::from_parts(0, 2740).saturating_mul(n.into())) @@ -175,15 +211,15 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// The range of component `n` is `[0, 2048]`. fn reset_pallet_migration(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1053 + n * (6 ±0)` - // Estimated: `612 + n * (7 ±0)` - // Minimum execution time: 2_182_000 picoseconds. - Weight::from_parts(2_281_000, 0) - .saturating_add(Weight::from_parts(0, 612)) - // Standard Error: 494 - .saturating_add(Weight::from_parts(630_585, 0).saturating_mul(n.into())) + // Measured: `1676 + n * (38 ±0)` + // Estimated: `754 + n * (39 ±0)` + // Minimum execution time: 2_019_000 picoseconds. + Weight::from_parts(6_578_665, 0) + .saturating_add(Weight::from_parts(0, 754)) + // Standard Error: 5_209 + .saturating_add(Weight::from_parts(894_607, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 7).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 39).saturating_mul(n.into())) } } diff --git a/polkadot/runtime/westend/src/weights/pallet_migrations.rs b/polkadot/runtime/westend/src/weights/pallet_migrations.rs index f013b1299f2cc..f5d4f079ca6d3 100644 --- a/polkadot/runtime/westend/src/weights/pallet_migrations.rs +++ b/polkadot/runtime/westend/src/weights/pallet_migrations.rs @@ -14,7 +14,31 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -// Need to rerun! +//! Autogenerated weights for `pallet_migrations` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `17938671047b`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// frame-omni-bencher +// v1 +// benchmark +// pallet +// --extrinsic=* +// --runtime=target/production/wbuild/westend-runtime/westend_runtime.wasm +// --pallet=pallet_migrations +// --header=/__w/polkadot-sdk/polkadot-sdk/polkadot/file_header.txt +// --output=./polkadot/runtime/westend/src/weights +// --wasm-execution=compiled +// --steps=50 +// --repeat=20 +// --heap-pages=4096 +// --no-storage-info +// --no-min-squares +// --no-median-slopes #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -33,22 +57,24 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) fn onboard_new_mbms() -> Weight { // Proof Size summary in bytes: - // Measured: `276` + // Measured: `133` // Estimated: `67035` - // Minimum execution time: 7_762_000 picoseconds. - Weight::from_parts(8_100_000, 67035) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 8_228_000 picoseconds. + Weight::from_parts(8_589_000, 0) + .saturating_add(Weight::from_parts(0, 67035)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn progress_mbms_none() -> Weight { // Proof Size summary in bytes: - // Measured: `142` + // Measured: `4` // Estimated: `67035` - // Minimum execution time: 2_077_000 picoseconds. - Weight::from_parts(2_138_000, 67035) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Minimum execution time: 1_980_000 picoseconds. + Weight::from_parts(2_175_000, 0) + .saturating_add(Weight::from_parts(0, 67035)) + .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -56,12 +82,13 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn exec_migration_completed() -> Weight { // Proof Size summary in bytes: - // Measured: `134` - // Estimated: `3599` - // Minimum execution time: 5_868_000 picoseconds. - Weight::from_parts(6_143_000, 3599) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `129` + // Estimated: `3594` + // Minimum execution time: 6_390_000 picoseconds. + Weight::from_parts(6_711_000, 0) + .saturating_add(Weight::from_parts(0, 3594)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -69,11 +96,12 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_skipped_historic() -> Weight { // Proof Size summary in bytes: - // Measured: `330` - // Estimated: `3795` - // Minimum execution time: 10_283_000 picoseconds. - Weight::from_parts(10_964_000, 3795) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `187` + // Estimated: `3731` + // Minimum execution time: 14_970_000 picoseconds. + Weight::from_parts(16_023_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -81,11 +109,12 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_advance() -> Weight { // Proof Size summary in bytes: - // Measured: `276` - // Estimated: `3741` - // Minimum execution time: 9_900_000 picoseconds. - Weight::from_parts(10_396_000, 3741) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `133` + // Estimated: `3731` + // Minimum execution time: 10_908_000 picoseconds. + Weight::from_parts(11_291_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -93,12 +122,13 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_complete() -> Weight { // Proof Size summary in bytes: - // Measured: `276` - // Estimated: `3741` - // Minimum execution time: 11_411_000 picoseconds. - Weight::from_parts(11_956_000, 3741) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `133` + // Estimated: `3731` + // Minimum execution time: 12_433_000 picoseconds. + Weight::from_parts(12_862_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -108,19 +138,21 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn exec_migration_fail() -> Weight { // Proof Size summary in bytes: - // Measured: `276` - // Estimated: `3741` - // Minimum execution time: 12_398_000 picoseconds. - Weight::from_parts(12_910_000, 3741) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `133` + // Estimated: `3731` + // Minimum execution time: 13_407_000 picoseconds. + Weight::from_parts(13_901_000, 0) + .saturating_add(Weight::from_parts(0, 3731)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } fn on_init_loop() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 166_000 picoseconds. - Weight::from_parts(193_000, 0) + // Minimum execution time: 162_000 picoseconds. + Weight::from_parts(207_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) @@ -128,9 +160,10 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_686_000 picoseconds. - Weight::from_parts(2_859_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 2_696_000 picoseconds. + Weight::from_parts(2_867_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) @@ -138,9 +171,10 @@ impl pallet_migrations::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_070_000 picoseconds. - Weight::from_parts(3_250_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 3_232_000 picoseconds. + Weight::from_parts(3_436_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) @@ -148,24 +182,26 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) fn force_onboard_mbms() -> Weight { // Proof Size summary in bytes: - // Measured: `251` + // Measured: `109` // Estimated: `67035` - // Minimum execution time: 5_901_000 picoseconds. - Weight::from_parts(6_320_000, 67035) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Minimum execution time: 5_849_000 picoseconds. + Weight::from_parts(6_156_000, 0) + .saturating_add(Weight::from_parts(0, 67035)) + .saturating_add(T::DbWeight::get().reads(2)) } /// Storage: `MultiBlockMigrations::Historic` (r:256 w:256) /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) /// The range of component `n` is `[0, 256]`. fn clear_historic(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1122 + n * (271 ±0)` + // Measured: `984 + n * (271 ±0)` // Estimated: `3834 + n * (2740 ±0)` - // Minimum execution time: 15_952_000 picoseconds. - Weight::from_parts(14_358_665, 3834) - // Standard Error: 3_358 - .saturating_add(Weight::from_parts(1_323_674, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Minimum execution time: 20_906_000 picoseconds. + Weight::from_parts(15_361_535, 0) + .saturating_add(Weight::from_parts(0, 3834)) + // Standard Error: 7_911 + .saturating_add(Weight::from_parts(1_518_172, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) .saturating_add(Weight::from_parts(0, 2740).saturating_mul(n.into())) @@ -175,15 +211,15 @@ impl pallet_migrations::WeightInfo for WeightInfo { /// The range of component `n` is `[0, 2048]`. fn reset_pallet_migration(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1053 + n * (6 ±0)` - // Estimated: `612 + n * (7 ±0)` - // Minimum execution time: 2_182_000 picoseconds. - Weight::from_parts(2_281_000, 0) - .saturating_add(Weight::from_parts(0, 612)) - // Standard Error: 494 - .saturating_add(Weight::from_parts(630_585, 0).saturating_mul(n.into())) + // Measured: `1676 + n * (38 ±0)` + // Estimated: `754 + n * (39 ±0)` + // Minimum execution time: 1_913_000 picoseconds. + Weight::from_parts(1_986_000, 0) + .saturating_add(Weight::from_parts(0, 754)) + // Standard Error: 2_511 + .saturating_add(Weight::from_parts(919_965, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 7).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 39).saturating_mul(n.into())) } } diff --git a/substrate/frame/migrations/src/weights.rs b/substrate/frame/migrations/src/weights.rs index e5788e7a5c1f3..10dfd82cbd813 100644 --- a/substrate/frame/migrations/src/weights.rs +++ b/substrate/frame/migrations/src/weights.rs @@ -18,36 +18,38 @@ //! Autogenerated weights for `pallet_migrations` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-11-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-01-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-wiukf8gn-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! HOSTNAME: `17938671047b`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: -// ./target/production/substrate-node +// frame-omni-bencher +// v1 // benchmark // pallet -// --chain=dev +// --extrinsic=* +// --runtime=target/production/wbuild/kitchensink-runtime/kitchensink_runtime.wasm +// --pallet=pallet_migrations +// --header=/__w/polkadot-sdk/polkadot-sdk/substrate/HEADER-APACHE2 +// --output=/__w/polkadot-sdk/polkadot-sdk/substrate/frame/migrations/src/weights.rs +// --wasm-execution=compiled // --steps=50 // --repeat=20 -// --pallet=pallet_migrations +// --heap-pages=4096 +// --template=substrate/.maintain/frame-weight-template.hbs // --no-storage-info -// --no-median-slopes // --no-min-squares -// --extrinsic=* -// --wasm-execution=compiled -// --heap-pages=4096 -// --output=./substrate/frame/migrations/src/weights.rs -// --header=./substrate/HEADER-APACHE2 -// --template=./substrate/.maintain/frame-weight-template.hbs +// --no-median-slopes +// --genesis-builder-policy=none +// --exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic,pallet_nomination_pools,pallet_remark,pallet_transaction_storage #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] #![allow(missing_docs)] -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use core::marker::PhantomData; +use frame::weights_prelude::*; /// Weight functions needed for `pallet_migrations`. pub trait WeightInfo { @@ -75,10 +77,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) fn onboard_new_mbms() -> Weight { // Proof Size summary in bytes: - // Measured: `309` + // Measured: `0` // Estimated: `67035` - // Minimum execution time: 9_520_000 picoseconds. - Weight::from_parts(9_934_000, 67035) + // Minimum execution time: 4_422_000 picoseconds. + Weight::from_parts(4_560_000, 67035) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -86,10 +88,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn progress_mbms_none() -> Weight { // Proof Size summary in bytes: - // Measured: `142` + // Measured: `0` // Estimated: `67035` - // Minimum execution time: 2_993_000 picoseconds. - Weight::from_parts(3_088_000, 67035) + // Minimum execution time: 678_000 picoseconds. + Weight::from_parts(751_000, 67035) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -98,10 +100,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn exec_migration_completed() -> Weight { // Proof Size summary in bytes: - // Measured: `167` - // Estimated: `3632` - // Minimum execution time: 7_042_000 picoseconds. - Weight::from_parts(7_272_000, 3632) + // Measured: `0` + // Estimated: `3465` + // Minimum execution time: 3_791_000 picoseconds. + Weight::from_parts(3_930_000, 3465) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -111,10 +113,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_skipped_historic() -> Weight { // Proof Size summary in bytes: - // Measured: `363` - // Estimated: `3828` - // Minimum execution time: 16_522_000 picoseconds. - Weight::from_parts(17_082_000, 3828) + // Measured: `34` + // Estimated: `3731` + // Minimum execution time: 7_375_000 picoseconds. + Weight::from_parts(7_630_000, 3731) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -123,10 +125,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_advance() -> Weight { // Proof Size summary in bytes: - // Measured: `309` - // Estimated: `3774` - // Minimum execution time: 12_445_000 picoseconds. - Weight::from_parts(12_797_000, 3774) + // Measured: `0` + // Estimated: `3731` + // Minimum execution time: 6_771_000 picoseconds. + Weight::from_parts(6_894_000, 3731) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -135,10 +137,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_complete() -> Weight { // Proof Size summary in bytes: - // Measured: `309` - // Estimated: `3774` - // Minimum execution time: 14_057_000 picoseconds. - Weight::from_parts(14_254_000, 3774) + // Measured: `0` + // Estimated: `3731` + // Minimum execution time: 8_223_000 picoseconds. + Weight::from_parts(8_406_000, 3731) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -150,10 +152,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn exec_migration_fail() -> Weight { // Proof Size summary in bytes: - // Measured: `309` - // Estimated: `3774` - // Minimum execution time: 14_578_000 picoseconds. - Weight::from_parts(14_825_000, 3774) + // Measured: `0` + // Estimated: `3731` + // Minimum execution time: 8_907_000 picoseconds. + Weight::from_parts(9_168_000, 3731) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -161,8 +163,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 169_000 picoseconds. - Weight::from_parts(197_000, 0) + // Minimum execution time: 143_000 picoseconds. + Weight::from_parts(174_000, 0) } /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) @@ -170,8 +172,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_634_000 picoseconds. - Weight::from_parts(2_798_000, 0) + // Minimum execution time: 2_172_000 picoseconds. + Weight::from_parts(2_259_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) @@ -180,8 +182,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_069_000 picoseconds. - Weight::from_parts(3_293_000, 0) + // Minimum execution time: 2_600_000 picoseconds. + Weight::from_parts(2_728_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) @@ -190,10 +192,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) fn force_onboard_mbms() -> Weight { // Proof Size summary in bytes: - // Measured: `284` + // Measured: `0` // Estimated: `67035` - // Minimum execution time: 7_674_000 picoseconds. - Weight::from_parts(8_000_000, 67035) + // Minimum execution time: 2_949_000 picoseconds. + Weight::from_parts(3_106_000, 67035) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `MultiBlockMigrations::Historic` (r:256 w:256) @@ -201,12 +203,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 256]`. fn clear_historic(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1122 + n * (271 ±0)` + // Measured: `960 + n * (271 ±0)` // Estimated: `3834 + n * (2740 ±0)` - // Minimum execution time: 16_937_000 picoseconds. - Weight::from_parts(15_713_121, 3834) - // Standard Error: 2_580 - .saturating_add(Weight::from_parts(1_424_239, 0).saturating_mul(n.into())) + // Minimum execution time: 15_122_000 picoseconds. + Weight::from_parts(27_397_644, 3834) + // Standard Error: 6_050 + .saturating_add(Weight::from_parts(1_454_904, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -217,16 +219,15 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 2048]`. fn reset_pallet_migration(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1053 + n * (6 ±0)` - // Estimated: `612 + n * (7 ±0)` - // Minimum execution time: 2_182_000 picoseconds. - Weight::from_parts(2_281_000, 0) - .saturating_add(Weight::from_parts(0, 612)) - // Standard Error: 494 - .saturating_add(Weight::from_parts(630_585, 0).saturating_mul(n.into())) + // Measured: `1605 + n * (38 ±0)` + // Estimated: `686 + n * (39 ±0)` + // Minimum execution time: 1_128_000 picoseconds. + Weight::from_parts(1_180_000, 686) + // Standard Error: 2_597 + .saturating_add(Weight::from_parts(916_593, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 7).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 39).saturating_mul(n.into())) } } @@ -238,10 +239,10 @@ impl WeightInfo for () { /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) fn onboard_new_mbms() -> Weight { // Proof Size summary in bytes: - // Measured: `309` + // Measured: `0` // Estimated: `67035` - // Minimum execution time: 9_520_000 picoseconds. - Weight::from_parts(9_934_000, 67035) + // Minimum execution time: 4_422_000 picoseconds. + Weight::from_parts(4_560_000, 67035) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -249,10 +250,10 @@ impl WeightInfo for () { /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn progress_mbms_none() -> Weight { // Proof Size summary in bytes: - // Measured: `142` + // Measured: `0` // Estimated: `67035` - // Minimum execution time: 2_993_000 picoseconds. - Weight::from_parts(3_088_000, 67035) + // Minimum execution time: 678_000 picoseconds. + Weight::from_parts(751_000, 67035) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -261,10 +262,10 @@ impl WeightInfo for () { /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn exec_migration_completed() -> Weight { // Proof Size summary in bytes: - // Measured: `167` - // Estimated: `3632` - // Minimum execution time: 7_042_000 picoseconds. - Weight::from_parts(7_272_000, 3632) + // Measured: `0` + // Estimated: `3465` + // Minimum execution time: 3_791_000 picoseconds. + Weight::from_parts(3_930_000, 3465) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -274,10 +275,10 @@ impl WeightInfo for () { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_skipped_historic() -> Weight { // Proof Size summary in bytes: - // Measured: `363` - // Estimated: `3828` - // Minimum execution time: 16_522_000 picoseconds. - Weight::from_parts(17_082_000, 3828) + // Measured: `34` + // Estimated: `3731` + // Minimum execution time: 7_375_000 picoseconds. + Weight::from_parts(7_630_000, 3731) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -286,10 +287,10 @@ impl WeightInfo for () { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_advance() -> Weight { // Proof Size summary in bytes: - // Measured: `309` - // Estimated: `3774` - // Minimum execution time: 12_445_000 picoseconds. - Weight::from_parts(12_797_000, 3774) + // Measured: `0` + // Estimated: `3731` + // Minimum execution time: 6_771_000 picoseconds. + Weight::from_parts(6_894_000, 3731) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) @@ -298,10 +299,10 @@ impl WeightInfo for () { /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) fn exec_migration_complete() -> Weight { // Proof Size summary in bytes: - // Measured: `309` - // Estimated: `3774` - // Minimum execution time: 14_057_000 picoseconds. - Weight::from_parts(14_254_000, 3774) + // Measured: `0` + // Estimated: `3731` + // Minimum execution time: 8_223_000 picoseconds. + Weight::from_parts(8_406_000, 3731) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -313,10 +314,10 @@ impl WeightInfo for () { /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) fn exec_migration_fail() -> Weight { // Proof Size summary in bytes: - // Measured: `309` - // Estimated: `3774` - // Minimum execution time: 14_578_000 picoseconds. - Weight::from_parts(14_825_000, 3774) + // Measured: `0` + // Estimated: `3731` + // Minimum execution time: 8_907_000 picoseconds. + Weight::from_parts(9_168_000, 3731) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -324,8 +325,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 169_000 picoseconds. - Weight::from_parts(197_000, 0) + // Minimum execution time: 143_000 picoseconds. + Weight::from_parts(174_000, 0) } /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) @@ -333,8 +334,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_634_000 picoseconds. - Weight::from_parts(2_798_000, 0) + // Minimum execution time: 2_172_000 picoseconds. + Weight::from_parts(2_259_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) @@ -343,8 +344,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_069_000 picoseconds. - Weight::from_parts(3_293_000, 0) + // Minimum execution time: 2_600_000 picoseconds. + Weight::from_parts(2_728_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) @@ -353,10 +354,10 @@ impl WeightInfo for () { /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) fn force_onboard_mbms() -> Weight { // Proof Size summary in bytes: - // Measured: `284` + // Measured: `0` // Estimated: `67035` - // Minimum execution time: 7_674_000 picoseconds. - Weight::from_parts(8_000_000, 67035) + // Minimum execution time: 2_949_000 picoseconds. + Weight::from_parts(3_106_000, 67035) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `MultiBlockMigrations::Historic` (r:256 w:256) @@ -364,12 +365,12 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 256]`. fn clear_historic(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1122 + n * (271 ±0)` + // Measured: `960 + n * (271 ±0)` // Estimated: `3834 + n * (2740 ±0)` - // Minimum execution time: 16_937_000 picoseconds. - Weight::from_parts(15_713_121, 3834) - // Standard Error: 2_580 - .saturating_add(Weight::from_parts(1_424_239, 0).saturating_mul(n.into())) + // Minimum execution time: 15_122_000 picoseconds. + Weight::from_parts(27_397_644, 3834) + // Standard Error: 6_050 + .saturating_add(Weight::from_parts(1_454_904, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -380,15 +381,14 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 2048]`. fn reset_pallet_migration(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1053 + n * (6 ±0)` - // Estimated: `612 + n * (7 ±0)` - // Minimum execution time: 2_182_000 picoseconds. - Weight::from_parts(2_281_000, 0) - .saturating_add(Weight::from_parts(0, 612)) - // Standard Error: 494 - .saturating_add(Weight::from_parts(630_585, 0).saturating_mul(n.into())) + // Measured: `1605 + n * (38 ±0)` + // Estimated: `686 + n * (39 ±0)` + // Minimum execution time: 1_128_000 picoseconds. + Weight::from_parts(1_180_000, 686) + // Standard Error: 2_597 + .saturating_add(Weight::from_parts(916_593, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 7).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 39).saturating_mul(n.into())) } } From 3091457af0c4f5c9e80abed920f4435539729b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Mon, 27 Jan 2025 15:58:07 +0100 Subject: [PATCH 25/41] Import `frame` is necessary for benchmark template --- Cargo.lock | 1 + substrate/frame/migrations/Cargo.toml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 2a65a264684c2..d53ee76756b18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14028,6 +14028,7 @@ dependencies = [ "impl-trait-for-tuples", "log", "parity-scale-codec", + "polkadot-sdk-frame 0.1.0", "pretty_assertions", "scale-info", "sp-api 26.0.0", diff --git a/substrate/frame/migrations/Cargo.toml b/substrate/frame/migrations/Cargo.toml index c6ae9fa26928b..07a2376e540b3 100644 --- a/substrate/frame/migrations/Cargo.toml +++ b/substrate/frame/migrations/Cargo.toml @@ -18,6 +18,7 @@ impl-trait-for-tuples = { workspace = true } log = { workspace = true, default-features = true } scale-info = { features = ["derive"], workspace = true } +frame = { workspace = true, features = ["runtime"] } frame-benchmarking = { optional = true, workspace = true } frame-support = { workspace = true } frame-system = { workspace = true } @@ -39,6 +40,7 @@ default = ["std"] std = [ "codec/std", + "frame/std", "frame-benchmarking?/std", "frame-support/std", "frame-system/std", @@ -50,6 +52,7 @@ std = [ ] runtime-benchmarks = [ + "frame/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", @@ -57,6 +60,7 @@ runtime-benchmarks = [ ] try-runtime = [ + "frame/try-runtime", "frame-executive/try-runtime", "frame-support/try-runtime", "frame-system/try-runtime", From bb2dfc7a6fa8c8c205115b5b2206dfcf0a17c484 Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 15:01:49 +0000 Subject: [PATCH 26/41] Update from athei running command 'fmt' --- substrate/frame/migrations/Cargo.toml | 6 +++--- substrate/frame/migrations/src/migrations.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/substrate/frame/migrations/Cargo.toml b/substrate/frame/migrations/Cargo.toml index 07a2376e540b3..f05db314ae57e 100644 --- a/substrate/frame/migrations/Cargo.toml +++ b/substrate/frame/migrations/Cargo.toml @@ -40,10 +40,10 @@ default = ["std"] std = [ "codec/std", - "frame/std", "frame-benchmarking?/std", "frame-support/std", "frame-system/std", + "frame/std", "log/std", "scale-info/std", "sp-core/std", @@ -52,17 +52,17 @@ std = [ ] runtime-benchmarks = [ - "frame/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", + "frame/runtime-benchmarks", "sp-runtime/runtime-benchmarks", ] try-runtime = [ - "frame/try-runtime", "frame-executive/try-runtime", "frame-support/try-runtime", "frame-system/try-runtime", + "frame/try-runtime", "sp-runtime/try-runtime", ] diff --git a/substrate/frame/migrations/src/migrations.rs b/substrate/frame/migrations/src/migrations.rs index 2a16d6d2d485c..44491304466ad 100644 --- a/substrate/frame/migrations/src/migrations.rs +++ b/substrate/frame/migrations/src/migrations.rs @@ -39,8 +39,8 @@ use sp_runtime::SaturatedConversion; /// /// # Note /// -/// The costs to set the optional genesis state are not accounted for. Make sure that there is enough -/// space in the block when supplying those parameters. +/// The costs to set the optional genesis state are not accounted for. Make sure that there is +/// enough space in the block when supplying those parameters. pub struct ResetPallet(PhantomData<(T, P, B, G)>); impl ResetPallet From 551bb9bdc761d5fe0c9b9fb64052b121ced5e7a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Tue, 28 Jan 2025 12:53:35 +0100 Subject: [PATCH 27/41] Return correct amount of weight when erroring out early --- substrate/frame/migrations/src/migrations.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/substrate/frame/migrations/src/migrations.rs b/substrate/frame/migrations/src/migrations.rs index 44491304466ad..632976068e0f6 100644 --- a/substrate/frame/migrations/src/migrations.rs +++ b/substrate/frame/migrations/src/migrations.rs @@ -86,7 +86,9 @@ where .saturated_into(); if key_budget == 0 { - return Err(SteppedMigrationError::InsufficientWeight { required: weight_per_key }) + return Err(SteppedMigrationError::InsufficientWeight { + required: T::WeightInfo::reset_pallet_migration(1), + }) } let (keys_removed, cursor) = match clear_prefix(&Self::hashed_prefix(), Some(key_budget)) { From 9abc2321f1f284235b16e8757b89ed03b7b93020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Tue, 28 Jan 2025 13:04:42 +0100 Subject: [PATCH 28/41] Remove not needed GenesisBuild functionality --- substrate/frame/migrations/src/migrations.rs | 48 ++++++++++---------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/substrate/frame/migrations/src/migrations.rs b/substrate/frame/migrations/src/migrations.rs index 632976068e0f6..bfc56ff88e712 100644 --- a/substrate/frame/migrations/src/migrations.rs +++ b/substrate/frame/migrations/src/migrations.rs @@ -20,7 +20,7 @@ use codec::Encode; use core::marker::PhantomData; use frame_support::{ migrations::{SteppedMigration, SteppedMigrationError}, - traits::{BuildGenesisConfig, OnGenesis, PalletInfoAccess}, + traits::{OnGenesis, PalletInfoAccess}, weights::WeightMeter, }; use sp_core::{twox_128, Get}; @@ -34,16 +34,17 @@ use sp_runtime::SaturatedConversion; /// /// # Parameters /// +/// - T: The runtime. Used to access the weight definition. /// - P: The pallet to resetted as defined in construct runtime -/// - B, G: Optional. Can be used if the pallet needs to be initialized via [`BuildGenesisConfig`]. /// /// # Note /// -/// The costs to set the optional genesis state are not accounted for. Make sure that there is -/// enough space in the block when supplying those parameters. -pub struct ResetPallet(PhantomData<(T, P, B, G)>); +/// If your pallet does rely of some state in genesis you need to take care of that +/// separately. This migration only sets the storage version after wiping by running +/// [`OnGenesis::on_genesis`]. +pub struct ResetPallet(PhantomData<(T, P)>); -impl ResetPallet +impl ResetPallet where P: PalletInfoAccess, { @@ -58,14 +59,12 @@ where } } -impl SteppedMigration for ResetPallet +impl SteppedMigration for ResetPallet where T: Config, P: PalletInfoAccess + OnGenesis, - B: BuildGenesisConfig, - G: Get, { - type Cursor = (); + type Cursor = bool; type Identifier = [u8; 16]; fn id() -> Self::Identifier { @@ -73,9 +72,20 @@ where } fn step( - _cursor: Option, + cursor: Option, meter: &mut WeightMeter, ) -> Result, SteppedMigrationError> { + // we write the storage version in a seperate block + if cursor.unwrap_or(false) { + let required = T::DbWeight::get().writes(1); + if meter.remaining().any_lt(required) { + return Err(SteppedMigrationError::InsufficientWeight { required }) + } + P::on_genesis(); + meter.consume(required); + return Ok(None); + } + let base_weight = T::WeightInfo::reset_pallet_migration(0); let weight_per_key = T::WeightInfo::reset_pallet_migration(1) - base_weight; let key_budget = meter @@ -91,22 +101,14 @@ where }) } - let (keys_removed, cursor) = match clear_prefix(&Self::hashed_prefix(), Some(key_budget)) { - KillStorageResult::AllRemoved(value) => (value, None), - KillStorageResult::SomeRemaining(value) => (value, Some(())), + let (keys_removed, is_done) = match clear_prefix(&Self::hashed_prefix(), Some(key_budget)) { + KillStorageResult::AllRemoved(value) => (value, true), + KillStorageResult::SomeRemaining(value) => (value, false), }; meter.consume(T::WeightInfo::reset_pallet_migration(keys_removed)); - if cursor.is_none() { - // sets pallet version to current in-code version - P::on_genesis(); - - // write the genesis state to storage - G::get().build(); - } - - Ok(cursor) + Ok(Some(is_done)) } #[cfg(feature = "try-runtime")] From e13c470e7232a9413c9ed73f9c1d4e893b34abd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Tue, 28 Jan 2025 13:15:20 +0100 Subject: [PATCH 29/41] Add stricter check in try-runtime --- substrate/frame/migrations/src/migrations.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/substrate/frame/migrations/src/migrations.rs b/substrate/frame/migrations/src/migrations.rs index bfc56ff88e712..8215c284f7699 100644 --- a/substrate/frame/migrations/src/migrations.rs +++ b/substrate/frame/migrations/src/migrations.rs @@ -130,6 +130,11 @@ where Err("ResetPallet failed")?; } + if keys_now != 1 { + log::error!("ResetPallet<{}>: Should have a single key after reset", P::name()); + Err("ResetPallet failed")?; + } + Ok(()) } } From 52537b43bfe986a6a98fde5f0adc2f4d07c29a60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Tue, 28 Jan 2025 16:01:46 +0100 Subject: [PATCH 30/41] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bastian Köcher --- substrate/frame/migrations/src/migrations.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/substrate/frame/migrations/src/migrations.rs b/substrate/frame/migrations/src/migrations.rs index 8215c284f7699..24cdb8a07cf43 100644 --- a/substrate/frame/migrations/src/migrations.rs +++ b/substrate/frame/migrations/src/migrations.rs @@ -48,13 +48,9 @@ impl ResetPallet where P: PalletInfoAccess, { - fn hashed_prefix() -> [u8; 16] { - twox_128(P::name().as_bytes()) - } - #[cfg(feature = "try-runtime")] fn num_keys() -> u64 { - let prefix = Self::hashed_prefix().to_vec(); + let prefix = Self::name_hash().to_vec(); crate::storage::KeyPrefixIterator::new(prefix.clone(), prefix, |_| Ok(())).count() as _ } } @@ -92,7 +88,7 @@ where .remaining() .saturating_sub(base_weight) .checked_div_per_component(&weight_per_key) - .expect("costs not zero") + .unwrap_or(Zero::zero()) .saturated_into(); if key_budget == 0 { @@ -126,7 +122,7 @@ where log::info!("ResetPallet<{}>: Keys remaining after migration: {keys_now}", P::name()); if keys_before <= keys_now { - log::error!("ResetPallet<{}>: Removed suspiciously low number of keys.", P::name()); + log::error!("ResetPallet<{}>: Did not remove any keys.", P::name()); Err("ResetPallet failed")?; } From e507e92570fad338b1404885d20357463fa760b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Tue, 28 Jan 2025 16:06:55 +0100 Subject: [PATCH 31/41] Fixes after applying suggestions --- substrate/frame/migrations/src/migrations.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/substrate/frame/migrations/src/migrations.rs b/substrate/frame/migrations/src/migrations.rs index 24cdb8a07cf43..3aa450c4ac238 100644 --- a/substrate/frame/migrations/src/migrations.rs +++ b/substrate/frame/migrations/src/migrations.rs @@ -50,7 +50,7 @@ where { #[cfg(feature = "try-runtime")] fn num_keys() -> u64 { - let prefix = Self::name_hash().to_vec(); + let prefix = P::name_hash().to_vec(); crate::storage::KeyPrefixIterator::new(prefix.clone(), prefix, |_| Ok(())).count() as _ } } @@ -88,7 +88,7 @@ where .remaining() .saturating_sub(base_weight) .checked_div_per_component(&weight_per_key) - .unwrap_or(Zero::zero()) + .unwrap_or_default() .saturated_into(); if key_budget == 0 { @@ -97,7 +97,7 @@ where }) } - let (keys_removed, is_done) = match clear_prefix(&Self::hashed_prefix(), Some(key_budget)) { + let (keys_removed, is_done) = match clear_prefix(&P::name_hash(), Some(key_budget)) { KillStorageResult::AllRemoved(value) => (value, true), KillStorageResult::SomeRemaining(value) => (value, false), }; From 9017422de1c91f9c594cb52746ddeccde3659b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Mon, 3 Feb 2025 15:14:28 +0100 Subject: [PATCH 32/41] Use try_consume --- substrate/frame/migrations/src/migrations.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/substrate/frame/migrations/src/migrations.rs b/substrate/frame/migrations/src/migrations.rs index 3aa450c4ac238..35a15957747c0 100644 --- a/substrate/frame/migrations/src/migrations.rs +++ b/substrate/frame/migrations/src/migrations.rs @@ -74,11 +74,10 @@ where // we write the storage version in a seperate block if cursor.unwrap_or(false) { let required = T::DbWeight::get().writes(1); - if meter.remaining().any_lt(required) { - return Err(SteppedMigrationError::InsufficientWeight { required }) - } + meter + .try_consume(required) + .map_err(|_| SteppedMigrationError::InsufficientWeight { required })?; P::on_genesis(); - meter.consume(required); return Ok(None); } From 2ebf592d88eba7ae4b061d2ceba3f33f9426a8f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Mon, 3 Feb 2025 15:26:55 +0100 Subject: [PATCH 33/41] Update substrate/frame/migrations/src/migrations.rs Co-authored-by: Oliver Tale-Yazdi --- substrate/frame/migrations/src/migrations.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/migrations/src/migrations.rs b/substrate/frame/migrations/src/migrations.rs index 35a15957747c0..a4469d591f5ed 100644 --- a/substrate/frame/migrations/src/migrations.rs +++ b/substrate/frame/migrations/src/migrations.rs @@ -82,7 +82,7 @@ where } let base_weight = T::WeightInfo::reset_pallet_migration(0); - let weight_per_key = T::WeightInfo::reset_pallet_migration(1) - base_weight; + let weight_per_key = T::WeightInfo::reset_pallet_migration(1).saturating_sub(base_weight); let key_budget = meter .remaining() .saturating_sub(base_weight) From bf284d4b9e678d188fd525e871782ad81b70c480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Mon, 3 Feb 2025 17:05:53 +0100 Subject: [PATCH 34/41] Fix benchmarking assertions --- substrate/frame/migrations/src/benchmarking.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/substrate/frame/migrations/src/benchmarking.rs b/substrate/frame/migrations/src/benchmarking.rs index 88bde8c54916a..2c73e50b5725e 100644 --- a/substrate/frame/migrations/src/benchmarking.rs +++ b/substrate/frame/migrations/src/benchmarking.rs @@ -227,9 +227,12 @@ mod benches { result = storage::clear_prefix(&prefix, None); } + // It will always reports no keys removed because they are still in the overlay. + // However, the benchmarking PoV results are correctly dependent on the amount of + // keys removed. match result { - KillStorageResult::AllRemoved(i) if i == n => (), - _ => Err("Unexpected number of keys were removed")?, + KillStorageResult::AllRemoved(_) => (), + _ => Err("Not all keys were removed")?, } Ok(()) From a0123d2f29616a076dd22b46023d3854868e2db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Mon, 3 Feb 2025 22:40:25 +0100 Subject: [PATCH 35/41] Don't use OnGenesis --- substrate/frame/migrations/src/migrations.rs | 9 ++++----- substrate/frame/support/src/traits.rs | 2 +- .../frame/support/src/traits/metadata.rs | 20 ++++++++++++++++++- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/substrate/frame/migrations/src/migrations.rs b/substrate/frame/migrations/src/migrations.rs index a4469d591f5ed..5d908cf5cee88 100644 --- a/substrate/frame/migrations/src/migrations.rs +++ b/substrate/frame/migrations/src/migrations.rs @@ -20,7 +20,7 @@ use codec::Encode; use core::marker::PhantomData; use frame_support::{ migrations::{SteppedMigration, SteppedMigrationError}, - traits::{OnGenesis, PalletInfoAccess}, + traits::{GetStorageVersion, PalletInfoAccess, WriteStorageVersion}, weights::WeightMeter, }; use sp_core::{twox_128, Get}; @@ -40,8 +40,7 @@ use sp_runtime::SaturatedConversion; /// # Note /// /// If your pallet does rely of some state in genesis you need to take care of that -/// separately. This migration only sets the storage version after wiping by running -/// [`OnGenesis::on_genesis`]. +/// separately. This migration only sets the storage version after wiping. pub struct ResetPallet(PhantomData<(T, P)>); impl ResetPallet @@ -58,7 +57,7 @@ where impl SteppedMigration for ResetPallet where T: Config, - P: PalletInfoAccess + OnGenesis, + P: PalletInfoAccess + GetStorageVersion, { type Cursor = bool; type Identifier = [u8; 16]; @@ -77,7 +76,7 @@ where meter .try_consume(required) .map_err(|_| SteppedMigrationError::InsufficientWeight { required })?; - P::on_genesis(); + P::in_code_storage_version().write_storage_version::

(); return Ok(None); } diff --git a/substrate/frame/support/src/traits.rs b/substrate/frame/support/src/traits.rs index 4a83c809a6a5e..bd0ecbf8926eb 100644 --- a/substrate/frame/support/src/traits.rs +++ b/substrate/frame/support/src/traits.rs @@ -79,7 +79,7 @@ mod metadata; pub use metadata::{ CallMetadata, CrateVersion, GetCallIndex, GetCallMetadata, GetCallName, GetStorageVersion, NoStorageVersionSet, PalletInfo, PalletInfoAccess, PalletInfoData, PalletsInfoAccess, - StorageVersion, STORAGE_VERSION_STORAGE_KEY_POSTFIX, + StorageVersion, WriteStorageVersion, STORAGE_VERSION_STORAGE_KEY_POSTFIX, }; mod hooks; diff --git a/substrate/frame/support/src/traits/metadata.rs b/substrate/frame/support/src/traits/metadata.rs index 1e46470a3911f..6b7863e65ad04 100644 --- a/substrate/frame/support/src/traits/metadata.rs +++ b/substrate/frame/support/src/traits/metadata.rs @@ -301,7 +301,7 @@ pub trait GetStorageVersion { /// of zero is to prevent developers from forgetting to set /// [`storage_version`](crate::pallet_macros::storage_version) when it is required, like in the /// case that they wish to compare the in-code storage version to the on-chain storage version. - type InCodeStorageVersion; + type InCodeStorageVersion: WriteStorageVersion; #[deprecated( note = "This method has been renamed to `in_code_storage_version` and will be removed after March 2024." @@ -323,6 +323,24 @@ pub trait GetStorageVersion { fn on_chain_storage_version() -> StorageVersion; } +/// Type that can write the storage version it represents to storage. +pub trait WriteStorageVersion { + /// Write the storage version represented by this type to storage. + fn write_storage_version(&self); +} + +impl WriteStorageVersion for StorageVersion { + fn write_storage_version(&self) { + self.put::

(); + } +} + +impl WriteStorageVersion for NoStorageVersionSet { + fn write_storage_version(&self) { + StorageVersion::new(0).put::

(); + } +} + #[cfg(test)] mod tests { use super::*; From c8febcfa861272d2ca97dbe55bd5d62e06b71b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Tue, 4 Feb 2025 14:56:07 +0100 Subject: [PATCH 36/41] Add checks back to benchmarks --- substrate/frame/migrations/src/benchmarking.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/substrate/frame/migrations/src/benchmarking.rs b/substrate/frame/migrations/src/benchmarking.rs index 2c73e50b5725e..e41be4749b00a 100644 --- a/substrate/frame/migrations/src/benchmarking.rs +++ b/substrate/frame/migrations/src/benchmarking.rs @@ -20,7 +20,7 @@ use super::*; use core::array; -use frame_benchmarking::{v2::*, BenchmarkError}; +use frame_benchmarking::{v2::*, BenchmarkError, benchmarking}; use frame_system::{Pallet as System, RawOrigin}; use sp_core::{twox_128, Get}; use sp_io::{storage, KillStorageResult}; @@ -220,8 +220,11 @@ mod benches { storage::set(&key, &[0u8; 32]); } - let result; + // test externalities don't support committing + #[cfg(not(test))] + benchmarking::commit_db(); + let result; #[block] { result = storage::clear_prefix(&prefix, None); @@ -231,7 +234,11 @@ mod benches { // However, the benchmarking PoV results are correctly dependent on the amount of // keys removed. match result { - KillStorageResult::AllRemoved(_) => (), + KillStorageResult::AllRemoved(i) => { + // `i` ionly includes commited keys + #[cfg(not(test))] + ensure!(i == n, "Not all keys are removed"); + }, _ => Err("Not all keys were removed")?, } From 1efd67ddf62c2e2074ebd227b1c6e55c8ec09f13 Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 14:06:25 +0000 Subject: [PATCH 37/41] Update from athei running command 'fmt' --- substrate/frame/migrations/src/benchmarking.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/migrations/src/benchmarking.rs b/substrate/frame/migrations/src/benchmarking.rs index e41be4749b00a..32aec58bafa97 100644 --- a/substrate/frame/migrations/src/benchmarking.rs +++ b/substrate/frame/migrations/src/benchmarking.rs @@ -20,7 +20,7 @@ use super::*; use core::array; -use frame_benchmarking::{v2::*, BenchmarkError, benchmarking}; +use frame_benchmarking::{benchmarking, v2::*, BenchmarkError}; use frame_system::{Pallet as System, RawOrigin}; use sp_core::{twox_128, Get}; use sp_io::{storage, KillStorageResult}; From a5c6d27300f9157ee244f7d9dd672e841880260f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Tue, 4 Feb 2025 15:53:57 +0100 Subject: [PATCH 38/41] Remove commit because the benchmarking infra does this --- substrate/frame/migrations/src/benchmarking.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/substrate/frame/migrations/src/benchmarking.rs b/substrate/frame/migrations/src/benchmarking.rs index 32aec58bafa97..c41e696928936 100644 --- a/substrate/frame/migrations/src/benchmarking.rs +++ b/substrate/frame/migrations/src/benchmarking.rs @@ -20,7 +20,7 @@ use super::*; use core::array; -use frame_benchmarking::{benchmarking, v2::*, BenchmarkError}; +use frame_benchmarking::{v2::*, BenchmarkError}; use frame_system::{Pallet as System, RawOrigin}; use sp_core::{twox_128, Get}; use sp_io::{storage, KillStorageResult}; @@ -220,10 +220,6 @@ mod benches { storage::set(&key, &[0u8; 32]); } - // test externalities don't support committing - #[cfg(not(test))] - benchmarking::commit_db(); - let result; #[block] { @@ -235,7 +231,7 @@ mod benches { // keys removed. match result { KillStorageResult::AllRemoved(i) => { - // `i` ionly includes commited keys + // during the test the storage is not comitted and `i` will always be 0 #[cfg(not(test))] ensure!(i == n, "Not all keys are removed"); }, From 9d0008506fdc13def68cd224dada136dd4c285c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Tue, 4 Feb 2025 18:49:09 +0100 Subject: [PATCH 39/41] Fix warning --- substrate/frame/migrations/src/benchmarking.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/substrate/frame/migrations/src/benchmarking.rs b/substrate/frame/migrations/src/benchmarking.rs index c41e696928936..f06870fa9502c 100644 --- a/substrate/frame/migrations/src/benchmarking.rs +++ b/substrate/frame/migrations/src/benchmarking.rs @@ -230,10 +230,10 @@ mod benches { // However, the benchmarking PoV results are correctly dependent on the amount of // keys removed. match result { - KillStorageResult::AllRemoved(i) => { + KillStorageResult::AllRemoved(_i) => { // during the test the storage is not comitted and `i` will always be 0 #[cfg(not(test))] - ensure!(i == n, "Not all keys are removed"); + ensure!(_i == n, "Not all keys are removed"); }, _ => Err("Not all keys were removed")?, } From 3726ddfaf3dee578dc8eac81c8a0e471de2ad9f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Tue, 4 Feb 2025 20:04:02 +0100 Subject: [PATCH 40/41] Don't add new trait --- substrate/frame/migrations/src/migrations.rs | 11 +++++----- substrate/frame/support/src/traits.rs | 2 +- .../frame/support/src/traits/metadata.rs | 20 +------------------ 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/substrate/frame/migrations/src/migrations.rs b/substrate/frame/migrations/src/migrations.rs index 5d908cf5cee88..796ff0f956599 100644 --- a/substrate/frame/migrations/src/migrations.rs +++ b/substrate/frame/migrations/src/migrations.rs @@ -19,8 +19,8 @@ use crate::{weights::WeightInfo, Config}; use codec::Encode; use core::marker::PhantomData; use frame_support::{ - migrations::{SteppedMigration, SteppedMigrationError}, - traits::{GetStorageVersion, PalletInfoAccess, WriteStorageVersion}, + migrations::{SteppedMigration, SteppedMigrationError, StoreInCodeStorageVersion}, + traits::{GetStorageVersion, PalletInfoAccess}, weights::WeightMeter, }; use sp_core::{twox_128, Get}; @@ -54,10 +54,11 @@ where } } -impl SteppedMigration for ResetPallet +impl SteppedMigration for ResetPallet where T: Config, - P: PalletInfoAccess + GetStorageVersion, + P: PalletInfoAccess + GetStorageVersion, + V: StoreInCodeStorageVersion

, { type Cursor = bool; type Identifier = [u8; 16]; @@ -76,7 +77,7 @@ where meter .try_consume(required) .map_err(|_| SteppedMigrationError::InsufficientWeight { required })?; - P::in_code_storage_version().write_storage_version::

(); + V::store_in_code_storage_version(); return Ok(None); } diff --git a/substrate/frame/support/src/traits.rs b/substrate/frame/support/src/traits.rs index bd0ecbf8926eb..4a83c809a6a5e 100644 --- a/substrate/frame/support/src/traits.rs +++ b/substrate/frame/support/src/traits.rs @@ -79,7 +79,7 @@ mod metadata; pub use metadata::{ CallMetadata, CrateVersion, GetCallIndex, GetCallMetadata, GetCallName, GetStorageVersion, NoStorageVersionSet, PalletInfo, PalletInfoAccess, PalletInfoData, PalletsInfoAccess, - StorageVersion, WriteStorageVersion, STORAGE_VERSION_STORAGE_KEY_POSTFIX, + StorageVersion, STORAGE_VERSION_STORAGE_KEY_POSTFIX, }; mod hooks; diff --git a/substrate/frame/support/src/traits/metadata.rs b/substrate/frame/support/src/traits/metadata.rs index 6b7863e65ad04..1e46470a3911f 100644 --- a/substrate/frame/support/src/traits/metadata.rs +++ b/substrate/frame/support/src/traits/metadata.rs @@ -301,7 +301,7 @@ pub trait GetStorageVersion { /// of zero is to prevent developers from forgetting to set /// [`storage_version`](crate::pallet_macros::storage_version) when it is required, like in the /// case that they wish to compare the in-code storage version to the on-chain storage version. - type InCodeStorageVersion: WriteStorageVersion; + type InCodeStorageVersion; #[deprecated( note = "This method has been renamed to `in_code_storage_version` and will be removed after March 2024." @@ -323,24 +323,6 @@ pub trait GetStorageVersion { fn on_chain_storage_version() -> StorageVersion; } -/// Type that can write the storage version it represents to storage. -pub trait WriteStorageVersion { - /// Write the storage version represented by this type to storage. - fn write_storage_version(&self); -} - -impl WriteStorageVersion for StorageVersion { - fn write_storage_version(&self) { - self.put::

(); - } -} - -impl WriteStorageVersion for NoStorageVersionSet { - fn write_storage_version(&self) { - StorageVersion::new(0).put::

(); - } -} - #[cfg(test)] mod tests { use super::*; From ff02ca05a5c966a84a6033b2ccd2f1ecc7b37524 Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 20:25:10 +0000 Subject: [PATCH 41/41] Update from athei running command 'bench --runtime dev --pallet pallet_revive --clean' --- substrate/frame/revive/src/weights.rs | 1119 ++++++++++++------------- 1 file changed, 533 insertions(+), 586 deletions(-) diff --git a/substrate/frame/revive/src/weights.rs b/substrate/frame/revive/src/weights.rs index 6c8344ff035f6..42b8a9e5e722f 100644 --- a/substrate/frame/revive/src/weights.rs +++ b/substrate/frame/revive/src/weights.rs @@ -18,9 +18,9 @@ //! Autogenerated weights for `pallet_revive` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-01-29, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-02-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `eacb3695a76e`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `11670a4f427b`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: @@ -48,6 +48,7 @@ #![allow(unused_parens)] #![allow(unused_imports)] #![allow(missing_docs)] +#[allow(dead_code)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use core::marker::PhantomData; @@ -131,8 +132,6 @@ pub trait WeightInfo { fn seal_ecdsa_recover() -> Weight; fn seal_ecdsa_to_eth_address() -> Weight; fn seal_set_code_hash() -> Weight; - fn lock_delegate_dependency() -> Weight; - fn unlock_delegate_dependency() -> Weight; fn instr(r: u32, ) -> Weight; } @@ -145,8 +144,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 690_000 picoseconds. - Weight::from_parts(743_000, 1485) + // Minimum execution time: 695_000 picoseconds. + Weight::from_parts(750_000, 1485) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -156,10 +155,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `230 + k * (69 ±0)` // Estimated: `222 + k * (70 ±0)` - // Minimum execution time: 10_913_000 picoseconds. - Weight::from_parts(11_048_000, 222) - // Standard Error: 972 - .saturating_add(Weight::from_parts(1_172_318, 0).saturating_mul(k.into())) + // Minimum execution time: 10_509_000 picoseconds. + Weight::from_parts(10_896_000, 222) + // Standard Error: 2_549 + .saturating_add(Weight::from_parts(1_264_033, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -169,7 +168,7 @@ impl WeightInfo for SubstrateWeight { /// Storage: `Revive::AddressSuffix` (r:2 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:1 w:0) @@ -179,14 +178,12 @@ impl WeightInfo for SubstrateWeight { /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. - fn call_with_code_per_byte(c: u32, ) -> Weight { + fn call_with_code_per_byte(_c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1195` - // Estimated: `7135` - // Minimum execution time: 83_080_000 picoseconds. - Weight::from_parts(89_270_264, 7135) - // Standard Error: 0 - .saturating_add(Weight::from_parts(3, 0).saturating_mul(c.into())) + // Measured: `1194` + // Estimated: `7134` + // Minimum execution time: 84_008_000 picoseconds. + Weight::from_parts(91_138_296, 7134) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -197,7 +194,7 @@ impl WeightInfo for SubstrateWeight { /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Timestamp::Now` (r:1 w:0) /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) @@ -210,10 +207,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `93` // Estimated: `6033` - // Minimum execution time: 171_761_000 picoseconds. - Weight::from_parts(158_031_807, 6033) - // Standard Error: 11 - .saturating_add(Weight::from_parts(4_536, 0).saturating_mul(i.into())) + // Minimum execution time: 172_907_000 picoseconds. + Weight::from_parts(153_592_465, 6033) + // Standard Error: 12 + .saturating_add(Weight::from_parts(4_544, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -224,7 +221,7 @@ impl WeightInfo for SubstrateWeight { /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Timestamp::Now` (r:1 w:0) /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) @@ -236,17 +233,17 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `987` // Estimated: `4452` - // Minimum execution time: 143_210_000 picoseconds. - Weight::from_parts(121_908_111, 4452) - // Standard Error: 15 - .saturating_add(Weight::from_parts(4_467, 0).saturating_mul(i.into())) + // Minimum execution time: 143_169_000 picoseconds. + Weight::from_parts(120_653_436, 4452) + // Standard Error: 16 + .saturating_add(Weight::from_parts(4_444, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } /// Storage: `Revive::AddressSuffix` (r:2 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:1 w:0) @@ -257,10 +254,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) fn call() -> Weight { // Proof Size summary in bytes: - // Measured: `1195` - // Estimated: `7135` - // Minimum execution time: 136_689_000 picoseconds. - Weight::from_parts(145_358_000, 7135) + // Measured: `1194` + // Estimated: `7134` + // Minimum execution time: 138_392_000 picoseconds. + Weight::from_parts(143_329_000, 7134) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -271,14 +268,12 @@ impl WeightInfo for SubstrateWeight { /// Storage: `Revive::PristineCode` (r:0 w:1) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. - fn upload_code(c: u32, ) -> Weight { + fn upload_code(_c: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 43_351_000 picoseconds. - Weight::from_parts(44_896_319, 3465) - // Standard Error: 0 - .saturating_add(Weight::from_parts(1, 0).saturating_mul(c.into())) + // Minimum execution time: 43_420_000 picoseconds. + Weight::from_parts(45_143_767, 3465) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -292,21 +287,21 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `181` // Estimated: `3646` - // Minimum execution time: 36_034_000 picoseconds. - Weight::from_parts(36_595_000, 3646) + // Minimum execution time: 35_828_000 picoseconds. + Weight::from_parts(36_853_000, 3646) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:2 w:2) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) fn set_code() -> Weight { // Proof Size summary in bytes: - // Measured: `425` - // Estimated: `6365` - // Minimum execution time: 19_484_000 picoseconds. - Weight::from_parts(20_104_000, 6365) + // Measured: `424` + // Estimated: `6364` + // Minimum execution time: 19_678_000 picoseconds. + Weight::from_parts(21_266_000, 6364) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -318,8 +313,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 37_066_000 picoseconds. - Weight::from_parts(37_646_000, 3465) + // Minimum execution time: 37_024_000 picoseconds. + Weight::from_parts(37_440_000, 3465) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -331,8 +326,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `56` // Estimated: `3521` - // Minimum execution time: 31_604_000 picoseconds. - Weight::from_parts(32_557_000, 3521) + // Minimum execution time: 31_228_000 picoseconds. + Weight::from_parts(32_183_000, 3521) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -344,8 +339,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 6_070_000 picoseconds. - Weight::from_parts(6_246_000, 3465) + // Minimum execution time: 6_241_000 picoseconds. + Weight::from_parts(6_467_000, 3465) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// The range of component `r` is `[0, 1600]`. @@ -353,33 +348,33 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_471_000 picoseconds. - Weight::from_parts(7_724_355, 0) - // Standard Error: 245 - .saturating_add(Weight::from_parts(165_331, 0).saturating_mul(r.into())) + // Minimum execution time: 6_397_000 picoseconds. + Weight::from_parts(7_159_300, 0) + // Standard Error: 173 + .saturating_add(Weight::from_parts(167_265, 0).saturating_mul(r.into())) } fn seal_caller() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 239_000 picoseconds. - Weight::from_parts(278_000, 0) + // Minimum execution time: 267_000 picoseconds. + Weight::from_parts(296_000, 0) } fn seal_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 234_000 picoseconds. - Weight::from_parts(264_000, 0) + // Minimum execution time: 227_000 picoseconds. + Weight::from_parts(252_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) fn seal_is_contract() -> Weight { // Proof Size summary in bytes: // Measured: `202` // Estimated: `3667` - // Minimum execution time: 6_508_000 picoseconds. - Weight::from_parts(6_715_000, 3667) + // Minimum execution time: 6_591_000 picoseconds. + Weight::from_parts(6_770_000, 3667) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) @@ -388,80 +383,80 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3609` - // Minimum execution time: 6_190_000 picoseconds. - Weight::from_parts(6_413_000, 3609) + // Minimum execution time: 6_182_000 picoseconds. + Weight::from_parts(6_372_000, 3609) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) fn seal_code_hash() -> Weight { // Proof Size summary in bytes: - // Measured: `299` - // Estimated: `3764` - // Minimum execution time: 7_547_000 picoseconds. - Weight::from_parts(7_742_000, 3764) + // Measured: `298` + // Estimated: `3763` + // Minimum execution time: 7_327_000 picoseconds. + Weight::from_parts(7_612_000, 3763) .saturating_add(T::DbWeight::get().reads(1_u64)) } fn seal_own_code_hash() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 251_000 picoseconds. - Weight::from_parts(274_000, 0) + // Minimum execution time: 232_000 picoseconds. + Weight::from_parts(287_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) fn seal_code_size() -> Weight { // Proof Size summary in bytes: - // Measured: `369` - // Estimated: `3834` - // Minimum execution time: 10_825_000 picoseconds. - Weight::from_parts(11_185_000, 3834) + // Measured: `368` + // Estimated: `3833` + // Minimum execution time: 10_918_000 picoseconds. + Weight::from_parts(11_323_000, 3833) .saturating_add(T::DbWeight::get().reads(2_u64)) } fn seal_caller_is_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 325_000 picoseconds. - Weight::from_parts(352_000, 0) + // Minimum execution time: 310_000 picoseconds. + Weight::from_parts(340_000, 0) } fn seal_caller_is_root() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 245_000 picoseconds. - Weight::from_parts(282_000, 0) + // Minimum execution time: 257_000 picoseconds. + Weight::from_parts(292_000, 0) } fn seal_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 251_000 picoseconds. - Weight::from_parts(274_000, 0) + // Minimum execution time: 240_000 picoseconds. + Weight::from_parts(249_000, 0) } fn seal_weight_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` // Minimum execution time: 599_000 picoseconds. - Weight::from_parts(675_000, 0) + Weight::from_parts(645_000, 0) } fn seal_ref_time_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 245_000 picoseconds. - Weight::from_parts(263_000, 0) + // Minimum execution time: 208_000 picoseconds. + Weight::from_parts(244_000, 0) } fn seal_balance() -> Weight { // Proof Size summary in bytes: // Measured: `102` // Estimated: `0` - // Minimum execution time: 4_613_000 picoseconds. - Weight::from_parts(4_768_000, 0) + // Minimum execution time: 4_534_000 picoseconds. + Weight::from_parts(4_689_000, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) @@ -471,8 +466,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `160` // Estimated: `3625` - // Minimum execution time: 8_513_000 picoseconds. - Weight::from_parts(8_765_000, 3625) + // Minimum execution time: 8_640_000 picoseconds. + Weight::from_parts(8_971_000, 3625) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `Revive::ImmutableDataOf` (r:1 w:0) @@ -482,10 +477,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `134 + n * (1 ±0)` // Estimated: `3599 + n * (1 ±0)` - // Minimum execution time: 4_870_000 picoseconds. - Weight::from_parts(6_309_018, 3599) + // Minimum execution time: 4_875_000 picoseconds. + Weight::from_parts(6_212_863, 3599) // Standard Error: 7 - .saturating_add(Weight::from_parts(645, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(671, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -496,67 +491,67 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_754_000 picoseconds. - Weight::from_parts(1_939_099, 0) - // Standard Error: 1 - .saturating_add(Weight::from_parts(581, 0).saturating_mul(n.into())) + // Minimum execution time: 1_678_000 picoseconds. + Weight::from_parts(1_883_150, 0) + // Standard Error: 2 + .saturating_add(Weight::from_parts(579, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().writes(1_u64)) } fn seal_value_transferred() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 243_000 picoseconds. - Weight::from_parts(292_000, 0) + // Minimum execution time: 238_000 picoseconds. + Weight::from_parts(273_000, 0) } fn seal_minimum_balance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 254_000 picoseconds. - Weight::from_parts(284_000, 0) + // Minimum execution time: 244_000 picoseconds. + Weight::from_parts(260_000, 0) } fn seal_return_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 242_000 picoseconds. - Weight::from_parts(257_000, 0) + // Minimum execution time: 249_000 picoseconds. + Weight::from_parts(265_000, 0) } fn seal_call_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 241_000 picoseconds. - Weight::from_parts(261_000, 0) + // Minimum execution time: 243_000 picoseconds. + Weight::from_parts(269_000, 0) } fn seal_gas_limit() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 265_000 picoseconds. - Weight::from_parts(290_000, 0) + // Minimum execution time: 228_000 picoseconds. + Weight::from_parts(268_000, 0) } fn seal_gas_price() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 225_000 picoseconds. - Weight::from_parts(249_000, 0) + // Minimum execution time: 222_000 picoseconds. + Weight::from_parts(251_000, 0) } fn seal_base_fee() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 246_000 picoseconds. - Weight::from_parts(266_000, 0) + // Minimum execution time: 226_000 picoseconds. + Weight::from_parts(250_000, 0) } fn seal_block_number() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 247_000 picoseconds. - Weight::from_parts(267_000, 0) + // Minimum execution time: 228_000 picoseconds. + Weight::from_parts(270_000, 0) } /// Storage: `Session::Validators` (r:1 w:0) /// Proof: `Session::Validators` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -564,8 +559,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 13_503_000 picoseconds. - Weight::from_parts(13_907_000, 1485) + // Minimum execution time: 13_597_000 picoseconds. + Weight::from_parts(13_770_000, 1485) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `System::BlockHash` (r:1 w:0) @@ -574,123 +569,121 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 2_251_000 picoseconds. - Weight::from_parts(2_370_000, 3465) + // Minimum execution time: 2_199_000 picoseconds. + Weight::from_parts(2_402_000, 3465) .saturating_add(T::DbWeight::get().reads(1_u64)) } fn seal_now() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 237_000 picoseconds. - Weight::from_parts(264_000, 0) + // Minimum execution time: 230_000 picoseconds. + Weight::from_parts(256_000, 0) } fn seal_weight_to_fee() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_238_000 picoseconds. - Weight::from_parts(1_311_000, 0) + // Minimum execution time: 1_214_000 picoseconds. + Weight::from_parts(1_283_000, 0) } /// The range of component `n` is `[0, 262140]`. fn seal_copy_to_contract(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 380_000 picoseconds. - Weight::from_parts(524_789, 0) + // Minimum execution time: 376_000 picoseconds. + Weight::from_parts(569_136, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(237, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(236, 0).saturating_mul(n.into())) } fn seal_call_data_load() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 248_000 picoseconds. - Weight::from_parts(267_000, 0) + // Minimum execution time: 243_000 picoseconds. + Weight::from_parts(260_000, 0) } /// The range of component `n` is `[0, 262144]`. fn seal_call_data_copy(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 230_000 picoseconds. - Weight::from_parts(207_234, 0) + // Minimum execution time: 231_000 picoseconds. + Weight::from_parts(379_088, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(150, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(148, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262140]`. fn seal_return(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 267_000 picoseconds. - Weight::from_parts(357_669, 0) + // Minimum execution time: 227_000 picoseconds. + Weight::from_parts(400_572, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(238, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(237, 0).saturating_mul(n.into())) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::DeletionQueueCounter` (r:1 w:1) /// Proof: `Revive::DeletionQueueCounter` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) - /// Storage: `Revive::CodeInfoOf` (r:33 w:33) + /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::DeletionQueue` (r:0 w:1) /// Proof: `Revive::DeletionQueue` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `Measured`) /// Storage: `Revive::ImmutableDataOf` (r:0 w:1) /// Proof: `Revive::ImmutableDataOf` (`max_values`: None, `max_size`: Some(4118), added: 6593, mode: `Measured`) - /// The range of component `n` is `[0, 32]`. fn seal_terminate() -> Weight { // Proof Size summary in bytes: - // Measured: `218 + n * (88 ±0)` - // Estimated: `3684 + n * (2563 ±0)` - // Minimum execution time: 14_314_000 picoseconds. - Weight::from_parts(15_353_516, 3684) - // Standard Error: 10_720 + // Measured: `215` + // Estimated: `3680` + // Minimum execution time: 14_216_000 picoseconds. + Weight::from_parts(14_533_000, 3680) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } /// The range of component `t` is `[0, 4]`. - /// The range of component `n` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. fn seal_deposit_event(t: u32, n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_968_000 picoseconds. - Weight::from_parts(3_902_423, 0) - // Standard Error: 2_379 - .saturating_add(Weight::from_parts(199_019, 0).saturating_mul(t.into())) - // Standard Error: 24 - .saturating_add(Weight::from_parts(945, 0).saturating_mul(n.into())) + // Minimum execution time: 3_877_000 picoseconds. + Weight::from_parts(3_856_832, 0) + // Standard Error: 2_622 + .saturating_add(Weight::from_parts(201_206, 0).saturating_mul(t.into())) + // Standard Error: 28 + .saturating_add(Weight::from_parts(1_128, 0).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) fn get_storage_empty() -> Weight { // Proof Size summary in bytes: - // Measured: `584` - // Estimated: `584` - // Minimum execution time: 5_980_000 picoseconds. - Weight::from_parts(6_250_000, 584) + // Measured: `552` + // Estimated: `552` + // Minimum execution time: 5_806_000 picoseconds. + Weight::from_parts(6_037_000, 552) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) fn get_storage_full() -> Weight { // Proof Size summary in bytes: - // Measured: `10594` - // Estimated: `10594` - // Minimum execution time: 39_415_000 picoseconds. - Weight::from_parts(40_109_000, 10594) + // Measured: `10562` + // Estimated: `10562` + // Minimum execution time: 39_517_000 picoseconds. + Weight::from_parts(40_698_000, 10562) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_storage_empty() -> Weight { // Proof Size summary in bytes: - // Measured: `584` - // Estimated: `584` - // Minimum execution time: 6_844_000 picoseconds. - Weight::from_parts(7_017_000, 584) + // Measured: `552` + // Estimated: `552` + // Minimum execution time: 6_747_000 picoseconds. + Weight::from_parts(7_003_000, 552) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -698,85 +691,85 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_storage_full() -> Weight { // Proof Size summary in bytes: - // Measured: `10594` - // Estimated: `10594` - // Minimum execution time: 39_496_000 picoseconds. - Weight::from_parts(41_428_000, 10594) + // Measured: `10562` + // Estimated: `10562` + // Minimum execution time: 40_158_000 picoseconds. + Weight::from_parts(41_394_000, 10562) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `n` is `[0, 448]`. - /// The range of component `o` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. + /// The range of component `o` is `[0, 416]`. fn seal_set_storage(n: u32, o: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `152 + o * (1 ±0)` // Estimated: `151 + o * (1 ±0)` - // Minimum execution time: 6_400_000 picoseconds. - Weight::from_parts(7_358_548, 151) - // Standard Error: 67 - .saturating_add(Weight::from_parts(659, 0).saturating_mul(n.into())) - // Standard Error: 67 - .saturating_add(Weight::from_parts(1_273, 0).saturating_mul(o.into())) + // Minimum execution time: 6_360_000 picoseconds. + Weight::from_parts(7_335_152, 151) + // Standard Error: 80 + .saturating_add(Weight::from_parts(716, 0).saturating_mul(n.into())) + // Standard Error: 80 + .saturating_add(Weight::from_parts(1_127, 0).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(o.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `n` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. fn seal_clear_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `152 + n * (1 ±0)` // Estimated: `151 + n * (1 ±0)` - // Minimum execution time: 6_090_000 picoseconds. - Weight::from_parts(7_308_548, 151) - // Standard Error: 113 - .saturating_add(Weight::from_parts(1_456, 0).saturating_mul(n.into())) + // Minimum execution time: 5_980_000 picoseconds. + Weight::from_parts(7_164_266, 151) + // Standard Error: 130 + .saturating_add(Weight::from_parts(1_893, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `n` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. fn seal_get_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `152 + n * (1 ±0)` // Estimated: `151 + n * (1 ±0)` - // Minimum execution time: 5_649_000 picoseconds. - Weight::from_parts(7_096_122, 151) - // Standard Error: 120 - .saturating_add(Weight::from_parts(2_127, 0).saturating_mul(n.into())) + // Minimum execution time: 5_823_000 picoseconds. + Weight::from_parts(7_045_557, 151) + // Standard Error: 123 + .saturating_add(Weight::from_parts(2_222, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `n` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. fn seal_contains_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `152 + n * (1 ±0)` // Estimated: `151 + n * (1 ±0)` - // Minimum execution time: 5_261_000 picoseconds. - Weight::from_parts(6_552_943, 151) - // Standard Error: 117 - .saturating_add(Weight::from_parts(1_585, 0).saturating_mul(n.into())) + // Minimum execution time: 5_349_000 picoseconds. + Weight::from_parts(6_506_216, 151) + // Standard Error: 127 + .saturating_add(Weight::from_parts(1_605, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `n` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. fn seal_take_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `152 + n * (1 ±0)` // Estimated: `151 + n * (1 ±0)` - // Minimum execution time: 6_374_000 picoseconds. - Weight::from_parts(7_739_700, 151) - // Standard Error: 122 - .saturating_add(Weight::from_parts(2_264, 0).saturating_mul(n.into())) + // Minimum execution time: 6_151_000 picoseconds. + Weight::from_parts(7_812_180, 151) + // Standard Error: 159 + .saturating_add(Weight::from_parts(2_277, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) @@ -785,92 +778,94 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_371_000 picoseconds. - Weight::from_parts(1_446_000, 0) + // Minimum execution time: 1_344_000 picoseconds. + Weight::from_parts(1_462_000, 0) } fn set_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_663_000 picoseconds. - Weight::from_parts(1_786_000, 0) + // Minimum execution time: 1_680_000 picoseconds. + Weight::from_parts(1_785_000, 0) } fn get_transient_storage_empty() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_352_000 picoseconds. - Weight::from_parts(1_425_000, 0) + // Minimum execution time: 1_380_000 picoseconds. + Weight::from_parts(1_502_000, 0) } fn get_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_499_000 picoseconds. - Weight::from_parts(1_569_000, 0) + // Minimum execution time: 1_506_000 picoseconds. + Weight::from_parts(1_604_000, 0) } fn rollback_transient_storage() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_038_000 picoseconds. - Weight::from_parts(1_091_000, 0) + // Minimum execution time: 972_000 picoseconds. + Weight::from_parts(1_054_000, 0) } - /// The range of component `n` is `[0, 448]`. - /// The range of component `o` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. + /// The range of component `o` is `[0, 416]`. fn seal_set_transient_storage(n: u32, o: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_108_000 picoseconds. - Weight::from_parts(2_300_363, 0) - // Standard Error: 13 - .saturating_add(Weight::from_parts(242, 0).saturating_mul(n.into())) - // Standard Error: 13 - .saturating_add(Weight::from_parts(374, 0).saturating_mul(o.into())) + // Minimum execution time: 2_048_000 picoseconds. + Weight::from_parts(2_304_120, 0) + // Standard Error: 17 + .saturating_add(Weight::from_parts(254, 0).saturating_mul(n.into())) + // Standard Error: 17 + .saturating_add(Weight::from_parts(321, 0).saturating_mul(o.into())) } - /// The range of component `n` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. fn seal_clear_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_822_000 picoseconds. - Weight::from_parts(2_150_092, 0) - // Standard Error: 16 - .saturating_add(Weight::from_parts(394, 0).saturating_mul(n.into())) + // Minimum execution time: 1_790_000 picoseconds. + Weight::from_parts(2_141_874, 0) + // Standard Error: 31 + .saturating_add(Weight::from_parts(378, 0).saturating_mul(n.into())) } - /// The range of component `n` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. fn seal_get_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_675_000 picoseconds. - Weight::from_parts(1_873_341, 0) - // Standard Error: 12 - .saturating_add(Weight::from_parts(273, 0).saturating_mul(n.into())) + // Minimum execution time: 1_662_000 picoseconds. + Weight::from_parts(1_938_172, 0) + // Standard Error: 14 + .saturating_add(Weight::from_parts(316, 0).saturating_mul(n.into())) } - /// The range of component `n` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. fn seal_contains_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_555_000 picoseconds. - Weight::from_parts(1_690_236, 0) - // Standard Error: 10 - .saturating_add(Weight::from_parts(185, 0).saturating_mul(n.into())) + // Minimum execution time: 1_570_000 picoseconds. + Weight::from_parts(1_769_617, 0) + // Standard Error: 13 + .saturating_add(Weight::from_parts(152, 0).saturating_mul(n.into())) } - /// The range of component `n` is `[0, 448]`. - fn seal_take_transient_storage(_n: u32, ) -> Weight { + /// The range of component `n` is `[0, 416]`. + fn seal_take_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_278_000 picoseconds. - Weight::from_parts(2_522_598, 0) + // Minimum execution time: 2_266_000 picoseconds. + Weight::from_parts(2_497_430, 0) + // Standard Error: 21 + .saturating_add(Weight::from_parts(38, 0).saturating_mul(n.into())) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:1 w:0) @@ -881,12 +876,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `i` is `[0, 262144]`. fn seal_call(t: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1164 + t * (206 ±0)` - // Estimated: `4629 + t * (2417 ±0)` - // Minimum execution time: 30_631_000 picoseconds. - Weight::from_parts(31_328_855, 4629) - // Standard Error: 36_031 - .saturating_add(Weight::from_parts(5_665_922, 0).saturating_mul(t.into())) + // Measured: `1163 + t * (206 ±0)` + // Estimated: `4628 + t * (2417 ±0)` + // Minimum execution time: 30_368_000 picoseconds. + Weight::from_parts(31_023_429, 4628) + // Standard Error: 43_250 + .saturating_add(Weight::from_parts(5_949_452, 0).saturating_mul(t.into())) // Standard Error: 0 .saturating_add(Weight::from_parts(2, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) @@ -895,17 +890,17 @@ impl WeightInfo for SubstrateWeight { .saturating_add(Weight::from_parts(0, 2417).saturating_mul(t.into())) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:1 w:0) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) fn seal_delegate_call() -> Weight { // Proof Size summary in bytes: - // Measured: `1109` - // Estimated: `4574` - // Minimum execution time: 25_423_000 picoseconds. - Weight::from_parts(25_957_000, 4574) + // Measured: `1108` + // Estimated: `4573` + // Minimum execution time: 24_707_000 picoseconds. + Weight::from_parts(25_410_000, 4573) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) @@ -913,18 +908,18 @@ impl WeightInfo for SubstrateWeight { /// Storage: `Revive::PristineCode` (r:1 w:0) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// The range of component `i` is `[0, 262144]`. fn seal_instantiate(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1093` - // Estimated: `4571` - // Minimum execution time: 108_874_000 picoseconds. - Weight::from_parts(98_900_023, 4571) + // Measured: `1094` + // Estimated: `4579` + // Minimum execution time: 107_232_000 picoseconds. + Weight::from_parts(94_844_854, 4579) // Standard Error: 10 - .saturating_add(Weight::from_parts(4_183, 0).saturating_mul(i.into())) + .saturating_add(Weight::from_parts(4_159, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -933,64 +928,64 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 627_000 picoseconds. - Weight::from_parts(3_385_445, 0) - // Standard Error: 3 - .saturating_add(Weight::from_parts(1_419, 0).saturating_mul(n.into())) + // Minimum execution time: 617_000 picoseconds. + Weight::from_parts(3_460_054, 0) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_374, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_keccak_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_035_000 picoseconds. - Weight::from_parts(3_723_700, 0) - // Standard Error: 3 - .saturating_add(Weight::from_parts(3_637, 0).saturating_mul(n.into())) + // Minimum execution time: 1_040_000 picoseconds. + Weight::from_parts(3_026_644, 0) + // Standard Error: 2 + .saturating_add(Weight::from_parts(3_607, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_blake2_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 626_000 picoseconds. - Weight::from_parts(2_822_237, 0) + // Minimum execution time: 633_000 picoseconds. + Weight::from_parts(3_375_104, 0) // Standard Error: 2 - .saturating_add(Weight::from_parts(1_552, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_494, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_blake2_128(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 554_000 picoseconds. - Weight::from_parts(3_287_817, 0) - // Standard Error: 3 - .saturating_add(Weight::from_parts(1_542, 0).saturating_mul(n.into())) + // Minimum execution time: 601_000 picoseconds. + Weight::from_parts(3_802_060, 0) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_493, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 261889]`. fn seal_sr25519_verify(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 42_532_000 picoseconds. - Weight::from_parts(27_976_517, 0) - // Standard Error: 11 - .saturating_add(Weight::from_parts(5_453, 0).saturating_mul(n.into())) + // Minimum execution time: 42_419_000 picoseconds. + Weight::from_parts(26_760_986, 0) + // Standard Error: 12 + .saturating_add(Weight::from_parts(5_421, 0).saturating_mul(n.into())) } fn seal_ecdsa_recover() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 45_970_000 picoseconds. - Weight::from_parts(47_747_000, 0) + // Minimum execution time: 48_672_000 picoseconds. + Weight::from_parts(49_840_000, 0) } fn seal_ecdsa_to_eth_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_550_000 picoseconds. - Weight::from_parts(12_706_000, 0) + // Minimum execution time: 12_307_000 picoseconds. + Weight::from_parts(12_500_000, 0) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) @@ -998,30 +993,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `196` // Estimated: `3661` - // Minimum execution time: 10_229_000 picoseconds. - Weight::from_parts(10_530_000, 3661) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: `Revive::CodeInfoOf` (r:1 w:1) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) - fn lock_delegate_dependency() -> Weight { - // Proof Size summary in bytes: - // Measured: `234` - // Estimated: `3699` - // Minimum execution time: 9_743_000 picoseconds. - Weight::from_parts(10_180_000, 3699) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: `Revive::CodeInfoOf` (r:1 w:1) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) - fn unlock_delegate_dependency() -> Weight { - // Proof Size summary in bytes: - // Measured: `234` - // Estimated: `3561` - // Minimum execution time: 8_717_000 picoseconds. - Weight::from_parts(9_129_000, 3561) + // Minimum execution time: 10_142_000 picoseconds. + Weight::from_parts(10_458_000, 3661) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1030,10 +1003,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_332_000 picoseconds. - Weight::from_parts(9_985_610, 0) - // Standard Error: 187 - .saturating_add(Weight::from_parts(73_915, 0).saturating_mul(r.into())) + // Minimum execution time: 7_893_000 picoseconds. + Weight::from_parts(9_362_667, 0) + // Standard Error: 84 + .saturating_add(Weight::from_parts(74_272, 0).saturating_mul(r.into())) } } @@ -1045,8 +1018,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 690_000 picoseconds. - Weight::from_parts(743_000, 1485) + // Minimum execution time: 695_000 picoseconds. + Weight::from_parts(750_000, 1485) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -1056,10 +1029,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `230 + k * (69 ±0)` // Estimated: `222 + k * (70 ±0)` - // Minimum execution time: 10_913_000 picoseconds. - Weight::from_parts(11_048_000, 222) - // Standard Error: 972 - .saturating_add(Weight::from_parts(1_172_318, 0).saturating_mul(k.into())) + // Minimum execution time: 10_509_000 picoseconds. + Weight::from_parts(10_896_000, 222) + // Standard Error: 2_549 + .saturating_add(Weight::from_parts(1_264_033, 0).saturating_mul(k.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -1069,7 +1042,7 @@ impl WeightInfo for () { /// Storage: `Revive::AddressSuffix` (r:2 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:1 w:0) @@ -1079,14 +1052,12 @@ impl WeightInfo for () { /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. - fn call_with_code_per_byte(c: u32, ) -> Weight { + fn call_with_code_per_byte(_c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1195` - // Estimated: `7135` - // Minimum execution time: 83_080_000 picoseconds. - Weight::from_parts(89_270_264, 7135) - // Standard Error: 0 - .saturating_add(Weight::from_parts(3, 0).saturating_mul(c.into())) + // Measured: `1194` + // Estimated: `7134` + // Minimum execution time: 84_008_000 picoseconds. + Weight::from_parts(91_138_296, 7134) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1097,7 +1068,7 @@ impl WeightInfo for () { /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Timestamp::Now` (r:1 w:0) /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) @@ -1110,10 +1081,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `93` // Estimated: `6033` - // Minimum execution time: 171_761_000 picoseconds. - Weight::from_parts(158_031_807, 6033) - // Standard Error: 11 - .saturating_add(Weight::from_parts(4_536, 0).saturating_mul(i.into())) + // Minimum execution time: 172_907_000 picoseconds. + Weight::from_parts(153_592_465, 6033) + // Standard Error: 12 + .saturating_add(Weight::from_parts(4_544, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -1124,7 +1095,7 @@ impl WeightInfo for () { /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Timestamp::Now` (r:1 w:0) /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) @@ -1136,17 +1107,17 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `987` // Estimated: `4452` - // Minimum execution time: 143_210_000 picoseconds. - Weight::from_parts(121_908_111, 4452) - // Standard Error: 15 - .saturating_add(Weight::from_parts(4_467, 0).saturating_mul(i.into())) + // Minimum execution time: 143_169_000 picoseconds. + Weight::from_parts(120_653_436, 4452) + // Standard Error: 16 + .saturating_add(Weight::from_parts(4_444, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } /// Storage: `Revive::AddressSuffix` (r:2 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:1 w:0) @@ -1157,10 +1128,10 @@ impl WeightInfo for () { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) fn call() -> Weight { // Proof Size summary in bytes: - // Measured: `1195` - // Estimated: `7135` - // Minimum execution time: 136_689_000 picoseconds. - Weight::from_parts(145_358_000, 7135) + // Measured: `1194` + // Estimated: `7134` + // Minimum execution time: 138_392_000 picoseconds. + Weight::from_parts(143_329_000, 7134) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1171,14 +1142,12 @@ impl WeightInfo for () { /// Storage: `Revive::PristineCode` (r:0 w:1) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. - fn upload_code(c: u32, ) -> Weight { + fn upload_code(_c: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 43_351_000 picoseconds. - Weight::from_parts(44_896_319, 3465) - // Standard Error: 0 - .saturating_add(Weight::from_parts(1, 0).saturating_mul(c.into())) + // Minimum execution time: 43_420_000 picoseconds. + Weight::from_parts(45_143_767, 3465) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1192,21 +1161,21 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `181` // Estimated: `3646` - // Minimum execution time: 36_034_000 picoseconds. - Weight::from_parts(36_595_000, 3646) + // Minimum execution time: 35_828_000 picoseconds. + Weight::from_parts(36_853_000, 3646) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:2 w:2) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) fn set_code() -> Weight { // Proof Size summary in bytes: - // Measured: `425` - // Estimated: `6365` - // Minimum execution time: 19_484_000 picoseconds. - Weight::from_parts(20_104_000, 6365) + // Measured: `424` + // Estimated: `6364` + // Minimum execution time: 19_678_000 picoseconds. + Weight::from_parts(21_266_000, 6364) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1218,8 +1187,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 37_066_000 picoseconds. - Weight::from_parts(37_646_000, 3465) + // Minimum execution time: 37_024_000 picoseconds. + Weight::from_parts(37_440_000, 3465) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1231,8 +1200,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `56` // Estimated: `3521` - // Minimum execution time: 31_604_000 picoseconds. - Weight::from_parts(32_557_000, 3521) + // Minimum execution time: 31_228_000 picoseconds. + Weight::from_parts(32_183_000, 3521) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1244,8 +1213,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 6_070_000 picoseconds. - Weight::from_parts(6_246_000, 3465) + // Minimum execution time: 6_241_000 picoseconds. + Weight::from_parts(6_467_000, 3465) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// The range of component `r` is `[0, 1600]`. @@ -1253,33 +1222,33 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_471_000 picoseconds. - Weight::from_parts(7_724_355, 0) - // Standard Error: 245 - .saturating_add(Weight::from_parts(165_331, 0).saturating_mul(r.into())) + // Minimum execution time: 6_397_000 picoseconds. + Weight::from_parts(7_159_300, 0) + // Standard Error: 173 + .saturating_add(Weight::from_parts(167_265, 0).saturating_mul(r.into())) } fn seal_caller() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 239_000 picoseconds. - Weight::from_parts(278_000, 0) + // Minimum execution time: 267_000 picoseconds. + Weight::from_parts(296_000, 0) } fn seal_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 234_000 picoseconds. - Weight::from_parts(264_000, 0) + // Minimum execution time: 227_000 picoseconds. + Weight::from_parts(252_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) fn seal_is_contract() -> Weight { // Proof Size summary in bytes: // Measured: `202` // Estimated: `3667` - // Minimum execution time: 6_508_000 picoseconds. - Weight::from_parts(6_715_000, 3667) + // Minimum execution time: 6_591_000 picoseconds. + Weight::from_parts(6_770_000, 3667) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) @@ -1288,80 +1257,80 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3609` - // Minimum execution time: 6_190_000 picoseconds. - Weight::from_parts(6_413_000, 3609) + // Minimum execution time: 6_182_000 picoseconds. + Weight::from_parts(6_372_000, 3609) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) fn seal_code_hash() -> Weight { // Proof Size summary in bytes: - // Measured: `299` - // Estimated: `3764` - // Minimum execution time: 7_547_000 picoseconds. - Weight::from_parts(7_742_000, 3764) + // Measured: `298` + // Estimated: `3763` + // Minimum execution time: 7_327_000 picoseconds. + Weight::from_parts(7_612_000, 3763) .saturating_add(RocksDbWeight::get().reads(1_u64)) } fn seal_own_code_hash() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 251_000 picoseconds. - Weight::from_parts(274_000, 0) + // Minimum execution time: 232_000 picoseconds. + Weight::from_parts(287_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) fn seal_code_size() -> Weight { // Proof Size summary in bytes: - // Measured: `369` - // Estimated: `3834` - // Minimum execution time: 10_825_000 picoseconds. - Weight::from_parts(11_185_000, 3834) + // Measured: `368` + // Estimated: `3833` + // Minimum execution time: 10_918_000 picoseconds. + Weight::from_parts(11_323_000, 3833) .saturating_add(RocksDbWeight::get().reads(2_u64)) } fn seal_caller_is_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 325_000 picoseconds. - Weight::from_parts(352_000, 0) + // Minimum execution time: 310_000 picoseconds. + Weight::from_parts(340_000, 0) } fn seal_caller_is_root() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 245_000 picoseconds. - Weight::from_parts(282_000, 0) + // Minimum execution time: 257_000 picoseconds. + Weight::from_parts(292_000, 0) } fn seal_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 251_000 picoseconds. - Weight::from_parts(274_000, 0) + // Minimum execution time: 240_000 picoseconds. + Weight::from_parts(249_000, 0) } fn seal_weight_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` // Minimum execution time: 599_000 picoseconds. - Weight::from_parts(675_000, 0) + Weight::from_parts(645_000, 0) } fn seal_ref_time_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 245_000 picoseconds. - Weight::from_parts(263_000, 0) + // Minimum execution time: 208_000 picoseconds. + Weight::from_parts(244_000, 0) } fn seal_balance() -> Weight { // Proof Size summary in bytes: // Measured: `102` // Estimated: `0` - // Minimum execution time: 4_613_000 picoseconds. - Weight::from_parts(4_768_000, 0) + // Minimum execution time: 4_534_000 picoseconds. + Weight::from_parts(4_689_000, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) @@ -1371,8 +1340,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `160` // Estimated: `3625` - // Minimum execution time: 8_513_000 picoseconds. - Weight::from_parts(8_765_000, 3625) + // Minimum execution time: 8_640_000 picoseconds. + Weight::from_parts(8_971_000, 3625) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `Revive::ImmutableDataOf` (r:1 w:0) @@ -1382,10 +1351,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `134 + n * (1 ±0)` // Estimated: `3599 + n * (1 ±0)` - // Minimum execution time: 4_870_000 picoseconds. - Weight::from_parts(6_309_018, 3599) + // Minimum execution time: 4_875_000 picoseconds. + Weight::from_parts(6_212_863, 3599) // Standard Error: 7 - .saturating_add(Weight::from_parts(645, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(671, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1396,67 +1365,67 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_754_000 picoseconds. - Weight::from_parts(1_939_099, 0) - // Standard Error: 1 - .saturating_add(Weight::from_parts(581, 0).saturating_mul(n.into())) + // Minimum execution time: 1_678_000 picoseconds. + Weight::from_parts(1_883_150, 0) + // Standard Error: 2 + .saturating_add(Weight::from_parts(579, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().writes(1_u64)) } fn seal_value_transferred() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 243_000 picoseconds. - Weight::from_parts(292_000, 0) + // Minimum execution time: 238_000 picoseconds. + Weight::from_parts(273_000, 0) } fn seal_minimum_balance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 254_000 picoseconds. - Weight::from_parts(284_000, 0) + // Minimum execution time: 244_000 picoseconds. + Weight::from_parts(260_000, 0) } fn seal_return_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 242_000 picoseconds. - Weight::from_parts(257_000, 0) + // Minimum execution time: 249_000 picoseconds. + Weight::from_parts(265_000, 0) } fn seal_call_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 241_000 picoseconds. - Weight::from_parts(261_000, 0) + // Minimum execution time: 243_000 picoseconds. + Weight::from_parts(269_000, 0) } fn seal_gas_limit() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 265_000 picoseconds. - Weight::from_parts(290_000, 0) + // Minimum execution time: 228_000 picoseconds. + Weight::from_parts(268_000, 0) } fn seal_gas_price() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 225_000 picoseconds. - Weight::from_parts(249_000, 0) + // Minimum execution time: 222_000 picoseconds. + Weight::from_parts(251_000, 0) } fn seal_base_fee() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 246_000 picoseconds. - Weight::from_parts(266_000, 0) + // Minimum execution time: 226_000 picoseconds. + Weight::from_parts(250_000, 0) } fn seal_block_number() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 247_000 picoseconds. - Weight::from_parts(267_000, 0) + // Minimum execution time: 228_000 picoseconds. + Weight::from_parts(270_000, 0) } /// Storage: `Session::Validators` (r:1 w:0) /// Proof: `Session::Validators` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -1464,8 +1433,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 13_503_000 picoseconds. - Weight::from_parts(13_907_000, 1485) + // Minimum execution time: 13_597_000 picoseconds. + Weight::from_parts(13_770_000, 1485) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `System::BlockHash` (r:1 w:0) @@ -1474,123 +1443,121 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 2_251_000 picoseconds. - Weight::from_parts(2_370_000, 3465) + // Minimum execution time: 2_199_000 picoseconds. + Weight::from_parts(2_402_000, 3465) .saturating_add(RocksDbWeight::get().reads(1_u64)) } fn seal_now() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 237_000 picoseconds. - Weight::from_parts(264_000, 0) + // Minimum execution time: 230_000 picoseconds. + Weight::from_parts(256_000, 0) } fn seal_weight_to_fee() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_238_000 picoseconds. - Weight::from_parts(1_311_000, 0) + // Minimum execution time: 1_214_000 picoseconds. + Weight::from_parts(1_283_000, 0) } /// The range of component `n` is `[0, 262140]`. fn seal_copy_to_contract(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 380_000 picoseconds. - Weight::from_parts(524_789, 0) + // Minimum execution time: 376_000 picoseconds. + Weight::from_parts(569_136, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(237, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(236, 0).saturating_mul(n.into())) } fn seal_call_data_load() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 248_000 picoseconds. - Weight::from_parts(267_000, 0) + // Minimum execution time: 243_000 picoseconds. + Weight::from_parts(260_000, 0) } /// The range of component `n` is `[0, 262144]`. fn seal_call_data_copy(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 230_000 picoseconds. - Weight::from_parts(207_234, 0) + // Minimum execution time: 231_000 picoseconds. + Weight::from_parts(379_088, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(150, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(148, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262140]`. fn seal_return(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 267_000 picoseconds. - Weight::from_parts(357_669, 0) + // Minimum execution time: 227_000 picoseconds. + Weight::from_parts(400_572, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(238, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(237, 0).saturating_mul(n.into())) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::DeletionQueueCounter` (r:1 w:1) /// Proof: `Revive::DeletionQueueCounter` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) - /// Storage: `Revive::CodeInfoOf` (r:33 w:33) + /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::DeletionQueue` (r:0 w:1) /// Proof: `Revive::DeletionQueue` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `Measured`) /// Storage: `Revive::ImmutableDataOf` (r:0 w:1) /// Proof: `Revive::ImmutableDataOf` (`max_values`: None, `max_size`: Some(4118), added: 6593, mode: `Measured`) - /// The range of component `n` is `[0, 32]`. fn seal_terminate() -> Weight { // Proof Size summary in bytes: - // Measured: `218 + n * (88 ±0)` - // Estimated: `3684 + n * (2563 ±0)` - // Minimum execution time: 14_314_000 picoseconds. - Weight::from_parts(15_353_516, 3684) - // Standard Error: 10_720 + // Measured: `215` + // Estimated: `3680` + // Minimum execution time: 14_216_000 picoseconds. + Weight::from_parts(14_533_000, 3680) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } /// The range of component `t` is `[0, 4]`. - /// The range of component `n` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. fn seal_deposit_event(t: u32, n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_968_000 picoseconds. - Weight::from_parts(3_902_423, 0) - // Standard Error: 2_379 - .saturating_add(Weight::from_parts(199_019, 0).saturating_mul(t.into())) - // Standard Error: 24 - .saturating_add(Weight::from_parts(945, 0).saturating_mul(n.into())) + // Minimum execution time: 3_877_000 picoseconds. + Weight::from_parts(3_856_832, 0) + // Standard Error: 2_622 + .saturating_add(Weight::from_parts(201_206, 0).saturating_mul(t.into())) + // Standard Error: 28 + .saturating_add(Weight::from_parts(1_128, 0).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) fn get_storage_empty() -> Weight { // Proof Size summary in bytes: - // Measured: `584` - // Estimated: `584` - // Minimum execution time: 5_980_000 picoseconds. - Weight::from_parts(6_250_000, 584) + // Measured: `552` + // Estimated: `552` + // Minimum execution time: 5_806_000 picoseconds. + Weight::from_parts(6_037_000, 552) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) fn get_storage_full() -> Weight { // Proof Size summary in bytes: - // Measured: `10594` - // Estimated: `10594` - // Minimum execution time: 39_415_000 picoseconds. - Weight::from_parts(40_109_000, 10594) + // Measured: `10562` + // Estimated: `10562` + // Minimum execution time: 39_517_000 picoseconds. + Weight::from_parts(40_698_000, 10562) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_storage_empty() -> Weight { // Proof Size summary in bytes: - // Measured: `584` - // Estimated: `584` - // Minimum execution time: 6_844_000 picoseconds. - Weight::from_parts(7_017_000, 584) + // Measured: `552` + // Estimated: `552` + // Minimum execution time: 6_747_000 picoseconds. + Weight::from_parts(7_003_000, 552) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1598,85 +1565,85 @@ impl WeightInfo for () { /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_storage_full() -> Weight { // Proof Size summary in bytes: - // Measured: `10594` - // Estimated: `10594` - // Minimum execution time: 39_496_000 picoseconds. - Weight::from_parts(41_428_000, 10594) + // Measured: `10562` + // Estimated: `10562` + // Minimum execution time: 40_158_000 picoseconds. + Weight::from_parts(41_394_000, 10562) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `n` is `[0, 448]`. - /// The range of component `o` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. + /// The range of component `o` is `[0, 416]`. fn seal_set_storage(n: u32, o: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `152 + o * (1 ±0)` // Estimated: `151 + o * (1 ±0)` - // Minimum execution time: 6_400_000 picoseconds. - Weight::from_parts(7_358_548, 151) - // Standard Error: 67 - .saturating_add(Weight::from_parts(659, 0).saturating_mul(n.into())) - // Standard Error: 67 - .saturating_add(Weight::from_parts(1_273, 0).saturating_mul(o.into())) + // Minimum execution time: 6_360_000 picoseconds. + Weight::from_parts(7_335_152, 151) + // Standard Error: 80 + .saturating_add(Weight::from_parts(716, 0).saturating_mul(n.into())) + // Standard Error: 80 + .saturating_add(Weight::from_parts(1_127, 0).saturating_mul(o.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(o.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `n` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. fn seal_clear_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `152 + n * (1 ±0)` // Estimated: `151 + n * (1 ±0)` - // Minimum execution time: 6_090_000 picoseconds. - Weight::from_parts(7_308_548, 151) - // Standard Error: 113 - .saturating_add(Weight::from_parts(1_456, 0).saturating_mul(n.into())) + // Minimum execution time: 5_980_000 picoseconds. + Weight::from_parts(7_164_266, 151) + // Standard Error: 130 + .saturating_add(Weight::from_parts(1_893, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `n` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. fn seal_get_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `152 + n * (1 ±0)` // Estimated: `151 + n * (1 ±0)` - // Minimum execution time: 5_649_000 picoseconds. - Weight::from_parts(7_096_122, 151) - // Standard Error: 120 - .saturating_add(Weight::from_parts(2_127, 0).saturating_mul(n.into())) + // Minimum execution time: 5_823_000 picoseconds. + Weight::from_parts(7_045_557, 151) + // Standard Error: 123 + .saturating_add(Weight::from_parts(2_222, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `n` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. fn seal_contains_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `152 + n * (1 ±0)` // Estimated: `151 + n * (1 ±0)` - // Minimum execution time: 5_261_000 picoseconds. - Weight::from_parts(6_552_943, 151) - // Standard Error: 117 - .saturating_add(Weight::from_parts(1_585, 0).saturating_mul(n.into())) + // Minimum execution time: 5_349_000 picoseconds. + Weight::from_parts(6_506_216, 151) + // Standard Error: 127 + .saturating_add(Weight::from_parts(1_605, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `n` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. fn seal_take_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `152 + n * (1 ±0)` // Estimated: `151 + n * (1 ±0)` - // Minimum execution time: 6_374_000 picoseconds. - Weight::from_parts(7_739_700, 151) - // Standard Error: 122 - .saturating_add(Weight::from_parts(2_264, 0).saturating_mul(n.into())) + // Minimum execution time: 6_151_000 picoseconds. + Weight::from_parts(7_812_180, 151) + // Standard Error: 159 + .saturating_add(Weight::from_parts(2_277, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) @@ -1685,92 +1652,94 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_371_000 picoseconds. - Weight::from_parts(1_446_000, 0) + // Minimum execution time: 1_344_000 picoseconds. + Weight::from_parts(1_462_000, 0) } fn set_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_663_000 picoseconds. - Weight::from_parts(1_786_000, 0) + // Minimum execution time: 1_680_000 picoseconds. + Weight::from_parts(1_785_000, 0) } fn get_transient_storage_empty() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_352_000 picoseconds. - Weight::from_parts(1_425_000, 0) + // Minimum execution time: 1_380_000 picoseconds. + Weight::from_parts(1_502_000, 0) } fn get_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_499_000 picoseconds. - Weight::from_parts(1_569_000, 0) + // Minimum execution time: 1_506_000 picoseconds. + Weight::from_parts(1_604_000, 0) } fn rollback_transient_storage() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_038_000 picoseconds. - Weight::from_parts(1_091_000, 0) + // Minimum execution time: 972_000 picoseconds. + Weight::from_parts(1_054_000, 0) } - /// The range of component `n` is `[0, 448]`. - /// The range of component `o` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. + /// The range of component `o` is `[0, 416]`. fn seal_set_transient_storage(n: u32, o: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_108_000 picoseconds. - Weight::from_parts(2_300_363, 0) - // Standard Error: 13 - .saturating_add(Weight::from_parts(242, 0).saturating_mul(n.into())) - // Standard Error: 13 - .saturating_add(Weight::from_parts(374, 0).saturating_mul(o.into())) + // Minimum execution time: 2_048_000 picoseconds. + Weight::from_parts(2_304_120, 0) + // Standard Error: 17 + .saturating_add(Weight::from_parts(254, 0).saturating_mul(n.into())) + // Standard Error: 17 + .saturating_add(Weight::from_parts(321, 0).saturating_mul(o.into())) } - /// The range of component `n` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. fn seal_clear_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_822_000 picoseconds. - Weight::from_parts(2_150_092, 0) - // Standard Error: 16 - .saturating_add(Weight::from_parts(394, 0).saturating_mul(n.into())) + // Minimum execution time: 1_790_000 picoseconds. + Weight::from_parts(2_141_874, 0) + // Standard Error: 31 + .saturating_add(Weight::from_parts(378, 0).saturating_mul(n.into())) } - /// The range of component `n` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. fn seal_get_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_675_000 picoseconds. - Weight::from_parts(1_873_341, 0) - // Standard Error: 12 - .saturating_add(Weight::from_parts(273, 0).saturating_mul(n.into())) + // Minimum execution time: 1_662_000 picoseconds. + Weight::from_parts(1_938_172, 0) + // Standard Error: 14 + .saturating_add(Weight::from_parts(316, 0).saturating_mul(n.into())) } - /// The range of component `n` is `[0, 448]`. + /// The range of component `n` is `[0, 416]`. fn seal_contains_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_555_000 picoseconds. - Weight::from_parts(1_690_236, 0) - // Standard Error: 10 - .saturating_add(Weight::from_parts(185, 0).saturating_mul(n.into())) + // Minimum execution time: 1_570_000 picoseconds. + Weight::from_parts(1_769_617, 0) + // Standard Error: 13 + .saturating_add(Weight::from_parts(152, 0).saturating_mul(n.into())) } - /// The range of component `n` is `[0, 448]`. - fn seal_take_transient_storage(_n: u32, ) -> Weight { + /// The range of component `n` is `[0, 416]`. + fn seal_take_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_278_000 picoseconds. - Weight::from_parts(2_522_598, 0) + // Minimum execution time: 2_266_000 picoseconds. + Weight::from_parts(2_497_430, 0) + // Standard Error: 21 + .saturating_add(Weight::from_parts(38, 0).saturating_mul(n.into())) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:1 w:0) @@ -1781,12 +1750,12 @@ impl WeightInfo for () { /// The range of component `i` is `[0, 262144]`. fn seal_call(t: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1164 + t * (206 ±0)` - // Estimated: `4629 + t * (2417 ±0)` - // Minimum execution time: 30_631_000 picoseconds. - Weight::from_parts(31_328_855, 4629) - // Standard Error: 36_031 - .saturating_add(Weight::from_parts(5_665_922, 0).saturating_mul(t.into())) + // Measured: `1163 + t * (206 ±0)` + // Estimated: `4628 + t * (2417 ±0)` + // Minimum execution time: 30_368_000 picoseconds. + Weight::from_parts(31_023_429, 4628) + // Standard Error: 43_250 + .saturating_add(Weight::from_parts(5_949_452, 0).saturating_mul(t.into())) // Standard Error: 0 .saturating_add(Weight::from_parts(2, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) @@ -1795,17 +1764,17 @@ impl WeightInfo for () { .saturating_add(Weight::from_parts(0, 2417).saturating_mul(t.into())) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:1 w:0) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) fn seal_delegate_call() -> Weight { // Proof Size summary in bytes: - // Measured: `1109` - // Estimated: `4574` - // Minimum execution time: 25_423_000 picoseconds. - Weight::from_parts(25_957_000, 4574) + // Measured: `1108` + // Estimated: `4573` + // Minimum execution time: 24_707_000 picoseconds. + Weight::from_parts(25_410_000, 4573) .saturating_add(RocksDbWeight::get().reads(3_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) @@ -1813,18 +1782,18 @@ impl WeightInfo for () { /// Storage: `Revive::PristineCode` (r:1 w:0) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) - /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) + /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(242), added: 2717, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// The range of component `i` is `[0, 262144]`. fn seal_instantiate(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1093` - // Estimated: `4571` - // Minimum execution time: 108_874_000 picoseconds. - Weight::from_parts(98_900_023, 4571) + // Measured: `1094` + // Estimated: `4579` + // Minimum execution time: 107_232_000 picoseconds. + Weight::from_parts(94_844_854, 4579) // Standard Error: 10 - .saturating_add(Weight::from_parts(4_183, 0).saturating_mul(i.into())) + .saturating_add(Weight::from_parts(4_159, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1833,64 +1802,64 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 627_000 picoseconds. - Weight::from_parts(3_385_445, 0) - // Standard Error: 3 - .saturating_add(Weight::from_parts(1_419, 0).saturating_mul(n.into())) + // Minimum execution time: 617_000 picoseconds. + Weight::from_parts(3_460_054, 0) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_374, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_keccak_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_035_000 picoseconds. - Weight::from_parts(3_723_700, 0) - // Standard Error: 3 - .saturating_add(Weight::from_parts(3_637, 0).saturating_mul(n.into())) + // Minimum execution time: 1_040_000 picoseconds. + Weight::from_parts(3_026_644, 0) + // Standard Error: 2 + .saturating_add(Weight::from_parts(3_607, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_blake2_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 626_000 picoseconds. - Weight::from_parts(2_822_237, 0) + // Minimum execution time: 633_000 picoseconds. + Weight::from_parts(3_375_104, 0) // Standard Error: 2 - .saturating_add(Weight::from_parts(1_552, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_494, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_blake2_128(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 554_000 picoseconds. - Weight::from_parts(3_287_817, 0) - // Standard Error: 3 - .saturating_add(Weight::from_parts(1_542, 0).saturating_mul(n.into())) + // Minimum execution time: 601_000 picoseconds. + Weight::from_parts(3_802_060, 0) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_493, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 261889]`. fn seal_sr25519_verify(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 42_532_000 picoseconds. - Weight::from_parts(27_976_517, 0) - // Standard Error: 11 - .saturating_add(Weight::from_parts(5_453, 0).saturating_mul(n.into())) + // Minimum execution time: 42_419_000 picoseconds. + Weight::from_parts(26_760_986, 0) + // Standard Error: 12 + .saturating_add(Weight::from_parts(5_421, 0).saturating_mul(n.into())) } fn seal_ecdsa_recover() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 45_970_000 picoseconds. - Weight::from_parts(47_747_000, 0) + // Minimum execution time: 48_672_000 picoseconds. + Weight::from_parts(49_840_000, 0) } fn seal_ecdsa_to_eth_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_550_000 picoseconds. - Weight::from_parts(12_706_000, 0) + // Minimum execution time: 12_307_000 picoseconds. + Weight::from_parts(12_500_000, 0) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) @@ -1898,30 +1867,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `196` // Estimated: `3661` - // Minimum execution time: 10_229_000 picoseconds. - Weight::from_parts(10_530_000, 3661) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: `Revive::CodeInfoOf` (r:1 w:1) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) - fn lock_delegate_dependency() -> Weight { - // Proof Size summary in bytes: - // Measured: `234` - // Estimated: `3699` - // Minimum execution time: 9_743_000 picoseconds. - Weight::from_parts(10_180_000, 3699) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: `Revive::CodeInfoOf` (r:1 w:1) - /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) - fn unlock_delegate_dependency() -> Weight { - // Proof Size summary in bytes: - // Measured: `234` - // Estimated: `3561` - // Minimum execution time: 8_717_000 picoseconds. - Weight::from_parts(9_129_000, 3561) + // Minimum execution time: 10_142_000 picoseconds. + Weight::from_parts(10_458_000, 3661) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1930,9 +1877,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_332_000 picoseconds. - Weight::from_parts(9_985_610, 0) - // Standard Error: 187 - .saturating_add(Weight::from_parts(73_915, 0).saturating_mul(r.into())) + // Minimum execution time: 7_893_000 picoseconds. + Weight::from_parts(9_362_667, 0) + // Standard Error: 84 + .saturating_add(Weight::from_parts(74_272, 0).saturating_mul(r.into())) } }