From 9c76672f3e8a34b488a0bb2ba1b0f1a69580c29d Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Tue, 1 Feb 2022 12:10:56 +0300 Subject: [PATCH 01/23] is_contract() and caller_is_origin() added to Ext API --- frame/contracts/src/exec.rs | 20 +++++++++++++++++++- frame/contracts/src/wasm/mod.rs | 6 ++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index e4988eea51d0b..6e9739f275b63 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -158,6 +158,16 @@ pub trait Ext: sealing::Sealed { /// Returns a reference to the account id of the caller. fn caller(&self) -> &AccountIdOf; + /// Check if a contract lives at a specific address + fn is_contract(&self, address: AccountIdOf) -> bool; + + /// Check if the caller of the current contract is the origin of the whole call stack + /// + /// This can be checked with `is_contract(self.caller())` as well. + /// However, this very function does not require any storage lookup and therefore uses much + /// less gas. + fn caller_is_origin(&self) -> bool; + /// Returns a reference to the account id of the current contract. fn address(&self) -> &AccountIdOf; @@ -483,7 +493,7 @@ where T::AccountId: UncheckedFrom + AsRef<[u8]>, E: Executable, { - /// Create an run a new call stack by calling into `dest`. + /// Create and run a new call stack by calling into `dest`. /// /// # Note /// @@ -1024,6 +1034,14 @@ where self.frames().nth(1).map(|f| &f.account_id).unwrap_or(&self.origin) } + fn is_contract(&self, address: T::AccountId) -> bool { + ContractInfoOf::::get(&address).is_some() + } + + fn caller_is_origin(&self) -> bool { + self.caller() == &self.origin + } + fn balance(&self) -> BalanceOf { T::Currency::free_balance(&self.top_frame().account_id) } diff --git a/frame/contracts/src/wasm/mod.rs b/frame/contracts/src/wasm/mod.rs index 41e940bcd9b6c..d4f73522a9bd2 100644 --- a/frame/contracts/src/wasm/mod.rs +++ b/frame/contracts/src/wasm/mod.rs @@ -409,6 +409,12 @@ mod tests { fn caller(&self) -> &AccountIdOf { &ALICE } + fn is_contract(&self, _address: AccountIdOf) -> bool { + true + } + fn caller_is_origin(&self) -> bool { + false + } fn address(&self) -> &AccountIdOf { &BOB } From 7af3ab177a902ac1a9bbb484ad278c2ae284f32e Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Wed, 2 Feb 2022 00:59:06 +0300 Subject: [PATCH 02/23] is_contract() exposed in wasm runtime.rs --- frame/contracts/src/schedule.rs | 4 ++++ frame/contracts/src/wasm/runtime.rs | 21 +++++++++++++++++++++ frame/contracts/src/weights.rs | 13 +++++++++++++ 3 files changed, 38 insertions(+) diff --git a/frame/contracts/src/schedule.rs b/frame/contracts/src/schedule.rs index f8ca182aea586..8b27c792349eb 100644 --- a/frame/contracts/src/schedule.rs +++ b/frame/contracts/src/schedule.rs @@ -256,6 +256,9 @@ pub struct HostFnWeights { /// Weight of calling `seal_caller`. pub caller: Weight, + /// Weight of calling `seal_is_contract`. + pub is_contract: Weight, + /// Weight of calling `seal_address`. pub address: Weight, @@ -571,6 +574,7 @@ impl Default for HostFnWeights { fn default() -> Self { Self { caller: cost_batched!(seal_caller), + is_contract: cost_batched!(seal_is_contract), address: cost_batched!(seal_address), gas_left: cost_batched!(seal_gas_left), balance: cost_batched!(seal_balance), diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index 13aa934306978..3f46b9b18a918 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -138,6 +138,8 @@ pub enum RuntimeCosts { MeteringBlock(u32), /// Weight of calling `seal_caller`. Caller, + /// Weight of calling `seal_is_contract`. + IsContract, /// Weight of calling `seal_address`. Address, /// Weight of calling `seal_gas_left`. @@ -225,6 +227,7 @@ impl RuntimeCosts { let weight = match *self { MeteringBlock(amount) => s.gas.saturating_add(amount.into()), Caller => s.caller, + IsContract => s.is_contract, Address => s.address, GasLeft => s.gas_left, Balance => s.balance, @@ -1254,6 +1257,24 @@ define_env!(Env, , )?) }, + // Checks whether a specified address belongs to a contract. + // + // # Parameters + // + // - account_ptr: a pointer to the address of the beneficiary account + // Should be decodable as an `T::AccountId`. Traps otherwise. + // - account_len: length of the address buffer. + // + // Returned value is u32-encoded boolean: (0 = false, 1 = true) + [__unstable__] seal_is_contract(ctx, account_ptr: u32, + _account_len: u32) -> u32 => { + ctx.charge_gas(RuntimeCosts::IsContract)?; + let address: <::T as frame_system::Config>::AccountId = + ctx.read_sandbox_memory_as(account_ptr)?; + + Ok(ctx.ext.is_contract(address) as u32) + }, + // Stores the address of the current contract into the supplied buffer. // // The value is stored to linear memory at the address pointed to by `out_ptr`. diff --git a/frame/contracts/src/weights.rs b/frame/contracts/src/weights.rs index 24a42cc10649a..6b4293fbc8f4f 100644 --- a/frame/contracts/src/weights.rs +++ b/frame/contracts/src/weights.rs @@ -55,6 +55,7 @@ pub trait WeightInfo { fn upload_code(c: u32, ) -> Weight; fn remove_code() -> Weight; fn seal_caller(r: u32, ) -> Weight; + fn seal_is_contract(r: u32, ) -> Weight; fn seal_address(r: u32, ) -> Weight; fn seal_gas_left(r: u32, ) -> Weight; fn seal_balance(r: u32, ) -> Weight; @@ -263,6 +264,12 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } + // Storage: Contracts ContractInfoOf (r:1 w:0) + fn seal_is_contract(r: u32, ) -> Weight { + (168_803_000 as Weight) // TBD: replace with measured value? + .saturating_add((56_278_000 as Weight).saturating_mul(r as Weight)) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + } // Storage: System Account (r:1 w:0) // Storage: Contracts ContractInfoOf (r:1 w:1) // Storage: Contracts CodeStorage (r:1 w:0) @@ -1110,6 +1117,12 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } + // Storage: Contracts ContractInfoOf (r:1 w:0) + fn seal_is_contract(r: u32, ) -> Weight { + (168_803_000 as Weight) // TBD: replace with measured value? + .saturating_add((56_278_000 as Weight).saturating_mul(r as Weight)) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + } // Storage: System Account (r:1 w:0) // Storage: Contracts ContractInfoOf (r:1 w:1) // Storage: Contracts CodeStorage (r:1 w:0) From fe5e2a6a71e69438cee0e5f50ef9a669348fad05 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Wed, 2 Feb 2022 20:03:31 +0300 Subject: [PATCH 03/23] + test for is_contract() --- frame/contracts/src/exec.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index 6e9739f275b63..a36a4429865c5 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -1638,6 +1638,36 @@ mod tests { WITNESSED_CALLER_CHARLIE.with(|caller| assert_eq!(*caller.borrow(), Some(dest))); } + #[test] + fn is_contract_returns_proper_values() { + let bob_ch = MockLoader::insert(Call, |ctx, _| { + // Verify that BOB is a contract + assert!(ctx.ext.is_contract(BOB)); + // Verify that ALICE is not a contract + assert!(!ctx.ext.is_contract(ALICE)); + exec_success() + }); + + ExtBuilder::default().build().execute_with(|| { + let schedule = ::Schedule::get(); + place_contract(&BOB, bob_ch); + + let mut storage_meter = storage::meter::Meter::new(&ALICE, Some(0), 0).unwrap(); + let result = MockStack::run_call( + ALICE, + BOB, + &mut GasMeter::::new(GAS_LIMIT), + &mut storage_meter, + &schedule, + 0, + vec![], + None, + ); + + assert_matches!(result, Ok(_)); + }); + } + #[test] fn address_returns_proper_values() { let bob_ch = MockLoader::insert(Call, |ctx, _| { From 5ed28c86c4f81e4be83e92ed463bf69974973428 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 3 Feb 2022 00:19:02 +0300 Subject: [PATCH 04/23] + seal_is_contract benchmark --- frame/contracts/src/benchmarking/mod.rs | 36 +++++++++++++++++++++++++ frame/contracts/src/wasm/runtime.rs | 4 +-- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index 83be846465e47..461abf01782a8 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -398,6 +398,42 @@ benchmarks! { let origin = RawOrigin::Signed(instance.caller.clone()); }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) + seal_is_contract { + let r in 0 .. API_BENCHMARK_BATCHES; + let accounts = (0 .. r * API_BENCHMARK_BATCH_SIZE) + .map(|n| account::("account", n, 0)) + .collect::>(); + let accounts_bytes = accounts.iter().map(|a| a.encode()).flatten().collect::>(); + let code = WasmModule::::from(ModuleDefinition { + memory: Some(ImportedMemory::max::()), + imported_functions: vec![ImportedFunction { + module: "__unstable__", + name: "seal_is_contract", + params: vec![ValueType::I32], + return_type: Some(ValueType::I32), + }], + data_segments: vec![ + DataSegment { + offset: 0, + value: accounts_bytes + }, + ], + call_body: Some(body::repeated_dyn(r * API_BENCHMARK_BATCH_SIZE, vec![ + Counter(0, 4), // address_ptr + Regular(Instruction::Call(0)), + Regular(Instruction::Drop), + ])), + .. Default::default() + }); + let instance = Contract::::new(code, vec![])?; + let info = instance.info()?; + // every 2nd account would be a contract + for acc in accounts.iter().step_by(2) { + >::insert(acc, info.clone()); + } + let origin = RawOrigin::Signed(instance.caller.clone()); + }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) + seal_address { let r in 0 .. API_BENCHMARK_BATCHES; let instance = Contract::::new(WasmModule::getter( diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index 3f46b9b18a918..e44f59db2b728 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -1263,11 +1263,9 @@ define_env!(Env, , // // - account_ptr: a pointer to the address of the beneficiary account // Should be decodable as an `T::AccountId`. Traps otherwise. - // - account_len: length of the address buffer. // // Returned value is u32-encoded boolean: (0 = false, 1 = true) - [__unstable__] seal_is_contract(ctx, account_ptr: u32, - _account_len: u32) -> u32 => { + [__unstable__] seal_is_contract(ctx, account_ptr: u32) -> u32 => { ctx.charge_gas(RuntimeCosts::IsContract)?; let address: <::T as frame_system::Config>::AccountId = ctx.read_sandbox_memory_as(account_ptr)?; From ef9129f26e767d6bcfd6f1d36cf074a605fce23d Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 3 Feb 2022 13:03:07 +0300 Subject: [PATCH 05/23] caller_is_origin() exposed to wasm/runtime.rs and covered by a test --- frame/contracts/src/exec.rs | 34 +++++++++++++++++++++++++++++ frame/contracts/src/schedule.rs | 4 ++++ frame/contracts/src/wasm/runtime.rs | 20 ++++++++++++++--- frame/contracts/src/weights.rs | 13 +++++++++-- 4 files changed, 66 insertions(+), 5 deletions(-) diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index a36a4429865c5..9ef94636a3498 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -1663,7 +1663,41 @@ mod tests { vec![], None, ); + assert_matches!(result, Ok(_)); + }); + } + #[test] + fn caller_is_origin_returns_proper_values() { + let code_bob = MockLoader::insert(Call, |ctx, _| { + // CHARLIE is not the origin of the stack call + assert!(!ctx.ext.caller_is_origin()); + exec_success() + }); + + let code_charlie = MockLoader::insert(Call, |ctx, _| { + // ALICE is the origin of the call stack + assert!(ctx.ext.caller_is_origin()); + // CHARLIE calls BOB + ctx.ext.call(0, BOB, 0, vec![1], true) + }); + + ExtBuilder::default().build().execute_with(|| { + let schedule = ::Schedule::get(); + place_contract(&BOB, code_bob); + place_contract(&CHARLIE, code_charlie); + let mut storage_meter = storage::meter::Meter::new(&ALICE, Some(0), 0).unwrap(); + // ALICE -> CHARLIE (caller is origin) -> BOB (caller is not origin) + let result = MockStack::run_call( + ALICE, + CHARLIE, + &mut GasMeter::::new(GAS_LIMIT), + &mut storage_meter, + &schedule, + 0, + vec![0], + None, + ); assert_matches!(result, Ok(_)); }); } diff --git a/frame/contracts/src/schedule.rs b/frame/contracts/src/schedule.rs index 8b27c792349eb..266c0a6e2748d 100644 --- a/frame/contracts/src/schedule.rs +++ b/frame/contracts/src/schedule.rs @@ -259,6 +259,9 @@ pub struct HostFnWeights { /// Weight of calling `seal_is_contract`. pub is_contract: Weight, + /// Weight of calling `seal_caller_is_origin`. + pub caller_is_origin: Weight, + /// Weight of calling `seal_address`. pub address: Weight, @@ -575,6 +578,7 @@ impl Default for HostFnWeights { Self { caller: cost_batched!(seal_caller), is_contract: cost_batched!(seal_is_contract), + caller_is_origin: cost_batched!(seal_caller_is_origin), address: cost_batched!(seal_address), gas_left: cost_batched!(seal_gas_left), balance: cost_batched!(seal_balance), diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index e44f59db2b728..e4ea5f26729f1 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -140,6 +140,8 @@ pub enum RuntimeCosts { Caller, /// Weight of calling `seal_is_contract`. IsContract, + /// Weight of calling `seal_caller_is_origin`. + CallerIsOrigin, /// Weight of calling `seal_address`. Address, /// Weight of calling `seal_gas_left`. @@ -228,6 +230,7 @@ impl RuntimeCosts { MeteringBlock(amount) => s.gas.saturating_add(amount.into()), Caller => s.caller, IsContract => s.is_contract, + CallerIsOrigin => s.caller_is_origin, Address => s.address, GasLeft => s.gas_left, Balance => s.balance, @@ -1264,15 +1267,26 @@ define_env!(Env, , // - account_ptr: a pointer to the address of the beneficiary account // Should be decodable as an `T::AccountId`. Traps otherwise. // - // Returned value is u32-encoded boolean: (0 = false, 1 = true) + // Returned value is an u32-encoded boolean: (0 = false, 1 = true) [__unstable__] seal_is_contract(ctx, account_ptr: u32) -> u32 => { ctx.charge_gas(RuntimeCosts::IsContract)?; - let address: <::T as frame_system::Config>::AccountId = - ctx.read_sandbox_memory_as(account_ptr)?; + let address: <::T as frame_system::Config>::AccountId = + ctx.read_sandbox_memory_as(account_ptr)?; Ok(ctx.ext.is_contract(address) as u32) }, + // Checks whether the caller of the current contract is the origin of the whole call stack + // + // Does not perform any storage lookups. + // + // Returned value is an u32-encoded boolean: (0 = false, 1 = true) + [__unstable__] seal_caller_is_origin(ctx) -> u32 => { + ctx.charge_gas(RuntimeCosts::CallerIsOrigin)?; + Ok(ctx.ext.caller_is_origin() as u32) + }, + + // Stores the address of the current contract into the supplied buffer. // // The value is stored to linear memory at the address pointed to by `out_ptr`. diff --git a/frame/contracts/src/weights.rs b/frame/contracts/src/weights.rs index 6b4293fbc8f4f..f4493cec93ea5 100644 --- a/frame/contracts/src/weights.rs +++ b/frame/contracts/src/weights.rs @@ -56,6 +56,7 @@ pub trait WeightInfo { fn remove_code() -> Weight; fn seal_caller(r: u32, ) -> Weight; fn seal_is_contract(r: u32, ) -> Weight; + fn seal_caller_is_origin(r: u32, ) -> Weight; fn seal_address(r: u32, ) -> Weight; fn seal_gas_left(r: u32, ) -> Weight; fn seal_balance(r: u32, ) -> Weight; @@ -266,10 +267,14 @@ impl WeightInfo for SubstrateWeight { } // Storage: Contracts ContractInfoOf (r:1 w:0) fn seal_is_contract(r: u32, ) -> Weight { - (168_803_000 as Weight) // TBD: replace with measured value? + (168_803_000 as Weight) // TBD: replace with measured value .saturating_add((56_278_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) } + fn seal_caller_is_origin(r: u32, ) -> Weight { + (36_501_000 as Weight) // TBD: replace with measured value + .saturating_add((2_490_000 as Weight).saturating_mul(r as Weight)) + } // Storage: System Account (r:1 w:0) // Storage: Contracts ContractInfoOf (r:1 w:1) // Storage: Contracts CodeStorage (r:1 w:0) @@ -1119,10 +1124,14 @@ impl WeightInfo for () { } // Storage: Contracts ContractInfoOf (r:1 w:0) fn seal_is_contract(r: u32, ) -> Weight { - (168_803_000 as Weight) // TBD: replace with measured value? + (168_803_000 as Weight) // TBD: replace with measured value .saturating_add((56_278_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) } + fn seal_caller_is_origin(r: u32, ) -> Weight { + (36_501_000 as Weight) // TBD: replace with measured value + .saturating_add((2_490_000 as Weight).saturating_mul(r as Weight)) + } // Storage: System Account (r:1 w:0) // Storage: Contracts ContractInfoOf (r:1 w:1) // Storage: Contracts CodeStorage (r:1 w:0) From 83e1000be891472d703c5b6b1dce03ffd048c633 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 3 Feb 2022 14:01:24 +0300 Subject: [PATCH 06/23] + seal_caller_is_origin benchmark --- frame/contracts/src/benchmarking/mod.rs | 22 +++++++++++++++++++++- frame/contracts/src/wasm/runtime.rs | 1 - 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index 461abf01782a8..712e3c2af7e6c 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -421,7 +421,7 @@ benchmarks! { call_body: Some(body::repeated_dyn(r * API_BENCHMARK_BATCH_SIZE, vec![ Counter(0, 4), // address_ptr Regular(Instruction::Call(0)), - Regular(Instruction::Drop), + Regular(Instruction::Drop), ])), .. Default::default() }); @@ -434,6 +434,26 @@ benchmarks! { let origin = RawOrigin::Signed(instance.caller.clone()); }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) + seal_caller_is_origin { + let r in 0 .. API_BENCHMARK_BATCHES; + let code = WasmModule::::from(ModuleDefinition { + memory: Some(ImportedMemory::max::()), + imported_functions: vec![ImportedFunction { + module: "__unstable__", + name: "seal_caller_is_origin", + params: vec![], + return_type: Some(ValueType::I32), + }], + call_body: Some(body::repeated(r * API_BENCHMARK_BATCH_SIZE, &[ + Instruction::Call(0), + Instruction::Drop, + ])), + .. Default::default() + }); + let instance = Contract::::new(code, vec![])?; + let origin = RawOrigin::Signed(instance.caller.clone()); + }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) + seal_address { let r in 0 .. API_BENCHMARK_BATCHES; let instance = Contract::::new(WasmModule::getter( diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index e4ea5f26729f1..c7148a2992f33 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -1286,7 +1286,6 @@ define_env!(Env, , Ok(ctx.ext.caller_is_origin() as u32) }, - // Stores the address of the current contract into the supplied buffer. // // The value is stored to linear memory at the address pointed to by `out_ptr`. From a0311fca037da8f2a4b4b6210d293cdcef38b3fa Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 3 Feb 2022 14:06:29 +0100 Subject: [PATCH 07/23] Update frame/contracts/src/exec.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexander Theißen --- frame/contracts/src/exec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index 9ef94636a3498..fe44de105fbb0 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -158,7 +158,7 @@ pub trait Ext: sealing::Sealed { /// Returns a reference to the account id of the caller. fn caller(&self) -> &AccountIdOf; - /// Check if a contract lives at a specific address + /// Check if a contract lives at the specified `address`. fn is_contract(&self, address: AccountIdOf) -> bool; /// Check if the caller of the current contract is the origin of the whole call stack From 7b98d32b8686f3f8bf4001adec8ce804a17b6e74 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 3 Feb 2022 14:07:08 +0100 Subject: [PATCH 08/23] Update frame/contracts/src/exec.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexander Theißen --- frame/contracts/src/exec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index fe44de105fbb0..4bba27e4a254b 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -161,7 +161,7 @@ pub trait Ext: sealing::Sealed { /// Check if a contract lives at the specified `address`. fn is_contract(&self, address: AccountIdOf) -> bool; - /// Check if the caller of the current contract is the origin of the whole call stack + /// Check if the caller of the current contract is the origin of the whole call stack. /// /// This can be checked with `is_contract(self.caller())` as well. /// However, this very function does not require any storage lookup and therefore uses much From 835d87584676a4509cc45cff86654c4c31f85c56 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 3 Feb 2022 14:07:28 +0100 Subject: [PATCH 09/23] Update frame/contracts/src/exec.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexander Theißen --- frame/contracts/src/exec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index 4bba27e4a254b..b906cf674c4df 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -1035,7 +1035,7 @@ where } fn is_contract(&self, address: T::AccountId) -> bool { - ContractInfoOf::::get(&address).is_some() + ContractInfoOf::::contains_key(&address) } fn caller_is_origin(&self) -> bool { From 12bda73b52b6a18c9bd609c52c9d75b55503d40b Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 3 Feb 2022 14:08:41 +0100 Subject: [PATCH 10/23] Update frame/contracts/src/wasm/runtime.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexander Theißen --- frame/contracts/src/wasm/runtime.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index c7148a2992f33..19a396885ffce 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -1267,7 +1267,7 @@ define_env!(Env, , // - account_ptr: a pointer to the address of the beneficiary account // Should be decodable as an `T::AccountId`. Traps otherwise. // - // Returned value is an u32-encoded boolean: (0 = false, 1 = true) + // Returned value is a u32-encoded boolean: (0 = false, 1 = true). [__unstable__] seal_is_contract(ctx, account_ptr: u32) -> u32 => { ctx.charge_gas(RuntimeCosts::IsContract)?; let address: <::T as frame_system::Config>::AccountId = From 171bb8e8ebfd17bfc15c65710818929d0688c9c9 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 3 Feb 2022 14:09:04 +0100 Subject: [PATCH 11/23] Update frame/contracts/src/wasm/runtime.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexander Theißen --- frame/contracts/src/wasm/runtime.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index 19a396885ffce..944a589148c64 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -1280,7 +1280,7 @@ define_env!(Env, , // // Does not perform any storage lookups. // - // Returned value is an u32-encoded boolean: (0 = false, 1 = true) + // Returned value is a u32-encoded boolean: (0 = false, 1 = true). [__unstable__] seal_caller_is_origin(ctx) -> u32 => { ctx.charge_gas(RuntimeCosts::CallerIsOrigin)?; Ok(ctx.ext.caller_is_origin() as u32) From ea41d7928f82854f627af7655a4da22b1a67b043 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 3 Feb 2022 14:10:07 +0100 Subject: [PATCH 12/23] Update frame/contracts/src/wasm/runtime.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexander Theißen --- frame/contracts/src/wasm/runtime.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index 944a589148c64..b13fde9f7d360 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -1276,9 +1276,12 @@ define_env!(Env, , Ok(ctx.ext.is_contract(address) as u32) }, - // Checks whether the caller of the current contract is the origin of the whole call stack + // Checks whether the caller of the current contract is the origin of the whole call stack. // - // Does not perform any storage lookups. + // Prefer this over `seal_is_contract` when checking whether being called by a contract + // or a plain account. Reason is that it performs better since it does not need to + // do any storage lookups: `true` implies that this contract is being called by a plain account + // and `false` implies that the caller is another contract. // // Returned value is a u32-encoded boolean: (0 = false, 1 = true). [__unstable__] seal_caller_is_origin(ctx) -> u32 => { From e4c7f4df5f538f5cbefda00b22bf4cdb4566ed0d Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 3 Feb 2022 14:11:05 +0100 Subject: [PATCH 13/23] Update frame/contracts/src/exec.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexander Theißen --- frame/contracts/src/exec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index b906cf674c4df..39143200c68a9 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -1679,7 +1679,7 @@ mod tests { // ALICE is the origin of the call stack assert!(ctx.ext.caller_is_origin()); // CHARLIE calls BOB - ctx.ext.call(0, BOB, 0, vec![1], true) + ctx.ext.call(0, BOB, 0, vec![], true) }); ExtBuilder::default().build().execute_with(|| { From d1f3a41bdd619ce2e97be27334302797898b3e48 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 3 Feb 2022 17:40:04 +0300 Subject: [PATCH 14/23] identation fix for benchmark macroses; test cosmetic improvement --- frame/contracts/src/benchmarking/mod.rs | 13 +++++++------ frame/contracts/src/exec.rs | 14 +++++++------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index 712e3c2af7e6c..00f21dea48458 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -403,6 +403,7 @@ benchmarks! { let accounts = (0 .. r * API_BENCHMARK_BATCH_SIZE) .map(|n| account::("account", n, 0)) .collect::>(); + let account_len = accounts.get(0).map(|i| i.encode().len()).unwrap_or(0); let accounts_bytes = accounts.iter().map(|a| a.encode()).flatten().collect::>(); let code = WasmModule::::from(ModuleDefinition { memory: Some(ImportedMemory::max::()), @@ -415,11 +416,11 @@ benchmarks! { data_segments: vec![ DataSegment { offset: 0, - value: accounts_bytes + value: accounts_bytes }, ], call_body: Some(body::repeated_dyn(r * API_BENCHMARK_BATCH_SIZE, vec![ - Counter(0, 4), // address_ptr + Counter(0, account_len), // address_ptr Regular(Instruction::Call(0)), Regular(Instruction::Drop), ])), @@ -427,8 +428,8 @@ benchmarks! { }); let instance = Contract::::new(code, vec![])?; let info = instance.info()?; - // every 2nd account would be a contract - for acc in accounts.iter().step_by(2) { + // every account would be a contract (worst case) + for acc in accounts.iter() { >::insert(acc, info.clone()); } let origin = RawOrigin::Signed(instance.caller.clone()); @@ -445,8 +446,8 @@ benchmarks! { return_type: Some(ValueType::I32), }], call_body: Some(body::repeated(r * API_BENCHMARK_BATCH_SIZE, &[ - Instruction::Call(0), - Instruction::Drop, + Instruction::Call(0), // + Instruction::Drop, ])), .. Default::default() }); diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index 39143200c68a9..212f99135e588 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -1669,17 +1669,17 @@ mod tests { #[test] fn caller_is_origin_returns_proper_values() { - let code_bob = MockLoader::insert(Call, |ctx, _| { - // CHARLIE is not the origin of the stack call + let code_charlie = MockLoader::insert(Call, |ctx, _| { + // BOB is not the origin of the stack call assert!(!ctx.ext.caller_is_origin()); exec_success() }); - let code_charlie = MockLoader::insert(Call, |ctx, _| { + let code_bob = MockLoader::insert(Call, |ctx, _| { // ALICE is the origin of the call stack assert!(ctx.ext.caller_is_origin()); - // CHARLIE calls BOB - ctx.ext.call(0, BOB, 0, vec![], true) + // BOB calls CHARLIE + ctx.ext.call(0, CHARLIE, 0, vec![], true) }); ExtBuilder::default().build().execute_with(|| { @@ -1687,10 +1687,10 @@ mod tests { place_contract(&BOB, code_bob); place_contract(&CHARLIE, code_charlie); let mut storage_meter = storage::meter::Meter::new(&ALICE, Some(0), 0).unwrap(); - // ALICE -> CHARLIE (caller is origin) -> BOB (caller is not origin) + // ALICE -> BOB (caller is origin) -> CHARLIE (caller is not origin) let result = MockStack::run_call( ALICE, - CHARLIE, + BOB, &mut GasMeter::::new(GAS_LIMIT), &mut storage_meter, &schedule, From 67d91d445a3b2ac16f977849c4a709d25e11d6fe Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 3 Feb 2022 17:47:08 +0300 Subject: [PATCH 15/23] benchmark fix --- frame/contracts/src/benchmarking/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index 00f21dea48458..270c00b19997d 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -420,7 +420,7 @@ benchmarks! { }, ], call_body: Some(body::repeated_dyn(r * API_BENCHMARK_BATCH_SIZE, vec![ - Counter(0, account_len), // address_ptr + Counter(0, account_len as u32), // address_ptr Regular(Instruction::Call(0)), Regular(Instruction::Drop), ])), From 04aca2a53951b399c8d10c5d7bf387343c91f987 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 3 Feb 2022 20:28:31 +0300 Subject: [PATCH 16/23] + is_contract() wasm test --- frame/contracts/src/wasm/mod.rs | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/frame/contracts/src/wasm/mod.rs b/frame/contracts/src/wasm/mod.rs index d4f73522a9bd2..2b276eb6243ed 100644 --- a/frame/contracts/src/wasm/mod.rs +++ b/frame/contracts/src/wasm/mod.rs @@ -2246,4 +2246,45 @@ mod tests { let result = execute(CODE, [2u8; 32].encode(), &mut ext).unwrap(); assert_eq!(u32::from_le_bytes(result.data.0.try_into().unwrap()), 0,); } + + #[test] + #[cfg(feature = "unstable-interface")] + fn is_contract_works() { + const CODE_IS_CONTRACT: &str = r#" +;; This runs is_contract check on zero account address +(module + (import "__unstable__" "seal_is_contract" (func $seal_is_contract (param i32) (result i32))) + (import "seal0" "seal_return" (func $seal_return (param i32 i32 i32))) + (import "env" "memory" (memory 1 1)) + + ;; [0, 32) zero-adress + (data (i32.const 0) + "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" + "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" + ) + + ;; [32, 36) here we store the return code of the `seal_is_contract` + + (func (export "deploy")) + + (func (export "call") + (i32.store + (i32.const 32) + (call $seal_is_contract + (i32.const 0) ;; ptr to destination address + ) + ) + ;; exit with success and take `seal_is_contract` return code to the output buffer + (call $seal_return (i32.const 0) (i32.const 32) (i32.const 4)) + ) +) +"#; + let output = execute(CODE_IS_CONTRACT, vec![], MockExt::default()).unwrap(); + + // The mock ext just returns the same data that was passed as the subject. + assert_eq!( + output, + ExecReturnValue { flags: ReturnFlags::empty(), data: Bytes(1u32.encode()) }, + ); + } } From 3ad46ec3688be71a0e0ad645ae9e2f9a8d60e88d Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 3 Feb 2022 20:34:34 +0300 Subject: [PATCH 17/23] + caller_is_origin() wasm test --- frame/contracts/src/wasm/mod.rs | 35 ++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/frame/contracts/src/wasm/mod.rs b/frame/contracts/src/wasm/mod.rs index 2b276eb6243ed..c8240ef2886c4 100644 --- a/frame/contracts/src/wasm/mod.rs +++ b/frame/contracts/src/wasm/mod.rs @@ -2251,7 +2251,7 @@ mod tests { #[cfg(feature = "unstable-interface")] fn is_contract_works() { const CODE_IS_CONTRACT: &str = r#" -;; This runs is_contract check on zero account address +;; This runs `is_contract` check on zero account address (module (import "__unstable__" "seal_is_contract" (func $seal_is_contract (param i32) (result i32))) (import "seal0" "seal_return" (func $seal_return (param i32 i32 i32))) @@ -2287,4 +2287,37 @@ mod tests { ExecReturnValue { flags: ReturnFlags::empty(), data: Bytes(1u32.encode()) }, ); } + + #[test] + #[cfg(feature = "unstable-interface")] + fn caller_is_origin_works() { + const CODE_CALLER_IS_ORIGIN: &str = r#" +;; This runs `caller_is_origin` check on zero account address +(module + (import "__unstable__" "seal_caller_is_origin" (func $seal_is_contract (result i32))) + (import "seal0" "seal_return" (func $seal_return (param i32 i32 i32))) + (import "env" "memory" (memory 1 1)) + + ;; [0, 4) here we store the return code of the `seal_caller_is_origin` + + (func (export "deploy")) + + (func (export "call") + (i32.store + (i32.const 4) + (call $seal_is_contract) + ) + ;; exit with success and take `seal_caller_is_origin` return code to the output buffer + (call $seal_return (i32.const 0) (i32.const 0) (i32.const 4)) + ) +) +"#; + let output = execute(CODE_CALLER_IS_ORIGIN, vec![], MockExt::default()).unwrap(); + + // The mock ext just returns the same data that was passed as the subject. + assert_eq!( + output, + ExecReturnValue { flags: ReturnFlags::empty(), data: Bytes(0u32.encode()) }, + ); + } } From c7baa4c6280eda4e91d0c80757a9dfc977b07a5a Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 3 Feb 2022 18:42:18 +0100 Subject: [PATCH 18/23] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexander Theißen --- frame/contracts/src/benchmarking/mod.rs | 4 ++-- frame/contracts/src/exec.rs | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index 270c00b19997d..71045bde21525 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -416,7 +416,7 @@ benchmarks! { data_segments: vec![ DataSegment { offset: 0, - value: accounts_bytes + value: accounts_bytes }, ], call_body: Some(body::repeated_dyn(r * API_BENCHMARK_BATCH_SIZE, vec![ @@ -446,7 +446,7 @@ benchmarks! { return_type: Some(ValueType::I32), }], call_body: Some(body::repeated(r * API_BENCHMARK_BATCH_SIZE, &[ - Instruction::Call(0), // + Instruction::Call(0), Instruction::Drop, ])), .. Default::default() diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index 212f99135e588..bd884e541422b 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -164,8 +164,7 @@ pub trait Ext: sealing::Sealed { /// Check if the caller of the current contract is the origin of the whole call stack. /// /// This can be checked with `is_contract(self.caller())` as well. - /// However, this very function does not require any storage lookup and therefore uses much - /// less gas. + /// However, this function does not require any storage lookup and therefore uses less weight. fn caller_is_origin(&self) -> bool; /// Returns a reference to the account id of the current contract. From 8e966ba7be0958dbe27fb42bc11d11bbf9358305 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Fri, 4 Feb 2022 00:42:11 +0300 Subject: [PATCH 19/23] is_contract() to borrow param instead of taking ownership --- frame/contracts/src/exec.rs | 8 ++++---- frame/contracts/src/wasm/mod.rs | 2 +- frame/contracts/src/wasm/runtime.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index bd884e541422b..befdf592f51c0 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -159,7 +159,7 @@ pub trait Ext: sealing::Sealed { fn caller(&self) -> &AccountIdOf; /// Check if a contract lives at the specified `address`. - fn is_contract(&self, address: AccountIdOf) -> bool; + fn is_contract(&self, address: &AccountIdOf) -> bool; /// Check if the caller of the current contract is the origin of the whole call stack. /// @@ -1033,7 +1033,7 @@ where self.frames().nth(1).map(|f| &f.account_id).unwrap_or(&self.origin) } - fn is_contract(&self, address: T::AccountId) -> bool { + fn is_contract(&self, address: &T::AccountId) -> bool { ContractInfoOf::::contains_key(&address) } @@ -1641,9 +1641,9 @@ mod tests { fn is_contract_returns_proper_values() { let bob_ch = MockLoader::insert(Call, |ctx, _| { // Verify that BOB is a contract - assert!(ctx.ext.is_contract(BOB)); + assert!(ctx.ext.is_contract(&BOB)); // Verify that ALICE is not a contract - assert!(!ctx.ext.is_contract(ALICE)); + assert!(!ctx.ext.is_contract(&ALICE)); exec_success() }); diff --git a/frame/contracts/src/wasm/mod.rs b/frame/contracts/src/wasm/mod.rs index c8240ef2886c4..e81b94bf53127 100644 --- a/frame/contracts/src/wasm/mod.rs +++ b/frame/contracts/src/wasm/mod.rs @@ -409,7 +409,7 @@ mod tests { fn caller(&self) -> &AccountIdOf { &ALICE } - fn is_contract(&self, _address: AccountIdOf) -> bool { + fn is_contract(&self, _address: &AccountIdOf) -> bool { true } fn caller_is_origin(&self) -> bool { diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index b13fde9f7d360..e2539af9f99db 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -1273,7 +1273,7 @@ define_env!(Env, , let address: <::T as frame_system::Config>::AccountId = ctx.read_sandbox_memory_as(account_ptr)?; - Ok(ctx.ext.is_contract(address) as u32) + Ok(ctx.ext.is_contract(&address) as u32) }, // Checks whether the caller of the current contract is the origin of the whole call stack. From f2d6fcbc79a624b329fb089a12a6f283049953a9 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 3 Feb 2022 22:48:26 +0100 Subject: [PATCH 20/23] phrasing improved Co-authored-by: Hernando Castano --- frame/contracts/src/wasm/runtime.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index e2539af9f99db..3d6032d560693 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -1278,10 +1278,12 @@ define_env!(Env, , // Checks whether the caller of the current contract is the origin of the whole call stack. // - // Prefer this over `seal_is_contract` when checking whether being called by a contract - // or a plain account. Reason is that it performs better since it does not need to - // do any storage lookups: `true` implies that this contract is being called by a plain account - // and `false` implies that the caller is another contract. + // Prefer this over `seal_is_contract` when checking whether your contract is being called by a contract + // or a plain account. The reason is that it performs better since it does not need to + // do any storage lookups. + // + // A return value of`true` indicates that this contract is being called by a plain account + // and `false` indicates that the caller is another contract. // // Returned value is a u32-encoded boolean: (0 = false, 1 = true). [__unstable__] seal_caller_is_origin(ctx) -> u32 => { From e22a3384d9ed46d77f8e1627324f79ef94fe4bec Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Fri, 4 Feb 2022 13:20:09 +0300 Subject: [PATCH 21/23] fixed wasm tests according to @athei feedback --- frame/contracts/src/wasm/mod.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/frame/contracts/src/wasm/mod.rs b/frame/contracts/src/wasm/mod.rs index e81b94bf53127..7c98ee7cf5b1a 100644 --- a/frame/contracts/src/wasm/mod.rs +++ b/frame/contracts/src/wasm/mod.rs @@ -2281,7 +2281,7 @@ mod tests { "#; let output = execute(CODE_IS_CONTRACT, vec![], MockExt::default()).unwrap(); - // The mock ext just returns the same data that was passed as the subject. + // The mock ext just always returns 1u32 (`true`). assert_eq!( output, ExecReturnValue { flags: ReturnFlags::empty(), data: Bytes(1u32.encode()) }, @@ -2294,18 +2294,20 @@ mod tests { const CODE_CALLER_IS_ORIGIN: &str = r#" ;; This runs `caller_is_origin` check on zero account address (module - (import "__unstable__" "seal_caller_is_origin" (func $seal_is_contract (result i32))) + (import "__unstable__" "seal_caller_is_origin" (func $seal_caller_is_origin (result i32))) (import "seal0" "seal_return" (func $seal_return (param i32 i32 i32))) (import "env" "memory" (memory 1 1)) - ;; [0, 4) here we store the return code of the `seal_caller_is_origin` + ;; [0, 4) here the return code of the `seal_caller_is_origin` will be stored + ;; we initialize it with non-zero value to be sure that it's being overwritten below + (data (i32.const 0) "\10\10\10\10") (func (export "deploy")) (func (export "call") (i32.store - (i32.const 4) - (call $seal_is_contract) + (i32.const 0) + (call $seal_caller_is_origin) ) ;; exit with success and take `seal_caller_is_origin` return code to the output buffer (call $seal_return (i32.const 0) (i32.const 0) (i32.const 4)) @@ -2314,7 +2316,7 @@ mod tests { "#; let output = execute(CODE_CALLER_IS_ORIGIN, vec![], MockExt::default()).unwrap(); - // The mock ext just returns the same data that was passed as the subject. + // The mock ext just always returns 0u32 (`false`) assert_eq!( output, ExecReturnValue { flags: ReturnFlags::empty(), data: Bytes(0u32.encode()) }, From c0b360e9a13db4c82c046c71949f2b14864af7fc Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Fri, 4 Feb 2022 14:18:04 +0300 Subject: [PATCH 22/23] dead code warnings suppressed by unstable-interface attributes --- frame/contracts/src/wasm/runtime.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index 3d6032d560693..194d5ffbaaf4f 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -139,8 +139,10 @@ pub enum RuntimeCosts { /// Weight of calling `seal_caller`. Caller, /// Weight of calling `seal_is_contract`. + #[cfg(feature = "unstable-interface")] IsContract, /// Weight of calling `seal_caller_is_origin`. + #[cfg(feature = "unstable-interface")] CallerIsOrigin, /// Weight of calling `seal_address`. Address, @@ -229,7 +231,9 @@ impl RuntimeCosts { let weight = match *self { MeteringBlock(amount) => s.gas.saturating_add(amount.into()), Caller => s.caller, + #[cfg(feature = "unstable-interface")] IsContract => s.is_contract, + #[cfg(feature = "unstable-interface")] CallerIsOrigin => s.caller_is_origin, Address => s.address, GasLeft => s.gas_left, From b3ee15120deee12d093cc921db06f51c08ac3493 Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Fri, 4 Feb 2022 17:48:52 +0000 Subject: [PATCH 23/23] cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs --- frame/contracts/src/weights.rs | 1252 ++++++++++++++++---------------- 1 file changed, 637 insertions(+), 615 deletions(-) diff --git a/frame/contracts/src/weights.rs b/frame/contracts/src/weights.rs index f4493cec93ea5..b58660b694ca9 100644 --- a/frame/contracts/src/weights.rs +++ b/frame/contracts/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_contracts //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-02-04, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -158,14 +158,14 @@ pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { // Storage: Contracts DeletionQueue (r:1 w:0) fn on_initialize() -> Weight { - (1_642_000 as Weight) + (1_640_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn on_initialize_per_trie_key(k: u32, ) -> Weight { - (7_854_000 as Weight) + (6_385_000 as Weight) // Standard Error: 0 - .saturating_add((742_000 as Weight).saturating_mul(k as Weight)) + .saturating_add((748_000 as Weight).saturating_mul(k as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) @@ -173,17 +173,17 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts DeletionQueue (r:1 w:0) fn on_initialize_per_queue_item(q: u32, ) -> Weight { (0 as Weight) - // Standard Error: 6_000 - .saturating_add((2_216_000 as Weight).saturating_mul(q as Weight)) + // Standard Error: 5_000 + .saturating_add((2_304_000 as Weight).saturating_mul(q as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Contracts PristineCode (r:1 w:0) // Storage: Contracts CodeStorage (r:0 w:1) fn reinstrument(c: u32, ) -> Weight { - (17_413_000 as Weight) - // Standard Error: 39_000 - .saturating_add((64_495_000 as Weight).saturating_mul(c as Weight)) + (22_923_000 as Weight) + // Standard Error: 33_000 + .saturating_add((65_851_000 as Weight).saturating_mul(c as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -192,9 +192,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Timestamp Now (r:1 w:0) // Storage: System Account (r:1 w:1) fn call_with_code_kb(c: u32, ) -> Weight { - (209_071_000 as Weight) - // Standard Error: 47_000 - .saturating_add((56_555_000 as Weight).saturating_mul(c as Weight)) + (209_577_000 as Weight) + // Standard Error: 53_000 + .saturating_add((61_341_000 as Weight).saturating_mul(c as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -206,11 +206,11 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts PristineCode (r:0 w:1) // Storage: Contracts OwnerInfoOf (r:0 w:1) fn instantiate_with_code(c: u32, s: u32, ) -> Weight { - (210_420_000 as Weight) - // Standard Error: 133_000 - .saturating_add((145_601_000 as Weight).saturating_mul(c as Weight)) - // Standard Error: 8_000 - .saturating_add((1_760_000 as Weight).saturating_mul(s as Weight)) + (240_302_000 as Weight) + // Standard Error: 119_000 + .saturating_add((151_894_000 as Weight).saturating_mul(c as Weight)) + // Standard Error: 7_000 + .saturating_add((1_740_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -221,9 +221,9 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:1 w:1) // Storage: Contracts OwnerInfoOf (r:1 w:1) fn instantiate(s: u32, ) -> Weight { - (173_397_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_714_000 as Weight).saturating_mul(s as Weight)) + (172_047_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_729_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -232,7 +232,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Timestamp Now (r:1 w:0) // Storage: System Account (r:1 w:1) fn call() -> Weight { - (140_169_000 as Weight) + (139_349_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -240,9 +240,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts PristineCode (r:0 w:1) // Storage: Contracts OwnerInfoOf (r:0 w:1) fn upload_code(c: u32, ) -> Weight { - (49_076_000 as Weight) - // Standard Error: 37_000 - .saturating_add((67_150_000 as Weight).saturating_mul(c as Weight)) + (50_449_000 as Weight) + // Standard Error: 45_000 + .saturating_add((68_254_000 as Weight).saturating_mul(c as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -250,7 +250,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:0 w:1) // Storage: Contracts PristineCode (r:0 w:1) fn remove_code() -> Weight { - (24_318_000 as Weight) + (24_576_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -259,30 +259,43 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_caller(r: u32, ) -> Weight { - (208_256_000 as Weight) - // Standard Error: 116_000 - .saturating_add((49_878_000 as Weight).saturating_mul(r as Weight)) + (220_059_000 as Weight) + // Standard Error: 128_000 + .saturating_add((49_607_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } - // Storage: Contracts ContractInfoOf (r:1 w:0) + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) fn seal_is_contract(r: u32, ) -> Weight { - (168_803_000 as Weight) // TBD: replace with measured value - .saturating_add((56_278_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) + (84_138_000 as Weight) + // Standard Error: 896_000 + .saturating_add((375_553_000 as Weight).saturating_mul(r as Weight)) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) fn seal_caller_is_origin(r: u32, ) -> Weight { - (36_501_000 as Weight) // TBD: replace with measured value - .saturating_add((2_490_000 as Weight).saturating_mul(r as Weight)) + (222_496_000 as Weight) + // Standard Error: 119_000 + .saturating_add((22_340_000 as Weight).saturating_mul(r as Weight)) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:0) // Storage: Contracts ContractInfoOf (r:1 w:1) // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_address(r: u32, ) -> Weight { - (230_530_000 as Weight) - // Standard Error: 132_000 - .saturating_add((47_902_000 as Weight).saturating_mul(r as Weight)) + (221_446_000 as Weight) + // Standard Error: 131_000 + .saturating_add((49_401_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -291,9 +304,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_gas_left(r: u32, ) -> Weight { - (219_027_000 as Weight) - // Standard Error: 108_000 - .saturating_add((48_039_000 as Weight).saturating_mul(r as Weight)) + (220_964_000 as Weight) + // Standard Error: 132_000 + .saturating_add((49_230_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -302,9 +315,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_balance(r: u32, ) -> Weight { - (219_036_000 as Weight) - // Standard Error: 152_000 - .saturating_add((137_047_000 as Weight).saturating_mul(r as Weight)) + (229_399_000 as Weight) + // Standard Error: 166_000 + .saturating_add((137_407_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -313,9 +326,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_value_transferred(r: u32, ) -> Weight { - (214_401_000 as Weight) - // Standard Error: 96_000 - .saturating_add((48_435_000 as Weight).saturating_mul(r as Weight)) + (220_103_000 as Weight) + // Standard Error: 133_000 + .saturating_add((49_410_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -324,9 +337,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_minimum_balance(r: u32, ) -> Weight { - (216_939_000 as Weight) - // Standard Error: 106_000 - .saturating_add((48_198_000 as Weight).saturating_mul(r as Weight)) + (228_143_000 as Weight) + // Standard Error: 151_000 + .saturating_add((48_608_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -335,9 +348,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_block_number(r: u32, ) -> Weight { - (216_637_000 as Weight) - // Standard Error: 86_000 - .saturating_add((47_819_000 as Weight).saturating_mul(r as Weight)) + (223_899_000 as Weight) + // Standard Error: 142_000 + .saturating_add((48_841_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -346,9 +359,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_now(r: u32, ) -> Weight { - (214_863_000 as Weight) - // Standard Error: 110_000 - .saturating_add((48_208_000 as Weight).saturating_mul(r as Weight)) + (224_974_000 as Weight) + // Standard Error: 148_000 + .saturating_add((48_902_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -358,9 +371,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Timestamp Now (r:1 w:0) // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0) fn seal_weight_to_fee(r: u32, ) -> Weight { - (216_494_000 as Weight) - // Standard Error: 141_000 - .saturating_add((120_736_000 as Weight).saturating_mul(r as Weight)) + (227_556_000 as Weight) + // Standard Error: 151_000 + .saturating_add((121_252_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -369,9 +382,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_gas(r: u32, ) -> Weight { - (123_867_000 as Weight) - // Standard Error: 33_000 - .saturating_add((24_578_000 as Weight).saturating_mul(r as Weight)) + (127_975_000 as Weight) + // Standard Error: 57_000 + .saturating_add((24_843_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -380,9 +393,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_input(r: u32, ) -> Weight { - (215_578_000 as Weight) - // Standard Error: 108_000 - .saturating_add((47_512_000 as Weight).saturating_mul(r as Weight)) + (224_592_000 as Weight) + // Standard Error: 141_000 + .saturating_add((48_296_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -391,9 +404,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_input_per_kb(n: u32, ) -> Weight { - (297_663_000 as Weight) + (296_995_000 as Weight) // Standard Error: 3_000 - .saturating_add((11_863_000 as Weight).saturating_mul(n as Weight)) + .saturating_add((11_884_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -401,10 +414,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts ContractInfoOf (r:1 w:1) // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) - fn seal_return(r: u32, ) -> Weight { - (209_709_000 as Weight) - // Standard Error: 75_000 - .saturating_add((1_783_000 as Weight).saturating_mul(r as Weight)) + fn seal_return(_r: u32, ) -> Weight { + (224_322_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -413,9 +424,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_return_per_kb(n: u32, ) -> Weight { - (214_403_000 as Weight) - // Standard Error: 0 - .saturating_add((197_000 as Weight).saturating_mul(n as Weight)) + (216_240_000 as Weight) + // Standard Error: 1_000 + .saturating_add((206_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -426,9 +437,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts DeletionQueue (r:1 w:1) // Storage: Contracts OwnerInfoOf (r:1 w:1) fn seal_terminate(r: u32, ) -> Weight { - (214_454_000 as Weight) - // Standard Error: 656_000 - .saturating_add((50_641_000 as Weight).saturating_mul(r as Weight)) + (219_637_000 as Weight) + // Standard Error: 3_916_000 + .saturating_add((51_769_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -440,9 +451,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Timestamp Now (r:1 w:0) // Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) fn seal_random(r: u32, ) -> Weight { - (214_140_000 as Weight) - // Standard Error: 169_000 - .saturating_add((158_778_000 as Weight).saturating_mul(r as Weight)) + (221_470_000 as Weight) + // Standard Error: 154_000 + .saturating_add((158_758_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -451,9 +462,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_deposit_event(r: u32, ) -> Weight { - (225_998_000 as Weight) - // Standard Error: 171_000 - .saturating_add((280_296_000 as Weight).saturating_mul(r as Weight)) + (228_674_000 as Weight) + // Standard Error: 203_000 + .saturating_add((287_195_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -463,11 +474,11 @@ impl WeightInfo for SubstrateWeight { // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:100 w:100) fn seal_deposit_event_per_topic_and_kb(t: u32, n: u32, ) -> Weight { - (491_432_000 as Weight) - // Standard Error: 1_992_000 - .saturating_add((288_376_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 392_000 - .saturating_add((82_805_000 as Weight).saturating_mul(n as Weight)) + (507_091_000 as Weight) + // Standard Error: 1_863_000 + .saturating_add((291_858_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 367_000 + .saturating_add((83_459_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(t as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -478,17 +489,17 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_debug_message(r: u32, ) -> Weight { - (130_861_000 as Weight) - // Standard Error: 74_000 - .saturating_add((40_268_000 as Weight).saturating_mul(r as Weight)) + (133_592_000 as Weight) + // Standard Error: 87_000 + .saturating_add((41_718_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_set_storage(r: u32, ) -> Weight { - (38_843_000 as Weight) - // Standard Error: 1_044_000 - .saturating_add((408_027_000 as Weight).saturating_mul(r as Weight)) + (44_719_000 as Weight) + // Standard Error: 1_036_000 + .saturating_add((407_521_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -496,25 +507,25 @@ impl WeightInfo for SubstrateWeight { } // Storage: Skipped Metadata (r:0 w:0) fn seal_set_storage_per_new_kb(n: u32, ) -> Weight { - (610_782_000 as Weight) - // Standard Error: 265_000 - .saturating_add((28_221_000 as Weight).saturating_mul(n as Weight)) + (606_108_000 as Weight) + // Standard Error: 315_000 + .saturating_add((29_136_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(105 as Weight)) .saturating_add(T::DbWeight::get().writes(103 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_set_storage_per_old_kb(n: u32, ) -> Weight { - (625_031_000 as Weight) - // Standard Error: 319_000 - .saturating_add((11_126_000 as Weight).saturating_mul(n as Weight)) + (634_330_000 as Weight) + // Standard Error: 281_000 + .saturating_add((10_741_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(105 as Weight)) .saturating_add(T::DbWeight::get().writes(103 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_clear_storage(r: u32, ) -> Weight { - (78_566_000 as Weight) - // Standard Error: 970_000 - .saturating_add((384_877_000 as Weight).saturating_mul(r as Weight)) + (89_750_000 as Weight) + // Standard Error: 924_000 + .saturating_add((382_525_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(3 as Weight)) @@ -522,51 +533,51 @@ impl WeightInfo for SubstrateWeight { } // Storage: Skipped Metadata (r:0 w:0) fn seal_clear_storage_per_kb(n: u32, ) -> Weight { - (601_558_000 as Weight) - // Standard Error: 280_000 - .saturating_add((11_378_000 as Weight).saturating_mul(n as Weight)) + (616_463_000 as Weight) + // Standard Error: 260_000 + .saturating_add((10_373_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(105 as Weight)) .saturating_add(T::DbWeight::get().writes(103 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_get_storage(r: u32, ) -> Weight { - (112_328_000 as Weight) - // Standard Error: 668_000 - .saturating_add((323_031_000 as Weight).saturating_mul(r as Weight)) + (116_340_000 as Weight) + // Standard Error: 633_000 + .saturating_add((322_054_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_get_storage_per_kb(n: u32, ) -> Weight { - (556_303_000 as Weight) - // Standard Error: 346_000 - .saturating_add((64_170_000 as Weight).saturating_mul(n as Weight)) + (563_077_000 as Weight) + // Standard Error: 340_000 + .saturating_add((63_889_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(104 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_contains_storage(r: u32, ) -> Weight { - (106_572_000 as Weight) - // Standard Error: 691_000 - .saturating_add((294_964_000 as Weight).saturating_mul(r as Weight)) + (118_832_000 as Weight) + // Standard Error: 595_000 + .saturating_add((291_817_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_contains_storage_per_kb(n: u32, ) -> Weight { - (508_339_000 as Weight) - // Standard Error: 245_000 - .saturating_add((10_675_000 as Weight).saturating_mul(n as Weight)) + (520_386_000 as Weight) + // Standard Error: 297_000 + .saturating_add((10_076_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(104 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_take_storage(r: u32, ) -> Weight { - (88_096_000 as Weight) - // Standard Error: 927_000 - .saturating_add((415_543_000 as Weight).saturating_mul(r as Weight)) + (85_377_000 as Weight) + // Standard Error: 847_000 + .saturating_add((419_438_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(3 as Weight)) @@ -574,9 +585,9 @@ impl WeightInfo for SubstrateWeight { } // Storage: Skipped Metadata (r:0 w:0) fn seal_take_storage_per_kb(n: u32, ) -> Weight { - (650_912_000 as Weight) - // Standard Error: 359_000 - .saturating_add((65_030_000 as Weight).saturating_mul(n as Weight)) + (666_218_000 as Weight) + // Standard Error: 294_000 + .saturating_add((64_627_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(105 as Weight)) .saturating_add(T::DbWeight::get().writes(103 as Weight)) } @@ -585,9 +596,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_transfer(r: u32, ) -> Weight { - (102_673_000 as Weight) - // Standard Error: 1_159_000 - .saturating_add((1_711_312_000 as Weight).saturating_mul(r as Weight)) + (108_224_000 as Weight) + // Standard Error: 1_042_000 + .saturating_add((1_723_539_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(2 as Weight)) @@ -599,8 +610,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Timestamp Now (r:1 w:0) fn seal_call(r: u32, ) -> Weight { (0 as Weight) - // Standard Error: 3_592_000 - .saturating_add((19_565_726_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 7_843_000 + .saturating_add((19_825_093_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -611,13 +622,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:2 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_call_per_transfer_input_output_kb(t: u32, i: u32, o: u32, ) -> Weight { - (19_665_171_000 as Weight) - // Standard Error: 27_641_000 - .saturating_add((2_089_637_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 9_000 - .saturating_add((20_165_000 as Weight).saturating_mul(i as Weight)) - // Standard Error: 10_000 - .saturating_add((31_728_000 as Weight).saturating_mul(o as Weight)) + (20_190_331_000 as Weight) + // Standard Error: 75_647_000 + .saturating_add((2_369_225_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 27_000 + .saturating_add((19_831_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 28_000 + .saturating_add((31_191_000 as Weight).saturating_mul(o as Weight)) .saturating_add(T::DbWeight::get().reads(105 as Weight)) .saturating_add(T::DbWeight::get().reads((101 as Weight).saturating_mul(t as Weight))) .saturating_add(T::DbWeight::get().writes(101 as Weight)) @@ -631,8 +642,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts OwnerInfoOf (r:100 w:100) fn seal_instantiate(r: u32, ) -> Weight { (0 as Weight) - // Standard Error: 48_640_000 - .saturating_add((27_307_450_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 50_368_000 + .saturating_add((27_757_564_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().reads((400 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(3 as Weight)) @@ -645,13 +656,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts AccountCounter (r:1 w:1) // Storage: Contracts OwnerInfoOf (r:1 w:1) fn seal_instantiate_per_input_output_salt_kb(i: u32, o: u32, s: u32, ) -> Weight { - (24_821_248_000 as Weight) - // Standard Error: 26_000 - .saturating_add((20_118_000 as Weight).saturating_mul(i as Weight)) - // Standard Error: 26_000 - .saturating_add((31_616_000 as Weight).saturating_mul(o as Weight)) - // Standard Error: 26_000 - .saturating_add((157_567_000 as Weight).saturating_mul(s as Weight)) + (25_199_228_000 as Weight) + // Standard Error: 36_000 + .saturating_add((19_598_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 36_000 + .saturating_add((30_986_000 as Weight).saturating_mul(o as Weight)) + // Standard Error: 36_000 + .saturating_add((158_016_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(208 as Weight)) .saturating_add(T::DbWeight::get().writes(206 as Weight)) } @@ -660,9 +671,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_sha2_256(r: u32, ) -> Weight { - (213_816_000 as Weight) - // Standard Error: 147_000 - .saturating_add((80_336_000 as Weight).saturating_mul(r as Weight)) + (222_984_000 as Weight) + // Standard Error: 155_000 + .saturating_add((80_649_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -671,9 +682,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_sha2_256_per_kb(n: u32, ) -> Weight { - (309_038_000 as Weight) - // Standard Error: 23_000 - .saturating_add((465_306_000 as Weight).saturating_mul(n as Weight)) + (393_726_000 as Weight) + // Standard Error: 36_000 + .saturating_add((463_983_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -682,9 +693,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_keccak_256(r: u32, ) -> Weight { - (212_825_000 as Weight) - // Standard Error: 143_000 - .saturating_add((91_947_000 as Weight).saturating_mul(r as Weight)) + (217_461_000 as Weight) + // Standard Error: 146_000 + .saturating_add((92_540_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -693,9 +704,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_keccak_256_per_kb(n: u32, ) -> Weight { - (329_548_000 as Weight) + (271_742_000 as Weight) // Standard Error: 19_000 - .saturating_add((306_729_000 as Weight).saturating_mul(n as Weight)) + .saturating_add((307_055_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -704,9 +715,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_blake2_256(r: u32, ) -> Weight { - (215_907_000 as Weight) - // Standard Error: 129_000 - .saturating_add((63_477_000 as Weight).saturating_mul(r as Weight)) + (220_664_000 as Weight) + // Standard Error: 145_000 + .saturating_add((64_516_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -715,9 +726,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_blake2_256_per_kb(n: u32, ) -> Weight { - (423_811_000 as Weight) - // Standard Error: 16_000 - .saturating_add((119_607_000 as Weight).saturating_mul(n as Weight)) + (287_500_000 as Weight) + // Standard Error: 12_000 + .saturating_add((119_931_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -726,9 +737,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_blake2_128(r: u32, ) -> Weight { - (214_747_000 as Weight) - // Standard Error: 115_000 - .saturating_add((62_904_000 as Weight).saturating_mul(r as Weight)) + (214_922_000 as Weight) + // Standard Error: 122_000 + .saturating_add((64_236_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -737,9 +748,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_blake2_128_per_kb(n: u32, ) -> Weight { - (437_217_000 as Weight) - // Standard Error: 19_000 - .saturating_add((120_126_000 as Weight).saturating_mul(n as Weight)) + (251_648_000 as Weight) + // Standard Error: 13_000 + .saturating_add((120_105_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -748,266 +759,266 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_ecdsa_recover(r: u32, ) -> Weight { - (195_980_000 as Weight) - // Standard Error: 1_262_000 - .saturating_add((15_428_805_000 as Weight).saturating_mul(r as Weight)) + (124_760_000 as Weight) + // Standard Error: 1_397_000 + .saturating_add((15_387_180_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn instr_i64const(r: u32, ) -> Weight { - (74_569_000 as Weight) - // Standard Error: 1_000 - .saturating_add((589_000 as Weight).saturating_mul(r as Weight)) + (75_287_000 as Weight) + // Standard Error: 11_000 + .saturating_add((569_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64load(r: u32, ) -> Weight { - (74_212_000 as Weight) - // Standard Error: 0 - .saturating_add((1_325_000 as Weight).saturating_mul(r as Weight)) + (74_251_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_306_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64store(r: u32, ) -> Weight { - (74_505_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_423_000 as Weight).saturating_mul(r as Weight)) + (75_072_000 as Weight) + // Standard Error: 4_000 + .saturating_add((1_386_000 as Weight).saturating_mul(r as Weight)) } fn instr_select(r: u32, ) -> Weight { - (74_005_000 as Weight) - // Standard Error: 3_000 - .saturating_add((1_785_000 as Weight).saturating_mul(r as Weight)) + (73_811_000 as Weight) + // Standard Error: 0 + .saturating_add((1_783_000 as Weight).saturating_mul(r as Weight)) } fn instr_if(r: u32, ) -> Weight { - (74_212_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_890_000 as Weight).saturating_mul(r as Weight)) + (73_901_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_886_000 as Weight).saturating_mul(r as Weight)) } fn instr_br(r: u32, ) -> Weight { - (74_102_000 as Weight) - // Standard Error: 2_000 - .saturating_add((896_000 as Weight).saturating_mul(r as Weight)) + (73_720_000 as Weight) + // Standard Error: 1_000 + .saturating_add((903_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_if(r: u32, ) -> Weight { - (73_523_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_456_000 as Weight).saturating_mul(r as Weight)) + (73_534_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_459_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_table(r: u32, ) -> Weight { - (73_307_000 as Weight) - // Standard Error: 4_000 - .saturating_add((1_594_000 as Weight).saturating_mul(r as Weight)) + (73_281_000 as Weight) + // Standard Error: 8_000 + .saturating_add((1_584_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_table_per_entry(e: u32, ) -> Weight { - (76_272_000 as Weight) - // Standard Error: 0 - .saturating_add((5_000 as Weight).saturating_mul(e as Weight)) + (76_135_000 as Weight) + // Standard Error: 1_000 + .saturating_add((6_000 as Weight).saturating_mul(e as Weight)) } fn instr_call(r: u32, ) -> Weight { - (73_390_000 as Weight) + (75_938_000 as Weight) // Standard Error: 23_000 - .saturating_add((16_936_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((17_156_000 as Weight).saturating_mul(r as Weight)) } fn instr_call_indirect(r: u32, ) -> Weight { - (89_331_000 as Weight) - // Standard Error: 30_000 - .saturating_add((28_104_000 as Weight).saturating_mul(r as Weight)) + (85_864_000 as Weight) + // Standard Error: 28_000 + .saturating_add((28_343_000 as Weight).saturating_mul(r as Weight)) } fn instr_call_indirect_per_param(p: u32, ) -> Weight { - (117_023_000 as Weight) - // Standard Error: 3_000 - .saturating_add((914_000 as Weight).saturating_mul(p as Weight)) + (119_795_000 as Weight) + // Standard Error: 1_000 + .saturating_add((911_000 as Weight).saturating_mul(p as Weight)) } fn instr_local_get(r: u32, ) -> Weight { - (74_727_000 as Weight) + (74_750_000 as Weight) // Standard Error: 1_000 - .saturating_add((618_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((613_000 as Weight).saturating_mul(r as Weight)) } fn instr_local_set(r: u32, ) -> Weight { - (74_893_000 as Weight) - // Standard Error: 1_000 - .saturating_add((674_000 as Weight).saturating_mul(r as Weight)) + (74_831_000 as Weight) + // Standard Error: 2_000 + .saturating_add((672_000 as Weight).saturating_mul(r as Weight)) } fn instr_local_tee(r: u32, ) -> Weight { - (74_552_000 as Weight) + (74_314_000 as Weight) // Standard Error: 1_000 - .saturating_add((898_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((902_000 as Weight).saturating_mul(r as Weight)) } fn instr_global_get(r: u32, ) -> Weight { - (77_355_000 as Weight) + (77_040_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_146_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_161_000 as Weight).saturating_mul(r as Weight)) } fn instr_global_set(r: u32, ) -> Weight { - (77_055_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_363_000 as Weight).saturating_mul(r as Weight)) + (76_770_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_372_000 as Weight).saturating_mul(r as Weight)) } fn instr_memory_current(r: u32, ) -> Weight { - (74_648_000 as Weight) - // Standard Error: 2_000 - .saturating_add((652_000 as Weight).saturating_mul(r as Weight)) + (74_010_000 as Weight) + // Standard Error: 1_000 + .saturating_add((665_000 as Weight).saturating_mul(r as Weight)) } fn instr_memory_grow(r: u32, ) -> Weight { - (73_777_000 as Weight) - // Standard Error: 226_000 - .saturating_add((187_252_000 as Weight).saturating_mul(r as Weight)) + (73_597_000 as Weight) + // Standard Error: 929_000 + .saturating_add((183_940_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64clz(r: u32, ) -> Weight { - (74_332_000 as Weight) - // Standard Error: 1_000 - .saturating_add((897_000 as Weight).saturating_mul(r as Weight)) + (74_488_000 as Weight) + // Standard Error: 4_000 + .saturating_add((893_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ctz(r: u32, ) -> Weight { - (74_265_000 as Weight) - // Standard Error: 1_000 - .saturating_add((898_000 as Weight).saturating_mul(r as Weight)) + (74_024_000 as Weight) + // Standard Error: 5_000 + .saturating_add((908_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64popcnt(r: u32, ) -> Weight { - (74_475_000 as Weight) - // Standard Error: 2_000 - .saturating_add((892_000 as Weight).saturating_mul(r as Weight)) + (74_084_000 as Weight) + // Standard Error: 1_000 + .saturating_add((895_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64eqz(r: u32, ) -> Weight { - (74_297_000 as Weight) - // Standard Error: 1_000 - .saturating_add((918_000 as Weight).saturating_mul(r as Weight)) + (74_250_000 as Weight) + // Standard Error: 2_000 + .saturating_add((916_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64extendsi32(r: u32, ) -> Weight { - (74_146_000 as Weight) + (74_027_000 as Weight) // Standard Error: 1_000 - .saturating_add((884_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((883_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64extendui32(r: u32, ) -> Weight { - (74_361_000 as Weight) + (74_201_000 as Weight) // Standard Error: 1_000 - .saturating_add((877_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((879_000 as Weight).saturating_mul(r as Weight)) } fn instr_i32wrapi64(r: u32, ) -> Weight { - (74_554_000 as Weight) + (74_116_000 as Weight) // Standard Error: 1_000 - .saturating_add((884_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((892_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64eq(r: u32, ) -> Weight { - (74_169_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) + (74_109_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_358_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ne(r: u32, ) -> Weight { - (74_164_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) + (73_962_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_363_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64lts(r: u32, ) -> Weight { - (74_058_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) + (73_977_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_360_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ltu(r: u32, ) -> Weight { - (74_039_000 as Weight) + (74_046_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_360_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64gts(r: u32, ) -> Weight { - (75_055_000 as Weight) - // Standard Error: 4_000 - .saturating_add((1_338_000 as Weight).saturating_mul(r as Weight)) + (73_912_000 as Weight) + // Standard Error: 0 + .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64gtu(r: u32, ) -> Weight { - (74_536_000 as Weight) - // Standard Error: 4_000 + (73_918_000 as Weight) + // Standard Error: 2_000 .saturating_add((1_367_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64les(r: u32, ) -> Weight { - (74_177_000 as Weight) + (73_953_000 as Weight) // Standard Error: 2_000 - .saturating_add((1_358_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_363_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64leu(r: u32, ) -> Weight { - (74_080_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_370_000 as Weight).saturating_mul(r as Weight)) + (74_855_000 as Weight) + // Standard Error: 4_000 + .saturating_add((1_347_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ges(r: u32, ) -> Weight { - (74_237_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_356_000 as Weight).saturating_mul(r as Weight)) + (73_917_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_364_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64geu(r: u32, ) -> Weight { - (74_049_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) + (73_949_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_361_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64add(r: u32, ) -> Weight { - (74_186_000 as Weight) + (73_726_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_335_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_347_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64sub(r: u32, ) -> Weight { - (74_268_000 as Weight) + (73_921_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_339_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_345_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64mul(r: u32, ) -> Weight { - (74_334_000 as Weight) + (73_924_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_331_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_341_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64divs(r: u32, ) -> Weight { - (74_285_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_997_000 as Weight).saturating_mul(r as Weight)) + (73_842_000 as Weight) + // Standard Error: 2_000 + .saturating_add((2_011_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64divu(r: u32, ) -> Weight { - (74_002_000 as Weight) + (73_932_000 as Weight) // Standard Error: 1_000 - .saturating_add((2_027_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((2_057_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rems(r: u32, ) -> Weight { - (74_281_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_977_000 as Weight).saturating_mul(r as Weight)) + (74_028_000 as Weight) + // Standard Error: 2_000 + .saturating_add((2_001_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64remu(r: u32, ) -> Weight { - (74_160_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_038_000 as Weight).saturating_mul(r as Weight)) + (73_784_000 as Weight) + // Standard Error: 2_000 + .saturating_add((2_059_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64and(r: u32, ) -> Weight { - (74_097_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_339_000 as Weight).saturating_mul(r as Weight)) + (74_169_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_334_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64or(r: u32, ) -> Weight { - (74_020_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_341_000 as Weight).saturating_mul(r as Weight)) + (73_982_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_340_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64xor(r: u32, ) -> Weight { - (73_890_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_351_000 as Weight).saturating_mul(r as Weight)) + (74_310_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_329_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shl(r: u32, ) -> Weight { - (74_139_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_355_000 as Weight).saturating_mul(r as Weight)) + (73_861_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shrs(r: u32, ) -> Weight { - (74_189_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_352_000 as Weight).saturating_mul(r as Weight)) + (73_787_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_364_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shru(r: u32, ) -> Weight { - (74_055_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_359_000 as Weight).saturating_mul(r as Weight)) + (73_886_000 as Weight) + // Standard Error: 7_000 + .saturating_add((1_372_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rotl(r: u32, ) -> Weight { - (74_074_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) + (73_860_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rotr(r: u32, ) -> Weight { - (74_005_000 as Weight) + (73_917_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_356_000 as Weight).saturating_mul(r as Weight)) } } @@ -1015,14 +1026,14 @@ impl WeightInfo for SubstrateWeight { impl WeightInfo for () { // Storage: Contracts DeletionQueue (r:1 w:0) fn on_initialize() -> Weight { - (1_642_000 as Weight) + (1_640_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn on_initialize_per_trie_key(k: u32, ) -> Weight { - (7_854_000 as Weight) + (6_385_000 as Weight) // Standard Error: 0 - .saturating_add((742_000 as Weight).saturating_mul(k as Weight)) + .saturating_add((748_000 as Weight).saturating_mul(k as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) @@ -1030,17 +1041,17 @@ impl WeightInfo for () { // Storage: Contracts DeletionQueue (r:1 w:0) fn on_initialize_per_queue_item(q: u32, ) -> Weight { (0 as Weight) - // Standard Error: 6_000 - .saturating_add((2_216_000 as Weight).saturating_mul(q as Weight)) + // Standard Error: 5_000 + .saturating_add((2_304_000 as Weight).saturating_mul(q as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Contracts PristineCode (r:1 w:0) // Storage: Contracts CodeStorage (r:0 w:1) fn reinstrument(c: u32, ) -> Weight { - (17_413_000 as Weight) - // Standard Error: 39_000 - .saturating_add((64_495_000 as Weight).saturating_mul(c as Weight)) + (22_923_000 as Weight) + // Standard Error: 33_000 + .saturating_add((65_851_000 as Weight).saturating_mul(c as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1049,9 +1060,9 @@ impl WeightInfo for () { // Storage: Timestamp Now (r:1 w:0) // Storage: System Account (r:1 w:1) fn call_with_code_kb(c: u32, ) -> Weight { - (209_071_000 as Weight) - // Standard Error: 47_000 - .saturating_add((56_555_000 as Weight).saturating_mul(c as Weight)) + (209_577_000 as Weight) + // Standard Error: 53_000 + .saturating_add((61_341_000 as Weight).saturating_mul(c as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -1063,11 +1074,11 @@ impl WeightInfo for () { // Storage: Contracts PristineCode (r:0 w:1) // Storage: Contracts OwnerInfoOf (r:0 w:1) fn instantiate_with_code(c: u32, s: u32, ) -> Weight { - (210_420_000 as Weight) - // Standard Error: 133_000 - .saturating_add((145_601_000 as Weight).saturating_mul(c as Weight)) - // Standard Error: 8_000 - .saturating_add((1_760_000 as Weight).saturating_mul(s as Weight)) + (240_302_000 as Weight) + // Standard Error: 119_000 + .saturating_add((151_894_000 as Weight).saturating_mul(c as Weight)) + // Standard Error: 7_000 + .saturating_add((1_740_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } @@ -1078,9 +1089,9 @@ impl WeightInfo for () { // Storage: System Account (r:1 w:1) // Storage: Contracts OwnerInfoOf (r:1 w:1) fn instantiate(s: u32, ) -> Weight { - (173_397_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_714_000 as Weight).saturating_mul(s as Weight)) + (172_047_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_729_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -1089,7 +1100,7 @@ impl WeightInfo for () { // Storage: Timestamp Now (r:1 w:0) // Storage: System Account (r:1 w:1) fn call() -> Weight { - (140_169_000 as Weight) + (139_349_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -1097,9 +1108,9 @@ impl WeightInfo for () { // Storage: Contracts PristineCode (r:0 w:1) // Storage: Contracts OwnerInfoOf (r:0 w:1) fn upload_code(c: u32, ) -> Weight { - (49_076_000 as Weight) - // Standard Error: 37_000 - .saturating_add((67_150_000 as Weight).saturating_mul(c as Weight)) + (50_449_000 as Weight) + // Standard Error: 45_000 + .saturating_add((68_254_000 as Weight).saturating_mul(c as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -1107,7 +1118,7 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:0 w:1) // Storage: Contracts PristineCode (r:0 w:1) fn remove_code() -> Weight { - (24_318_000 as Weight) + (24_576_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -1116,30 +1127,43 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_caller(r: u32, ) -> Weight { - (208_256_000 as Weight) - // Standard Error: 116_000 - .saturating_add((49_878_000 as Weight).saturating_mul(r as Weight)) + (220_059_000 as Weight) + // Standard Error: 128_000 + .saturating_add((49_607_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } - // Storage: Contracts ContractInfoOf (r:1 w:0) + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) fn seal_is_contract(r: u32, ) -> Weight { - (168_803_000 as Weight) // TBD: replace with measured value - .saturating_add((56_278_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + (84_138_000 as Weight) + // Standard Error: 896_000 + .saturating_add((375_553_000 as Weight).saturating_mul(r as Weight)) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) fn seal_caller_is_origin(r: u32, ) -> Weight { - (36_501_000 as Weight) // TBD: replace with measured value - .saturating_add((2_490_000 as Weight).saturating_mul(r as Weight)) + (222_496_000 as Weight) + // Standard Error: 119_000 + .saturating_add((22_340_000 as Weight).saturating_mul(r as Weight)) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:0) // Storage: Contracts ContractInfoOf (r:1 w:1) // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_address(r: u32, ) -> Weight { - (230_530_000 as Weight) - // Standard Error: 132_000 - .saturating_add((47_902_000 as Weight).saturating_mul(r as Weight)) + (221_446_000 as Weight) + // Standard Error: 131_000 + .saturating_add((49_401_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1148,9 +1172,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_gas_left(r: u32, ) -> Weight { - (219_027_000 as Weight) - // Standard Error: 108_000 - .saturating_add((48_039_000 as Weight).saturating_mul(r as Weight)) + (220_964_000 as Weight) + // Standard Error: 132_000 + .saturating_add((49_230_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1159,9 +1183,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_balance(r: u32, ) -> Weight { - (219_036_000 as Weight) - // Standard Error: 152_000 - .saturating_add((137_047_000 as Weight).saturating_mul(r as Weight)) + (229_399_000 as Weight) + // Standard Error: 166_000 + .saturating_add((137_407_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1170,9 +1194,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_value_transferred(r: u32, ) -> Weight { - (214_401_000 as Weight) - // Standard Error: 96_000 - .saturating_add((48_435_000 as Weight).saturating_mul(r as Weight)) + (220_103_000 as Weight) + // Standard Error: 133_000 + .saturating_add((49_410_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1181,9 +1205,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_minimum_balance(r: u32, ) -> Weight { - (216_939_000 as Weight) - // Standard Error: 106_000 - .saturating_add((48_198_000 as Weight).saturating_mul(r as Weight)) + (228_143_000 as Weight) + // Standard Error: 151_000 + .saturating_add((48_608_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1192,9 +1216,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_block_number(r: u32, ) -> Weight { - (216_637_000 as Weight) - // Standard Error: 86_000 - .saturating_add((47_819_000 as Weight).saturating_mul(r as Weight)) + (223_899_000 as Weight) + // Standard Error: 142_000 + .saturating_add((48_841_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1203,9 +1227,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_now(r: u32, ) -> Weight { - (214_863_000 as Weight) - // Standard Error: 110_000 - .saturating_add((48_208_000 as Weight).saturating_mul(r as Weight)) + (224_974_000 as Weight) + // Standard Error: 148_000 + .saturating_add((48_902_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1215,9 +1239,9 @@ impl WeightInfo for () { // Storage: Timestamp Now (r:1 w:0) // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0) fn seal_weight_to_fee(r: u32, ) -> Weight { - (216_494_000 as Weight) - // Standard Error: 141_000 - .saturating_add((120_736_000 as Weight).saturating_mul(r as Weight)) + (227_556_000 as Weight) + // Standard Error: 151_000 + .saturating_add((121_252_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1226,9 +1250,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_gas(r: u32, ) -> Weight { - (123_867_000 as Weight) - // Standard Error: 33_000 - .saturating_add((24_578_000 as Weight).saturating_mul(r as Weight)) + (127_975_000 as Weight) + // Standard Error: 57_000 + .saturating_add((24_843_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1237,9 +1261,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_input(r: u32, ) -> Weight { - (215_578_000 as Weight) - // Standard Error: 108_000 - .saturating_add((47_512_000 as Weight).saturating_mul(r as Weight)) + (224_592_000 as Weight) + // Standard Error: 141_000 + .saturating_add((48_296_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1248,9 +1272,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_input_per_kb(n: u32, ) -> Weight { - (297_663_000 as Weight) + (296_995_000 as Weight) // Standard Error: 3_000 - .saturating_add((11_863_000 as Weight).saturating_mul(n as Weight)) + .saturating_add((11_884_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1258,10 +1282,8 @@ impl WeightInfo for () { // Storage: Contracts ContractInfoOf (r:1 w:1) // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) - fn seal_return(r: u32, ) -> Weight { - (209_709_000 as Weight) - // Standard Error: 75_000 - .saturating_add((1_783_000 as Weight).saturating_mul(r as Weight)) + fn seal_return(_r: u32, ) -> Weight { + (224_322_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1270,9 +1292,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_return_per_kb(n: u32, ) -> Weight { - (214_403_000 as Weight) - // Standard Error: 0 - .saturating_add((197_000 as Weight).saturating_mul(n as Weight)) + (216_240_000 as Weight) + // Standard Error: 1_000 + .saturating_add((206_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1283,9 +1305,9 @@ impl WeightInfo for () { // Storage: Contracts DeletionQueue (r:1 w:1) // Storage: Contracts OwnerInfoOf (r:1 w:1) fn seal_terminate(r: u32, ) -> Weight { - (214_454_000 as Weight) - // Standard Error: 656_000 - .saturating_add((50_641_000 as Weight).saturating_mul(r as Weight)) + (219_637_000 as Weight) + // Standard Error: 3_916_000 + .saturating_add((51_769_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -1297,9 +1319,9 @@ impl WeightInfo for () { // Storage: Timestamp Now (r:1 w:0) // Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) fn seal_random(r: u32, ) -> Weight { - (214_140_000 as Weight) - // Standard Error: 169_000 - .saturating_add((158_778_000 as Weight).saturating_mul(r as Weight)) + (221_470_000 as Weight) + // Standard Error: 154_000 + .saturating_add((158_758_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1308,9 +1330,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_deposit_event(r: u32, ) -> Weight { - (225_998_000 as Weight) - // Standard Error: 171_000 - .saturating_add((280_296_000 as Weight).saturating_mul(r as Weight)) + (228_674_000 as Weight) + // Standard Error: 203_000 + .saturating_add((287_195_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1320,11 +1342,11 @@ impl WeightInfo for () { // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:100 w:100) fn seal_deposit_event_per_topic_and_kb(t: u32, n: u32, ) -> Weight { - (491_432_000 as Weight) - // Standard Error: 1_992_000 - .saturating_add((288_376_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 392_000 - .saturating_add((82_805_000 as Weight).saturating_mul(n as Weight)) + (507_091_000 as Weight) + // Standard Error: 1_863_000 + .saturating_add((291_858_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 367_000 + .saturating_add((83_459_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(t as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -1335,17 +1357,17 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_debug_message(r: u32, ) -> Weight { - (130_861_000 as Weight) - // Standard Error: 74_000 - .saturating_add((40_268_000 as Weight).saturating_mul(r as Weight)) + (133_592_000 as Weight) + // Standard Error: 87_000 + .saturating_add((41_718_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_set_storage(r: u32, ) -> Weight { - (38_843_000 as Weight) - // Standard Error: 1_044_000 - .saturating_add((408_027_000 as Weight).saturating_mul(r as Weight)) + (44_719_000 as Weight) + // Standard Error: 1_036_000 + .saturating_add((407_521_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -1353,25 +1375,25 @@ impl WeightInfo for () { } // Storage: Skipped Metadata (r:0 w:0) fn seal_set_storage_per_new_kb(n: u32, ) -> Weight { - (610_782_000 as Weight) - // Standard Error: 265_000 - .saturating_add((28_221_000 as Weight).saturating_mul(n as Weight)) + (606_108_000 as Weight) + // Standard Error: 315_000 + .saturating_add((29_136_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(105 as Weight)) .saturating_add(RocksDbWeight::get().writes(103 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_set_storage_per_old_kb(n: u32, ) -> Weight { - (625_031_000 as Weight) - // Standard Error: 319_000 - .saturating_add((11_126_000 as Weight).saturating_mul(n as Weight)) + (634_330_000 as Weight) + // Standard Error: 281_000 + .saturating_add((10_741_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(105 as Weight)) .saturating_add(RocksDbWeight::get().writes(103 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_clear_storage(r: u32, ) -> Weight { - (78_566_000 as Weight) - // Standard Error: 970_000 - .saturating_add((384_877_000 as Weight).saturating_mul(r as Weight)) + (89_750_000 as Weight) + // Standard Error: 924_000 + .saturating_add((382_525_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) @@ -1379,51 +1401,51 @@ impl WeightInfo for () { } // Storage: Skipped Metadata (r:0 w:0) fn seal_clear_storage_per_kb(n: u32, ) -> Weight { - (601_558_000 as Weight) - // Standard Error: 280_000 - .saturating_add((11_378_000 as Weight).saturating_mul(n as Weight)) + (616_463_000 as Weight) + // Standard Error: 260_000 + .saturating_add((10_373_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(105 as Weight)) .saturating_add(RocksDbWeight::get().writes(103 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_get_storage(r: u32, ) -> Weight { - (112_328_000 as Weight) - // Standard Error: 668_000 - .saturating_add((323_031_000 as Weight).saturating_mul(r as Weight)) + (116_340_000 as Weight) + // Standard Error: 633_000 + .saturating_add((322_054_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_get_storage_per_kb(n: u32, ) -> Weight { - (556_303_000 as Weight) - // Standard Error: 346_000 - .saturating_add((64_170_000 as Weight).saturating_mul(n as Weight)) + (563_077_000 as Weight) + // Standard Error: 340_000 + .saturating_add((63_889_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(104 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_contains_storage(r: u32, ) -> Weight { - (106_572_000 as Weight) - // Standard Error: 691_000 - .saturating_add((294_964_000 as Weight).saturating_mul(r as Weight)) + (118_832_000 as Weight) + // Standard Error: 595_000 + .saturating_add((291_817_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_contains_storage_per_kb(n: u32, ) -> Weight { - (508_339_000 as Weight) - // Standard Error: 245_000 - .saturating_add((10_675_000 as Weight).saturating_mul(n as Weight)) + (520_386_000 as Weight) + // Standard Error: 297_000 + .saturating_add((10_076_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(104 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_take_storage(r: u32, ) -> Weight { - (88_096_000 as Weight) - // Standard Error: 927_000 - .saturating_add((415_543_000 as Weight).saturating_mul(r as Weight)) + (85_377_000 as Weight) + // Standard Error: 847_000 + .saturating_add((419_438_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) @@ -1431,9 +1453,9 @@ impl WeightInfo for () { } // Storage: Skipped Metadata (r:0 w:0) fn seal_take_storage_per_kb(n: u32, ) -> Weight { - (650_912_000 as Weight) - // Standard Error: 359_000 - .saturating_add((65_030_000 as Weight).saturating_mul(n as Weight)) + (666_218_000 as Weight) + // Standard Error: 294_000 + .saturating_add((64_627_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(105 as Weight)) .saturating_add(RocksDbWeight::get().writes(103 as Weight)) } @@ -1442,9 +1464,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_transfer(r: u32, ) -> Weight { - (102_673_000 as Weight) - // Standard Error: 1_159_000 - .saturating_add((1_711_312_000 as Weight).saturating_mul(r as Weight)) + (108_224_000 as Weight) + // Standard Error: 1_042_000 + .saturating_add((1_723_539_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) @@ -1456,8 +1478,8 @@ impl WeightInfo for () { // Storage: Timestamp Now (r:1 w:0) fn seal_call(r: u32, ) -> Weight { (0 as Weight) - // Standard Error: 3_592_000 - .saturating_add((19_565_726_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 7_843_000 + .saturating_add((19_825_093_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().reads((100 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -1468,13 +1490,13 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:2 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_call_per_transfer_input_output_kb(t: u32, i: u32, o: u32, ) -> Weight { - (19_665_171_000 as Weight) - // Standard Error: 27_641_000 - .saturating_add((2_089_637_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 9_000 - .saturating_add((20_165_000 as Weight).saturating_mul(i as Weight)) - // Standard Error: 10_000 - .saturating_add((31_728_000 as Weight).saturating_mul(o as Weight)) + (20_190_331_000 as Weight) + // Standard Error: 75_647_000 + .saturating_add((2_369_225_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 27_000 + .saturating_add((19_831_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 28_000 + .saturating_add((31_191_000 as Weight).saturating_mul(o as Weight)) .saturating_add(RocksDbWeight::get().reads(105 as Weight)) .saturating_add(RocksDbWeight::get().reads((101 as Weight).saturating_mul(t as Weight))) .saturating_add(RocksDbWeight::get().writes(101 as Weight)) @@ -1488,8 +1510,8 @@ impl WeightInfo for () { // Storage: Contracts OwnerInfoOf (r:100 w:100) fn seal_instantiate(r: u32, ) -> Weight { (0 as Weight) - // Standard Error: 48_640_000 - .saturating_add((27_307_450_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 50_368_000 + .saturating_add((27_757_564_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().reads((400 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) @@ -1502,13 +1524,13 @@ impl WeightInfo for () { // Storage: Contracts AccountCounter (r:1 w:1) // Storage: Contracts OwnerInfoOf (r:1 w:1) fn seal_instantiate_per_input_output_salt_kb(i: u32, o: u32, s: u32, ) -> Weight { - (24_821_248_000 as Weight) - // Standard Error: 26_000 - .saturating_add((20_118_000 as Weight).saturating_mul(i as Weight)) - // Standard Error: 26_000 - .saturating_add((31_616_000 as Weight).saturating_mul(o as Weight)) - // Standard Error: 26_000 - .saturating_add((157_567_000 as Weight).saturating_mul(s as Weight)) + (25_199_228_000 as Weight) + // Standard Error: 36_000 + .saturating_add((19_598_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 36_000 + .saturating_add((30_986_000 as Weight).saturating_mul(o as Weight)) + // Standard Error: 36_000 + .saturating_add((158_016_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(208 as Weight)) .saturating_add(RocksDbWeight::get().writes(206 as Weight)) } @@ -1517,9 +1539,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_sha2_256(r: u32, ) -> Weight { - (213_816_000 as Weight) - // Standard Error: 147_000 - .saturating_add((80_336_000 as Weight).saturating_mul(r as Weight)) + (222_984_000 as Weight) + // Standard Error: 155_000 + .saturating_add((80_649_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1528,9 +1550,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_sha2_256_per_kb(n: u32, ) -> Weight { - (309_038_000 as Weight) - // Standard Error: 23_000 - .saturating_add((465_306_000 as Weight).saturating_mul(n as Weight)) + (393_726_000 as Weight) + // Standard Error: 36_000 + .saturating_add((463_983_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1539,9 +1561,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_keccak_256(r: u32, ) -> Weight { - (212_825_000 as Weight) - // Standard Error: 143_000 - .saturating_add((91_947_000 as Weight).saturating_mul(r as Weight)) + (217_461_000 as Weight) + // Standard Error: 146_000 + .saturating_add((92_540_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1550,9 +1572,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_keccak_256_per_kb(n: u32, ) -> Weight { - (329_548_000 as Weight) + (271_742_000 as Weight) // Standard Error: 19_000 - .saturating_add((306_729_000 as Weight).saturating_mul(n as Weight)) + .saturating_add((307_055_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1561,9 +1583,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_blake2_256(r: u32, ) -> Weight { - (215_907_000 as Weight) - // Standard Error: 129_000 - .saturating_add((63_477_000 as Weight).saturating_mul(r as Weight)) + (220_664_000 as Weight) + // Standard Error: 145_000 + .saturating_add((64_516_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1572,9 +1594,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_blake2_256_per_kb(n: u32, ) -> Weight { - (423_811_000 as Weight) - // Standard Error: 16_000 - .saturating_add((119_607_000 as Weight).saturating_mul(n as Weight)) + (287_500_000 as Weight) + // Standard Error: 12_000 + .saturating_add((119_931_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1583,9 +1605,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_blake2_128(r: u32, ) -> Weight { - (214_747_000 as Weight) - // Standard Error: 115_000 - .saturating_add((62_904_000 as Weight).saturating_mul(r as Weight)) + (214_922_000 as Weight) + // Standard Error: 122_000 + .saturating_add((64_236_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1594,9 +1616,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_hash_blake2_128_per_kb(n: u32, ) -> Weight { - (437_217_000 as Weight) - // Standard Error: 19_000 - .saturating_add((120_126_000 as Weight).saturating_mul(n as Weight)) + (251_648_000 as Weight) + // Standard Error: 13_000 + .saturating_add((120_105_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1605,265 +1627,265 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_ecdsa_recover(r: u32, ) -> Weight { - (195_980_000 as Weight) - // Standard Error: 1_262_000 - .saturating_add((15_428_805_000 as Weight).saturating_mul(r as Weight)) + (124_760_000 as Weight) + // Standard Error: 1_397_000 + .saturating_add((15_387_180_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn instr_i64const(r: u32, ) -> Weight { - (74_569_000 as Weight) - // Standard Error: 1_000 - .saturating_add((589_000 as Weight).saturating_mul(r as Weight)) + (75_287_000 as Weight) + // Standard Error: 11_000 + .saturating_add((569_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64load(r: u32, ) -> Weight { - (74_212_000 as Weight) - // Standard Error: 0 - .saturating_add((1_325_000 as Weight).saturating_mul(r as Weight)) + (74_251_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_306_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64store(r: u32, ) -> Weight { - (74_505_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_423_000 as Weight).saturating_mul(r as Weight)) + (75_072_000 as Weight) + // Standard Error: 4_000 + .saturating_add((1_386_000 as Weight).saturating_mul(r as Weight)) } fn instr_select(r: u32, ) -> Weight { - (74_005_000 as Weight) - // Standard Error: 3_000 - .saturating_add((1_785_000 as Weight).saturating_mul(r as Weight)) + (73_811_000 as Weight) + // Standard Error: 0 + .saturating_add((1_783_000 as Weight).saturating_mul(r as Weight)) } fn instr_if(r: u32, ) -> Weight { - (74_212_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_890_000 as Weight).saturating_mul(r as Weight)) + (73_901_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_886_000 as Weight).saturating_mul(r as Weight)) } fn instr_br(r: u32, ) -> Weight { - (74_102_000 as Weight) - // Standard Error: 2_000 - .saturating_add((896_000 as Weight).saturating_mul(r as Weight)) + (73_720_000 as Weight) + // Standard Error: 1_000 + .saturating_add((903_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_if(r: u32, ) -> Weight { - (73_523_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_456_000 as Weight).saturating_mul(r as Weight)) + (73_534_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_459_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_table(r: u32, ) -> Weight { - (73_307_000 as Weight) - // Standard Error: 4_000 - .saturating_add((1_594_000 as Weight).saturating_mul(r as Weight)) + (73_281_000 as Weight) + // Standard Error: 8_000 + .saturating_add((1_584_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_table_per_entry(e: u32, ) -> Weight { - (76_272_000 as Weight) - // Standard Error: 0 - .saturating_add((5_000 as Weight).saturating_mul(e as Weight)) + (76_135_000 as Weight) + // Standard Error: 1_000 + .saturating_add((6_000 as Weight).saturating_mul(e as Weight)) } fn instr_call(r: u32, ) -> Weight { - (73_390_000 as Weight) + (75_938_000 as Weight) // Standard Error: 23_000 - .saturating_add((16_936_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((17_156_000 as Weight).saturating_mul(r as Weight)) } fn instr_call_indirect(r: u32, ) -> Weight { - (89_331_000 as Weight) - // Standard Error: 30_000 - .saturating_add((28_104_000 as Weight).saturating_mul(r as Weight)) + (85_864_000 as Weight) + // Standard Error: 28_000 + .saturating_add((28_343_000 as Weight).saturating_mul(r as Weight)) } fn instr_call_indirect_per_param(p: u32, ) -> Weight { - (117_023_000 as Weight) - // Standard Error: 3_000 - .saturating_add((914_000 as Weight).saturating_mul(p as Weight)) + (119_795_000 as Weight) + // Standard Error: 1_000 + .saturating_add((911_000 as Weight).saturating_mul(p as Weight)) } fn instr_local_get(r: u32, ) -> Weight { - (74_727_000 as Weight) + (74_750_000 as Weight) // Standard Error: 1_000 - .saturating_add((618_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((613_000 as Weight).saturating_mul(r as Weight)) } fn instr_local_set(r: u32, ) -> Weight { - (74_893_000 as Weight) - // Standard Error: 1_000 - .saturating_add((674_000 as Weight).saturating_mul(r as Weight)) + (74_831_000 as Weight) + // Standard Error: 2_000 + .saturating_add((672_000 as Weight).saturating_mul(r as Weight)) } fn instr_local_tee(r: u32, ) -> Weight { - (74_552_000 as Weight) + (74_314_000 as Weight) // Standard Error: 1_000 - .saturating_add((898_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((902_000 as Weight).saturating_mul(r as Weight)) } fn instr_global_get(r: u32, ) -> Weight { - (77_355_000 as Weight) + (77_040_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_146_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_161_000 as Weight).saturating_mul(r as Weight)) } fn instr_global_set(r: u32, ) -> Weight { - (77_055_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_363_000 as Weight).saturating_mul(r as Weight)) + (76_770_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_372_000 as Weight).saturating_mul(r as Weight)) } fn instr_memory_current(r: u32, ) -> Weight { - (74_648_000 as Weight) - // Standard Error: 2_000 - .saturating_add((652_000 as Weight).saturating_mul(r as Weight)) + (74_010_000 as Weight) + // Standard Error: 1_000 + .saturating_add((665_000 as Weight).saturating_mul(r as Weight)) } fn instr_memory_grow(r: u32, ) -> Weight { - (73_777_000 as Weight) - // Standard Error: 226_000 - .saturating_add((187_252_000 as Weight).saturating_mul(r as Weight)) + (73_597_000 as Weight) + // Standard Error: 929_000 + .saturating_add((183_940_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64clz(r: u32, ) -> Weight { - (74_332_000 as Weight) - // Standard Error: 1_000 - .saturating_add((897_000 as Weight).saturating_mul(r as Weight)) + (74_488_000 as Weight) + // Standard Error: 4_000 + .saturating_add((893_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ctz(r: u32, ) -> Weight { - (74_265_000 as Weight) - // Standard Error: 1_000 - .saturating_add((898_000 as Weight).saturating_mul(r as Weight)) + (74_024_000 as Weight) + // Standard Error: 5_000 + .saturating_add((908_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64popcnt(r: u32, ) -> Weight { - (74_475_000 as Weight) - // Standard Error: 2_000 - .saturating_add((892_000 as Weight).saturating_mul(r as Weight)) + (74_084_000 as Weight) + // Standard Error: 1_000 + .saturating_add((895_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64eqz(r: u32, ) -> Weight { - (74_297_000 as Weight) - // Standard Error: 1_000 - .saturating_add((918_000 as Weight).saturating_mul(r as Weight)) + (74_250_000 as Weight) + // Standard Error: 2_000 + .saturating_add((916_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64extendsi32(r: u32, ) -> Weight { - (74_146_000 as Weight) + (74_027_000 as Weight) // Standard Error: 1_000 - .saturating_add((884_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((883_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64extendui32(r: u32, ) -> Weight { - (74_361_000 as Weight) + (74_201_000 as Weight) // Standard Error: 1_000 - .saturating_add((877_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((879_000 as Weight).saturating_mul(r as Weight)) } fn instr_i32wrapi64(r: u32, ) -> Weight { - (74_554_000 as Weight) + (74_116_000 as Weight) // Standard Error: 1_000 - .saturating_add((884_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((892_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64eq(r: u32, ) -> Weight { - (74_169_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) + (74_109_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_358_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ne(r: u32, ) -> Weight { - (74_164_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) + (73_962_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_363_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64lts(r: u32, ) -> Weight { - (74_058_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) + (73_977_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_360_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ltu(r: u32, ) -> Weight { - (74_039_000 as Weight) + (74_046_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_360_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64gts(r: u32, ) -> Weight { - (75_055_000 as Weight) - // Standard Error: 4_000 - .saturating_add((1_338_000 as Weight).saturating_mul(r as Weight)) + (73_912_000 as Weight) + // Standard Error: 0 + .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64gtu(r: u32, ) -> Weight { - (74_536_000 as Weight) - // Standard Error: 4_000 + (73_918_000 as Weight) + // Standard Error: 2_000 .saturating_add((1_367_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64les(r: u32, ) -> Weight { - (74_177_000 as Weight) + (73_953_000 as Weight) // Standard Error: 2_000 - .saturating_add((1_358_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_363_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64leu(r: u32, ) -> Weight { - (74_080_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_370_000 as Weight).saturating_mul(r as Weight)) + (74_855_000 as Weight) + // Standard Error: 4_000 + .saturating_add((1_347_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ges(r: u32, ) -> Weight { - (74_237_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_356_000 as Weight).saturating_mul(r as Weight)) + (73_917_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_364_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64geu(r: u32, ) -> Weight { - (74_049_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) + (73_949_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_361_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64add(r: u32, ) -> Weight { - (74_186_000 as Weight) + (73_726_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_335_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_347_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64sub(r: u32, ) -> Weight { - (74_268_000 as Weight) + (73_921_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_339_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_345_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64mul(r: u32, ) -> Weight { - (74_334_000 as Weight) + (73_924_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_331_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_341_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64divs(r: u32, ) -> Weight { - (74_285_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_997_000 as Weight).saturating_mul(r as Weight)) + (73_842_000 as Weight) + // Standard Error: 2_000 + .saturating_add((2_011_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64divu(r: u32, ) -> Weight { - (74_002_000 as Weight) + (73_932_000 as Weight) // Standard Error: 1_000 - .saturating_add((2_027_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((2_057_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rems(r: u32, ) -> Weight { - (74_281_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_977_000 as Weight).saturating_mul(r as Weight)) + (74_028_000 as Weight) + // Standard Error: 2_000 + .saturating_add((2_001_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64remu(r: u32, ) -> Weight { - (74_160_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_038_000 as Weight).saturating_mul(r as Weight)) + (73_784_000 as Weight) + // Standard Error: 2_000 + .saturating_add((2_059_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64and(r: u32, ) -> Weight { - (74_097_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_339_000 as Weight).saturating_mul(r as Weight)) + (74_169_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_334_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64or(r: u32, ) -> Weight { - (74_020_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_341_000 as Weight).saturating_mul(r as Weight)) + (73_982_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_340_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64xor(r: u32, ) -> Weight { - (73_890_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_351_000 as Weight).saturating_mul(r as Weight)) + (74_310_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_329_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shl(r: u32, ) -> Weight { - (74_139_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_355_000 as Weight).saturating_mul(r as Weight)) + (73_861_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shrs(r: u32, ) -> Weight { - (74_189_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_352_000 as Weight).saturating_mul(r as Weight)) + (73_787_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_364_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shru(r: u32, ) -> Weight { - (74_055_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_359_000 as Weight).saturating_mul(r as Weight)) + (73_886_000 as Weight) + // Standard Error: 7_000 + .saturating_add((1_372_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rotl(r: u32, ) -> Weight { - (74_074_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) + (73_860_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rotr(r: u32, ) -> Weight { - (74_005_000 as Weight) + (73_917_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_356_000 as Weight).saturating_mul(r as Weight)) } }