diff --git a/prdoc/pr_6920.prdoc b/prdoc/pr_6920.prdoc new file mode 100644 index 000000000000..d80a77e0a71f --- /dev/null +++ b/prdoc/pr_6920.prdoc @@ -0,0 +1,14 @@ +title: '[pallet-revive] change some getter APIs to return value in register' +doc: +- audience: Runtime Dev + description: Call data, return data and code sizes can never exceed `u32::MAX`; + they are also not generic. Hence we know that they are guaranteed to always fit + into a 64bit register and `revive` can just zero extend them into a 256bit integer + value. Which is slightly more efficient than passing them on the stack. +crates: +- name: pallet-revive-fixtures + bump: major +- name: pallet-revive + bump: major +- name: pallet-revive-uapi + bump: major diff --git a/substrate/frame/revive/fixtures/contracts/call_data_size.rs b/substrate/frame/revive/fixtures/contracts/call_data_size.rs index 32205b921d47..7caf18d440b8 100644 --- a/substrate/frame/revive/fixtures/contracts/call_data_size.rs +++ b/substrate/frame/revive/fixtures/contracts/call_data_size.rs @@ -30,8 +30,5 @@ pub extern "C" fn deploy() {} #[no_mangle] #[polkavm_derive::polkavm_export] pub extern "C" fn call() { - let mut buf = [0; 32]; - api::call_data_size(&mut buf); - - api::return_value(ReturnFlags::empty(), &buf); + api::return_value(ReturnFlags::empty(), &api::call_data_size().to_le_bytes()); } diff --git a/substrate/frame/revive/fixtures/contracts/common/src/lib.rs b/substrate/frame/revive/fixtures/contracts/common/src/lib.rs index 1666cdf85ede..302608ccf87c 100644 --- a/substrate/frame/revive/fixtures/contracts/common/src/lib.rs +++ b/substrate/frame/revive/fixtures/contracts/common/src/lib.rs @@ -121,7 +121,7 @@ macro_rules! input { // e.g input!(buffer, 512, var1: u32, var2: [u8], ); ($buffer:ident, $size:expr, $($rest:tt)*) => { let mut $buffer = [0u8; $size]; - let input_size = $crate::u64_output!($crate::api::call_data_size,); + let input_size = $crate::api::call_data_size(); let $buffer = &mut &mut $buffer[..$size.min(input_size as usize)]; $crate::api::call_data_copy($buffer, 0); input!(@inner $buffer, 0, $($rest)*); diff --git a/substrate/frame/revive/fixtures/contracts/extcodesize.rs b/substrate/frame/revive/fixtures/contracts/extcodesize.rs index 0a1171be30e9..3f51b69b46db 100644 --- a/substrate/frame/revive/fixtures/contracts/extcodesize.rs +++ b/substrate/frame/revive/fixtures/contracts/extcodesize.rs @@ -18,7 +18,7 @@ #![no_std] #![no_main] -use common::{input, u64_output}; +use common::input; use uapi::{HostFn, HostFnImpl as api}; #[no_mangle] @@ -30,7 +30,7 @@ pub extern "C" fn deploy() {} pub extern "C" fn call() { input!(address: &[u8; 20], expected: u64,); - let received = u64_output!(api::code_size, address); + let received = api::code_size(address); assert_eq!(expected, received); } diff --git a/substrate/frame/revive/fixtures/contracts/return_data_api.rs b/substrate/frame/revive/fixtures/contracts/return_data_api.rs index 2a390296a419..1d483373cffd 100644 --- a/substrate/frame/revive/fixtures/contracts/return_data_api.rs +++ b/substrate/frame/revive/fixtures/contracts/return_data_api.rs @@ -75,9 +75,7 @@ fn recursion_guard() -> [u8; 20] { /// Assert [api::return_data_size] to match the `expected` value. fn assert_return_data_size_of(expected: u64) { - let mut return_data_size = [0xff; 32]; - api::return_data_size(&mut return_data_size); - assert_eq!(return_data_size, u256_bytes(expected)); + assert_eq!(api::return_data_size(), expected); } /// Assert the return data to be reset after a balance transfer. diff --git a/substrate/frame/revive/rpc/examples/js/pvm/ErrorTester.polkavm b/substrate/frame/revive/rpc/examples/js/pvm/ErrorTester.polkavm index af60be273d74..5c3995bffe35 100644 Binary files a/substrate/frame/revive/rpc/examples/js/pvm/ErrorTester.polkavm and b/substrate/frame/revive/rpc/examples/js/pvm/ErrorTester.polkavm differ diff --git a/substrate/frame/revive/rpc/examples/js/pvm/EventExample.polkavm b/substrate/frame/revive/rpc/examples/js/pvm/EventExample.polkavm index 67f02042c784..7880647f3792 100644 Binary files a/substrate/frame/revive/rpc/examples/js/pvm/EventExample.polkavm and b/substrate/frame/revive/rpc/examples/js/pvm/EventExample.polkavm differ diff --git a/substrate/frame/revive/rpc/examples/js/pvm/Flipper.polkavm b/substrate/frame/revive/rpc/examples/js/pvm/Flipper.polkavm index ebb06b6949e3..1f036fa37948 100644 Binary files a/substrate/frame/revive/rpc/examples/js/pvm/Flipper.polkavm and b/substrate/frame/revive/rpc/examples/js/pvm/Flipper.polkavm differ diff --git a/substrate/frame/revive/rpc/examples/js/pvm/FlipperCaller.polkavm b/substrate/frame/revive/rpc/examples/js/pvm/FlipperCaller.polkavm index 56ae81c7e5b0..92304419dda7 100644 Binary files a/substrate/frame/revive/rpc/examples/js/pvm/FlipperCaller.polkavm and b/substrate/frame/revive/rpc/examples/js/pvm/FlipperCaller.polkavm differ diff --git a/substrate/frame/revive/rpc/examples/js/pvm/PiggyBank.polkavm b/substrate/frame/revive/rpc/examples/js/pvm/PiggyBank.polkavm index 416577ad8f23..b29c640a2fee 100644 Binary files a/substrate/frame/revive/rpc/examples/js/pvm/PiggyBank.polkavm and b/substrate/frame/revive/rpc/examples/js/pvm/PiggyBank.polkavm differ diff --git a/substrate/frame/revive/src/benchmarking/mod.rs b/substrate/frame/revive/src/benchmarking/mod.rs index 28736cd8d5da..6f84ecdd1525 100644 --- a/substrate/frame/revive/src/benchmarking/mod.rs +++ b/substrate/frame/revive/src/benchmarking/mod.rs @@ -596,19 +596,15 @@ mod benchmarks { #[benchmark(pov_mode = Measured)] fn seal_code_size() { let contract = Contract::::with_index(1, WasmModule::dummy(), vec![]).unwrap(); - build_runtime!(runtime, memory: [contract.address.encode(), vec![0u8; 32], ]); + build_runtime!(runtime, memory: [contract.address.encode(),]); let result; #[block] { - result = runtime.bench_code_size(memory.as_mut_slice(), 0, 20); + result = runtime.bench_code_size(memory.as_mut_slice(), 0); } - assert_ok!(result); - assert_eq!( - U256::from_little_endian(&memory[20..]), - U256::from(WasmModule::dummy().code.len()) - ); + assert_eq!(result.unwrap(), WasmModule::dummy().code.len() as u64); } #[benchmark(pov_mode = Measured)] @@ -783,19 +779,34 @@ mod benchmarks { assert_eq!(U256::from_little_endian(&memory[..]), runtime.ext().minimum_balance()); } + #[benchmark(pov_mode = Measured)] + fn seal_return_data_size() { + let mut setup = CallSetup::::default(); + let (mut ext, _) = setup.ext(); + let mut runtime = crate::wasm::Runtime::new(&mut ext, vec![]); + let mut memory = memory!(vec![],); + *runtime.ext().last_frame_output_mut() = + ExecReturnValue { data: vec![42; 256], ..Default::default() }; + let result; + #[block] + { + result = runtime.bench_return_data_size(memory.as_mut_slice()); + } + assert_eq!(result.unwrap(), 256); + } + #[benchmark(pov_mode = Measured)] fn seal_call_data_size() { let mut setup = CallSetup::::default(); let (mut ext, _) = setup.ext(); let mut runtime = crate::wasm::Runtime::new(&mut ext, vec![42u8; 128 as usize]); - let mut memory = memory!(vec![0u8; 32 as usize],); + let mut memory = memory!(vec![0u8; 4],); let result; #[block] { - result = runtime.bench_call_data_size(memory.as_mut_slice(), 0); + result = runtime.bench_call_data_size(memory.as_mut_slice()); } - assert_ok!(result); - assert_eq!(U256::from_little_endian(&memory[..]), U256::from(128)); + assert_eq!(result.unwrap(), 128); } #[benchmark(pov_mode = Measured)] diff --git a/substrate/frame/revive/src/exec.rs b/substrate/frame/revive/src/exec.rs index b6f0e3ae1a81..a6a259149768 100644 --- a/substrate/frame/revive/src/exec.rs +++ b/substrate/frame/revive/src/exec.rs @@ -298,7 +298,7 @@ pub trait Ext: sealing::Sealed { fn code_hash(&self, address: &H160) -> H256; /// Returns the code size of the contract at the given `address` or zero. - fn code_size(&self, address: &H160) -> U256; + fn code_size(&self, address: &H160) -> u64; /// Returns the code hash of the contract being executed. fn own_code_hash(&mut self) -> &H256; @@ -1663,7 +1663,7 @@ where }) } - fn code_size(&self, address: &H160) -> U256 { + fn code_size(&self, address: &H160) -> u64 { >::get(&address) .and_then(|contract| CodeInfoOf::::get(contract.code_hash)) .map(|info| info.code_len()) diff --git a/substrate/frame/revive/src/tests.rs b/substrate/frame/revive/src/tests.rs index b73f50e34bc5..90c032bd0840 100644 --- a/substrate/frame/revive/src/tests.rs +++ b/substrate/frame/revive/src/tests.rs @@ -4377,11 +4377,11 @@ fn call_data_size_api_works() { // Call the contract: It echoes back the value returned by the call data size API. let received = builder::bare_call(addr).build_and_unwrap_result(); assert_eq!(received.flags, ReturnFlags::empty()); - assert_eq!(U256::from_little_endian(&received.data), U256::zero()); + assert_eq!(u64::from_le_bytes(received.data.try_into().unwrap()), 0); let received = builder::bare_call(addr).data(vec![1; 256]).build_and_unwrap_result(); assert_eq!(received.flags, ReturnFlags::empty()); - assert_eq!(U256::from_little_endian(&received.data), U256::from(256)); + assert_eq!(u64::from_le_bytes(received.data.try_into().unwrap()), 256); }); } diff --git a/substrate/frame/revive/src/wasm/mod.rs b/substrate/frame/revive/src/wasm/mod.rs index e963895dafae..b24de61314f9 100644 --- a/substrate/frame/revive/src/wasm/mod.rs +++ b/substrate/frame/revive/src/wasm/mod.rs @@ -242,7 +242,7 @@ impl CodeInfo { } /// Returns the code length. - pub fn code_len(&self) -> U256 { + pub fn code_len(&self) -> u64 { self.code_len.into() } } diff --git a/substrate/frame/revive/src/wasm/runtime.rs b/substrate/frame/revive/src/wasm/runtime.rs index 47fdfa8bab09..d1a14ca1a93a 100644 --- a/substrate/frame/revive/src/wasm/runtime.rs +++ b/substrate/frame/revive/src/wasm/runtime.rs @@ -290,6 +290,8 @@ pub enum RuntimeCosts { Caller, /// Weight of calling `seal_call_data_size`. CallDataSize, + /// Weight of calling `seal_return_data_size`. + ReturnDataSize, /// Weight of calling `seal_origin`. Origin, /// Weight of calling `seal_is_contract`. @@ -453,6 +455,7 @@ impl Token for RuntimeCosts { CopyToContract(len) => T::WeightInfo::seal_copy_to_contract(len), CopyFromContract(len) => T::WeightInfo::seal_return(len), CallDataSize => T::WeightInfo::seal_call_data_size(), + ReturnDataSize => T::WeightInfo::seal_return_data_size(), CallDataLoad => T::WeightInfo::seal_call_data_load(), CallDataCopy(len) => T::WeightInfo::seal_call_data_copy(len), Caller => T::WeightInfo::seal_caller(), @@ -1283,17 +1286,13 @@ pub mod env { /// Returns the total size of the contract call input data. /// See [`pallet_revive_uapi::HostFn::call_data_size `]. #[stable] - fn call_data_size(&mut self, memory: &mut M, out_ptr: u32) -> Result<(), TrapReason> { + fn call_data_size(&mut self, memory: &mut M) -> Result { self.charge_gas(RuntimeCosts::CallDataSize)?; - let value = - U256::from(self.input_data.as_ref().map(|input| input.len()).unwrap_or_default()); - Ok(self.write_fixed_sandbox_output( - memory, - out_ptr, - &value.to_little_endian(), - false, - already_charged, - )?) + Ok(self + .input_data + .as_ref() + .map(|input| input.len().try_into().expect("usize fits into u64; qed")) + .unwrap_or_default()) } /// Stores the input passed by the caller into the supplied buffer. @@ -1420,16 +1419,10 @@ pub mod env { /// Retrieve the code size for a given contract address. /// See [`pallet_revive_uapi::HostFn::code_size`]. #[stable] - fn code_size(&mut self, memory: &mut M, addr_ptr: u32, out_ptr: u32) -> Result<(), TrapReason> { + fn code_size(&mut self, memory: &mut M, addr_ptr: u32) -> Result { self.charge_gas(RuntimeCosts::CodeSize)?; let address = memory.read_h160(addr_ptr)?; - Ok(self.write_fixed_sandbox_output( - memory, - out_ptr, - &self.ext.code_size(&address).to_little_endian(), - false, - already_charged, - )?) + Ok(self.ext.code_size(&address)) } /// Stores the address of the current contract into the supplied buffer. @@ -1667,14 +1660,15 @@ pub mod env { /// Stores the length of the data returned by the last call into the supplied buffer. /// See [`pallet_revive_uapi::HostFn::return_data_size`]. #[stable] - fn return_data_size(&mut self, memory: &mut M, out_ptr: u32) -> Result<(), TrapReason> { - Ok(self.write_fixed_sandbox_output( - memory, - out_ptr, - &U256::from(self.ext.last_frame_output().data.len()).to_little_endian(), - false, - |len| Some(RuntimeCosts::CopyToContract(len)), - )?) + fn return_data_size(&mut self, memory: &mut M) -> Result { + self.charge_gas(RuntimeCosts::ReturnDataSize)?; + Ok(self + .ext + .last_frame_output() + .data + .len() + .try_into() + .expect("usize fits into u64; qed")) } /// Stores data returned by the last call, starting from `offset`, into the supplied buffer. diff --git a/substrate/frame/revive/src/weights.rs b/substrate/frame/revive/src/weights.rs index 03899fb3f20a..db3c34a75878 100644 --- a/substrate/frame/revive/src/weights.rs +++ b/substrate/frame/revive/src/weights.rs @@ -20,7 +20,7 @@ //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 //! DATE: 2024-12-18, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `4ca2a44ee243`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `28f02a6d927a`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: @@ -81,6 +81,7 @@ pub trait WeightInfo { fn seal_set_immutable_data(n: u32, ) -> Weight; fn seal_value_transferred() -> Weight; fn seal_minimum_balance() -> Weight; + fn seal_return_data_size() -> Weight; fn seal_call_data_size() -> Weight; fn seal_block_number() -> Weight; fn seal_block_hash() -> Weight; @@ -137,8 +138,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `109` // Estimated: `1594` - // Minimum execution time: 2_729_000 picoseconds. - Weight::from_parts(2_919_000, 1594) + // Minimum execution time: 2_752_000 picoseconds. + Weight::from_parts(2_990_000, 1594) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -148,10 +149,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `425 + k * (69 ±0)` // Estimated: `415 + k * (70 ±0)` - // Minimum execution time: 16_062_000 picoseconds. - Weight::from_parts(2_790_037, 415) - // Standard Error: 1_371 - .saturating_add(Weight::from_parts(1_187_192, 0).saturating_mul(k.into())) + // Minimum execution time: 16_130_000 picoseconds. + Weight::from_parts(3_413_527, 415) + // Standard Error: 1_190 + .saturating_add(Weight::from_parts(1_184_912, 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)) @@ -175,8 +176,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1465` // Estimated: `7405` - // Minimum execution time: 94_592_000 picoseconds. - Weight::from_parts(100_095_688, 7405) + // Minimum execution time: 91_977_000 picoseconds. + Weight::from_parts(96_482_355, 7405) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -196,16 +197,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. /// The range of component `i` is `[0, 262144]`. - fn instantiate_with_code(c: u32, i: u32, ) -> Weight { + fn instantiate_with_code(_c: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `416` // Estimated: `6348` - // Minimum execution time: 205_430_000 picoseconds. - Weight::from_parts(190_302_613, 6348) - // Standard Error: 10 - .saturating_add(Weight::from_parts(2, 0).saturating_mul(c.into())) - // Standard Error: 10 - .saturating_add(Weight::from_parts(4_465, 0).saturating_mul(i.into())) + // Minimum execution time: 197_911_000 picoseconds. + Weight::from_parts(185_839_401, 6348) + // Standard Error: 9 + .saturating_add(Weight::from_parts(4_419, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -228,10 +227,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1309` // Estimated: `4760` - // Minimum execution time: 168_842_000 picoseconds. - Weight::from_parts(154_652_310, 4760) + // Minimum execution time: 162_062_000 picoseconds. + Weight::from_parts(146_040_237, 4760) // Standard Error: 15 - .saturating_add(Weight::from_parts(4_407, 0).saturating_mul(i.into())) + .saturating_add(Weight::from_parts(4_410, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -251,8 +250,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1465` // Estimated: `7405` - // Minimum execution time: 144_703_000 picoseconds. - Weight::from_parts(151_937_000, 7405) + // Minimum execution time: 143_737_000 picoseconds. + Weight::from_parts(151_572_000, 7405) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -267,8 +266,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `109` // Estimated: `3574` - // Minimum execution time: 52_912_000 picoseconds. - Weight::from_parts(54_905_094, 3574) + // Minimum execution time: 52_301_000 picoseconds. + Weight::from_parts(54_773_649, 3574) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -282,8 +281,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3750` - // Minimum execution time: 46_323_000 picoseconds. - Weight::from_parts(47_075_000, 3750) + // Minimum execution time: 45_699_000 picoseconds. + Weight::from_parts(46_961_000, 3750) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -295,8 +294,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `529` // Estimated: `6469` - // Minimum execution time: 27_120_000 picoseconds. - Weight::from_parts(28_635_000, 6469) + // Minimum execution time: 26_501_000 picoseconds. + Weight::from_parts(27_913_000, 6469) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -308,8 +307,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `109` // Estimated: `3574` - // Minimum execution time: 42_489_000 picoseconds. - Weight::from_parts(43_230_000, 3574) + // Minimum execution time: 41_673_000 picoseconds. + Weight::from_parts(42_360_000, 3574) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -321,8 +320,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `56` // Estimated: `3521` - // Minimum execution time: 34_042_000 picoseconds. - Weight::from_parts(34_758_000, 3521) + // Minimum execution time: 32_530_000 picoseconds. + Weight::from_parts(33_997_000, 3521) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -334,8 +333,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `145` // Estimated: `3610` - // Minimum execution time: 14_322_000 picoseconds. - Weight::from_parts(14_761_000, 3610) + // Minimum execution time: 13_327_000 picoseconds. + Weight::from_parts(13_976_000, 3610) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// The range of component `r` is `[0, 1600]`. @@ -343,24 +342,24 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 14_300_000 picoseconds. - Weight::from_parts(14_435_272, 0) - // Standard Error: 357 - .saturating_add(Weight::from_parts(151_410, 0).saturating_mul(r.into())) + // Minimum execution time: 7_317_000 picoseconds. + Weight::from_parts(7_742_783, 0) + // Standard Error: 274 + .saturating_add(Weight::from_parts(166_272, 0).saturating_mul(r.into())) } fn seal_caller() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 315_000 picoseconds. - Weight::from_parts(355_000, 0) + // Minimum execution time: 300_000 picoseconds. + Weight::from_parts(349_000, 0) } fn seal_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 252_000 picoseconds. - Weight::from_parts(300_000, 0) + // Minimum execution time: 248_000 picoseconds. + Weight::from_parts(293_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) @@ -368,8 +367,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `306` // Estimated: `3771` - // Minimum execution time: 10_073_000 picoseconds. - Weight::from_parts(10_791_000, 3771) + // Minimum execution time: 10_018_000 picoseconds. + Weight::from_parts(10_399_000, 3771) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) @@ -378,16 +377,16 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `403` // Estimated: `3868` - // Minimum execution time: 11_216_000 picoseconds. - Weight::from_parts(11_917_000, 3868) + // Minimum execution time: 11_209_000 picoseconds. + Weight::from_parts(11_640_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: 269_000 picoseconds. - Weight::from_parts(308_000, 0) + // Minimum execution time: 280_000 picoseconds. + Weight::from_parts(309_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) @@ -397,51 +396,51 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `473` // Estimated: `3938` - // Minimum execution time: 15_159_000 picoseconds. - Weight::from_parts(15_933_000, 3938) + // Minimum execution time: 14_718_000 picoseconds. + Weight::from_parts(15_292_000, 3938) .saturating_add(T::DbWeight::get().reads(2_u64)) } fn seal_caller_is_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 367_000 picoseconds. + // Minimum execution time: 336_000 picoseconds. Weight::from_parts(391_000, 0) } fn seal_caller_is_root() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 294_000 picoseconds. - Weight::from_parts(331_000, 0) + // Minimum execution time: 275_000 picoseconds. + Weight::from_parts(296_000, 0) } fn seal_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 275_000 picoseconds. - Weight::from_parts(318_000, 0) + // Minimum execution time: 262_000 picoseconds. + Weight::from_parts(304_000, 0) } fn seal_weight_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 660_000 picoseconds. - Weight::from_parts(697_000, 0) + // Minimum execution time: 628_000 picoseconds. + Weight::from_parts(714_000, 0) } fn seal_ref_time_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 288_000 picoseconds. - Weight::from_parts(306_000, 0) + // Minimum execution time: 246_000 picoseconds. + Weight::from_parts(265_000, 0) } fn seal_balance() -> Weight { // Proof Size summary in bytes: // Measured: `140` // Estimated: `0` - // Minimum execution time: 5_577_000 picoseconds. - Weight::from_parts(5_918_000, 0) + // Minimum execution time: 5_605_000 picoseconds. + Weight::from_parts(5_769_000, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) @@ -451,8 +450,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `264` // Estimated: `3729` - // Minimum execution time: 9_264_000 picoseconds. - Weight::from_parts(9_589_000, 3729) + // Minimum execution time: 8_990_000 picoseconds. + Weight::from_parts(9_223_000, 3729) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `Revive::ImmutableDataOf` (r:1 w:0) @@ -462,10 +461,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `238 + n * (1 ±0)` // Estimated: `3703 + n * (1 ±0)` - // Minimum execution time: 6_082_000 picoseconds. - Weight::from_parts(6_789_222, 3703) + // Minimum execution time: 6_001_000 picoseconds. + Weight::from_parts(6_630_017, 3703) // Standard Error: 4 - .saturating_add(Weight::from_parts(670, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(622, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -476,39 +475,46 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_950_000 picoseconds. - Weight::from_parts(2_244_232, 0) + // Minimum execution time: 2_026_000 picoseconds. + Weight::from_parts(2_271_985, 0) // Standard Error: 2 - .saturating_add(Weight::from_parts(574, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(537, 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: 254_000 picoseconds. - Weight::from_parts(304_000, 0) + // Minimum execution time: 287_000 picoseconds. + Weight::from_parts(323_000, 0) } fn seal_minimum_balance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 251_000 picoseconds. - Weight::from_parts(292_000, 0) + // Minimum execution time: 230_000 picoseconds. + Weight::from_parts(275_000, 0) + } + fn seal_return_data_size() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 242_000 picoseconds. + Weight::from_parts(268_000, 0) } fn seal_call_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 262_000 picoseconds. - Weight::from_parts(288_000, 0) + // Minimum execution time: 244_000 picoseconds. + Weight::from_parts(271_000, 0) } fn seal_block_number() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 269_000 picoseconds. - Weight::from_parts(302_000, 0) + // Minimum execution time: 266_000 picoseconds. + Weight::from_parts(304_000, 0) } /// Storage: `System::BlockHash` (r:1 w:0) /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `Measured`) @@ -516,60 +522,60 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `30` // Estimated: `3495` - // Minimum execution time: 3_690_000 picoseconds. - Weight::from_parts(3_791_000, 3495) + // Minimum execution time: 3_559_000 picoseconds. + Weight::from_parts(3_697_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: 261_000 picoseconds. - Weight::from_parts(307_000, 0) + // Minimum execution time: 242_000 picoseconds. + Weight::from_parts(294_000, 0) } fn seal_weight_to_fee() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_417_000 picoseconds. - Weight::from_parts(1_547_000, 0) + // Minimum execution time: 1_222_000 picoseconds. + Weight::from_parts(1_387_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: 364_000 picoseconds. - Weight::from_parts(566_499, 0) + // Minimum execution time: 392_000 picoseconds. + Weight::from_parts(397_500, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(237, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(206, 0).saturating_mul(n.into())) } fn seal_call_data_load() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 279_000 picoseconds. - Weight::from_parts(305_000, 0) + // Minimum execution time: 267_000 picoseconds. + Weight::from_parts(322_000, 0) } /// The range of component `n` is `[0, 262144]`. fn seal_call_data_copy(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 265_000 picoseconds. - Weight::from_parts(359_300, 0) + // Minimum execution time: 234_000 picoseconds. + Weight::from_parts(291_182, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(148, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(113, 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: 278_000 picoseconds. - Weight::from_parts(474_421, 0) + // Minimum execution time: 253_000 picoseconds. + Weight::from_parts(271_000, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(237, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(212, 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`) @@ -586,10 +592,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `324 + n * (88 ±0)` // Estimated: `3790 + n * (2563 ±0)` - // Minimum execution time: 23_182_000 picoseconds. - Weight::from_parts(23_833_588, 3790) - // Standard Error: 12_448 - .saturating_add(Weight::from_parts(4_277_757, 0).saturating_mul(n.into())) + // Minimum execution time: 22_082_000 picoseconds. + Weight::from_parts(22_815_417, 3790) + // Standard Error: 9_515 + .saturating_add(Weight::from_parts(4_283_767, 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)) @@ -602,22 +608,22 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_433_000 picoseconds. - Weight::from_parts(4_321_363, 0) - // Standard Error: 2_536 - .saturating_add(Weight::from_parts(207_597, 0).saturating_mul(t.into())) - // Standard Error: 22 - .saturating_add(Weight::from_parts(957, 0).saturating_mul(n.into())) + // Minimum execution time: 4_242_000 picoseconds. + Weight::from_parts(4_360_337, 0) + // Standard Error: 3_223 + .saturating_add(Weight::from_parts(201_105, 0).saturating_mul(t.into())) + // Standard Error: 28 + .saturating_add(Weight::from_parts(723, 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: 353_000 picoseconds. - Weight::from_parts(78_798, 0) + // Minimum execution time: 340_000 picoseconds. + Weight::from_parts(773_824, 0) // Standard Error: 1 - .saturating_add(Weight::from_parts(762, 0).saturating_mul(i.into())) + .saturating_add(Weight::from_parts(722, 0).saturating_mul(i.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -625,8 +631,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `744` // Estimated: `744` - // Minimum execution time: 7_701_000 picoseconds. - Weight::from_parts(8_043_000, 744) + // Minimum execution time: 7_741_000 picoseconds. + Weight::from_parts(8_048_000, 744) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -635,8 +641,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `10754` // Estimated: `10754` - // Minimum execution time: 42_961_000 picoseconds. - Weight::from_parts(44_719_000, 10754) + // Minimum execution time: 42_314_000 picoseconds. + Weight::from_parts(43_255_000, 10754) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -645,8 +651,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `744` // Estimated: `744` - // Minimum execution time: 8_575_000 picoseconds. - Weight::from_parts(9_239_000, 744) + // Minimum execution time: 8_741_000 picoseconds. + Weight::from_parts(9_123_000, 744) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -656,8 +662,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `10754` // Estimated: `10754` - // Minimum execution time: 43_585_000 picoseconds. - Weight::from_parts(45_719_000, 10754) + // Minimum execution time: 44_703_000 picoseconds. + Weight::from_parts(46_403_000, 10754) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -669,12 +675,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + o * (1 ±0)` // Estimated: `247 + o * (1 ±0)` - // Minimum execution time: 9_147_000 picoseconds. - Weight::from_parts(9_851_872, 247) - // Standard Error: 40 - .saturating_add(Weight::from_parts(222, 0).saturating_mul(n.into())) - // Standard Error: 40 - .saturating_add(Weight::from_parts(411, 0).saturating_mul(o.into())) + // Minimum execution time: 9_285_000 picoseconds. + Weight::from_parts(10_046_720, 247) + // Standard Error: 37 + .saturating_add(Weight::from_parts(365, 0).saturating_mul(n.into())) + // Standard Error: 37 + .saturating_add(Weight::from_parts(273, 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())) @@ -686,10 +692,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_859_000 picoseconds. - Weight::from_parts(9_633_190, 247) - // Standard Error: 55 - .saturating_add(Weight::from_parts(995, 0).saturating_mul(n.into())) + // Minimum execution time: 8_879_000 picoseconds. + Weight::from_parts(9_736_050, 247) + // Standard Error: 48 + .saturating_add(Weight::from_parts(514, 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())) @@ -701,10 +707,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_270_000 picoseconds. - Weight::from_parts(9_208_849, 247) - // Standard Error: 67 - .saturating_add(Weight::from_parts(1_686, 0).saturating_mul(n.into())) + // Minimum execution time: 8_475_000 picoseconds. + Weight::from_parts(9_410_206, 247) + // Standard Error: 58 + .saturating_add(Weight::from_parts(1_409, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -715,10 +721,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_002_000 picoseconds. - Weight::from_parts(8_695_892, 247) - // Standard Error: 48 - .saturating_add(Weight::from_parts(721, 0).saturating_mul(n.into())) + // Minimum execution time: 8_017_000 picoseconds. + Weight::from_parts(8_879_089, 247) + // Standard Error: 51 + .saturating_add(Weight::from_parts(512, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -729,10 +735,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 9_204_000 picoseconds. - Weight::from_parts(10_176_756, 247) - // Standard Error: 57 - .saturating_add(Weight::from_parts(1_550, 0).saturating_mul(n.into())) + // Minimum execution time: 9_196_000 picoseconds. + Weight::from_parts(10_285_787, 247) + // Standard Error: 65 + .saturating_add(Weight::from_parts(1_553, 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())) @@ -741,36 +747,36 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_518_000 picoseconds. - Weight::from_parts(1_578_000, 0) + // Minimum execution time: 1_456_000 picoseconds. + Weight::from_parts(1_593_000, 0) } fn set_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_846_000 picoseconds. - Weight::from_parts(1_996_000, 0) + // Minimum execution time: 1_897_000 picoseconds. + Weight::from_parts(2_059_000, 0) } fn get_transient_storage_empty() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_442_000 picoseconds. - Weight::from_parts(1_562_000, 0) + // Minimum execution time: 1_487_000 picoseconds. + Weight::from_parts(1_588_000, 0) } fn get_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_602_000 picoseconds. - Weight::from_parts(1_730_000, 0) + // Minimum execution time: 1_622_000 picoseconds. + Weight::from_parts(1_732_000, 0) } fn rollback_transient_storage() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_096_000 picoseconds. - Weight::from_parts(1_176_000, 0) + // Minimum execution time: 1_188_000 picoseconds. + Weight::from_parts(1_239_000, 0) } /// The range of component `n` is `[0, 512]`. /// The range of component `o` is `[0, 512]`. @@ -778,52 +784,50 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_328_000 picoseconds. - Weight::from_parts(2_470_198, 0) - // Standard Error: 14 - .saturating_add(Weight::from_parts(256, 0).saturating_mul(n.into())) - // Standard Error: 14 - .saturating_add(Weight::from_parts(441, 0).saturating_mul(o.into())) + // Minimum execution time: 2_269_000 picoseconds. + Weight::from_parts(2_528_717, 0) + // Standard Error: 12 + .saturating_add(Weight::from_parts(163, 0).saturating_mul(n.into())) + // Standard Error: 12 + .saturating_add(Weight::from_parts(332, 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_037_000 picoseconds. - Weight::from_parts(2_439_061, 0) - // Standard Error: 17 - .saturating_add(Weight::from_parts(303, 0).saturating_mul(n.into())) + // Minimum execution time: 2_051_000 picoseconds. + Weight::from_parts(2_507_009, 0) + // Standard Error: 20 + .saturating_add(Weight::from_parts(309, 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_900_000 picoseconds. - Weight::from_parts(2_095_135, 0) - // Standard Error: 12 - .saturating_add(Weight::from_parts(310, 0).saturating_mul(n.into())) + // Minimum execution time: 1_829_000 picoseconds. + Weight::from_parts(2_052_749, 0) + // Standard Error: 14 + .saturating_add(Weight::from_parts(350, 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_772_000 picoseconds. - Weight::from_parts(1_964_542, 0) - // Standard Error: 16 - .saturating_add(Weight::from_parts(298, 0).saturating_mul(n.into())) + // Minimum execution time: 1_717_000 picoseconds. + Weight::from_parts(1_930_820, 0) + // Standard Error: 12 + .saturating_add(Weight::from_parts(161, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 512]`. - fn seal_take_transient_storage(n: u32, ) -> Weight { + fn seal_take_transient_storage(_n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_555_000 picoseconds. - Weight::from_parts(2_864_143, 0) - // Standard Error: 22 - .saturating_add(Weight::from_parts(45, 0).saturating_mul(n.into())) + // Minimum execution time: 2_502_000 picoseconds. + Weight::from_parts(2_829_951, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) @@ -837,14 +841,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// The range of component `t` is `[0, 1]`. /// The range of component `i` is `[0, 262144]`. - fn seal_call(t: u32, _i: u32, ) -> Weight { + fn seal_call(t: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1292 + t * (280 ±0)` // Estimated: `4757 + t * (2518 ±0)` - // Minimum execution time: 40_760_000 picoseconds. - Weight::from_parts(45_131_001, 4757) - // Standard Error: 302_594 - .saturating_add(Weight::from_parts(2_769_232, 0).saturating_mul(t.into())) + // Minimum execution time: 40_791_000 picoseconds. + Weight::from_parts(42_421_336, 4757) + // Standard Error: 53_086 + .saturating_add(Weight::from_parts(2_057_850, 0).saturating_mul(t.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(1, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(t.into()))) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -860,8 +866,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1237` // Estimated: `4702` - // Minimum execution time: 36_975_000 picoseconds. - Weight::from_parts(38_368_000, 4702) + // Minimum execution time: 35_825_000 picoseconds. + Weight::from_parts(37_377_000, 4702) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) @@ -877,10 +883,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1310` // Estimated: `4769` - // Minimum execution time: 122_553_000 picoseconds. - Weight::from_parts(117_325_822, 4769) + // Minimum execution time: 121_920_000 picoseconds. + Weight::from_parts(115_842_357, 4769) // Standard Error: 10 - .saturating_add(Weight::from_parts(4_147, 0).saturating_mul(i.into())) + .saturating_add(Weight::from_parts(4_062, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -890,63 +896,63 @@ impl WeightInfo for SubstrateWeight { // Measured: `0` // Estimated: `0` // Minimum execution time: 657_000 picoseconds. - Weight::from_parts(3_531_259, 0) + Weight::from_parts(2_219_539, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(1_428, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_413, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_keccak_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_072_000 picoseconds. - Weight::from_parts(5_487_006, 0) + // Minimum execution time: 1_091_000 picoseconds. + Weight::from_parts(4_036_613, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(3_634, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(3_600, 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: 638_000 picoseconds. - Weight::from_parts(3_097_177, 0) + // Minimum execution time: 635_000 picoseconds. + Weight::from_parts(4_636_213, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(1_551, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_514, 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: 682_000 picoseconds. - Weight::from_parts(2_963_774, 0) + // Minimum execution time: 648_000 picoseconds. + Weight::from_parts(3_658_083, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(1_561, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_516, 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_791_000 picoseconds. - Weight::from_parts(27_471_391, 0) + // Minimum execution time: 42_722_000 picoseconds. + Weight::from_parts(28_496_037, 0) // Standard Error: 13 - .saturating_add(Weight::from_parts(5_246, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(5_235, 0).saturating_mul(n.into())) } fn seal_ecdsa_recover() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 46_565_000 picoseconds. - Weight::from_parts(48_251_000, 0) + // Minimum execution time: 46_924_000 picoseconds. + Weight::from_parts(48_639_000, 0) } fn seal_ecdsa_to_eth_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_562_000 picoseconds. - Weight::from_parts(12_664_000, 0) + // Minimum execution time: 12_882_000 picoseconds. + Weight::from_parts(13_108_000, 0) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) @@ -954,8 +960,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `300` // Estimated: `3765` - // Minimum execution time: 18_527_000 picoseconds. - Weight::from_parts(19_134_000, 3765) + // Minimum execution time: 17_907_000 picoseconds. + Weight::from_parts(18_634_000, 3765) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -965,8 +971,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `338` // Estimated: `3803` - // Minimum execution time: 13_843_000 picoseconds. - Weight::from_parts(14_750_000, 3803) + // Minimum execution time: 14_091_000 picoseconds. + Weight::from_parts(14_393_000, 3803) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -976,8 +982,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `338` // Estimated: `3561` - // Minimum execution time: 13_013_000 picoseconds. - Weight::from_parts(13_612_000, 3561) + // Minimum execution time: 12_824_000 picoseconds. + Weight::from_parts(13_304_000, 3561) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -986,10 +992,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 15_182_000 picoseconds. - Weight::from_parts(16_987_060, 0) - // Standard Error: 105 - .saturating_add(Weight::from_parts(72_086, 0).saturating_mul(r.into())) + // Minimum execution time: 9_185_000 picoseconds. + Weight::from_parts(10_532_230, 0) + // Standard Error: 189 + .saturating_add(Weight::from_parts(71_786, 0).saturating_mul(r.into())) } } @@ -1001,8 +1007,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `109` // Estimated: `1594` - // Minimum execution time: 2_729_000 picoseconds. - Weight::from_parts(2_919_000, 1594) + // Minimum execution time: 2_752_000 picoseconds. + Weight::from_parts(2_990_000, 1594) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -1012,10 +1018,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `425 + k * (69 ±0)` // Estimated: `415 + k * (70 ±0)` - // Minimum execution time: 16_062_000 picoseconds. - Weight::from_parts(2_790_037, 415) - // Standard Error: 1_371 - .saturating_add(Weight::from_parts(1_187_192, 0).saturating_mul(k.into())) + // Minimum execution time: 16_130_000 picoseconds. + Weight::from_parts(3_413_527, 415) + // Standard Error: 1_190 + .saturating_add(Weight::from_parts(1_184_912, 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)) @@ -1039,8 +1045,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1465` // Estimated: `7405` - // Minimum execution time: 94_592_000 picoseconds. - Weight::from_parts(100_095_688, 7405) + // Minimum execution time: 91_977_000 picoseconds. + Weight::from_parts(96_482_355, 7405) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1060,16 +1066,14 @@ impl WeightInfo for () { /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. /// The range of component `i` is `[0, 262144]`. - fn instantiate_with_code(c: u32, i: u32, ) -> Weight { + fn instantiate_with_code(_c: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `416` // Estimated: `6348` - // Minimum execution time: 205_430_000 picoseconds. - Weight::from_parts(190_302_613, 6348) - // Standard Error: 10 - .saturating_add(Weight::from_parts(2, 0).saturating_mul(c.into())) - // Standard Error: 10 - .saturating_add(Weight::from_parts(4_465, 0).saturating_mul(i.into())) + // Minimum execution time: 197_911_000 picoseconds. + Weight::from_parts(185_839_401, 6348) + // Standard Error: 9 + .saturating_add(Weight::from_parts(4_419, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -1092,10 +1096,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1309` // Estimated: `4760` - // Minimum execution time: 168_842_000 picoseconds. - Weight::from_parts(154_652_310, 4760) + // Minimum execution time: 162_062_000 picoseconds. + Weight::from_parts(146_040_237, 4760) // Standard Error: 15 - .saturating_add(Weight::from_parts(4_407, 0).saturating_mul(i.into())) + .saturating_add(Weight::from_parts(4_410, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -1115,8 +1119,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1465` // Estimated: `7405` - // Minimum execution time: 144_703_000 picoseconds. - Weight::from_parts(151_937_000, 7405) + // Minimum execution time: 143_737_000 picoseconds. + Weight::from_parts(151_572_000, 7405) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1131,8 +1135,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `109` // Estimated: `3574` - // Minimum execution time: 52_912_000 picoseconds. - Weight::from_parts(54_905_094, 3574) + // Minimum execution time: 52_301_000 picoseconds. + Weight::from_parts(54_773_649, 3574) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1146,8 +1150,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3750` - // Minimum execution time: 46_323_000 picoseconds. - Weight::from_parts(47_075_000, 3750) + // Minimum execution time: 45_699_000 picoseconds. + Weight::from_parts(46_961_000, 3750) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1159,8 +1163,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `529` // Estimated: `6469` - // Minimum execution time: 27_120_000 picoseconds. - Weight::from_parts(28_635_000, 6469) + // Minimum execution time: 26_501_000 picoseconds. + Weight::from_parts(27_913_000, 6469) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1172,8 +1176,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `109` // Estimated: `3574` - // Minimum execution time: 42_489_000 picoseconds. - Weight::from_parts(43_230_000, 3574) + // Minimum execution time: 41_673_000 picoseconds. + Weight::from_parts(42_360_000, 3574) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1185,8 +1189,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `56` // Estimated: `3521` - // Minimum execution time: 34_042_000 picoseconds. - Weight::from_parts(34_758_000, 3521) + // Minimum execution time: 32_530_000 picoseconds. + Weight::from_parts(33_997_000, 3521) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1198,8 +1202,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `145` // Estimated: `3610` - // Minimum execution time: 14_322_000 picoseconds. - Weight::from_parts(14_761_000, 3610) + // Minimum execution time: 13_327_000 picoseconds. + Weight::from_parts(13_976_000, 3610) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// The range of component `r` is `[0, 1600]`. @@ -1207,24 +1211,24 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 14_300_000 picoseconds. - Weight::from_parts(14_435_272, 0) - // Standard Error: 357 - .saturating_add(Weight::from_parts(151_410, 0).saturating_mul(r.into())) + // Minimum execution time: 7_317_000 picoseconds. + Weight::from_parts(7_742_783, 0) + // Standard Error: 274 + .saturating_add(Weight::from_parts(166_272, 0).saturating_mul(r.into())) } fn seal_caller() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 315_000 picoseconds. - Weight::from_parts(355_000, 0) + // Minimum execution time: 300_000 picoseconds. + Weight::from_parts(349_000, 0) } fn seal_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 252_000 picoseconds. - Weight::from_parts(300_000, 0) + // Minimum execution time: 248_000 picoseconds. + Weight::from_parts(293_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) @@ -1232,8 +1236,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `306` // Estimated: `3771` - // Minimum execution time: 10_073_000 picoseconds. - Weight::from_parts(10_791_000, 3771) + // Minimum execution time: 10_018_000 picoseconds. + Weight::from_parts(10_399_000, 3771) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) @@ -1242,16 +1246,16 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `403` // Estimated: `3868` - // Minimum execution time: 11_216_000 picoseconds. - Weight::from_parts(11_917_000, 3868) + // Minimum execution time: 11_209_000 picoseconds. + Weight::from_parts(11_640_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: 269_000 picoseconds. - Weight::from_parts(308_000, 0) + // Minimum execution time: 280_000 picoseconds. + Weight::from_parts(309_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) @@ -1261,51 +1265,51 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `473` // Estimated: `3938` - // Minimum execution time: 15_159_000 picoseconds. - Weight::from_parts(15_933_000, 3938) + // Minimum execution time: 14_718_000 picoseconds. + Weight::from_parts(15_292_000, 3938) .saturating_add(RocksDbWeight::get().reads(2_u64)) } fn seal_caller_is_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 367_000 picoseconds. + // Minimum execution time: 336_000 picoseconds. Weight::from_parts(391_000, 0) } fn seal_caller_is_root() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 294_000 picoseconds. - Weight::from_parts(331_000, 0) + // Minimum execution time: 275_000 picoseconds. + Weight::from_parts(296_000, 0) } fn seal_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 275_000 picoseconds. - Weight::from_parts(318_000, 0) + // Minimum execution time: 262_000 picoseconds. + Weight::from_parts(304_000, 0) } fn seal_weight_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 660_000 picoseconds. - Weight::from_parts(697_000, 0) + // Minimum execution time: 628_000 picoseconds. + Weight::from_parts(714_000, 0) } fn seal_ref_time_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 288_000 picoseconds. - Weight::from_parts(306_000, 0) + // Minimum execution time: 246_000 picoseconds. + Weight::from_parts(265_000, 0) } fn seal_balance() -> Weight { // Proof Size summary in bytes: // Measured: `140` // Estimated: `0` - // Minimum execution time: 5_577_000 picoseconds. - Weight::from_parts(5_918_000, 0) + // Minimum execution time: 5_605_000 picoseconds. + Weight::from_parts(5_769_000, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) @@ -1315,8 +1319,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `264` // Estimated: `3729` - // Minimum execution time: 9_264_000 picoseconds. - Weight::from_parts(9_589_000, 3729) + // Minimum execution time: 8_990_000 picoseconds. + Weight::from_parts(9_223_000, 3729) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `Revive::ImmutableDataOf` (r:1 w:0) @@ -1326,10 +1330,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `238 + n * (1 ±0)` // Estimated: `3703 + n * (1 ±0)` - // Minimum execution time: 6_082_000 picoseconds. - Weight::from_parts(6_789_222, 3703) + // Minimum execution time: 6_001_000 picoseconds. + Weight::from_parts(6_630_017, 3703) // Standard Error: 4 - .saturating_add(Weight::from_parts(670, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(622, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1340,39 +1344,46 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_950_000 picoseconds. - Weight::from_parts(2_244_232, 0) + // Minimum execution time: 2_026_000 picoseconds. + Weight::from_parts(2_271_985, 0) // Standard Error: 2 - .saturating_add(Weight::from_parts(574, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(537, 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: 254_000 picoseconds. - Weight::from_parts(304_000, 0) + // Minimum execution time: 287_000 picoseconds. + Weight::from_parts(323_000, 0) } fn seal_minimum_balance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 251_000 picoseconds. - Weight::from_parts(292_000, 0) + // Minimum execution time: 230_000 picoseconds. + Weight::from_parts(275_000, 0) + } + fn seal_return_data_size() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 242_000 picoseconds. + Weight::from_parts(268_000, 0) } fn seal_call_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 262_000 picoseconds. - Weight::from_parts(288_000, 0) + // Minimum execution time: 244_000 picoseconds. + Weight::from_parts(271_000, 0) } fn seal_block_number() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 269_000 picoseconds. - Weight::from_parts(302_000, 0) + // Minimum execution time: 266_000 picoseconds. + Weight::from_parts(304_000, 0) } /// Storage: `System::BlockHash` (r:1 w:0) /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `Measured`) @@ -1380,60 +1391,60 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `30` // Estimated: `3495` - // Minimum execution time: 3_690_000 picoseconds. - Weight::from_parts(3_791_000, 3495) + // Minimum execution time: 3_559_000 picoseconds. + Weight::from_parts(3_697_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: 261_000 picoseconds. - Weight::from_parts(307_000, 0) + // Minimum execution time: 242_000 picoseconds. + Weight::from_parts(294_000, 0) } fn seal_weight_to_fee() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_417_000 picoseconds. - Weight::from_parts(1_547_000, 0) + // Minimum execution time: 1_222_000 picoseconds. + Weight::from_parts(1_387_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: 364_000 picoseconds. - Weight::from_parts(566_499, 0) + // Minimum execution time: 392_000 picoseconds. + Weight::from_parts(397_500, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(237, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(206, 0).saturating_mul(n.into())) } fn seal_call_data_load() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 279_000 picoseconds. - Weight::from_parts(305_000, 0) + // Minimum execution time: 267_000 picoseconds. + Weight::from_parts(322_000, 0) } /// The range of component `n` is `[0, 262144]`. fn seal_call_data_copy(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 265_000 picoseconds. - Weight::from_parts(359_300, 0) + // Minimum execution time: 234_000 picoseconds. + Weight::from_parts(291_182, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(148, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(113, 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: 278_000 picoseconds. - Weight::from_parts(474_421, 0) + // Minimum execution time: 253_000 picoseconds. + Weight::from_parts(271_000, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(237, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(212, 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`) @@ -1450,10 +1461,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `324 + n * (88 ±0)` // Estimated: `3790 + n * (2563 ±0)` - // Minimum execution time: 23_182_000 picoseconds. - Weight::from_parts(23_833_588, 3790) - // Standard Error: 12_448 - .saturating_add(Weight::from_parts(4_277_757, 0).saturating_mul(n.into())) + // Minimum execution time: 22_082_000 picoseconds. + Weight::from_parts(22_815_417, 3790) + // Standard Error: 9_515 + .saturating_add(Weight::from_parts(4_283_767, 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)) @@ -1466,22 +1477,22 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_433_000 picoseconds. - Weight::from_parts(4_321_363, 0) - // Standard Error: 2_536 - .saturating_add(Weight::from_parts(207_597, 0).saturating_mul(t.into())) - // Standard Error: 22 - .saturating_add(Weight::from_parts(957, 0).saturating_mul(n.into())) + // Minimum execution time: 4_242_000 picoseconds. + Weight::from_parts(4_360_337, 0) + // Standard Error: 3_223 + .saturating_add(Weight::from_parts(201_105, 0).saturating_mul(t.into())) + // Standard Error: 28 + .saturating_add(Weight::from_parts(723, 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: 353_000 picoseconds. - Weight::from_parts(78_798, 0) + // Minimum execution time: 340_000 picoseconds. + Weight::from_parts(773_824, 0) // Standard Error: 1 - .saturating_add(Weight::from_parts(762, 0).saturating_mul(i.into())) + .saturating_add(Weight::from_parts(722, 0).saturating_mul(i.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1489,8 +1500,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `744` // Estimated: `744` - // Minimum execution time: 7_701_000 picoseconds. - Weight::from_parts(8_043_000, 744) + // Minimum execution time: 7_741_000 picoseconds. + Weight::from_parts(8_048_000, 744) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -1499,8 +1510,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `10754` // Estimated: `10754` - // Minimum execution time: 42_961_000 picoseconds. - Weight::from_parts(44_719_000, 10754) + // Minimum execution time: 42_314_000 picoseconds. + Weight::from_parts(43_255_000, 10754) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -1509,8 +1520,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `744` // Estimated: `744` - // Minimum execution time: 8_575_000 picoseconds. - Weight::from_parts(9_239_000, 744) + // Minimum execution time: 8_741_000 picoseconds. + Weight::from_parts(9_123_000, 744) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1520,8 +1531,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `10754` // Estimated: `10754` - // Minimum execution time: 43_585_000 picoseconds. - Weight::from_parts(45_719_000, 10754) + // Minimum execution time: 44_703_000 picoseconds. + Weight::from_parts(46_403_000, 10754) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1533,12 +1544,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + o * (1 ±0)` // Estimated: `247 + o * (1 ±0)` - // Minimum execution time: 9_147_000 picoseconds. - Weight::from_parts(9_851_872, 247) - // Standard Error: 40 - .saturating_add(Weight::from_parts(222, 0).saturating_mul(n.into())) - // Standard Error: 40 - .saturating_add(Weight::from_parts(411, 0).saturating_mul(o.into())) + // Minimum execution time: 9_285_000 picoseconds. + Weight::from_parts(10_046_720, 247) + // Standard Error: 37 + .saturating_add(Weight::from_parts(365, 0).saturating_mul(n.into())) + // Standard Error: 37 + .saturating_add(Weight::from_parts(273, 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())) @@ -1550,10 +1561,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_859_000 picoseconds. - Weight::from_parts(9_633_190, 247) - // Standard Error: 55 - .saturating_add(Weight::from_parts(995, 0).saturating_mul(n.into())) + // Minimum execution time: 8_879_000 picoseconds. + Weight::from_parts(9_736_050, 247) + // Standard Error: 48 + .saturating_add(Weight::from_parts(514, 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())) @@ -1565,10 +1576,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_270_000 picoseconds. - Weight::from_parts(9_208_849, 247) - // Standard Error: 67 - .saturating_add(Weight::from_parts(1_686, 0).saturating_mul(n.into())) + // Minimum execution time: 8_475_000 picoseconds. + Weight::from_parts(9_410_206, 247) + // Standard Error: 58 + .saturating_add(Weight::from_parts(1_409, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1579,10 +1590,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_002_000 picoseconds. - Weight::from_parts(8_695_892, 247) - // Standard Error: 48 - .saturating_add(Weight::from_parts(721, 0).saturating_mul(n.into())) + // Minimum execution time: 8_017_000 picoseconds. + Weight::from_parts(8_879_089, 247) + // Standard Error: 51 + .saturating_add(Weight::from_parts(512, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1593,10 +1604,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 9_204_000 picoseconds. - Weight::from_parts(10_176_756, 247) - // Standard Error: 57 - .saturating_add(Weight::from_parts(1_550, 0).saturating_mul(n.into())) + // Minimum execution time: 9_196_000 picoseconds. + Weight::from_parts(10_285_787, 247) + // Standard Error: 65 + .saturating_add(Weight::from_parts(1_553, 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())) @@ -1605,36 +1616,36 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_518_000 picoseconds. - Weight::from_parts(1_578_000, 0) + // Minimum execution time: 1_456_000 picoseconds. + Weight::from_parts(1_593_000, 0) } fn set_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_846_000 picoseconds. - Weight::from_parts(1_996_000, 0) + // Minimum execution time: 1_897_000 picoseconds. + Weight::from_parts(2_059_000, 0) } fn get_transient_storage_empty() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_442_000 picoseconds. - Weight::from_parts(1_562_000, 0) + // Minimum execution time: 1_487_000 picoseconds. + Weight::from_parts(1_588_000, 0) } fn get_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_602_000 picoseconds. - Weight::from_parts(1_730_000, 0) + // Minimum execution time: 1_622_000 picoseconds. + Weight::from_parts(1_732_000, 0) } fn rollback_transient_storage() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_096_000 picoseconds. - Weight::from_parts(1_176_000, 0) + // Minimum execution time: 1_188_000 picoseconds. + Weight::from_parts(1_239_000, 0) } /// The range of component `n` is `[0, 512]`. /// The range of component `o` is `[0, 512]`. @@ -1642,52 +1653,50 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_328_000 picoseconds. - Weight::from_parts(2_470_198, 0) - // Standard Error: 14 - .saturating_add(Weight::from_parts(256, 0).saturating_mul(n.into())) - // Standard Error: 14 - .saturating_add(Weight::from_parts(441, 0).saturating_mul(o.into())) + // Minimum execution time: 2_269_000 picoseconds. + Weight::from_parts(2_528_717, 0) + // Standard Error: 12 + .saturating_add(Weight::from_parts(163, 0).saturating_mul(n.into())) + // Standard Error: 12 + .saturating_add(Weight::from_parts(332, 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_037_000 picoseconds. - Weight::from_parts(2_439_061, 0) - // Standard Error: 17 - .saturating_add(Weight::from_parts(303, 0).saturating_mul(n.into())) + // Minimum execution time: 2_051_000 picoseconds. + Weight::from_parts(2_507_009, 0) + // Standard Error: 20 + .saturating_add(Weight::from_parts(309, 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_900_000 picoseconds. - Weight::from_parts(2_095_135, 0) - // Standard Error: 12 - .saturating_add(Weight::from_parts(310, 0).saturating_mul(n.into())) + // Minimum execution time: 1_829_000 picoseconds. + Weight::from_parts(2_052_749, 0) + // Standard Error: 14 + .saturating_add(Weight::from_parts(350, 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_772_000 picoseconds. - Weight::from_parts(1_964_542, 0) - // Standard Error: 16 - .saturating_add(Weight::from_parts(298, 0).saturating_mul(n.into())) + // Minimum execution time: 1_717_000 picoseconds. + Weight::from_parts(1_930_820, 0) + // Standard Error: 12 + .saturating_add(Weight::from_parts(161, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 512]`. - fn seal_take_transient_storage(n: u32, ) -> Weight { + fn seal_take_transient_storage(_n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_555_000 picoseconds. - Weight::from_parts(2_864_143, 0) - // Standard Error: 22 - .saturating_add(Weight::from_parts(45, 0).saturating_mul(n.into())) + // Minimum execution time: 2_502_000 picoseconds. + Weight::from_parts(2_829_951, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) @@ -1701,14 +1710,16 @@ impl WeightInfo for () { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// The range of component `t` is `[0, 1]`. /// The range of component `i` is `[0, 262144]`. - fn seal_call(t: u32, _i: u32, ) -> Weight { + fn seal_call(t: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1292 + t * (280 ±0)` // Estimated: `4757 + t * (2518 ±0)` - // Minimum execution time: 40_760_000 picoseconds. - Weight::from_parts(45_131_001, 4757) - // Standard Error: 302_594 - .saturating_add(Weight::from_parts(2_769_232, 0).saturating_mul(t.into())) + // Minimum execution time: 40_791_000 picoseconds. + Weight::from_parts(42_421_336, 4757) + // Standard Error: 53_086 + .saturating_add(Weight::from_parts(2_057_850, 0).saturating_mul(t.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(1, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(t.into()))) .saturating_add(RocksDbWeight::get().writes(1_u64)) @@ -1724,8 +1735,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1237` // Estimated: `4702` - // Minimum execution time: 36_975_000 picoseconds. - Weight::from_parts(38_368_000, 4702) + // Minimum execution time: 35_825_000 picoseconds. + Weight::from_parts(37_377_000, 4702) .saturating_add(RocksDbWeight::get().reads(3_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) @@ -1741,10 +1752,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1310` // Estimated: `4769` - // Minimum execution time: 122_553_000 picoseconds. - Weight::from_parts(117_325_822, 4769) + // Minimum execution time: 121_920_000 picoseconds. + Weight::from_parts(115_842_357, 4769) // Standard Error: 10 - .saturating_add(Weight::from_parts(4_147, 0).saturating_mul(i.into())) + .saturating_add(Weight::from_parts(4_062, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1754,63 +1765,63 @@ impl WeightInfo for () { // Measured: `0` // Estimated: `0` // Minimum execution time: 657_000 picoseconds. - Weight::from_parts(3_531_259, 0) + Weight::from_parts(2_219_539, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(1_428, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_413, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_keccak_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_072_000 picoseconds. - Weight::from_parts(5_487_006, 0) + // Minimum execution time: 1_091_000 picoseconds. + Weight::from_parts(4_036_613, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(3_634, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(3_600, 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: 638_000 picoseconds. - Weight::from_parts(3_097_177, 0) + // Minimum execution time: 635_000 picoseconds. + Weight::from_parts(4_636_213, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(1_551, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_514, 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: 682_000 picoseconds. - Weight::from_parts(2_963_774, 0) + // Minimum execution time: 648_000 picoseconds. + Weight::from_parts(3_658_083, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(1_561, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_516, 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_791_000 picoseconds. - Weight::from_parts(27_471_391, 0) + // Minimum execution time: 42_722_000 picoseconds. + Weight::from_parts(28_496_037, 0) // Standard Error: 13 - .saturating_add(Weight::from_parts(5_246, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(5_235, 0).saturating_mul(n.into())) } fn seal_ecdsa_recover() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 46_565_000 picoseconds. - Weight::from_parts(48_251_000, 0) + // Minimum execution time: 46_924_000 picoseconds. + Weight::from_parts(48_639_000, 0) } fn seal_ecdsa_to_eth_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_562_000 picoseconds. - Weight::from_parts(12_664_000, 0) + // Minimum execution time: 12_882_000 picoseconds. + Weight::from_parts(13_108_000, 0) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) @@ -1818,8 +1829,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `300` // Estimated: `3765` - // Minimum execution time: 18_527_000 picoseconds. - Weight::from_parts(19_134_000, 3765) + // Minimum execution time: 17_907_000 picoseconds. + Weight::from_parts(18_634_000, 3765) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1829,8 +1840,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `338` // Estimated: `3803` - // Minimum execution time: 13_843_000 picoseconds. - Weight::from_parts(14_750_000, 3803) + // Minimum execution time: 14_091_000 picoseconds. + Weight::from_parts(14_393_000, 3803) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1840,8 +1851,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `338` // Estimated: `3561` - // Minimum execution time: 13_013_000 picoseconds. - Weight::from_parts(13_612_000, 3561) + // Minimum execution time: 12_824_000 picoseconds. + Weight::from_parts(13_304_000, 3561) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1850,9 +1861,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 15_182_000 picoseconds. - Weight::from_parts(16_987_060, 0) - // Standard Error: 105 - .saturating_add(Weight::from_parts(72_086, 0).saturating_mul(r.into())) + // Minimum execution time: 9_185_000 picoseconds. + Weight::from_parts(10_532_230, 0) + // Standard Error: 189 + .saturating_add(Weight::from_parts(71_786, 0).saturating_mul(r.into())) } } diff --git a/substrate/frame/revive/uapi/src/host.rs b/substrate/frame/revive/uapi/src/host.rs index 2214563faf02..ae4479cd1549 100644 --- a/substrate/frame/revive/uapi/src/host.rs +++ b/substrate/frame/revive/uapi/src/host.rs @@ -87,12 +87,8 @@ pub trait HostFn: private::Sealed { /// Returns the [EIP-155](https://eips.ethereum.org/EIPS/eip-155) chain ID. fn chain_id(output: &mut [u8; 32]); - /// Stores the call data size as little endian U256 value into the supplied buffer. - /// - /// # Parameters - /// - /// - `output`: A reference to the output data buffer to write the call data size. - fn call_data_size(output: &mut [u8; 32]); + /// Returns the call data size. + fn call_data_size() -> u64; /// Call (possibly transferring some amount of funds) into the specified account. /// @@ -170,17 +166,16 @@ pub trait HostFn: private::Sealed { /// otherwise `zero`. fn code_hash(addr: &[u8; 20], output: &mut [u8; 32]); - /// Retrieve the code size for a specified contract address. + /// Returns the code size for a specified contract address. /// /// # Parameters /// /// - `addr`: The address of the contract. - /// - `output`: A reference to the output data buffer to write the code size. /// /// # Note /// /// If `addr` is not a contract the `output` will be zero. - fn code_size(addr: &[u8; 20], output: &mut [u8; 32]); + fn code_size(addr: &[u8; 20]) -> u64; /// Execute code in the context (storage, caller, value) of the current contract. /// @@ -384,12 +379,8 @@ pub trait HostFn: private::Sealed { /// - `output`: A reference to the output data buffer to write the price. fn weight_to_fee(ref_time_limit: u64, proof_size_limit: u64, output: &mut [u8; 32]); - /// Stores the size of the returned data of the last contract call or instantiation. - /// - /// # Parameters - /// - /// - `output`: A reference to the output buffer to write the size. - fn return_data_size(output: &mut [u8; 32]); + /// Returns the size of the returned data of the last contract call or instantiation. + fn return_data_size() -> u64; /// Stores the returned data of the last contract call or contract instantiation. /// diff --git a/substrate/frame/revive/uapi/src/host/riscv64.rs b/substrate/frame/revive/uapi/src/host/riscv64.rs index a73a13ed1af5..d45e0d65646c 100644 --- a/substrate/frame/revive/uapi/src/host/riscv64.rs +++ b/substrate/frame/revive/uapi/src/host/riscv64.rs @@ -69,7 +69,7 @@ mod sys { 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 code_size(address_ptr: *const u8, out_ptr: *mut u8); + pub fn code_size(address_ptr: *const u8) -> u64; pub fn own_code_hash(out_ptr: *mut u8); pub fn caller_is_origin() -> ReturnCode; pub fn caller_is_root() -> ReturnCode; @@ -91,7 +91,7 @@ mod sys { data_ptr: *const u8, data_len: u32, ); - pub fn call_data_size(out_ptr: *mut u8); + pub fn call_data_size() -> u64; pub fn block_number(out_ptr: *mut u8); pub fn block_hash(block_number_ptr: *const u8, out_ptr: *mut u8); pub fn hash_sha2_256(input_ptr: *const u8, input_len: u32, out_ptr: *mut u8); @@ -131,7 +131,7 @@ mod sys { msg_len: u32, out_ptr: *mut u8, ) -> ReturnCode; - pub fn return_data_size(out_ptr: *mut u8); + pub fn return_data_size() -> u64; pub fn return_data_copy(out_ptr: *mut u8, out_len_ptr: *mut u32, offset: u32); } } @@ -386,13 +386,17 @@ impl HostFn for HostFnImpl { unsafe { sys::call_data_load(out_ptr.as_mut_ptr(), offset) }; } + fn call_data_size() -> u64 { + unsafe { sys::call_data_size() } + } + fn return_value(flags: ReturnFlags, return_value: &[u8]) -> ! { unsafe { sys::seal_return(flags.bits(), return_value.as_ptr(), return_value.len() as u32) } panic!("seal_return does not return"); } impl_wrapper_for! { - [u8; 32] => call_data_size, balance, value_transferred, now, chain_id; + [u8; 32] => balance, value_transferred, now, chain_id; [u8; 20] => address, caller, origin; } @@ -425,12 +429,12 @@ impl HostFn for HostFnImpl { unsafe { sys::code_hash(address.as_ptr(), output.as_mut_ptr()) } } - fn code_size(address: &[u8; 20], output: &mut [u8; 32]) { - unsafe { sys::code_size(address.as_ptr(), output.as_mut_ptr()) } + fn code_size(address: &[u8; 20]) -> u64 { + unsafe { sys::code_size(address.as_ptr()) } } - fn return_data_size(output: &mut [u8; 32]) { - unsafe { sys::return_data_size(output.as_mut_ptr()) }; + fn return_data_size() -> u64 { + unsafe { sys::return_data_size() } } fn return_data_copy(output: &mut &mut [u8], offset: u32) {