diff --git a/prdoc/pr_6105.prdoc b/prdoc/pr_6105.prdoc new file mode 100644 index 0000000000000..f8339c6ce535d --- /dev/null +++ b/prdoc/pr_6105.prdoc @@ -0,0 +1,14 @@ +title: '[pallet-revive] implement tx origin API' + +doc: +- audience: + - Runtime Dev + description: Implement a syscall to retreive the transaction origin. + +crates: +- name: pallet-revive + bump: minor +- name: pallet-revive-uapi + bump: minor +- name: pallet-revive-fixtures + bump: patch diff --git a/substrate/frame/revive/fixtures/contracts/origin.rs b/substrate/frame/revive/fixtures/contracts/origin.rs new file mode 100644 index 0000000000000..8e9afd8e80526 --- /dev/null +++ b/substrate/frame/revive/fixtures/contracts/origin.rs @@ -0,0 +1,62 @@ +// 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. + +//! Tests that the `origin` syscall works. +//! The fixture returns the observed origin if the caller is not the origin, +//! otherwise call itself recursively and assert the returned origin to match. + +#![no_std] +#![no_main] + +extern crate common; +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() { + let mut caller = [0; 20]; + api::caller(&mut caller); + + let mut origin = [0; 20]; + api::origin(&mut origin); + + if caller != origin { + api::return_value(Default::default(), &origin); + } + + let mut addr = [0u8; 20]; + api::address(&mut addr); + + let mut buf = [0u8; 20]; + api::call( + uapi::CallFlags::ALLOW_REENTRY, + &addr, + 0u64, + 0u64, + None, + &[0; 32], + &[], + Some(&mut &mut buf[..]), + ) + .unwrap(); + + assert_eq!(buf, origin); +} diff --git a/substrate/frame/revive/src/benchmarking/mod.rs b/substrate/frame/revive/src/benchmarking/mod.rs index 8c9bf2cf70f02..bf27c660e1a47 100644 --- a/substrate/frame/revive/src/benchmarking/mod.rs +++ b/substrate/frame/revive/src/benchmarking/mod.rs @@ -523,6 +523,24 @@ mod benchmarks { ); } + #[benchmark(pov_mode = Measured)] + fn seal_origin() { + let len = H160::len_bytes(); + build_runtime!(runtime, memory: [vec![0u8; len as _], ]); + + let result; + #[block] + { + result = runtime.bench_origin(memory.as_mut_slice(), 0); + } + + assert_ok!(result); + assert_eq!( + ::decode(&mut &memory[..]).unwrap(), + T::AddressMapper::to_address(&runtime.ext().origin().account_id().unwrap()) + ); + } + #[benchmark(pov_mode = Measured)] fn seal_is_contract() { let Contract { account_id, .. } = diff --git a/substrate/frame/revive/src/exec.rs b/substrate/frame/revive/src/exec.rs index 9f3a75c0090dd..8b9fd660296ef 100644 --- a/substrate/frame/revive/src/exec.rs +++ b/substrate/frame/revive/src/exec.rs @@ -284,6 +284,9 @@ pub trait Ext: sealing::Sealed { /// Returns the caller. fn caller(&self) -> Origin; + /// Return the origin of the whole call stack. + fn origin(&self) -> &Origin; + /// Check if a contract lives at the specified `address`. fn is_contract(&self, address: &H160) -> bool; @@ -1547,6 +1550,10 @@ where } } + fn origin(&self) -> &Origin { + &self.origin + } + fn is_contract(&self, address: &H160) -> bool { ContractInfoOf::::contains_key(&address) } @@ -2381,6 +2388,71 @@ mod tests { assert_eq!(WitnessedCallerCharlie::get(), Some(BOB_ADDR)); } + #[test] + fn origin_returns_proper_values() { + parameter_types! { + static WitnessedCallerBob: Option = None; + static WitnessedCallerCharlie: Option = None; + } + + let bob_ch = MockLoader::insert(Call, |ctx, _| { + // Record the origin for bob. + WitnessedCallerBob::mutate(|witness| { + let origin = ctx.ext.origin(); + *witness = Some(::AddressMapper::to_address( + &origin.account_id().unwrap(), + )); + }); + + // Call into CHARLIE contract. + assert_matches!( + ctx.ext.call( + Weight::zero(), + U256::zero(), + &CHARLIE_ADDR, + U256::zero(), + vec![], + true, + false + ), + Ok(_) + ); + exec_success() + }); + let charlie_ch = MockLoader::insert(Call, |ctx, _| { + // Record the origin for charlie. + WitnessedCallerCharlie::mutate(|witness| { + let origin = ctx.ext.origin(); + *witness = Some(::AddressMapper::to_address( + &origin.account_id().unwrap(), + )); + }); + exec_success() + }); + + ExtBuilder::default().build().execute_with(|| { + place_contract(&BOB, bob_ch); + place_contract(&CHARLIE, charlie_ch); + let origin = Origin::from_account_id(ALICE); + let mut storage_meter = storage::meter::Meter::new(&origin, 0, 0).unwrap(); + + let result = MockStack::run_call( + origin, + BOB_ADDR, + &mut GasMeter::::new(GAS_LIMIT), + &mut storage_meter, + 0, + vec![], + None, + ); + + assert_matches!(result, Ok(_)); + }); + + assert_eq!(WitnessedCallerBob::get(), Some(ALICE_ADDR)); + assert_eq!(WitnessedCallerCharlie::get(), Some(ALICE_ADDR)); + } + #[test] fn is_contract_returns_proper_values() { let bob_ch = MockLoader::insert(Call, |ctx, _| { diff --git a/substrate/frame/revive/src/tests.rs b/substrate/frame/revive/src/tests.rs index 1b5e64739d88f..37167d20a4385 100644 --- a/substrate/frame/revive/src/tests.rs +++ b/substrate/frame/revive/src/tests.rs @@ -4476,6 +4476,22 @@ mod run_tests { }); } + #[test] + fn origin_api_works() { + let (code, _) = compile_module("origin").unwrap(); + + ExtBuilder::default().existential_deposit(100).build().execute_with(|| { + let _ = ::Currency::set_balance(&ALICE, 1_000_000); + + // Create fixture: Constructor does nothing + let Contract { addr, .. } = + builder::bare_instantiate(Code::Upload(code)).build_and_unwrap_contract(); + + // Call the contract: Asserts the origin API to work as expected + assert_ok!(builder::call(addr).build()); + }); + } + #[test] fn code_hash_works() { let (code_hash_code, self_code_hash) = compile_module("code_hash").unwrap(); diff --git a/substrate/frame/revive/src/wasm/runtime.rs b/substrate/frame/revive/src/wasm/runtime.rs index 00be26aeaf8b1..4221498a725c5 100644 --- a/substrate/frame/revive/src/wasm/runtime.rs +++ b/substrate/frame/revive/src/wasm/runtime.rs @@ -291,6 +291,8 @@ pub enum RuntimeCosts { CopyToContract(u32), /// Weight of calling `seal_caller`. Caller, + /// Weight of calling `seal_origin`. + Origin, /// Weight of calling `seal_is_contract`. IsContract, /// Weight of calling `seal_code_hash`. @@ -448,6 +450,7 @@ impl Token for RuntimeCosts { CopyToContract(len) => T::WeightInfo::seal_input(len), CopyFromContract(len) => T::WeightInfo::seal_return(len), Caller => T::WeightInfo::seal_caller(), + Origin => T::WeightInfo::seal_origin(), IsContract => T::WeightInfo::seal_is_contract(), CodeHash => T::WeightInfo::seal_code_hash(), OwnCodeHash => T::WeightInfo::seal_own_code_hash(), @@ -1388,6 +1391,21 @@ pub mod env { )?) } + /// Stores the address of the call stack origin into the supplied buffer. + /// See [`pallet_revive_uapi::HostFn::origin`]. + #[api_version(0)] + fn origin(&mut self, memory: &mut M, out_ptr: u32) -> Result<(), TrapReason> { + self.charge_gas(RuntimeCosts::Origin)?; + let origin = ::AddressMapper::to_address(self.ext.origin().account_id()?); + Ok(self.write_fixed_sandbox_output( + memory, + out_ptr, + origin.as_bytes(), + false, + already_charged, + )?) + } + /// Checks whether a specified address belongs to a contract. /// See [`pallet_revive_uapi::HostFn::is_contract`]. #[api_version(0)] diff --git a/substrate/frame/revive/src/weights.rs b/substrate/frame/revive/src/weights.rs index 3203a0cba9fb9..bf2beb94d7a5b 100644 --- a/substrate/frame/revive/src/weights.rs +++ b/substrate/frame/revive/src/weights.rs @@ -18,9 +18,9 @@ //! Autogenerated weights for `pallet_revive` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-10-16, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-29, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-dr4vwrkf-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `runner-wmcgzesc-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: @@ -63,6 +63,7 @@ pub trait WeightInfo { fn dispatch_as_fallback_account() -> Weight; fn noop_host_fn(r: u32, ) -> Weight; fn seal_caller() -> Weight; + fn seal_origin() -> Weight; fn seal_is_contract() -> Weight; fn seal_code_hash() -> Weight; fn seal_own_code_hash() -> Weight; @@ -129,8 +130,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `109` // Estimated: `1594` - // Minimum execution time: 3_053_000 picoseconds. - Weight::from_parts(3_150_000, 1594) + // Minimum execution time: 3_293_000 picoseconds. + Weight::from_parts(3_530_000, 1594) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -140,10 +141,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `425 + k * (69 ±0)` // Estimated: `415 + k * (70 ±0)` - // Minimum execution time: 15_219_000 picoseconds. - Weight::from_parts(12_576_960, 415) - // Standard Error: 1_429 - .saturating_add(Weight::from_parts(1_341_896, 0).saturating_mul(k.into())) + // Minimum execution time: 16_103_000 picoseconds. + Weight::from_parts(16_692_000, 415) + // Standard Error: 2_700 + .saturating_add(Weight::from_parts(1_493_715, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -163,12 +164,14 @@ impl WeightInfo for SubstrateWeight { /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. - fn call_with_code_per_byte(_c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1519` - // Estimated: `7459` - // Minimum execution time: 88_906_000 picoseconds. - Weight::from_parts(93_353_224, 7459) + fn call_with_code_per_byte(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1561` + // Estimated: `7501` + // Minimum execution time: 98_125_000 picoseconds. + Weight::from_parts(105_486_409, 7501) + // Standard Error: 2 + .saturating_add(Weight::from_parts(4, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -191,11 +194,11 @@ impl WeightInfo for SubstrateWeight { fn instantiate_with_code(_c: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `416` - // Estimated: `6360` - // Minimum execution time: 202_688_000 picoseconds. - Weight::from_parts(197_366_807, 6360) - // Standard Error: 13 - .saturating_add(Weight::from_parts(4_261, 0).saturating_mul(i.into())) + // Estimated: `6348` + // Minimum execution time: 204_069_000 picoseconds. + Weight::from_parts(206_289_328, 6348) + // Standard Error: 16 + .saturating_add(Weight::from_parts(4_438, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -216,12 +219,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `i` is `[0, 262144]`. fn instantiate(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1313` - // Estimated: `4779` - // Minimum execution time: 169_246_000 picoseconds. - Weight::from_parts(149_480_457, 4779) - // Standard Error: 16 - .saturating_add(Weight::from_parts(4_041, 0).saturating_mul(i.into())) + // Measured: `1334` + // Estimated: `4782` + // Minimum execution time: 171_790_000 picoseconds. + Weight::from_parts(152_418_252, 4782) + // Standard Error: 20 + .saturating_add(Weight::from_parts(4_271, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -239,10 +242,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: `1519` - // Estimated: `7459` - // Minimum execution time: 91_129_000 picoseconds. - Weight::from_parts(94_220_000, 7459) + // Measured: `1561` + // Estimated: `7501` + // Minimum execution time: 150_910_000 picoseconds. + Weight::from_parts(163_308_000, 7501) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -253,12 +256,14 @@ impl WeightInfo for SubstrateWeight { /// Storage: `Revive::PristineCode` (r:0 w:1) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. - fn upload_code(_c: u32, ) -> Weight { + fn upload_code(c: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `109` // Estimated: `3574` - // Minimum execution time: 54_849_000 picoseconds. - Weight::from_parts(57_508_591, 3574) + // Minimum execution time: 57_970_000 picoseconds. + Weight::from_parts(62_605_851, 3574) + // Standard Error: 3 + .saturating_add(Weight::from_parts(6, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -272,8 +277,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3750` - // Minimum execution time: 45_017_000 picoseconds. - Weight::from_parts(46_312_000, 3750) + // Minimum execution time: 47_117_000 picoseconds. + Weight::from_parts(48_310_000, 3750) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -285,8 +290,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `529` // Estimated: `6469` - // Minimum execution time: 26_992_000 picoseconds. - Weight::from_parts(28_781_000, 6469) + // Minimum execution time: 30_754_000 picoseconds. + Weight::from_parts(32_046_000, 6469) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -298,8 +303,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `109` // Estimated: `3574` - // Minimum execution time: 44_031_000 picoseconds. - Weight::from_parts(45_133_000, 3574) + // Minimum execution time: 46_338_000 picoseconds. + Weight::from_parts(47_697_000, 3574) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -311,8 +316,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `56` // Estimated: `3521` - // Minimum execution time: 35_681_000 picoseconds. - Weight::from_parts(36_331_000, 3521) + // Minimum execution time: 36_480_000 picoseconds. + Weight::from_parts(37_310_000, 3521) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -324,8 +329,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `145` // Estimated: `3610` - // Minimum execution time: 11_550_000 picoseconds. - Weight::from_parts(12_114_000, 3610) + // Minimum execution time: 12_950_000 picoseconds. + Weight::from_parts(13_431_000, 3610) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// The range of component `r` is `[0, 1600]`. @@ -333,17 +338,24 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_063_000 picoseconds. - Weight::from_parts(7_671_454, 0) - // Standard Error: 105 - .saturating_add(Weight::from_parts(175_349, 0).saturating_mul(r.into())) + // Minimum execution time: 7_540_000 picoseconds. + Weight::from_parts(8_481_295, 0) + // Standard Error: 900 + .saturating_add(Weight::from_parts(183_511, 0).saturating_mul(r.into())) } fn seal_caller() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 266_000 picoseconds. - Weight::from_parts(313_000, 0) + // Minimum execution time: 328_000 picoseconds. + Weight::from_parts(361_000, 0) + } + fn seal_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 272_000 picoseconds. + Weight::from_parts(310_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) @@ -351,8 +363,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `306` // Estimated: `3771` - // Minimum execution time: 7_397_000 picoseconds. - Weight::from_parts(7_967_000, 3771) + // Minimum execution time: 7_755_000 picoseconds. + Weight::from_parts(8_364_000, 3771) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) @@ -361,51 +373,51 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `403` // Estimated: `3868` - // Minimum execution time: 8_395_000 picoseconds. - Weight::from_parts(8_863_000, 3868) + // Minimum execution time: 8_848_000 picoseconds. + Weight::from_parts(9_317_000, 3868) .saturating_add(T::DbWeight::get().reads(1_u64)) } fn seal_own_code_hash() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 265_000 picoseconds. - Weight::from_parts(292_000, 0) + // Minimum execution time: 285_000 picoseconds. + Weight::from_parts(333_000, 0) } fn seal_caller_is_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 298_000 picoseconds. - Weight::from_parts(334_000, 0) + // Minimum execution time: 314_000 picoseconds. + Weight::from_parts(418_000, 0) } fn seal_caller_is_root() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 262_000 picoseconds. - Weight::from_parts(274_000, 0) + // Minimum execution time: 297_000 picoseconds. + Weight::from_parts(353_000, 0) } fn seal_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 277_000 picoseconds. - Weight::from_parts(297_000, 0) + // Minimum execution time: 285_000 picoseconds. + Weight::from_parts(316_000, 0) } fn seal_weight_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 620_000 picoseconds. - Weight::from_parts(706_000, 0) + // Minimum execution time: 676_000 picoseconds. + Weight::from_parts(895_000, 0) } fn seal_balance() -> Weight { // Proof Size summary in bytes: - // Measured: `140` + // Measured: `178` // Estimated: `0` - // Minimum execution time: 5_475_000 picoseconds. - Weight::from_parts(5_706_000, 0) + // Minimum execution time: 6_842_000 picoseconds. + Weight::from_parts(7_790_000, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) @@ -415,8 +427,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `264` // Estimated: `3729` - // Minimum execution time: 9_141_000 picoseconds. - Weight::from_parts(9_674_000, 3729) + // Minimum execution time: 10_982_000 picoseconds. + Weight::from_parts(13_664_000, 3729) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `Revive::ImmutableDataOf` (r:1 w:0) @@ -426,10 +438,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `238 + n * (1 ±0)` // Estimated: `3703 + n * (1 ±0)` - // Minimum execution time: 6_443_000 picoseconds. - Weight::from_parts(7_252_595, 3703) - // Standard Error: 12 - .saturating_add(Weight::from_parts(915, 0).saturating_mul(n.into())) + // Minimum execution time: 6_690_000 picoseconds. + Weight::from_parts(7_522_685, 3703) + // Standard Error: 21 + .saturating_add(Weight::from_parts(1_084, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -440,39 +452,39 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_745_000 picoseconds. - Weight::from_parts(3_121_250, 0) - // Standard Error: 4 - .saturating_add(Weight::from_parts(627, 0).saturating_mul(n.into())) + // Minimum execution time: 3_090_000 picoseconds. + Weight::from_parts(3_585_913, 0) + // Standard Error: 11 + .saturating_add(Weight::from_parts(594, 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: 255_000 picoseconds. - Weight::from_parts(274_000, 0) + // Minimum execution time: 261_000 picoseconds. + Weight::from_parts(305_000, 0) } fn seal_minimum_balance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 235_000 picoseconds. - Weight::from_parts(261_000, 0) + // Minimum execution time: 279_000 picoseconds. + Weight::from_parts(299_000, 0) } fn seal_block_number() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 249_000 picoseconds. - Weight::from_parts(263_000, 0) + // Minimum execution time: 280_000 picoseconds. + Weight::from_parts(317_000, 0) } fn seal_now() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 287_000 picoseconds. - Weight::from_parts(300_000, 0) + // Minimum execution time: 285_000 picoseconds. + Weight::from_parts(313_000, 0) } /// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0) /// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `Measured`) @@ -480,8 +492,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `67` // Estimated: `1552` - // Minimum execution time: 6_147_000 picoseconds. - Weight::from_parts(6_562_000, 1552) + // Minimum execution time: 6_116_000 picoseconds. + Weight::from_parts(6_584_000, 1552) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// The range of component `n` is `[0, 262140]`. @@ -489,20 +501,20 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 453_000 picoseconds. - Weight::from_parts(548_774, 0) + // Minimum execution time: 477_000 picoseconds. + Weight::from_parts(887_560, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(147, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(154, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262140]`. fn seal_return(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 264_000 picoseconds. - Weight::from_parts(490_374, 0) - // Standard Error: 0 - .saturating_add(Weight::from_parts(236, 0).saturating_mul(n.into())) + // Minimum execution time: 315_000 picoseconds. + Weight::from_parts(870_254, 0) + // Standard Error: 1 + .saturating_add(Weight::from_parts(248, 0).saturating_mul(n.into())) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) @@ -518,11 +530,11 @@ impl WeightInfo for SubstrateWeight { fn seal_terminate(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `323 + n * (88 ±0)` - // Estimated: `3788 + n * (2563 ±0)` - // Minimum execution time: 22_833_000 picoseconds. - Weight::from_parts(24_805_620, 3788) - // Standard Error: 9_498 - .saturating_add(Weight::from_parts(4_486_714, 0).saturating_mul(n.into())) + // Estimated: `3789 + n * (2563 ±0)` + // Minimum execution time: 23_098_000 picoseconds. + Weight::from_parts(26_001_186, 3789) + // Standard Error: 23_098 + .saturating_add(Weight::from_parts(4_935_203, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(4_u64)) @@ -535,22 +547,22 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_969_000 picoseconds. - Weight::from_parts(4_994_916, 0) - // Standard Error: 3_727 - .saturating_add(Weight::from_parts(188_374, 0).saturating_mul(t.into())) - // Standard Error: 33 - .saturating_add(Weight::from_parts(925, 0).saturating_mul(n.into())) + // Minimum execution time: 5_271_000 picoseconds. + Weight::from_parts(5_803_969, 0) + // Standard Error: 10_511 + .saturating_add(Weight::from_parts(163_106, 0).saturating_mul(t.into())) + // Standard Error: 93 + .saturating_add(Weight::from_parts(361, 0).saturating_mul(n.into())) } /// The range of component `i` is `[0, 262144]`. fn seal_debug_message(i: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 328_000 picoseconds. - Weight::from_parts(928_905, 0) - // Standard Error: 1 - .saturating_add(Weight::from_parts(753, 0).saturating_mul(i.into())) + // Minimum execution time: 375_000 picoseconds. + Weight::from_parts(1_601_309, 0) + // Standard Error: 3 + .saturating_add(Weight::from_parts(787, 0).saturating_mul(i.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -558,8 +570,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `744` // Estimated: `744` - // Minimum execution time: 8_612_000 picoseconds. - Weight::from_parts(9_326_000, 744) + // Minimum execution time: 9_557_000 picoseconds. + Weight::from_parts(10_131_000, 744) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -568,8 +580,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `10754` // Estimated: `10754` - // Minimum execution time: 44_542_000 picoseconds. - Weight::from_parts(45_397_000, 10754) + // Minimum execution time: 45_601_000 picoseconds. + Weight::from_parts(46_296_000, 10754) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -578,8 +590,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `744` // Estimated: `744` - // Minimum execution time: 10_343_000 picoseconds. - Weight::from_parts(10_883_000, 744) + // Minimum execution time: 10_718_000 picoseconds. + Weight::from_parts(12_282_000, 744) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -589,8 +601,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `10754` // Estimated: `10754` - // Minimum execution time: 46_835_000 picoseconds. - Weight::from_parts(47_446_000, 10754) + // Minimum execution time: 47_580_000 picoseconds. + Weight::from_parts(50_301_000, 10754) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -602,12 +614,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + o * (1 ±0)` // Estimated: `247 + o * (1 ±0)` - // Minimum execution time: 10_604_000 picoseconds. - Weight::from_parts(11_282_849, 247) - // Standard Error: 48 - .saturating_add(Weight::from_parts(496, 0).saturating_mul(n.into())) - // Standard Error: 48 - .saturating_add(Weight::from_parts(764, 0).saturating_mul(o.into())) + // Minimum execution time: 11_483_000 picoseconds. + Weight::from_parts(13_084_262, 247) + // Standard Error: 218 + .saturating_add(Weight::from_parts(83, 0).saturating_mul(n.into())) + // Standard Error: 218 + .saturating_add(Weight::from_parts(683, 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())) @@ -619,10 +631,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 10_081_000 picoseconds. - Weight::from_parts(11_186_557, 247) - // Standard Error: 68 - .saturating_add(Weight::from_parts(782, 0).saturating_mul(n.into())) + // Minimum execution time: 10_972_000 picoseconds. + Weight::from_parts(12_960_831, 247) .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())) @@ -634,10 +644,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_758_000 picoseconds. - Weight::from_parts(9_939_492, 247) - // Standard Error: 69 - .saturating_add(Weight::from_parts(1_703, 0).saturating_mul(n.into())) + // Minimum execution time: 9_989_000 picoseconds. + Weight::from_parts(12_783_294, 247) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -648,10 +656,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_525_000 picoseconds. - Weight::from_parts(9_522_265, 247) - // Standard Error: 66 - .saturating_add(Weight::from_parts(426, 0).saturating_mul(n.into())) + // Minimum execution time: 9_732_000 picoseconds. + Weight::from_parts(11_156_576, 247) + // Standard Error: 255 + .saturating_add(Weight::from_parts(1_956, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -662,10 +670,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 10_603_000 picoseconds. - Weight::from_parts(11_817_752, 247) - // Standard Error: 82 - .saturating_add(Weight::from_parts(1_279, 0).saturating_mul(n.into())) + // Minimum execution time: 10_883_000 picoseconds. + Weight::from_parts(13_454_925, 247) + // Standard Error: 276 + .saturating_add(Weight::from_parts(1_509, 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())) @@ -674,36 +682,36 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_553_000 picoseconds. - Weight::from_parts(1_615_000, 0) + // Minimum execution time: 1_586_000 picoseconds. + Weight::from_parts(1_869_000, 0) } fn set_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_932_000 picoseconds. - Weight::from_parts(2_064_000, 0) + // Minimum execution time: 1_997_000 picoseconds. + Weight::from_parts(2_093_000, 0) } fn get_transient_storage_empty() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_510_000 picoseconds. - Weight::from_parts(1_545_000, 0) + // Minimum execution time: 1_531_000 picoseconds. + Weight::from_parts(1_734_000, 0) } fn get_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_663_000 picoseconds. - Weight::from_parts(1_801_000, 0) + // Minimum execution time: 1_635_000 picoseconds. + Weight::from_parts(1_880_000, 0) } fn rollback_transient_storage() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_026_000 picoseconds. - Weight::from_parts(1_137_000, 0) + // Minimum execution time: 1_192_000 picoseconds. + Weight::from_parts(1_339_000, 0) } /// The range of component `n` is `[0, 512]`. /// The range of component `o` is `[0, 512]`. @@ -711,59 +719,59 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_446_000 picoseconds. - Weight::from_parts(2_644_525, 0) - // Standard Error: 17 - .saturating_add(Weight::from_parts(113, 0).saturating_mul(n.into())) - // Standard Error: 17 - .saturating_add(Weight::from_parts(179, 0).saturating_mul(o.into())) + // Minimum execution time: 2_294_000 picoseconds. + Weight::from_parts(2_848_884, 0) + // Standard Error: 53 + .saturating_add(Weight::from_parts(176, 0).saturating_mul(n.into())) + // Standard Error: 53 + .saturating_add(Weight::from_parts(148, 0).saturating_mul(o.into())) } /// The range of component `n` is `[0, 512]`. fn seal_clear_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_085_000 picoseconds. - Weight::from_parts(2_379_853, 0) - // Standard Error: 19 - .saturating_add(Weight::from_parts(366, 0).saturating_mul(n.into())) + // Minimum execution time: 2_073_000 picoseconds. + Weight::from_parts(2_670_081, 0) + // Standard Error: 64 + .saturating_add(Weight::from_parts(270, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 512]`. fn seal_get_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_876_000 picoseconds. - Weight::from_parts(2_073_689, 0) - // Standard Error: 16 - .saturating_add(Weight::from_parts(376, 0).saturating_mul(n.into())) + // Minimum execution time: 1_879_000 picoseconds. + Weight::from_parts(2_294_904, 0) + // Standard Error: 55 + .saturating_add(Weight::from_parts(481, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 512]`. fn seal_contains_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_688_000 picoseconds. - Weight::from_parts(1_914_470, 0) - // Standard Error: 15 - .saturating_add(Weight::from_parts(125, 0).saturating_mul(n.into())) + // Minimum execution time: 1_711_000 picoseconds. + Weight::from_parts(2_151_924, 0) + // Standard Error: 56 + .saturating_add(Weight::from_parts(98, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 512]`. fn seal_take_transient_storage(_n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_479_000 picoseconds. - Weight::from_parts(2_758_250, 0) + // Minimum execution time: 2_615_000 picoseconds. + Weight::from_parts(3_050_600, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) fn seal_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `352` - // Estimated: `3817` - // Minimum execution time: 15_745_000 picoseconds. - Weight::from_parts(16_300_000, 3817) + // Measured: `390` + // Estimated: `3855` + // Minimum execution time: 18_629_000 picoseconds. + Weight::from_parts(19_520_000, 3855) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) @@ -778,17 +786,15 @@ impl WeightInfo for SubstrateWeight { /// The range of component `i` is `[0, 262144]`. fn seal_call(t: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1309 + t * (140 ±0)` - // Estimated: `4774 + t * (140 ±0)` - // Minimum execution time: 39_639_000 picoseconds. - Weight::from_parts(40_909_376, 4774) - // Standard Error: 54_479 - .saturating_add(Weight::from_parts(1_526_185, 0).saturating_mul(t.into())) - // Standard Error: 0 - .saturating_add(Weight::from_parts(4, 0).saturating_mul(i.into())) + // Measured: `1319 + t * (178 ±0)` + // Estimated: `4784 + t * (178 ±0)` + // Minimum execution time: 43_655_000 picoseconds. + Weight::from_parts(50_252_813, 4784) + // Standard Error: 1 + .saturating_add(Weight::from_parts(1, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_parts(0, 140).saturating_mul(t.into())) + .saturating_add(Weight::from_parts(0, 178).saturating_mul(t.into())) } /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) @@ -796,10 +802,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) fn seal_delegate_call() -> Weight { // Proof Size summary in bytes: - // Measured: `1081` - // Estimated: `4546` - // Minimum execution time: 29_651_000 picoseconds. - Weight::from_parts(31_228_000, 4546) + // Measured: `1089` + // Estimated: `4554` + // Minimum execution time: 31_153_000 picoseconds. + Weight::from_parts(33_625_000, 4554) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) @@ -813,12 +819,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `i` is `[0, 262144]`. fn seal_instantiate(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1327` - // Estimated: `4792` - // Minimum execution time: 126_995_000 picoseconds. - Weight::from_parts(114_028_446, 4792) - // Standard Error: 11 - .saturating_add(Weight::from_parts(3_781, 0).saturating_mul(i.into())) + // Measured: `1360` + // Estimated: `4814` + // Minimum execution time: 130_134_000 picoseconds. + Weight::from_parts(120_699_282, 4814) + // Standard Error: 20 + .saturating_add(Weight::from_parts(4_054, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -827,64 +833,64 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 653_000 picoseconds. - Weight::from_parts(973_524, 0) - // Standard Error: 0 - .saturating_add(Weight::from_parts(1_048, 0).saturating_mul(n.into())) + // Minimum execution time: 665_000 picoseconds. + Weight::from_parts(1_964_310, 0) + // Standard Error: 4 + .saturating_add(Weight::from_parts(1_091, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_keccak_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_118_000 picoseconds. - Weight::from_parts(795_498, 0) - // Standard Error: 1 - .saturating_add(Weight::from_parts(3_260, 0).saturating_mul(n.into())) + // Minimum execution time: 1_245_000 picoseconds. + Weight::from_parts(2_362_235, 0) + // Standard Error: 10 + .saturating_add(Weight::from_parts(3_360, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_blake2_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 647_000 picoseconds. - Weight::from_parts(667_024, 0) - // Standard Error: 0 - .saturating_add(Weight::from_parts(1_183, 0).saturating_mul(n.into())) + // Minimum execution time: 668_000 picoseconds. + Weight::from_parts(1_216_363, 0) + // Standard Error: 4 + .saturating_add(Weight::from_parts(1_231, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_blake2_128(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 605_000 picoseconds. - Weight::from_parts(675_568, 0) - // Standard Error: 0 - .saturating_add(Weight::from_parts(1_181, 0).saturating_mul(n.into())) + // Minimum execution time: 702_000 picoseconds. + Weight::from_parts(1_283_345, 0) + // Standard Error: 5 + .saturating_add(Weight::from_parts(1_230, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 261889]`. fn seal_sr25519_verify(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 42_743_000 picoseconds. - Weight::from_parts(26_131_984, 0) - // Standard Error: 15 - .saturating_add(Weight::from_parts(4_867, 0).saturating_mul(n.into())) + // Minimum execution time: 45_690_000 picoseconds. + Weight::from_parts(28_207_599, 0) + // Standard Error: 18 + .saturating_add(Weight::from_parts(5_142, 0).saturating_mul(n.into())) } fn seal_ecdsa_recover() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 50_838_000 picoseconds. - Weight::from_parts(52_248_000, 0) + // Minimum execution time: 51_869_000 picoseconds. + Weight::from_parts(56_118_000, 0) } fn seal_ecdsa_to_eth_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_605_000 picoseconds. - Weight::from_parts(12_796_000, 0) + // Minimum execution time: 12_927_000 picoseconds. + Weight::from_parts(13_256_000, 0) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) @@ -892,8 +898,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `300` // Estimated: `3765` - // Minimum execution time: 16_377_000 picoseconds. - Weight::from_parts(16_932_000, 3765) + // Minimum execution time: 16_969_000 picoseconds. + Weight::from_parts(17_796_000, 3765) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -903,8 +909,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `338` // Estimated: `3803` - // Minimum execution time: 11_499_000 picoseconds. - Weight::from_parts(12_104_000, 3803) + // Minimum execution time: 11_827_000 picoseconds. + Weight::from_parts(13_675_000, 3803) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -914,8 +920,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `338` // Estimated: `3561` - // Minimum execution time: 10_308_000 picoseconds. - Weight::from_parts(11_000_000, 3561) + // Minimum execution time: 10_529_000 picoseconds. + Weight::from_parts(12_080_000, 3561) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -924,10 +930,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_162_000 picoseconds. - Weight::from_parts(9_180_011, 0) - // Standard Error: 63 - .saturating_add(Weight::from_parts(84_822, 0).saturating_mul(r.into())) + // Minimum execution time: 8_269_000 picoseconds. + Weight::from_parts(11_148_702, 0) + // Standard Error: 366 + .saturating_add(Weight::from_parts(87_469, 0).saturating_mul(r.into())) } } @@ -939,8 +945,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `109` // Estimated: `1594` - // Minimum execution time: 3_053_000 picoseconds. - Weight::from_parts(3_150_000, 1594) + // Minimum execution time: 3_293_000 picoseconds. + Weight::from_parts(3_530_000, 1594) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -950,10 +956,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `425 + k * (69 ±0)` // Estimated: `415 + k * (70 ±0)` - // Minimum execution time: 15_219_000 picoseconds. - Weight::from_parts(12_576_960, 415) - // Standard Error: 1_429 - .saturating_add(Weight::from_parts(1_341_896, 0).saturating_mul(k.into())) + // Minimum execution time: 16_103_000 picoseconds. + Weight::from_parts(16_692_000, 415) + // Standard Error: 2_700 + .saturating_add(Weight::from_parts(1_493_715, 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)) @@ -973,12 +979,14 @@ impl WeightInfo for () { /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. - fn call_with_code_per_byte(_c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1519` - // Estimated: `7459` - // Minimum execution time: 88_906_000 picoseconds. - Weight::from_parts(93_353_224, 7459) + fn call_with_code_per_byte(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1561` + // Estimated: `7501` + // Minimum execution time: 98_125_000 picoseconds. + Weight::from_parts(105_486_409, 7501) + // Standard Error: 2 + .saturating_add(Weight::from_parts(4, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1001,11 +1009,11 @@ impl WeightInfo for () { fn instantiate_with_code(_c: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `416` - // Estimated: `6360` - // Minimum execution time: 202_688_000 picoseconds. - Weight::from_parts(197_366_807, 6360) - // Standard Error: 13 - .saturating_add(Weight::from_parts(4_261, 0).saturating_mul(i.into())) + // Estimated: `6348` + // Minimum execution time: 204_069_000 picoseconds. + Weight::from_parts(206_289_328, 6348) + // Standard Error: 16 + .saturating_add(Weight::from_parts(4_438, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -1026,12 +1034,12 @@ impl WeightInfo for () { /// The range of component `i` is `[0, 262144]`. fn instantiate(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1313` - // Estimated: `4779` - // Minimum execution time: 169_246_000 picoseconds. - Weight::from_parts(149_480_457, 4779) - // Standard Error: 16 - .saturating_add(Weight::from_parts(4_041, 0).saturating_mul(i.into())) + // Measured: `1334` + // Estimated: `4782` + // Minimum execution time: 171_790_000 picoseconds. + Weight::from_parts(152_418_252, 4782) + // Standard Error: 20 + .saturating_add(Weight::from_parts(4_271, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -1049,10 +1057,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: `1519` - // Estimated: `7459` - // Minimum execution time: 91_129_000 picoseconds. - Weight::from_parts(94_220_000, 7459) + // Measured: `1561` + // Estimated: `7501` + // Minimum execution time: 150_910_000 picoseconds. + Weight::from_parts(163_308_000, 7501) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1063,12 +1071,14 @@ impl WeightInfo for () { /// Storage: `Revive::PristineCode` (r:0 w:1) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. - fn upload_code(_c: u32, ) -> Weight { + fn upload_code(c: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `109` // Estimated: `3574` - // Minimum execution time: 54_849_000 picoseconds. - Weight::from_parts(57_508_591, 3574) + // Minimum execution time: 57_970_000 picoseconds. + Weight::from_parts(62_605_851, 3574) + // Standard Error: 3 + .saturating_add(Weight::from_parts(6, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1082,8 +1092,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3750` - // Minimum execution time: 45_017_000 picoseconds. - Weight::from_parts(46_312_000, 3750) + // Minimum execution time: 47_117_000 picoseconds. + Weight::from_parts(48_310_000, 3750) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1095,8 +1105,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `529` // Estimated: `6469` - // Minimum execution time: 26_992_000 picoseconds. - Weight::from_parts(28_781_000, 6469) + // Minimum execution time: 30_754_000 picoseconds. + Weight::from_parts(32_046_000, 6469) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1108,8 +1118,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `109` // Estimated: `3574` - // Minimum execution time: 44_031_000 picoseconds. - Weight::from_parts(45_133_000, 3574) + // Minimum execution time: 46_338_000 picoseconds. + Weight::from_parts(47_697_000, 3574) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1121,8 +1131,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `56` // Estimated: `3521` - // Minimum execution time: 35_681_000 picoseconds. - Weight::from_parts(36_331_000, 3521) + // Minimum execution time: 36_480_000 picoseconds. + Weight::from_parts(37_310_000, 3521) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1134,8 +1144,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `145` // Estimated: `3610` - // Minimum execution time: 11_550_000 picoseconds. - Weight::from_parts(12_114_000, 3610) + // Minimum execution time: 12_950_000 picoseconds. + Weight::from_parts(13_431_000, 3610) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// The range of component `r` is `[0, 1600]`. @@ -1143,17 +1153,24 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_063_000 picoseconds. - Weight::from_parts(7_671_454, 0) - // Standard Error: 105 - .saturating_add(Weight::from_parts(175_349, 0).saturating_mul(r.into())) + // Minimum execution time: 7_540_000 picoseconds. + Weight::from_parts(8_481_295, 0) + // Standard Error: 900 + .saturating_add(Weight::from_parts(183_511, 0).saturating_mul(r.into())) } fn seal_caller() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 266_000 picoseconds. - Weight::from_parts(313_000, 0) + // Minimum execution time: 328_000 picoseconds. + Weight::from_parts(361_000, 0) + } + fn seal_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 272_000 picoseconds. + Weight::from_parts(310_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) @@ -1161,8 +1178,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `306` // Estimated: `3771` - // Minimum execution time: 7_397_000 picoseconds. - Weight::from_parts(7_967_000, 3771) + // Minimum execution time: 7_755_000 picoseconds. + Weight::from_parts(8_364_000, 3771) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) @@ -1171,51 +1188,51 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `403` // Estimated: `3868` - // Minimum execution time: 8_395_000 picoseconds. - Weight::from_parts(8_863_000, 3868) + // Minimum execution time: 8_848_000 picoseconds. + Weight::from_parts(9_317_000, 3868) .saturating_add(RocksDbWeight::get().reads(1_u64)) } fn seal_own_code_hash() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 265_000 picoseconds. - Weight::from_parts(292_000, 0) + // Minimum execution time: 285_000 picoseconds. + Weight::from_parts(333_000, 0) } fn seal_caller_is_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 298_000 picoseconds. - Weight::from_parts(334_000, 0) + // Minimum execution time: 314_000 picoseconds. + Weight::from_parts(418_000, 0) } fn seal_caller_is_root() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 262_000 picoseconds. - Weight::from_parts(274_000, 0) + // Minimum execution time: 297_000 picoseconds. + Weight::from_parts(353_000, 0) } fn seal_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 277_000 picoseconds. - Weight::from_parts(297_000, 0) + // Minimum execution time: 285_000 picoseconds. + Weight::from_parts(316_000, 0) } fn seal_weight_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 620_000 picoseconds. - Weight::from_parts(706_000, 0) + // Minimum execution time: 676_000 picoseconds. + Weight::from_parts(895_000, 0) } fn seal_balance() -> Weight { // Proof Size summary in bytes: - // Measured: `140` + // Measured: `178` // Estimated: `0` - // Minimum execution time: 5_475_000 picoseconds. - Weight::from_parts(5_706_000, 0) + // Minimum execution time: 6_842_000 picoseconds. + Weight::from_parts(7_790_000, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) @@ -1225,8 +1242,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `264` // Estimated: `3729` - // Minimum execution time: 9_141_000 picoseconds. - Weight::from_parts(9_674_000, 3729) + // Minimum execution time: 10_982_000 picoseconds. + Weight::from_parts(13_664_000, 3729) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `Revive::ImmutableDataOf` (r:1 w:0) @@ -1236,10 +1253,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `238 + n * (1 ±0)` // Estimated: `3703 + n * (1 ±0)` - // Minimum execution time: 6_443_000 picoseconds. - Weight::from_parts(7_252_595, 3703) - // Standard Error: 12 - .saturating_add(Weight::from_parts(915, 0).saturating_mul(n.into())) + // Minimum execution time: 6_690_000 picoseconds. + Weight::from_parts(7_522_685, 3703) + // Standard Error: 21 + .saturating_add(Weight::from_parts(1_084, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1250,39 +1267,39 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_745_000 picoseconds. - Weight::from_parts(3_121_250, 0) - // Standard Error: 4 - .saturating_add(Weight::from_parts(627, 0).saturating_mul(n.into())) + // Minimum execution time: 3_090_000 picoseconds. + Weight::from_parts(3_585_913, 0) + // Standard Error: 11 + .saturating_add(Weight::from_parts(594, 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: 255_000 picoseconds. - Weight::from_parts(274_000, 0) + // Minimum execution time: 261_000 picoseconds. + Weight::from_parts(305_000, 0) } fn seal_minimum_balance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 235_000 picoseconds. - Weight::from_parts(261_000, 0) + // Minimum execution time: 279_000 picoseconds. + Weight::from_parts(299_000, 0) } fn seal_block_number() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 249_000 picoseconds. - Weight::from_parts(263_000, 0) + // Minimum execution time: 280_000 picoseconds. + Weight::from_parts(317_000, 0) } fn seal_now() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 287_000 picoseconds. - Weight::from_parts(300_000, 0) + // Minimum execution time: 285_000 picoseconds. + Weight::from_parts(313_000, 0) } /// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0) /// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `Measured`) @@ -1290,8 +1307,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `67` // Estimated: `1552` - // Minimum execution time: 6_147_000 picoseconds. - Weight::from_parts(6_562_000, 1552) + // Minimum execution time: 6_116_000 picoseconds. + Weight::from_parts(6_584_000, 1552) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// The range of component `n` is `[0, 262140]`. @@ -1299,20 +1316,20 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 453_000 picoseconds. - Weight::from_parts(548_774, 0) + // Minimum execution time: 477_000 picoseconds. + Weight::from_parts(887_560, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(147, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(154, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262140]`. fn seal_return(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 264_000 picoseconds. - Weight::from_parts(490_374, 0) - // Standard Error: 0 - .saturating_add(Weight::from_parts(236, 0).saturating_mul(n.into())) + // Minimum execution time: 315_000 picoseconds. + Weight::from_parts(870_254, 0) + // Standard Error: 1 + .saturating_add(Weight::from_parts(248, 0).saturating_mul(n.into())) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) @@ -1328,11 +1345,11 @@ impl WeightInfo for () { fn seal_terminate(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `323 + n * (88 ±0)` - // Estimated: `3788 + n * (2563 ±0)` - // Minimum execution time: 22_833_000 picoseconds. - Weight::from_parts(24_805_620, 3788) - // Standard Error: 9_498 - .saturating_add(Weight::from_parts(4_486_714, 0).saturating_mul(n.into())) + // Estimated: `3789 + n * (2563 ±0)` + // Minimum execution time: 23_098_000 picoseconds. + Weight::from_parts(26_001_186, 3789) + // Standard Error: 23_098 + .saturating_add(Weight::from_parts(4_935_203, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(RocksDbWeight::get().writes(4_u64)) @@ -1345,22 +1362,22 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_969_000 picoseconds. - Weight::from_parts(4_994_916, 0) - // Standard Error: 3_727 - .saturating_add(Weight::from_parts(188_374, 0).saturating_mul(t.into())) - // Standard Error: 33 - .saturating_add(Weight::from_parts(925, 0).saturating_mul(n.into())) + // Minimum execution time: 5_271_000 picoseconds. + Weight::from_parts(5_803_969, 0) + // Standard Error: 10_511 + .saturating_add(Weight::from_parts(163_106, 0).saturating_mul(t.into())) + // Standard Error: 93 + .saturating_add(Weight::from_parts(361, 0).saturating_mul(n.into())) } /// The range of component `i` is `[0, 262144]`. fn seal_debug_message(i: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 328_000 picoseconds. - Weight::from_parts(928_905, 0) - // Standard Error: 1 - .saturating_add(Weight::from_parts(753, 0).saturating_mul(i.into())) + // Minimum execution time: 375_000 picoseconds. + Weight::from_parts(1_601_309, 0) + // Standard Error: 3 + .saturating_add(Weight::from_parts(787, 0).saturating_mul(i.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1368,8 +1385,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `744` // Estimated: `744` - // Minimum execution time: 8_612_000 picoseconds. - Weight::from_parts(9_326_000, 744) + // Minimum execution time: 9_557_000 picoseconds. + Weight::from_parts(10_131_000, 744) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -1378,8 +1395,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `10754` // Estimated: `10754` - // Minimum execution time: 44_542_000 picoseconds. - Weight::from_parts(45_397_000, 10754) + // Minimum execution time: 45_601_000 picoseconds. + Weight::from_parts(46_296_000, 10754) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -1388,8 +1405,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `744` // Estimated: `744` - // Minimum execution time: 10_343_000 picoseconds. - Weight::from_parts(10_883_000, 744) + // Minimum execution time: 10_718_000 picoseconds. + Weight::from_parts(12_282_000, 744) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1399,8 +1416,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `10754` // Estimated: `10754` - // Minimum execution time: 46_835_000 picoseconds. - Weight::from_parts(47_446_000, 10754) + // Minimum execution time: 47_580_000 picoseconds. + Weight::from_parts(50_301_000, 10754) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1412,12 +1429,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + o * (1 ±0)` // Estimated: `247 + o * (1 ±0)` - // Minimum execution time: 10_604_000 picoseconds. - Weight::from_parts(11_282_849, 247) - // Standard Error: 48 - .saturating_add(Weight::from_parts(496, 0).saturating_mul(n.into())) - // Standard Error: 48 - .saturating_add(Weight::from_parts(764, 0).saturating_mul(o.into())) + // Minimum execution time: 11_483_000 picoseconds. + Weight::from_parts(13_084_262, 247) + // Standard Error: 218 + .saturating_add(Weight::from_parts(83, 0).saturating_mul(n.into())) + // Standard Error: 218 + .saturating_add(Weight::from_parts(683, 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())) @@ -1429,10 +1446,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 10_081_000 picoseconds. - Weight::from_parts(11_186_557, 247) - // Standard Error: 68 - .saturating_add(Weight::from_parts(782, 0).saturating_mul(n.into())) + // Minimum execution time: 10_972_000 picoseconds. + Weight::from_parts(12_960_831, 247) .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())) @@ -1444,10 +1459,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_758_000 picoseconds. - Weight::from_parts(9_939_492, 247) - // Standard Error: 69 - .saturating_add(Weight::from_parts(1_703, 0).saturating_mul(n.into())) + // Minimum execution time: 9_989_000 picoseconds. + Weight::from_parts(12_783_294, 247) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1458,10 +1471,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_525_000 picoseconds. - Weight::from_parts(9_522_265, 247) - // Standard Error: 66 - .saturating_add(Weight::from_parts(426, 0).saturating_mul(n.into())) + // Minimum execution time: 9_732_000 picoseconds. + Weight::from_parts(11_156_576, 247) + // Standard Error: 255 + .saturating_add(Weight::from_parts(1_956, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1472,10 +1485,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 10_603_000 picoseconds. - Weight::from_parts(11_817_752, 247) - // Standard Error: 82 - .saturating_add(Weight::from_parts(1_279, 0).saturating_mul(n.into())) + // Minimum execution time: 10_883_000 picoseconds. + Weight::from_parts(13_454_925, 247) + // Standard Error: 276 + .saturating_add(Weight::from_parts(1_509, 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())) @@ -1484,36 +1497,36 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_553_000 picoseconds. - Weight::from_parts(1_615_000, 0) + // Minimum execution time: 1_586_000 picoseconds. + Weight::from_parts(1_869_000, 0) } fn set_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_932_000 picoseconds. - Weight::from_parts(2_064_000, 0) + // Minimum execution time: 1_997_000 picoseconds. + Weight::from_parts(2_093_000, 0) } fn get_transient_storage_empty() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_510_000 picoseconds. - Weight::from_parts(1_545_000, 0) + // Minimum execution time: 1_531_000 picoseconds. + Weight::from_parts(1_734_000, 0) } fn get_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_663_000 picoseconds. - Weight::from_parts(1_801_000, 0) + // Minimum execution time: 1_635_000 picoseconds. + Weight::from_parts(1_880_000, 0) } fn rollback_transient_storage() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_026_000 picoseconds. - Weight::from_parts(1_137_000, 0) + // Minimum execution time: 1_192_000 picoseconds. + Weight::from_parts(1_339_000, 0) } /// The range of component `n` is `[0, 512]`. /// The range of component `o` is `[0, 512]`. @@ -1521,59 +1534,59 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_446_000 picoseconds. - Weight::from_parts(2_644_525, 0) - // Standard Error: 17 - .saturating_add(Weight::from_parts(113, 0).saturating_mul(n.into())) - // Standard Error: 17 - .saturating_add(Weight::from_parts(179, 0).saturating_mul(o.into())) + // Minimum execution time: 2_294_000 picoseconds. + Weight::from_parts(2_848_884, 0) + // Standard Error: 53 + .saturating_add(Weight::from_parts(176, 0).saturating_mul(n.into())) + // Standard Error: 53 + .saturating_add(Weight::from_parts(148, 0).saturating_mul(o.into())) } /// The range of component `n` is `[0, 512]`. fn seal_clear_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_085_000 picoseconds. - Weight::from_parts(2_379_853, 0) - // Standard Error: 19 - .saturating_add(Weight::from_parts(366, 0).saturating_mul(n.into())) + // Minimum execution time: 2_073_000 picoseconds. + Weight::from_parts(2_670_081, 0) + // Standard Error: 64 + .saturating_add(Weight::from_parts(270, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 512]`. fn seal_get_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_876_000 picoseconds. - Weight::from_parts(2_073_689, 0) - // Standard Error: 16 - .saturating_add(Weight::from_parts(376, 0).saturating_mul(n.into())) + // Minimum execution time: 1_879_000 picoseconds. + Weight::from_parts(2_294_904, 0) + // Standard Error: 55 + .saturating_add(Weight::from_parts(481, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 512]`. fn seal_contains_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_688_000 picoseconds. - Weight::from_parts(1_914_470, 0) - // Standard Error: 15 - .saturating_add(Weight::from_parts(125, 0).saturating_mul(n.into())) + // Minimum execution time: 1_711_000 picoseconds. + Weight::from_parts(2_151_924, 0) + // Standard Error: 56 + .saturating_add(Weight::from_parts(98, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 512]`. fn seal_take_transient_storage(_n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_479_000 picoseconds. - Weight::from_parts(2_758_250, 0) + // Minimum execution time: 2_615_000 picoseconds. + Weight::from_parts(3_050_600, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) fn seal_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `352` - // Estimated: `3817` - // Minimum execution time: 15_745_000 picoseconds. - Weight::from_parts(16_300_000, 3817) + // Measured: `390` + // Estimated: `3855` + // Minimum execution time: 18_629_000 picoseconds. + Weight::from_parts(19_520_000, 3855) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) @@ -1588,17 +1601,15 @@ impl WeightInfo for () { /// The range of component `i` is `[0, 262144]`. fn seal_call(t: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1309 + t * (140 ±0)` - // Estimated: `4774 + t * (140 ±0)` - // Minimum execution time: 39_639_000 picoseconds. - Weight::from_parts(40_909_376, 4774) - // Standard Error: 54_479 - .saturating_add(Weight::from_parts(1_526_185, 0).saturating_mul(t.into())) - // Standard Error: 0 - .saturating_add(Weight::from_parts(4, 0).saturating_mul(i.into())) + // Measured: `1319 + t * (178 ±0)` + // Estimated: `4784 + t * (178 ±0)` + // Minimum execution time: 43_655_000 picoseconds. + Weight::from_parts(50_252_813, 4784) + // Standard Error: 1 + .saturating_add(Weight::from_parts(1, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_parts(0, 140).saturating_mul(t.into())) + .saturating_add(Weight::from_parts(0, 178).saturating_mul(t.into())) } /// Storage: `Revive::CodeInfoOf` (r:1 w:0) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) @@ -1606,10 +1617,10 @@ impl WeightInfo for () { /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) fn seal_delegate_call() -> Weight { // Proof Size summary in bytes: - // Measured: `1081` - // Estimated: `4546` - // Minimum execution time: 29_651_000 picoseconds. - Weight::from_parts(31_228_000, 4546) + // Measured: `1089` + // Estimated: `4554` + // Minimum execution time: 31_153_000 picoseconds. + Weight::from_parts(33_625_000, 4554) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) @@ -1623,12 +1634,12 @@ impl WeightInfo for () { /// The range of component `i` is `[0, 262144]`. fn seal_instantiate(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1327` - // Estimated: `4792` - // Minimum execution time: 126_995_000 picoseconds. - Weight::from_parts(114_028_446, 4792) - // Standard Error: 11 - .saturating_add(Weight::from_parts(3_781, 0).saturating_mul(i.into())) + // Measured: `1360` + // Estimated: `4814` + // Minimum execution time: 130_134_000 picoseconds. + Weight::from_parts(120_699_282, 4814) + // Standard Error: 20 + .saturating_add(Weight::from_parts(4_054, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1637,64 +1648,64 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 653_000 picoseconds. - Weight::from_parts(973_524, 0) - // Standard Error: 0 - .saturating_add(Weight::from_parts(1_048, 0).saturating_mul(n.into())) + // Minimum execution time: 665_000 picoseconds. + Weight::from_parts(1_964_310, 0) + // Standard Error: 4 + .saturating_add(Weight::from_parts(1_091, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_keccak_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_118_000 picoseconds. - Weight::from_parts(795_498, 0) - // Standard Error: 1 - .saturating_add(Weight::from_parts(3_260, 0).saturating_mul(n.into())) + // Minimum execution time: 1_245_000 picoseconds. + Weight::from_parts(2_362_235, 0) + // Standard Error: 10 + .saturating_add(Weight::from_parts(3_360, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_blake2_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 647_000 picoseconds. - Weight::from_parts(667_024, 0) - // Standard Error: 0 - .saturating_add(Weight::from_parts(1_183, 0).saturating_mul(n.into())) + // Minimum execution time: 668_000 picoseconds. + Weight::from_parts(1_216_363, 0) + // Standard Error: 4 + .saturating_add(Weight::from_parts(1_231, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_blake2_128(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 605_000 picoseconds. - Weight::from_parts(675_568, 0) - // Standard Error: 0 - .saturating_add(Weight::from_parts(1_181, 0).saturating_mul(n.into())) + // Minimum execution time: 702_000 picoseconds. + Weight::from_parts(1_283_345, 0) + // Standard Error: 5 + .saturating_add(Weight::from_parts(1_230, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 261889]`. fn seal_sr25519_verify(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 42_743_000 picoseconds. - Weight::from_parts(26_131_984, 0) - // Standard Error: 15 - .saturating_add(Weight::from_parts(4_867, 0).saturating_mul(n.into())) + // Minimum execution time: 45_690_000 picoseconds. + Weight::from_parts(28_207_599, 0) + // Standard Error: 18 + .saturating_add(Weight::from_parts(5_142, 0).saturating_mul(n.into())) } fn seal_ecdsa_recover() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 50_838_000 picoseconds. - Weight::from_parts(52_248_000, 0) + // Minimum execution time: 51_869_000 picoseconds. + Weight::from_parts(56_118_000, 0) } fn seal_ecdsa_to_eth_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_605_000 picoseconds. - Weight::from_parts(12_796_000, 0) + // Minimum execution time: 12_927_000 picoseconds. + Weight::from_parts(13_256_000, 0) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) @@ -1702,8 +1713,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `300` // Estimated: `3765` - // Minimum execution time: 16_377_000 picoseconds. - Weight::from_parts(16_932_000, 3765) + // Minimum execution time: 16_969_000 picoseconds. + Weight::from_parts(17_796_000, 3765) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1713,8 +1724,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `338` // Estimated: `3803` - // Minimum execution time: 11_499_000 picoseconds. - Weight::from_parts(12_104_000, 3803) + // Minimum execution time: 11_827_000 picoseconds. + Weight::from_parts(13_675_000, 3803) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1724,8 +1735,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `338` // Estimated: `3561` - // Minimum execution time: 10_308_000 picoseconds. - Weight::from_parts(11_000_000, 3561) + // Minimum execution time: 10_529_000 picoseconds. + Weight::from_parts(12_080_000, 3561) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1734,9 +1745,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_162_000 picoseconds. - Weight::from_parts(9_180_011, 0) - // Standard Error: 63 - .saturating_add(Weight::from_parts(84_822, 0).saturating_mul(r.into())) + // Minimum execution time: 8_269_000 picoseconds. + Weight::from_parts(11_148_702, 0) + // Standard Error: 366 + .saturating_add(Weight::from_parts(87_469, 0).saturating_mul(r.into())) } } diff --git a/substrate/frame/revive/uapi/src/host.rs b/substrate/frame/revive/uapi/src/host.rs index 2663d7c2cf0cc..aa92ed73a050f 100644 --- a/substrate/frame/revive/uapi/src/host.rs +++ b/substrate/frame/revive/uapi/src/host.rs @@ -206,6 +206,17 @@ pub trait HostFn: private::Sealed { /// - `output`: A reference to the output data buffer to write the caller address. fn caller(output: &mut [u8; 20]); + /// Stores the origin address (initator of the call stack) into the supplied buffer. + /// + /// If there is no address associated with the origin (e.g. because the origin is root) then + /// it traps with `BadOrigin`. This can only happen through on-chain governance actions or + /// customized runtimes. + /// + /// # Parameters + /// + /// - `output`: A reference to the output data buffer to write the origin's address. + fn origin(output: &mut [u8; 20]); + /// Checks whether the caller of the current contract is the origin of the whole call stack. /// /// Prefer this over [`is_contract()`][`Self::is_contract`] when checking whether your contract diff --git a/substrate/frame/revive/uapi/src/host/riscv32.rs b/substrate/frame/revive/uapi/src/host/riscv32.rs index c2508198c9358..07bbb24adedd7 100644 --- a/substrate/frame/revive/uapi/src/host/riscv32.rs +++ b/substrate/frame/revive/uapi/src/host/riscv32.rs @@ -73,6 +73,7 @@ mod sys { pub fn input(out_ptr: *mut u8, out_len_ptr: *mut u32); pub fn seal_return(flags: u32, data_ptr: *const u8, data_len: u32); pub fn caller(out_ptr: *mut u8); + pub fn origin(out_ptr: *mut u8); pub fn is_contract(account_ptr: *const u8) -> ReturnCode; pub fn code_hash(address_ptr: *const u8, out_ptr: *mut u8); pub fn own_code_hash(out_ptr: *mut u8); @@ -453,7 +454,7 @@ impl HostFn for HostFnImpl { impl_wrapper_for! { [u8; 32] => block_number, balance, value_transferred, now, minimum_balance, chain_id; - [u8; 20] => address, caller; + [u8; 20] => address, caller, origin; } fn weight_left(output: &mut &mut [u8]) {