diff --git a/prdoc/pr_7319.prdoc b/prdoc/pr_7319.prdoc new file mode 100644 index 0000000000000..d572f7e707e1f --- /dev/null +++ b/prdoc/pr_7319.prdoc @@ -0,0 +1,16 @@ +title: '[pallet-revive] pack exceeding syscall arguments into registers' +doc: +- audience: Runtime Dev + description: |- + This PR changes how we call runtime API methods with more than 6 arguments: They are no longer spilled to the stack but packed into registers instead. Pointers are 32 bit wide so we can pack two of them into a single 64 bit register. Since we mostly pass pointers, this technique effectively increases the number of arguments we can pass using the available registers. + + To make this work for `instantiate` too we now pass the code hash and the call data in the same buffer, akin to how the `create` family opcodes work in the EVM. The code hash is fixed in size, implying the start of the constructor call data. +crates: +- name: pallet-revive-fixtures + bump: major +- name: pallet-revive-proc-macro + bump: major +- name: pallet-revive + bump: major +- name: pallet-revive-uapi + bump: major diff --git a/substrate/frame/revive/fixtures/contracts/call_diverging_out_len.rs b/substrate/frame/revive/fixtures/contracts/call_diverging_out_len.rs index 9a8fe5f5f6cc5..d084c4aed6df7 100644 --- a/substrate/frame/revive/fixtures/contracts/call_diverging_out_len.rs +++ b/substrate/frame/revive/fixtures/contracts/call_diverging_out_len.rs @@ -66,12 +66,11 @@ fn assert_instantiate(expected_output: [u8; BUF_SIZE]) { let output_buf_capped = &mut &mut output_buf[..N]; api::instantiate( - &code_hash, u64::MAX, u64::MAX, &[u8::MAX; 32], &[0; 32], - &[0; 32], + &code_hash, None, Some(output_buf_capped), None, diff --git a/substrate/frame/revive/fixtures/contracts/caller_contract.rs b/substrate/frame/revive/fixtures/contracts/caller_contract.rs index d042dc2c22a25..b6a9bf2895fa6 100644 --- a/substrate/frame/revive/fixtures/contracts/caller_contract.rs +++ b/substrate/frame/revive/fixtures/contracts/caller_contract.rs @@ -21,6 +21,9 @@ use common::{input, u256_bytes}; use uapi::{HostFn, HostFnImpl as api, ReturnErrorCode}; +const INPUT: [u8; 8] = [0u8, 1, 34, 51, 68, 85, 102, 119]; +const REVERTED_INPUT: [u8; 7] = [1u8, 34, 51, 68, 85, 102, 119]; + #[no_mangle] #[polkavm_derive::polkavm_export] pub extern "C" fn deploy() {} @@ -36,17 +39,21 @@ pub extern "C" fn call() { let salt = [0u8; 32]; // Callee will use the first 4 bytes of the input to return an exit status. - let input = [0u8, 1, 34, 51, 68, 85, 102, 119]; - let reverted_input = [1u8, 34, 51, 68, 85, 102, 119]; + let mut input_deploy = [0; 32 + INPUT.len()]; + input_deploy[..32].copy_from_slice(code_hash); + input_deploy[32..].copy_from_slice(&INPUT); + + let mut reverted_input_deploy = [0; 32 + REVERTED_INPUT.len()]; + reverted_input_deploy[..32].copy_from_slice(code_hash); + reverted_input_deploy[32..].copy_from_slice(&REVERTED_INPUT); // Fail to deploy the contract since it returns a non-zero exit status. let res = api::instantiate( - code_hash, u64::MAX, // How much ref_time weight to devote for the execution. u64::MAX = use all. u64::MAX, // How much proof_size weight to devote for the execution. u64::MAX = use all. &[u8::MAX; 32], // No deposit limit. &value, - &reverted_input, + &reverted_input_deploy, None, None, Some(&salt), @@ -55,12 +62,11 @@ pub extern "C" fn call() { // Fail to deploy the contract due to insufficient ref_time weight. let res = api::instantiate( - code_hash, 1u64, // too little ref_time weight u64::MAX, // How much proof_size weight to devote for the execution. u64::MAX = use all. &[u8::MAX; 32], // No deposit limit. &value, - &input, + &input_deploy, None, None, Some(&salt), @@ -69,12 +75,11 @@ pub extern "C" fn call() { // Fail to deploy the contract due to insufficient proof_size weight. let res = api::instantiate( - code_hash, u64::MAX, // How much ref_time weight to devote for the execution. u64::MAX = use all. 1u64, // Too little proof_size weight &[u8::MAX; 32], // No deposit limit. &value, - &input, + &input_deploy, None, None, Some(&salt), @@ -85,12 +90,11 @@ pub extern "C" fn call() { let mut callee = [0u8; 20]; api::instantiate( - code_hash, u64::MAX, // How much ref_time weight to devote for the execution. u64::MAX = use all. u64::MAX, // How much proof_size weight to devote for the execution. u64::MAX = use all. &[u8::MAX; 32], // No deposit limit. &value, - &input, + &input_deploy, Some(&mut callee), None, Some(&salt), @@ -101,11 +105,11 @@ pub extern "C" fn call() { let res = api::call( uapi::CallFlags::empty(), &callee, - u64::MAX, // How much ref_time weight to devote for the execution. u64::MAX = use all. - u64::MAX, // How much proof_size weight to devote for the execution. u64::MAX = use all. + u64::MAX, // How much ref_time weight to devote for the execution. u64::MAX = use all. + u64::MAX, // How much proof_size weight to devote for the execution. u64::MAX = use all. &[u8::MAX; 32], // No deposit limit. &value, - &reverted_input, + &REVERTED_INPUT, None, ); assert!(matches!(res, Err(ReturnErrorCode::CalleeReverted))); @@ -118,7 +122,7 @@ pub extern "C" fn call() { u64::MAX, // How much proof_size weight to devote for the execution. u64::MAX = use all. &[u8::MAX; 32], // No deposit limit. &value, - &input, + &INPUT, None, ); assert!(matches!(res, Err(ReturnErrorCode::OutOfResources))); @@ -127,11 +131,11 @@ pub extern "C" fn call() { let res = api::call( uapi::CallFlags::empty(), &callee, - u64::MAX, // How much ref_time weight to devote for the execution. u64::MAX = use all. - 1u64, // too little proof_size weight + u64::MAX, // How much ref_time weight to devote for the execution. u64::MAX = use all. + 1u64, // too little proof_size weight &[u8::MAX; 32], // No deposit limit. &value, - &input, + &INPUT, None, ); assert!(matches!(res, Err(ReturnErrorCode::OutOfResources))); @@ -141,13 +145,13 @@ pub extern "C" fn call() { api::call( uapi::CallFlags::empty(), &callee, - u64::MAX, // How much ref_time weight to devote for the execution. u64::MAX = use all. - u64::MAX, // How much proof_size weight to devote for the execution. u64::MAX = use all. + u64::MAX, // How much ref_time weight to devote for the execution. u64::MAX = use all. + u64::MAX, // How much proof_size weight to devote for the execution. u64::MAX = use all. &[u8::MAX; 32], // No deposit limit. &value, - &input, + &INPUT, Some(&mut &mut output[..]), ) .unwrap(); - assert_eq!(&output, &input[4..]) + assert_eq!(&output, &INPUT[4..]) } diff --git a/substrate/frame/revive/fixtures/contracts/create1_with_value.rs b/substrate/frame/revive/fixtures/contracts/create1_with_value.rs index 3554f8f620a29..a694a9b091898 100644 --- a/substrate/frame/revive/fixtures/contracts/create1_with_value.rs +++ b/substrate/frame/revive/fixtures/contracts/create1_with_value.rs @@ -34,16 +34,6 @@ pub extern "C" fn call() { api::value_transferred(&mut value); // Deploy the contract with no salt (equivalent to create1). - let ret = api::instantiate( - code_hash, - u64::MAX, - u64::MAX, - &[u8::MAX; 32], - &value, - &[], - None, - None, - None - ); - assert!(ret.is_ok()); + api::instantiate(u64::MAX, u64::MAX, &[u8::MAX; 32], &value, code_hash, None, None, None) + .unwrap(); } diff --git a/substrate/frame/revive/fixtures/contracts/create_storage_and_instantiate.rs b/substrate/frame/revive/fixtures/contracts/create_storage_and_instantiate.rs index f627bc8ba6c41..3db5ee1c573e1 100644 --- a/substrate/frame/revive/fixtures/contracts/create_storage_and_instantiate.rs +++ b/substrate/frame/revive/fixtures/contracts/create_storage_and_instantiate.rs @@ -30,22 +30,24 @@ pub extern "C" fn deploy() {} #[polkavm_derive::polkavm_export] pub extern "C" fn call() { input!( - input: [u8; 4], code_hash: &[u8; 32], + input: [u8; 4], deposit_limit: &[u8; 32], ); let value = u256_bytes(10_000u64); let salt = [0u8; 32]; let mut address = [0u8; 20]; + let mut deploy_input = [0; 32 + 4]; + deploy_input[..32].copy_from_slice(code_hash); + deploy_input[32..].copy_from_slice(&input); let ret = api::instantiate( - code_hash, u64::MAX, // How much ref_time weight to devote for the execution. u64::MAX = use all. u64::MAX, // How much proof_size weight to devote for the execution. u64::MAX = use all. deposit_limit, &value, - input, + &deploy_input, Some(&mut address), None, Some(&salt), diff --git a/substrate/frame/revive/fixtures/contracts/destroy_and_transfer.rs b/substrate/frame/revive/fixtures/contracts/destroy_and_transfer.rs index c2c7da528ba7c..b5face97e2360 100644 --- a/substrate/frame/revive/fixtures/contracts/destroy_and_transfer.rs +++ b/substrate/frame/revive/fixtures/contracts/destroy_and_transfer.rs @@ -29,17 +29,15 @@ const VALUE: [u8; 32] = u256_bytes(65536); pub extern "C" fn deploy() { input!(code_hash: &[u8; 32],); - let input = [0u8; 0]; let mut address = [0u8; 20]; let salt = [47u8; 32]; api::instantiate( - code_hash, u64::MAX, // How much ref_time weight to devote for the execution. u64::MAX = use all. u64::MAX, // How much proof_size weight to devote for the execution. u64::MAX = use all. &[u8::MAX; 32], // No deposit limit. &VALUE, - &input, + code_hash, Some(&mut address), None, Some(&salt), diff --git a/substrate/frame/revive/fixtures/contracts/instantiate_return_code.rs b/substrate/frame/revive/fixtures/contracts/instantiate_return_code.rs index f7cbd75be5aaa..a3643bdedbdbd 100644 --- a/substrate/frame/revive/fixtures/contracts/instantiate_return_code.rs +++ b/substrate/frame/revive/fixtures/contracts/instantiate_return_code.rs @@ -28,16 +28,14 @@ pub extern "C" fn deploy() {} #[no_mangle] #[polkavm_derive::polkavm_export] pub extern "C" fn call() { - input!(buffer, 36, code_hash: &[u8; 32],); - let input = &buffer[32..]; + input!(buffer: &[u8; 36],); let err_code = match api::instantiate( - code_hash, - u64::MAX, // How much ref_time weight to devote for the execution. u64::MAX = use all. - u64::MAX, // How much proof_size weight to devote for the execution. u64::MAX = use all. - &[u8::MAX; 32], // No deposit limit. + u64::MAX, // How much ref_time weight to devote for the execution. u64::MAX = use all. + u64::MAX, // How much proof_size weight to devote for the execution. u64::MAX = use all. + &[u8::MAX; 32], // No deposit limit. &u256_bytes(10_000u64), // Value to transfer. - input, + buffer, None, None, Some(&[0u8; 32]), // Salt. diff --git a/substrate/frame/revive/fixtures/contracts/return_data_api.rs b/substrate/frame/revive/fixtures/contracts/return_data_api.rs index 1407e5323ea18..e8aeeea44bde7 100644 --- a/substrate/frame/revive/fixtures/contracts/return_data_api.rs +++ b/substrate/frame/revive/fixtures/contracts/return_data_api.rs @@ -88,8 +88,9 @@ fn assert_balance_transfer_does_reset() { &[u8::MAX; 32], &u256_bytes(128), &[], - None - ).unwrap(); + None, + ) + .unwrap(); assert_return_data_size_of(0); } @@ -117,13 +118,16 @@ pub extern "C" fn call() { input }; let mut instantiate = |exit_flag| { + let input = construct_input(exit_flag); + let mut deploy_input = [0; 32 + INPUT_BUF_SIZE]; + deploy_input[..32].copy_from_slice(code_hash); + deploy_input[32..].copy_from_slice(&input); api::instantiate( - code_hash, u64::MAX, u64::MAX, &[u8::MAX; 32], &[0; 32], - &construct_input(exit_flag), + &deploy_input, Some(&mut address_buf), None, None, diff --git a/substrate/frame/revive/proc-macro/src/lib.rs b/substrate/frame/revive/proc-macro/src/lib.rs index 6e38063d20a67..6f087c86b5ffd 100644 --- a/substrate/frame/revive/proc-macro/src/lib.rs +++ b/substrate/frame/revive/proc-macro/src/lib.rs @@ -355,6 +355,11 @@ where { const ALLOWED_REGISTERS: usize = 6; + // too many arguments + if param_names.clone().count() > ALLOWED_REGISTERS { + panic!("Syscalls take a maximum of {ALLOWED_REGISTERS} arguments"); + } + // all of them take one register but we truncate them before passing into the function // it is important to not allow any type which has illegal bit patterns like 'bool' if !param_types.clone().all(|ty| { @@ -369,39 +374,7 @@ where panic!("Only primitive unsigned integers are allowed as arguments to syscalls"); } - // too many arguments: pass as pointer to a struct in memory - if param_names.clone().count() > ALLOWED_REGISTERS { - let fields = param_names.clone().zip(param_types.clone()).map(|(name, ty)| { - quote! { - #name: #ty, - } - }); - return quote! { - #[derive(Default)] - #[repr(C)] - struct Args { - #(#fields)* - } - let Args { #(#param_names,)* } = { - let len = ::core::mem::size_of::(); - let mut args = Args::default(); - let ptr = &mut args as *mut Args as *mut u8; - // Safety - // 1. The struct is initialized at all times. - // 2. We only allow primitive integers (no bools) as arguments so every bit pattern is safe. - // 3. The reference doesn't outlive the args field. - // 4. There is only the single reference to the args field. - // 5. The length of the generated slice is the same as the struct. - let reference = unsafe { - ::core::slice::from_raw_parts_mut(ptr, len) - }; - memory.read_into_buf(__a0__ as _, reference)?; - args - }; - } - } - - // otherwise: one argument per register + // one argument per register let bindings = param_names.zip(param_types).enumerate().map(|(idx, (name, ty))| { let reg = quote::format_ident!("__a{}__", idx); quote! { diff --git a/substrate/frame/revive/rpc/examples/js/pvm/FlipperCaller.polkavm b/substrate/frame/revive/rpc/examples/js/pvm/FlipperCaller.polkavm index 29efafd8722db..b7b037c1c7b31 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 78455fcdd7c64..2fc5e139825aa 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 a19ed28dd9b09..d3d648cd2125d 100644 --- a/substrate/frame/revive/src/benchmarking/mod.rs +++ b/substrate/frame/revive/src/benchmarking/mod.rs @@ -39,7 +39,7 @@ use frame_support::{ weights::{Weight, WeightMeter}, }; use frame_system::RawOrigin; -use pallet_revive_uapi::{CallFlags, ReturnErrorCode, StorageFlags}; +use pallet_revive_uapi::{pack_hi_lo, CallFlags, ReturnErrorCode, StorageFlags}; use sp_runtime::traits::{Bounded, Hash}; /// How many runs we do per API benchmark. @@ -1650,16 +1650,12 @@ mod benchmarks { { result = runtime.bench_call( memory.as_mut_slice(), - CallFlags::CLONE_INPUT.bits(), // flags - 0, // callee_ptr - u64::MAX, // ref_time_limit - u64::MAX, // proof_size_limit - callee_len, // deposit_ptr - callee_len + deposit_len, // value_ptr - 0, // input_data_ptr - 0, // input_data_len - SENTINEL, // output_ptr - 0, // output_len_ptr + pack_hi_lo(CallFlags::CLONE_INPUT.bits(), 0), // flags + callee + u64::MAX, // ref_time_limit + u64::MAX, // proof_size_limit + pack_hi_lo(callee_len, callee_len + deposit_len), // deposit_ptr + value_pr + pack_hi_lo(0, 0), // input len + data ptr + pack_hi_lo(0, SENTINEL), // output len + data ptr ); } @@ -1690,15 +1686,12 @@ mod benchmarks { { result = runtime.bench_delegate_call( memory.as_mut_slice(), - 0, // flags - 0, // address_ptr - u64::MAX, // ref_time_limit - u64::MAX, // proof_size_limit - address_len, // deposit_ptr - 0, // input_data_ptr - 0, // input_data_len - SENTINEL, // output_ptr - 0, + pack_hi_lo(0, 0), // flags + address ptr + u64::MAX, // ref_time_limit + u64::MAX, // proof_size_limit + address_len, // deposit_ptr + pack_hi_lo(0, 0), // input len + data ptr + pack_hi_lo(0, SENTINEL), // output len + ptr ); } @@ -1713,7 +1706,6 @@ mod benchmarks { let code = WasmModule::dummy(); let hash = Contract::::with_index(1, WasmModule::dummy(), vec![])?.info()?.code_hash; let hash_bytes = hash.encode(); - let hash_len = hash_bytes.len() as u32; let value: BalanceOf = 1_000_000u32.into(); let value_bytes = Into::::into(value).encode(); @@ -1732,11 +1724,12 @@ mod benchmarks { let mut runtime = crate::wasm::Runtime::<_, [u8]>::new(&mut ext, vec![]); let input = vec![42u8; i as _]; + let input_len = hash_bytes.len() as u32 + input.len() as u32; let salt = [42u8; 32]; let deployer = T::AddressMapper::to_address(&account_id); let addr = crate::address::create2(&deployer, &code.code, &input, &salt); let account_id = T::AddressMapper::to_fallback_account_id(&addr); - let mut memory = memory!(hash_bytes, deposit_bytes, value_bytes, input, salt,); + let mut memory = memory!(hash_bytes, input, deposit_bytes, value_bytes, salt,); let mut offset = { let mut current = 0u32; @@ -1753,17 +1746,12 @@ mod benchmarks { { result = runtime.bench_instantiate( memory.as_mut_slice(), - 0, // code_hash_ptr - u64::MAX, // ref_time_limit - u64::MAX, // proof_size_limit - offset(hash_len), // deposit_ptr - offset(deposit_len), // value_ptr - offset(value_len), // input_data_ptr - i, // input_data_len - SENTINEL, // address_ptr - SENTINEL, // output_ptr - 0, // output_len_ptr - offset(i), // salt_ptr + u64::MAX, // ref_time_limit + u64::MAX, // proof_size_limit + pack_hi_lo(offset(input_len), offset(deposit_len)), // deopsit_ptr + value_ptr + pack_hi_lo(input_len, 0), // input_data_len + input_data + pack_hi_lo(0, SENTINEL), // output_len_ptr + output_ptr + pack_hi_lo(SENTINEL, offset(value_len)), // address_ptr + salt_ptr ); } diff --git a/substrate/frame/revive/src/tests.rs b/substrate/frame/revive/src/tests.rs index d8b60e38da5ef..db4b4da2b05e3 100644 --- a/substrate/frame/revive/src/tests.rs +++ b/substrate/frame/revive/src/tests.rs @@ -1584,13 +1584,13 @@ fn instantiate_return_code() { // Contract has only the minimal balance so any transfer will fail. ::Currency::set_balance(&contract.account_id, min_balance); let result = builder::bare_call(contract.addr) - .data(callee_hash.clone()) + .data(callee_hash.iter().chain(&0u32.to_le_bytes()).cloned().collect()) .build_and_unwrap_result(); assert_return_code!(result, RuntimeReturnCode::TransferFailed); // Contract has enough balance but the passed code hash is invalid ::Currency::set_balance(&contract.account_id, min_balance + 10_000); - let result = builder::bare_call(contract.addr).data(vec![0; 33]).build(); + let result = builder::bare_call(contract.addr).data(vec![0; 36]).build(); assert_err!(result.result, >::CodeNotFound); // Contract has enough balance but callee reverts because "1" is passed. @@ -3129,7 +3129,7 @@ fn deposit_limit_in_nested_instantiate() { let ret = builder::bare_call(addr_caller) .origin(RuntimeOrigin::signed(BOB)) .storage_deposit_limit(DepositLimit::Balance(callee_info_len + 2 + ED + 1)) - .data((0u32, &code_hash_callee, &U256::MAX.to_little_endian()).encode()) + .data((&code_hash_callee, 0u32, &U256::MAX.to_little_endian()).encode()) .build_and_unwrap_result(); assert_return_code!(ret, RuntimeReturnCode::OutOfResources); // The charges made on instantiation should be rolled back. @@ -3141,7 +3141,7 @@ fn deposit_limit_in_nested_instantiate() { let ret = builder::bare_call(addr_caller) .origin(RuntimeOrigin::signed(BOB)) .storage_deposit_limit(DepositLimit::Balance(callee_info_len + 2 + ED + 2)) - .data((1u32, &code_hash_callee, U256::from(0u64)).encode()) + .data((&code_hash_callee, 1u32, U256::from(0u64)).encode()) .build_and_unwrap_result(); assert_return_code!(ret, RuntimeReturnCode::OutOfResources); // The charges made on the instantiation should be rolled back. @@ -3153,7 +3153,7 @@ fn deposit_limit_in_nested_instantiate() { let ret = builder::bare_call(addr_caller) .origin(RuntimeOrigin::signed(BOB)) .storage_deposit_limit(DepositLimit::Balance(callee_info_len + 2 + ED + 2)) - .data((0u32, &code_hash_callee, U256::from(callee_info_len + 2 + ED + 1)).encode()) + .data((&code_hash_callee, 1u32, U256::from(callee_info_len + 2 + ED + 1)).encode()) .build_and_unwrap_result(); assert_return_code!(ret, RuntimeReturnCode::OutOfResources); // The charges made on the instantiation should be rolled back. @@ -3166,7 +3166,7 @@ fn deposit_limit_in_nested_instantiate() { let ret = builder::bare_call(addr_caller) .origin(RuntimeOrigin::signed(BOB)) .storage_deposit_limit(DepositLimit::Balance(callee_info_len + 2 + ED + 3)) // enough parent limit - .data((1u32, &code_hash_callee, U256::from(callee_info_len + 2 + ED + 2)).encode()) + .data((&code_hash_callee, 1u32, U256::from(callee_info_len + 2 + ED + 2)).encode()) .build_and_unwrap_result(); assert_return_code!(ret, RuntimeReturnCode::OutOfResources); // The charges made on the instantiation should be rolled back. @@ -3176,7 +3176,7 @@ fn deposit_limit_in_nested_instantiate() { let result = builder::bare_call(addr_caller) .origin(RuntimeOrigin::signed(BOB)) .storage_deposit_limit((callee_info_len + 2 + ED + 4 + 2).into()) - .data((1u32, &code_hash_callee, U256::from(callee_info_len + 2 + ED + 3 + 2)).encode()) + .data((&code_hash_callee, 1u32, U256::from(callee_info_len + 2 + ED + 3 + 2)).encode()) .build(); let returned = result.result.unwrap(); diff --git a/substrate/frame/revive/src/wasm/runtime.rs b/substrate/frame/revive/src/wasm/runtime.rs index 4fbcfe1b47f5b..d02c75247a4fe 100644 --- a/substrate/frame/revive/src/wasm/runtime.rs +++ b/substrate/frame/revive/src/wasm/runtime.rs @@ -569,6 +569,11 @@ fn already_charged(_: u32) -> Option { None } +/// Helper to extract two `u32` values from a given `u64` register. +fn extract_hi_lo(reg: u64) -> (u32, u32) { + ((reg >> 32) as u32, reg as u32) +} + /// Can only be used for one call. pub struct Runtime<'a, E: Ext, M: ?Sized> { ext: &'a mut E, @@ -1199,17 +1204,18 @@ pub mod env { fn call( &mut self, memory: &mut M, - flags: u32, - callee_ptr: u32, + flags_and_callee: u64, ref_time_limit: u64, proof_size_limit: u64, - deposit_ptr: u32, - value_ptr: u32, - input_data_ptr: u32, - input_data_len: u32, - output_ptr: u32, - output_len_ptr: u32, + deposit_and_value: u64, + input_data: u64, + output_data: u64, ) -> Result { + let (flags, callee_ptr) = extract_hi_lo(flags_and_callee); + let (deposit_ptr, value_ptr) = extract_hi_lo(deposit_and_value); + let (input_data_len, input_data_ptr) = extract_hi_lo(input_data); + let (output_len_ptr, output_ptr) = extract_hi_lo(output_data); + self.call( memory, CallFlags::from_bits(flags).ok_or(Error::::InvalidCallFlags)?, @@ -1230,16 +1236,17 @@ pub mod env { fn delegate_call( &mut self, memory: &mut M, - flags: u32, - address_ptr: u32, + flags_and_callee: u64, ref_time_limit: u64, proof_size_limit: u64, deposit_ptr: u32, - input_data_ptr: u32, - input_data_len: u32, - output_ptr: u32, - output_len_ptr: u32, + input_data: u64, + output_data: u64, ) -> Result { + let (flags, address_ptr) = extract_hi_lo(flags_and_callee); + let (input_data_len, input_data_ptr) = extract_hi_lo(input_data); + let (output_len_ptr, output_ptr) = extract_hi_lo(output_data); + self.call( memory, CallFlags::from_bits(flags).ok_or(Error::::InvalidCallFlags)?, @@ -1261,18 +1268,24 @@ pub mod env { fn instantiate( &mut self, memory: &mut M, - code_hash_ptr: u32, ref_time_limit: u64, proof_size_limit: u64, - deposit_ptr: u32, - value_ptr: u32, - input_data_ptr: u32, - input_data_len: u32, - address_ptr: u32, - output_ptr: u32, - output_len_ptr: u32, - salt_ptr: u32, + deposit_and_value: u64, + input_data: u64, + output_data: u64, + address_and_salt: u64, ) -> Result { + let (deposit_ptr, value_ptr) = extract_hi_lo(deposit_and_value); + let (input_data_len, code_hash_ptr) = extract_hi_lo(input_data); + let (output_len_ptr, output_ptr) = extract_hi_lo(output_data); + let (address_ptr, salt_ptr) = extract_hi_lo(address_and_salt); + let Some(input_data_ptr) = code_hash_ptr.checked_add(32) else { + return Err(Error::::OutOfBounds.into()); + }; + let Some(input_data_len) = input_data_len.checked_sub(32) else { + return Err(Error::::OutOfBounds.into()); + }; + self.instantiate( memory, code_hash_ptr, diff --git a/substrate/frame/revive/src/weights.rs b/substrate/frame/revive/src/weights.rs index 52153d74ca758..086b64c5dde40 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-12-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-01-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `19e0eeaa3bc2`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `cc3478f23e9a`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: @@ -141,8 +141,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `109` // Estimated: `1594` - // Minimum execution time: 2_859_000 picoseconds. - Weight::from_parts(3_007_000, 1594) + // Minimum execution time: 2_796_000 picoseconds. + Weight::from_parts(2_958_000, 1594) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -152,10 +152,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `425 + k * (69 ±0)` // Estimated: `415 + k * (70 ±0)` - // Minimum execution time: 15_640_000 picoseconds. - Weight::from_parts(1_609_026, 415) - // Standard Error: 1_359 - .saturating_add(Weight::from_parts(1_204_420, 0).saturating_mul(k.into())) + // Minimum execution time: 16_135_000 picoseconds. + Weight::from_parts(3_227_098, 415) + // Standard Error: 1_106 + .saturating_add(Weight::from_parts(1_175_210, 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)) @@ -177,17 +177,17 @@ impl WeightInfo for SubstrateWeight { /// The range of component `c` is `[0, 262144]`. fn call_with_code_per_byte(_c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1463` - // Estimated: `7403` - // Minimum execution time: 89_437_000 picoseconds. - Weight::from_parts(94_285_182, 7403) + // Measured: `1502` + // Estimated: `7442` + // Minimum execution time: 89_144_000 picoseconds. + Weight::from_parts(93_719_381, 7442) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Balances::Holds` (r:2 w:2) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) @@ -202,14 +202,14 @@ impl WeightInfo for SubstrateWeight { /// The range of component `i` is `[0, 262144]`. fn instantiate_with_code(c: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `364` - // Estimated: `6327` - // Minimum execution time: 187_904_000 picoseconds. - Weight::from_parts(153_252_081, 6327) - // Standard Error: 11 - .saturating_add(Weight::from_parts(49, 0).saturating_mul(c.into())) - // Standard Error: 11 - .saturating_add(Weight::from_parts(4_528, 0).saturating_mul(i.into())) + // Measured: `401` + // Estimated: `6349` + // Minimum execution time: 185_726_000 picoseconds. + Weight::from_parts(165_030_228, 6349) + // Standard Error: 10 + .saturating_add(Weight::from_parts(10, 0).saturating_mul(c.into())) + // Standard Error: 10 + .saturating_add(Weight::from_parts(4_453, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -226,16 +226,16 @@ 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`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// The range of component `i` is `[0, 262144]`. fn instantiate(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1296` - // Estimated: `4758` - // Minimum execution time: 154_656_000 picoseconds. - Weight::from_parts(139_308_398, 4758) - // Standard Error: 16 - .saturating_add(Weight::from_parts(4_421, 0).saturating_mul(i.into())) + // Measured: `1294` + // Estimated: `4739` + // Minimum execution time: 154_669_000 picoseconds. + Weight::from_parts(138_463_785, 4739) + // Standard Error: 15 + .saturating_add(Weight::from_parts(4_389, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -253,43 +253,41 @@ impl WeightInfo for SubstrateWeight { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) fn call() -> Weight { // Proof Size summary in bytes: - // Measured: `1463` - // Estimated: `7403` - // Minimum execution time: 138_815_000 picoseconds. - Weight::from_parts(149_067_000, 7403) + // Measured: `1502` + // Estimated: `7442` + // Minimum execution time: 137_822_000 picoseconds. + Weight::from_parts(146_004_000, 7442) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:0 w:1) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. - fn upload_code(c: u32, ) -> Weight { + fn upload_code(_c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `3574` - // Minimum execution time: 49_978_000 picoseconds. - Weight::from_parts(51_789_325, 3574) - // Standard Error: 0 - .saturating_add(Weight::from_parts(1, 0).saturating_mul(c.into())) + // Measured: `164` + // Estimated: `3629` + // Minimum execution time: 53_476_000 picoseconds. + Weight::from_parts(55_795_699, 3629) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:0 w:1) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) fn remove_code() -> Weight { // Proof Size summary in bytes: - // Measured: `285` - // Estimated: `3750` - // Minimum execution time: 43_833_000 picoseconds. - Weight::from_parts(44_660_000, 3750) + // Measured: `322` + // Estimated: `3787` + // Minimum execution time: 41_955_000 picoseconds. + Weight::from_parts(43_749_000, 3787) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -301,34 +299,34 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `529` // Estimated: `6469` - // Minimum execution time: 26_717_000 picoseconds. - Weight::from_parts(28_566_000, 6469) + // Minimum execution time: 22_763_000 picoseconds. + Weight::from_parts(23_219_000, 6469) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: `Revive::AddressSuffix` (r:1 w:1) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) fn map_account() -> Weight { // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `3574` - // Minimum execution time: 39_401_000 picoseconds. - Weight::from_parts(40_542_000, 3574) + // Measured: `164` + // Estimated: `3629` + // Minimum execution time: 45_478_000 picoseconds. + Weight::from_parts(46_658_000, 3629) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// Storage: `Revive::AddressSuffix` (r:0 w:1) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) fn unmap_account() -> Weight { // Proof Size summary in bytes: - // Measured: `56` - // Estimated: `3521` - // Minimum execution time: 31_570_000 picoseconds. - Weight::from_parts(32_302_000, 3521) + // Measured: `93` + // Estimated: `3558` + // Minimum execution time: 33_359_000 picoseconds. + Weight::from_parts(34_196_000, 3558) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -340,8 +338,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `145` // Estimated: `3610` - // Minimum execution time: 13_607_000 picoseconds. - Weight::from_parts(13_903_000, 3610) + // Minimum execution time: 13_663_000 picoseconds. + Weight::from_parts(14_278_000, 3610) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// The range of component `r` is `[0, 1600]`. @@ -349,24 +347,24 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_400_000 picoseconds. - Weight::from_parts(8_388_251, 0) - // Standard Error: 283 - .saturating_add(Weight::from_parts(165_630, 0).saturating_mul(r.into())) + // Minimum execution time: 6_966_000 picoseconds. + Weight::from_parts(7_708_050, 0) + // Standard Error: 238 + .saturating_add(Weight::from_parts(167_115, 0).saturating_mul(r.into())) } fn seal_caller() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 275_000 picoseconds. - Weight::from_parts(305_000, 0) + // Minimum execution time: 332_000 picoseconds. + Weight::from_parts(378_000, 0) } fn seal_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 224_000 picoseconds. - Weight::from_parts(265_000, 0) + // Minimum execution time: 303_000 picoseconds. + Weight::from_parts(329_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) @@ -374,18 +372,18 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `306` // Estimated: `3771` - // Minimum execution time: 10_004_000 picoseconds. - Weight::from_parts(10_336_000, 3771) + // Minimum execution time: 10_014_000 picoseconds. + Weight::from_parts(10_549_000, 3771) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) fn seal_to_account_id() -> Weight { // Proof Size summary in bytes: - // Measured: `212` - // Estimated: `3677` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(4_000_000, 3677) + // Measured: `248` + // Estimated: `3713` + // Minimum execution time: 9_771_000 picoseconds. + Weight::from_parts(10_092_000, 3713) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) @@ -394,16 +392,16 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `403` // Estimated: `3868` - // Minimum execution time: 11_054_000 picoseconds. - Weight::from_parts(11_651_000, 3868) + // Minimum execution time: 11_260_000 picoseconds. + Weight::from_parts(11_626_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: 252_000 picoseconds. - Weight::from_parts(305_000, 0) + // Minimum execution time: 307_000 picoseconds. + Weight::from_parts(328_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) @@ -413,51 +411,51 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `473` // Estimated: `3938` - // Minimum execution time: 14_461_000 picoseconds. - Weight::from_parts(15_049_000, 3938) + // Minimum execution time: 14_675_000 picoseconds. + Weight::from_parts(15_168_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: 312_000 picoseconds. - Weight::from_parts(338_000, 0) + // Minimum execution time: 332_000 picoseconds. + Weight::from_parts(357_000, 0) } fn seal_caller_is_root() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 243_000 picoseconds. - Weight::from_parts(299_000, 0) + // Minimum execution time: 298_000 picoseconds. + Weight::from_parts(332_000, 0) } fn seal_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 231_000 picoseconds. - Weight::from_parts(271_000, 0) + // Minimum execution time: 313_000 picoseconds. + Weight::from_parts(336_000, 0) } fn seal_weight_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 683_000 picoseconds. - Weight::from_parts(732_000, 0) + // Minimum execution time: 663_000 picoseconds. + Weight::from_parts(730_000, 0) } fn seal_ref_time_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 226_000 picoseconds. - Weight::from_parts(273_000, 0) + // Minimum execution time: 292_000 picoseconds. + Weight::from_parts(344_000, 0) } fn seal_balance() -> Weight { // Proof Size summary in bytes: // Measured: `102` // Estimated: `0` - // Minimum execution time: 4_626_000 picoseconds. - Weight::from_parts(4_842_000, 0) + // Minimum execution time: 4_604_000 picoseconds. + Weight::from_parts(4_875_000, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) @@ -467,8 +465,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `264` // Estimated: `3729` - // Minimum execution time: 12_309_000 picoseconds. - Weight::from_parts(12_653_000, 3729) + // Minimum execution time: 12_252_000 picoseconds. + Weight::from_parts(12_641_000, 3729) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: `Revive::ImmutableDataOf` (r:1 w:0) @@ -478,10 +476,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `238 + n * (1 ±0)` // Estimated: `3703 + n * (1 ±0)` - // Minimum execution time: 5_838_000 picoseconds. - Weight::from_parts(9_570_778, 3703) - // Standard Error: 19 - .saturating_add(Weight::from_parts(721, 0).saturating_mul(n.into())) + // Minimum execution time: 6_005_000 picoseconds. + Weight::from_parts(9_550_692, 3703) + // Standard Error: 18 + .saturating_add(Weight::from_parts(710, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -492,67 +490,67 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_910_000 picoseconds. - Weight::from_parts(2_205_396, 0) + // Minimum execution time: 1_981_000 picoseconds. + Weight::from_parts(2_297_488, 0) // Standard Error: 2 - .saturating_add(Weight::from_parts(538, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(528, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().writes(1_u64)) } fn seal_value_transferred() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 224_000 picoseconds. - Weight::from_parts(274_000, 0) + // Minimum execution time: 279_000 picoseconds. + Weight::from_parts(309_000, 0) } fn seal_minimum_balance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 231_000 picoseconds. - Weight::from_parts(279_000, 0) + // Minimum execution time: 289_000 picoseconds. + Weight::from_parts(315_000, 0) } fn seal_return_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 229_000 picoseconds. - Weight::from_parts(267_000, 0) + // Minimum execution time: 253_000 picoseconds. + Weight::from_parts(310_000, 0) } fn seal_call_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 218_000 picoseconds. - Weight::from_parts(267_000, 0) + // Minimum execution time: 291_000 picoseconds. + Weight::from_parts(338_000, 0) } fn seal_gas_limit() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 225_000 picoseconds. - Weight::from_parts(280_000, 0) + // Minimum execution time: 266_000 picoseconds. + Weight::from_parts(331_000, 0) } fn seal_gas_price() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 274_000 picoseconds. - Weight::from_parts(323_000, 0) + // Minimum execution time: 250_000 picoseconds. + Weight::from_parts(314_000, 0) } fn seal_base_fee() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 239_000 picoseconds. - Weight::from_parts(290_000, 0) + // Minimum execution time: 266_000 picoseconds. + Weight::from_parts(341_000, 0) } fn seal_block_number() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 224_000 picoseconds. - Weight::from_parts(274_000, 0) + // Minimum execution time: 281_000 picoseconds. + Weight::from_parts(314_000, 0) } /// Storage: `System::BlockHash` (r:1 w:0) /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `Measured`) @@ -560,60 +558,60 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `30` // Estimated: `3495` - // Minimum execution time: 3_430_000 picoseconds. - Weight::from_parts(3_692_000, 3495) + // Minimum execution time: 3_557_000 picoseconds. + Weight::from_parts(3_816_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: 241_000 picoseconds. - Weight::from_parts(290_000, 0) + // Minimum execution time: 280_000 picoseconds. + Weight::from_parts(316_000, 0) } fn seal_weight_to_fee() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_355_000 picoseconds. - Weight::from_parts(1_493_000, 0) + // Minimum execution time: 1_413_000 picoseconds. + Weight::from_parts(1_477_000, 0) } /// The range of component `n` is `[0, 262140]`. fn seal_copy_to_contract(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 348_000 picoseconds. - Weight::from_parts(1_004_890, 0) + // Minimum execution time: 383_000 picoseconds. + Weight::from_parts(602_481, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(202, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(201, 0).saturating_mul(n.into())) } fn seal_call_data_load() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 222_000 picoseconds. - Weight::from_parts(256_000, 0) + // Minimum execution time: 327_000 picoseconds. + Weight::from_parts(365_000, 0) } /// The range of component `n` is `[0, 262144]`. fn seal_call_data_copy(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 240_000 picoseconds. - Weight::from_parts(330_609, 0) + // Minimum execution time: 334_000 picoseconds. + Weight::from_parts(205_756, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(114, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(116, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262140]`. fn seal_return(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 232_000 picoseconds. - Weight::from_parts(264_000, 0) + // Minimum execution time: 278_000 picoseconds. + Weight::from_parts(611_031, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(208, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(202, 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`) @@ -628,12 +626,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 32]`. fn seal_terminate(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `322 + n * (88 ±0)` - // Estimated: `3787 + n * (2563 ±0)` - // Minimum execution time: 21_920_000 picoseconds. - Weight::from_parts(21_725_868, 3787) - // Standard Error: 11_165 - .saturating_add(Weight::from_parts(4_317_986, 0).saturating_mul(n.into())) + // Measured: `324 + n * (88 ±0)` + // Estimated: `3791 + n * (2563 ±0)` + // Minimum execution time: 18_544_000 picoseconds. + Weight::from_parts(18_412_253, 3791) + // Standard Error: 12_785 + .saturating_add(Weight::from_parts(4_214_449, 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)) @@ -646,12 +644,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_140_000 picoseconds. - Weight::from_parts(4_259_301, 0) - // Standard Error: 3_362 - .saturating_add(Weight::from_parts(194_546, 0).saturating_mul(t.into())) - // Standard Error: 34 - .saturating_add(Weight::from_parts(774, 0).saturating_mul(n.into())) + // Minimum execution time: 4_156_000 picoseconds. + Weight::from_parts(4_120_442, 0) + // Standard Error: 3_278 + .saturating_add(Weight::from_parts(212_768, 0).saturating_mul(t.into())) + // Standard Error: 33 + .saturating_add(Weight::from_parts(1_199, 0).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -659,8 +657,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `680` // Estimated: `680` - // Minimum execution time: 10_747_000 picoseconds. - Weight::from_parts(11_276_000, 680) + // Minimum execution time: 11_065_000 picoseconds. + Weight::from_parts(11_573_000, 680) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -669,8 +667,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `10690` // Estimated: `10690` - // Minimum execution time: 42_076_000 picoseconds. - Weight::from_parts(43_381_000, 10690) + // Minimum execution time: 42_728_000 picoseconds. + Weight::from_parts(43_764_000, 10690) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -679,8 +677,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `680` // Estimated: `680` - // Minimum execution time: 11_703_000 picoseconds. - Weight::from_parts(12_308_000, 680) + // Minimum execution time: 12_376_000 picoseconds. + Weight::from_parts(12_658_000, 680) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -690,8 +688,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `10690` // Estimated: `10690` - // Minimum execution time: 43_460_000 picoseconds. - Weight::from_parts(45_165_000, 10690) + // Minimum execution time: 44_344_000 picoseconds. + Weight::from_parts(45_753_000, 10690) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -703,12 +701,12 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + o * (1 ±0)` // Estimated: `247 + o * (1 ±0)` - // Minimum execution time: 9_087_000 picoseconds. - Weight::from_parts(11_787_486, 247) - // Standard Error: 179 - .saturating_add(Weight::from_parts(976, 0).saturating_mul(n.into())) - // Standard Error: 179 - .saturating_add(Weight::from_parts(3_151, 0).saturating_mul(o.into())) + // Minimum execution time: 9_333_000 picoseconds. + Weight::from_parts(12_118_514, 247) + // Standard Error: 187 + .saturating_add(Weight::from_parts(1_212, 0).saturating_mul(n.into())) + // Standard Error: 187 + .saturating_add(Weight::from_parts(3_114, 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())) @@ -720,10 +718,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_611_000 picoseconds. - Weight::from_parts(11_791_390, 247) - // Standard Error: 308 - .saturating_add(Weight::from_parts(3_943, 0).saturating_mul(n.into())) + // Minimum execution time: 8_800_000 picoseconds. + Weight::from_parts(12_126_263, 247) + // Standard Error: 310 + .saturating_add(Weight::from_parts(4_181, 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())) @@ -735,10 +733,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_389_000 picoseconds. - Weight::from_parts(11_625_480, 247) - // Standard Error: 315 - .saturating_add(Weight::from_parts(4_487, 0).saturating_mul(n.into())) + // Minimum execution time: 8_612_000 picoseconds. + Weight::from_parts(11_888_491, 247) + // Standard Error: 322 + .saturating_add(Weight::from_parts(4_319, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -749,10 +747,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 7_947_000 picoseconds. - Weight::from_parts(10_970_587, 247) - // Standard Error: 310 - .saturating_add(Weight::from_parts(3_675, 0).saturating_mul(n.into())) + // Minimum execution time: 8_112_000 picoseconds. + Weight::from_parts(11_160_688, 247) + // Standard Error: 297 + .saturating_add(Weight::from_parts(4_056, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -763,10 +761,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 9_071_000 picoseconds. - Weight::from_parts(12_525_027, 247) - // Standard Error: 328 - .saturating_add(Weight::from_parts(4_427, 0).saturating_mul(n.into())) + // Minimum execution time: 9_419_000 picoseconds. + Weight::from_parts(12_683_269, 247) + // Standard Error: 298 + .saturating_add(Weight::from_parts(4_848, 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())) @@ -775,36 +773,36 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_487_000 picoseconds. - Weight::from_parts(1_611_000, 0) + // Minimum execution time: 1_535_000 picoseconds. + Weight::from_parts(1_637_000, 0) } fn set_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_852_000 picoseconds. - Weight::from_parts(1_982_000, 0) + // Minimum execution time: 1_891_000 picoseconds. + Weight::from_parts(1_970_000, 0) } fn get_transient_storage_empty() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_467_000 picoseconds. - Weight::from_parts(1_529_000, 0) + // Minimum execution time: 1_442_000 picoseconds. + Weight::from_parts(1_595_000, 0) } fn get_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_630_000 picoseconds. - Weight::from_parts(1_712_000, 0) + // Minimum execution time: 1_690_000 picoseconds. + Weight::from_parts(1_781_000, 0) } fn rollback_transient_storage() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_188_000 picoseconds. - Weight::from_parts(1_268_000, 0) + // Minimum execution time: 1_364_000 picoseconds. + Weight::from_parts(1_408_000, 0) } /// The range of component `n` is `[0, 448]`. /// The range of component `o` is `[0, 448]`. @@ -812,52 +810,50 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_197_000 picoseconds. - Weight::from_parts(2_464_654, 0) - // Standard Error: 17 - .saturating_add(Weight::from_parts(296, 0).saturating_mul(n.into())) - // Standard Error: 17 - .saturating_add(Weight::from_parts(342, 0).saturating_mul(o.into())) + // Minimum execution time: 2_392_000 picoseconds. + Weight::from_parts(2_559_622, 0) + // Standard Error: 18 + .saturating_add(Weight::from_parts(194, 0).saturating_mul(n.into())) + // Standard Error: 18 + .saturating_add(Weight::from_parts(319, 0).saturating_mul(o.into())) } /// The range of component `n` is `[0, 448]`. fn seal_clear_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_005_000 picoseconds. - Weight::from_parts(2_381_053, 0) - // Standard Error: 23 - .saturating_add(Weight::from_parts(322, 0).saturating_mul(n.into())) + // Minimum execution time: 2_099_000 picoseconds. + Weight::from_parts(2_442_655, 0) + // Standard Error: 19 + .saturating_add(Weight::from_parts(361, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 448]`. fn seal_get_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_853_000 picoseconds. - Weight::from_parts(2_082_772, 0) + // Minimum execution time: 1_936_000 picoseconds. + Weight::from_parts(2_160_919, 0) // Standard Error: 20 - .saturating_add(Weight::from_parts(322, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(385, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 448]`. fn seal_contains_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_711_000 picoseconds. - Weight::from_parts(1_899_649, 0) + // Minimum execution time: 1_809_000 picoseconds. + Weight::from_parts(1_997_103, 0) // Standard Error: 16 - .saturating_add(Weight::from_parts(208, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(156, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 448]`. - fn seal_take_transient_storage(n: u32, ) -> Weight { + fn seal_take_transient_storage(_n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_460_000 picoseconds. - Weight::from_parts(2_684_364, 0) - // Standard Error: 22 - .saturating_add(Weight::from_parts(56, 0).saturating_mul(n.into())) + // Minimum execution time: 2_513_000 picoseconds. + Weight::from_parts(2_799_538, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) @@ -873,18 +869,18 @@ impl WeightInfo for SubstrateWeight { /// The range of component `i` is `[0, 262144]`. fn seal_call(t: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1292 + t * (203 ±0)` - // Estimated: `4757 + t * (2480 ±0)` - // Minimum execution time: 40_031_000 picoseconds. - Weight::from_parts(41_527_691, 4757) - // Standard Error: 50_351 - .saturating_add(Weight::from_parts(1_112_950, 0).saturating_mul(t.into())) + // Measured: `1294 + t * (205 ±0)` + // Estimated: `4759 + t * (2482 ±0)` + // Minimum execution time: 36_919_000 picoseconds. + Weight::from_parts(37_978_283, 4759) + // Standard Error: 54_576 + .saturating_add(Weight::from_parts(5_559_261, 0).saturating_mul(t.into())) // Standard Error: 0 - .saturating_add(Weight::from_parts(1, 0).saturating_mul(i.into())) + .saturating_add(Weight::from_parts(2, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(t.into()))) .saturating_add(T::DbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_parts(0, 2480).saturating_mul(t.into())) + .saturating_add(Weight::from_parts(0, 2482).saturating_mul(t.into())) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) @@ -896,8 +892,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1237` // Estimated: `4702` - // Minimum execution time: 35_759_000 picoseconds. - Weight::from_parts(37_086_000, 4702) + // Minimum execution time: 31_267_000 picoseconds. + Weight::from_parts(32_495_000, 4702) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) @@ -911,12 +907,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: `1271` - // Estimated: `4710` - // Minimum execution time: 116_485_000 picoseconds. - Weight::from_parts(108_907_717, 4710) - // Standard Error: 12 - .saturating_add(Weight::from_parts(4_125, 0).saturating_mul(i.into())) + // Measured: `1272` + // Estimated: `4724` + // Minimum execution time: 119_000_000 picoseconds. + Weight::from_parts(110_163_800, 4724) + // Standard Error: 11 + .saturating_add(Weight::from_parts(4_063, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -925,8 +921,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 651_000 picoseconds. - Weight::from_parts(3_867_609, 0) + // Minimum execution time: 725_000 picoseconds. + Weight::from_parts(4_441_443, 0) // Standard Error: 3 .saturating_add(Weight::from_parts(1_384, 0).saturating_mul(n.into())) } @@ -935,54 +931,54 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_090_000 picoseconds. - Weight::from_parts(5_338_460, 0) + // Minimum execution time: 1_057_000 picoseconds. + Weight::from_parts(5_659_277, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(3_601, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(3_588, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_blake2_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 717_000 picoseconds. - Weight::from_parts(2_629_461, 0) + // Minimum execution time: 691_000 picoseconds. + Weight::from_parts(3_368_834, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(1_528, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_507, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_blake2_128(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 660_000 picoseconds. - Weight::from_parts(4_807_814, 0) + // Minimum execution time: 619_000 picoseconds. + Weight::from_parts(2_422_606, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(1_509, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_528, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 261889]`. fn seal_sr25519_verify(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 42_829_000 picoseconds. - Weight::from_parts(24_650_992, 0) - // Standard Error: 14 - .saturating_add(Weight::from_parts(5_212, 0).saturating_mul(n.into())) + // Minimum execution time: 46_148_000 picoseconds. + Weight::from_parts(35_311_479, 0) + // Standard Error: 10 + .saturating_add(Weight::from_parts(5_452, 0).saturating_mul(n.into())) } fn seal_ecdsa_recover() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 46_902_000 picoseconds. - Weight::from_parts(48_072_000, 0) + // Minimum execution time: 49_475_000 picoseconds. + Weight::from_parts(50_488_000, 0) } fn seal_ecdsa_to_eth_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_713_000 picoseconds. - Weight::from_parts(12_847_000, 0) + // Minimum execution time: 12_516_000 picoseconds. + Weight::from_parts(12_637_000, 0) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) @@ -990,8 +986,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `300` // Estimated: `3765` - // Minimum execution time: 17_657_000 picoseconds. - Weight::from_parts(18_419_000, 3765) + // Minimum execution time: 13_735_000 picoseconds. + Weight::from_parts(14_450_000, 3765) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -999,10 +995,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) fn lock_delegate_dependency() -> Weight { // Proof Size summary in bytes: - // Measured: `338` - // Estimated: `3803` - // Minimum execution time: 13_650_000 picoseconds. - Weight::from_parts(14_209_000, 3803) + // Measured: `337` + // Estimated: `3802` + // Minimum execution time: 13_488_000 picoseconds. + Weight::from_parts(14_161_000, 3802) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1010,10 +1006,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) fn unlock_delegate_dependency() -> Weight { // Proof Size summary in bytes: - // Measured: `338` + // Measured: `337` // Estimated: `3561` - // Minimum execution time: 12_341_000 picoseconds. - Weight::from_parts(13_011_000, 3561) + // Minimum execution time: 12_686_000 picoseconds. + Weight::from_parts(13_180_000, 3561) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -1022,10 +1018,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_899_000 picoseconds. - Weight::from_parts(10_489_171, 0) - // Standard Error: 104 - .saturating_add(Weight::from_parts(73_814, 0).saturating_mul(r.into())) + // Minimum execution time: 8_475_000 picoseconds. + Weight::from_parts(10_353_864, 0) + // Standard Error: 99 + .saturating_add(Weight::from_parts(73_636, 0).saturating_mul(r.into())) } } @@ -1037,8 +1033,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `109` // Estimated: `1594` - // Minimum execution time: 2_859_000 picoseconds. - Weight::from_parts(3_007_000, 1594) + // Minimum execution time: 2_796_000 picoseconds. + Weight::from_parts(2_958_000, 1594) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -1048,10 +1044,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `425 + k * (69 ±0)` // Estimated: `415 + k * (70 ±0)` - // Minimum execution time: 15_640_000 picoseconds. - Weight::from_parts(1_609_026, 415) - // Standard Error: 1_359 - .saturating_add(Weight::from_parts(1_204_420, 0).saturating_mul(k.into())) + // Minimum execution time: 16_135_000 picoseconds. + Weight::from_parts(3_227_098, 415) + // Standard Error: 1_106 + .saturating_add(Weight::from_parts(1_175_210, 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)) @@ -1073,17 +1069,17 @@ impl WeightInfo for () { /// The range of component `c` is `[0, 262144]`. fn call_with_code_per_byte(_c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1463` - // Estimated: `7403` - // Minimum execution time: 89_437_000 picoseconds. - Weight::from_parts(94_285_182, 7403) + // Measured: `1502` + // Estimated: `7442` + // Minimum execution time: 89_144_000 picoseconds. + Weight::from_parts(93_719_381, 7442) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Balances::Holds` (r:2 w:2) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Revive::ContractInfoOf` (r:1 w:1) @@ -1098,14 +1094,14 @@ impl WeightInfo for () { /// The range of component `i` is `[0, 262144]`. fn instantiate_with_code(c: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `364` - // Estimated: `6327` - // Minimum execution time: 187_904_000 picoseconds. - Weight::from_parts(153_252_081, 6327) - // Standard Error: 11 - .saturating_add(Weight::from_parts(49, 0).saturating_mul(c.into())) - // Standard Error: 11 - .saturating_add(Weight::from_parts(4_528, 0).saturating_mul(i.into())) + // Measured: `401` + // Estimated: `6349` + // Minimum execution time: 185_726_000 picoseconds. + Weight::from_parts(165_030_228, 6349) + // Standard Error: 10 + .saturating_add(Weight::from_parts(10, 0).saturating_mul(c.into())) + // Standard Error: 10 + .saturating_add(Weight::from_parts(4_453, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -1122,16 +1118,16 @@ impl WeightInfo for () { /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// The range of component `i` is `[0, 262144]`. fn instantiate(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1296` - // Estimated: `4758` - // Minimum execution time: 154_656_000 picoseconds. - Weight::from_parts(139_308_398, 4758) - // Standard Error: 16 - .saturating_add(Weight::from_parts(4_421, 0).saturating_mul(i.into())) + // Measured: `1294` + // Estimated: `4739` + // Minimum execution time: 154_669_000 picoseconds. + Weight::from_parts(138_463_785, 4739) + // Standard Error: 15 + .saturating_add(Weight::from_parts(4_389, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -1149,43 +1145,41 @@ impl WeightInfo for () { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) fn call() -> Weight { // Proof Size summary in bytes: - // Measured: `1463` - // Estimated: `7403` - // Minimum execution time: 138_815_000 picoseconds. - Weight::from_parts(149_067_000, 7403) + // Measured: `1502` + // Estimated: `7442` + // Minimum execution time: 137_822_000 picoseconds. + Weight::from_parts(146_004_000, 7442) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:0 w:1) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) /// The range of component `c` is `[0, 262144]`. - fn upload_code(c: u32, ) -> Weight { + fn upload_code(_c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `3574` - // Minimum execution time: 49_978_000 picoseconds. - Weight::from_parts(51_789_325, 3574) - // Standard Error: 0 - .saturating_add(Weight::from_parts(1, 0).saturating_mul(c.into())) + // Measured: `164` + // Estimated: `3629` + // Minimum execution time: 53_476_000 picoseconds. + Weight::from_parts(55_795_699, 3629) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// Storage: `Revive::PristineCode` (r:0 w:1) /// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`) fn remove_code() -> Weight { // Proof Size summary in bytes: - // Measured: `285` - // Estimated: `3750` - // Minimum execution time: 43_833_000 picoseconds. - Weight::from_parts(44_660_000, 3750) + // Measured: `322` + // Estimated: `3787` + // Minimum execution time: 41_955_000 picoseconds. + Weight::from_parts(43_749_000, 3787) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1197,34 +1191,34 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `529` // Estimated: `6469` - // Minimum execution time: 26_717_000 picoseconds. - Weight::from_parts(28_566_000, 6469) + // Minimum execution time: 22_763_000 picoseconds. + Weight::from_parts(23_219_000, 6469) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: `Revive::AddressSuffix` (r:1 w:1) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) fn map_account() -> Weight { // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `3574` - // Minimum execution time: 39_401_000 picoseconds. - Weight::from_parts(40_542_000, 3574) + // Measured: `164` + // Estimated: `3629` + // Minimum execution time: 45_478_000 picoseconds. + Weight::from_parts(46_658_000, 3629) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(355), added: 2830, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(409), added: 2884, mode: `Measured`) /// Storage: `Revive::AddressSuffix` (r:0 w:1) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) fn unmap_account() -> Weight { // Proof Size summary in bytes: - // Measured: `56` - // Estimated: `3521` - // Minimum execution time: 31_570_000 picoseconds. - Weight::from_parts(32_302_000, 3521) + // Measured: `93` + // Estimated: `3558` + // Minimum execution time: 33_359_000 picoseconds. + Weight::from_parts(34_196_000, 3558) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -1236,8 +1230,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `145` // Estimated: `3610` - // Minimum execution time: 13_607_000 picoseconds. - Weight::from_parts(13_903_000, 3610) + // Minimum execution time: 13_663_000 picoseconds. + Weight::from_parts(14_278_000, 3610) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// The range of component `r` is `[0, 1600]`. @@ -1245,24 +1239,24 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_400_000 picoseconds. - Weight::from_parts(8_388_251, 0) - // Standard Error: 283 - .saturating_add(Weight::from_parts(165_630, 0).saturating_mul(r.into())) + // Minimum execution time: 6_966_000 picoseconds. + Weight::from_parts(7_708_050, 0) + // Standard Error: 238 + .saturating_add(Weight::from_parts(167_115, 0).saturating_mul(r.into())) } fn seal_caller() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 275_000 picoseconds. - Weight::from_parts(305_000, 0) + // Minimum execution time: 332_000 picoseconds. + Weight::from_parts(378_000, 0) } fn seal_origin() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 224_000 picoseconds. - Weight::from_parts(265_000, 0) + // Minimum execution time: 303_000 picoseconds. + Weight::from_parts(329_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) @@ -1270,18 +1264,18 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `306` // Estimated: `3771` - // Minimum execution time: 10_004_000 picoseconds. - Weight::from_parts(10_336_000, 3771) + // Minimum execution time: 10_014_000 picoseconds. + Weight::from_parts(10_549_000, 3771) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) fn seal_to_account_id() -> Weight { // Proof Size summary in bytes: - // Measured: `212` - // Estimated: `3677` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(4_000_000, 3677) + // Measured: `248` + // Estimated: `3713` + // Minimum execution time: 9_771_000 picoseconds. + Weight::from_parts(10_092_000, 3713) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) @@ -1290,16 +1284,16 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `403` // Estimated: `3868` - // Minimum execution time: 11_054_000 picoseconds. - Weight::from_parts(11_651_000, 3868) + // Minimum execution time: 11_260_000 picoseconds. + Weight::from_parts(11_626_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: 252_000 picoseconds. - Weight::from_parts(305_000, 0) + // Minimum execution time: 307_000 picoseconds. + Weight::from_parts(328_000, 0) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) @@ -1309,51 +1303,51 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `473` // Estimated: `3938` - // Minimum execution time: 14_461_000 picoseconds. - Weight::from_parts(15_049_000, 3938) + // Minimum execution time: 14_675_000 picoseconds. + Weight::from_parts(15_168_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: 312_000 picoseconds. - Weight::from_parts(338_000, 0) + // Minimum execution time: 332_000 picoseconds. + Weight::from_parts(357_000, 0) } fn seal_caller_is_root() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 243_000 picoseconds. - Weight::from_parts(299_000, 0) + // Minimum execution time: 298_000 picoseconds. + Weight::from_parts(332_000, 0) } fn seal_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 231_000 picoseconds. - Weight::from_parts(271_000, 0) + // Minimum execution time: 313_000 picoseconds. + Weight::from_parts(336_000, 0) } fn seal_weight_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 683_000 picoseconds. - Weight::from_parts(732_000, 0) + // Minimum execution time: 663_000 picoseconds. + Weight::from_parts(730_000, 0) } fn seal_ref_time_left() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 226_000 picoseconds. - Weight::from_parts(273_000, 0) + // Minimum execution time: 292_000 picoseconds. + Weight::from_parts(344_000, 0) } fn seal_balance() -> Weight { // Proof Size summary in bytes: // Measured: `102` // Estimated: `0` - // Minimum execution time: 4_626_000 picoseconds. - Weight::from_parts(4_842_000, 0) + // Minimum execution time: 4_604_000 picoseconds. + Weight::from_parts(4_875_000, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) @@ -1363,8 +1357,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `264` // Estimated: `3729` - // Minimum execution time: 12_309_000 picoseconds. - Weight::from_parts(12_653_000, 3729) + // Minimum execution time: 12_252_000 picoseconds. + Weight::from_parts(12_641_000, 3729) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: `Revive::ImmutableDataOf` (r:1 w:0) @@ -1374,10 +1368,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `238 + n * (1 ±0)` // Estimated: `3703 + n * (1 ±0)` - // Minimum execution time: 5_838_000 picoseconds. - Weight::from_parts(9_570_778, 3703) - // Standard Error: 19 - .saturating_add(Weight::from_parts(721, 0).saturating_mul(n.into())) + // Minimum execution time: 6_005_000 picoseconds. + Weight::from_parts(9_550_692, 3703) + // Standard Error: 18 + .saturating_add(Weight::from_parts(710, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1388,67 +1382,67 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_910_000 picoseconds. - Weight::from_parts(2_205_396, 0) + // Minimum execution time: 1_981_000 picoseconds. + Weight::from_parts(2_297_488, 0) // Standard Error: 2 - .saturating_add(Weight::from_parts(538, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(528, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().writes(1_u64)) } fn seal_value_transferred() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 224_000 picoseconds. - Weight::from_parts(274_000, 0) + // Minimum execution time: 279_000 picoseconds. + Weight::from_parts(309_000, 0) } fn seal_minimum_balance() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 231_000 picoseconds. - Weight::from_parts(279_000, 0) + // Minimum execution time: 289_000 picoseconds. + Weight::from_parts(315_000, 0) } fn seal_return_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 229_000 picoseconds. - Weight::from_parts(267_000, 0) + // Minimum execution time: 253_000 picoseconds. + Weight::from_parts(310_000, 0) } fn seal_call_data_size() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 218_000 picoseconds. - Weight::from_parts(267_000, 0) + // Minimum execution time: 291_000 picoseconds. + Weight::from_parts(338_000, 0) } fn seal_gas_limit() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 225_000 picoseconds. - Weight::from_parts(280_000, 0) + // Minimum execution time: 266_000 picoseconds. + Weight::from_parts(331_000, 0) } fn seal_gas_price() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 274_000 picoseconds. - Weight::from_parts(323_000, 0) + // Minimum execution time: 250_000 picoseconds. + Weight::from_parts(314_000, 0) } fn seal_base_fee() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 239_000 picoseconds. - Weight::from_parts(290_000, 0) + // Minimum execution time: 266_000 picoseconds. + Weight::from_parts(341_000, 0) } fn seal_block_number() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 224_000 picoseconds. - Weight::from_parts(274_000, 0) + // Minimum execution time: 281_000 picoseconds. + Weight::from_parts(314_000, 0) } /// Storage: `System::BlockHash` (r:1 w:0) /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `Measured`) @@ -1456,60 +1450,60 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `30` // Estimated: `3495` - // Minimum execution time: 3_430_000 picoseconds. - Weight::from_parts(3_692_000, 3495) + // Minimum execution time: 3_557_000 picoseconds. + Weight::from_parts(3_816_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: 241_000 picoseconds. - Weight::from_parts(290_000, 0) + // Minimum execution time: 280_000 picoseconds. + Weight::from_parts(316_000, 0) } fn seal_weight_to_fee() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_355_000 picoseconds. - Weight::from_parts(1_493_000, 0) + // Minimum execution time: 1_413_000 picoseconds. + Weight::from_parts(1_477_000, 0) } /// The range of component `n` is `[0, 262140]`. fn seal_copy_to_contract(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 348_000 picoseconds. - Weight::from_parts(1_004_890, 0) + // Minimum execution time: 383_000 picoseconds. + Weight::from_parts(602_481, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(202, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(201, 0).saturating_mul(n.into())) } fn seal_call_data_load() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 222_000 picoseconds. - Weight::from_parts(256_000, 0) + // Minimum execution time: 327_000 picoseconds. + Weight::from_parts(365_000, 0) } /// The range of component `n` is `[0, 262144]`. fn seal_call_data_copy(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 240_000 picoseconds. - Weight::from_parts(330_609, 0) + // Minimum execution time: 334_000 picoseconds. + Weight::from_parts(205_756, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(114, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(116, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262140]`. fn seal_return(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 232_000 picoseconds. - Weight::from_parts(264_000, 0) + // Minimum execution time: 278_000 picoseconds. + Weight::from_parts(611_031, 0) // Standard Error: 0 - .saturating_add(Weight::from_parts(208, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(202, 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`) @@ -1524,12 +1518,12 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 32]`. fn seal_terminate(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `322 + n * (88 ±0)` - // Estimated: `3787 + n * (2563 ±0)` - // Minimum execution time: 21_920_000 picoseconds. - Weight::from_parts(21_725_868, 3787) - // Standard Error: 11_165 - .saturating_add(Weight::from_parts(4_317_986, 0).saturating_mul(n.into())) + // Measured: `324 + n * (88 ±0)` + // Estimated: `3791 + n * (2563 ±0)` + // Minimum execution time: 18_544_000 picoseconds. + Weight::from_parts(18_412_253, 3791) + // Standard Error: 12_785 + .saturating_add(Weight::from_parts(4_214_449, 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)) @@ -1542,12 +1536,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_140_000 picoseconds. - Weight::from_parts(4_259_301, 0) - // Standard Error: 3_362 - .saturating_add(Weight::from_parts(194_546, 0).saturating_mul(t.into())) - // Standard Error: 34 - .saturating_add(Weight::from_parts(774, 0).saturating_mul(n.into())) + // Minimum execution time: 4_156_000 picoseconds. + Weight::from_parts(4_120_442, 0) + // Standard Error: 3_278 + .saturating_add(Weight::from_parts(212_768, 0).saturating_mul(t.into())) + // Standard Error: 33 + .saturating_add(Weight::from_parts(1_199, 0).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1555,8 +1549,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `680` // Estimated: `680` - // Minimum execution time: 10_747_000 picoseconds. - Weight::from_parts(11_276_000, 680) + // Minimum execution time: 11_065_000 picoseconds. + Weight::from_parts(11_573_000, 680) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -1565,8 +1559,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `10690` // Estimated: `10690` - // Minimum execution time: 42_076_000 picoseconds. - Weight::from_parts(43_381_000, 10690) + // Minimum execution time: 42_728_000 picoseconds. + Weight::from_parts(43_764_000, 10690) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -1575,8 +1569,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `680` // Estimated: `680` - // Minimum execution time: 11_703_000 picoseconds. - Weight::from_parts(12_308_000, 680) + // Minimum execution time: 12_376_000 picoseconds. + Weight::from_parts(12_658_000, 680) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1586,8 +1580,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `10690` // Estimated: `10690` - // Minimum execution time: 43_460_000 picoseconds. - Weight::from_parts(45_165_000, 10690) + // Minimum execution time: 44_344_000 picoseconds. + Weight::from_parts(45_753_000, 10690) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1599,12 +1593,12 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + o * (1 ±0)` // Estimated: `247 + o * (1 ±0)` - // Minimum execution time: 9_087_000 picoseconds. - Weight::from_parts(11_787_486, 247) - // Standard Error: 179 - .saturating_add(Weight::from_parts(976, 0).saturating_mul(n.into())) - // Standard Error: 179 - .saturating_add(Weight::from_parts(3_151, 0).saturating_mul(o.into())) + // Minimum execution time: 9_333_000 picoseconds. + Weight::from_parts(12_118_514, 247) + // Standard Error: 187 + .saturating_add(Weight::from_parts(1_212, 0).saturating_mul(n.into())) + // Standard Error: 187 + .saturating_add(Weight::from_parts(3_114, 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())) @@ -1616,10 +1610,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_611_000 picoseconds. - Weight::from_parts(11_791_390, 247) - // Standard Error: 308 - .saturating_add(Weight::from_parts(3_943, 0).saturating_mul(n.into())) + // Minimum execution time: 8_800_000 picoseconds. + Weight::from_parts(12_126_263, 247) + // Standard Error: 310 + .saturating_add(Weight::from_parts(4_181, 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())) @@ -1631,10 +1625,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 8_389_000 picoseconds. - Weight::from_parts(11_625_480, 247) - // Standard Error: 315 - .saturating_add(Weight::from_parts(4_487, 0).saturating_mul(n.into())) + // Minimum execution time: 8_612_000 picoseconds. + Weight::from_parts(11_888_491, 247) + // Standard Error: 322 + .saturating_add(Weight::from_parts(4_319, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1645,10 +1639,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 7_947_000 picoseconds. - Weight::from_parts(10_970_587, 247) - // Standard Error: 310 - .saturating_add(Weight::from_parts(3_675, 0).saturating_mul(n.into())) + // Minimum execution time: 8_112_000 picoseconds. + Weight::from_parts(11_160_688, 247) + // Standard Error: 297 + .saturating_add(Weight::from_parts(4_056, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1659,10 +1653,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `248 + n * (1 ±0)` // Estimated: `247 + n * (1 ±0)` - // Minimum execution time: 9_071_000 picoseconds. - Weight::from_parts(12_525_027, 247) - // Standard Error: 328 - .saturating_add(Weight::from_parts(4_427, 0).saturating_mul(n.into())) + // Minimum execution time: 9_419_000 picoseconds. + Weight::from_parts(12_683_269, 247) + // Standard Error: 298 + .saturating_add(Weight::from_parts(4_848, 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())) @@ -1671,36 +1665,36 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_487_000 picoseconds. - Weight::from_parts(1_611_000, 0) + // Minimum execution time: 1_535_000 picoseconds. + Weight::from_parts(1_637_000, 0) } fn set_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_852_000 picoseconds. - Weight::from_parts(1_982_000, 0) + // Minimum execution time: 1_891_000 picoseconds. + Weight::from_parts(1_970_000, 0) } fn get_transient_storage_empty() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_467_000 picoseconds. - Weight::from_parts(1_529_000, 0) + // Minimum execution time: 1_442_000 picoseconds. + Weight::from_parts(1_595_000, 0) } fn get_transient_storage_full() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_630_000 picoseconds. - Weight::from_parts(1_712_000, 0) + // Minimum execution time: 1_690_000 picoseconds. + Weight::from_parts(1_781_000, 0) } fn rollback_transient_storage() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_188_000 picoseconds. - Weight::from_parts(1_268_000, 0) + // Minimum execution time: 1_364_000 picoseconds. + Weight::from_parts(1_408_000, 0) } /// The range of component `n` is `[0, 448]`. /// The range of component `o` is `[0, 448]`. @@ -1708,52 +1702,50 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_197_000 picoseconds. - Weight::from_parts(2_464_654, 0) - // Standard Error: 17 - .saturating_add(Weight::from_parts(296, 0).saturating_mul(n.into())) - // Standard Error: 17 - .saturating_add(Weight::from_parts(342, 0).saturating_mul(o.into())) + // Minimum execution time: 2_392_000 picoseconds. + Weight::from_parts(2_559_622, 0) + // Standard Error: 18 + .saturating_add(Weight::from_parts(194, 0).saturating_mul(n.into())) + // Standard Error: 18 + .saturating_add(Weight::from_parts(319, 0).saturating_mul(o.into())) } /// The range of component `n` is `[0, 448]`. fn seal_clear_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_005_000 picoseconds. - Weight::from_parts(2_381_053, 0) - // Standard Error: 23 - .saturating_add(Weight::from_parts(322, 0).saturating_mul(n.into())) + // Minimum execution time: 2_099_000 picoseconds. + Weight::from_parts(2_442_655, 0) + // Standard Error: 19 + .saturating_add(Weight::from_parts(361, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 448]`. fn seal_get_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_853_000 picoseconds. - Weight::from_parts(2_082_772, 0) + // Minimum execution time: 1_936_000 picoseconds. + Weight::from_parts(2_160_919, 0) // Standard Error: 20 - .saturating_add(Weight::from_parts(322, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(385, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 448]`. fn seal_contains_transient_storage(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_711_000 picoseconds. - Weight::from_parts(1_899_649, 0) + // Minimum execution time: 1_809_000 picoseconds. + Weight::from_parts(1_997_103, 0) // Standard Error: 16 - .saturating_add(Weight::from_parts(208, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(156, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 448]`. - fn seal_take_transient_storage(n: u32, ) -> Weight { + fn seal_take_transient_storage(_n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_460_000 picoseconds. - Weight::from_parts(2_684_364, 0) - // Standard Error: 22 - .saturating_add(Weight::from_parts(56, 0).saturating_mul(n.into())) + // Minimum execution time: 2_513_000 picoseconds. + Weight::from_parts(2_799_538, 0) } /// Storage: `Revive::AddressSuffix` (r:1 w:0) /// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`) @@ -1769,18 +1761,18 @@ impl WeightInfo for () { /// The range of component `i` is `[0, 262144]`. fn seal_call(t: u32, i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1292 + t * (203 ±0)` - // Estimated: `4757 + t * (2480 ±0)` - // Minimum execution time: 40_031_000 picoseconds. - Weight::from_parts(41_527_691, 4757) - // Standard Error: 50_351 - .saturating_add(Weight::from_parts(1_112_950, 0).saturating_mul(t.into())) + // Measured: `1294 + t * (205 ±0)` + // Estimated: `4759 + t * (2482 ±0)` + // Minimum execution time: 36_919_000 picoseconds. + Weight::from_parts(37_978_283, 4759) + // Standard Error: 54_576 + .saturating_add(Weight::from_parts(5_559_261, 0).saturating_mul(t.into())) // Standard Error: 0 - .saturating_add(Weight::from_parts(1, 0).saturating_mul(i.into())) + .saturating_add(Weight::from_parts(2, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(t.into()))) .saturating_add(RocksDbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_parts(0, 2480).saturating_mul(t.into())) + .saturating_add(Weight::from_parts(0, 2482).saturating_mul(t.into())) } /// Storage: `Revive::ContractInfoOf` (r:1 w:0) /// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`) @@ -1792,8 +1784,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1237` // Estimated: `4702` - // Minimum execution time: 35_759_000 picoseconds. - Weight::from_parts(37_086_000, 4702) + // Minimum execution time: 31_267_000 picoseconds. + Weight::from_parts(32_495_000, 4702) .saturating_add(RocksDbWeight::get().reads(3_u64)) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) @@ -1807,12 +1799,12 @@ impl WeightInfo for () { /// The range of component `i` is `[0, 262144]`. fn seal_instantiate(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1271` - // Estimated: `4710` - // Minimum execution time: 116_485_000 picoseconds. - Weight::from_parts(108_907_717, 4710) - // Standard Error: 12 - .saturating_add(Weight::from_parts(4_125, 0).saturating_mul(i.into())) + // Measured: `1272` + // Estimated: `4724` + // Minimum execution time: 119_000_000 picoseconds. + Weight::from_parts(110_163_800, 4724) + // Standard Error: 11 + .saturating_add(Weight::from_parts(4_063, 0).saturating_mul(i.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1821,8 +1813,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 651_000 picoseconds. - Weight::from_parts(3_867_609, 0) + // Minimum execution time: 725_000 picoseconds. + Weight::from_parts(4_441_443, 0) // Standard Error: 3 .saturating_add(Weight::from_parts(1_384, 0).saturating_mul(n.into())) } @@ -1831,54 +1823,54 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_090_000 picoseconds. - Weight::from_parts(5_338_460, 0) + // Minimum execution time: 1_057_000 picoseconds. + Weight::from_parts(5_659_277, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(3_601, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(3_588, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_blake2_256(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 717_000 picoseconds. - Weight::from_parts(2_629_461, 0) + // Minimum execution time: 691_000 picoseconds. + Weight::from_parts(3_368_834, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(1_528, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_507, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 262144]`. fn seal_hash_blake2_128(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 660_000 picoseconds. - Weight::from_parts(4_807_814, 0) + // Minimum execution time: 619_000 picoseconds. + Weight::from_parts(2_422_606, 0) // Standard Error: 3 - .saturating_add(Weight::from_parts(1_509, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(1_528, 0).saturating_mul(n.into())) } /// The range of component `n` is `[0, 261889]`. fn seal_sr25519_verify(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 42_829_000 picoseconds. - Weight::from_parts(24_650_992, 0) - // Standard Error: 14 - .saturating_add(Weight::from_parts(5_212, 0).saturating_mul(n.into())) + // Minimum execution time: 46_148_000 picoseconds. + Weight::from_parts(35_311_479, 0) + // Standard Error: 10 + .saturating_add(Weight::from_parts(5_452, 0).saturating_mul(n.into())) } fn seal_ecdsa_recover() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 46_902_000 picoseconds. - Weight::from_parts(48_072_000, 0) + // Minimum execution time: 49_475_000 picoseconds. + Weight::from_parts(50_488_000, 0) } fn seal_ecdsa_to_eth_address() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_713_000 picoseconds. - Weight::from_parts(12_847_000, 0) + // Minimum execution time: 12_516_000 picoseconds. + Weight::from_parts(12_637_000, 0) } /// Storage: `Revive::CodeInfoOf` (r:1 w:1) /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) @@ -1886,8 +1878,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `300` // Estimated: `3765` - // Minimum execution time: 17_657_000 picoseconds. - Weight::from_parts(18_419_000, 3765) + // Minimum execution time: 13_735_000 picoseconds. + Weight::from_parts(14_450_000, 3765) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1895,10 +1887,10 @@ impl WeightInfo for () { /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`) fn lock_delegate_dependency() -> Weight { // Proof Size summary in bytes: - // Measured: `338` - // Estimated: `3803` - // Minimum execution time: 13_650_000 picoseconds. - Weight::from_parts(14_209_000, 3803) + // Measured: `337` + // Estimated: `3802` + // Minimum execution time: 13_488_000 picoseconds. + Weight::from_parts(14_161_000, 3802) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1906,10 +1898,10 @@ impl WeightInfo for () { /// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) fn unlock_delegate_dependency() -> Weight { // Proof Size summary in bytes: - // Measured: `338` + // Measured: `337` // Estimated: `3561` - // Minimum execution time: 12_341_000 picoseconds. - Weight::from_parts(13_011_000, 3561) + // Minimum execution time: 12_686_000 picoseconds. + Weight::from_parts(13_180_000, 3561) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1918,9 +1910,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_899_000 picoseconds. - Weight::from_parts(10_489_171, 0) - // Standard Error: 104 - .saturating_add(Weight::from_parts(73_814, 0).saturating_mul(r.into())) + // Minimum execution time: 8_475_000 picoseconds. + Weight::from_parts(10_353_864, 0) + // Standard Error: 99 + .saturating_add(Weight::from_parts(73_636, 0).saturating_mul(r.into())) } } diff --git a/substrate/frame/revive/uapi/src/host.rs b/substrate/frame/revive/uapi/src/host.rs index 130cbf97ad504..2d7c73d26192e 100644 --- a/substrate/frame/revive/uapi/src/host.rs +++ b/substrate/frame/revive/uapi/src/host.rs @@ -288,14 +288,14 @@ pub trait HostFn: private::Sealed { /// /// # Parameters /// - /// - `code_hash`: The hash of the code to be instantiated. /// - `ref_time_limit`: how much *ref_time* Weight to devote to the execution. /// - `proof_size_limit`: how much *proof_size* Weight to devote to the execution. /// - `deposit`: The storage deposit limit for instantiation. Passing `None` means setting no /// specific limit for the call, which implies storage usage up to the limit of the parent /// call. /// - `value`: The value to transfer into the contract. - /// - `input`: The input data buffer. + /// - `input`: The code hash and constructor input data buffer. The first 32 bytes are the code + /// hash of the code to be instantiated. The remaining bytes are the constructor call data. /// - `address`: A reference to the address buffer to write the address of the contract. If /// `None` is provided then the output buffer is not copied. /// - `output`: A reference to the return value buffer to write the constructor output buffer. @@ -315,7 +315,6 @@ pub trait HostFn: private::Sealed { /// - [TransferFailed][`crate::ReturnErrorCode::TransferFailed] /// - [OutOfResources][`crate::ReturnErrorCode::OutOfResources] fn instantiate( - code_hash: &[u8; 32], ref_time_limit: u64, proof_size_limit: u64, deposit: &[u8; 32], diff --git a/substrate/frame/revive/uapi/src/host/riscv64.rs b/substrate/frame/revive/uapi/src/host/riscv64.rs index 3726564e26eba..8179ea890189b 100644 --- a/substrate/frame/revive/uapi/src/host/riscv64.rs +++ b/substrate/frame/revive/uapi/src/host/riscv64.rs @@ -16,7 +16,7 @@ use crate::{ host::{CallFlags, HostFn, HostFnImpl, Result, StorageFlags}, - ReturnFlags, + pack_hi_lo, ReturnFlags, }; use pallet_revive_proc_macro::unstable_hostfn; @@ -59,9 +59,30 @@ mod sys { out_ptr: *mut u8, out_len_ptr: *mut u32, ) -> ReturnCode; - pub fn call(ptr: *const u8) -> ReturnCode; - pub fn delegate_call(ptr: *const u8) -> ReturnCode; - pub fn instantiate(ptr: *const u8) -> ReturnCode; + pub fn call( + flags_and_callee: u64, + ref_time_limit: u64, + proof_size_limit: u64, + deposit_and_value: u64, + input_data: u64, + output_data: u64, + ) -> ReturnCode; + pub fn delegate_call( + flags_and_callee: u64, + ref_time_limit: u64, + proof_size_limit: u64, + deposit_ptr: *const u8, + input_data: u64, + output_data: u64, + ) -> ReturnCode; + pub fn instantiate( + ref_time_limit: u64, + proof_size_limit: u64, + deposit_and_value: u64, + input_data: u64, + output_data: u64, + address_and_salt: u64, + ) -> ReturnCode; pub fn terminate(beneficiary_ptr: *const u8); pub fn call_data_copy(out_ptr: *mut u8, out_len: u32, offset: u32); pub fn call_data_load(out_ptr: *mut u8, offset: u32); @@ -165,7 +186,6 @@ fn ptr_or_sentinel(data: &Option<&[u8; 32]>) -> *const u8 { impl HostFn for HostFnImpl { fn instantiate( - code_hash: &[u8; 32], ref_time_limit: u64, proof_size_limit: u64, deposit_limit: &[u8; 32], @@ -179,42 +199,28 @@ impl HostFn for HostFnImpl { Some(ref mut data) => data.as_mut_ptr(), None => crate::SENTINEL as _, }; - let (output_ptr, mut output_len) = ptr_len_or_sentinel(&mut output); + let (output_ptr, mut output_len_ptr) = ptr_len_or_sentinel(&mut output); let deposit_limit_ptr = deposit_limit.as_ptr(); let salt_ptr = ptr_or_sentinel(&salt); - #[repr(C)] - #[allow(dead_code)] - struct Args { - code_hash: u32, - ref_time_limit: u64, - proof_size_limit: u64, - deposit_limit: u32, - value: u32, - input: u32, - input_len: u32, - address: u32, - output: u32, - output_len: u32, - salt: u32, - } - let args = Args { - code_hash: code_hash.as_ptr() as _, - ref_time_limit, - proof_size_limit, - deposit_limit: deposit_limit_ptr as _, - value: value.as_ptr() as _, - input: input.as_ptr() as _, - input_len: input.len() as _, - address: address as _, - output: output_ptr as _, - output_len: &mut output_len as *mut _ as _, - salt: salt_ptr as _, - }; - let ret_code = { unsafe { sys::instantiate(&args as *const Args as *const _) } }; + let deposit_and_value = pack_hi_lo(deposit_limit_ptr as _, value.as_ptr() as _); + let address_and_salt = pack_hi_lo(address as _, salt_ptr as _); + let input_data = pack_hi_lo(input.len() as _, input.as_ptr() as _); + let output_data = pack_hi_lo(&mut output_len_ptr as *mut _ as _, output_ptr as _); + + let ret_code = unsafe { + sys::instantiate( + ref_time_limit, + proof_size_limit, + deposit_and_value, + input_data, + output_data, + address_and_salt, + ) + }; if let Some(ref mut output) = output { - extract_from_slice(output, output_len as usize); + extract_from_slice(output, output_len_ptr as usize); } ret_code.into() @@ -232,34 +238,22 @@ impl HostFn for HostFnImpl { ) -> Result { let (output_ptr, mut output_len) = ptr_len_or_sentinel(&mut output); let deposit_limit_ptr = deposit_limit.as_ptr(); - #[repr(C)] - #[allow(dead_code)] - struct Args { - flags: u32, - callee: u32, - ref_time_limit: u64, - proof_size_limit: u64, - deposit_limit: u32, - value: u32, - input: u32, - input_len: u32, - output: u32, - output_len: u32, - } - let args = Args { - flags: flags.bits(), - callee: callee.as_ptr() as _, - ref_time_limit, - proof_size_limit, - deposit_limit: deposit_limit_ptr as _, - value: value.as_ptr() as _, - input: input.as_ptr() as _, - input_len: input.len() as _, - output: output_ptr as _, - output_len: &mut output_len as *mut _ as _, - }; - let ret_code = { unsafe { sys::call(&args as *const Args as *const _) } }; + let flags_and_callee = pack_hi_lo(flags.bits(), callee.as_ptr() as _); + let deposit_and_value = pack_hi_lo(deposit_limit_ptr as _, value.as_ptr() as _); + let input_data = pack_hi_lo(input.len() as _, input.as_ptr() as _); + let output_data = pack_hi_lo(&mut output_len as *mut _ as _, output_ptr as _); + + let ret_code = unsafe { + sys::call( + flags_and_callee, + ref_time_limit, + proof_size_limit, + deposit_and_value, + input_data, + output_data, + ) + }; if let Some(ref mut output) = output { extract_from_slice(output, output_len as usize); @@ -279,32 +273,21 @@ impl HostFn for HostFnImpl { ) -> Result { let (output_ptr, mut output_len) = ptr_len_or_sentinel(&mut output); let deposit_limit_ptr = deposit_limit.as_ptr(); - #[repr(C)] - #[allow(dead_code)] - struct Args { - flags: u32, - address: u32, - ref_time_limit: u64, - proof_size_limit: u64, - deposit_limit: u32, - input: u32, - input_len: u32, - output: u32, - output_len: u32, - } - let args = Args { - flags: flags.bits(), - address: address.as_ptr() as _, - ref_time_limit, - proof_size_limit, - deposit_limit: deposit_limit_ptr as _, - input: input.as_ptr() as _, - input_len: input.len() as _, - output: output_ptr as _, - output_len: &mut output_len as *mut _ as _, - }; - let ret_code = { unsafe { sys::delegate_call(&args as *const Args as *const _) } }; + let flags_and_callee = pack_hi_lo(flags.bits(), address.as_ptr() as u32); + let input_data = pack_hi_lo(input.len() as u32, input.as_ptr() as u32); + let output_data = pack_hi_lo(&mut output_len as *mut _ as u32, output_ptr as u32); + + let ret_code = unsafe { + sys::delegate_call( + flags_and_callee, + ref_time_limit, + proof_size_limit, + deposit_limit_ptr as _, + input_data, + output_data, + ) + }; if let Some(ref mut output) = output { extract_from_slice(output, output_len as usize); diff --git a/substrate/frame/revive/uapi/src/lib.rs b/substrate/frame/revive/uapi/src/lib.rs index 867f356339876..bbd647a7faed5 100644 --- a/substrate/frame/revive/uapi/src/lib.rs +++ b/substrate/frame/revive/uapi/src/lib.rs @@ -131,3 +131,14 @@ impl ReturnCode { } type Result = core::result::Result<(), ReturnErrorCode>; + +/// Helper to pack two `u32` values into a `u64` register. +/// +/// Pointers to PVM memory are always 32 bit in size. Thus contracts can pack two +/// pointers into a single register when calling a syscall API method. +/// +/// This is done in syscall API methods where the number of arguments is exceeding +/// the available registers. +pub fn pack_hi_lo(hi: u32, lo: u32) -> u64 { + ((hi as u64) << 32) | lo as u64 +}