diff --git a/prdoc/pr_9699.prdoc b/prdoc/pr_9699.prdoc new file mode 100644 index 0000000000000..08f0918e14fe2 --- /dev/null +++ b/prdoc/pr_9699.prdoc @@ -0,0 +1,16 @@ +title: Rve/revm selfdestruct2 +doc: +- audience: Runtime Dev + description: |- + fixes https://github.com/paritytech/polkadot-sdk/issues/9621 + + Behavior of `terminate` is changed in accordance with EIP-6780 (and EVM in general): + - `terminate` only deletes the code from storage if it is called in the same transaction the contract was created. + - `terminate` does not destroy the contract instantly. The contract is registered for destruction, which happens at the end of the transaction. +crates: +- name: pallet-revive + bump: minor +- name: pallet-revive-fixtures + bump: minor +- name: pallet-revive-uapi + bump: minor diff --git a/substrate/frame/revive/fixtures/contracts/HostEvmOnly.sol b/substrate/frame/revive/fixtures/contracts/HostEvmOnly.sol index 1241eb6a70889..9c615fae68d57 100644 --- a/substrate/frame/revive/fixtures/contracts/HostEvmOnly.sol +++ b/substrate/frame/revive/fixtures/contracts/HostEvmOnly.sol @@ -7,6 +7,11 @@ contract HostEvmOnly { selfdestruct(recipient) } } + function fallback(address payable recipient) public { + assembly { + selfdestruct(recipient) + } + } function extcodecopyOp(address account, uint64 offset, uint64 size) public view returns (bytes memory code) { code = new bytes(size); diff --git a/substrate/frame/revive/fixtures/contracts/destroy_and_transfer.rs b/substrate/frame/revive/fixtures/contracts/destroy_and_transfer.rs deleted file mode 100644 index 4ca300fdb0dcf..0000000000000 --- a/substrate/frame/revive/fixtures/contracts/destroy_and_transfer.rs +++ /dev/null @@ -1,85 +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. - -#![no_std] -#![no_main] -include!("../panic_handler.rs"); - -use uapi::{input, u256_bytes, HostFn, HostFnImpl as api, StorageFlags}; - -const ADDRESS_KEY: [u8; 32] = [0u8; 32]; -const VALUE: [u8; 32] = u256_bytes(65_536_000_000); - -#[no_mangle] -#[polkavm_derive::polkavm_export] -pub extern "C" fn deploy() { - input!(code_hash: &[u8; 32],); - - let mut address = [0u8; 20]; - let salt = [47u8; 32]; - - api::instantiate( - u64::MAX, /* How much ref_time weight to devote for the execution. u64::MAX = use - * all. */ - u64::MAX, // How much proof_size weight to devote for the execution. u64::MAX = use all. - &[u8::MAX; 32], // No deposit limit. - &VALUE, - code_hash, - Some(&mut address), - None, - Some(&salt), - ) - .unwrap(); - - // Return the deployed contract address. - api::set_storage(StorageFlags::empty(), &ADDRESS_KEY, &address); -} - -#[no_mangle] -#[polkavm_derive::polkavm_export] -pub extern "C" fn call() { - let mut callee_addr = [0u8; 20]; - let callee = &mut &mut callee_addr[..]; - api::get_storage(StorageFlags::empty(), &ADDRESS_KEY, callee).unwrap(); - assert!(callee.len() == 20); - - // Calling the destination contract with non-empty input data should fail. - let res = api::call( - uapi::CallFlags::empty(), - &callee_addr, - u64::MAX, // How much ref_time weight to devote for the execution. u64::MAX = use all. - u64::MAX, // How much proof_size weight to devote for the execution. u64::MAX = use all. - &[u8::MAX; 32], // No deposit limit. - &VALUE, - &[0u8; 1], - None, - ); - assert!(matches!(res, Err(uapi::ReturnErrorCode::CalleeTrapped))); - - // Call the destination contract regularly, forcing it to self-destruct. - api::call( - uapi::CallFlags::empty(), - &callee_addr, - u64::MAX, // How much ref_time weight to devote for the execution. u64::MAX = use all. - u64::MAX, // How much proof_size weight to devote for the execution. u64::MAX = use all. - &[u8::MAX; 32], // No deposit limit. - &VALUE, - &[0u8; 0], - None, - ) - .unwrap(); -} diff --git a/substrate/frame/revive/fixtures/contracts/self_destruct.rs b/substrate/frame/revive/fixtures/contracts/self_destruct_by_precompile.rs similarity index 73% rename from substrate/frame/revive/fixtures/contracts/self_destruct.rs rename to substrate/frame/revive/fixtures/contracts/self_destruct_by_precompile.rs index 22611be548aa0..ae2c8df3f3035 100644 --- a/substrate/frame/revive/fixtures/contracts/self_destruct.rs +++ b/substrate/frame/revive/fixtures/contracts/self_destruct_by_precompile.rs @@ -55,6 +55,23 @@ pub extern "C" fn call() { .unwrap(); } else { // Try to terminate and give balance to django. - api::terminate(&DJANGO_FALLBACK); + + // Build the calldata: selector + ABI-encoded address + let selector = uapi::solidity_selector("terminate(address)"); + let mut calldata = [0u8; 4 + 32]; + calldata[0..4].copy_from_slice(&selector); + // ABI encode address: right-align into 32 bytes (pad with 12 leading zeros) + calldata[4 + 12..4 + 32].copy_from_slice(&DJANGO_FALLBACK); + + let _ = api::call( + uapi::CallFlags::ALLOW_REENTRY, + &uapi::SYSTEM_PRECOMPILE_ADDR, + u64::MAX, + u64::MAX, + &[u8::MAX; 32], + &[0u8; 32], + &calldata, + None, + ).unwrap(); } } diff --git a/substrate/frame/revive/fixtures/contracts/self_destruct_by_syscall.rs b/substrate/frame/revive/fixtures/contracts/self_destruct_by_syscall.rs new file mode 100644 index 0000000000000..ae6ae20e9b017 --- /dev/null +++ b/substrate/frame/revive/fixtures/contracts/self_destruct_by_syscall.rs @@ -0,0 +1,34 @@ +// 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. + +#![no_std] +#![no_main] +include!("../panic_handler.rs"); + +use uapi::{HostFn, HostFnImpl as api}; + + +#[no_mangle] +#[polkavm_derive::polkavm_export] +pub extern "C" fn deploy() {} + +#[no_mangle] +#[polkavm_derive::polkavm_export] +pub extern "C" fn call() { + const DJANGO_FALLBACK: [u8; 20] = [4u8; 20]; + api::terminate(&DJANGO_FALLBACK); +} diff --git a/substrate/frame/revive/fixtures/contracts/self_destruct_factory.rs b/substrate/frame/revive/fixtures/contracts/self_destruct_factory.rs new file mode 100644 index 0000000000000..d0c9fc27cce36 --- /dev/null +++ b/substrate/frame/revive/fixtures/contracts/self_destruct_factory.rs @@ -0,0 +1,47 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +#![no_std] +#![no_main] +include!("../panic_handler.rs"); + +use uapi::{input, u256_bytes, HostFn, HostFnImpl as api}; + +#[no_mangle] +#[polkavm_derive::polkavm_export] +pub extern "C" fn deploy() {} + +#[no_mangle] +#[polkavm_derive::polkavm_export] +pub extern "C" fn call() { + input!(36, code_hash: [u8],); + + let mut addr = [0u8; 20]; + let salt = [1u8; 32]; + api::instantiate( + u64::MAX, + u64::MAX, + &[u8::MAX; 32], + &u256_bytes(100_000_000_000u64), + code_hash, + Some(&mut addr), + None, + Some(&salt), + ).unwrap(); + + api::call( + uapi::CallFlags::empty(), + &addr, + u64::MAX, + u64::MAX, + &[0u8; 32], + &[0u8; 32], + &[], + None, + ).unwrap(); + + // Return the address of the created (and destroyed) contract + api::return_value(uapi::ReturnFlags::empty(), &addr); +} diff --git a/substrate/frame/revive/fixtures/contracts/self_destructing_constructor_by_precompile.rs b/substrate/frame/revive/fixtures/contracts/self_destructing_constructor_by_precompile.rs new file mode 100644 index 0000000000000..41b4cbbf014d7 --- /dev/null +++ b/substrate/frame/revive/fixtures/contracts/self_destructing_constructor_by_precompile.rs @@ -0,0 +1,50 @@ +// 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. + +#![no_std] +#![no_main] +include!("../panic_handler.rs"); + +use uapi::{HostFn, HostFnImpl as api}; + +const DJANGO_FALLBACK: [u8; 20] = [4u8; 20]; + +#[no_mangle] +#[polkavm_derive::polkavm_export] +pub extern "C" fn deploy() { + // Build the calldata: selector + ABI-encoded address + let selector = uapi::solidity_selector("terminate(address)"); + let mut calldata = [0u8; 4 + 32]; + calldata[0..4].copy_from_slice(&selector); + // ABI encode address: right-align into 32 bytes (pad with 12 leading zeros) + calldata[4 + 12..4 + 32].copy_from_slice(&DJANGO_FALLBACK); + + let _ = api::call( + uapi::CallFlags::ALLOW_REENTRY, + &uapi::SYSTEM_PRECOMPILE_ADDR, + u64::MAX, + u64::MAX, + &[u8::MAX; 32], + &[0u8; 32], + &calldata, + None, + ).unwrap(); +} + +#[no_mangle] +#[polkavm_derive::polkavm_export] +pub extern "C" fn call() {} diff --git a/substrate/frame/revive/fixtures/contracts/self_destructing_constructor.rs b/substrate/frame/revive/fixtures/contracts/self_destructing_constructor_by_syscall.rs similarity index 100% rename from substrate/frame/revive/fixtures/contracts/self_destructing_constructor.rs rename to substrate/frame/revive/fixtures/contracts/self_destructing_constructor_by_syscall.rs diff --git a/substrate/frame/revive/fixtures/contracts/terminate_and_send_to_argument.rs b/substrate/frame/revive/fixtures/contracts/terminate_and_send_to_argument.rs index b1891d813d001..c4b25ee652acc 100644 --- a/substrate/frame/revive/fixtures/contracts/terminate_and_send_to_argument.rs +++ b/substrate/frame/revive/fixtures/contracts/terminate_and_send_to_argument.rs @@ -29,5 +29,21 @@ pub extern "C" fn deploy() {} #[polkavm_derive::polkavm_export] pub extern "C" fn call() { input!(beneficiary: &[u8; 20],); - api::terminate(&beneficiary); + // Build the calldata: selector + ABI-encoded address + let selector = uapi::solidity_selector("terminate(address)"); + let mut calldata = [0u8; 4 + 32]; + calldata[0..4].copy_from_slice(&selector); + // ABI encode address: right-align into 32 bytes (pad with 12 leading zeros) + calldata[4 + 12..4 + 32].copy_from_slice(beneficiary); + + let _ = api::call( + uapi::CallFlags::ALLOW_REENTRY, + &uapi::SYSTEM_PRECOMPILE_ADDR, + u64::MAX, + u64::MAX, + &[u8::MAX; 32], + &[0u8; 32], + &calldata, + None, + ).unwrap(); } diff --git a/substrate/frame/revive/src/benchmarking.rs b/substrate/frame/revive/src/benchmarking.rs index 887cc8e4ce610..9072f9ad26963 100644 --- a/substrate/frame/revive/src/benchmarking.rs +++ b/substrate/frame/revive/src/benchmarking.rs @@ -51,7 +51,10 @@ use frame_support::{ self, assert_ok, migrations::SteppedMigration, storage::child, - traits::{fungible::InspectHold, Hooks}, + traits::{ + fungible::{InspectHold, UnbalancedHold}, + Hooks, + }, weights::{Weight, WeightMeter}, }; use frame_system::RawOrigin; @@ -1221,7 +1224,49 @@ mod benchmarks { } assert!(matches!(result, Err(crate::vm::pvm::TrapReason::Termination))); - assert_eq!(PristineCode::::get(code_hash).is_none(), delete_code); + + Ok(()) + } + + #[benchmark(pov_mode = Measured)] + fn seal_terminate_logic() -> Result<(), BenchmarkError> { + let beneficiary = account::("beneficiary", 0, 0); + + build_runtime!(_runtime, instance, _memory: [vec![0u8; 0], ]); + let code_hash = instance.info()?.code_hash; + + assert!(PristineCode::::get(code_hash).is_some()); + + // Set storage deposit to zero so terminate_logic can proceed. + T::Currency::set_balance_on_hold( + &HoldReason::StorageDepositReserve.into(), + &instance.account_id, + 0u32.into(), + ) + .unwrap(); + + T::Currency::set_balance(&instance.account_id, Pallet::::min_balance() * 2u32.into()); + + let result; + #[block] + { + result = crate::storage::meter::terminate_logic_for_benchmark::( + &instance.account_id, + &beneficiary, + ); + } + result.unwrap(); + + // Check that the contract is removed + assert!(PristineCode::::get(code_hash).is_none()); + + // Check that the balance has been transferred away + let balance = ::Currency::total_balance(&instance.account_id); + assert_eq!(balance, 0u32.into()); + + // Check that the beneficiary received the balance + let balance = ::Currency::balance(&beneficiary); + assert_eq!(balance, Pallet::::min_balance() * 2u32.into()); Ok(()) } diff --git a/substrate/frame/revive/src/exec.rs b/substrate/frame/revive/src/exec.rs index 1e77a15f5b392..ee9f6f8b14fc4 100644 --- a/substrate/frame/revive/src/exec.rs +++ b/substrate/frame/revive/src/exec.rs @@ -33,7 +33,10 @@ use crate::{ CodeRemoved, Config, ContractInfo, Error, Event, ImmutableData, ImmutableDataOf, Pallet as Contracts, RuntimeCosts, LOG_TARGET, }; -use alloc::vec::Vec; +use alloc::{ + collections::{BTreeMap, BTreeSet}, + vec::Vec, +}; use core::{fmt::Debug, marker::PhantomData, mem, ops::ControlFlow}; use frame_support::{ crypto::ecdsa::ECDSAExt, @@ -202,14 +205,13 @@ pub trait Ext: PrecompileWithInfoExt { input_data: Vec, ) -> Result<(), ExecError>; - /// Transfer all funds to `beneficiary` and delete the contract. + /// Register the contract for destruction at the end of the call stack. /// - /// Since this function removes the self contract eagerly, if succeeded, no further actions - /// should be performed on this `Ext` instance. + /// Transfer all funds to `beneficiary`. + /// Contract is deleted only if it was created in the same call stack. /// - /// This function will fail if the same contract is present on the contract - /// call stack. - fn terminate(&mut self, beneficiary: &H160) -> Result; + /// This function will fail if called from constructor. + fn terminate_if_same_tx(&mut self, beneficiary: &H160) -> Result; /// Returns the code hash of the contract being executed. #[allow(dead_code)] @@ -430,6 +432,16 @@ pub trait PrecompileExt: sealing::Sealed { /// are filled with zeros fn copy_code_slice(&mut self, buf: &mut [u8], address: &H160, code_offset: usize); + /// Register the caller of the current contract for destruction. + /// Destruction happens at the end of the call stack. + /// This is supposed to be used by the terminate precompile. + /// + /// Transfer all funds to `beneficiary`. + /// Contract is deleted at the end of the call stack. + /// + /// This function will fail if called from constructor. + fn terminate_caller(&mut self, beneficiary: &H160) -> Result<(), DispatchError>; + /// Returns the effective gas price of this transaction. fn effective_gas_price(&self) -> U256; @@ -551,6 +563,11 @@ pub struct Stack<'a, T: Config, E> { transient_storage: TransientStorage, /// Global behavior determined by the creater of this stack. exec_config: &'a ExecConfig, + /// The set of contracts that were created during this call stack. + contracts_created: BTreeSet, + /// The set of contracts that are registered for destruction at the end of this call stack. + /// The tuple contains: (address of contract, contract info, address of beneficiary) + contracts_to_be_destroyed: BTreeMap, H160)>, /// No executable is held by the struct but influences its behaviour. _phantom: PhantomData, } @@ -668,11 +685,6 @@ enum CachedContract { /// /// In this case the cached contract is stale and needs to be reloaded from storage. Invalidated, - /// The current contract executed `terminate` and removed the contract. - /// - /// In this case a reload is neither allowed nor possible. Please note that recursive - /// calls cannot remove a contract as this is checked and denied. - Terminated, /// The frame is associated with pre-compile that has no contract info. None, } @@ -682,16 +694,6 @@ impl Frame { fn contract_info(&mut self) -> &mut ContractInfo { self.contract_info.get(&self.account_id) } - - /// Terminate and return the `contract_info` of the current contract. - /// - /// # Note - /// - /// Under no circumstances the contract is allowed to access the `contract_info` after - /// a call to this function. This would constitute a programming error in the exec module. - fn terminate(&mut self) -> ContractInfo { - self.contract_info.terminate(&self.account_id) - } } /// Extract the contract info after loading it from storage. @@ -769,12 +771,6 @@ impl CachedContract { get_cached_or_panic_after_load!(self) } - /// Terminate and return the contract info. - fn terminate(&mut self, account_id: &T::AccountId) -> ContractInfo { - self.load(account_id); - get_cached_or_panic_after_load!(mem::replace(self, Self::Terminated)) - } - /// Set the status to invalidate if is cached. fn invalidate(&mut self) { if matches!(self, CachedContract::Cached(_)) { @@ -951,6 +947,8 @@ where frames: Default::default(), transient_storage: TransientStorage::new(limits::TRANSIENT_STORAGE_BYTES), exec_config, + contracts_created: BTreeSet::new(), + contracts_to_be_destroyed: BTreeMap::new(), _phantom: Default::default(), }; @@ -1440,7 +1438,6 @@ where } } } else { - // TODO: iterate contracts_to_be_destroyed and destroy each contract self.gas_meter.absorb_nested(mem::take(&mut self.first_frame.nested_gas)); if !persist { return; @@ -1451,12 +1448,18 @@ where &self.first_frame.account_id, contract.as_deref_mut(), ); + if let Some(contract) = contract { AccountInfo::::insert_contract( &T::AddressMapper::to_address(&self.first_frame.account_id), contract.clone(), ); } + // End of the callstack: destroy scheduled contracts in line with EVM semantics. + let contracts_to_destroy = mem::take(&mut self.contracts_to_be_destroyed); + for (contract_address, (mut contract_info, beneficiary)) in contracts_to_destroy { + self.destroy_contract(&contract_address, &mut contract_info, &beneficiary); + } } } @@ -1554,9 +1557,8 @@ where Ok(()) } - let value = BalanceWithDust::>::from_value::(value) - .map_err(|_| >::BalanceConversionFailed)?; + .map_err(|_| Error::::BalanceConversionFailed)?; if value.is_zero() { return Ok(()); } @@ -1626,12 +1628,6 @@ where core::iter::once(&mut self.first_frame).chain(&mut self.frames).rev() } - /// Returns whether the current contract is on the stack multiple times. - fn is_recursive(&self) -> bool { - let account_id = &self.top_frame().account_id; - self.frames().skip(1).any(|f| &f.account_id == account_id) - } - /// Returns whether the specified contract allows to be reentered right now. fn allows_reentry(&self, id: &T::AccountId) -> bool { !self.frames().any(|f| &f.account_id == id && !f.allows_reentry) @@ -1679,6 +1675,28 @@ where } } + fn destroy_contract( + &mut self, + contract_address: &H160, + contract_info: &mut ContractInfo, + beneficiary_address: &H160, + ) { + let contract_account = T::AddressMapper::to_account_id(contract_address); + let beneficiary_account = T::AddressMapper::to_account_id(beneficiary_address); + + // Only allow storage to be removed if the contract was created in the current tx. + let delete_code = self.contracts_created.contains(&contract_account); + + self.storage_meter.terminate_absorb( + contract_account, + contract_info, + beneficiary_account.clone(), + delete_code, + ); + + log::debug!(target: crate::LOG_TARGET, "Contract at {contract_address:?} registered termination. Beneficiary: {beneficiary_address:?}, delete_code: {delete_code}"); + } + /// Returns true if the current context has contract info. /// This is the case if `no_precompile || precompile_with_info`. fn has_contract_info(&self) -> bool { @@ -1732,25 +1750,26 @@ where } } - fn terminate(&mut self, beneficiary: &H160) -> Result { - if self.is_recursive() { - 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); - - info.queue_trie_for_deletion(); - let account_address = T::AddressMapper::to_address(&frame.account_id); - AccountInfoOf::::remove(&account_address); - ImmutableDataOf::::remove(&account_address); - let removed = >::decrement_refcount(info.code_hash)?; + fn terminate_if_same_tx(&mut self, beneficiary: &H160) -> Result { + let (account_id, contract_address, contract_info) = { + let frame = self.top_frame_mut(); + if frame.entry_point == ExportedFunction::Constructor { + return Err(Error::::TerminatedInConstructor.into()); + } + ( + frame.account_id.clone(), + T::AddressMapper::to_address(&frame.account_id), + frame.contract_info().clone(), + ) + }; + self.contracts_to_be_destroyed + .insert(contract_address, (contract_info.clone(), *beneficiary)); - Ok(removed) + if self.contracts_created.contains(&account_id) { + Ok(CodeRemoved::Yes) + } else { + Ok(CodeRemoved::No) + } } fn own_code_hash(&mut self) -> &H256 { @@ -1867,6 +1886,10 @@ where )? }; let executable = executable.expect(FRAME_ALWAYS_EXISTS_ON_INSTANTIATE); + + // Mark the contract as created in this tx. + self.contracts_created.insert(self.top_frame().account_id.clone()); + let address = T::AddressMapper::to_address(&self.top_frame().account_id); if_tracing(|t| t.instantiate_code(&code, salt)); self.run(executable, input_data).map(|_| address) @@ -2198,6 +2221,25 @@ where buf[len..].fill(0); } + fn terminate_caller(&mut self, beneficiary: &H160) -> Result<(), DispatchError> { + let account_id = self.caller().account_id()?.clone(); + let caller_address = T::AddressMapper::to_address(&account_id); + { + let frame = self.top_frame_mut(); + if frame.entry_point == ExportedFunction::Constructor { + return Err(Error::::TerminatedInConstructor.into()); + } + } + let contract_info = + AccountInfo::::load_contract(&caller_address).ok_or(Error::::ContractNotFound)?; + self.contracts_to_be_destroyed + .insert(caller_address, (contract_info.clone(), *beneficiary)); + + // Pretend the contract was created in the current tx so that its storage can be destroyed. + self.contracts_created.insert(account_id); + Ok(()) + } + fn effective_gas_price(&self) -> U256 { self.exec_config .effective_gas_price diff --git a/substrate/frame/revive/src/exec/mock_ext.rs b/substrate/frame/revive/src/exec/mock_ext.rs index 77473681c60ed..8338b66825bb9 100644 --- a/substrate/frame/revive/src/exec/mock_ext.rs +++ b/substrate/frame/revive/src/exec/mock_ext.rs @@ -16,7 +16,6 @@ // limitations under the License. #![cfg(test)] - use crate::{ exec::{AccountIdOf, ExecError, Ext, Key, Origin, PrecompileExt, PrecompileWithInfoExt}, gas::GasMeter, @@ -206,6 +205,10 @@ impl PrecompileExt for MockExt { panic!("MockExt::copy_code_slice") } + fn terminate_caller(&mut self, _beneficiary: &H160) -> Result<(), DispatchError> { + panic!("MockExt::terminate_caller") + } + fn to_account_id(&self, _address: &H160) -> AccountIdOf { panic!("MockExt::to_account_id") } @@ -263,8 +266,8 @@ impl Ext for MockExt { panic!("MockExt::delegate_call") } - fn terminate(&mut self, _beneficiary: &H160) -> Result { - panic!("MockExt::terminate") + fn terminate_if_same_tx(&mut self, _beneficiary: &H160) -> Result { + panic!("MockExt::terminate_if_same_tx") } fn own_code_hash(&mut self) -> &H256 { diff --git a/substrate/frame/revive/src/exec/tests.rs b/substrate/frame/revive/src/exec/tests.rs index 23feeb693cd4b..11c2cb65e7e53 100644 --- a/substrate/frame/revive/src/exec/tests.rs +++ b/substrate/frame/revive/src/exec/tests.rs @@ -1316,7 +1316,7 @@ fn instantiation_traps() { #[test] fn termination_from_instantiate_fails() { let terminate_ch = MockLoader::insert(Constructor, |ctx, _| { - let _ = ctx.ext.terminate(&ALICE_ADDR)?; + let _ = ctx.ext.terminate_if_same_tx(&ALICE_ADDR)?; exec_success() }); diff --git a/substrate/frame/revive/src/precompiles/builtin/system.rs b/substrate/frame/revive/src/precompiles/builtin/system.rs index 9fce7a54a849d..9d3ab491b686f 100644 --- a/substrate/frame/revive/src/precompiles/builtin/system.rs +++ b/substrate/frame/revive/src/precompiles/builtin/system.rs @@ -44,6 +44,8 @@ impl BuiltinPrecompile for System { ) -> Result, Error> { use ISystem::ISystemCalls; match input { + ISystemCalls::terminate(_) if env.is_read_only() => + Err(crate::Error::::StateChangeDenied.into()), ISystemCalls::hashBlake256(ISystem::hashBlake256Call { input }) => { env.gas_meter_mut().charge(RuntimeCosts::HashBlake256(input.len() as u32))?; let output = sp_io::hashing::blake2_256(input.as_bytes_ref()); @@ -88,6 +90,13 @@ impl BuiltinPrecompile for System { let res = (ref_time, proof_size); Ok(res.abi_encode()) }, + ISystemCalls::terminate(ISystem::terminateCall { beneficiary }) => { + // no need to adjust gas because this always deletes code + env.gas_meter_mut().charge(RuntimeCosts::Terminate { code_removed: true })?; + let h160 = H160::from_slice(beneficiary.as_slice()); + env.terminate_caller(&h160)?; + Ok(Vec::new()) + }, } } } diff --git a/substrate/frame/revive/src/storage/meter.rs b/substrate/frame/revive/src/storage/meter.rs index aabcb0f8423d3..c52cf589e4e5d 100644 --- a/substrate/frame/revive/src/storage/meter.rs +++ b/substrate/frame/revive/src/storage/meter.rs @@ -18,12 +18,14 @@ //! This module contains functions to meter the storage deposit. use crate::{ - storage::ContractInfo, AccountIdOf, BalanceOf, Config, Error, ExecConfig, ExecOrigin as Origin, - HoldReason, Inspect, Pallet, StorageDeposit as Deposit, System, LOG_TARGET, + address::AddressMapper, storage::ContractInfo, AccountIdOf, AccountInfo, AccountInfoOf, + BalanceOf, CodeInfo, Config, Error, ExecConfig, ExecOrigin as Origin, HoldReason, + ImmutableDataOf, Inspect, Pallet, StorageDeposit as Deposit, System, LOG_TARGET, }; use alloc::vec::Vec; use core::{fmt::Debug, marker::PhantomData}; use frame_support::{ + storage::{with_transaction, TransactionOutcome}, traits::{ fungible::Mutate, tokens::{Fortitude::Polite, Preservation}, @@ -203,7 +205,7 @@ impl Diff { #[derive(RuntimeDebugNoBound, Clone, PartialEq, Eq)] pub enum ContractState { Alive, - Terminated { beneficiary: AccountIdOf }, + Terminated { beneficiary: AccountIdOf, delete_code: bool }, } /// Records information to charge or refund a plain account. @@ -233,7 +235,7 @@ enum Contribution { /// The contract was terminated. In this process the [`Diff`] was converted into a [`Deposit`] /// in order to calculate the refund. Upon termination the `reducible_balance` in the /// contract's account is transferred to the [`beneficiary`]. - Terminated { deposit: DepositOf, beneficiary: AccountIdOf }, + Terminated { deposit: DepositOf, beneficiary: AccountIdOf, delete_code: bool }, } impl Contribution { @@ -241,7 +243,7 @@ impl Contribution { fn update_contract(&self, info: Option<&mut ContractInfo>) -> DepositOf { match self { Self::Alive(diff) => diff.update_contract::(info), - Self::Terminated { deposit, beneficiary: _ } | Self::Checked(deposit) => + Self::Terminated { deposit, beneficiary: _, .. } | Self::Checked(deposit) => deposit.clone(), } } @@ -298,7 +300,11 @@ where .saturating_add(&absorbed.total_deposit) .saturating_add(&own_deposit); self.charges.extend_from_slice(&absorbed.charges); - if !own_deposit.is_zero() { + + // Allow recording zero deposit charge only if the contract was terminated. + if !own_deposit.is_zero() || + matches!(absorbed.contract_state(), ContractState::Terminated { .. }) + { self.charges.push(Charge { contract: contract.clone(), amount: own_deposit, @@ -307,6 +313,20 @@ where } } + pub fn terminate_absorb( + &mut self, + contract_account: T::AccountId, + contract_info: &mut ContractInfo, + beneficiary: T::AccountId, + delete_code: bool, + ) { + use sp_runtime::traits::Bounded; + // Create a nested storage meter and terminate the contract's storage. + let mut nested = self.nested(BalanceOf::::max_value()); + nested.terminate(contract_info, beneficiary.clone(), delete_code); + self.absorb(core::mem::take(&mut nested), &contract_account, Some(contract_info)); + } + /// Record a charge that has taken place externally. /// /// This will not perform a charge. It just records it to reflect it in the @@ -343,8 +363,11 @@ where /// Returns the state of the currently executed contract. fn contract_state(&self) -> ContractState { match &self.own_contribution { - Contribution::Terminated { deposit: _, beneficiary } => - ContractState::Terminated { beneficiary: beneficiary.clone() }, + Contribution::Terminated { deposit: _, beneficiary, delete_code } => + ContractState::Terminated { + beneficiary: beneficiary.clone(), + delete_code: *delete_code, + }, _ => ContractState::Alive, } } @@ -371,7 +394,7 @@ where /// This drops the root meter in order to make sure it is only called when the whole /// execution did finish. pub fn try_into_deposit( - self, + mut self, origin: &Origin, exec_config: &ExecConfig, ) -> Result, DispatchError> { @@ -380,6 +403,27 @@ where Origin::Root => return Ok(Deposit::Charge(Zero::zero())), Origin::Signed(o) => o, }; + self.charges.sort_by(|a, b| a.contract.cmp(&b.contract)); + // Coalesce charges of the same contract. + self.charges = { + let mut coalesced: Vec> = Vec::with_capacity(self.charges.len()); + for ch in self.charges { + if let Some(last) = coalesced.last_mut() { + if last.contract == ch.contract { + // merge amounts (uses Deposit::saturating_add) + last.amount = last.amount.saturating_add(&ch.amount); + // prefer terminated state if any entry is terminated (keep whichever is + // terminated) + if matches!(ch.state, ContractState::Terminated { .. }) { + last.state = ch.state.clone(); + } + continue; + } + } + coalesced.push(ch); + } + coalesced + }; let try_charge = || { for charge in self.charges.iter().filter(|c| matches!(c.amount, Deposit::Refund(_))) { E::charge(origin, &charge.contract, &charge.amount, &charge.state, exec_config)?; @@ -425,11 +469,13 @@ impl> RawMeter { /// This will manipulate the meter so that all storage deposit accumulated in /// `contract_info` will be refunded to the `origin` of the meter. And the free /// (`reducible_balance`) will be sent to the `beneficiary`. - pub fn terminate(&mut self, info: &ContractInfo, beneficiary: T::AccountId) { + fn terminate(&mut self, info: &ContractInfo, beneficiary: T::AccountId, delete_code: bool) { debug_assert!(matches!(self.contract_state(), ContractState::Alive)); + let deposit = if delete_code { info.total_deposit() } else { BalanceOf::::zero() }; self.own_contribution = Contribution::Terminated { - deposit: Deposit::Refund(info.total_deposit()), + deposit: Deposit::Refund(deposit), beneficiary, + delete_code, }; } @@ -464,7 +510,9 @@ impl Ext for ReservingExt { exec_config: &ExecConfig, ) -> Result<(), DispatchError> { match amount { - Deposit::Charge(amount) | Deposit::Refund(amount) if amount.is_zero() => return Ok(()), + Deposit::Charge(amount) | Deposit::Refund(amount) if amount.is_zero() => { + // We cannot return here because need to handle the terminated state below. + }, Deposit::Charge(amount) => { >::charge_deposit( Some(HoldReason::StorageDepositReserve), @@ -495,18 +543,66 @@ impl Ext for ReservingExt { } }, } - if let ContractState::::Terminated { beneficiary } = state { + if let ContractState::::Terminated { beneficiary, delete_code } = state { + if let Err(e) = terminate::(contract, &beneficiary, delete_code) { + log::debug!(target: LOG_TARGET, "Failed to terminate contract: {:?}", e); + } + } + Ok(()) + } +} + +fn terminate( + contract: &T::AccountId, + beneficiary: &T::AccountId, + delete_code: &bool, +) -> Result<(), DispatchError> { + fn terminate_inner( + contract: &T::AccountId, + beneficiary: &T::AccountId, + delete_code: &bool, + ) -> Result<(), DispatchError> { + let balance = if *delete_code { + // Clean up on-chain storage + let contract_address = T::AddressMapper::to_address(contract); + let contract_info = AccountInfo::::load_contract(&contract_address) + .ok_or(Error::::ContractNotFound)?; + contract_info.queue_trie_for_deletion(); + AccountInfoOf::::remove(contract_address); + ImmutableDataOf::::remove(contract_address); + + // ensure code is removed + let _code_removed = >::decrement_refcount(contract_info.code_hash)?; + System::::dec_consumers(&contract); + + // Whatever is left in the contract is sent to the termination beneficiary. + T::Currency::total_balance(&contract) + } else { // Whatever is left in the contract is sent to the termination beneficiary. - T::Currency::transfer( - &contract, - &beneficiary, - T::Currency::reducible_balance(&contract, Preservation::Expendable, Polite), - Preservation::Expendable, - )?; + T::Currency::reducible_balance(&contract, Preservation::Expendable, Polite) + }; + if !balance.is_zero() { + T::Currency::transfer(&contract, &beneficiary, balance, Preservation::Expendable)?; } + Ok(()) } + + with_transaction(|| -> TransactionOutcome> { + match terminate_inner::(contract, beneficiary, delete_code) { + Ok(_) => TransactionOutcome::Commit(Ok(())), + Err(e) => TransactionOutcome::Rollback(Err(e)), + } + }) +} + +#[cfg(feature = "runtime-benchmarks")] +pub fn terminate_logic_for_benchmark( + contract: &T::AccountId, + beneficiary: &T::AccountId, +) -> Result<(), DispatchError> { + terminate::(contract, beneficiary, &true) } mod private { @@ -677,13 +773,7 @@ mod tests { Charge { origin: ALICE, contract: CHARLIE, - amount: Deposit::Refund(10), - state: ContractState::Alive, - }, - Charge { - origin: ALICE, - contract: CHARLIE, - amount: Deposit::Refund(20), + amount: Deposit::Refund(30), state: ContractState::Alive, }, Charge { @@ -776,7 +866,10 @@ mod tests { origin: ALICE, contract: CHARLIE, amount: Deposit::Refund(120), - state: ContractState::Terminated { beneficiary: CHARLIE }, + state: ContractState::Terminated { + beneficiary: CHARLIE, + delete_code: true, + }, }, Charge { origin: ALICE, @@ -819,7 +912,7 @@ mod tests { let mut nested1 = nested0.nested(BalanceOf::::max_value()); nested1.charge(&Diff { items_removed: 5, ..Default::default() }); nested1.charge(&Diff { bytes_added: 20, ..Default::default() }); - nested1.terminate(&nested1_info, CHARLIE); + nested1.terminate(&nested1_info, CHARLIE, true); nested0.enforce_limit(Some(&mut nested1_info)).unwrap(); nested0.absorb(nested1, &CHARLIE, None); diff --git a/substrate/frame/revive/src/tests/pvm.rs b/substrate/frame/revive/src/tests/pvm.rs index 03adcca66f9f5..887063863fa81 100644 --- a/substrate/frame/revive/src/tests/pvm.rs +++ b/substrate/frame/revive/src/tests/pvm.rs @@ -525,7 +525,7 @@ fn gas_syncs_work() { /// Check the `Nonce` storage item for more information. #[test] fn instantiate_unique_trie_id() { - let (binary, code_hash) = compile_module("self_destruct").unwrap(); + let (binary, code_hash) = compile_module("self_destruct_by_precompile").unwrap(); ExtBuilder::default().existential_deposit(500).build().execute_with(|| { let _ = ::Currency::set_balance(&ALICE, 1_000_000); @@ -1023,8 +1023,8 @@ fn cannot_self_destruct_through_storage_refund_after_price_change() { } #[test] -fn cannot_self_destruct_while_live() { - let (binary, _code_hash) = compile_module("self_destruct").unwrap(); +fn can_self_destruct_while_live() { + let (binary, _code_hash) = compile_module("self_destruct_by_precompile").unwrap(); ExtBuilder::default().existential_deposit(50).build().execute_with(|| { let _ = ::Currency::set_balance(&ALICE, 1_000_000); @@ -1036,29 +1036,27 @@ fn cannot_self_destruct_while_live() { // Check that the BOB contract has been instantiated. get_contract(&addr); - // Call BOB with input data, forcing it make a recursive call to itself to - // self-destruct, resulting in a trap. - assert_err_ignore_postinfo!( - builder::call(addr).data(vec![0]).build(), - Error::::ContractTrapped, - ); + // Call BOB with input that forces it to recurse and self-destruct. + // New behavior: termination while on the stack is allowed, so expect success. + assert_ok!(builder::call(addr).data(vec![0]).build()); - // Check that BOB is still there. - get_contract(&addr); + assert!(get_contract_checked(&addr).is_none(), "contract should have been destroyed"); }); } #[test] -fn self_destruct_works() { - let (binary, code_hash) = compile_module("self_destruct").unwrap(); +fn self_destruct_by_precompile_works() { + let (binary, code_hash) = compile_module("self_destruct_by_precompile").unwrap(); ExtBuilder::default().existential_deposit(1_000).build().execute_with(|| { let _ = ::Currency::set_balance(&ALICE, 1_000_000); let _ = ::Currency::set_balance(&DJANGO_FALLBACK, 1_000_000); let min_balance = Contracts::min_balance(); + let initial_contract_balance = 100_000; + // Instantiate the BOB contract. let contract = builder::bare_instantiate(Code::Upload(binary)) - .native_value(100_000) + .native_value(initial_contract_balance) .build_and_unwrap_contract(); let hold_balance = contract_base_deposit(&contract.addr); @@ -1083,14 +1081,14 @@ fn self_destruct_works() { // Check that the beneficiary (django) got remaining balance. assert_eq!( ::Currency::free_balance(DJANGO_FALLBACK), - 1_000_000 + 100_000 + min_balance + 1_000_000 + initial_contract_balance + min_balance ); // Check that the Alice is missing Django's benefit. Within ALICE's total balance // there's also the code upload deposit held. assert_eq!( ::Currency::total_balance(&ALICE), - 1_000_000 - (100_000 + min_balance) + 1_000_000 - (initial_contract_balance + min_balance) ); pretty_assertions::assert_eq!( @@ -1100,11 +1098,11 @@ fn self_destruct_works() { phase: Phase::Initialization, event: RuntimeEvent::Balances(pallet_balances::Event::TransferOnHold { reason: ::RuntimeHoldReason::Contracts( - HoldReason::CodeUploadDepositReserve, + HoldReason::StorageDepositReserve, ), - source: Pallet::::account_id(), + source: contract.account_id.clone(), dest: ALICE, - amount: upload_deposit, + amount: hold_balance, }), topics: vec![], }, @@ -1112,11 +1110,11 @@ fn self_destruct_works() { phase: Phase::Initialization, event: RuntimeEvent::Balances(pallet_balances::Event::TransferOnHold { reason: ::RuntimeHoldReason::Contracts( - HoldReason::StorageDepositReserve, + HoldReason::CodeUploadDepositReserve, ), - source: contract.account_id.clone(), + source: Pallet::::account_id(), dest: ALICE, - amount: hold_balance, + amount: upload_deposit, }), topics: vec![], }, @@ -1132,7 +1130,7 @@ fn self_destruct_works() { event: RuntimeEvent::Balances(pallet_balances::Event::Transfer { from: contract.account_id.clone(), to: DJANGO_FALLBACK, - amount: 100_000 + min_balance, + amount: initial_contract_balance + min_balance, }), topics: vec![], }, @@ -1141,47 +1139,131 @@ fn self_destruct_works() { }); } -// This tests that one contract cannot prevent another from self-destructing by sending it -// additional funds after it has been drained. #[test] -fn destroy_contract_and_transfer_funds() { - let (callee_binary, callee_code_hash) = compile_module("self_destruct").unwrap(); - let (caller_binary, _caller_code_hash) = compile_module("destroy_and_transfer").unwrap(); +fn self_destruct_by_syscall_does_not_delete_code() { + // Test EIP-6780 behavior where self-destruct does not delete the code. + let (binary, code_hash) = compile_module("self_destruct_by_syscall").unwrap(); + ExtBuilder::default().existential_deposit(1_000).build().execute_with(|| { + let _ = ::Currency::set_balance(&ALICE, 1_000_000); + let _ = ::Currency::set_balance(&DJANGO_FALLBACK, 1_000_000); + let min_balance = Contracts::min_balance(); - ExtBuilder::default().existential_deposit(50).build().execute_with(|| { - // Create code hash for bob to instantiate + let initial_contract_balance = 100_000; + + // Instantiate the BOB contract. + let contract = builder::bare_instantiate(Code::Upload(binary)) + .native_value(initial_contract_balance) + .build_and_unwrap_contract(); + + let hold_balance = contract_base_deposit(&contract.addr); + + // Check that the BOB contract has been instantiated. + let _ = get_contract(&contract.addr); + + // Drop all previous events + initialize_block(2); + + let alice_balance_before_termination = ::Currency::total_balance(&ALICE); + + // Call BOB without input data which triggers termination. + assert_matches!(builder::call(contract.addr).build(), Ok(_)); + + // Check that the code still exists + assert!(PristineCode::::get(&code_hash).is_some()); + + // Check that account still exists + assert!(get_contract_checked(&contract.addr).is_some()); + assert_eq!( + ::Currency::total_balance(&contract.account_id), + min_balance + hold_balance + ); + + // Check that the beneficiary (django) got remaining balance. + assert_eq!( + ::Currency::free_balance(DJANGO_FALLBACK), + 1_000_000 + initial_contract_balance + ); + + // Check that the Alice did not get a refund. + assert_eq!( + ::Currency::total_balance(&ALICE), + alice_balance_before_termination + ); + + pretty_assertions::assert_eq!( + System::events(), + vec![EventRecord { + phase: Phase::Initialization, + event: RuntimeEvent::Balances(pallet_balances::Event::Transfer { + from: contract.account_id.clone(), + to: DJANGO_FALLBACK, + amount: initial_contract_balance, + }), + topics: vec![], + },], + ); + }); +} + +#[test] +fn self_destruct_by_syscall_works() { + let (factory_binary, factory_code_hash) = compile_module("self_destruct_factory").unwrap(); + let (selfdestruct_binary, selfdestruct_code_hash) = + compile_module("self_destruct_by_syscall").unwrap(); + + ExtBuilder::default().build().execute_with(|| { let _ = ::Currency::set_balance(&ALICE, 1_000_000); - Contracts::upload_code( - RuntimeOrigin::signed(ALICE), - callee_binary.clone(), + let _ = ::Currency::set_balance(&BOB, 1_000_000); + let min_balance = Contracts::min_balance(); + let initial_contract_balance = 100_000; + + // Upload both contracts + assert_ok!(Contracts::upload_code( + RuntimeOrigin::signed(BOB), + selfdestruct_binary, deposit_limit::(), - ) - .unwrap(); + )); - // This deploys the BOB contract, which in turn deploys the CHARLIE contract during - // construction. - let Contract { addr: addr_bob, .. } = - builder::bare_instantiate(Code::Upload(caller_binary)) - .native_value(200_000) - .data(callee_code_hash.as_ref().to_vec()) - .build_and_unwrap_contract(); + assert_ok!(Contracts::upload_code( + RuntimeOrigin::signed(BOB), + factory_binary, + deposit_limit::(), + )); + + // Deploy factory + let factory = builder::bare_instantiate(Code::Existing(factory_code_hash)) + .origin(RuntimeOrigin::signed(BOB)) + .native_value(initial_contract_balance) + .build_and_unwrap_contract(); + + let mut input_data = Vec::new(); + input_data.extend_from_slice(selfdestruct_code_hash.as_bytes()); + + // Call factory + let result = builder::bare_call(factory.addr).data(input_data.clone()).build(); + assert!(result.result.is_ok()); - // Check that the CHARLIE contract has been instantiated. - let salt = [47; 32]; // hard coded in fixture. - let addr_charlie = create2(&addr_bob, &callee_binary, &[], &salt); - get_contract(&addr_charlie); + let returned_data = result.result.unwrap().data; + assert!(returned_data.len() >= 20, "Returned data too short to contain address"); + let mut contract_addr_bytes = [0u8; 20]; + contract_addr_bytes.copy_from_slice(&returned_data[0..20]); + let contract_addr = H160::from(contract_addr_bytes); - // Call BOB, which calls CHARLIE, forcing CHARLIE to self-destruct. - assert_ok!(builder::call(addr_bob).data(addr_charlie.encode()).build()); + initialize_block(System::block_number() + 1); - // Check that CHARLIE has moved on to the great beyond (ie. died). - assert!(get_contract_checked(&addr_charlie).is_none()); + assert!(get_contract_checked(&contract_addr).is_none(), "Contract found"); + + assert_eq!( + ::Currency::total_balance(&DJANGO_FALLBACK), + initial_contract_balance + min_balance + ); + assert_eq!(::Currency::total_balance(&ALICE), 1_000_000 - min_balance); }); } #[test] -fn cannot_self_destruct_in_constructor() { - let (binary, _) = compile_module("self_destructing_constructor").unwrap(); +fn cannot_self_destruct_in_constructor_by_syscall() { + let (binary, _) = compile_module("self_destructing_constructor_by_syscall").unwrap(); ExtBuilder::default().existential_deposit(50).build().execute_with(|| { let _ = ::Currency::set_balance(&ALICE, 1_000_000); @@ -1193,6 +1275,21 @@ fn cannot_self_destruct_in_constructor() { }); } +#[test] +fn cannot_self_destruct_in_constructor_by_precompile() { + let (binary, _) = compile_module("self_destructing_constructor_by_precompile").unwrap(); + ExtBuilder::default().existential_deposit(50).build().execute_with(|| { + let _ = ::Currency::set_balance(&ALICE, 1_000_000); + + // Fail to instantiate the BOB because the constructor calls seal_terminate. + // Error is ContractTrapped because precompile call fails. + assert_err_ignore_postinfo!( + builder::instantiate_with_code(binary).value(100_000).build(), + Error::::ContractTrapped, + ); + }); +} + #[test] fn crypto_hash_keccak_256() { let (binary, _code_hash) = compile_module("crypto_hash_keccak_256").unwrap(); @@ -1412,7 +1509,7 @@ fn instantiate_return_code() { #[test] fn lazy_removal_works() { - let (code, _hash) = compile_module("self_destruct").unwrap(); + let (code, _hash) = compile_module("self_destruct_by_precompile").unwrap(); ExtBuilder::default().existential_deposit(50).build().execute_with(|| { let min_balance = Contracts::min_balance(); let _ = ::Currency::set_balance(&ALICE, 1000 * min_balance); @@ -1446,7 +1543,7 @@ fn lazy_removal_works() { #[test] fn lazy_batch_removal_works() { - let (code, _hash) = compile_module("self_destruct").unwrap(); + let (code, _hash) = compile_module("self_destruct_by_precompile").unwrap(); ExtBuilder::default().existential_deposit(50).build().execute_with(|| { let min_balance = Contracts::min_balance(); let _ = ::Currency::set_balance(&ALICE, 1000 * min_balance); @@ -1518,7 +1615,7 @@ fn gas_left_api_works() { #[test] fn lazy_removal_partial_remove_works() { - let (code, _hash) = compile_module("self_destruct").unwrap(); + let (code, _hash) = compile_module("self_destruct_by_precompile").unwrap(); // We create a contract with some extra keys above the weight limit let extra_keys = 7u32; @@ -1593,7 +1690,7 @@ fn lazy_removal_partial_remove_works() { #[test] fn lazy_removal_does_no_run_on_low_remaining_weight() { - let (code, _hash) = compile_module("self_destruct").unwrap(); + let (code, _hash) = compile_module("self_destruct_by_precompile").unwrap(); ExtBuilder::default().existential_deposit(50).build().execute_with(|| { let min_balance = Contracts::min_balance(); let _ = ::Currency::set_balance(&ALICE, 1000 * min_balance); @@ -1643,7 +1740,7 @@ fn lazy_removal_does_no_run_on_low_remaining_weight() { #[test] fn lazy_removal_does_not_use_all_weight() { - let (code, _hash) = compile_module("self_destruct").unwrap(); + let (code, _hash) = compile_module("self_destruct_by_precompile").unwrap(); let mut meter = WeightMeter::with_limit(Weight::from_parts(5_000_000_000, 100 * 1024)); let mut ext = ExtBuilder::default().existential_deposit(50).build(); @@ -1707,7 +1804,7 @@ fn lazy_removal_does_not_use_all_weight() { #[test] fn deletion_queue_ring_buffer_overflow() { - let (code, _hash) = compile_module("self_destruct").unwrap(); + let (code, _hash) = compile_module("self_destruct_by_precompile").unwrap(); let mut ext = ExtBuilder::default().existential_deposit(50).build(); // setup the deletion queue with custom counters @@ -1761,7 +1858,7 @@ fn deletion_queue_ring_buffer_overflow() { } #[test] fn refcounter() { - let (binary, code_hash) = compile_module("self_destruct").unwrap(); + let (binary, code_hash) = compile_module("self_destruct_by_precompile").unwrap(); ExtBuilder::default().existential_deposit(50).build().execute_with(|| { let _ = ::Currency::set_balance(&ALICE, 1_000_000); let min_balance = Contracts::min_balance(); diff --git a/substrate/frame/revive/src/vm/evm/instructions/host.rs b/substrate/frame/revive/src/vm/evm/instructions/host.rs index 43111a7ebf3e7..160d6c3d6dd2f 100644 --- a/substrate/frame/revive/src/vm/evm/instructions/host.rs +++ b/substrate/frame/revive/src/vm/evm/instructions/host.rs @@ -15,6 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. use crate::{ + gas::Token, limits, storage::WriteOutcome, vec::Vec, @@ -25,7 +26,7 @@ use crate::{ }, Ext, }, - DispatchError, Error, Key, RuntimeCosts, U256, + DispatchError, Error, Key, RuntimeCosts, LOG_TARGET, U256, }; use core::ops::ControlFlow; @@ -250,7 +251,28 @@ pub fn log<'ext, const N: usize, E: Ext>( /// Implements the SELFDESTRUCT instruction. /// /// Halt execution and register account for later deletion. -pub fn selfdestruct<'ext, E: Ext>(_interpreter: &mut Interpreter<'ext, E>) -> ControlFlow { - // TODO: for now this instruction is not supported - ControlFlow::Break(Error::::InvalidInstruction.into()) +pub fn selfdestruct<'ext, E: Ext>(interpreter: &mut Interpreter<'ext, E>) -> ControlFlow { + if interpreter.ext.is_read_only() { + return ControlFlow::Break(Error::::StateChangeDenied.into()); + } + let [beneficiary] = interpreter.stack.popn()?; + let charged = interpreter.ext.charge_or_halt(RuntimeCosts::Terminate { code_removed: true })?; + let dispatch_result = interpreter.ext.terminate_if_same_tx(&beneficiary.into_address()); + + match dispatch_result { + Ok(code_removed) => { + // halt execution on successful selfdestruct + if matches!(code_removed, crate::CodeRemoved::No) { + let actual_cost = RuntimeCosts::Terminate { code_removed: false }; + interpreter + .ext + .adjust_gas(charged, >::weight(&actual_cost)); + } + ControlFlow::Break(Halt::Return(Vec::default())) + }, + Err(e) => { + log::debug!(target: LOG_TARGET, "Selfdestruct failed: {:?}", e); + ControlFlow::Break(Halt::Err(e)) + }, + } } diff --git a/substrate/frame/revive/src/vm/pvm/env.rs b/substrate/frame/revive/src/vm/pvm/env.rs index 876f96f57d610..6e491c26ae01e 100644 --- a/substrate/frame/revive/src/vm/pvm/env.rs +++ b/substrate/frame/revive/src/vm/pvm/env.rs @@ -915,13 +915,15 @@ pub mod env { } } - /// Remove the calling account and transfer remaining **free** balance. + /// Remove the calling account and transfer remaining balance: + /// **total** balance if code is deleted from storage, else **free** balance only. /// See [`pallet_revive_uapi::HostFn::terminate`]. #[mutating] + #[stable] fn terminate(&mut self, memory: &mut M, beneficiary_ptr: u32) -> Result<(), TrapReason> { let charged = self.charge_gas(RuntimeCosts::Terminate { code_removed: true })?; let beneficiary = memory.read_h160(beneficiary_ptr)?; - if matches!(self.ext.terminate(&beneficiary)?, crate::CodeRemoved::No) { + if matches!(self.ext.terminate_if_same_tx(&beneficiary)?, crate::CodeRemoved::No) { self.adjust_gas(charged, RuntimeCosts::Terminate { code_removed: false }); } Err(TrapReason::Termination) diff --git a/substrate/frame/revive/src/vm/runtime_costs.rs b/substrate/frame/revive/src/vm/runtime_costs.rs index d0b2676cae4f6..d4398406845db 100644 --- a/substrate/frame/revive/src/vm/runtime_costs.rs +++ b/substrate/frame/revive/src/vm/runtime_costs.rs @@ -259,7 +259,15 @@ impl Token for RuntimeCosts { BaseFee => T::WeightInfo::seal_base_fee(), Now => T::WeightInfo::seal_now(), GasLimit => T::WeightInfo::seal_gas_limit(), - Terminate { code_removed } => T::WeightInfo::seal_terminate(code_removed.into()), + Terminate { code_removed } => { + // logic only runs if code is removed + if code_removed { + T::WeightInfo::seal_terminate(code_removed.into()) + .saturating_add(T::WeightInfo::seal_terminate_logic()) + } else { + T::WeightInfo::seal_terminate(code_removed.into()) + } + }, DepositEvent { num_topic, len } => T::WeightInfo::seal_deposit_event(num_topic, len) .saturating_add(T::WeightInfo::on_finalize_block_per_event(len)) .saturating_add(Weight::from_parts( diff --git a/substrate/frame/revive/src/weights.rs b/substrate/frame/revive/src/weights.rs index 76557640e24d4..459ba44ad51b4 100644 --- a/substrate/frame/revive/src/weights.rs +++ b/substrate/frame/revive/src/weights.rs @@ -35,9 +35,9 @@ //! Autogenerated weights for `pallet_revive` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-09-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-10-03, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `881150ca8787`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `986c4e741cbd`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: @@ -119,6 +119,7 @@ pub trait WeightInfo { fn seal_call_data_copy(n: u32, ) -> Weight; fn seal_return(n: u32, ) -> Weight; fn seal_terminate(r: u32, ) -> Weight; + fn seal_terminate_logic() -> Weight; fn seal_deposit_event(t: u32, n: u32, ) -> Weight; fn get_storage_empty() -> Weight; fn get_storage_full() -> Weight; @@ -178,8 +179,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `147` // Estimated: `1632` - // Minimum execution time: 3_043_000 picoseconds. - Weight::from_parts(3_333_000, 1632) + // Minimum execution time: 3_172_000 picoseconds. + Weight::from_parts(3_366_000, 1632) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -189,10 +190,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `458 + k * (69 ±0)` // Estimated: `448 + k * (70 ±0)` - // Minimum execution time: 14_513_000 picoseconds. - Weight::from_parts(14_833_000, 448) - // Standard Error: 919 - .saturating_add(Weight::from_parts(1_192_693, 0).saturating_mul(k.into())) + // Minimum execution time: 14_716_000 picoseconds. + Weight::from_parts(1_865_927, 448) + // Standard Error: 1_184 + .saturating_add(Weight::from_parts(1_211_741, 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)) @@ -216,10 +217,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1172 + c * (1 ±0)` // Estimated: `7107 + c * (1 ±0)` - // Minimum execution time: 90_182_000 picoseconds. - Weight::from_parts(127_351_676, 7107) - // Standard Error: 11 - .saturating_add(Weight::from_parts(1_420, 0).saturating_mul(c.into())) + // Minimum execution time: 89_748_000 picoseconds. + Weight::from_parts(128_346_732, 7107) + // Standard Error: 10 + .saturating_add(Weight::from_parts(1_255, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) @@ -241,10 +242,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1112` // Estimated: `7051` - // Minimum execution time: 84_859_000 picoseconds. - Weight::from_parts(88_351_086, 7051) - // Standard Error: 17 - .saturating_add(Weight::from_parts(105, 0).saturating_mul(c.into())) + // Minimum execution time: 84_280_000 picoseconds. + Weight::from_parts(88_997_361, 7051) + // Standard Error: 23 + .saturating_add(Weight::from_parts(29, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -265,8 +266,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `4516` // Estimated: `10456` - // Minimum execution time: 126_840_000 picoseconds. - Weight::from_parts(131_448_116, 10456) + // Minimum execution time: 127_879_000 picoseconds. + Weight::from_parts(132_688_414, 10456) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -290,12 +291,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `881` // Estimated: `6811` - // Minimum execution time: 759_864_000 picoseconds. - Weight::from_parts(61_804_765, 6811) - // Standard Error: 32 - .saturating_add(Weight::from_parts(19_995, 0).saturating_mul(c.into())) - // Standard Error: 25 - .saturating_add(Weight::from_parts(5_090, 0).saturating_mul(i.into())) + // Minimum execution time: 760_891_000 picoseconds. + Weight::from_parts(80_916_401, 6811) + // Standard Error: 40 + .saturating_add(Weight::from_parts(19_536, 0).saturating_mul(c.into())) + // Standard Error: 31 + .saturating_add(Weight::from_parts(4_870, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -311,8 +312,6 @@ impl WeightInfo for SubstrateWeight { /// 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::EthBlockBuilderIR` (r:1 w:1) - /// Proof: `Revive::EthBlockBuilderIR` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:0 w:1) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `c` is `[0, 102400]`. @@ -322,16 +321,16 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `881` // Estimated: `6821` - // Minimum execution time: 296_703_000 picoseconds. - Weight::from_parts(137_114_517, 6821) - // Standard Error: 41 - .saturating_add(Weight::from_parts(15_152, 0).saturating_mul(c.into())) - // Standard Error: 32 - .saturating_add(Weight::from_parts(771, 0).saturating_mul(i.into())) - // Standard Error: 2_686_368 - .saturating_add(Weight::from_parts(45_575_803, 0).saturating_mul(d.into())) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) + // Minimum execution time: 287_281_000 picoseconds. + Weight::from_parts(188_988_937, 6821) + // Standard Error: 17 + .saturating_add(Weight::from_parts(14_406, 0).saturating_mul(c.into())) + // Standard Error: 13 + .saturating_add(Weight::from_parts(455, 0).saturating_mul(i.into())) + // Standard Error: 1_169_772 + .saturating_add(Weight::from_parts(34_956_293, 0).saturating_mul(d.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(6_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(d.into()))) } /// Storage: `Revive::AccountInfoOf` (r:2 w:1) @@ -351,12 +350,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `i` is `[0, 131072]`. fn instantiate(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1623` - // Estimated: `7552` - // Minimum execution time: 176_685_000 picoseconds. - Weight::from_parts(181_872_822, 7552) - // Standard Error: 11 - .saturating_add(Weight::from_parts(4_273, 0).saturating_mul(i.into())) + // Measured: `1610` + // Estimated: `7553` + // Minimum execution time: 178_541_000 picoseconds. + Weight::from_parts(183_113_115, 7553) + // Standard Error: 10 + .saturating_add(Weight::from_parts(4_171, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -374,10 +373,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: `1794` - // Estimated: `7734` - // Minimum execution time: 92_245_000 picoseconds. - Weight::from_parts(94_466_000, 7734) + // Measured: `1831` + // Estimated: `7771` + // Minimum execution time: 94_101_000 picoseconds. + Weight::from_parts(97_247_000, 7771) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -393,19 +392,17 @@ impl WeightInfo for SubstrateWeight { /// 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::EthBlockBuilderIR` (r:1 w:1) - /// Proof: `Revive::EthBlockBuilderIR` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `d` is `[0, 1]`. fn eth_call(d: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1794` - // Estimated: `7734` - // Minimum execution time: 97_723_000 picoseconds. - Weight::from_parts(101_795_926, 7734) - // Standard Error: 381_733 - .saturating_add(Weight::from_parts(26_168_673, 0).saturating_mul(d.into())) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `1831` + // Estimated: `7771` + // Minimum execution time: 91_981_000 picoseconds. + Weight::from_parts(95_667_365, 7771) + // Standard Error: 354_322 + .saturating_add(Weight::from_parts(26_844_334, 0).saturating_mul(d.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(d.into()))) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) @@ -419,10 +416,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `303` // Estimated: `3768` - // Minimum execution time: 55_275_000 picoseconds. - Weight::from_parts(45_495_493, 3768) - // Standard Error: 19 - .saturating_add(Weight::from_parts(14_273, 0).saturating_mul(c.into())) + // Minimum execution time: 56_823_000 picoseconds. + Weight::from_parts(50_899_286, 3768) + // Standard Error: 17 + .saturating_add(Weight::from_parts(13_871, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -436,8 +433,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `458` // Estimated: `3923` - // Minimum execution time: 52_330_000 picoseconds. - Weight::from_parts(53_410_000, 3923) + // Minimum execution time: 53_007_000 picoseconds. + Weight::from_parts(54_163_000, 3923) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -455,8 +452,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `797` // Estimated: `6737` - // Minimum execution time: 66_325_000 picoseconds. - Weight::from_parts(67_314_000, 6737) + // Minimum execution time: 67_293_000 picoseconds. + Weight::from_parts(69_420_000, 6737) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -468,8 +465,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `510` // Estimated: `3975` - // Minimum execution time: 55_199_000 picoseconds. - Weight::from_parts(56_546_000, 3975) + // Minimum execution time: 56_104_000 picoseconds. + Weight::from_parts(57_331_000, 3975) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -481,8 +478,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `93` // Estimated: `3558` - // Minimum execution time: 39_793_000 picoseconds. - Weight::from_parts(40_493_000, 3558) + // Minimum execution time: 39_974_000 picoseconds. + Weight::from_parts(41_089_000, 3558) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -494,8 +491,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `145` // Estimated: `3610` - // Minimum execution time: 13_187_000 picoseconds. - Weight::from_parts(13_527_000, 3610) + // Minimum execution time: 13_328_000 picoseconds. + Weight::from_parts(13_677_000, 3610) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// The range of component `r` is `[0, 1600]`. @@ -503,24 +500,24 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_332_000 picoseconds. - Weight::from_parts(8_687_708, 0) - // Standard Error: 209 - .saturating_add(Weight::from_parts(173_436, 0).saturating_mul(r.into())) + // Minimum execution time: 7_446_000 picoseconds. + Weight::from_parts(7_434_791, 0) + // Standard Error: 313 + .saturating_add(Weight::from_parts(180_281, 0).saturating_mul(r.into())) } fn seal_caller() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 338_000 picoseconds. - Weight::from_parts(367_000, 0) + // Minimum execution time: 343_000 picoseconds. + Weight::from_parts(364_000, 0) } fn seal_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 328_000 picoseconds. - Weight::from_parts(356_000, 0) + // Minimum execution time: 294_000 picoseconds. + Weight::from_parts(351_000, 0) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `Measured`) @@ -528,8 +525,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `567` // Estimated: `4032` - // Minimum execution time: 8_199_000 picoseconds. - Weight::from_parts(8_624_000, 4032) + // Minimum execution time: 8_157_000 picoseconds. + Weight::from_parts(8_503_000, 4032) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Revive::AccountInfoOf` (r:1 w:0) @@ -538,16 +535,16 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `403` // Estimated: `3868` - // Minimum execution time: 9_064_000 picoseconds. - Weight::from_parts(9_747_000, 3868) + // Minimum execution time: 9_210_000 picoseconds. + Weight::from_parts(9_940_000, 3868) .saturating_add(T::DbWeight::get().reads(1_u64)) } fn own_code_hash() -> Weight { // Proof Size summary in bytes: // Measured: `366` // Estimated: `0` - // Minimum execution time: 6_919_000 picoseconds. - Weight::from_parts(7_280_000, 0) + // Minimum execution time: 7_167_000 picoseconds. + Weight::from_parts(7_441_000, 0) } /// Storage: `Revive::AccountInfoOf` (r:1 w:0) /// Proof: `Revive::AccountInfoOf` (`max_values`: None, `max_size`: Some(247), added: 2722, mode: `Measured`) @@ -557,51 +554,51 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `475` // Estimated: `3940` - // Minimum execution time: 12_795_000 picoseconds. - Weight::from_parts(13_452_000, 3940) + // Minimum execution time: 13_179_000 picoseconds. + Weight::from_parts(13_523_000, 3940) .saturating_add(T::DbWeight::get().reads(2_u64)) } fn caller_is_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_037_000 picoseconds. - Weight::from_parts(1_126_000, 0) + // Minimum execution time: 1_091_000 picoseconds. + Weight::from_parts(1_180_000, 0) } fn caller_is_root() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_044_000 picoseconds. - Weight::from_parts(1_156_000, 0) + // Minimum execution time: 1_111_000 picoseconds. + Weight::from_parts(1_215_000, 0) } fn seal_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 299_000 picoseconds. - Weight::from_parts(359_000, 0) + // Minimum execution time: 293_000 picoseconds. + Weight::from_parts(357_000, 0) } fn weight_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_021_000 picoseconds. - Weight::from_parts(1_120_000, 0) + // Minimum execution time: 1_037_000 picoseconds. + Weight::from_parts(1_134_000, 0) } fn seal_ref_time_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 273_000 picoseconds. - Weight::from_parts(309_000, 0) + // Minimum execution time: 294_000 picoseconds. + Weight::from_parts(329_000, 0) } fn seal_balance() -> Weight { // Proof Size summary in bytes: - // Measured: `469` + // Measured: `540` // Estimated: `0` - // Minimum execution time: 12_068_000 picoseconds. - Weight::from_parts(12_792_000, 0) + // Minimum execution time: 13_035_000 picoseconds. + Weight::from_parts(13_690_000, 0) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `Measured`) @@ -611,10 +608,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Revive::AccountInfoOf` (`max_values`: None, `max_size`: Some(247), added: 2722, mode: `Measured`) fn seal_balance_of() -> Weight { // Proof Size summary in bytes: - // Measured: `791` - // Estimated: `4256` - // Minimum execution time: 18_572_000 picoseconds. - Weight::from_parts(19_484_000, 4256) + // Measured: `824` + // Estimated: `4289` + // Minimum execution time: 19_107_000 picoseconds. + Weight::from_parts(19_609_000, 4289) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: `Revive::ImmutableDataOf` (r:1 w:0) @@ -624,10 +621,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `271 + n * (1 ±0)` // Estimated: `3736 + n * (1 ±0)` - // Minimum execution time: 6_028_000 picoseconds. - Weight::from_parts(6_828_577, 3736) + // Minimum execution time: 5_970_000 picoseconds. + Weight::from_parts(6_876_179, 3736) // Standard Error: 5 - .saturating_add(Weight::from_parts(559, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(494, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -638,67 +635,67 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_938_000 picoseconds. - Weight::from_parts(2_253_391, 0) + // Minimum execution time: 2_125_000 picoseconds. + Weight::from_parts(2_353_652, 0) // Standard Error: 2 - .saturating_add(Weight::from_parts(588, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(520, 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: 272_000 picoseconds. - Weight::from_parts(316_000, 0) + // Minimum execution time: 287_000 picoseconds. + Weight::from_parts(336_000, 0) } fn minimum_balance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_213_000 picoseconds. - Weight::from_parts(1_347_000, 0) + // Minimum execution time: 1_335_000 picoseconds. + Weight::from_parts(1_439_000, 0) } fn seal_return_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 253_000 picoseconds. - Weight::from_parts(282_000, 0) + // Minimum execution time: 265_000 picoseconds. + Weight::from_parts(300_000, 0) } fn seal_call_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 238_000 picoseconds. - Weight::from_parts(283_000, 0) + // Minimum execution time: 269_000 picoseconds. + Weight::from_parts(325_000, 0) } fn seal_gas_limit() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 473_000 picoseconds. - Weight::from_parts(556_000, 0) + // Minimum execution time: 463_000 picoseconds. + Weight::from_parts(522_000, 0) } fn seal_gas_price() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 282_000 picoseconds. - Weight::from_parts(334_000, 0) + // Minimum execution time: 251_000 picoseconds. + Weight::from_parts(310_000, 0) } fn seal_base_fee() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 253_000 picoseconds. - Weight::from_parts(307_000, 0) + // Minimum execution time: 275_000 picoseconds. + Weight::from_parts(298_000, 0) } fn seal_block_number() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 293_000 picoseconds. - Weight::from_parts(341_000, 0) + // Minimum execution time: 235_000 picoseconds. + Weight::from_parts(308_000, 0) } /// Storage: `Session::Validators` (r:1 w:0) /// Proof: `Session::Validators` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -706,96 +703,92 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `141` // Estimated: `1626` - // Minimum execution time: 21_772_000 picoseconds. - Weight::from_parts(22_449_000, 1626) + // Minimum execution time: 22_421_000 picoseconds. + Weight::from_parts(22_893_000, 1626) .saturating_add(T::DbWeight::get().reads(1_u64)) } - /// Storage: `Revive::BlockHash` (r:1 w:0) - /// Proof: `Revive::BlockHash` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `Measured`) /// 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: `295` - // Estimated: `3760` - // Minimum execution time: 8_286_000 picoseconds. - Weight::from_parts(8_872_000, 3760) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `30` + // Estimated: `3495` + // Minimum execution time: 3_655_000 picoseconds. + Weight::from_parts(3_971_000, 3495) + .saturating_add(T::DbWeight::get().reads(1_u64)) } fn seal_now() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 277_000 picoseconds. - Weight::from_parts(315_000, 0) + // Minimum execution time: 306_000 picoseconds. + Weight::from_parts(348_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: 428_000 picoseconds. - Weight::from_parts(41_583, 0) + // Minimum execution time: 436_000 picoseconds. + Weight::from_parts(172_085, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(239, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(202, 0).saturating_mul(n.into())) } fn seal_call_data_load() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 281_000 picoseconds. - Weight::from_parts(314_000, 0) + // Minimum execution time: 260_000 picoseconds. + Weight::from_parts(305_000, 0) } /// The range of component `n` is `[0, 1048576]`. fn seal_call_data_copy(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 257_000 picoseconds. - Weight::from_parts(222_536, 0) + // Minimum execution time: 245_000 picoseconds. + Weight::from_parts(551_388, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(149, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(112, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 131072]`. fn seal_return(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 286_000 picoseconds. - Weight::from_parts(606_042, 0) + // Minimum execution time: 317_000 picoseconds. + Weight::from_parts(478_137, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(235, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(200, 0).saturating_mul(n.into())) + } + /// The range of component `r` is `[0, 1]`. + fn seal_terminate(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `366` + // Estimated: `0` + // Minimum execution time: 6_508_000 picoseconds. + Weight::from_parts(7_066_673, 0) + // Standard Error: 28_385 + .saturating_add(Weight::from_parts(6_926, 0).saturating_mul(r.into())) } - /// Storage: `Revive::OriginalAccount` (r:1 w:0) - /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, 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(97), added: 2572, mode: `Measured`) - /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) + /// Storage: `System::Account` (r:1 w:0) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, 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::PristineCode` (r:0 w:1) - /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: None, 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 `r` is `[0, 1]`. - fn seal_terminate(r: u32, ) -> Weight { + fn seal_terminate_logic() -> Weight { // Proof Size summary in bytes: - // Measured: `583 + r * (368 ±0)` - // Estimated: `4048 + r * (2208 ±0)` - // Minimum execution time: 16_576_000 picoseconds. - Weight::from_parts(17_695_744, 4048) - // Standard Error: 56_646 - .saturating_add(Weight::from_parts(45_062_655, 0).saturating_mul(r.into())) + // Measured: `651` + // Estimated: `4116` + // Minimum execution time: 46_417_000 picoseconds. + Weight::from_parts(47_610_000, 4116) .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(4_u64)) - .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(r.into()))) - .saturating_add(Weight::from_parts(0, 2208).saturating_mul(r.into())) } /// The range of component `t` is `[0, 4]`. /// The range of component `n` is `[0, 416]`. @@ -803,12 +796,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_442_000 picoseconds. - Weight::from_parts(4_542_144, 0) - // Standard Error: 3_564 - .saturating_add(Weight::from_parts(235_217, 0).saturating_mul(t.into())) - // Standard Error: 39 - .saturating_add(Weight::from_parts(1_023, 0).saturating_mul(n.into())) + // Minimum execution time: 4_474_000 picoseconds. + Weight::from_parts(4_393_233, 0) + // Standard Error: 3_393 + .saturating_add(Weight::from_parts(267_475, 0).saturating_mul(t.into())) + // Standard Error: 37 + .saturating_add(Weight::from_parts(1_332, 0).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -816,8 +809,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `648` // Estimated: `648` - // Minimum execution time: 7_336_000 picoseconds. - Weight::from_parts(7_748_000, 648) + // Minimum execution time: 7_174_000 picoseconds. + Weight::from_parts(7_829_000, 648) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -826,8 +819,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `10658` // Estimated: `10658` - // Minimum execution time: 41_574_000 picoseconds. - Weight::from_parts(42_424_000, 10658) + // Minimum execution time: 41_844_000 picoseconds. + Weight::from_parts(43_207_000, 10658) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -836,8 +829,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `648` // Estimated: `648` - // Minimum execution time: 8_294_000 picoseconds. - Weight::from_parts(8_831_000, 648) + // Minimum execution time: 8_774_000 picoseconds. + Weight::from_parts(9_172_000, 648) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -847,8 +840,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `10658` // Estimated: `10658` - // Minimum execution time: 43_327_000 picoseconds. - Weight::from_parts(44_273_000, 10658) + // Minimum execution time: 43_524_000 picoseconds. + Weight::from_parts(45_070_000, 10658) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -860,12 +853,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + o * (1 ±0)` // Estimated: `247 + o * (1 ±0)` - // Minimum execution time: 8_947_000 picoseconds. - Weight::from_parts(9_408_356, 247) - // Standard Error: 62 - .saturating_add(Weight::from_parts(744, 0).saturating_mul(n.into())) - // Standard Error: 62 - .saturating_add(Weight::from_parts(1_420, 0).saturating_mul(o.into())) + // Minimum execution time: 8_957_000 picoseconds. + Weight::from_parts(9_791_356, 247) + // Standard Error: 60 + .saturating_add(Weight::from_parts(426, 0).saturating_mul(n.into())) + // Standard Error: 60 + .saturating_add(Weight::from_parts(825, 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())) @@ -877,10 +870,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_455_000 picoseconds. - Weight::from_parts(9_502_169, 247) - // Standard Error: 71 - .saturating_add(Weight::from_parts(822, 0).saturating_mul(n.into())) + // Minimum execution time: 8_805_000 picoseconds. + Weight::from_parts(9_670_990, 247) + // Standard Error: 75 + .saturating_add(Weight::from_parts(809, 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())) @@ -892,10 +885,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_067_000 picoseconds. - Weight::from_parts(9_250_525, 247) - // Standard Error: 84 - .saturating_add(Weight::from_parts(1_457, 0).saturating_mul(n.into())) + // Minimum execution time: 8_057_000 picoseconds. + Weight::from_parts(9_245_514, 247) + // Standard Error: 80 + .saturating_add(Weight::from_parts(1_894, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -906,10 +899,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 7_687_000 picoseconds. - Weight::from_parts(8_629_827, 247) - // Standard Error: 73 - .saturating_add(Weight::from_parts(711, 0).saturating_mul(n.into())) + // Minimum execution time: 7_704_000 picoseconds. + Weight::from_parts(8_564_996, 247) + // Standard Error: 66 + .saturating_add(Weight::from_parts(943, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -920,10 +913,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 9_123_000 picoseconds. - Weight::from_parts(10_077_753, 247) - // Standard Error: 82 - .saturating_add(Weight::from_parts(1_971, 0).saturating_mul(n.into())) + // Minimum execution time: 9_314_000 picoseconds. + Weight::from_parts(10_433_419, 247) + // Standard Error: 88 + .saturating_add(Weight::from_parts(1_436, 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())) @@ -932,36 +925,36 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_597_000 picoseconds. - Weight::from_parts(1_701_000, 0) + // Minimum execution time: 1_563_000 picoseconds. + Weight::from_parts(1_683_000, 0) } fn set_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_027_000 picoseconds. - Weight::from_parts(2_133_000, 0) + // Minimum execution time: 2_051_000 picoseconds. + Weight::from_parts(2_160_000, 0) } fn get_transient_storage_empty() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_597_000 picoseconds. - Weight::from_parts(1_740_000, 0) + // Minimum execution time: 1_676_000 picoseconds. + Weight::from_parts(1_761_000, 0) } fn get_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_852_000 picoseconds. - Weight::from_parts(1_931_000, 0) + // Minimum execution time: 1_829_000 picoseconds. + Weight::from_parts(1_952_000, 0) } fn rollback_transient_storage() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_220_000 picoseconds. - Weight::from_parts(1_340_000, 0) + // Minimum execution time: 1_275_000 picoseconds. + Weight::from_parts(1_375_000, 0) } /// The range of component `n` is `[0, 416]`. /// The range of component `o` is `[0, 416]`. @@ -969,50 +962,50 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_397_000 picoseconds. - Weight::from_parts(2_745_122, 0) - // Standard Error: 18 - .saturating_add(Weight::from_parts(158, 0).saturating_mul(n.into())) - // Standard Error: 18 - .saturating_add(Weight::from_parts(344, 0).saturating_mul(o.into())) + // Minimum execution time: 2_349_000 picoseconds. + Weight::from_parts(2_395_814, 0) + // Standard Error: 103 + .saturating_add(Weight::from_parts(1_114, 0).saturating_mul(n.into())) + // Standard Error: 103 + .saturating_add(Weight::from_parts(838, 0).saturating_mul(o.into())) } /// 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: 2_039_000 picoseconds. - Weight::from_parts(2_530_835, 0) - // Standard Error: 27 - .saturating_add(Weight::from_parts(440, 0).saturating_mul(n.into())) + // Minimum execution time: 2_195_000 picoseconds. + Weight::from_parts(2_629_931, 0) + // Standard Error: 26 + .saturating_add(Weight::from_parts(261, 0).saturating_mul(n.into())) } /// 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_993_000 picoseconds. - Weight::from_parts(2_296_784, 0) + // Minimum execution time: 2_006_000 picoseconds. + Weight::from_parts(2_323_107, 0) // Standard Error: 20 - .saturating_add(Weight::from_parts(303, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(320, 0).saturating_mul(n.into())) } /// 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_857_000 picoseconds. - Weight::from_parts(2_083_817, 0) - // Standard Error: 17 - .saturating_add(Weight::from_parts(227, 0).saturating_mul(n.into())) + // Minimum execution time: 1_868_000 picoseconds. + Weight::from_parts(2_154_351, 0) + // Standard Error: 19 + .saturating_add(Weight::from_parts(162, 0).saturating_mul(n.into())) } /// 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_707_000 picoseconds. - Weight::from_parts(2_996_712, 0) + // Minimum execution time: 2_764_000 picoseconds. + Weight::from_parts(3_061_726, 0) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `Measured`) @@ -1029,14 +1022,14 @@ impl WeightInfo for SubstrateWeight { /// The range of component `i` is `[0, 1048576]`. fn seal_call(t: u32, d: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1982` - // Estimated: `5447` - // Minimum execution time: 90_029_000 picoseconds. - Weight::from_parts(71_172_970, 5447) - // Standard Error: 169_069 - .saturating_add(Weight::from_parts(19_082_380, 0).saturating_mul(t.into())) - // Standard Error: 169_069 - .saturating_add(Weight::from_parts(24_814_180, 0).saturating_mul(d.into())) + // Measured: `1998` + // Estimated: `5463` + // Minimum execution time: 91_282_000 picoseconds. + Weight::from_parts(70_457_000, 5463) + // Standard Error: 179_620 + .saturating_add(Weight::from_parts(20_096_022, 0).saturating_mul(t.into())) + // Standard Error: 179_620 + .saturating_add(Weight::from_parts(26_414_175, 0).saturating_mul(d.into())) // Standard Error: 0 .saturating_add(Weight::from_parts(4, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) @@ -1053,12 +1046,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `366 + d * (212 ±0)` // Estimated: `2021 + d * (2021 ±0)` - // Minimum execution time: 23_859_000 picoseconds. - Weight::from_parts(12_073_197, 2021) - // Standard Error: 33_668 - .saturating_add(Weight::from_parts(13_492_051, 0).saturating_mul(d.into())) + // Minimum execution time: 24_929_000 picoseconds. + Weight::from_parts(11_931_852, 2021) + // Standard Error: 56_823 + .saturating_add(Weight::from_parts(14_427_014, 0).saturating_mul(d.into())) // Standard Error: 0 - .saturating_add(Weight::from_parts(394, 0).saturating_mul(i.into())) + .saturating_add(Weight::from_parts(324, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(d.into()))) .saturating_add(Weight::from_parts(0, 2021).saturating_mul(d.into())) @@ -1073,8 +1066,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1363` // Estimated: `4828` - // Minimum execution time: 32_493_000 picoseconds. - Weight::from_parts(33_818_000, 4828) + // Minimum execution time: 33_181_000 picoseconds. + Weight::from_parts(33_640_000, 4828) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) @@ -1090,16 +1083,16 @@ impl WeightInfo for SubstrateWeight { /// The range of component `i` is `[0, 131072]`. fn seal_instantiate(t: u32, d: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1394` - // Estimated: `4860` - // Minimum execution time: 149_647_000 picoseconds. - Weight::from_parts(106_282_483, 4860) - // Standard Error: 579_265 - .saturating_add(Weight::from_parts(19_926_931, 0).saturating_mul(t.into())) - // Standard Error: 579_265 - .saturating_add(Weight::from_parts(29_243_692, 0).saturating_mul(d.into())) + // Measured: `1508` + // Estimated: `5012` + // Minimum execution time: 153_430_000 picoseconds. + Weight::from_parts(108_979_481, 5012) + // Standard Error: 520_268 + .saturating_add(Weight::from_parts(21_150_070, 0).saturating_mul(t.into())) + // Standard Error: 520_268 + .saturating_add(Weight::from_parts(29_618_093, 0).saturating_mul(d.into())) // Standard Error: 6 - .saturating_add(Weight::from_parts(4_030, 0).saturating_mul(i.into())) + .saturating_add(Weight::from_parts(3_943, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -1108,118 +1101,118 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_189_000 picoseconds. - Weight::from_parts(13_257_813, 0) + // Minimum execution time: 1_264_000 picoseconds. + Weight::from_parts(12_347_788, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(1_284, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_240, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1048576]`. fn identity(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 727_000 picoseconds. - Weight::from_parts(785_643, 0) + // Minimum execution time: 770_000 picoseconds. + Weight::from_parts(642_533, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(148, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(112, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1048576]`. fn ripemd_160(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_386_000 picoseconds. - Weight::from_parts(5_645_651, 0) - // Standard Error: 0 - .saturating_add(Weight::from_parts(3_766, 0).saturating_mul(n.into())) + // Minimum execution time: 1_286_000 picoseconds. + Weight::from_parts(9_970_063, 0) + // Standard Error: 4 + .saturating_add(Weight::from_parts(3_725, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1048576]`. fn seal_hash_keccak_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_117_000 picoseconds. - Weight::from_parts(12_840_542, 0) + // Minimum execution time: 1_124_000 picoseconds. + Weight::from_parts(13_357_663, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(3_580, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(3_531, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1048576]`. fn hash_blake2_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_644_000 picoseconds. - Weight::from_parts(12_914_994, 0) + // Minimum execution time: 1_677_000 picoseconds. + Weight::from_parts(9_709_495, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(1_447, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_414, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1048576]`. fn hash_blake2_128(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_645_000 picoseconds. - Weight::from_parts(13_618_462, 0) + // Minimum execution time: 1_699_000 picoseconds. + Weight::from_parts(15_011_703, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(1_440, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_409, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1048321]`. fn seal_sr25519_verify(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 42_663_000 picoseconds. - Weight::from_parts(97_917_401, 0) - // Standard Error: 5 - .saturating_add(Weight::from_parts(5_007, 0).saturating_mul(n.into())) + // Minimum execution time: 42_819_000 picoseconds. + Weight::from_parts(82_493_763, 0) + // Standard Error: 4 + .saturating_add(Weight::from_parts(4_898, 0).saturating_mul(n.into())) } fn ecdsa_recover() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 45_593_000 picoseconds. - Weight::from_parts(46_804_000, 0) + // Minimum execution time: 45_437_000 picoseconds. + Weight::from_parts(46_428_000, 0) } fn bn128_add() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 14_802_000 picoseconds. - Weight::from_parts(15_547_000, 0) + // Minimum execution time: 14_765_000 picoseconds. + Weight::from_parts(15_633_000, 0) } fn bn128_mul() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 979_532_000 picoseconds. - Weight::from_parts(985_691_000, 0) + // Minimum execution time: 983_615_000 picoseconds. + Weight::from_parts(993_428_000, 0) } /// The range of component `n` is `[0, 20]`. fn bn128_pairing(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 867_000 picoseconds. - Weight::from_parts(5_007_553_671, 0) - // Standard Error: 10_683_043 - .saturating_add(Weight::from_parts(5_954_606_629, 0).saturating_mul(n.into())) + // Minimum execution time: 888_000 picoseconds. + Weight::from_parts(4_943_399_071, 0) + // Standard Error: 10_458_564 + .saturating_add(Weight::from_parts(5_972_338_278, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1200]`. fn blake2f(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_016_000 picoseconds. - Weight::from_parts(1_223_331, 0) - // Standard Error: 11 - .saturating_add(Weight::from_parts(28_895, 0).saturating_mul(n.into())) + // Minimum execution time: 957_000 picoseconds. + Weight::from_parts(1_298_448, 0) + // Standard Error: 18 + .saturating_add(Weight::from_parts(28_740, 0).saturating_mul(n.into())) } fn seal_ecdsa_to_eth_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_885_000 picoseconds. - Weight::from_parts(13_085_000, 0) + // Minimum execution time: 13_144_000 picoseconds. + Weight::from_parts(13_234_000, 0) } /// Storage: `Revive::CodeInfoOf` (r:2 w:2) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `Measured`) @@ -1234,10 +1227,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `391 + r * (401 ±0)` // Estimated: `6331 + r * (2129 ±0)` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(15_827_097, 6331) - // Standard Error: 54_436 - .saturating_add(Weight::from_parts(45_169_302, 0).saturating_mul(r.into())) + // Minimum execution time: 15_245_000 picoseconds. + Weight::from_parts(16_236_973, 6331) + // Standard Error: 51_905 + .saturating_add(Weight::from_parts(46_482_926, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -1249,30 +1242,30 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_281_000 picoseconds. - Weight::from_parts(1_761_142, 0) - // Standard Error: 28 - .saturating_add(Weight::from_parts(7_240, 0).saturating_mul(r.into())) + // Minimum execution time: 1_159_000 picoseconds. + Weight::from_parts(1_805_350, 0) + // Standard Error: 17 + .saturating_add(Weight::from_parts(6_829, 0).saturating_mul(r.into())) } /// The range of component `r` is `[0, 10000]`. fn instr(r: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_941_000 picoseconds. - Weight::from_parts(47_985_764, 0) - // Standard Error: 501 - .saturating_add(Weight::from_parts(114_377, 0).saturating_mul(r.into())) + // Minimum execution time: 11_932_000 picoseconds. + Weight::from_parts(45_910_362, 0) + // Standard Error: 389 + .saturating_add(Weight::from_parts(106_195, 0).saturating_mul(r.into())) } /// The range of component `r` is `[0, 10000]`. fn instr_empty_loop(r: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_196_000 picoseconds. - Weight::from_parts(2_103_105, 0) - // Standard Error: 57 - .saturating_add(Weight::from_parts(71_986, 0).saturating_mul(r.into())) + // Minimum execution time: 3_350_000 picoseconds. + Weight::from_parts(5_189_068, 0) + // Standard Error: 122 + .saturating_add(Weight::from_parts(71_652, 0).saturating_mul(r.into())) } /// Storage: `Revive::PristineCode` (r:1 w:0) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1281,10 +1274,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `457 + n * (1 ±0)` // Estimated: `3922 + n * (1 ±0)` - // Minimum execution time: 13_694_000 picoseconds. - Weight::from_parts(13_817_772, 3922) - // Standard Error: 6 - .saturating_add(Weight::from_parts(838, 0).saturating_mul(n.into())) + // Minimum execution time: 14_047_000 picoseconds. + Weight::from_parts(13_896_558, 3922) + // Standard Error: 4 + .saturating_add(Weight::from_parts(742, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1296,8 +1289,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `316` // Estimated: `6256` - // Minimum execution time: 12_331_000 picoseconds. - Weight::from_parts(12_562_000, 6256) + // Minimum execution time: 12_469_000 picoseconds. + Weight::from_parts(13_089_000, 6256) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -1311,8 +1304,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `439` // Estimated: `6794` - // Minimum execution time: 62_340_000 picoseconds. - Weight::from_parts(64_756_000, 6794) + // Minimum execution time: 65_203_000 picoseconds. + Weight::from_parts(67_117_000, 6794) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -1420,8 +1413,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `147` // Estimated: `1632` - // Minimum execution time: 3_043_000 picoseconds. - Weight::from_parts(3_333_000, 1632) + // Minimum execution time: 3_172_000 picoseconds. + Weight::from_parts(3_366_000, 1632) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -1431,10 +1424,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `458 + k * (69 ±0)` // Estimated: `448 + k * (70 ±0)` - // Minimum execution time: 14_513_000 picoseconds. - Weight::from_parts(14_833_000, 448) - // Standard Error: 919 - .saturating_add(Weight::from_parts(1_192_693, 0).saturating_mul(k.into())) + // Minimum execution time: 14_716_000 picoseconds. + Weight::from_parts(1_865_927, 448) + // Standard Error: 1_184 + .saturating_add(Weight::from_parts(1_211_741, 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)) @@ -1458,10 +1451,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1172 + c * (1 ±0)` // Estimated: `7107 + c * (1 ±0)` - // Minimum execution time: 90_182_000 picoseconds. - Weight::from_parts(127_351_676, 7107) - // Standard Error: 11 - .saturating_add(Weight::from_parts(1_420, 0).saturating_mul(c.into())) + // Minimum execution time: 89_748_000 picoseconds. + Weight::from_parts(128_346_732, 7107) + // Standard Error: 10 + .saturating_add(Weight::from_parts(1_255, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) @@ -1483,10 +1476,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1112` // Estimated: `7051` - // Minimum execution time: 84_859_000 picoseconds. - Weight::from_parts(88_351_086, 7051) - // Standard Error: 17 - .saturating_add(Weight::from_parts(105, 0).saturating_mul(c.into())) + // Minimum execution time: 84_280_000 picoseconds. + Weight::from_parts(88_997_361, 7051) + // Standard Error: 23 + .saturating_add(Weight::from_parts(29, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1507,8 +1500,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `4516` // Estimated: `10456` - // Minimum execution time: 126_840_000 picoseconds. - Weight::from_parts(131_448_116, 10456) + // Minimum execution time: 127_879_000 picoseconds. + Weight::from_parts(132_688_414, 10456) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1532,12 +1525,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `881` // Estimated: `6811` - // Minimum execution time: 759_864_000 picoseconds. - Weight::from_parts(61_804_765, 6811) - // Standard Error: 32 - .saturating_add(Weight::from_parts(19_995, 0).saturating_mul(c.into())) - // Standard Error: 25 - .saturating_add(Weight::from_parts(5_090, 0).saturating_mul(i.into())) + // Minimum execution time: 760_891_000 picoseconds. + Weight::from_parts(80_916_401, 6811) + // Standard Error: 40 + .saturating_add(Weight::from_parts(19_536, 0).saturating_mul(c.into())) + // Standard Error: 31 + .saturating_add(Weight::from_parts(4_870, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -1553,8 +1546,6 @@ impl WeightInfo for () { /// 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::EthBlockBuilderIR` (r:1 w:1) - /// Proof: `Revive::EthBlockBuilderIR` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:0 w:1) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `c` is `[0, 102400]`. @@ -1564,16 +1555,16 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `881` // Estimated: `6821` - // Minimum execution time: 296_703_000 picoseconds. - Weight::from_parts(137_114_517, 6821) - // Standard Error: 41 - .saturating_add(Weight::from_parts(15_152, 0).saturating_mul(c.into())) - // Standard Error: 32 - .saturating_add(Weight::from_parts(771, 0).saturating_mul(i.into())) - // Standard Error: 2_686_368 - .saturating_add(Weight::from_parts(45_575_803, 0).saturating_mul(d.into())) - .saturating_add(RocksDbWeight::get().reads(9_u64)) - .saturating_add(RocksDbWeight::get().writes(7_u64)) + // Minimum execution time: 287_281_000 picoseconds. + Weight::from_parts(188_988_937, 6821) + // Standard Error: 17 + .saturating_add(Weight::from_parts(14_406, 0).saturating_mul(c.into())) + // Standard Error: 13 + .saturating_add(Weight::from_parts(455, 0).saturating_mul(i.into())) + // Standard Error: 1_169_772 + .saturating_add(Weight::from_parts(34_956_293, 0).saturating_mul(d.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) + .saturating_add(RocksDbWeight::get().writes(6_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(d.into()))) } /// Storage: `Revive::AccountInfoOf` (r:2 w:1) @@ -1593,12 +1584,12 @@ impl WeightInfo for () { /// The range of component `i` is `[0, 131072]`. fn instantiate(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1623` - // Estimated: `7552` - // Minimum execution time: 176_685_000 picoseconds. - Weight::from_parts(181_872_822, 7552) - // Standard Error: 11 - .saturating_add(Weight::from_parts(4_273, 0).saturating_mul(i.into())) + // Measured: `1610` + // Estimated: `7553` + // Minimum execution time: 178_541_000 picoseconds. + Weight::from_parts(183_113_115, 7553) + // Standard Error: 10 + .saturating_add(Weight::from_parts(4_171, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -1616,10 +1607,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: `1794` - // Estimated: `7734` - // Minimum execution time: 92_245_000 picoseconds. - Weight::from_parts(94_466_000, 7734) + // Measured: `1831` + // Estimated: `7771` + // Minimum execution time: 94_101_000 picoseconds. + Weight::from_parts(97_247_000, 7771) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1635,19 +1626,17 @@ impl WeightInfo for () { /// 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::EthBlockBuilderIR` (r:1 w:1) - /// Proof: `Revive::EthBlockBuilderIR` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `d` is `[0, 1]`. fn eth_call(d: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1794` - // Estimated: `7734` - // Minimum execution time: 97_723_000 picoseconds. - Weight::from_parts(101_795_926, 7734) - // Standard Error: 381_733 - .saturating_add(Weight::from_parts(26_168_673, 0).saturating_mul(d.into())) - .saturating_add(RocksDbWeight::get().reads(9_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) + // Measured: `1831` + // Estimated: `7771` + // Minimum execution time: 91_981_000 picoseconds. + Weight::from_parts(95_667_365, 7771) + // Standard Error: 354_322 + .saturating_add(Weight::from_parts(26_844_334, 0).saturating_mul(d.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(d.into()))) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) @@ -1661,10 +1650,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `303` // Estimated: `3768` - // Minimum execution time: 55_275_000 picoseconds. - Weight::from_parts(45_495_493, 3768) - // Standard Error: 19 - .saturating_add(Weight::from_parts(14_273, 0).saturating_mul(c.into())) + // Minimum execution time: 56_823_000 picoseconds. + Weight::from_parts(50_899_286, 3768) + // Standard Error: 17 + .saturating_add(Weight::from_parts(13_871, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1678,8 +1667,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `458` // Estimated: `3923` - // Minimum execution time: 52_330_000 picoseconds. - Weight::from_parts(53_410_000, 3923) + // Minimum execution time: 53_007_000 picoseconds. + Weight::from_parts(54_163_000, 3923) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1697,8 +1686,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `797` // Estimated: `6737` - // Minimum execution time: 66_325_000 picoseconds. - Weight::from_parts(67_314_000, 6737) + // Minimum execution time: 67_293_000 picoseconds. + Weight::from_parts(69_420_000, 6737) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -1710,8 +1699,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `510` // Estimated: `3975` - // Minimum execution time: 55_199_000 picoseconds. - Weight::from_parts(56_546_000, 3975) + // Minimum execution time: 56_104_000 picoseconds. + Weight::from_parts(57_331_000, 3975) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1723,8 +1712,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `93` // Estimated: `3558` - // Minimum execution time: 39_793_000 picoseconds. - Weight::from_parts(40_493_000, 3558) + // Minimum execution time: 39_974_000 picoseconds. + Weight::from_parts(41_089_000, 3558) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1736,8 +1725,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `145` // Estimated: `3610` - // Minimum execution time: 13_187_000 picoseconds. - Weight::from_parts(13_527_000, 3610) + // Minimum execution time: 13_328_000 picoseconds. + Weight::from_parts(13_677_000, 3610) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// The range of component `r` is `[0, 1600]`. @@ -1745,24 +1734,24 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_332_000 picoseconds. - Weight::from_parts(8_687_708, 0) - // Standard Error: 209 - .saturating_add(Weight::from_parts(173_436, 0).saturating_mul(r.into())) + // Minimum execution time: 7_446_000 picoseconds. + Weight::from_parts(7_434_791, 0) + // Standard Error: 313 + .saturating_add(Weight::from_parts(180_281, 0).saturating_mul(r.into())) } fn seal_caller() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 338_000 picoseconds. - Weight::from_parts(367_000, 0) + // Minimum execution time: 343_000 picoseconds. + Weight::from_parts(364_000, 0) } fn seal_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 328_000 picoseconds. - Weight::from_parts(356_000, 0) + // Minimum execution time: 294_000 picoseconds. + Weight::from_parts(351_000, 0) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `Measured`) @@ -1770,8 +1759,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `567` // Estimated: `4032` - // Minimum execution time: 8_199_000 picoseconds. - Weight::from_parts(8_624_000, 4032) + // Minimum execution time: 8_157_000 picoseconds. + Weight::from_parts(8_503_000, 4032) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Revive::AccountInfoOf` (r:1 w:0) @@ -1780,16 +1769,16 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `403` // Estimated: `3868` - // Minimum execution time: 9_064_000 picoseconds. - Weight::from_parts(9_747_000, 3868) + // Minimum execution time: 9_210_000 picoseconds. + Weight::from_parts(9_940_000, 3868) .saturating_add(RocksDbWeight::get().reads(1_u64)) } fn own_code_hash() -> Weight { // Proof Size summary in bytes: // Measured: `366` // Estimated: `0` - // Minimum execution time: 6_919_000 picoseconds. - Weight::from_parts(7_280_000, 0) + // Minimum execution time: 7_167_000 picoseconds. + Weight::from_parts(7_441_000, 0) } /// Storage: `Revive::AccountInfoOf` (r:1 w:0) /// Proof: `Revive::AccountInfoOf` (`max_values`: None, `max_size`: Some(247), added: 2722, mode: `Measured`) @@ -1799,51 +1788,51 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `475` // Estimated: `3940` - // Minimum execution time: 12_795_000 picoseconds. - Weight::from_parts(13_452_000, 3940) + // Minimum execution time: 13_179_000 picoseconds. + Weight::from_parts(13_523_000, 3940) .saturating_add(RocksDbWeight::get().reads(2_u64)) } fn caller_is_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_037_000 picoseconds. - Weight::from_parts(1_126_000, 0) + // Minimum execution time: 1_091_000 picoseconds. + Weight::from_parts(1_180_000, 0) } fn caller_is_root() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_044_000 picoseconds. - Weight::from_parts(1_156_000, 0) + // Minimum execution time: 1_111_000 picoseconds. + Weight::from_parts(1_215_000, 0) } fn seal_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 299_000 picoseconds. - Weight::from_parts(359_000, 0) + // Minimum execution time: 293_000 picoseconds. + Weight::from_parts(357_000, 0) } fn weight_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_021_000 picoseconds. - Weight::from_parts(1_120_000, 0) + // Minimum execution time: 1_037_000 picoseconds. + Weight::from_parts(1_134_000, 0) } fn seal_ref_time_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 273_000 picoseconds. - Weight::from_parts(309_000, 0) + // Minimum execution time: 294_000 picoseconds. + Weight::from_parts(329_000, 0) } fn seal_balance() -> Weight { // Proof Size summary in bytes: - // Measured: `469` + // Measured: `540` // Estimated: `0` - // Minimum execution time: 12_068_000 picoseconds. - Weight::from_parts(12_792_000, 0) + // Minimum execution time: 13_035_000 picoseconds. + Weight::from_parts(13_690_000, 0) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `Measured`) @@ -1853,10 +1842,10 @@ impl WeightInfo for () { /// Proof: `Revive::AccountInfoOf` (`max_values`: None, `max_size`: Some(247), added: 2722, mode: `Measured`) fn seal_balance_of() -> Weight { // Proof Size summary in bytes: - // Measured: `791` - // Estimated: `4256` - // Minimum execution time: 18_572_000 picoseconds. - Weight::from_parts(19_484_000, 4256) + // Measured: `824` + // Estimated: `4289` + // Minimum execution time: 19_107_000 picoseconds. + Weight::from_parts(19_609_000, 4289) .saturating_add(RocksDbWeight::get().reads(3_u64)) } /// Storage: `Revive::ImmutableDataOf` (r:1 w:0) @@ -1866,10 +1855,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `271 + n * (1 ±0)` // Estimated: `3736 + n * (1 ±0)` - // Minimum execution time: 6_028_000 picoseconds. - Weight::from_parts(6_828_577, 3736) + // Minimum execution time: 5_970_000 picoseconds. + Weight::from_parts(6_876_179, 3736) // Standard Error: 5 - .saturating_add(Weight::from_parts(559, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(494, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1880,67 +1869,67 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_938_000 picoseconds. - Weight::from_parts(2_253_391, 0) + // Minimum execution time: 2_125_000 picoseconds. + Weight::from_parts(2_353_652, 0) // Standard Error: 2 - .saturating_add(Weight::from_parts(588, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(520, 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: 272_000 picoseconds. - Weight::from_parts(316_000, 0) + // Minimum execution time: 287_000 picoseconds. + Weight::from_parts(336_000, 0) } fn minimum_balance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_213_000 picoseconds. - Weight::from_parts(1_347_000, 0) + // Minimum execution time: 1_335_000 picoseconds. + Weight::from_parts(1_439_000, 0) } fn seal_return_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 253_000 picoseconds. - Weight::from_parts(282_000, 0) + // Minimum execution time: 265_000 picoseconds. + Weight::from_parts(300_000, 0) } fn seal_call_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 238_000 picoseconds. - Weight::from_parts(283_000, 0) + // Minimum execution time: 269_000 picoseconds. + Weight::from_parts(325_000, 0) } fn seal_gas_limit() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 473_000 picoseconds. - Weight::from_parts(556_000, 0) + // Minimum execution time: 463_000 picoseconds. + Weight::from_parts(522_000, 0) } fn seal_gas_price() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 282_000 picoseconds. - Weight::from_parts(334_000, 0) + // Minimum execution time: 251_000 picoseconds. + Weight::from_parts(310_000, 0) } fn seal_base_fee() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 253_000 picoseconds. - Weight::from_parts(307_000, 0) + // Minimum execution time: 275_000 picoseconds. + Weight::from_parts(298_000, 0) } fn seal_block_number() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 293_000 picoseconds. - Weight::from_parts(341_000, 0) + // Minimum execution time: 235_000 picoseconds. + Weight::from_parts(308_000, 0) } /// Storage: `Session::Validators` (r:1 w:0) /// Proof: `Session::Validators` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -1948,96 +1937,92 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `141` // Estimated: `1626` - // Minimum execution time: 21_772_000 picoseconds. - Weight::from_parts(22_449_000, 1626) + // Minimum execution time: 22_421_000 picoseconds. + Weight::from_parts(22_893_000, 1626) .saturating_add(RocksDbWeight::get().reads(1_u64)) } - /// Storage: `Revive::BlockHash` (r:1 w:0) - /// Proof: `Revive::BlockHash` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `Measured`) /// 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: `295` - // Estimated: `3760` - // Minimum execution time: 8_286_000 picoseconds. - Weight::from_parts(8_872_000, 3760) - .saturating_add(RocksDbWeight::get().reads(2_u64)) + // Measured: `30` + // Estimated: `3495` + // Minimum execution time: 3_655_000 picoseconds. + Weight::from_parts(3_971_000, 3495) + .saturating_add(RocksDbWeight::get().reads(1_u64)) } fn seal_now() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 277_000 picoseconds. - Weight::from_parts(315_000, 0) + // Minimum execution time: 306_000 picoseconds. + Weight::from_parts(348_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: 428_000 picoseconds. - Weight::from_parts(41_583, 0) + // Minimum execution time: 436_000 picoseconds. + Weight::from_parts(172_085, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(239, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(202, 0).saturating_mul(n.into())) } fn seal_call_data_load() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 281_000 picoseconds. - Weight::from_parts(314_000, 0) + // Minimum execution time: 260_000 picoseconds. + Weight::from_parts(305_000, 0) } /// The range of component `n` is `[0, 1048576]`. fn seal_call_data_copy(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 257_000 picoseconds. - Weight::from_parts(222_536, 0) + // Minimum execution time: 245_000 picoseconds. + Weight::from_parts(551_388, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(149, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(112, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 131072]`. fn seal_return(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 286_000 picoseconds. - Weight::from_parts(606_042, 0) + // Minimum execution time: 317_000 picoseconds. + Weight::from_parts(478_137, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(235, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(200, 0).saturating_mul(n.into())) + } + /// The range of component `r` is `[0, 1]`. + fn seal_terminate(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `366` + // Estimated: `0` + // Minimum execution time: 6_508_000 picoseconds. + Weight::from_parts(7_066_673, 0) + // Standard Error: 28_385 + .saturating_add(Weight::from_parts(6_926, 0).saturating_mul(r.into())) } - /// Storage: `Revive::OriginalAccount` (r:1 w:0) - /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, 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(97), added: 2572, mode: `Measured`) - /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) + /// Storage: `System::Account` (r:1 w:0) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, 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::PristineCode` (r:0 w:1) - /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: None, 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 `r` is `[0, 1]`. - fn seal_terminate(r: u32, ) -> Weight { + fn seal_terminate_logic() -> Weight { // Proof Size summary in bytes: - // Measured: `583 + r * (368 ±0)` - // Estimated: `4048 + r * (2208 ±0)` - // Minimum execution time: 16_576_000 picoseconds. - Weight::from_parts(17_695_744, 4048) - // Standard Error: 56_646 - .saturating_add(Weight::from_parts(45_062_655, 0).saturating_mul(r.into())) + // Measured: `651` + // Estimated: `4116` + // Minimum execution time: 46_417_000 picoseconds. + Weight::from_parts(47_610_000, 4116) .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(r.into()))) .saturating_add(RocksDbWeight::get().writes(4_u64)) - .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(r.into()))) - .saturating_add(Weight::from_parts(0, 2208).saturating_mul(r.into())) } /// The range of component `t` is `[0, 4]`. /// The range of component `n` is `[0, 416]`. @@ -2045,12 +2030,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_442_000 picoseconds. - Weight::from_parts(4_542_144, 0) - // Standard Error: 3_564 - .saturating_add(Weight::from_parts(235_217, 0).saturating_mul(t.into())) - // Standard Error: 39 - .saturating_add(Weight::from_parts(1_023, 0).saturating_mul(n.into())) + // Minimum execution time: 4_474_000 picoseconds. + Weight::from_parts(4_393_233, 0) + // Standard Error: 3_393 + .saturating_add(Weight::from_parts(267_475, 0).saturating_mul(t.into())) + // Standard Error: 37 + .saturating_add(Weight::from_parts(1_332, 0).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2058,8 +2043,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `648` // Estimated: `648` - // Minimum execution time: 7_336_000 picoseconds. - Weight::from_parts(7_748_000, 648) + // Minimum execution time: 7_174_000 picoseconds. + Weight::from_parts(7_829_000, 648) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -2068,8 +2053,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `10658` // Estimated: `10658` - // Minimum execution time: 41_574_000 picoseconds. - Weight::from_parts(42_424_000, 10658) + // Minimum execution time: 41_844_000 picoseconds. + Weight::from_parts(43_207_000, 10658) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -2078,8 +2063,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `648` // Estimated: `648` - // Minimum execution time: 8_294_000 picoseconds. - Weight::from_parts(8_831_000, 648) + // Minimum execution time: 8_774_000 picoseconds. + Weight::from_parts(9_172_000, 648) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2089,8 +2074,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `10658` // Estimated: `10658` - // Minimum execution time: 43_327_000 picoseconds. - Weight::from_parts(44_273_000, 10658) + // Minimum execution time: 43_524_000 picoseconds. + Weight::from_parts(45_070_000, 10658) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2102,12 +2087,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + o * (1 ±0)` // Estimated: `247 + o * (1 ±0)` - // Minimum execution time: 8_947_000 picoseconds. - Weight::from_parts(9_408_356, 247) - // Standard Error: 62 - .saturating_add(Weight::from_parts(744, 0).saturating_mul(n.into())) - // Standard Error: 62 - .saturating_add(Weight::from_parts(1_420, 0).saturating_mul(o.into())) + // Minimum execution time: 8_957_000 picoseconds. + Weight::from_parts(9_791_356, 247) + // Standard Error: 60 + .saturating_add(Weight::from_parts(426, 0).saturating_mul(n.into())) + // Standard Error: 60 + .saturating_add(Weight::from_parts(825, 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())) @@ -2119,10 +2104,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_455_000 picoseconds. - Weight::from_parts(9_502_169, 247) - // Standard Error: 71 - .saturating_add(Weight::from_parts(822, 0).saturating_mul(n.into())) + // Minimum execution time: 8_805_000 picoseconds. + Weight::from_parts(9_670_990, 247) + // Standard Error: 75 + .saturating_add(Weight::from_parts(809, 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())) @@ -2134,10 +2119,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_067_000 picoseconds. - Weight::from_parts(9_250_525, 247) - // Standard Error: 84 - .saturating_add(Weight::from_parts(1_457, 0).saturating_mul(n.into())) + // Minimum execution time: 8_057_000 picoseconds. + Weight::from_parts(9_245_514, 247) + // Standard Error: 80 + .saturating_add(Weight::from_parts(1_894, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -2148,10 +2133,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 7_687_000 picoseconds. - Weight::from_parts(8_629_827, 247) - // Standard Error: 73 - .saturating_add(Weight::from_parts(711, 0).saturating_mul(n.into())) + // Minimum execution time: 7_704_000 picoseconds. + Weight::from_parts(8_564_996, 247) + // Standard Error: 66 + .saturating_add(Weight::from_parts(943, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -2162,10 +2147,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 9_123_000 picoseconds. - Weight::from_parts(10_077_753, 247) - // Standard Error: 82 - .saturating_add(Weight::from_parts(1_971, 0).saturating_mul(n.into())) + // Minimum execution time: 9_314_000 picoseconds. + Weight::from_parts(10_433_419, 247) + // Standard Error: 88 + .saturating_add(Weight::from_parts(1_436, 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())) @@ -2174,36 +2159,36 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_597_000 picoseconds. - Weight::from_parts(1_701_000, 0) + // Minimum execution time: 1_563_000 picoseconds. + Weight::from_parts(1_683_000, 0) } fn set_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_027_000 picoseconds. - Weight::from_parts(2_133_000, 0) + // Minimum execution time: 2_051_000 picoseconds. + Weight::from_parts(2_160_000, 0) } fn get_transient_storage_empty() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_597_000 picoseconds. - Weight::from_parts(1_740_000, 0) + // Minimum execution time: 1_676_000 picoseconds. + Weight::from_parts(1_761_000, 0) } fn get_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_852_000 picoseconds. - Weight::from_parts(1_931_000, 0) + // Minimum execution time: 1_829_000 picoseconds. + Weight::from_parts(1_952_000, 0) } fn rollback_transient_storage() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_220_000 picoseconds. - Weight::from_parts(1_340_000, 0) + // Minimum execution time: 1_275_000 picoseconds. + Weight::from_parts(1_375_000, 0) } /// The range of component `n` is `[0, 416]`. /// The range of component `o` is `[0, 416]`. @@ -2211,50 +2196,50 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_397_000 picoseconds. - Weight::from_parts(2_745_122, 0) - // Standard Error: 18 - .saturating_add(Weight::from_parts(158, 0).saturating_mul(n.into())) - // Standard Error: 18 - .saturating_add(Weight::from_parts(344, 0).saturating_mul(o.into())) + // Minimum execution time: 2_349_000 picoseconds. + Weight::from_parts(2_395_814, 0) + // Standard Error: 103 + .saturating_add(Weight::from_parts(1_114, 0).saturating_mul(n.into())) + // Standard Error: 103 + .saturating_add(Weight::from_parts(838, 0).saturating_mul(o.into())) } /// 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: 2_039_000 picoseconds. - Weight::from_parts(2_530_835, 0) - // Standard Error: 27 - .saturating_add(Weight::from_parts(440, 0).saturating_mul(n.into())) + // Minimum execution time: 2_195_000 picoseconds. + Weight::from_parts(2_629_931, 0) + // Standard Error: 26 + .saturating_add(Weight::from_parts(261, 0).saturating_mul(n.into())) } /// 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_993_000 picoseconds. - Weight::from_parts(2_296_784, 0) + // Minimum execution time: 2_006_000 picoseconds. + Weight::from_parts(2_323_107, 0) // Standard Error: 20 - .saturating_add(Weight::from_parts(303, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(320, 0).saturating_mul(n.into())) } /// 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_857_000 picoseconds. - Weight::from_parts(2_083_817, 0) - // Standard Error: 17 - .saturating_add(Weight::from_parts(227, 0).saturating_mul(n.into())) + // Minimum execution time: 1_868_000 picoseconds. + Weight::from_parts(2_154_351, 0) + // Standard Error: 19 + .saturating_add(Weight::from_parts(162, 0).saturating_mul(n.into())) } /// 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_707_000 picoseconds. - Weight::from_parts(2_996_712, 0) + // Minimum execution time: 2_764_000 picoseconds. + Weight::from_parts(3_061_726, 0) } /// Storage: `Revive::OriginalAccount` (r:1 w:0) /// Proof: `Revive::OriginalAccount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `Measured`) @@ -2271,14 +2256,14 @@ impl WeightInfo for () { /// The range of component `i` is `[0, 1048576]`. fn seal_call(t: u32, d: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1982` - // Estimated: `5447` - // Minimum execution time: 90_029_000 picoseconds. - Weight::from_parts(71_172_970, 5447) - // Standard Error: 169_069 - .saturating_add(Weight::from_parts(19_082_380, 0).saturating_mul(t.into())) - // Standard Error: 169_069 - .saturating_add(Weight::from_parts(24_814_180, 0).saturating_mul(d.into())) + // Measured: `1998` + // Estimated: `5463` + // Minimum execution time: 91_282_000 picoseconds. + Weight::from_parts(70_457_000, 5463) + // Standard Error: 179_620 + .saturating_add(Weight::from_parts(20_096_022, 0).saturating_mul(t.into())) + // Standard Error: 179_620 + .saturating_add(Weight::from_parts(26_414_175, 0).saturating_mul(d.into())) // Standard Error: 0 .saturating_add(Weight::from_parts(4, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(5_u64)) @@ -2295,12 +2280,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `366 + d * (212 ±0)` // Estimated: `2021 + d * (2021 ±0)` - // Minimum execution time: 23_859_000 picoseconds. - Weight::from_parts(12_073_197, 2021) - // Standard Error: 33_668 - .saturating_add(Weight::from_parts(13_492_051, 0).saturating_mul(d.into())) + // Minimum execution time: 24_929_000 picoseconds. + Weight::from_parts(11_931_852, 2021) + // Standard Error: 56_823 + .saturating_add(Weight::from_parts(14_427_014, 0).saturating_mul(d.into())) // Standard Error: 0 - .saturating_add(Weight::from_parts(394, 0).saturating_mul(i.into())) + .saturating_add(Weight::from_parts(324, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(d.into()))) .saturating_add(Weight::from_parts(0, 2021).saturating_mul(d.into())) @@ -2315,8 +2300,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1363` // Estimated: `4828` - // Minimum execution time: 32_493_000 picoseconds. - Weight::from_parts(33_818_000, 4828) + // Minimum execution time: 33_181_000 picoseconds. + Weight::from_parts(33_640_000, 4828) .saturating_add(RocksDbWeight::get().reads(3_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) @@ -2332,16 +2317,16 @@ impl WeightInfo for () { /// The range of component `i` is `[0, 131072]`. fn seal_instantiate(t: u32, d: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1394` - // Estimated: `4860` - // Minimum execution time: 149_647_000 picoseconds. - Weight::from_parts(106_282_483, 4860) - // Standard Error: 579_265 - .saturating_add(Weight::from_parts(19_926_931, 0).saturating_mul(t.into())) - // Standard Error: 579_265 - .saturating_add(Weight::from_parts(29_243_692, 0).saturating_mul(d.into())) + // Measured: `1508` + // Estimated: `5012` + // Minimum execution time: 153_430_000 picoseconds. + Weight::from_parts(108_979_481, 5012) + // Standard Error: 520_268 + .saturating_add(Weight::from_parts(21_150_070, 0).saturating_mul(t.into())) + // Standard Error: 520_268 + .saturating_add(Weight::from_parts(29_618_093, 0).saturating_mul(d.into())) // Standard Error: 6 - .saturating_add(Weight::from_parts(4_030, 0).saturating_mul(i.into())) + .saturating_add(Weight::from_parts(3_943, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -2350,118 +2335,118 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_189_000 picoseconds. - Weight::from_parts(13_257_813, 0) + // Minimum execution time: 1_264_000 picoseconds. + Weight::from_parts(12_347_788, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(1_284, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_240, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1048576]`. fn identity(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 727_000 picoseconds. - Weight::from_parts(785_643, 0) + // Minimum execution time: 770_000 picoseconds. + Weight::from_parts(642_533, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(148, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(112, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1048576]`. fn ripemd_160(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_386_000 picoseconds. - Weight::from_parts(5_645_651, 0) - // Standard Error: 0 - .saturating_add(Weight::from_parts(3_766, 0).saturating_mul(n.into())) + // Minimum execution time: 1_286_000 picoseconds. + Weight::from_parts(9_970_063, 0) + // Standard Error: 4 + .saturating_add(Weight::from_parts(3_725, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1048576]`. fn seal_hash_keccak_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_117_000 picoseconds. - Weight::from_parts(12_840_542, 0) + // Minimum execution time: 1_124_000 picoseconds. + Weight::from_parts(13_357_663, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(3_580, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(3_531, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1048576]`. fn hash_blake2_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_644_000 picoseconds. - Weight::from_parts(12_914_994, 0) + // Minimum execution time: 1_677_000 picoseconds. + Weight::from_parts(9_709_495, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(1_447, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_414, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1048576]`. fn hash_blake2_128(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_645_000 picoseconds. - Weight::from_parts(13_618_462, 0) + // Minimum execution time: 1_699_000 picoseconds. + Weight::from_parts(15_011_703, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(1_440, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_409, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1048321]`. fn seal_sr25519_verify(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 42_663_000 picoseconds. - Weight::from_parts(97_917_401, 0) - // Standard Error: 5 - .saturating_add(Weight::from_parts(5_007, 0).saturating_mul(n.into())) + // Minimum execution time: 42_819_000 picoseconds. + Weight::from_parts(82_493_763, 0) + // Standard Error: 4 + .saturating_add(Weight::from_parts(4_898, 0).saturating_mul(n.into())) } fn ecdsa_recover() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 45_593_000 picoseconds. - Weight::from_parts(46_804_000, 0) + // Minimum execution time: 45_437_000 picoseconds. + Weight::from_parts(46_428_000, 0) } fn bn128_add() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 14_802_000 picoseconds. - Weight::from_parts(15_547_000, 0) + // Minimum execution time: 14_765_000 picoseconds. + Weight::from_parts(15_633_000, 0) } fn bn128_mul() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 979_532_000 picoseconds. - Weight::from_parts(985_691_000, 0) + // Minimum execution time: 983_615_000 picoseconds. + Weight::from_parts(993_428_000, 0) } /// The range of component `n` is `[0, 20]`. fn bn128_pairing(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 867_000 picoseconds. - Weight::from_parts(5_007_553_671, 0) - // Standard Error: 10_683_043 - .saturating_add(Weight::from_parts(5_954_606_629, 0).saturating_mul(n.into())) + // Minimum execution time: 888_000 picoseconds. + Weight::from_parts(4_943_399_071, 0) + // Standard Error: 10_458_564 + .saturating_add(Weight::from_parts(5_972_338_278, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 1200]`. fn blake2f(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_016_000 picoseconds. - Weight::from_parts(1_223_331, 0) - // Standard Error: 11 - .saturating_add(Weight::from_parts(28_895, 0).saturating_mul(n.into())) + // Minimum execution time: 957_000 picoseconds. + Weight::from_parts(1_298_448, 0) + // Standard Error: 18 + .saturating_add(Weight::from_parts(28_740, 0).saturating_mul(n.into())) } fn seal_ecdsa_to_eth_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_885_000 picoseconds. - Weight::from_parts(13_085_000, 0) + // Minimum execution time: 13_144_000 picoseconds. + Weight::from_parts(13_234_000, 0) } /// Storage: `Revive::CodeInfoOf` (r:2 w:2) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `Measured`) @@ -2476,10 +2461,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `391 + r * (401 ±0)` // Estimated: `6331 + r * (2129 ±0)` - // Minimum execution time: 15_000_000 picoseconds. - Weight::from_parts(15_827_097, 6331) - // Standard Error: 54_436 - .saturating_add(Weight::from_parts(45_169_302, 0).saturating_mul(r.into())) + // Minimum execution time: 15_245_000 picoseconds. + Weight::from_parts(16_236_973, 6331) + // Standard Error: 51_905 + .saturating_add(Weight::from_parts(46_482_926, 0).saturating_mul(r.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(r.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) @@ -2491,30 +2476,30 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_281_000 picoseconds. - Weight::from_parts(1_761_142, 0) - // Standard Error: 28 - .saturating_add(Weight::from_parts(7_240, 0).saturating_mul(r.into())) + // Minimum execution time: 1_159_000 picoseconds. + Weight::from_parts(1_805_350, 0) + // Standard Error: 17 + .saturating_add(Weight::from_parts(6_829, 0).saturating_mul(r.into())) } /// The range of component `r` is `[0, 10000]`. fn instr(r: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_941_000 picoseconds. - Weight::from_parts(47_985_764, 0) - // Standard Error: 501 - .saturating_add(Weight::from_parts(114_377, 0).saturating_mul(r.into())) + // Minimum execution time: 11_932_000 picoseconds. + Weight::from_parts(45_910_362, 0) + // Standard Error: 389 + .saturating_add(Weight::from_parts(106_195, 0).saturating_mul(r.into())) } /// The range of component `r` is `[0, 10000]`. fn instr_empty_loop(r: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_196_000 picoseconds. - Weight::from_parts(2_103_105, 0) - // Standard Error: 57 - .saturating_add(Weight::from_parts(71_986, 0).saturating_mul(r.into())) + // Minimum execution time: 3_350_000 picoseconds. + Weight::from_parts(5_189_068, 0) + // Standard Error: 122 + .saturating_add(Weight::from_parts(71_652, 0).saturating_mul(r.into())) } /// Storage: `Revive::PristineCode` (r:1 w:0) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -2523,10 +2508,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `457 + n * (1 ±0)` // Estimated: `3922 + n * (1 ±0)` - // Minimum execution time: 13_694_000 picoseconds. - Weight::from_parts(13_817_772, 3922) - // Standard Error: 6 - .saturating_add(Weight::from_parts(838, 0).saturating_mul(n.into())) + // Minimum execution time: 14_047_000 picoseconds. + Weight::from_parts(13_896_558, 3922) + // Standard Error: 4 + .saturating_add(Weight::from_parts(742, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -2538,8 +2523,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `316` // Estimated: `6256` - // Minimum execution time: 12_331_000 picoseconds. - Weight::from_parts(12_562_000, 6256) + // Minimum execution time: 12_469_000 picoseconds. + Weight::from_parts(13_089_000, 6256) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2553,8 +2538,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `439` // Estimated: `6794` - // Minimum execution time: 62_340_000 picoseconds. - Weight::from_parts(64_756_000, 6794) + // Minimum execution time: 65_203_000 picoseconds. + Weight::from_parts(67_117_000, 6794) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } diff --git a/substrate/frame/revive/uapi/src/precompiles/system.rs b/substrate/frame/revive/uapi/src/precompiles/system.rs index e73c9ca05fa29..3c689f716f6bf 100644 --- a/substrate/frame/revive/uapi/src/precompiles/system.rs +++ b/substrate/frame/revive/uapi/src/precompiles/system.rs @@ -66,5 +66,8 @@ sol! { /// Returns the amount of `Weight` left. function weightLeft() external view returns (uint64 refTime, uint64 proofSize); + + /// Terminate the calling contract of this function and send balance to `beneficiary`. + function terminate(address beneficiary) external; } }