From 41a683bb1624f9b8ad76ca50063feebf45dbaf65 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 24 Feb 2022 19:22:33 +0300 Subject: [PATCH 01/21] `seal_origin` + tests added --- frame/contracts/src/exec.rs | 32 ++++++++++++++++ frame/contracts/src/schedule.rs | 4 ++ frame/contracts/src/wasm/mod.rs | 59 +++++++++++++++++++++++++++-- frame/contracts/src/wasm/runtime.rs | 18 +++++++++ frame/contracts/src/weights.rs | 23 +++++++++++ 5 files changed, 132 insertions(+), 4 deletions(-) diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index eb7a68d81ad50..5a7796cabfe9b 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -168,6 +168,9 @@ pub trait Ext: sealing::Sealed { /// However, this function does not require any storage lookup and therefore uses less weight. fn caller_is_origin(&self) -> bool; + /// Return address of the origin of current call stack + fn origin(&self) -> &AccountIdOf; + /// Returns a reference to the account id of the current contract. fn address(&self) -> &AccountIdOf; @@ -1106,6 +1109,10 @@ where self.caller() == &self.origin } + fn origin(&self) -> &AccountIdOf { + &self.origin + } + fn balance(&self) -> BalanceOf { T::Currency::free_balance(&self.top_frame().account_id) } @@ -1787,6 +1794,31 @@ mod tests { }); } + #[test] + fn origin_returns_proper_values() { + let code_bob = MockLoader::insert(Call, |ctx, _| { + assert_eq!(ctx.ext.origin(), &ALICE); + exec_success() + }); + ExtBuilder::default().build().execute_with(|| { + let schedule = ::Schedule::get(); + place_contract(&BOB, code_bob); + let mut storage_meter = storage::meter::Meter::new(&ALICE, Some(0), 0).unwrap(); + // ALICE -> BOB: (origin is ALICE) + let result = MockStack::run_call( + ALICE, + BOB, + &mut GasMeter::::new(GAS_LIMIT), + &mut storage_meter, + &schedule, + 0, + vec![0], + None, + ); + assert_matches!(result, Ok(_)); + }); + } + #[test] fn address_returns_proper_values() { let bob_ch = MockLoader::insert(Call, |ctx, _| { diff --git a/frame/contracts/src/schedule.rs b/frame/contracts/src/schedule.rs index 8535166a6ac5c..ebb81cbe96c7c 100644 --- a/frame/contracts/src/schedule.rs +++ b/frame/contracts/src/schedule.rs @@ -268,6 +268,9 @@ pub struct HostFnWeights { /// Weight of calling `seal_caller_is_origin`. pub caller_is_origin: Weight, + /// Weight of calling `seal_origin`. + pub origin: Weight, + /// Weight of calling `seal_address`. pub address: Weight, @@ -585,6 +588,7 @@ impl Default for HostFnWeights { caller: cost_batched!(seal_caller), is_contract: cost_batched!(seal_is_contract), caller_is_origin: cost_batched!(seal_caller_is_origin), + origin: cost_batched!(seal_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/mod.rs b/frame/contracts/src/wasm/mod.rs index 2dbaad0d79324..99fb765072c07 100644 --- a/frame/contracts/src/wasm/mod.rs +++ b/frame/contracts/src/wasm/mod.rs @@ -441,6 +441,9 @@ mod tests { fn caller_is_origin(&self) -> bool { false } + fn origin(&self) -> &AccountIdOf { + &ALICE + } fn address(&self) -> &AccountIdOf { &BOB } @@ -1155,7 +1158,7 @@ mod tests { ); } - /// calls `seal_caller` and compares the result with the constant 42. + /// calls `seal_caller` and compares the result with the constant (ALICE's address part). const CODE_CALLER: &str = r#" (module (import "seal0" "seal_caller" (func $seal_caller (param i32 i32))) @@ -1185,7 +1188,7 @@ mod tests { ) ) - ;; assert that the first 64 byte are the beginning of "ALICE" + ;; assert that the first 8 bytes are the beginning of "ALICE" (call $assert (i64.eq (i64.load (i32.const 0)) @@ -1203,7 +1206,7 @@ mod tests { assert_ok!(execute(CODE_CALLER, vec![], MockExt::default())); } - /// calls `seal_address` and compares the result with the constant 69. + /// calls `seal_address` and compares the result with the constant (BOB's address part). const CODE_ADDRESS: &str = r#" (module (import "seal0" "seal_address" (func $seal_address (param i32 i32))) @@ -1233,7 +1236,7 @@ mod tests { ) ) - ;; assert that the first 64 byte are the beginning of "BOB" + ;; assert that the first 8 bytes are the beginning of "BOB" (call $assert (i64.eq (i64.load (i32.const 0)) @@ -2396,6 +2399,54 @@ mod tests { ); } + #[test] + #[cfg(feature = "unstable-interface")] + fn origin() { + /// calls `seal_origin` and compares the result with the constant (ALICE's address part). + const CODE_ORIGIN: &str = r#" +(module + (import "__unstable__" "seal_origin" (func $seal_origin (param i32 i32))) + (import "env" "memory" (memory 1 1)) + + ;; size of our buffer is 32 bytes + (data (i32.const 32) "\20") + + (func $assert (param i32) + (block $ok + (br_if $ok + (get_local 0) + ) + (unreachable) + ) + ) + + (func (export "call") + ;; fill the buffer with the origin address. + (call $seal_origin (i32.const 0) (i32.const 32)) + + ;; assert size == 32 + (call $assert + (i32.eq + (i32.load (i32.const 32)) + (i32.const 32) + ) + ) + + ;; assert that the first 8 bytes are the beginning of "ALICE" + (call $assert + (i64.eq + (i64.load (i32.const 0)) + (i64.const 0x0101010101010101) + ) + ) + ) + + (func (export "deploy")) +) +"#; + assert_ok!(execute(CODE_ORIGIN, vec![], MockExt::default())); + } + #[test] #[cfg(feature = "unstable-interface")] fn set_code_hash() { diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index bb188e10e8fa0..0b3e786dc0591 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -148,6 +148,9 @@ pub enum RuntimeCosts { /// Weight of calling `seal_caller_is_origin`. #[cfg(feature = "unstable-interface")] CallerIsOrigin, + /// Weight of calling `seal_origin`. + #[cfg(feature = "unstable-interface")] + Origin, /// Weight of calling `seal_address`. Address, /// Weight of calling `seal_gas_left`. @@ -240,6 +243,8 @@ impl RuntimeCosts { IsContract => s.is_contract, #[cfg(feature = "unstable-interface")] CallerIsOrigin => s.caller_is_origin, + #[cfg(feature = "unstable-interface")] + Origin => s.origin, Address => s.address, GasLeft => s.gas_left, Balance => s.balance, @@ -1395,6 +1400,19 @@ define_env!(Env, , Ok(ctx.ext.caller_is_origin() as u32) }, + // Stores the address of the origin of the whole call stack into the supplied buffer. + // + // The value is stored to linear memory at the address pointed to by `out_ptr`. + // `out_len_ptr` must point to a u32 value that describes the available space at + // `out_ptr`. This call overwrites it with the size of the value. If the available + // space at `out_ptr` is less than the size of the value a trap is triggered. + [__unstable__] seal_origin(ctx, out_ptr: u32, out_len_ptr: u32) => { + ctx.charge_gas(RuntimeCosts::Origin)?; + Ok(ctx.write_sandbox_output( + out_ptr, out_len_ptr, &ctx.ext.origin().encode(), false, already_charged + )?) + }, + // 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 7d73a3a1cecc7..0e47526c86643 100644 --- a/frame/contracts/src/weights.rs +++ b/frame/contracts/src/weights.rs @@ -57,6 +57,7 @@ pub trait WeightInfo { fn seal_caller(r: u32, ) -> Weight; fn seal_is_contract(r: u32, ) -> Weight; fn seal_caller_is_origin(r: u32, ) -> Weight; + fn seal_origin(r: u32, ) -> Weight; fn seal_address(r: u32, ) -> Weight; fn seal_gas_left(r: u32, ) -> Weight; fn seal_balance(r: u32, ) -> Weight; @@ -294,6 +295,17 @@ 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_origin(r: u32, ) -> Weight { + (213_550_000 as Weight) + // Standard Error: 63_000 + .saturating_add((21_519_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 { (220_649_000 as Weight) // Standard Error: 95_000 @@ -1185,6 +1197,17 @@ 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_origin(r: u32, ) -> Weight { + (213_550_000 as Weight) + // Standard Error: 63_000 + .saturating_add((21_519_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 { (220_649_000 as Weight) // Standard Error: 95_000 From be988fe5f5e84fbfee512525570320e04814518a Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 24 Feb 2022 23:28:59 +0300 Subject: [PATCH 02/21] `seal_origin` benchmark added --- frame/contracts/src/benchmarking/mod.rs | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index 129b4a62581cc..f0d4097b31ead 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -456,6 +456,40 @@ benchmarks! { let origin = RawOrigin::Signed(instance.caller.clone()); }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) + seal_origin { + let r in 0 .. API_BENCHMARK_BATCHES; + let repeat = r * API_BENCHMARK_BATCH_SIZE; + let pages = code::max_pages::(); + let code = WasmModule::::from(ModuleDefinition { + memory: Some(ImportedMemory::max::()), + imported_functions: vec![ImportedFunction { + module: "__unstable__", + name: "seal_origin", + params: vec![ValueType::I32, ValueType::I32], + return_type: None, + }], + // Write the output buffer size. The output size will be overwritten by the + // supervisor with the real size when calling this getter. Since this size does not + // change between calls it suffices to start with an initial value and then just + // leave as whatever value was written there. + data_segments: vec![DataSegment { + offset: 0, + value: (pages * 64 * 1024 - 4).to_le_bytes().to_vec(), + }], + call_body: Some(body::repeated( + repeat, + &[ + Instruction::I32Const(4), // ptr where to store output + Instruction::I32Const(0), // ptr to length + Instruction::Call(0), // call the imported function + ], + )), + ..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( From 6d954214acbb510f0204baa0b4198eed9f0ba3f1 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Fri, 25 Feb 2022 19:09:05 +0300 Subject: [PATCH 03/21] `seal_code_hash` + tests added --- frame/contracts/src/exec.rs | 42 +++++++++++++++++++++ frame/contracts/src/schedule.rs | 4 ++ frame/contracts/src/wasm/mod.rs | 58 ++++++++++++++++++++++++++++- frame/contracts/src/wasm/runtime.rs | 30 +++++++++++++++ frame/contracts/src/weights.rs | 25 +++++++++++++ 5 files changed, 158 insertions(+), 1 deletion(-) diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index 5a7796cabfe9b..efc58984f01ed 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -162,6 +162,11 @@ pub trait Ext: sealing::Sealed { /// Check if a contract lives at the specified `address`. fn is_contract(&self, address: &AccountIdOf) -> bool; + /// Returns the code hash of the contract by the given `address`. + /// + /// Returns 'None' if the `address` does not belong to a contract. + fn code_hash(&self, address: &AccountIdOf) -> Option>; + /// 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. @@ -1105,6 +1110,14 @@ where ContractInfoOf::::contains_key(&address) } + fn code_hash(&self, address: &T::AccountId) -> Option> { + if let Some(contract) = >::get(&address) { + Some(contract.code_hash) + } else { + None + } + } + fn caller_is_origin(&self) -> bool { self.caller() == &self.origin } @@ -1759,6 +1772,35 @@ mod tests { }); } + #[test] + fn code_hash_returns_proper_values() { + let code_bob = MockLoader::insert(Call, |ctx, _| { + // ALICE is not a contract and hence she does not have a code_hash + assert!(ctx.ext.code_hash(&ALICE).is_none()); + // BOB is a contract and hence he has a code_hash + assert!(ctx.ext.code_hash(&BOB).is_some()); + exec_success() + }); + + ExtBuilder::default().build().execute_with(|| { + let schedule = ::Schedule::get(); + place_contract(&BOB, code_bob); + let mut storage_meter = storage::meter::Meter::new(&ALICE, Some(0), 0).unwrap(); + // ALICE (not contract) -> BOB (contract) + let result = MockStack::run_call( + ALICE, + BOB, + &mut GasMeter::::new(GAS_LIMIT), + &mut storage_meter, + &schedule, + 0, + vec![0], + None, + ); + assert_matches!(result, Ok(_)); + }); + } + #[test] fn caller_is_origin_returns_proper_values() { let code_charlie = MockLoader::insert(Call, |ctx, _| { diff --git a/frame/contracts/src/schedule.rs b/frame/contracts/src/schedule.rs index ebb81cbe96c7c..78c375d7404b7 100644 --- a/frame/contracts/src/schedule.rs +++ b/frame/contracts/src/schedule.rs @@ -265,6 +265,9 @@ pub struct HostFnWeights { /// Weight of calling `seal_is_contract`. pub is_contract: Weight, + /// Weight of calling `seal_code_hash`. + pub code_hash: Weight, + /// Weight of calling `seal_caller_is_origin`. pub caller_is_origin: Weight, @@ -587,6 +590,7 @@ impl Default for HostFnWeights { Self { caller: cost_batched!(seal_caller), is_contract: cost_batched!(seal_is_contract), + code_hash: cost_batched!(seal_code_hash), caller_is_origin: cost_batched!(seal_caller_is_origin), origin: cost_batched!(seal_origin), address: cost_batched!(seal_address), diff --git a/frame/contracts/src/wasm/mod.rs b/frame/contracts/src/wasm/mod.rs index 99fb765072c07..cb0dcb6422af6 100644 --- a/frame/contracts/src/wasm/mod.rs +++ b/frame/contracts/src/wasm/mod.rs @@ -438,6 +438,9 @@ mod tests { fn is_contract(&self, _address: &AccountIdOf) -> bool { true } + fn code_hash(&self, _address: &AccountIdOf) -> Option> { + Some(H256::from_slice(&[0x11; 32])) + } fn caller_is_origin(&self) -> bool { false } @@ -2364,6 +2367,59 @@ mod tests { ); } + #[test] + #[cfg(feature = "unstable-interface")] + fn code_hash_works() { + /// calls `seal_code_hash` and compares the result with the constant. + const CODE_CODE_HASH: &str = r#" +(module + (import "__unstable__" "seal_code_hash" (func $seal_code_hash (param i32 i32 i32) (result i32))) + (import "env" "memory" (memory 1 1)) + + ;; size of our buffer is 32 bytes + (data (i32.const 32) "\20") + + (func $assert (param i32) + (block $ok + (br_if $ok + (get_local 0) + ) + (unreachable) + ) + ) + + (func (export "call") + ;; fill the buffer with the code hash. + (call $seal_code_hash + (i32.const 0) ;; input: address_ptr (before call) + (i32.const 0) ;; output: code_hash_ptr (after call) + (i32.const 32) ;; same 32 bytes length for input and output + ) + + ;; assert size == 32 + (call $assert + (i32.eq + (i32.load (i32.const 32)) + (i32.const 32) + ) + ) + + ;; assert that the first 8 bytes are "1111111111111111" + (call $assert + (i64.eq + (i64.load (i32.const 0)) + (i64.const 0x1111111111111111) + ) + ) + drop + ) + + (func (export "deploy")) +) +"#; + assert_ok!(execute(CODE_CODE_HASH, vec![], MockExt::default())); + } + #[test] #[cfg(feature = "unstable-interface")] fn caller_is_origin_works() { @@ -2401,7 +2457,7 @@ mod tests { #[test] #[cfg(feature = "unstable-interface")] - fn origin() { + fn origin_works() { /// calls `seal_origin` and compares the result with the constant (ALICE's address part). const CODE_ORIGIN: &str = r#" (module diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index 0b3e786dc0591..bd261de3c1961 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -145,6 +145,9 @@ pub enum RuntimeCosts { /// Weight of calling `seal_is_contract`. #[cfg(feature = "unstable-interface")] IsContract, + /// Weight of calling `seal_code_hash`. + #[cfg(feature = "unstable-interface")] + CodeHash, /// Weight of calling `seal_caller_is_origin`. #[cfg(feature = "unstable-interface")] CallerIsOrigin, @@ -242,6 +245,8 @@ impl RuntimeCosts { #[cfg(feature = "unstable-interface")] IsContract => s.is_contract, #[cfg(feature = "unstable-interface")] + CodeHash => s.code_hash, + #[cfg(feature = "unstable-interface")] CallerIsOrigin => s.caller_is_origin, #[cfg(feature = "unstable-interface")] Origin => s.origin, @@ -1385,6 +1390,31 @@ define_env!(Env, , Ok(ctx.ext.is_contract(&address) as u32) }, + // Retrieve a code hash for a specified address + // + // # Parameters + // + // - account_ptr: a pointer to the address in question. + // Should be decodable as an `T::AccountId`. Traps otherwise. + // - `out_ptr`: pointer to the linear memory where the returning value is written to. + // - `out_len_ptr`: in-out pointer into linear memory where the buffer length + // is read from and the value length is written to. + // + // # Errors + // + // `ReturnCode::KeyNotFound` + [__unstable__] seal_code_hash(ctx, account_ptr: u32, out_ptr: u32, out_len_ptr: u32) -> ReturnCode => { + ctx.charge_gas(RuntimeCosts::CodeHash)?; + let address: <::T as frame_system::Config>::AccountId = + ctx.read_sandbox_memory_as(account_ptr)?; + if let Some(value) = ctx.ext.code_hash(&address) { + ctx.write_sandbox_output(out_ptr, out_len_ptr, &value.encode(), false, already_charged)?; + Ok(ReturnCode::Success) + } else { + Ok(ReturnCode::KeyNotFound) + } + }, + // 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 your contract is being called by a contract diff --git a/frame/contracts/src/weights.rs b/frame/contracts/src/weights.rs index 0e47526c86643..27f7c61c3a6d5 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_code_hash(r: u32, ) -> Weight; fn seal_caller_is_origin(r: u32, ) -> Weight; fn seal_origin(r: u32, ) -> Weight; fn seal_address(r: u32, ) -> Weight; @@ -284,6 +285,18 @@ 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_code_hash(r: u32, ) -> Weight { + (102_073_000 as Weight) + // Standard Error: 843_000 + .saturating_add((369_025_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 { (213_550_000 as Weight) // Standard Error: 63_000 @@ -1186,6 +1199,18 @@ 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_code_hash(r: u32, ) -> Weight { + (102_073_000 as Weight) + // Standard Error: 843_000 + .saturating_add((369_025_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 { (213_550_000 as Weight) // Standard Error: 63_000 From 3de590468c83e846affb4b960794b15833dff381 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Fri, 25 Feb 2022 23:41:19 +0300 Subject: [PATCH 04/21] `seal_code_hash` benchmark added --- frame/contracts/src/benchmarking/mod.rs | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index f0d4097b31ead..259a3f8adf1f9 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -436,6 +436,42 @@ benchmarks! { let origin = RawOrigin::Signed(instance.caller.clone()); }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) + seal_code_hash { + let r in 0 .. API_BENCHMARK_BATCHES; + 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::()), + imported_functions: vec![ImportedFunction { + module: "__unstable__", + name: "seal_code_hash", + 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, account_len as u32), // address_ptr + Regular(Instruction::I32Const(4)), // ptr where to store output + Regular(Instruction::I32Const(0)), // ptr to length + Regular(Instruction::Call(0)), + ])), + .. Default::default() + }); + let instance = Contract::::new(code, vec![])?; + let info = instance.info()?; + // every account would be a contract (worst case) + for acc in accounts.iter() { + >::insert(acc, info.clone()); + } + 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 { From ee33b30a36dcf247eb2d58219b4cf90776a8119f Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Sun, 27 Feb 2022 22:45:32 +0300 Subject: [PATCH 05/21] `seal_own_code_hash` + tests added --- frame/contracts/src/exec.rs | 36 ++++++++++++++++++- frame/contracts/src/schedule.rs | 4 +++ frame/contracts/src/tests.rs | 2 ++ frame/contracts/src/wasm/mod.rs | 56 ++++++++++++++++++++++++++++- frame/contracts/src/wasm/runtime.rs | 17 +++++++++ frame/contracts/src/weights.rs | 25 +++++++++++++ 6 files changed, 138 insertions(+), 2 deletions(-) diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index efc58984f01ed..723e3a0b29ec1 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -162,11 +162,14 @@ pub trait Ext: sealing::Sealed { /// Check if a contract lives at the specified `address`. fn is_contract(&self, address: &AccountIdOf) -> bool; - /// Returns the code hash of the contract by the given `address`. + /// Returns the code hash of the contract for the given `address`. /// /// Returns 'None' if the `address` does not belong to a contract. fn code_hash(&self, address: &AccountIdOf) -> Option>; + /// Returns the code hash of the contract being executed. + fn own_code_hash(&mut self) -> &CodeHash; + /// 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. @@ -1118,6 +1121,10 @@ where } } + fn own_code_hash(&mut self) -> &CodeHash { + &self.top_frame_mut().contract_info().code_hash + } + fn caller_is_origin(&self) -> bool { self.caller() == &self.origin } @@ -1801,6 +1808,33 @@ mod tests { }); } + #[test] + fn own_code_hash_returns_proper_values() { + let bob_ch = MockLoader::insert(Call, |ctx, _| { + let code_hash = ctx.ext.code_hash(&BOB).unwrap(); + assert_eq!(*ctx.ext.own_code_hash(), code_hash); + 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(); + // ALICE (not contract) -> BOB (contract) + let result = MockStack::run_call( + ALICE, + BOB, + &mut GasMeter::::new(GAS_LIMIT), + &mut storage_meter, + &schedule, + 0, + vec![0], + None, + ); + assert_matches!(result, Ok(_)); + }); + } + #[test] fn caller_is_origin_returns_proper_values() { let code_charlie = MockLoader::insert(Call, |ctx, _| { diff --git a/frame/contracts/src/schedule.rs b/frame/contracts/src/schedule.rs index 78c375d7404b7..0e13df7f80622 100644 --- a/frame/contracts/src/schedule.rs +++ b/frame/contracts/src/schedule.rs @@ -268,6 +268,9 @@ pub struct HostFnWeights { /// Weight of calling `seal_code_hash`. pub code_hash: Weight, + /// Weight of calling `seal_own_code_hash`. + pub own_code_hash: Weight, + /// Weight of calling `seal_caller_is_origin`. pub caller_is_origin: Weight, @@ -591,6 +594,7 @@ impl Default for HostFnWeights { caller: cost_batched!(seal_caller), is_contract: cost_batched!(seal_is_contract), code_hash: cost_batched!(seal_code_hash), + own_code_hash: cost_batched!(seal_own_code_hash), caller_is_origin: cost_batched!(seal_caller_is_origin), origin: cost_batched!(seal_origin), address: cost_batched!(seal_address), diff --git a/frame/contracts/src/tests.rs b/frame/contracts/src/tests.rs index 8add424db0892..30696f477dd99 100644 --- a/frame/contracts/src/tests.rs +++ b/frame/contracts/src/tests.rs @@ -301,6 +301,8 @@ pub const BOB: AccountId32 = AccountId32::new([2u8; 32]); pub const CHARLIE: AccountId32 = AccountId32::new([3u8; 32]); pub const DJANGO: AccountId32 = AccountId32::new([4u8; 32]); +pub const HASH: H256 = H256::repeat_byte(0x10); + pub const GAS_LIMIT: Weight = 100_000_000_000; pub struct ExtBuilder { diff --git a/frame/contracts/src/wasm/mod.rs b/frame/contracts/src/wasm/mod.rs index cb0dcb6422af6..e97fc86813add 100644 --- a/frame/contracts/src/wasm/mod.rs +++ b/frame/contracts/src/wasm/mod.rs @@ -262,7 +262,7 @@ mod tests { }, gas::GasMeter, storage::WriteOutcome, - tests::{Call, Test, ALICE, BOB}, + tests::{Call, Test, ALICE, BOB, HASH}, BalanceOf, CodeHash, Error, Pallet as Contracts, }; use assert_matches::assert_matches; @@ -441,6 +441,9 @@ mod tests { fn code_hash(&self, _address: &AccountIdOf) -> Option> { Some(H256::from_slice(&[0x11; 32])) } + fn own_code_hash(&mut self) -> &CodeHash { + &HASH + } fn caller_is_origin(&self) -> bool { false } @@ -2420,6 +2423,57 @@ mod tests { assert_ok!(execute(CODE_CODE_HASH, vec![], MockExt::default())); } + #[test] + #[cfg(feature = "unstable-interface")] + fn own_code_hash_works() { + /// calls `seal_own_code_hash` and compares the result with the constant. + const CODE_OWN_CODE_HASH: &str = r#" +(module + (import "__unstable__" "seal_own_code_hash" (func $seal_own_code_hash (param i32 i32))) + (import "env" "memory" (memory 1 1)) + + ;; size of our buffer is 32 bytes + (data (i32.const 32) "\20") + + (func $assert (param i32) + (block $ok + (br_if $ok + (get_local 0) + ) + (unreachable) + ) + ) + + (func (export "call") + ;; fill the buffer with the code hash. + (call $seal_own_code_hash + (i32.const 0) ;; output: code_hash_ptr + (i32.const 32) ;; 32 bytes length of code_hash output + ) + + ;; assert size == 32 + (call $assert + (i32.eq + (i32.load (i32.const 32)) + (i32.const 32) + ) + ) + + ;; assert that the first 8 bytes are "1010101010101010" + (call $assert + (i64.eq + (i64.load (i32.const 0)) + (i64.const 0x1010101010101010) + ) + ) + ) + + (func (export "deploy")) +) +"#; + assert_ok!(execute(CODE_OWN_CODE_HASH, vec![], MockExt::default())); + } + #[test] #[cfg(feature = "unstable-interface")] fn caller_is_origin_works() { diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index bd261de3c1961..d7050545af162 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -148,6 +148,8 @@ pub enum RuntimeCosts { /// Weight of calling `seal_code_hash`. #[cfg(feature = "unstable-interface")] CodeHash, + #[cfg(feature = "unstable-interface")] + OwnCodeHash, /// Weight of calling `seal_caller_is_origin`. #[cfg(feature = "unstable-interface")] CallerIsOrigin, @@ -247,6 +249,8 @@ impl RuntimeCosts { #[cfg(feature = "unstable-interface")] CodeHash => s.code_hash, #[cfg(feature = "unstable-interface")] + OwnCodeHash => s.own_code_hash, + #[cfg(feature = "unstable-interface")] CallerIsOrigin => s.caller_is_origin, #[cfg(feature = "unstable-interface")] Origin => s.origin, @@ -1415,6 +1419,19 @@ define_env!(Env, , } }, + // Retrieve own code hash for current contract + // + // # Parameters + // + // - `out_ptr`: pointer to the linear memory where the returning value is written to. + // - `out_len_ptr`: in-out pointer into linear memory where the buffer length + // is read from and the value length is written to. + [__unstable__] seal_own_code_hash(ctx, out_ptr: u32, out_len_ptr: u32) => { + ctx.charge_gas(RuntimeCosts::OwnCodeHash)?; + let code_hash_encoded = &ctx.ext.own_code_hash().encode(); + Ok(ctx.write_sandbox_output(out_ptr, out_len_ptr, code_hash_encoded, false, already_charged)?) + }, + // 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 your contract is being called by a contract diff --git a/frame/contracts/src/weights.rs b/frame/contracts/src/weights.rs index 27f7c61c3a6d5..54c4b877ce1f0 100644 --- a/frame/contracts/src/weights.rs +++ b/frame/contracts/src/weights.rs @@ -57,6 +57,7 @@ pub trait WeightInfo { fn seal_caller(r: u32, ) -> Weight; fn seal_is_contract(r: u32, ) -> Weight; fn seal_code_hash(r: u32, ) -> Weight; + fn seal_own_code_hash(r: u32, ) -> Weight; fn seal_caller_is_origin(r: u32, ) -> Weight; fn seal_origin(r: u32, ) -> Weight; fn seal_address(r: u32, ) -> Weight; @@ -297,6 +298,18 @@ 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_own_code_hash(r: u32, ) -> Weight { + (102_073_000 as Weight) + // Standard Error: 843_000 + .saturating_add((369_025_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 { (213_550_000 as Weight) // Standard Error: 63_000 @@ -1211,6 +1224,18 @@ 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_own_code_hash(r: u32, ) -> Weight { + (102_073_000 as Weight) + // Standard Error: 843_000 + .saturating_add((369_025_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 { (213_550_000 as Weight) // Standard Error: 63_000 From 807cc1245e532801d29068c645ed2afe6d36254e Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Sun, 27 Feb 2022 23:45:39 +0300 Subject: [PATCH 06/21] `seal_own_code_hash` benchmark added --- frame/contracts/src/benchmarking/mod.rs | 38 ++++++++++++++++++++++++- frame/contracts/src/wasm/mod.rs | 6 ++-- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index 259a3f8adf1f9..7aa16438ccf4b 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -448,7 +448,7 @@ benchmarks! { imported_functions: vec![ImportedFunction { module: "__unstable__", name: "seal_code_hash", - params: vec![ValueType::I32], + params: vec![ValueType::I32, ValueType::I32, ValueType::I32], return_type: Some(ValueType::I32), }], data_segments: vec![DataSegment { @@ -460,6 +460,7 @@ benchmarks! { Regular(Instruction::I32Const(4)), // ptr where to store output Regular(Instruction::I32Const(0)), // ptr to length Regular(Instruction::Call(0)), + Regular(Instruction::Drop), ])), .. Default::default() }); @@ -472,6 +473,41 @@ benchmarks! { let origin = RawOrigin::Signed(instance.caller.clone()); }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) + seal_own_code_hash { + let r in 0 .. API_BENCHMARK_BATCHES; + let repeat = r * API_BENCHMARK_BATCH_SIZE; + let pages = code::max_pages::(); + let code = WasmModule::::from(ModuleDefinition { + memory: Some(ImportedMemory::max::()), + imported_functions: vec![ImportedFunction { + module: "__unstable__", + name: "seal_own_code_hash", + params: vec![ValueType::I32, ValueType::I32], + return_type: None, + }], + // Write the output buffer size. The output size will be overwritten by the + // supervisor with the real size when calling this getter. Since this size does not + // change between calls it suffices to start with an initial value and then just + // leave as whatever value was written there. + data_segments: vec![DataSegment { + offset: 0, + value: (pages * 64 * 1024 - 4).to_le_bytes().to_vec(), + }], + call_body: Some(body::repeated( + repeat, + &[ + Instruction::I32Const(4), // ptr where to store output + Instruction::I32Const(0), // ptr to length + Instruction::Call(0), // call the imported function + ], + )), + .. Default::default() + }); + let instance = Contract::::new(code, vec![])?; + let info = instance.info()?; + 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 { diff --git a/frame/contracts/src/wasm/mod.rs b/frame/contracts/src/wasm/mod.rs index e97fc86813add..34a0612effcf9 100644 --- a/frame/contracts/src/wasm/mod.rs +++ b/frame/contracts/src/wasm/mod.rs @@ -2393,7 +2393,7 @@ mod tests { (func (export "call") ;; fill the buffer with the code hash. - (call $seal_code_hash + (call $seal_code_hash (i32.const 0) ;; input: address_ptr (before call) (i32.const 0) ;; output: code_hash_ptr (after call) (i32.const 32) ;; same 32 bytes length for input and output @@ -2445,8 +2445,8 @@ mod tests { ) (func (export "call") - ;; fill the buffer with the code hash. - (call $seal_own_code_hash + ;; fill the buffer with the code hash + (call $seal_own_code_hash (i32.const 0) ;; output: code_hash_ptr (i32.const 32) ;; 32 bytes length of code_hash output ) From e7af71ff7f435309335150892fa7286506454354 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Mon, 28 Feb 2022 00:23:45 +0300 Subject: [PATCH 07/21] fmt lil fix --- frame/contracts/src/benchmarking/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index 7aa16438ccf4b..a4ebd30021d03 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -457,10 +457,10 @@ benchmarks! { }], call_body: Some(body::repeated_dyn(r * API_BENCHMARK_BATCH_SIZE, vec![ Counter(0, account_len as u32), // address_ptr - Regular(Instruction::I32Const(4)), // ptr where to store output +(Instruction::I32Const(4)), // ptr where to store output Regular(Instruction::I32Const(0)), // ptr to length Regular(Instruction::Call(0)), - Regular(Instruction::Drop), + Regular(Instruction::Drop), ])), .. Default::default() }); From 9c08447dd0394cb0fc350497949c2a0997069f8d Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Mon, 28 Feb 2022 12:41:24 +0300 Subject: [PATCH 08/21] akward accident bug fix --- frame/contracts/src/benchmarking/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index a4ebd30021d03..dc5fab54c4d9b 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -456,8 +456,8 @@ benchmarks! { value: accounts_bytes, }], call_body: Some(body::repeated_dyn(r * API_BENCHMARK_BATCH_SIZE, vec![ - Counter(0, account_len as u32), // address_ptr -(Instruction::I32Const(4)), // ptr where to store output + Counter(0, account_len as u32), // address_ptr + Regular(Instruction::I32Const(4)), // ptr where to store output Regular(Instruction::I32Const(0)), // ptr to length Regular(Instruction::Call(0)), Regular(Instruction::Drop), From e9bb2f35ff8a0cf9af512e62015504b7fc999b27 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Tue, 15 Mar 2022 16:41:53 +0200 Subject: [PATCH 09/21] 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/exec.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index 723e3a0b29ec1..b69d6d265d612 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -164,7 +164,7 @@ pub trait Ext: sealing::Sealed { /// Returns the code hash of the contract for the given `address`. /// - /// Returns 'None' if the `address` does not belong to a contract. + /// Returns `None` if the `address` does not belong to a contract. fn code_hash(&self, address: &AccountIdOf) -> Option>; /// Returns the code hash of the contract being executed. @@ -176,7 +176,7 @@ pub trait Ext: sealing::Sealed { /// However, this function does not require any storage lookup and therefore uses less weight. fn caller_is_origin(&self) -> bool; - /// Return address of the origin of current call stack + /// Returns the address of the origin of the whole call stack. fn origin(&self) -> &AccountIdOf; /// Returns a reference to the account id of the current contract. @@ -1114,11 +1114,7 @@ where } fn code_hash(&self, address: &T::AccountId) -> Option> { - if let Some(contract) = >::get(&address) { - Some(contract.code_hash) - } else { - None - } + >::get(&address).map(|contract| contract.code_hash) } fn own_code_hash(&mut self) -> &CodeHash { From ef032f4861233888ca99efa910428c722a1d0a91 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Wed, 16 Mar 2022 11:39:56 +0200 Subject: [PATCH 10/21] 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/wasm/runtime.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index d7050545af162..844daf5cd018e 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -1394,11 +1394,11 @@ define_env!(Env, , Ok(ctx.ext.is_contract(&address) as u32) }, - // Retrieve a code hash for a specified address + // Retrieve the code hash for a specified contract address. // // # Parameters // - // - account_ptr: a pointer to the address in question. + // - `account_ptr`: a pointer to the address in question. // Should be decodable as an `T::AccountId`. Traps otherwise. // - `out_ptr`: pointer to the linear memory where the returning value is written to. // - `out_len_ptr`: in-out pointer into linear memory where the buffer length @@ -1419,7 +1419,7 @@ define_env!(Env, , } }, - // Retrieve own code hash for current contract + // Retrieve the code hash of the currently executing contract. // // # Parameters // From 2abebfa17c26b5b54351351ee32eb62837dc7ac9 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Wed, 16 Mar 2022 10:31:39 +0200 Subject: [PATCH 11/21] benchmark fix --- frame/contracts/src/benchmarking/mod.rs | 30 ++++++++++++++++++------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index dc5fab54c4d9b..66a6420723463 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -443,6 +443,10 @@ benchmarks! { .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 accounts_len = accounts_bytes.len(); + let pages = code::max_pages::(); + let length_bytes = (pages * 64 * 1024 - (accounts_len as u32) - 4).to_le_bytes().to_vec(); + let hash_bytes = [0u8; 32].encode(); let code = WasmModule::::from(ModuleDefinition { memory: Some(ImportedMemory::max::()), imported_functions: vec![ImportedFunction { @@ -451,14 +455,24 @@ benchmarks! { params: vec![ValueType::I32, ValueType::I32, ValueType::I32], return_type: Some(ValueType::I32), }], - data_segments: vec![DataSegment { - offset: 0, - value: accounts_bytes, - }], + data_segments: vec![ + DataSegment { + offset: 0, + value: length_bytes, // output length + }, + DataSegment { + offset: 4, + value: hash_bytes, + }, + DataSegment { + offset: 36, + value: accounts_bytes, + }, + ], call_body: Some(body::repeated_dyn(r * API_BENCHMARK_BATCH_SIZE, vec![ - Counter(0, account_len as u32), // address_ptr - Regular(Instruction::I32Const(4)), // ptr where to store output - Regular(Instruction::I32Const(0)), // ptr to length + Counter(36, account_len as u32), // address_ptr + Regular(Instruction::I32Const(4)), // ptr to output data + Regular(Instruction::I32Const(0)), // ptr to output length Regular(Instruction::Call(0)), Regular(Instruction::Drop), ])), @@ -2447,7 +2461,7 @@ benchmarks! { } // w_memory_grow = w_bench - 2 * w_param - // We can only allow allocate as much memory as it is allowed in a a contract. + // We can only allow allocate as much memory as it is allowed in a contract. // Therefore the repeat count is limited by the maximum memory any contract can have. // Using a contract with more memory will skew the benchmark because the runtime of grow // depends on how much memory is already allocated. From 13a280267e381163698c8bdabb5ee94f0963c38a Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Wed, 16 Mar 2022 11:21:59 +0200 Subject: [PATCH 12/21] `WasmModule::getter()` to take `module_name` arg --- frame/contracts/src/benchmarking/code.rs | 4 +- frame/contracts/src/benchmarking/mod.rs | 49 ++++++------------------ 2 files changed, 13 insertions(+), 40 deletions(-) diff --git a/frame/contracts/src/benchmarking/code.rs b/frame/contracts/src/benchmarking/code.rs index f9d71fde65885..2544fd6b7f922 100644 --- a/frame/contracts/src/benchmarking/code.rs +++ b/frame/contracts/src/benchmarking/code.rs @@ -339,12 +339,12 @@ where /// Creates a wasm module that calls the imported function named `getter_name` `repeat` /// times. The imported function is expected to have the "getter signature" of /// (out_ptr: u32, len_ptr: u32) -> (). - pub fn getter(getter_name: &'static str, repeat: u32) -> Self { + pub fn getter(module_name: &'static str, getter_name: &'static str, repeat: u32) -> Self { let pages = max_pages::(); ModuleDefinition { memory: Some(ImportedMemory::max::()), imported_functions: vec![ImportedFunction { - module: "seal0", + module: module_name, name: getter_name, params: vec![ValueType::I32, ValueType::I32], return_type: None, diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index 66a6420723463..c3f5f5ab120bf 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -394,7 +394,7 @@ benchmarks! { seal_caller { let r in 0 .. API_BENCHMARK_BATCHES; let instance = Contract::::new(WasmModule::getter( - "seal_caller", r * API_BENCHMARK_BATCH_SIZE + "seal0", "seal_caller", r * API_BENCHMARK_BATCH_SIZE ), vec![])?; let origin = RawOrigin::Signed(instance.caller.clone()); }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) @@ -489,36 +489,9 @@ benchmarks! { seal_own_code_hash { let r in 0 .. API_BENCHMARK_BATCHES; - let repeat = r * API_BENCHMARK_BATCH_SIZE; - let pages = code::max_pages::(); - let code = WasmModule::::from(ModuleDefinition { - memory: Some(ImportedMemory::max::()), - imported_functions: vec![ImportedFunction { - module: "__unstable__", - name: "seal_own_code_hash", - params: vec![ValueType::I32, ValueType::I32], - return_type: None, - }], - // Write the output buffer size. The output size will be overwritten by the - // supervisor with the real size when calling this getter. Since this size does not - // change between calls it suffices to start with an initial value and then just - // leave as whatever value was written there. - data_segments: vec![DataSegment { - offset: 0, - value: (pages * 64 * 1024 - 4).to_le_bytes().to_vec(), - }], - call_body: Some(body::repeated( - repeat, - &[ - Instruction::I32Const(4), // ptr where to store output - Instruction::I32Const(0), // ptr to length - Instruction::Call(0), // call the imported function - ], - )), - .. Default::default() - }); - let instance = Contract::::new(code, vec![])?; - let info = instance.info()?; + let instance = Contract::::new(WasmModule::getter( + "__unstable__", "seal_own_code_hash", r * API_BENCHMARK_BATCH_SIZE + ), vec![])?; let origin = RawOrigin::Signed(instance.caller.clone()); }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) @@ -579,7 +552,7 @@ benchmarks! { seal_address { let r in 0 .. API_BENCHMARK_BATCHES; let instance = Contract::::new(WasmModule::getter( - "seal_address", r * API_BENCHMARK_BATCH_SIZE + "seal0", "seal_address", r * API_BENCHMARK_BATCH_SIZE ), vec![])?; let origin = RawOrigin::Signed(instance.caller.clone()); }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) @@ -587,7 +560,7 @@ benchmarks! { seal_gas_left { let r in 0 .. API_BENCHMARK_BATCHES; let instance = Contract::::new(WasmModule::getter( - "seal_gas_left", r * API_BENCHMARK_BATCH_SIZE + "seal0", "seal_gas_left", r * API_BENCHMARK_BATCH_SIZE ), vec![])?; let origin = RawOrigin::Signed(instance.caller.clone()); }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) @@ -595,7 +568,7 @@ benchmarks! { seal_balance { let r in 0 .. API_BENCHMARK_BATCHES; let instance = Contract::::new(WasmModule::getter( - "seal_balance", r * API_BENCHMARK_BATCH_SIZE + "seal0", "seal_balance", r * API_BENCHMARK_BATCH_SIZE ), vec![])?; let origin = RawOrigin::Signed(instance.caller.clone()); }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) @@ -603,7 +576,7 @@ benchmarks! { seal_value_transferred { let r in 0 .. API_BENCHMARK_BATCHES; let instance = Contract::::new(WasmModule::getter( - "seal_value_transferred", r * API_BENCHMARK_BATCH_SIZE + "seal0", "seal_value_transferred", r * API_BENCHMARK_BATCH_SIZE ), vec![])?; let origin = RawOrigin::Signed(instance.caller.clone()); }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) @@ -611,7 +584,7 @@ benchmarks! { seal_minimum_balance { let r in 0 .. API_BENCHMARK_BATCHES; let instance = Contract::::new(WasmModule::getter( - "seal_minimum_balance", r * API_BENCHMARK_BATCH_SIZE + "seal0", "seal_minimum_balance", r * API_BENCHMARK_BATCH_SIZE ), vec![])?; let origin = RawOrigin::Signed(instance.caller.clone()); }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) @@ -619,7 +592,7 @@ benchmarks! { seal_block_number { let r in 0 .. API_BENCHMARK_BATCHES; let instance = Contract::::new(WasmModule::getter( - "seal_block_number", r * API_BENCHMARK_BATCH_SIZE + "seal0", "seal_block_number", r * API_BENCHMARK_BATCH_SIZE ), vec![])?; let origin = RawOrigin::Signed(instance.caller.clone()); }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) @@ -627,7 +600,7 @@ benchmarks! { seal_now { let r in 0 .. API_BENCHMARK_BATCHES; let instance = Contract::::new(WasmModule::getter( - "seal_now", r * API_BENCHMARK_BATCH_SIZE + "seal0", "seal_now", r * API_BENCHMARK_BATCH_SIZE ), vec![])?; let origin = RawOrigin::Signed(instance.caller.clone()); }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) From 8a3e5bdd2be708c4077cd3e0cba7e891d4e1ab76 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Wed, 16 Mar 2022 11:34:54 +0200 Subject: [PATCH 13/21] test enhanced --- frame/contracts/src/exec.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index b69d6d265d612..59f2522cc29f5 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -1868,15 +1868,26 @@ mod tests { #[test] fn origin_returns_proper_values() { - let code_bob = MockLoader::insert(Call, |ctx, _| { + let code_charlie = MockLoader::insert(Call, |ctx, _| { + // BOB is caller but not the origin of the stack call + assert_ne!(ctx.ext.origin(), &BOB); + // ALICE is the origin of the call stack assert_eq!(ctx.ext.origin(), &ALICE); exec_success() }); + + let code_bob = MockLoader::insert(Call, |ctx, _| { + // ALICE is the origin of the call stack + assert_eq!(ctx.ext.origin(), &ALICE); + // BOB calls CHARLIE + ctx.ext.call(0, CHARLIE, 0, vec![], 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 -> BOB: (origin is ALICE) + // ALICE -> BOB: (origin is ALICE) -> CHARLIE (origin is still ALICE) let result = MockStack::run_call( ALICE, BOB, From 3049fbd6311af2fbcf6e3166a4dbf697d5eac1d7 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Wed, 16 Mar 2022 11:40:19 +0200 Subject: [PATCH 14/21] fixes based on review feedback --- frame/contracts/src/tests.rs | 2 -- frame/contracts/src/wasm/mod.rs | 4 ++-- frame/contracts/src/wasm/runtime.rs | 1 + 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frame/contracts/src/tests.rs b/frame/contracts/src/tests.rs index 30696f477dd99..8add424db0892 100644 --- a/frame/contracts/src/tests.rs +++ b/frame/contracts/src/tests.rs @@ -301,8 +301,6 @@ pub const BOB: AccountId32 = AccountId32::new([2u8; 32]); pub const CHARLIE: AccountId32 = AccountId32::new([3u8; 32]); pub const DJANGO: AccountId32 = AccountId32::new([4u8; 32]); -pub const HASH: H256 = H256::repeat_byte(0x10); - pub const GAS_LIMIT: Weight = 100_000_000_000; pub struct ExtBuilder { diff --git a/frame/contracts/src/wasm/mod.rs b/frame/contracts/src/wasm/mod.rs index 34a0612effcf9..9b1a6a6ab35a4 100644 --- a/frame/contracts/src/wasm/mod.rs +++ b/frame/contracts/src/wasm/mod.rs @@ -262,7 +262,7 @@ mod tests { }, gas::GasMeter, storage::WriteOutcome, - tests::{Call, Test, ALICE, BOB, HASH}, + tests::{Call, Test, ALICE, BOB}, BalanceOf, CodeHash, Error, Pallet as Contracts, }; use assert_matches::assert_matches; @@ -442,7 +442,7 @@ mod tests { Some(H256::from_slice(&[0x11; 32])) } fn own_code_hash(&mut self) -> &CodeHash { - &HASH + H256::repeat_byte(0x10); } fn caller_is_origin(&self) -> bool { false diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index d7050545af162..a15b0be4d32f7 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -148,6 +148,7 @@ pub enum RuntimeCosts { /// Weight of calling `seal_code_hash`. #[cfg(feature = "unstable-interface")] CodeHash, + /// Weight of calling `seal_own_code_hash`. #[cfg(feature = "unstable-interface")] OwnCodeHash, /// Weight of calling `seal_caller_is_origin`. From 4f2c3b7af3748aab181e5f9e3bb4100b01b3a562 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Wed, 16 Mar 2022 11:39:56 +0200 Subject: [PATCH 15/21] 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/wasm/runtime.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index a15b0be4d32f7..9ad470314962a 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -1395,11 +1395,11 @@ define_env!(Env, , Ok(ctx.ext.is_contract(&address) as u32) }, - // Retrieve a code hash for a specified address + // Retrieve the code hash for a specified contract address. // // # Parameters // - // - account_ptr: a pointer to the address in question. + // - `account_ptr`: a pointer to the address in question. // Should be decodable as an `T::AccountId`. Traps otherwise. // - `out_ptr`: pointer to the linear memory where the returning value is written to. // - `out_len_ptr`: in-out pointer into linear memory where the buffer length @@ -1420,7 +1420,7 @@ define_env!(Env, , } }, - // Retrieve own code hash for current contract + // Retrieve the code hash of the currently executing contract. // // # Parameters // From 3db6f533b984604526ae9b369124e5e7203f1ea7 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Wed, 16 Mar 2022 13:21:12 +0200 Subject: [PATCH 16/21] Hash left as const to return a ref to it from mock --- frame/contracts/src/tests.rs | 2 ++ frame/contracts/src/wasm/mod.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frame/contracts/src/tests.rs b/frame/contracts/src/tests.rs index 2b01cbe3c7429..91ddf44e8ce28 100644 --- a/frame/contracts/src/tests.rs +++ b/frame/contracts/src/tests.rs @@ -299,6 +299,8 @@ pub const BOB: AccountId32 = AccountId32::new([2u8; 32]); pub const CHARLIE: AccountId32 = AccountId32::new([3u8; 32]); pub const DJANGO: AccountId32 = AccountId32::new([4u8; 32]); +pub const HASH: H256 = H256::repeat_byte(0x10); + pub const GAS_LIMIT: Weight = 100_000_000_000; pub struct ExtBuilder { diff --git a/frame/contracts/src/wasm/mod.rs b/frame/contracts/src/wasm/mod.rs index 77d323e1f7475..9c7597ea705b8 100644 --- a/frame/contracts/src/wasm/mod.rs +++ b/frame/contracts/src/wasm/mod.rs @@ -262,7 +262,7 @@ mod tests { }, gas::GasMeter, storage::WriteOutcome, - tests::{Call, Test, ALICE, BOB}, + tests::{Call, Test, ALICE, BOB, HASH}, BalanceOf, CodeHash, Error, Pallet as Contracts, }; use assert_matches::assert_matches; @@ -442,7 +442,7 @@ mod tests { Some(H256::from_slice(&[0x11; 32])) } fn own_code_hash(&mut self) -> &CodeHash { - H256::repeat_byte(0x10); + &HASH } fn caller_is_origin(&self) -> bool { false From 746f8eff0c026cb8f5c9d29daf0c473c473e47af Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Wed, 16 Mar 2022 17:28:08 +0200 Subject: [PATCH 17/21] HASH test val to local const in mock --- frame/contracts/src/tests.rs | 2 -- frame/contracts/src/wasm/mod.rs | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/frame/contracts/src/tests.rs b/frame/contracts/src/tests.rs index 91ddf44e8ce28..2b01cbe3c7429 100644 --- a/frame/contracts/src/tests.rs +++ b/frame/contracts/src/tests.rs @@ -299,8 +299,6 @@ pub const BOB: AccountId32 = AccountId32::new([2u8; 32]); pub const CHARLIE: AccountId32 = AccountId32::new([3u8; 32]); pub const DJANGO: AccountId32 = AccountId32::new([4u8; 32]); -pub const HASH: H256 = H256::repeat_byte(0x10); - pub const GAS_LIMIT: Weight = 100_000_000_000; pub struct ExtBuilder { diff --git a/frame/contracts/src/wasm/mod.rs b/frame/contracts/src/wasm/mod.rs index 9c7597ea705b8..34a2f34d4b5cf 100644 --- a/frame/contracts/src/wasm/mod.rs +++ b/frame/contracts/src/wasm/mod.rs @@ -262,7 +262,7 @@ mod tests { }, gas::GasMeter, storage::WriteOutcome, - tests::{Call, Test, ALICE, BOB, HASH}, + tests::{Call, Test, ALICE, BOB}, BalanceOf, CodeHash, Error, Pallet as Contracts, }; use assert_matches::assert_matches; @@ -442,6 +442,7 @@ mod tests { Some(H256::from_slice(&[0x11; 32])) } fn own_code_hash(&mut self) -> &CodeHash { + const HASH: H256 = H256::repeat_byte(0x10); &HASH } fn caller_is_origin(&self) -> bool { From 654f14aa743878697b950af898fc96f9fab8c77e Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 17 Mar 2022 12:44:09 +0200 Subject: [PATCH 18/21] 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 | 3 +-- frame/contracts/src/exec.rs | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index c29cc5a55b104..32a590cd33458 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -445,7 +445,6 @@ benchmarks! { let accounts_bytes = accounts.iter().map(|a| a.encode()).flatten().collect::>(); let accounts_len = accounts_bytes.len(); let pages = code::max_pages::(); - let length_bytes = (pages * 64 * 1024 - (accounts_len as u32) - 4).to_le_bytes().to_vec(); let hash_bytes = [0u8; 32].encode(); let code = WasmModule::::from(ModuleDefinition { memory: Some(ImportedMemory::max::()), @@ -458,7 +457,7 @@ benchmarks! { data_segments: vec![ DataSegment { offset: 0, - value: length_bytes, // output length + value: 32, // output length }, DataSegment { offset: 4, diff --git a/frame/contracts/src/exec.rs b/frame/contracts/src/exec.rs index d6e92cf042995..38034a6a59a90 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -1871,7 +1871,7 @@ mod tests { fn origin_returns_proper_values() { let code_charlie = MockLoader::insert(Call, |ctx, _| { // BOB is caller but not the origin of the stack call - assert_ne!(ctx.ext.origin(), &BOB); + assert_eq!(ctx.ext.caller(), &BOB); // ALICE is the origin of the call stack assert_eq!(ctx.ext.origin(), &ALICE); exec_success() @@ -1880,6 +1880,7 @@ mod tests { let code_bob = MockLoader::insert(Call, |ctx, _| { // ALICE is the origin of the call stack assert_eq!(ctx.ext.origin(), &ALICE); + assert_eq!(ctx.ext.caller(), &ALICE); // BOB calls CHARLIE ctx.ext.call(0, CHARLIE, 0, vec![], true) }); From 113dce07b4dfe1f676ae3a19456ec94150f5ffc8 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 17 Mar 2022 13:01:56 +0200 Subject: [PATCH 19/21] fixes to benchmarks according to review feedback --- frame/contracts/src/benchmarking/mod.rs | 39 +++---------------------- 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index 32a590cd33458..90f89f854eb92 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -445,7 +445,6 @@ benchmarks! { let accounts_bytes = accounts.iter().map(|a| a.encode()).flatten().collect::>(); let accounts_len = accounts_bytes.len(); let pages = code::max_pages::(); - let hash_bytes = [0u8; 32].encode(); let code = WasmModule::::from(ModuleDefinition { memory: Some(ImportedMemory::max::()), imported_functions: vec![ImportedFunction { @@ -457,11 +456,7 @@ benchmarks! { data_segments: vec![ DataSegment { offset: 0, - value: 32, // output length - }, - DataSegment { - offset: 4, - value: hash_bytes, + value: 32u32.to_le_bytes().to_vec(), // output length }, DataSegment { offset: 36, @@ -516,35 +511,9 @@ benchmarks! { seal_origin { let r in 0 .. API_BENCHMARK_BATCHES; - let repeat = r * API_BENCHMARK_BATCH_SIZE; - let pages = code::max_pages::(); - let code = WasmModule::::from(ModuleDefinition { - memory: Some(ImportedMemory::max::()), - imported_functions: vec![ImportedFunction { - module: "__unstable__", - name: "seal_origin", - params: vec![ValueType::I32, ValueType::I32], - return_type: None, - }], - // Write the output buffer size. The output size will be overwritten by the - // supervisor with the real size when calling this getter. Since this size does not - // change between calls it suffices to start with an initial value and then just - // leave as whatever value was written there. - data_segments: vec![DataSegment { - offset: 0, - value: (pages * 64 * 1024 - 4).to_le_bytes().to_vec(), - }], - call_body: Some(body::repeated( - repeat, - &[ - Instruction::I32Const(4), // ptr where to store output - Instruction::I32Const(0), // ptr to length - Instruction::Call(0), // call the imported function - ], - )), - ..Default::default() - }); - let instance = Contract::::new(code, vec![])?; + let instance = Contract::::new(WasmModule::getter( + "__unstable__", "seal_origin", r * API_BENCHMARK_BATCH_SIZE + ), vec![])?; let origin = RawOrigin::Signed(instance.caller.clone()); }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) From f6d2b2b9ff367bac4531992979bc90124be1a349 Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Mon, 21 Mar 2022 13:21:03 +0000 Subject: [PATCH 20/21] 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 | 1242 ++++++++++++++++---------------- 1 file changed, 618 insertions(+), 624 deletions(-) diff --git a/frame/contracts/src/weights.rs b/frame/contracts/src/weights.rs index 087c545081f46..84937355cbe61 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-02-18, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-03-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -163,14 +163,14 @@ pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { // Storage: Contracts DeletionQueue (r:1 w:0) fn on_initialize() -> Weight { - (1_512_000 as Weight) + (1_569_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 { - (8_089_000 as Weight) + (9_620_000 as Weight) // Standard Error: 0 - .saturating_add((741_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))) @@ -178,17 +178,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: 5_000 - .saturating_add((2_287_000 as Weight).saturating_mul(q as Weight)) + // Standard Error: 4_000 + .saturating_add((1_795_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 { - (15_212_000 as Weight) + (12_256_000 as Weight) // Standard Error: 0 - .saturating_add((51_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((49_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)) } @@ -197,9 +197,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Timestamp Now (r:1 w:0) // Storage: System Account (r:1 w:1) fn call_with_code_per_byte(c: u32, ) -> Weight { - (218_406_000 as Weight) + (213_494_000 as Weight) // Standard Error: 0 - .saturating_add((55_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((53_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)) } @@ -211,9 +211,9 @@ 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 { - (265_773_000 as Weight) + (231_180_000 as Weight) // Standard Error: 0 - .saturating_add((127_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((125_000 as Weight).saturating_mul(c as Weight)) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) @@ -226,7 +226,7 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:1 w:1) // Storage: Contracts OwnerInfoOf (r:1 w:1) fn instantiate(s: u32, ) -> Weight { - (173_852_000 as Weight) + (172_238_000 as Weight) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(6 as Weight)) @@ -237,7 +237,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Timestamp Now (r:1 w:0) // Storage: System Account (r:1 w:1) fn call() -> Weight { - (140_088_000 as Weight) + (140_912_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -245,9 +245,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 { - (44_290_000 as Weight) + (42_493_000 as Weight) // Standard Error: 0 - .saturating_add((51_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((49_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)) } @@ -255,7 +255,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:0 w:1) // Storage: Contracts PristineCode (r:0 w:1) fn remove_code() -> Weight { - (24_364_000 as Weight) + (24_533_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -264,9 +264,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_caller(r: u32, ) -> Weight { - (219_617_000 as Weight) - // Standard Error: 119_000 - .saturating_add((50_409_000 as Weight).saturating_mul(r as Weight)) + (220_009_000 as Weight) + // Standard Error: 80_000 + .saturating_add((47_887_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)) } @@ -275,9 +275,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_is_contract(r: u32, ) -> Weight { - (102_073_000 as Weight) - // Standard Error: 843_000 - .saturating_add((369_025_000 as Weight).saturating_mul(r as Weight)) + (71_779_000 as Weight) + // Standard Error: 900_000 + .saturating_add((371_278_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)) @@ -287,33 +287,32 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_code_hash(r: u32, ) -> Weight { - (102_073_000 as Weight) - // Standard Error: 843_000 - .saturating_add((369_025_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)) + (0 as Weight) + // Standard Error: 2_329_000 + .saturating_add((451_731_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_own_code_hash(r: u32, ) -> Weight { - (102_073_000 as Weight) - // Standard Error: 843_000 - .saturating_add((369_025_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)) + (227_824_000 as Weight) + // Standard Error: 128_000 + .saturating_add((52_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)) } // 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 { - (213_550_000 as Weight) - // Standard Error: 63_000 - .saturating_add((21_519_000 as Weight).saturating_mul(r as Weight)) + (213_057_000 as Weight) + // Standard Error: 43_000 + .saturating_add((21_023_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)) } @@ -322,9 +321,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_origin(r: u32, ) -> Weight { - (213_550_000 as Weight) - // Standard Error: 63_000 - .saturating_add((21_519_000 as Weight).saturating_mul(r as Weight)) + (217_807_000 as Weight) + // Standard Error: 108_000 + .saturating_add((48_063_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)) } @@ -333,9 +332,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_address(r: u32, ) -> Weight { - (220_649_000 as Weight) - // Standard Error: 95_000 - .saturating_add((50_197_000 as Weight).saturating_mul(r as Weight)) + (219_066_000 as Weight) + // Standard Error: 117_000 + .saturating_add((48_056_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)) } @@ -344,9 +343,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 { - (218_190_000 as Weight) - // Standard Error: 99_000 - .saturating_add((49_817_000 as Weight).saturating_mul(r as Weight)) + (218_844_000 as Weight) + // Standard Error: 101_000 + .saturating_add((47_325_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)) } @@ -355,9 +354,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 { - (223_133_000 as Weight) - // Standard Error: 188_000 - .saturating_add((142_288_000 as Weight).saturating_mul(r as Weight)) + (219_234_000 as Weight) + // Standard Error: 171_000 + .saturating_add((142_534_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)) } @@ -366,9 +365,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 { - (216_612_000 as Weight) - // Standard Error: 103_000 - .saturating_add((49_956_000 as Weight).saturating_mul(r as Weight)) + (215_128_000 as Weight) + // Standard Error: 119_000 + .saturating_add((48_392_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)) } @@ -377,9 +376,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 { - (218_349_000 as Weight) - // Standard Error: 93_000 - .saturating_add((49_656_000 as Weight).saturating_mul(r as Weight)) + (214_603_000 as Weight) + // Standard Error: 115_000 + .saturating_add((48_041_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)) } @@ -388,9 +387,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 { - (213_151_000 as Weight) - // Standard Error: 110_000 - .saturating_add((50_099_000 as Weight).saturating_mul(r as Weight)) + (214_091_000 as Weight) + // Standard Error: 126_000 + .saturating_add((48_067_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)) } @@ -399,9 +398,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 { - (216_816_000 as Weight) - // Standard Error: 95_000 - .saturating_add((49_724_000 as Weight).saturating_mul(r as Weight)) + (214_418_000 as Weight) + // Standard Error: 100_000 + .saturating_add((47_791_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)) } @@ -411,9 +410,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 { - (223_053_000 as Weight) - // Standard Error: 148_000 - .saturating_add((124_240_000 as Weight).saturating_mul(r as Weight)) + (229_261_000 as Weight) + // Standard Error: 150_000 + .saturating_add((121_988_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)) } @@ -422,9 +421,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 { - (127_253_000 as Weight) - // Standard Error: 27_000 - .saturating_add((25_608_000 as Weight).saturating_mul(r as Weight)) + (127_983_000 as Weight) + // Standard Error: 56_000 + .saturating_add((24_016_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)) } @@ -433,9 +432,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 { - (218_057_000 as Weight) - // Standard Error: 98_000 - .saturating_add((49_061_000 as Weight).saturating_mul(r as Weight)) + (216_634_000 as Weight) + // Standard Error: 114_000 + .saturating_add((46_864_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)) } @@ -444,9 +443,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 { - (293_563_000 as Weight) - // Standard Error: 3_000 - .saturating_add((11_877_000 as Weight).saturating_mul(n as Weight)) + (285_180_000 as Weight) + // Standard Error: 4_000 + .saturating_add((11_899_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)) } @@ -454,10 +453,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 { - (211_511_000 as Weight) - // Standard Error: 70_000 - .saturating_add((2_085_000 as Weight).saturating_mul(r as Weight)) + fn seal_return(_r: u32, ) -> Weight { + (215_379_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -466,9 +463,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 { - (213_876_000 as Weight) + (213_957_000 as Weight) // Standard Error: 0 - .saturating_add((193_000 as Weight).saturating_mul(n as Weight)) + .saturating_add((201_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)) } @@ -479,9 +476,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_736_000 as Weight) - // Standard Error: 206_000 - .saturating_add((53_637_000 as Weight).saturating_mul(r as Weight)) + (215_782_000 as Weight) + // Standard Error: 149_000 + .saturating_add((52_421_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)) @@ -493,9 +490,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 { - (222_037_000 as Weight) - // Standard Error: 191_000 - .saturating_add((160_114_000 as Weight).saturating_mul(r as Weight)) + (217_910_000 as Weight) + // Standard Error: 149_000 + .saturating_add((157_525_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)) } @@ -504,9 +501,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 { - (219_211_000 as Weight) - // Standard Error: 239_000 - .saturating_add((296_722_000 as Weight).saturating_mul(r as Weight)) + (230_787_000 as Weight) + // Standard Error: 210_000 + .saturating_add((296_973_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)) } @@ -516,11 +513,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 { - (519_643_000 as Weight) - // Standard Error: 1_842_000 - .saturating_add((300_853_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 363_000 - .saturating_add((82_577_000 as Weight).saturating_mul(n as Weight)) + (539_238_000 as Weight) + // Standard Error: 1_701_000 + .saturating_add((294_348_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 335_000 + .saturating_add((82_116_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)) @@ -531,17 +528,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 { - (132_710_000 as Weight) - // Standard Error: 77_000 - .saturating_add((41_623_000 as Weight).saturating_mul(r as Weight)) + (135_081_000 as Weight) + // Standard Error: 94_000 + .saturating_add((39_247_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 { - (40_644_000 as Weight) - // Standard Error: 1_072_000 - .saturating_add((412_308_000 as Weight).saturating_mul(r as Weight)) + (41_752_000 as Weight) + // Standard Error: 1_107_000 + .saturating_add((403_473_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)) @@ -549,25 +546,25 @@ impl WeightInfo for SubstrateWeight { } // Storage: Skipped Metadata (r:0 w:0) fn seal_set_storage_per_new_kb(n: u32, ) -> Weight { - (609_052_000 as Weight) - // Standard Error: 258_000 - .saturating_add((28_633_000 as Weight).saturating_mul(n as Weight)) + (602_028_000 as Weight) + // Standard Error: 255_000 + .saturating_add((28_303_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 { - (629_665_000 as Weight) - // Standard Error: 300_000 - .saturating_add((10_947_000 as Weight).saturating_mul(n as Weight)) + (620_964_000 as Weight) + // Standard Error: 308_000 + .saturating_add((11_338_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 { - (91_519_000 as Weight) - // Standard Error: 889_000 - .saturating_add((386_498_000 as Weight).saturating_mul(r as Weight)) + (88_113_000 as Weight) + // Standard Error: 851_000 + .saturating_add((381_671_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)) @@ -575,51 +572,51 @@ impl WeightInfo for SubstrateWeight { } // Storage: Skipped Metadata (r:0 w:0) fn seal_clear_storage_per_kb(n: u32, ) -> Weight { - (612_224_000 as Weight) - // Standard Error: 269_000 - .saturating_add((10_709_000 as Weight).saturating_mul(n as Weight)) + (603_193_000 as Weight) + // Standard Error: 262_000 + .saturating_add((10_286_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_236_000 as Weight) - // Standard Error: 624_000 - .saturating_add((327_655_000 as Weight).saturating_mul(r as Weight)) + (112_477_000 as Weight) + // Standard Error: 666_000 + .saturating_add((324_824_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 { - (567_711_000 as Weight) - // Standard Error: 387_000 - .saturating_add((63_984_000 as Weight).saturating_mul(n as Weight)) + (564_781_000 as Weight) + // Standard Error: 403_000 + .saturating_add((63_824_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 { - (109_996_000 as Weight) - // Standard Error: 681_000 - .saturating_add((298_317_000 as Weight).saturating_mul(r as Weight)) + (115_207_000 as Weight) + // Standard Error: 672_000 + .saturating_add((290_919_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 { - (518_342_000 as Weight) - // Standard Error: 251_000 - .saturating_add((9_666_000 as Weight).saturating_mul(n as Weight)) + (511_026_000 as Weight) + // Standard Error: 224_000 + .saturating_add((10_138_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 { - (75_974_000 as Weight) - // Standard Error: 1_000_000 - .saturating_add((417_954_000 as Weight).saturating_mul(r as Weight)) + (79_113_000 as Weight) + // Standard Error: 904_000 + .saturating_add((417_022_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)) @@ -627,9 +624,9 @@ impl WeightInfo for SubstrateWeight { } // Storage: Skipped Metadata (r:0 w:0) fn seal_take_storage_per_kb(n: u32, ) -> Weight { - (653_188_000 as Weight) - // Standard Error: 333_000 - .saturating_add((64_810_000 as Weight).saturating_mul(n as Weight)) + (651_769_000 as Weight) + // Standard Error: 338_000 + .saturating_add((65_576_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)) } @@ -638,9 +635,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 { - (127_056_000 as Weight) - // Standard Error: 1_106_000 - .saturating_add((1_784_183_000 as Weight).saturating_mul(r as Weight)) + (93_588_000 as Weight) + // Standard Error: 1_444_000 + .saturating_add((1_803_217_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)) @@ -652,8 +649,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Timestamp Now (r:1 w:0) fn seal_call(r: u32, ) -> Weight { (0 as Weight) - // Standard Error: 2_621_000 - .saturating_add((19_757_765_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 3_050_000 + .saturating_add((19_925_209_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)) @@ -665,8 +662,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Timestamp Now (r:1 w:0) fn seal_delegate_call(r: u32, ) -> Weight { (0 as Weight) - // Standard Error: 6_286_000 - .saturating_add((19_798_229_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 7_377_000 + .saturating_add((19_978_301_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads((99 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -675,11 +672,11 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts CodeStorage (r:2 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_call_per_transfer_clone_kb(t: u32, c: u32, ) -> Weight { - (10_922_130_000 as Weight) - // Standard Error: 15_556_000 - .saturating_add((1_672_276_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 6_000 - .saturating_add((11_984_000 as Weight).saturating_mul(c as Weight)) + (11_124_804_000 as Weight) + // Standard Error: 21_475_000 + .saturating_add((1_635_442_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 9_000 + .saturating_add((11_981_000 as Weight).saturating_mul(c 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)) @@ -693,8 +690,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts OwnerInfoOf (r:100 w:100) fn seal_instantiate(r: u32, ) -> Weight { (0 as Weight) - // Standard Error: 46_147_000 - .saturating_add((27_589_519_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 47_682_000 + .saturating_add((27_883_754_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)) @@ -707,11 +704,11 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts Nonce (r:1 w:1) // Storage: Contracts OwnerInfoOf (r:1 w:1) fn seal_instantiate_per_transfer_salt_kb(t: u32, s: u32, ) -> Weight { - (14_790_752_000 as Weight) - // Standard Error: 37_838_000 - .saturating_add((714_016_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 17_000 - .saturating_add((155_605_000 as Weight).saturating_mul(s as Weight)) + (14_824_308_000 as Weight) + // Standard Error: 39_823_000 + .saturating_add((880_630_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 18_000 + .saturating_add((156_232_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(207 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(t as Weight))) .saturating_add(T::DbWeight::get().writes(205 as Weight)) @@ -722,9 +719,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 { - (216_547_000 as Weight) - // Standard Error: 126_000 - .saturating_add((81_132_000 as Weight).saturating_mul(r as Weight)) + (218_378_000 as Weight) + // Standard Error: 131_000 + .saturating_add((78_260_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)) } @@ -733,9 +730,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 { - (459_912_000 as Weight) - // Standard Error: 27_000 - .saturating_add((464_750_000 as Weight).saturating_mul(n as Weight)) + (202_849_000 as Weight) + // Standard Error: 61_000 + .saturating_add((466_532_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)) } @@ -744,9 +741,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_653_000 as Weight) + (220_258_000 as Weight) // Standard Error: 147_000 - .saturating_add((93_380_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((90_363_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)) } @@ -755,9 +752,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 { - (324_536_000 as Weight) - // Standard Error: 20_000 - .saturating_add((306_160_000 as Weight).saturating_mul(n as Weight)) + (232_371_000 as Weight) + // Standard Error: 23_000 + .saturating_add((307_036_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)) } @@ -766,9 +763,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 { - (218_574_000 as Weight) - // Standard Error: 123_000 - .saturating_add((65_035_000 as Weight).saturating_mul(r as Weight)) + (217_991_000 as Weight) + // Standard Error: 124_000 + .saturating_add((62_273_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)) } @@ -777,9 +774,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 { - (345_804_000 as Weight) - // Standard Error: 14_000 - .saturating_add((118_896_000 as Weight).saturating_mul(n as Weight)) + (396_282_000 as Weight) + // Standard Error: 13_000 + .saturating_add((119_575_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)) } @@ -788,9 +785,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 { - (215_898_000 as Weight) - // Standard Error: 108_000 - .saturating_add((64_332_000 as Weight).saturating_mul(r as Weight)) + (217_578_000 as Weight) + // Standard Error: 104_000 + .saturating_add((62_189_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)) } @@ -799,9 +796,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 { - (351_569_000 as Weight) - // Standard Error: 18_000 - .saturating_add((118_896_000 as Weight).saturating_mul(n as Weight)) + (358_167_000 as Weight) + // Standard Error: 15_000 + .saturating_add((119_692_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)) } @@ -810,9 +807,9 @@ 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 { - (272_893_000 as Weight) - // Standard Error: 1_438_000 - .saturating_add((15_412_877_000 as Weight).saturating_mul(r as Weight)) + (292_884_000 as Weight) + // Standard Error: 683_000 + .saturating_add((3_824_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)) } @@ -823,265 +820,265 @@ impl WeightInfo for SubstrateWeight { // Storage: Contracts OwnerInfoOf (r:36 w:36) fn seal_set_code_hash(r: u32, ) -> Weight { (0 as Weight) - // Standard Error: 2_132_000 - .saturating_add((937_623_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 2_302_000 + .saturating_add((922_467_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads((99 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().writes((99 as Weight).saturating_mul(r as Weight))) } fn instr_i64const(r: u32, ) -> Weight { - (74_268_000 as Weight) + (74_516_000 as Weight) // Standard Error: 1_000 - .saturating_add((595_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((592_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64load(r: u32, ) -> Weight { - (74_515_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_300_000 as Weight).saturating_mul(r as Weight)) + (74_430_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_320_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64store(r: u32, ) -> Weight { - (74_217_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_411_000 as Weight).saturating_mul(r as Weight)) + (74_440_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_428_000 as Weight).saturating_mul(r as Weight)) } fn instr_select(r: u32, ) -> Weight { - (73_689_000 as Weight) - // Standard Error: 4_000 - .saturating_add((1_792_000 as Weight).saturating_mul(r as Weight)) + (74_151_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_782_000 as Weight).saturating_mul(r as Weight)) } fn instr_if(r: u32, ) -> Weight { - (73_755_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_899_000 as Weight).saturating_mul(r as Weight)) + (74_225_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_887_000 as Weight).saturating_mul(r as Weight)) } fn instr_br(r: u32, ) -> Weight { - (73_735_000 as Weight) - // Standard Error: 0 - .saturating_add((903_000 as Weight).saturating_mul(r as Weight)) + (73_987_000 as Weight) + // Standard Error: 1_000 + .saturating_add((898_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_if(r: u32, ) -> Weight { - (73_595_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_448_000 as Weight).saturating_mul(r as Weight)) + (73_305_000 as Weight) + // Standard Error: 4_000 + .saturating_add((1_465_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_table(r: u32, ) -> Weight { - (73_524_000 as Weight) + (73_037_000 as Weight) // Standard Error: 3_000 - .saturating_add((1_572_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_605_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_table_per_entry(e: u32, ) -> Weight { - (76_361_000 as Weight) + (76_434_000 as Weight) // Standard Error: 0 .saturating_add((4_000 as Weight).saturating_mul(e as Weight)) } fn instr_call(r: u32, ) -> Weight { - (76_131_000 as Weight) - // Standard Error: 7_000 - .saturating_add((7_271_000 as Weight).saturating_mul(r as Weight)) + (75_461_000 as Weight) + // Standard Error: 10_000 + .saturating_add((7_446_000 as Weight).saturating_mul(r as Weight)) } fn instr_call_indirect(r: u32, ) -> Weight { - (87_948_000 as Weight) - // Standard Error: 14_000 - .saturating_add((9_429_000 as Weight).saturating_mul(r as Weight)) + (87_222_000 as Weight) + // Standard Error: 15_000 + .saturating_add((9_406_000 as Weight).saturating_mul(r as Weight)) } fn instr_call_indirect_per_param(p: u32, ) -> Weight { - (98_091_000 as Weight) + (97_204_000 as Weight) // Standard Error: 1_000 - .saturating_add((481_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((472_000 as Weight).saturating_mul(p as Weight)) } fn instr_local_get(r: u32, ) -> Weight { - (74_311_000 as Weight) + (75_299_000 as Weight) // Standard Error: 1_000 - .saturating_add((627_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((601_000 as Weight).saturating_mul(r as Weight)) } fn instr_local_set(r: u32, ) -> Weight { - (74_701_000 as Weight) - // Standard Error: 1_000 - .saturating_add((677_000 as Weight).saturating_mul(r as Weight)) + (74_827_000 as Weight) + // Standard Error: 3_000 + .saturating_add((686_000 as Weight).saturating_mul(r as Weight)) } fn instr_local_tee(r: u32, ) -> Weight { - (74_645_000 as Weight) - // Standard Error: 1_000 - .saturating_add((890_000 as Weight).saturating_mul(r as Weight)) + (74_624_000 as Weight) + // Standard Error: 2_000 + .saturating_add((895_000 as Weight).saturating_mul(r as Weight)) } fn instr_global_get(r: u32, ) -> Weight { - (77_130_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_156_000 as Weight).saturating_mul(r as Weight)) + (77_435_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_201_000 as Weight).saturating_mul(r as Weight)) } fn instr_global_set(r: u32, ) -> Weight { - (77_199_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_366_000 as Weight).saturating_mul(r as Weight)) + (76_693_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_410_000 as Weight).saturating_mul(r as Weight)) } fn instr_memory_current(r: u32, ) -> Weight { - (74_024_000 as Weight) - // Standard Error: 2_000 - .saturating_add((675_000 as Weight).saturating_mul(r as Weight)) + (74_244_000 as Weight) + // Standard Error: 1_000 + .saturating_add((660_000 as Weight).saturating_mul(r as Weight)) } fn instr_memory_grow(r: u32, ) -> Weight { - (75_226_000 as Weight) - // Standard Error: 170_000 - .saturating_add((186_225_000 as Weight).saturating_mul(r as Weight)) + (73_527_000 as Weight) + // Standard Error: 931_000 + .saturating_add((184_946_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64clz(r: u32, ) -> Weight { - (74_307_000 as Weight) - // Standard Error: 2_000 - .saturating_add((896_000 as Weight).saturating_mul(r as Weight)) + (74_181_000 as Weight) + // Standard Error: 6_000 + .saturating_add((906_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ctz(r: u32, ) -> Weight { - (74_408_000 as Weight) - // Standard Error: 3_000 - .saturating_add((895_000 as Weight).saturating_mul(r as Weight)) + (74_339_000 as Weight) + // Standard Error: 1_000 + .saturating_add((896_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64popcnt(r: u32, ) -> Weight { - (74_418_000 as Weight) - // Standard Error: 1_000 - .saturating_add((885_000 as Weight).saturating_mul(r as Weight)) + (74_444_000 as Weight) + // Standard Error: 3_000 + .saturating_add((889_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64eqz(r: u32, ) -> Weight { - (74_130_000 as Weight) - // Standard Error: 2_000 - .saturating_add((920_000 as Weight).saturating_mul(r as Weight)) + (74_572_000 as Weight) + // Standard Error: 1_000 + .saturating_add((908_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64extendsi32(r: u32, ) -> Weight { - (74_318_000 as Weight) + (74_349_000 as Weight) // Standard Error: 2_000 - .saturating_add((876_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((881_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64extendui32(r: u32, ) -> Weight { - (74_496_000 as Weight) + (74_426_000 as Weight) // Standard Error: 1_000 - .saturating_add((871_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((875_000 as Weight).saturating_mul(r as Weight)) } fn instr_i32wrapi64(r: u32, ) -> Weight { - (73_938_000 as Weight) - // Standard Error: 0 - .saturating_add((897_000 as Weight).saturating_mul(r as Weight)) + (74_172_000 as Weight) + // Standard Error: 2_000 + .saturating_add((906_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64eq(r: u32, ) -> Weight { - (73_943_000 as Weight) + (74_169_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_367_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ne(r: u32, ) -> Weight { - (74_305_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_353_000 as Weight).saturating_mul(r as Weight)) + (74_205_000 as Weight) + // Standard Error: 4_000 + .saturating_add((1_360_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64lts(r: u32, ) -> Weight { - (73_948_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_361_000 as Weight).saturating_mul(r as Weight)) + (74_237_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_356_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ltu(r: u32, ) -> Weight { - (74_188_000 as Weight) - // Standard Error: 4_000 - .saturating_add((1_354_000 as Weight).saturating_mul(r as Weight)) + (74_181_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64gts(r: u32, ) -> Weight { - (74_156_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_353_000 as Weight).saturating_mul(r as Weight)) + (74_038_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_360_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64gtu(r: u32, ) -> Weight { - (73_972_000 as Weight) - // Standard Error: 0 - .saturating_add((1_365_000 as Weight).saturating_mul(r as Weight)) + (73_881_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_372_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64les(r: u32, ) -> Weight { - (74_082_000 as Weight) - // Standard Error: 5_000 - .saturating_add((1_360_000 as Weight).saturating_mul(r as Weight)) + (73_969_000 as Weight) + // Standard Error: 0 + .saturating_add((1_361_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64leu(r: u32, ) -> Weight { - (74_190_000 as Weight) - // Standard Error: 1_000 + (74_497_000 as Weight) + // Standard Error: 3_000 .saturating_add((1_359_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ges(r: u32, ) -> Weight { - (73_803_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_370_000 as Weight).saturating_mul(r as Weight)) + (74_275_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_354_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64geu(r: u32, ) -> Weight { - (74_063_000 as Weight) - // Standard Error: 1_000 + (74_349_000 as Weight) + // Standard Error: 3_000 .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64add(r: u32, ) -> Weight { - (73_750_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_345_000 as Weight).saturating_mul(r as Weight)) + (74_192_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_333_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64sub(r: u32, ) -> Weight { - (73_979_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_341_000 as Weight).saturating_mul(r as Weight)) + (74_271_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_340_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64mul(r: u32, ) -> Weight { - (74_197_000 as Weight) - // Standard Error: 4_000 - .saturating_add((1_332_000 as Weight).saturating_mul(r as Weight)) + (73_971_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_340_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64divs(r: u32, ) -> Weight { - (73_624_000 as Weight) - // Standard Error: 5_000 - .saturating_add((2_020_000 as Weight).saturating_mul(r as Weight)) + (74_546_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_995_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64divu(r: u32, ) -> Weight { - (74_074_000 as Weight) + (74_194_000 as Weight) // Standard Error: 2_000 .saturating_add((2_050_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rems(r: u32, ) -> Weight { - (73_766_000 as Weight) - // Standard Error: 5_000 - .saturating_add((2_016_000 as Weight).saturating_mul(r as Weight)) + (74_106_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_997_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64remu(r: u32, ) -> Weight { - (73_978_000 as Weight) - // Standard Error: 3_000 - .saturating_add((2_064_000 as Weight).saturating_mul(r as Weight)) + (74_219_000 as Weight) + // Standard Error: 5_000 + .saturating_add((2_061_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64and(r: u32, ) -> Weight { - (73_996_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_336_000 as Weight).saturating_mul(r as Weight)) + (74_157_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_338_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64or(r: u32, ) -> Weight { - (74_058_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_335_000 as Weight).saturating_mul(r as Weight)) + (74_135_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_336_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64xor(r: u32, ) -> Weight { - (73_983_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_337_000 as Weight).saturating_mul(r as Weight)) + (74_038_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_345_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shl(r: u32, ) -> Weight { - (74_061_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_351_000 as Weight).saturating_mul(r as Weight)) + (74_011_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shrs(r: u32, ) -> Weight { - (73_940_000 as Weight) - // Standard Error: 5_000 - .saturating_add((1_360_000 as Weight).saturating_mul(r as Weight)) + (74_054_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_356_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shru(r: u32, ) -> Weight { - (73_954_000 as Weight) + (73_900_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_359_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_358_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rotl(r: u32, ) -> Weight { - (74_026_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_354_000 as Weight).saturating_mul(r as Weight)) + (73_948_000 as Weight) + // Standard Error: 0 + .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rotr(r: u32, ) -> Weight { - (74_149_000 as Weight) + (73_972_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_352_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_358_000 as Weight).saturating_mul(r as Weight)) } } @@ -1089,14 +1086,14 @@ impl WeightInfo for SubstrateWeight { impl WeightInfo for () { // Storage: Contracts DeletionQueue (r:1 w:0) fn on_initialize() -> Weight { - (1_512_000 as Weight) + (1_569_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 { - (8_089_000 as Weight) + (9_620_000 as Weight) // Standard Error: 0 - .saturating_add((741_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))) @@ -1104,17 +1101,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: 5_000 - .saturating_add((2_287_000 as Weight).saturating_mul(q as Weight)) + // Standard Error: 4_000 + .saturating_add((1_795_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 { - (15_212_000 as Weight) + (12_256_000 as Weight) // Standard Error: 0 - .saturating_add((51_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((49_000 as Weight).saturating_mul(c as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1123,9 +1120,9 @@ impl WeightInfo for () { // Storage: Timestamp Now (r:1 w:0) // Storage: System Account (r:1 w:1) fn call_with_code_per_byte(c: u32, ) -> Weight { - (218_406_000 as Weight) + (213_494_000 as Weight) // Standard Error: 0 - .saturating_add((55_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((53_000 as Weight).saturating_mul(c as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -1137,9 +1134,9 @@ 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 { - (265_773_000 as Weight) + (231_180_000 as Weight) // Standard Error: 0 - .saturating_add((127_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((125_000 as Weight).saturating_mul(c as Weight)) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) @@ -1152,7 +1149,7 @@ impl WeightInfo for () { // Storage: System Account (r:1 w:1) // Storage: Contracts OwnerInfoOf (r:1 w:1) fn instantiate(s: u32, ) -> Weight { - (173_852_000 as Weight) + (172_238_000 as Weight) // Standard Error: 0 .saturating_add((2_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) @@ -1163,7 +1160,7 @@ impl WeightInfo for () { // Storage: Timestamp Now (r:1 w:0) // Storage: System Account (r:1 w:1) fn call() -> Weight { - (140_088_000 as Weight) + (140_912_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -1171,9 +1168,9 @@ impl WeightInfo for () { // Storage: Contracts PristineCode (r:0 w:1) // Storage: Contracts OwnerInfoOf (r:0 w:1) fn upload_code(c: u32, ) -> Weight { - (44_290_000 as Weight) + (42_493_000 as Weight) // Standard Error: 0 - .saturating_add((51_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((49_000 as Weight).saturating_mul(c as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -1181,7 +1178,7 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:0 w:1) // Storage: Contracts PristineCode (r:0 w:1) fn remove_code() -> Weight { - (24_364_000 as Weight) + (24_533_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -1190,9 +1187,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_caller(r: u32, ) -> Weight { - (219_617_000 as Weight) - // Standard Error: 119_000 - .saturating_add((50_409_000 as Weight).saturating_mul(r as Weight)) + (220_009_000 as Weight) + // Standard Error: 80_000 + .saturating_add((47_887_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1201,9 +1198,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_is_contract(r: u32, ) -> Weight { - (102_073_000 as Weight) - // Standard Error: 843_000 - .saturating_add((369_025_000 as Weight).saturating_mul(r as Weight)) + (71_779_000 as Weight) + // Standard Error: 900_000 + .saturating_add((371_278_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)) @@ -1213,9 +1210,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_code_hash(r: u32, ) -> Weight { - (102_073_000 as Weight) - // Standard Error: 843_000 - .saturating_add((369_025_000 as Weight).saturating_mul(r as Weight)) + (0 as Weight) + // Standard Error: 2_329_000 + .saturating_add((451_731_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)) @@ -1225,11 +1222,10 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_own_code_hash(r: u32, ) -> Weight { - (102_073_000 as Weight) - // Standard Error: 843_000 - .saturating_add((369_025_000 as Weight).saturating_mul(r as Weight)) + (227_824_000 as Weight) + // Standard Error: 128_000 + .saturating_add((52_843_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) @@ -1237,9 +1233,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_caller_is_origin(r: u32, ) -> Weight { - (213_550_000 as Weight) - // Standard Error: 63_000 - .saturating_add((21_519_000 as Weight).saturating_mul(r as Weight)) + (213_057_000 as Weight) + // Standard Error: 43_000 + .saturating_add((21_023_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 +1244,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_origin(r: u32, ) -> Weight { - (213_550_000 as Weight) - // Standard Error: 63_000 - .saturating_add((21_519_000 as Weight).saturating_mul(r as Weight)) + (217_807_000 as Weight) + // Standard Error: 108_000 + .saturating_add((48_063_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1259,9 +1255,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_address(r: u32, ) -> Weight { - (220_649_000 as Weight) - // Standard Error: 95_000 - .saturating_add((50_197_000 as Weight).saturating_mul(r as Weight)) + (219_066_000 as Weight) + // Standard Error: 117_000 + .saturating_add((48_056_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1270,9 +1266,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 { - (218_190_000 as Weight) - // Standard Error: 99_000 - .saturating_add((49_817_000 as Weight).saturating_mul(r as Weight)) + (218_844_000 as Weight) + // Standard Error: 101_000 + .saturating_add((47_325_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1281,9 +1277,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_balance(r: u32, ) -> Weight { - (223_133_000 as Weight) - // Standard Error: 188_000 - .saturating_add((142_288_000 as Weight).saturating_mul(r as Weight)) + (219_234_000 as Weight) + // Standard Error: 171_000 + .saturating_add((142_534_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1292,9 +1288,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 { - (216_612_000 as Weight) - // Standard Error: 103_000 - .saturating_add((49_956_000 as Weight).saturating_mul(r as Weight)) + (215_128_000 as Weight) + // Standard Error: 119_000 + .saturating_add((48_392_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1303,9 +1299,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 { - (218_349_000 as Weight) - // Standard Error: 93_000 - .saturating_add((49_656_000 as Weight).saturating_mul(r as Weight)) + (214_603_000 as Weight) + // Standard Error: 115_000 + .saturating_add((48_041_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1314,9 +1310,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 { - (213_151_000 as Weight) - // Standard Error: 110_000 - .saturating_add((50_099_000 as Weight).saturating_mul(r as Weight)) + (214_091_000 as Weight) + // Standard Error: 126_000 + .saturating_add((48_067_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1325,9 +1321,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_now(r: u32, ) -> Weight { - (216_816_000 as Weight) - // Standard Error: 95_000 - .saturating_add((49_724_000 as Weight).saturating_mul(r as Weight)) + (214_418_000 as Weight) + // Standard Error: 100_000 + .saturating_add((47_791_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1337,9 +1333,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 { - (223_053_000 as Weight) - // Standard Error: 148_000 - .saturating_add((124_240_000 as Weight).saturating_mul(r as Weight)) + (229_261_000 as Weight) + // Standard Error: 150_000 + .saturating_add((121_988_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1348,9 +1344,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_gas(r: u32, ) -> Weight { - (127_253_000 as Weight) - // Standard Error: 27_000 - .saturating_add((25_608_000 as Weight).saturating_mul(r as Weight)) + (127_983_000 as Weight) + // Standard Error: 56_000 + .saturating_add((24_016_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1359,9 +1355,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_input(r: u32, ) -> Weight { - (218_057_000 as Weight) - // Standard Error: 98_000 - .saturating_add((49_061_000 as Weight).saturating_mul(r as Weight)) + (216_634_000 as Weight) + // Standard Error: 114_000 + .saturating_add((46_864_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1370,9 +1366,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 { - (293_563_000 as Weight) - // Standard Error: 3_000 - .saturating_add((11_877_000 as Weight).saturating_mul(n as Weight)) + (285_180_000 as Weight) + // Standard Error: 4_000 + .saturating_add((11_899_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1380,10 +1376,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 { - (211_511_000 as Weight) - // Standard Error: 70_000 - .saturating_add((2_085_000 as Weight).saturating_mul(r as Weight)) + fn seal_return(_r: u32, ) -> Weight { + (215_379_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1392,9 +1386,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 { - (213_876_000 as Weight) + (213_957_000 as Weight) // Standard Error: 0 - .saturating_add((193_000 as Weight).saturating_mul(n as Weight)) + .saturating_add((201_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1405,9 +1399,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_736_000 as Weight) - // Standard Error: 206_000 - .saturating_add((53_637_000 as Weight).saturating_mul(r as Weight)) + (215_782_000 as Weight) + // Standard Error: 149_000 + .saturating_add((52_421_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)) @@ -1419,9 +1413,9 @@ impl WeightInfo for () { // Storage: Timestamp Now (r:1 w:0) // Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) fn seal_random(r: u32, ) -> Weight { - (222_037_000 as Weight) - // Standard Error: 191_000 - .saturating_add((160_114_000 as Weight).saturating_mul(r as Weight)) + (217_910_000 as Weight) + // Standard Error: 149_000 + .saturating_add((157_525_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1430,9 +1424,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 { - (219_211_000 as Weight) - // Standard Error: 239_000 - .saturating_add((296_722_000 as Weight).saturating_mul(r as Weight)) + (230_787_000 as Weight) + // Standard Error: 210_000 + .saturating_add((296_973_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1442,11 +1436,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 { - (519_643_000 as Weight) - // Standard Error: 1_842_000 - .saturating_add((300_853_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 363_000 - .saturating_add((82_577_000 as Weight).saturating_mul(n as Weight)) + (539_238_000 as Weight) + // Standard Error: 1_701_000 + .saturating_add((294_348_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 335_000 + .saturating_add((82_116_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)) @@ -1457,17 +1451,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 { - (132_710_000 as Weight) - // Standard Error: 77_000 - .saturating_add((41_623_000 as Weight).saturating_mul(r as Weight)) + (135_081_000 as Weight) + // Standard Error: 94_000 + .saturating_add((39_247_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 { - (40_644_000 as Weight) - // Standard Error: 1_072_000 - .saturating_add((412_308_000 as Weight).saturating_mul(r as Weight)) + (41_752_000 as Weight) + // Standard Error: 1_107_000 + .saturating_add((403_473_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)) @@ -1475,25 +1469,25 @@ impl WeightInfo for () { } // Storage: Skipped Metadata (r:0 w:0) fn seal_set_storage_per_new_kb(n: u32, ) -> Weight { - (609_052_000 as Weight) - // Standard Error: 258_000 - .saturating_add((28_633_000 as Weight).saturating_mul(n as Weight)) + (602_028_000 as Weight) + // Standard Error: 255_000 + .saturating_add((28_303_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 { - (629_665_000 as Weight) - // Standard Error: 300_000 - .saturating_add((10_947_000 as Weight).saturating_mul(n as Weight)) + (620_964_000 as Weight) + // Standard Error: 308_000 + .saturating_add((11_338_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 { - (91_519_000 as Weight) - // Standard Error: 889_000 - .saturating_add((386_498_000 as Weight).saturating_mul(r as Weight)) + (88_113_000 as Weight) + // Standard Error: 851_000 + .saturating_add((381_671_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)) @@ -1501,51 +1495,51 @@ impl WeightInfo for () { } // Storage: Skipped Metadata (r:0 w:0) fn seal_clear_storage_per_kb(n: u32, ) -> Weight { - (612_224_000 as Weight) - // Standard Error: 269_000 - .saturating_add((10_709_000 as Weight).saturating_mul(n as Weight)) + (603_193_000 as Weight) + // Standard Error: 262_000 + .saturating_add((10_286_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_236_000 as Weight) - // Standard Error: 624_000 - .saturating_add((327_655_000 as Weight).saturating_mul(r as Weight)) + (112_477_000 as Weight) + // Standard Error: 666_000 + .saturating_add((324_824_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 { - (567_711_000 as Weight) - // Standard Error: 387_000 - .saturating_add((63_984_000 as Weight).saturating_mul(n as Weight)) + (564_781_000 as Weight) + // Standard Error: 403_000 + .saturating_add((63_824_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 { - (109_996_000 as Weight) - // Standard Error: 681_000 - .saturating_add((298_317_000 as Weight).saturating_mul(r as Weight)) + (115_207_000 as Weight) + // Standard Error: 672_000 + .saturating_add((290_919_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 { - (518_342_000 as Weight) - // Standard Error: 251_000 - .saturating_add((9_666_000 as Weight).saturating_mul(n as Weight)) + (511_026_000 as Weight) + // Standard Error: 224_000 + .saturating_add((10_138_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 { - (75_974_000 as Weight) - // Standard Error: 1_000_000 - .saturating_add((417_954_000 as Weight).saturating_mul(r as Weight)) + (79_113_000 as Weight) + // Standard Error: 904_000 + .saturating_add((417_022_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)) @@ -1553,9 +1547,9 @@ impl WeightInfo for () { } // Storage: Skipped Metadata (r:0 w:0) fn seal_take_storage_per_kb(n: u32, ) -> Weight { - (653_188_000 as Weight) - // Standard Error: 333_000 - .saturating_add((64_810_000 as Weight).saturating_mul(n as Weight)) + (651_769_000 as Weight) + // Standard Error: 338_000 + .saturating_add((65_576_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(105 as Weight)) .saturating_add(RocksDbWeight::get().writes(103 as Weight)) } @@ -1564,9 +1558,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_transfer(r: u32, ) -> Weight { - (127_056_000 as Weight) - // Standard Error: 1_106_000 - .saturating_add((1_784_183_000 as Weight).saturating_mul(r as Weight)) + (93_588_000 as Weight) + // Standard Error: 1_444_000 + .saturating_add((1_803_217_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)) @@ -1578,8 +1572,8 @@ impl WeightInfo for () { // Storage: Timestamp Now (r:1 w:0) fn seal_call(r: u32, ) -> Weight { (0 as Weight) - // Standard Error: 2_621_000 - .saturating_add((19_757_765_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 3_050_000 + .saturating_add((19_925_209_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)) @@ -1591,8 +1585,8 @@ impl WeightInfo for () { // Storage: Timestamp Now (r:1 w:0) fn seal_delegate_call(r: u32, ) -> Weight { (0 as Weight) - // Standard Error: 6_286_000 - .saturating_add((19_798_229_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 7_377_000 + .saturating_add((19_978_301_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads((99 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1601,11 +1595,11 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:2 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_call_per_transfer_clone_kb(t: u32, c: u32, ) -> Weight { - (10_922_130_000 as Weight) - // Standard Error: 15_556_000 - .saturating_add((1_672_276_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 6_000 - .saturating_add((11_984_000 as Weight).saturating_mul(c as Weight)) + (11_124_804_000 as Weight) + // Standard Error: 21_475_000 + .saturating_add((1_635_442_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 9_000 + .saturating_add((11_981_000 as Weight).saturating_mul(c 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)) @@ -1619,8 +1613,8 @@ impl WeightInfo for () { // Storage: Contracts OwnerInfoOf (r:100 w:100) fn seal_instantiate(r: u32, ) -> Weight { (0 as Weight) - // Standard Error: 46_147_000 - .saturating_add((27_589_519_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 47_682_000 + .saturating_add((27_883_754_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)) @@ -1633,11 +1627,11 @@ impl WeightInfo for () { // Storage: Contracts Nonce (r:1 w:1) // Storage: Contracts OwnerInfoOf (r:1 w:1) fn seal_instantiate_per_transfer_salt_kb(t: u32, s: u32, ) -> Weight { - (14_790_752_000 as Weight) - // Standard Error: 37_838_000 - .saturating_add((714_016_000 as Weight).saturating_mul(t as Weight)) - // Standard Error: 17_000 - .saturating_add((155_605_000 as Weight).saturating_mul(s as Weight)) + (14_824_308_000 as Weight) + // Standard Error: 39_823_000 + .saturating_add((880_630_000 as Weight).saturating_mul(t as Weight)) + // Standard Error: 18_000 + .saturating_add((156_232_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(207 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(t as Weight))) .saturating_add(RocksDbWeight::get().writes(205 as Weight)) @@ -1648,9 +1642,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 { - (216_547_000 as Weight) - // Standard Error: 126_000 - .saturating_add((81_132_000 as Weight).saturating_mul(r as Weight)) + (218_378_000 as Weight) + // Standard Error: 131_000 + .saturating_add((78_260_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1659,9 +1653,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 { - (459_912_000 as Weight) - // Standard Error: 27_000 - .saturating_add((464_750_000 as Weight).saturating_mul(n as Weight)) + (202_849_000 as Weight) + // Standard Error: 61_000 + .saturating_add((466_532_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1670,9 +1664,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_653_000 as Weight) + (220_258_000 as Weight) // Standard Error: 147_000 - .saturating_add((93_380_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((90_363_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1681,9 +1675,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 { - (324_536_000 as Weight) - // Standard Error: 20_000 - .saturating_add((306_160_000 as Weight).saturating_mul(n as Weight)) + (232_371_000 as Weight) + // Standard Error: 23_000 + .saturating_add((307_036_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1692,9 +1686,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 { - (218_574_000 as Weight) - // Standard Error: 123_000 - .saturating_add((65_035_000 as Weight).saturating_mul(r as Weight)) + (217_991_000 as Weight) + // Standard Error: 124_000 + .saturating_add((62_273_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1703,9 +1697,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 { - (345_804_000 as Weight) - // Standard Error: 14_000 - .saturating_add((118_896_000 as Weight).saturating_mul(n as Weight)) + (396_282_000 as Weight) + // Standard Error: 13_000 + .saturating_add((119_575_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1714,9 +1708,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 { - (215_898_000 as Weight) - // Standard Error: 108_000 - .saturating_add((64_332_000 as Weight).saturating_mul(r as Weight)) + (217_578_000 as Weight) + // Standard Error: 104_000 + .saturating_add((62_189_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1725,9 +1719,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 { - (351_569_000 as Weight) - // Standard Error: 18_000 - .saturating_add((118_896_000 as Weight).saturating_mul(n as Weight)) + (358_167_000 as Weight) + // Standard Error: 15_000 + .saturating_add((119_692_000 as Weight).saturating_mul(n as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -1736,9 +1730,9 @@ impl WeightInfo for () { // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn seal_ecdsa_recover(r: u32, ) -> Weight { - (272_893_000 as Weight) - // Standard Error: 1_438_000 - .saturating_add((15_412_877_000 as Weight).saturating_mul(r as Weight)) + (292_884_000 as Weight) + // Standard Error: 683_000 + .saturating_add((3_824_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)) } @@ -1749,264 +1743,264 @@ impl WeightInfo for () { // Storage: Contracts OwnerInfoOf (r:36 w:36) fn seal_set_code_hash(r: u32, ) -> Weight { (0 as Weight) - // Standard Error: 2_132_000 - .saturating_add((937_623_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 2_302_000 + .saturating_add((922_467_000 as Weight).saturating_mul(r as Weight)) .saturating_add(RocksDbWeight::get().reads((99 as Weight).saturating_mul(r as Weight))) .saturating_add(RocksDbWeight::get().writes((99 as Weight).saturating_mul(r as Weight))) } fn instr_i64const(r: u32, ) -> Weight { - (74_268_000 as Weight) + (74_516_000 as Weight) // Standard Error: 1_000 - .saturating_add((595_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((592_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64load(r: u32, ) -> Weight { - (74_515_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_300_000 as Weight).saturating_mul(r as Weight)) + (74_430_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_320_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64store(r: u32, ) -> Weight { - (74_217_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_411_000 as Weight).saturating_mul(r as Weight)) + (74_440_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_428_000 as Weight).saturating_mul(r as Weight)) } fn instr_select(r: u32, ) -> Weight { - (73_689_000 as Weight) - // Standard Error: 4_000 - .saturating_add((1_792_000 as Weight).saturating_mul(r as Weight)) + (74_151_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_782_000 as Weight).saturating_mul(r as Weight)) } fn instr_if(r: u32, ) -> Weight { - (73_755_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_899_000 as Weight).saturating_mul(r as Weight)) + (74_225_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_887_000 as Weight).saturating_mul(r as Weight)) } fn instr_br(r: u32, ) -> Weight { - (73_735_000 as Weight) - // Standard Error: 0 - .saturating_add((903_000 as Weight).saturating_mul(r as Weight)) + (73_987_000 as Weight) + // Standard Error: 1_000 + .saturating_add((898_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_if(r: u32, ) -> Weight { - (73_595_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_448_000 as Weight).saturating_mul(r as Weight)) + (73_305_000 as Weight) + // Standard Error: 4_000 + .saturating_add((1_465_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_table(r: u32, ) -> Weight { - (73_524_000 as Weight) + (73_037_000 as Weight) // Standard Error: 3_000 - .saturating_add((1_572_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_605_000 as Weight).saturating_mul(r as Weight)) } fn instr_br_table_per_entry(e: u32, ) -> Weight { - (76_361_000 as Weight) + (76_434_000 as Weight) // Standard Error: 0 .saturating_add((4_000 as Weight).saturating_mul(e as Weight)) } fn instr_call(r: u32, ) -> Weight { - (76_131_000 as Weight) - // Standard Error: 7_000 - .saturating_add((7_271_000 as Weight).saturating_mul(r as Weight)) + (75_461_000 as Weight) + // Standard Error: 10_000 + .saturating_add((7_446_000 as Weight).saturating_mul(r as Weight)) } fn instr_call_indirect(r: u32, ) -> Weight { - (87_948_000 as Weight) - // Standard Error: 14_000 - .saturating_add((9_429_000 as Weight).saturating_mul(r as Weight)) + (87_222_000 as Weight) + // Standard Error: 15_000 + .saturating_add((9_406_000 as Weight).saturating_mul(r as Weight)) } fn instr_call_indirect_per_param(p: u32, ) -> Weight { - (98_091_000 as Weight) + (97_204_000 as Weight) // Standard Error: 1_000 - .saturating_add((481_000 as Weight).saturating_mul(p as Weight)) + .saturating_add((472_000 as Weight).saturating_mul(p as Weight)) } fn instr_local_get(r: u32, ) -> Weight { - (74_311_000 as Weight) + (75_299_000 as Weight) // Standard Error: 1_000 - .saturating_add((627_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((601_000 as Weight).saturating_mul(r as Weight)) } fn instr_local_set(r: u32, ) -> Weight { - (74_701_000 as Weight) - // Standard Error: 1_000 - .saturating_add((677_000 as Weight).saturating_mul(r as Weight)) + (74_827_000 as Weight) + // Standard Error: 3_000 + .saturating_add((686_000 as Weight).saturating_mul(r as Weight)) } fn instr_local_tee(r: u32, ) -> Weight { - (74_645_000 as Weight) - // Standard Error: 1_000 - .saturating_add((890_000 as Weight).saturating_mul(r as Weight)) + (74_624_000 as Weight) + // Standard Error: 2_000 + .saturating_add((895_000 as Weight).saturating_mul(r as Weight)) } fn instr_global_get(r: u32, ) -> Weight { - (77_130_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_156_000 as Weight).saturating_mul(r as Weight)) + (77_435_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_201_000 as Weight).saturating_mul(r as Weight)) } fn instr_global_set(r: u32, ) -> Weight { - (77_199_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_366_000 as Weight).saturating_mul(r as Weight)) + (76_693_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_410_000 as Weight).saturating_mul(r as Weight)) } fn instr_memory_current(r: u32, ) -> Weight { - (74_024_000 as Weight) - // Standard Error: 2_000 - .saturating_add((675_000 as Weight).saturating_mul(r as Weight)) + (74_244_000 as Weight) + // Standard Error: 1_000 + .saturating_add((660_000 as Weight).saturating_mul(r as Weight)) } fn instr_memory_grow(r: u32, ) -> Weight { - (75_226_000 as Weight) - // Standard Error: 170_000 - .saturating_add((186_225_000 as Weight).saturating_mul(r as Weight)) + (73_527_000 as Weight) + // Standard Error: 931_000 + .saturating_add((184_946_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64clz(r: u32, ) -> Weight { - (74_307_000 as Weight) - // Standard Error: 2_000 - .saturating_add((896_000 as Weight).saturating_mul(r as Weight)) + (74_181_000 as Weight) + // Standard Error: 6_000 + .saturating_add((906_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ctz(r: u32, ) -> Weight { - (74_408_000 as Weight) - // Standard Error: 3_000 - .saturating_add((895_000 as Weight).saturating_mul(r as Weight)) + (74_339_000 as Weight) + // Standard Error: 1_000 + .saturating_add((896_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64popcnt(r: u32, ) -> Weight { - (74_418_000 as Weight) - // Standard Error: 1_000 - .saturating_add((885_000 as Weight).saturating_mul(r as Weight)) + (74_444_000 as Weight) + // Standard Error: 3_000 + .saturating_add((889_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64eqz(r: u32, ) -> Weight { - (74_130_000 as Weight) - // Standard Error: 2_000 - .saturating_add((920_000 as Weight).saturating_mul(r as Weight)) + (74_572_000 as Weight) + // Standard Error: 1_000 + .saturating_add((908_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64extendsi32(r: u32, ) -> Weight { - (74_318_000 as Weight) + (74_349_000 as Weight) // Standard Error: 2_000 - .saturating_add((876_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((881_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64extendui32(r: u32, ) -> Weight { - (74_496_000 as Weight) + (74_426_000 as Weight) // Standard Error: 1_000 - .saturating_add((871_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((875_000 as Weight).saturating_mul(r as Weight)) } fn instr_i32wrapi64(r: u32, ) -> Weight { - (73_938_000 as Weight) - // Standard Error: 0 - .saturating_add((897_000 as Weight).saturating_mul(r as Weight)) + (74_172_000 as Weight) + // Standard Error: 2_000 + .saturating_add((906_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64eq(r: u32, ) -> Weight { - (73_943_000 as Weight) + (74_169_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_367_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ne(r: u32, ) -> Weight { - (74_305_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_353_000 as Weight).saturating_mul(r as Weight)) + (74_205_000 as Weight) + // Standard Error: 4_000 + .saturating_add((1_360_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64lts(r: u32, ) -> Weight { - (73_948_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_361_000 as Weight).saturating_mul(r as Weight)) + (74_237_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_356_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ltu(r: u32, ) -> Weight { - (74_188_000 as Weight) - // Standard Error: 4_000 - .saturating_add((1_354_000 as Weight).saturating_mul(r as Weight)) + (74_181_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64gts(r: u32, ) -> Weight { - (74_156_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_353_000 as Weight).saturating_mul(r as Weight)) + (74_038_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_360_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64gtu(r: u32, ) -> Weight { - (73_972_000 as Weight) - // Standard Error: 0 - .saturating_add((1_365_000 as Weight).saturating_mul(r as Weight)) + (73_881_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_372_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64les(r: u32, ) -> Weight { - (74_082_000 as Weight) - // Standard Error: 5_000 - .saturating_add((1_360_000 as Weight).saturating_mul(r as Weight)) + (73_969_000 as Weight) + // Standard Error: 0 + .saturating_add((1_361_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64leu(r: u32, ) -> Weight { - (74_190_000 as Weight) - // Standard Error: 1_000 + (74_497_000 as Weight) + // Standard Error: 3_000 .saturating_add((1_359_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64ges(r: u32, ) -> Weight { - (73_803_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_370_000 as Weight).saturating_mul(r as Weight)) + (74_275_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_354_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64geu(r: u32, ) -> Weight { - (74_063_000 as Weight) - // Standard Error: 1_000 + (74_349_000 as Weight) + // Standard Error: 3_000 .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64add(r: u32, ) -> Weight { - (73_750_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_345_000 as Weight).saturating_mul(r as Weight)) + (74_192_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_333_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64sub(r: u32, ) -> Weight { - (73_979_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_341_000 as Weight).saturating_mul(r as Weight)) + (74_271_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_340_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64mul(r: u32, ) -> Weight { - (74_197_000 as Weight) - // Standard Error: 4_000 - .saturating_add((1_332_000 as Weight).saturating_mul(r as Weight)) + (73_971_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_340_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64divs(r: u32, ) -> Weight { - (73_624_000 as Weight) - // Standard Error: 5_000 - .saturating_add((2_020_000 as Weight).saturating_mul(r as Weight)) + (74_546_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_995_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64divu(r: u32, ) -> Weight { - (74_074_000 as Weight) + (74_194_000 as Weight) // Standard Error: 2_000 .saturating_add((2_050_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rems(r: u32, ) -> Weight { - (73_766_000 as Weight) - // Standard Error: 5_000 - .saturating_add((2_016_000 as Weight).saturating_mul(r as Weight)) + (74_106_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_997_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64remu(r: u32, ) -> Weight { - (73_978_000 as Weight) - // Standard Error: 3_000 - .saturating_add((2_064_000 as Weight).saturating_mul(r as Weight)) + (74_219_000 as Weight) + // Standard Error: 5_000 + .saturating_add((2_061_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64and(r: u32, ) -> Weight { - (73_996_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_336_000 as Weight).saturating_mul(r as Weight)) + (74_157_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_338_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64or(r: u32, ) -> Weight { - (74_058_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_335_000 as Weight).saturating_mul(r as Weight)) + (74_135_000 as Weight) + // Standard Error: 1_000 + .saturating_add((1_336_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64xor(r: u32, ) -> Weight { - (73_983_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_337_000 as Weight).saturating_mul(r as Weight)) + (74_038_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_345_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shl(r: u32, ) -> Weight { - (74_061_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_351_000 as Weight).saturating_mul(r as Weight)) + (74_011_000 as Weight) + // Standard Error: 3_000 + .saturating_add((1_362_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shrs(r: u32, ) -> Weight { - (73_940_000 as Weight) - // Standard Error: 5_000 - .saturating_add((1_360_000 as Weight).saturating_mul(r as Weight)) + (74_054_000 as Weight) + // Standard Error: 2_000 + .saturating_add((1_356_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64shru(r: u32, ) -> Weight { - (73_954_000 as Weight) + (73_900_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_359_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_358_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rotl(r: u32, ) -> Weight { - (74_026_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_354_000 as Weight).saturating_mul(r as Weight)) + (73_948_000 as Weight) + // Standard Error: 0 + .saturating_add((1_357_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rotr(r: u32, ) -> Weight { - (74_149_000 as Weight) + (73_972_000 as Weight) // Standard Error: 1_000 - .saturating_add((1_352_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((1_358_000 as Weight).saturating_mul(r as Weight)) } } From 6236bda08c116c59ca1ba21318b9f8dc51e6b990 Mon Sep 17 00:00:00 2001 From: Alexander Gryaznov Date: Thu, 24 Mar 2022 21:33:42 +0200 Subject: [PATCH 21/21] removed `seal_origin` from API --- frame/contracts/src/benchmarking/mod.rs | 8 ---- frame/contracts/src/exec.rs | 44 --------------------- frame/contracts/src/schedule.rs | 4 -- frame/contracts/src/wasm/mod.rs | 51 ------------------------- frame/contracts/src/wasm/runtime.rs | 18 --------- frame/contracts/src/weights.rs | 23 ----------- 6 files changed, 148 deletions(-) diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index 90f89f854eb92..de83f51a01528 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -509,14 +509,6 @@ benchmarks! { let origin = RawOrigin::Signed(instance.caller.clone()); }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) - seal_origin { - let r in 0 .. API_BENCHMARK_BATCHES; - let instance = Contract::::new(WasmModule::getter( - "__unstable__", "seal_origin", r * API_BENCHMARK_BATCH_SIZE - ), 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/exec.rs b/frame/contracts/src/exec.rs index 38034a6a59a90..e73b29e54378b 100644 --- a/frame/contracts/src/exec.rs +++ b/frame/contracts/src/exec.rs @@ -176,9 +176,6 @@ pub trait Ext: sealing::Sealed { /// However, this function does not require any storage lookup and therefore uses less weight. fn caller_is_origin(&self) -> bool; - /// Returns the address of the origin of the whole call stack. - fn origin(&self) -> &AccountIdOf; - /// Returns a reference to the account id of the current contract. fn address(&self) -> &AccountIdOf; @@ -1126,10 +1123,6 @@ where self.caller() == &self.origin } - fn origin(&self) -> &AccountIdOf { - &self.origin - } - fn balance(&self) -> BalanceOf { T::Currency::free_balance(&self.top_frame().account_id) } @@ -1867,43 +1860,6 @@ mod tests { }); } - #[test] - fn origin_returns_proper_values() { - let code_charlie = MockLoader::insert(Call, |ctx, _| { - // BOB is caller but not the origin of the stack call - assert_eq!(ctx.ext.caller(), &BOB); - // ALICE is the origin of the call stack - assert_eq!(ctx.ext.origin(), &ALICE); - exec_success() - }); - - let code_bob = MockLoader::insert(Call, |ctx, _| { - // ALICE is the origin of the call stack - assert_eq!(ctx.ext.origin(), &ALICE); - assert_eq!(ctx.ext.caller(), &ALICE); - // BOB calls CHARLIE - ctx.ext.call(0, CHARLIE, 0, vec![], 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 -> BOB: (origin is ALICE) -> CHARLIE (origin is still ALICE) - let result = MockStack::run_call( - ALICE, - BOB, - &mut GasMeter::::new(GAS_LIMIT), - &mut storage_meter, - &schedule, - 0, - vec![0], - None, - ); - assert_matches!(result, Ok(_)); - }); - } - #[test] fn address_returns_proper_values() { let bob_ch = MockLoader::insert(Call, |ctx, _| { diff --git a/frame/contracts/src/schedule.rs b/frame/contracts/src/schedule.rs index 0e13df7f80622..b0c58d721d578 100644 --- a/frame/contracts/src/schedule.rs +++ b/frame/contracts/src/schedule.rs @@ -274,9 +274,6 @@ pub struct HostFnWeights { /// Weight of calling `seal_caller_is_origin`. pub caller_is_origin: Weight, - /// Weight of calling `seal_origin`. - pub origin: Weight, - /// Weight of calling `seal_address`. pub address: Weight, @@ -596,7 +593,6 @@ impl Default for HostFnWeights { code_hash: cost_batched!(seal_code_hash), own_code_hash: cost_batched!(seal_own_code_hash), caller_is_origin: cost_batched!(seal_caller_is_origin), - origin: cost_batched!(seal_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/mod.rs b/frame/contracts/src/wasm/mod.rs index 34a2f34d4b5cf..c38613cb68102 100644 --- a/frame/contracts/src/wasm/mod.rs +++ b/frame/contracts/src/wasm/mod.rs @@ -448,9 +448,6 @@ mod tests { fn caller_is_origin(&self) -> bool { false } - fn origin(&self) -> &AccountIdOf { - &ALICE - } fn address(&self) -> &AccountIdOf { &BOB } @@ -2509,54 +2506,6 @@ mod tests { ); } - #[test] - #[cfg(feature = "unstable-interface")] - fn origin_works() { - /// calls `seal_origin` and compares the result with the constant (ALICE's address part). - const CODE_ORIGIN: &str = r#" -(module - (import "__unstable__" "seal_origin" (func $seal_origin (param i32 i32))) - (import "env" "memory" (memory 1 1)) - - ;; size of our buffer is 32 bytes - (data (i32.const 32) "\20") - - (func $assert (param i32) - (block $ok - (br_if $ok - (get_local 0) - ) - (unreachable) - ) - ) - - (func (export "call") - ;; fill the buffer with the origin address. - (call $seal_origin (i32.const 0) (i32.const 32)) - - ;; assert size == 32 - (call $assert - (i32.eq - (i32.load (i32.const 32)) - (i32.const 32) - ) - ) - - ;; assert that the first 8 bytes are the beginning of "ALICE" - (call $assert - (i64.eq - (i64.load (i32.const 0)) - (i64.const 0x0101010101010101) - ) - ) - ) - - (func (export "deploy")) -) -"#; - assert_ok!(execute(CODE_ORIGIN, vec![], MockExt::default())); - } - #[test] #[cfg(feature = "unstable-interface")] fn set_code_hash() { diff --git a/frame/contracts/src/wasm/runtime.rs b/frame/contracts/src/wasm/runtime.rs index 3a3729e64d22c..975cfcdd12db8 100644 --- a/frame/contracts/src/wasm/runtime.rs +++ b/frame/contracts/src/wasm/runtime.rs @@ -152,9 +152,6 @@ pub enum RuntimeCosts { OwnCodeHash, /// Weight of calling `seal_caller_is_origin`. CallerIsOrigin, - /// Weight of calling `seal_origin`. - #[cfg(feature = "unstable-interface")] - Origin, /// Weight of calling `seal_address`. Address, /// Weight of calling `seal_gas_left`. @@ -248,8 +245,6 @@ impl RuntimeCosts { #[cfg(feature = "unstable-interface")] OwnCodeHash => s.own_code_hash, CallerIsOrigin => s.caller_is_origin, - #[cfg(feature = "unstable-interface")] - Origin => s.origin, Address => s.address, GasLeft => s.gas_left, Balance => s.balance, @@ -1439,19 +1434,6 @@ define_env!(Env, , Ok(ctx.ext.caller_is_origin() as u32) }, - // Stores the address of the origin of the whole call stack into the supplied buffer. - // - // The value is stored to linear memory at the address pointed to by `out_ptr`. - // `out_len_ptr` must point to a u32 value that describes the available space at - // `out_ptr`. This call overwrites it with the size of the value. If the available - // space at `out_ptr` is less than the size of the value a trap is triggered. - [__unstable__] seal_origin(ctx, out_ptr: u32, out_len_ptr: u32) => { - ctx.charge_gas(RuntimeCosts::Origin)?; - Ok(ctx.write_sandbox_output( - out_ptr, out_len_ptr, &ctx.ext.origin().encode(), false, already_charged - )?) - }, - // 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 84937355cbe61..43f00196ab3b2 100644 --- a/frame/contracts/src/weights.rs +++ b/frame/contracts/src/weights.rs @@ -59,7 +59,6 @@ pub trait WeightInfo { fn seal_code_hash(r: u32, ) -> Weight; fn seal_own_code_hash(r: u32, ) -> Weight; fn seal_caller_is_origin(r: u32, ) -> Weight; - fn seal_origin(r: u32, ) -> Weight; fn seal_address(r: u32, ) -> Weight; fn seal_gas_left(r: u32, ) -> Weight; fn seal_balance(r: u32, ) -> Weight; @@ -320,17 +319,6 @@ 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_origin(r: u32, ) -> Weight { - (217_807_000 as Weight) - // Standard Error: 108_000 - .saturating_add((48_063_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 { (219_066_000 as Weight) // Standard Error: 117_000 @@ -1243,17 +1231,6 @@ 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_origin(r: u32, ) -> Weight { - (217_807_000 as Weight) - // Standard Error: 108_000 - .saturating_add((48_063_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 { (219_066_000 as Weight) // Standard Error: 117_000