diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index bf6ea25cb2..2a06b1f993 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -3691,6 +3691,12 @@ dependencies = [ "webrtc-util", ] +[[package]] +name = "intx" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f38a50a899dc47a6d0ed5508e7f601a2e34c3a85303514b5d137f3c10a0c75" + [[package]] name = "io-lifetimes" version = "1.0.11" @@ -13139,10 +13145,12 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.28.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e61a7006b0fdf24f6bbe8dcfdad5ca1b350de80061fb2827f31c82fbbb9565a" +checksum = "e51fb5c61993e71158abf5bb863df2674ca3ec39ed6471c64f07aeaf751d67b4" dependencies = [ + "intx", + "smallvec", "spin 0.9.8", "wasmi_arena", "wasmi_core", diff --git a/substrate/frame/contracts/Cargo.toml b/substrate/frame/contracts/Cargo.toml index 62ea5b9d3c..e784321c38 100644 --- a/substrate/frame/contracts/Cargo.toml +++ b/substrate/frame/contracts/Cargo.toml @@ -26,7 +26,7 @@ serde = { version = "1", optional = true, features = ["derive"] } smallvec = { version = "1", default-features = false, features = [ "const_generics", ] } -wasmi = { version = "0.28", default-features = false } +wasmi = { version = "0.30", default-features = false } wasmparser = { package = "wasmparser-nostd", version = "0.100", default-features = false } impl-trait-for-tuples = "0.2" diff --git a/substrate/frame/contracts/README.md b/substrate/frame/contracts/README.md index 13c5e7253c..2b5fec6ca5 100644 --- a/substrate/frame/contracts/README.md +++ b/substrate/frame/contracts/README.md @@ -13,8 +13,8 @@ This module extends accounts based on the `Currency` trait to have smart-contrac be used with other modules that implement accounts based on `Currency`. These "smart-contract accounts" have the ability to instantiate smart-contracts and make calls to other contract and non-contract accounts. -The smart-contract code is stored once in a `code_cache`, and later retrievable via its `code_hash`. -This means that multiple smart-contracts can be instantiated from the same `code_cache`, without replicating +The smart-contract code is stored once, and later retrievable via its `code_hash`. +This means that multiple smart-contracts can be instantiated from the same `code`, without replicating the code each time. When a smart-contract is called, its associated code is retrieved via the code hash and gets executed. @@ -24,18 +24,17 @@ or call other smart-contracts. Finally, when an account is reaped, its associated code and storage of the smart-contract account will also be deleted. -### Gas +### Weight -Senders must specify a gas limit with every call, as all instructions invoked by the smart-contract require gas. -Unused gas is refunded after the call, regardless of the execution outcome. +Senders must specify a [`Weight`](https://paritytech.github.io/substrate/master/sp_weights/struct.Weight.html) limit with every call, as all instructions invoked by the smart-contract require weight. +Unused weight is refunded after the call, regardless of the execution outcome. -If the gas limit is reached, then all calls and state changes (including balance transfers) are only -reverted at the current call's contract level. For example, if contract A calls B and B runs out of gas mid-call, +If the weight limit is reached, then all calls and state changes (including balance transfers) are only +reverted at the current call's contract level. For example, if contract A calls B and B runs out of weight mid-call, then all of B's calls are reverted. Assuming correct error handling by contract A, A's other calls and state changes still persist. -One gas is equivalent to one [weight](https://docs.substrate.io/v3/runtime/weights-and-fees) -which is defined as one picosecond of execution time on the runtime's reference machine. +One `ref_time` `Weight` is defined as one picosecond of execution time on the runtime's reference machine. ### Revert Behaviour @@ -43,29 +42,26 @@ Contract call failures are not cascading. When failures occur in a sub-call, the and the call will only revert at the specific contract level. For example, if contract A calls contract B, and B fails, A can decide how to handle that failure, either proceeding or reverting A's changes. -### Offchain Execution +### Off-chain Execution In general, a contract execution needs to be deterministic so that all nodes come to the same conclusion when executing it. To that end we disallow any instructions that could cause indeterminism. Most notable are any floating point arithmetic. That said, sometimes contracts are executed off-chain and hence are not subject to consensus. If code is only executed by a single node and implicitly trusted by other actors is such a case. Trusted execution environments -come to mind. To that end we allow the execution of indeterminstic code for offchain usages +come to mind. To that end we allow the execution of indeterminstic code for off-chain usages with the following constraints: 1. No contract can ever be instantiated from an indeterministic code. The only way to execute the code is to use a delegate call from a deterministic contract. -2. The code that wants to use this feature needs to depend on `pallet-contracts` and use `bare_call` +2. The code that wants to use this feature needs to depend on `pallet-contracts` and use [`bare_call()`](https://paritytech.github.io/substrate/master/pallet_contracts/pallet/struct.Pallet.html#method.bare_call) directly. This makes sure that by default `pallet-contracts` does not expose any indeterminism. -## How to use - -When setting up the `Schedule` for your runtime make sure to set `InstructionWeights::fallback` -to a non zero value. The default is `0` and prevents the upload of any non deterministic code. +#### How to use An indeterministic code can be deployed on-chain by passing `Determinism::Relaxed` -to `upload_code`. A deterministic contract can then delegate call into it if and only if it -is ran by using `bare_call` and passing `Determinism::Relaxed` to it. **Never use +to [`upload_code()`](https://paritytech.github.io/substrate/master/pallet_contracts/pallet/struct.Pallet.html#method.upload_code). A deterministic contract can then delegate call into it if and only if it +is ran by using [`bare_call()`](https://paritytech.github.io/substrate/master/pallet_contracts/pallet/struct.Pallet.html#method.bare_call) and passing [`Determinism::Relaxed`](https://paritytech.github.io/substrate/master/pallet_contracts/enum.Determinism.html#variant.Relaxed) to it. **Never use this argument when the contract is called from an on-chain transaction.** ## Interface @@ -99,24 +95,22 @@ Each contract is one WebAssembly module that looks like this: ``` The documentation of all importable functions can be found -[here](https://github.com/paritytech/substrate/blob/master/frame/contracts/src/wasm/runtime.rs). -Look for the `define_env!` macro invocation. +[here](https://paritytech.github.io/substrate/master/pallet_contracts/api_doc/trait.Current.html). ## Usage This module executes WebAssembly smart contracts. These can potentially be written in any language -that compiles to web assembly. However, using a language that specifically targets this module -will make things a lot easier. One such language is [`ink!`](https://use.ink) -which is an [`eDSL`](https://wiki.haskell.org/Embedded_domain_specific_language) that enables -writing WebAssembly based smart contracts in the Rust programming language. +that compiles to Wasm. However, using a language that specifically targets this module +will make things a lot easier. One such language is [`ink!`](https://use.ink). It enables +writing WebAssembly-based smart-contracts in the Rust programming language. ## Debugging -Contracts can emit messages to the client when called as RPC through the `seal_debug_message` +Contracts can emit messages to the client when called as RPC through the [`debug_message`](https://paritytech.github.io/substrate/master/pallet_contracts/api_doc/trait.Current.html#tymethod.debug_message) API. This is exposed in [ink!](https://use.ink) via [`ink_env::debug_message()`](https://paritytech.github.io/ink/ink_env/fn.debug_message.html). -Those messages are gathered into an internal buffer and send to the RPC client. +Those messages are gathered into an internal buffer and sent to the RPC client. It is up the the individual client if and how those messages are presented to the user. This buffer is also printed as a debug message. In order to see these messages on the node @@ -154,11 +148,11 @@ this pallet contains the concept of an unstable interface. Akin to the rust nigh it allows us to add new interfaces but mark them as unstable so that contract languages can experiment with them and give feedback before we stabilize those. -In order to access interfaces marked as `#[unstable]` in `runtime.rs` one need to set -`pallet_contracts::Config::UnsafeUnstableInterface` to `ConstU32`. It should be obvious +In order to access interfaces marked as `#[unstable]` in [`runtime.rs`](src/wasm/runtime.rs) one need to set +`pallet_contracts::Config::UnsafeUnstableInterface` to `ConstU32`. **It should be obvious that any production runtime should never be compiled with this feature: In addition to be subject to change or removal those interfaces might not have proper weights associated with -them and are therefore considered unsafe. +them and are therefore considered unsafe**. New interfaces are generally added as unstable and might go through several iterations before they are promoted to a stable interface. diff --git a/substrate/frame/contracts/fixtures/seal_input_noop.wat b/substrate/frame/contracts/fixtures/seal_input_noop.wat new file mode 100644 index 0000000000..7b5a1e32af --- /dev/null +++ b/substrate/frame/contracts/fixtures/seal_input_noop.wat @@ -0,0 +1,14 @@ +;; Everything prepared for the host function call, but no call is performed. +(module + (import "seal0" "seal_input" (func $seal_input (param i32 i32))) + (import "env" "memory" (memory 1 1)) + + ;; [0, 8) buffer to write input + + ;; [8, 12) size of the input buffer + (data (i32.const 8) "\04") + + (func (export "call")) + + (func (export "deploy")) +) diff --git a/substrate/frame/contracts/fixtures/seal_input_once.wat b/substrate/frame/contracts/fixtures/seal_input_once.wat new file mode 100644 index 0000000000..919a03a9b6 --- /dev/null +++ b/substrate/frame/contracts/fixtures/seal_input_once.wat @@ -0,0 +1,22 @@ +;; Stores a value of the passed size. The host function is called once. +(module + (import "seal0" "seal_input" (func $seal_input (param i32 i32))) + (import "env" "memory" (memory 1 1)) + + ;; [0, 8) buffer to write input + + ;; [8, 12) size of the input buffer + (data (i32.const 8) "\04") + + (func (export "call") + ;; instructions to consume engine fuel + (drop + (i32.const 42) + ) + + (call $seal_input (i32.const 0) (i32.const 8)) + + ) + + (func (export "deploy")) +) diff --git a/substrate/frame/contracts/fixtures/seal_input_twice.wat b/substrate/frame/contracts/fixtures/seal_input_twice.wat new file mode 100644 index 0000000000..3a8be814ef --- /dev/null +++ b/substrate/frame/contracts/fixtures/seal_input_twice.wat @@ -0,0 +1,28 @@ +;; Stores a value of the passed size. The host function is called twice. +(module + (import "seal0" "seal_input" (func $seal_input (param i32 i32))) + (import "env" "memory" (memory 1 1)) + + ;; [0, 8) buffer to write input + + ;; [8, 12) size of the input buffer + (data (i32.const 8) "\04") + + (func (export "call") + ;; instructions to consume engine fuel + (drop + (i32.const 42) + ) + + (call $seal_input (i32.const 0) (i32.const 8)) + + ;; instructions to consume engine fuel + (drop + (i32.const 42) + ) + + (call $seal_input (i32.const 0) (i32.const 8)) + ) + + (func (export "deploy")) +) diff --git a/substrate/frame/contracts/proc-macro/src/lib.rs b/substrate/frame/contracts/proc-macro/src/lib.rs index a6a8187bc8..b31403c29a 100644 --- a/substrate/frame/contracts/proc-macro/src/lib.rs +++ b/substrate/frame/contracts/proc-macro/src/lib.rs @@ -624,19 +624,15 @@ fn expand_functions(def: &EnvDef, expand_blocks: bool, host_state: TokenStream2) let trace_fmt_str = format!("{}::{}({}) = {{:?}}\n", module, name, params_fmt_str); quote! { + let result = #body; if ::log::log_enabled!(target: "runtime::contracts::strace", ::log::Level::Trace) { - let result = #body; - { use sp_std::fmt::Write; let mut w = sp_std::Writer::default(); let _ = core::write!(&mut w, #trace_fmt_str, #( #trace_fmt_args, )* result); let msg = core::str::from_utf8(&w.inner()).unwrap_or_default(); ctx.ext().append_debug_buffer(msg); - } - result - } else { - #body } + result } }; @@ -661,7 +657,7 @@ fn expand_functions(def: &EnvDef, expand_blocks: bool, host_state: TokenStream2) ::core::unreachable!() } } }; - let map_err = if expand_blocks { + let into_host = if expand_blocks { quote! { |reason| { ::wasmi::core::Trap::from(reason) @@ -677,6 +673,43 @@ fn expand_functions(def: &EnvDef, expand_blocks: bool, host_state: TokenStream2) } else { quote! { #[allow(unused_variables)] } }; + let sync_gas_before = if expand_blocks { + quote! { + // Gas left in the gas meter right before switching to engine execution. + let __gas_before__ = { + let engine_consumed_total = + __caller__.fuel_consumed().expect("Fuel metering is enabled; qed"); + let gas_meter = __caller__.data_mut().ext().gas_meter_mut(); + gas_meter + .charge_fuel(engine_consumed_total) + .map_err(TrapReason::from) + .map_err(#into_host)? + .ref_time() + }; + } + } else { + quote! { } + }; + // Gas left in the gas meter right after returning from engine execution. + let sync_gas_after = if expand_blocks { + quote! { + let mut gas_after = __caller__.data_mut().ext().gas_meter().gas_left().ref_time(); + let mut host_consumed = __gas_before__.saturating_sub(gas_after); + // Possible undercharge of at max 1 fuel here, if host consumed less than `instruction_weights.base` + // Not a problem though, as soon as host accounts its spent gas properly. + let fuel_consumed = host_consumed + .checked_div(__caller__.data_mut().ext().schedule().instruction_weights.base as u64) + .ok_or(Error::::InvalidSchedule) + .map_err(TrapReason::from) + .map_err(#into_host)?; + __caller__ + .consume_fuel(fuel_consumed) + .map_err(|_| TrapReason::from(Error::::OutOfGas)) + .map_err(#into_host)?; + } + } else { + quote! { } + }; quote! { // We need to allow all interfaces when runtime benchmarks are performed because @@ -688,10 +721,11 @@ fn expand_functions(def: &EnvDef, expand_blocks: bool, host_state: TokenStream2) { #allow_unused linker.define(#module, #name, ::wasmi::Func::wrap(&mut*store, |mut __caller__: ::wasmi::Caller<#host_state>, #( #params, )*| -> #wasm_output { + #sync_gas_before let mut func = #inner; - func() - .map_err(#map_err) - .map(::core::convert::Into::into) + let result = func().map_err(#into_host).map(::core::convert::Into::into); + #sync_gas_after + result }))?; } } diff --git a/substrate/frame/contracts/src/benchmarking/code.rs b/substrate/frame/contracts/src/benchmarking/code.rs index 07f24f385b..027c17c1d6 100644 --- a/substrate/frame/contracts/src/benchmarking/code.rs +++ b/substrate/frame/contracts/src/benchmarking/code.rs @@ -24,18 +24,15 @@ //! we define this simple definition of a contract that can be passed to `create_code` that //! compiles it down into a `WasmModule` that can be used as a contract's code. -use crate::{Config, Determinism}; +use crate::Config; use frame_support::traits::Get; use sp_runtime::traits::Hash; use sp_std::{borrow::ToOwned, prelude::*}; -use wasm_instrument::{ - gas_metering, - parity_wasm::{ - builder, - elements::{ - self, BlockType, CustomSection, External, FuncBody, Instruction, Instructions, Module, - Section, ValueType, - }, +use wasm_instrument::parity_wasm::{ + builder, + elements::{ + self, BlockType, CustomSection, External, FuncBody, Instruction, Instructions, Module, + Section, ValueType, }, }; @@ -240,15 +237,9 @@ impl From for WasmModule { } impl WasmModule { - /// Uses the supplied wasm module and instruments it when requested. - pub fn instrumented(code: &[u8], inject_gas: bool) -> Self { - let module = { - let mut module = Module::from_bytes(code).unwrap(); - if inject_gas { - module = inject_gas_metering::(module); - } - module - }; + /// Uses the supplied wasm module. + pub fn from_code(code: &[u8]) -> Self { + let module = Module::from_bytes(code).unwrap(); let limits = *module .import_section() .unwrap() @@ -366,37 +357,13 @@ impl WasmModule { } .into() } - - pub fn unary_instr(instr: Instruction, repeat: u32) -> Self { - use body::DynInstr::{RandomI64Repeated, Regular}; - ModuleDefinition { - call_body: Some(body::repeated_dyn( - repeat, - vec![RandomI64Repeated(1), Regular(instr), Regular(Instruction::Drop)], - )), - ..Default::default() - } - .into() - } - - pub fn binary_instr(instr: Instruction, repeat: u32) -> Self { - use body::DynInstr::{RandomI64Repeated, Regular}; - ModuleDefinition { - call_body: Some(body::repeated_dyn( - repeat, - vec![RandomI64Repeated(2), Regular(instr), Regular(Instruction::Drop)], - )), - ..Default::default() - } - .into() - } } /// Mechanisms to generate a function body that can be used inside a `ModuleDefinition`. pub mod body { use super::*; - /// When generating contract code by repeating a wasm sequence, it's sometimes necessary + /// When generating contract code by repeating a Wasm sequence, it's sometimes necessary /// to change those instructions on each repetition. The variants of this enum describe /// various ways in which this can happen. pub enum DynInstr { @@ -405,31 +372,8 @@ pub mod body { /// Insert a I32Const with incrementing value for each insertion. /// (start_at, increment_by) Counter(u32, u32), - /// Insert a I32Const with a random value in [low, high) not divisible by two. - /// (low, high) - RandomUnaligned(u32, u32), - /// Insert a I32Const with a random value in [low, high). - /// (low, high) - RandomI32(i32, i32), - /// Insert the specified amount of I32Const with a random value. - RandomI32Repeated(usize), /// Insert the specified amount of I64Const with a random value. RandomI64Repeated(usize), - /// Insert a GetLocal with a random offset in [low, high). - /// (low, high) - RandomGetLocal(u32, u32), - /// Insert a SetLocal with a random offset in [low, high). - /// (low, high) - RandomSetLocal(u32, u32), - /// Insert a TeeLocal with a random offset in [low, high). - /// (low, high) - RandomTeeLocal(u32, u32), - /// Insert a GetGlobal with a random offset in [low, high). - /// (low, high) - RandomGetGlobal(u32, u32), - /// Insert a SetGlobal with a random offset in [low, high). - /// (low, high) - RandomSetGlobal(u32, u32), } pub fn plain(instructions: Vec) -> FuncBody { @@ -466,53 +410,16 @@ pub mod body { *offset += *increment_by; vec![Instruction::I32Const(current as i32)] }, - DynInstr::RandomUnaligned(low, high) => { - let unaligned = rng.gen_range(*low..*high) | 1; - vec![Instruction::I32Const(unaligned as i32)] - }, - DynInstr::RandomI32(low, high) => { - vec![Instruction::I32Const(rng.gen_range(*low..*high))] - }, - DynInstr::RandomI32Repeated(num) => - (&mut rng).sample_iter(Standard).take(*num).map(Instruction::I32Const).collect(), DynInstr::RandomI64Repeated(num) => (&mut rng).sample_iter(Standard).take(*num).map(Instruction::I64Const).collect(), - DynInstr::RandomGetLocal(low, high) => { - vec![Instruction::GetLocal(rng.gen_range(*low..*high))] - }, - DynInstr::RandomSetLocal(low, high) => { - vec![Instruction::SetLocal(rng.gen_range(*low..*high))] - }, - DynInstr::RandomTeeLocal(low, high) => { - vec![Instruction::TeeLocal(rng.gen_range(*low..*high))] - }, - DynInstr::RandomGetGlobal(low, high) => { - vec![Instruction::GetGlobal(rng.gen_range(*low..*high))] - }, - DynInstr::RandomSetGlobal(low, high) => { - vec![Instruction::SetGlobal(rng.gen_range(*low..*high))] - }, }) .chain(sp_std::iter::once(Instruction::End)) .collect(); FuncBody::new(Vec::new(), Instructions::new(body)) } - - /// Replace the locals of the supplied `body` with `num` i64 locals. - pub fn inject_locals(body: &mut FuncBody, num: u32) { - use self::elements::Local; - *body.locals_mut() = vec![Local::new(num, ValueType::I64)]; - } } /// The maximum amount of pages any contract is allowed to have according to the current `Schedule`. pub fn max_pages() -> u32 { T::Schedule::get().limits.memory_pages } - -fn inject_gas_metering(module: Module) -> Module { - let schedule = T::Schedule::get(); - let gas_rules = schedule.rules(Determinism::Enforced); - let backend = gas_metering::host_function::Injector::new("seal0", "gas"); - gas_metering::inject(module, backend, &gas_rules).unwrap() -} diff --git a/substrate/frame/contracts/src/benchmarking/mod.rs b/substrate/frame/contracts/src/benchmarking/mod.rs index 3eb5e8ed2f..11683456f0 100644 --- a/substrate/frame/contracts/src/benchmarking/mod.rs +++ b/substrate/frame/contracts/src/benchmarking/mod.rs @@ -30,7 +30,7 @@ use self::{ }; use crate::{ exec::{AccountIdOf, Key}, - migration::{v10, v11, v9, MigrationStep}, + migration::{v10, v11, v12, v9, MigrationStep}, wasm::CallFlags, Pallet as Contracts, *, }; @@ -38,12 +38,9 @@ use codec::{Encode, MaxEncodedLen}; use frame_benchmarking::v1::{account, benchmarks, whitelisted_caller}; use frame_support::{pallet_prelude::StorageVersion, weights::Weight}; use frame_system::RawOrigin; -use sp_runtime::{ - traits::{Bounded, Hash}, - Perbill, -}; +use sp_runtime::traits::{Bounded, Hash}; use sp_std::prelude::*; -use wasm_instrument::parity_wasm::elements::{BlockType, BrTableData, Instruction, ValueType}; +use wasm_instrument::parity_wasm::elements::{BlockType, Instruction, ValueType}; /// How many runs we do per API benchmark. /// @@ -162,16 +159,12 @@ where /// Returns `true` iff all storage entries related to code storage exist. fn code_exists(hash: &CodeHash) -> bool { - >::contains_key(hash) && - >::contains_key(&hash) && - >::contains_key(&hash) + >::contains_key(hash) && >::contains_key(&hash) } /// Returns `true` iff no storage entry related to code storage exist. fn code_removed(hash: &CodeHash) -> bool { - !>::contains_key(hash) && - !>::contains_key(&hash) && - !>::contains_key(&hash) + !>::contains_key(hash) && !>::contains_key(&hash) } } @@ -219,22 +212,7 @@ benchmarks! { ContractInfo::::process_deletion_queue_batch(Weight::MAX) } - // This benchmarks the additional weight that is charged when a contract is executed the - // first time after a new schedule was deployed: For every new schedule a contract needs - // to re-run the instrumentation once. - #[pov_mode = Measured] - reinstrument { - let c in 0 .. Perbill::from_percent(49).mul_ceil(T::MaxCodeLen::get()); - let WasmModule { code, hash, .. } = WasmModule::::sized(c, Location::Call); - Contracts::::store_code_raw(code, whitelisted_caller())?; - let schedule = T::Schedule::get(); - let mut gas_meter = GasMeter::new(Weight::MAX); - let mut module = PrefabWasmModule::from_storage(hash, &schedule, &mut gas_meter)?; - }: { - Contracts::::reinstrument_module(&mut module, &schedule)?; - } - - // This benchmarks the v9 migration step. (update codeStorage) + // This benchmarks the v9 migration step (update codeStorage). #[pov_mode = Measured] v9_migration_step { let c in 0 .. T::MaxCodeLen::get(); @@ -244,7 +222,7 @@ benchmarks! { m.step(); } - // This benchmarks the v10 migration step. (use dedicated deposit_account) + // This benchmarks the v10 migration step (use dedicated deposit_account). #[pov_mode = Measured] v10_migration_step { let contract = >::with_caller( @@ -257,7 +235,7 @@ benchmarks! { m.step(); } - // This benchmarks the v11 migration step. + // This benchmarks the v11 migration step (Don't rely on reserved balances keeping an account alive). #[pov_mode = Measured] v11_migration_step { let k in 0 .. 1024; @@ -267,6 +245,18 @@ benchmarks! { m.step(); } + // This benchmarks the v12 migration step (Move `OwnerInfo` to `CodeInfo`, + // add `determinism` field to the latter, clear `CodeStorage` + // and repay deposits). + #[pov_mode = Measured] + v12_migration_step { + let c in 0 .. T::MaxCodeLen::get(); + v12::store_old_dummy_code::(c as usize, account::("account", 0, 0)); + let mut m = v12::Migration::::default(); + }: { + m.step(); + } + // This benchmarks the weight of executing Migration::migrate to execute a noop migration. #[pov_mode = Measured] migration_noop { @@ -348,14 +338,9 @@ benchmarks! { // `c`: Size of the code in bytes. // `i`: Size of the input in bytes. // `s`: Size of the salt in bytes. - // - // # Note - // - // We cannot let `c` grow to the maximum code size because the code is not allowed - // to be larger than the maximum size **after instrumentation**. #[pov_mode = Measured] instantiate_with_code { - let c in 0 .. Perbill::from_percent(49).mul_ceil(T::MaxCodeLen::get()); + let c in 0 .. T::MaxCodeLen::get(); let i in 0 .. code::max_pages::() * 64 * 1024; let s in 0 .. code::max_pages::() * 64 * 1024; let input = vec![42u8; i as usize]; @@ -445,14 +430,9 @@ benchmarks! { // This constructs a contract that is maximal expensive to instrument. // It creates a maximum number of metering blocks per byte. // `c`: Size of the code in bytes. - // - // # Note - // - // We cannot let `c` grow to the maximum code size because the code is not allowed - // to be larger than the maximum size **after instrumentation**. #[pov_mode = Measured] upload_code { - let c in 0 .. Perbill::from_percent(49).mul_ceil(T::MaxCodeLen::get()); + let c in 0 .. T::MaxCodeLen::get(); let caller = whitelisted_caller(); T::Currency::make_free_balance_be(&caller, caller_funding::()); let WasmModule { code, hash, .. } = WasmModule::::sized(c, Location::Call); @@ -466,7 +446,7 @@ benchmarks! { // Removing code does not depend on the size of the contract because all the information // needed to verify the removal claim (refcount, owner) is stored in a separate storage - // item (`OwnerInfoOf`). + // item (`CodeInfoOf`). #[pov_mode = Measured] remove_code { let caller = whitelisted_caller(); @@ -736,27 +716,6 @@ benchmarks! { let origin = RawOrigin::Signed(instance.caller.clone()); }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) - #[pov_mode = Measured] - seal_gas { - let r in 0 .. API_BENCHMARK_RUNS; - let code = WasmModule::::from(ModuleDefinition { - imported_functions: vec![ImportedFunction { - module: "seal0", - name: "gas", - params: vec![ValueType::I64], - return_type: None, - }], - call_body: Some(body::repeated(r, &[ - Instruction::I64Const(42), - Instruction::Call(0), - ])), - .. 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![]) - #[pov_mode = Measured] seal_input { let r in 0 .. API_BENCHMARK_RUNS; @@ -1051,7 +1010,7 @@ benchmarks! { // or maximum allowed debug buffer size, whichever is less. let i in 0 .. (T::Schedule::get().limits.memory_pages * 64 * 1024).min(T::MaxDebugBufferLen::get()); // We benchmark versus messages containing printable ASCII codes. - // About 1Kb goes to the instrumented contract code instructions, + // About 1Kb goes to the contract code instructions, // whereas all the space left we use for the initialization of the debug messages data. let message = (0 .. T::MaxCodeLen::get() - 1024).zip((32..127).cycle()).map(|i| i.1).collect::>(); let code = WasmModule::::from(ModuleDefinition { @@ -2445,15 +2404,10 @@ benchmarks! { }: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![]) // We make the assumption that pushing a constant and dropping a value takes roughly - // the same amount of time. We follow that `t.load` and `drop` both have the weight - // of this benchmark / 2. We need to make this assumption because there is no way - // to measure them on their own using a valid wasm module. We need their individual - // values to derive the weight of individual instructions (by subtraction) from - // benchmarks that include those for parameter pushing and return type dropping. - // We call the weight of `t.load` and `drop`: `w_param`. + // the same amount of time. We call this weight `w_base`. // The weight that would result from the respective benchmark we call: `w_bench`. // - // w_i{32,64}const = w_drop = w_bench / 2 + // w_base = w_i{32,64}const = w_drop = w_bench / 2 #[pov_mode = Ignored] instr_i64const { let r in 0 .. INSTR_BENCHMARK_RUNS; @@ -2468,765 +2422,6 @@ benchmarks! { sbox.invoke(); } - // w_i{32,64}load = w_bench - 2 * w_param - #[pov_mode = Ignored] - instr_i64load { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - memory: Some(ImportedMemory::max::()), - call_body: Some(body::repeated_dyn(r, vec![ - RandomUnaligned(0, code::max_pages::() * 64 * 1024 - 8), - Regular(Instruction::I64Load(3, 0)), - Regular(Instruction::Drop), - ])), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // w_i{32,64}store{...} = w_bench - 2 * w_param - #[pov_mode = Ignored] - instr_i64store { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - memory: Some(ImportedMemory::max::()), - call_body: Some(body::repeated_dyn(r, vec![ - RandomUnaligned(0, code::max_pages::() * 64 * 1024 - 8), - RandomI64Repeated(1), - Regular(Instruction::I64Store(3, 0)), - ])), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // w_select = w_bench - 4 * w_param - #[pov_mode = Ignored] - instr_select { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - call_body: Some(body::repeated_dyn(r, vec![ - RandomI64Repeated(1), - RandomI64Repeated(1), - RandomI32(0, 2), - Regular(Instruction::Select), - Regular(Instruction::Drop), - ])), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // w_if = w_bench - 3 * w_param - #[pov_mode = Ignored] - instr_if { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - call_body: Some(body::repeated_dyn(r, vec![ - RandomI32(0, 2), - Regular(Instruction::If(BlockType::Value(ValueType::I64))), - RandomI64Repeated(1), - Regular(Instruction::Else), - RandomI64Repeated(1), - Regular(Instruction::End), - Regular(Instruction::Drop), - ])), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // w_br = w_bench - 2 * w_param - // Block instructions are not counted. - #[pov_mode = Ignored] - instr_br { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - call_body: Some(body::repeated_dyn(r, vec![ - Regular(Instruction::Block(BlockType::NoResult)), - Regular(Instruction::Block(BlockType::NoResult)), - Regular(Instruction::Block(BlockType::NoResult)), - Regular(Instruction::Br(1)), - RandomI64Repeated(1), - Regular(Instruction::Drop), - Regular(Instruction::End), - RandomI64Repeated(1), - Regular(Instruction::Drop), - Regular(Instruction::End), - RandomI64Repeated(1), - Regular(Instruction::Drop), - Regular(Instruction::End), - ])), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // w_br_if = w_bench - 3 * w_param - // Block instructions are not counted. - #[pov_mode = Ignored] - instr_br_if { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - call_body: Some(body::repeated_dyn(r, vec![ - Regular(Instruction::Block(BlockType::NoResult)), - Regular(Instruction::Block(BlockType::NoResult)), - Regular(Instruction::Block(BlockType::NoResult)), - Regular(Instruction::I32Const(1)), - Regular(Instruction::BrIf(1)), - RandomI64Repeated(1), - Regular(Instruction::Drop), - Regular(Instruction::End), - RandomI64Repeated(1), - Regular(Instruction::Drop), - Regular(Instruction::End), - RandomI64Repeated(1), - Regular(Instruction::Drop), - Regular(Instruction::End), - ])), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // w_br_table = w_bench - 3 * w_param - // Block instructions are not counted. - #[pov_mode = Ignored] - instr_br_table { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let table = Box::new(BrTableData { - table: Box::new([1, 1, 1]), - default: 1, - }); - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - call_body: Some(body::repeated_dyn(r, vec![ - Regular(Instruction::Block(BlockType::NoResult)), - Regular(Instruction::Block(BlockType::NoResult)), - Regular(Instruction::Block(BlockType::NoResult)), - RandomI32(0, 4), - Regular(Instruction::BrTable(table)), - RandomI64Repeated(1), - Regular(Instruction::Drop), - Regular(Instruction::End), - RandomI64Repeated(1), - Regular(Instruction::Drop), - Regular(Instruction::End), - RandomI64Repeated(1), - Regular(Instruction::Drop), - Regular(Instruction::End), - ])), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // w_br_table_per_entry = w_bench - #[pov_mode = Ignored] - instr_br_table_per_entry { - let e in 1 .. T::Schedule::get().limits.br_table_size; - let entry: Vec = [0, 1].iter() - .cloned() - .cycle() - .take((e / 2) as usize).collect(); - let table = Box::new(BrTableData { - table: entry.into_boxed_slice(), - default: 0, - }); - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - call_body: Some(body::plain(vec![ - Instruction::Block(BlockType::NoResult), - Instruction::Block(BlockType::NoResult), - Instruction::Block(BlockType::NoResult), - Instruction::I32Const((e / 2) as i32), - Instruction::BrTable(table), - Instruction::I64Const(42), - Instruction::Drop, - Instruction::End, - Instruction::I64Const(42), - Instruction::Drop, - Instruction::End, - Instruction::I64Const(42), - Instruction::Drop, - Instruction::End, - Instruction::End, - ])), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // w_call = w_bench - 2 * w_param - #[pov_mode = Ignored] - instr_call { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - // We need to make use of the stack here in order to trigger stack height - // instrumentation. - aux_body: Some(body::plain(vec![ - Instruction::I64Const(42), - Instruction::Drop, - Instruction::End, - ])), - call_body: Some(body::repeated(r, &[ - Instruction::Call(2), // call aux - ])), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // w_call_indrect = w_bench - 3 * w_param - #[pov_mode = Ignored] - instr_call_indirect { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let num_elements = T::Schedule::get().limits.table_size; - use self::code::TableSegment; - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - // We need to make use of the stack here in order to trigger stack height - // instrumentation. - aux_body: Some(body::plain(vec![ - Instruction::I64Const(42), - Instruction::Drop, - Instruction::End, - ])), - call_body: Some(body::repeated_dyn(r, vec![ - RandomI32(0, num_elements as i32), - Regular(Instruction::CallIndirect(0, 0)), // we only have one sig: 0 - ])), - table: Some(TableSegment { - num_elements, - function_index: 2, // aux - }), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // w_per_local = w_bench - #[pov_mode = Ignored] - instr_call_per_local { - let l in 0 .. T::Schedule::get().limits.locals; - let mut aux_body = body::plain(vec![ - Instruction::End, - ]); - body::inject_locals(&mut aux_body, l); - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - aux_body: Some(aux_body), - call_body: Some(body::plain(vec![ - Instruction::Call(2), // call aux - Instruction::End, - ])), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // w_local_get = w_bench - 1 * w_param - #[pov_mode = Ignored] - instr_local_get { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let max_locals = T::Schedule::get().limits.locals; - let mut call_body = body::repeated_dyn(r, vec![ - RandomGetLocal(0, max_locals), - Regular(Instruction::Drop), - ]); - body::inject_locals(&mut call_body, max_locals); - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - call_body: Some(call_body), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // w_local_set = w_bench - 1 * w_param - #[pov_mode = Ignored] - instr_local_set { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let max_locals = T::Schedule::get().limits.locals; - let mut call_body = body::repeated_dyn(r, vec![ - RandomI64Repeated(1), - RandomSetLocal(0, max_locals), - ]); - body::inject_locals(&mut call_body, max_locals); - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - call_body: Some(call_body), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // w_local_tee = w_bench - 2 * w_param - #[pov_mode = Ignored] - instr_local_tee { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let max_locals = T::Schedule::get().limits.locals; - let mut call_body = body::repeated_dyn(r, vec![ - RandomI64Repeated(1), - RandomTeeLocal(0, max_locals), - Regular(Instruction::Drop), - ]); - body::inject_locals(&mut call_body, max_locals); - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - call_body: Some(call_body), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // w_global_get = w_bench - 1 * w_param - #[pov_mode = Ignored] - instr_global_get { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let max_globals = T::Schedule::get().limits.globals; - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - call_body: Some(body::repeated_dyn(r, vec![ - RandomGetGlobal(0, max_globals), - Regular(Instruction::Drop), - ])), - num_globals: max_globals, - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // w_global_set = w_bench - 1 * w_param - #[pov_mode = Ignored] - instr_global_set { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let max_globals = T::Schedule::get().limits.globals; - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - call_body: Some(body::repeated_dyn(r, vec![ - RandomI64Repeated(1), - RandomSetGlobal(0, max_globals), - ])), - num_globals: max_globals, - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // w_memory_get = w_bench - 1 * w_param - #[pov_mode = Ignored] - instr_memory_current { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - memory: Some(ImportedMemory::max::()), - call_body: Some(body::repeated(r, &[ - Instruction::CurrentMemory(0), - Instruction::Drop - ])), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // w_memory_grow = w_bench - 2 * w_param - // 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. - #[pov_mode = Ignored] - instr_memory_grow { - let r in 0 .. ImportedMemory::max::().max_pages; - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - memory: Some(ImportedMemory { - min_pages: 0, - max_pages: ImportedMemory::max::().max_pages, - }), - call_body: Some(body::repeated(r, &[ - Instruction::I32Const(1), - Instruction::GrowMemory(0), - Instruction::Drop, - ])), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - // Unary numeric instructions. - // All use w = w_bench - 2 * w_param. - - #[pov_mode = Ignored] - instr_i64clz { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::unary_instr( - Instruction::I64Clz, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64ctz { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::unary_instr( - Instruction::I64Ctz, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64popcnt { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::unary_instr( - Instruction::I64Popcnt, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64eqz { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::unary_instr( - Instruction::I64Eqz, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64extendsi32 { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - call_body: Some(body::repeated_dyn(r, vec![ - RandomI32Repeated(1), - Regular(Instruction::I64ExtendSI32), - Regular(Instruction::Drop), - ])), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64extendui32 { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { - call_body: Some(body::repeated_dyn(r, vec![ - RandomI32Repeated(1), - Regular(Instruction::I64ExtendUI32), - Regular(Instruction::Drop), - ])), - .. Default::default() - })); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i32wrapi64 { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::unary_instr( - Instruction::I32WrapI64, - r, - )); - }: { - sbox.invoke(); - } - - // Binary numeric instructions. - // All use w = w_bench - 3 * w_param. - - #[pov_mode = Ignored] - instr_i64eq { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64Eq, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64ne { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64Ne, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64lts { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64LtS, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64ltu { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64LtU, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64gts { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64GtS, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64gtu { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64GtU, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64les { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64LeS, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64leu { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64LeU, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64ges { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64GeS, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64geu { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64GeU, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64add { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64Add, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64sub { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64Sub, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64mul { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64Mul, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64divs { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64DivS, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64divu { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64DivU, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64rems { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64RemS, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64remu { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64RemU, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64and { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64And, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64or { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64Or, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64xor { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64Xor, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64shl { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64Shl, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64shrs { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64ShrS, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64shru { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64ShrU, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64rotl { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64Rotl, - r, - )); - }: { - sbox.invoke(); - } - - #[pov_mode = Ignored] - instr_i64rotr { - let r in 0 .. INSTR_BENCHMARK_RUNS; - let mut sbox = Sandbox::from(&WasmModule::::binary_instr( - Instruction::I64Rotr, - r, - )); - }: { - sbox.invoke(); - } - // This is no benchmark. It merely exist to have an easy way to pretty print the currently // configured `Schedule` during benchmark development. // It can be outputted using the following command: @@ -3250,21 +2445,16 @@ benchmarks! { }: {} // Execute one erc20 transfer using the ink! erc20 example contract. - // - // `g` is used to enable gas instrumentation to compare the performance impact of - // that instrumentation at runtime. #[extra] #[pov_mode = Measured] ink_erc20_transfer { - let g in 0 .. 1; - let gas_metering = g != 0; let code = load_benchmark!("ink_erc20"); let data = { let new: ([u8; 4], BalanceOf) = ([0x9b, 0xae, 0x9d, 0x5e], 1000u32.into()); new.encode() }; let instance = Contract::::new( - WasmModule::instrumented(code, gas_metering), data, + WasmModule::from_code(code), data, )?; let data = { let transfer: ([u8; 4], AccountIdOf, BalanceOf) = ( @@ -3290,14 +2480,9 @@ benchmarks! { } // Execute one erc20 transfer using the open zeppelin erc20 contract compiled with solang. - // - // `g` is used to enable gas instrumentation to compare the performance impact of - // that instrumentation at runtime. #[extra] #[pov_mode = Measured] solang_erc20_transfer { - let g in 0 .. 1; - let gas_metering = g != 0; let code = include_bytes!("../../benchmarks/solang_erc20.wasm"); let caller = account::("instantiator", 0, 0); let mut balance = [0u8; 32]; @@ -3313,7 +2498,7 @@ benchmarks! { new.encode() }; let instance = Contract::::with_caller( - caller, WasmModule::instrumented(code, gas_metering), data, + caller, WasmModule::from_code(code), data, )?; balance[0] = 1; let data = { diff --git a/substrate/frame/contracts/src/benchmarking/sandbox.rs b/substrate/frame/contracts/src/benchmarking/sandbox.rs index 7e28840981..b323c92079 100644 --- a/substrate/frame/contracts/src/benchmarking/sandbox.rs +++ b/substrate/frame/contracts/src/benchmarking/sandbox.rs @@ -15,13 +15,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -/// ! For instruction benchmarking we do no instantiate a full contract but merely the -/// ! sandbox to execute the wasm code. This is because we do not need the full +/// ! For instruction benchmarking we do not instantiate a full contract but merely the +/// ! sandbox to execute the Wasm code. This is because we do not need the full /// ! environment that provides the seal interface as imported functions. use super::{code::WasmModule, Config}; -use crate::wasm::{ - AllowDeprecatedInterface, AllowUnstableInterface, Environment, PrefabWasmModule, -}; +use crate::wasm::{AllowDeprecatedInterface, AllowUnstableInterface, Environment, WasmBlob}; +use sp_core::Get; use wasmi::{errors::LinkerError, Func, Linker, StackLimits, Store}; /// Minimal execution environment without any imported functions. @@ -38,23 +37,24 @@ impl Sandbox { } impl From<&WasmModule> for Sandbox { - /// Creates an instance from the supplied module and supplies as much memory - /// to the instance as the module declares as imported. + /// Creates an instance from the supplied module. + /// Sets the execution engine fuel level to `u64::MAX`. fn from(module: &WasmModule) -> Self { - let memory = module - .memory - .as_ref() - .map(|mem| (mem.min_pages, mem.max_pages)) - .unwrap_or((0, 0)); - let (store, _memory, instance) = PrefabWasmModule::::instantiate::( + let (mut store, _memory, instance) = WasmBlob::::instantiate::( &module.code, (), - memory, + &::Schedule::get(), StackLimits::default(), // We are testing with an empty environment anyways AllowDeprecatedInterface::No, ) .expect("Failed to create benchmarking Sandbox instance"); + + // Set fuel for wasmi execution. + store + .add_fuel(u64::MAX) + .expect("We've set up engine to fuel consuming mode; qed"); + let entry_point = instance.get_export(&store, "call").unwrap().into_func().unwrap(); Self { entry_point, store } } diff --git a/substrate/frame/contracts/src/exec.rs b/substrate/frame/contracts/src/exec.rs index a81a633f74..2bf3f44717 100644 --- a/substrate/frame/contracts/src/exec.rs +++ b/substrate/frame/contracts/src/exec.rs @@ -135,7 +135,7 @@ pub trait Ext: sealing::Sealed { /// Call (possibly transferring some amount of funds) into the specified account. /// - /// Returns the original code size of the called contract. + /// Returns the code size of the called contract. fn call( &mut self, gas_limit: Weight, @@ -148,7 +148,7 @@ pub trait Ext: sealing::Sealed { /// Execute code in the current frame. /// - /// Returns the original code size of the called contract. + /// Returns the code size of the called contract. fn delegate_call( &mut self, code: CodeHash, @@ -159,7 +159,7 @@ pub trait Ext: sealing::Sealed { /// /// Returns the original code size of the called contract. /// The newly created account will be associated with `code`. `value` specifies the amount of - /// value transferred from this to the newly created account. + /// value transferred from the caller to the newly created account. fn instantiate( &mut self, gas_limit: Weight, @@ -263,8 +263,11 @@ pub trait Ext: sealing::Sealed { /// Get a reference to the schedule used by the current call. fn schedule(&self) -> &Schedule; + /// Get an immutable reference to the nested gas meter. + fn gas_meter(&self) -> &GasMeter; + /// Get a mutable reference to the nested gas meter. - fn gas_meter(&mut self) -> &mut GasMeter; + fn gas_meter_mut(&mut self) -> &mut GasMeter; /// Append a string to the debug buffer. /// @@ -325,24 +328,27 @@ pub trait Executable: Sized { /// Load the executable from storage. /// /// # Note - /// Charges size base load and instrumentation weight from the gas meter. + /// Charges size base load weight from the gas meter. fn from_storage( code_hash: CodeHash, - schedule: &Schedule, gas_meter: &mut GasMeter, ) -> Result; - /// Increment the refcount of a code in-storage by one. - /// - /// This is needed when the code is not set via instantiate but `seal_set_code_hash`. + /// Increment the reference count of a of a stored code by one. /// /// # Errors /// - /// [`Error::CodeNotFound`] is returned if the specified `code_hash` does not exist. - fn add_user(code_hash: CodeHash) -> Result<(), DispatchError>; + /// [`Error::CodeNotFound`] is returned if no stored code found having the specified + /// `code_hash`. + fn increment_refcount(code_hash: CodeHash) -> Result<(), DispatchError>; - /// Decrement the refcount by one if the code exists. - fn remove_user(code_hash: CodeHash); + /// Decrement the reference count of a stored code by one. + /// + /// # Note + /// + /// A contract whose reference count dropped to zero isn't automatically removed. A + /// `remove_code` transaction must be submitted by the original uploader to do so. + fn decrement_refcount(code_hash: CodeHash); /// Execute the specified exported function and return the result. /// @@ -363,7 +369,7 @@ pub trait Executable: Sized { /// The code hash of the executable. fn code_hash(&self) -> &CodeHash; - /// Size of the instrumented code in bytes. + /// Size of the contract code in bytes. fn code_len(&self) -> u32; /// The code does not contain any instructions which could lead to indeterminism. @@ -703,9 +709,9 @@ where Weight::zero(), storage_meter, BalanceOf::::zero(), - schedule, determinism, )?; + let stack = Self { origin, schedule, @@ -735,7 +741,6 @@ where gas_limit: Weight, storage_meter: &mut storage::meter::GenericMeter, deposit_limit: BalanceOf, - schedule: &Schedule, determinism: Determinism, ) -> Result<(Frame, E, Option), ExecError> { let (account_id, contract_info, executable, delegate_caller, entry_point, nonce) = @@ -751,7 +756,7 @@ where if let Some(DelegatedCall { executable, caller }) = delegated_call { (executable, Some(caller)) } else { - (E::from_storage(contract.code_hash, schedule, gas_meter)?, None) + (E::from_storage(contract.code_hash, gas_meter)?, None) }; (dest, contract, executable, delegate_caller, ExportedFunction::Call, None) @@ -759,7 +764,7 @@ where FrameArgs::Instantiate { sender, nonce, executable, salt, input_data } => { let account_id = Contracts::::contract_address( &sender, - executable.code_hash(), + &executable.code_hash(), input_data, salt, ); @@ -831,7 +836,6 @@ where gas_limit, nested_storage, deposit_limit, - self.schedule, self.determinism, )?; self.frames.push(frame); @@ -864,7 +868,7 @@ where // Every non delegate call or instantiate also optionally transfers the balance. self.initial_transfer()?; - // Call into the wasm blob. + // Call into the Wasm blob. let output = executable .execute(self, &entry_point, input_data) .map_err(|e| ExecError { error: e.error, origin: ErrorOrigin::Callee })?; @@ -1193,7 +1197,7 @@ where code_hash: CodeHash, input_data: Vec, ) -> Result { - let executable = E::from_storage(code_hash, self.schedule, self.gas_meter())?; + let executable = E::from_storage(code_hash, self.gas_meter_mut())?; let top_frame = self.top_frame_mut(); let contract_info = top_frame.contract_info().clone(); let account_id = top_frame.account_id.clone(); @@ -1220,7 +1224,7 @@ where input_data: Vec, salt: &[u8], ) -> Result<(AccountIdOf, ExecReturnValue), ExecError> { - let executable = E::from_storage(code_hash, self.schedule, self.gas_meter())?; + let executable = E::from_storage(code_hash, self.gas_meter_mut())?; let nonce = self.next_nonce(); let executable = self.push_frame( FrameArgs::Instantiate { @@ -1255,7 +1259,7 @@ where )?; info.queue_trie_for_deletion(); ContractInfoOf::::remove(&frame.account_id); - E::remove_user(info.code_hash); + E::decrement_refcount(info.code_hash); Contracts::::deposit_event( vec![T::Hashing::hash_of(&frame.account_id), T::Hashing::hash_of(&beneficiary)], Event::Terminated { @@ -1372,7 +1376,11 @@ where self.schedule } - fn gas_meter(&mut self) -> &mut GasMeter { + fn gas_meter(&self) -> &GasMeter { + &self.top_frame().nested_gas + } + + fn gas_meter_mut(&mut self) -> &mut GasMeter { &mut self.top_frame_mut().nested_gas } @@ -1423,12 +1431,12 @@ where fn set_code_hash(&mut self, hash: CodeHash) -> Result<(), DispatchError> { let frame = top_frame_mut!(self); - if !E::from_storage(hash, self.schedule, &mut frame.nested_gas)?.is_deterministic() { + if !E::from_storage(hash, &mut frame.nested_gas)?.is_deterministic() { return Err(>::Indeterministic.into()) } - E::add_user(hash)?; + E::increment_refcount(hash)?; let prev_hash = frame.contract_info().code_hash; - E::remove_user(prev_hash); + E::decrement_refcount(prev_hash); frame.contract_info().code_hash = hash; Contracts::::deposit_event( vec![T::Hashing::hash_of(&frame.account_id), hash, prev_hash], @@ -1591,7 +1599,6 @@ mod tests { impl Executable for MockExecutable { fn from_storage( code_hash: CodeHash, - _schedule: &Schedule, _gas_meter: &mut GasMeter, ) -> Result { Loader::mutate(|loader| { @@ -1599,11 +1606,11 @@ mod tests { }) } - fn add_user(code_hash: CodeHash) -> Result<(), DispatchError> { + fn increment_refcount(code_hash: CodeHash) -> Result<(), DispatchError> { MockLoader::increment_refcount(code_hash) } - fn remove_user(code_hash: CodeHash) { + fn decrement_refcount(code_hash: CodeHash) { MockLoader::decrement_refcount(code_hash); } @@ -1614,7 +1621,7 @@ mod tests { input_data: Vec, ) -> ExecResult { if let &Constructor = function { - Self::add_user(self.code_hash).unwrap(); + Self::increment_refcount(self.code_hash).unwrap(); } if function == &self.func_type { (self.func)(MockCtx { ext, input_data }, &self) @@ -1952,8 +1959,7 @@ mod tests { let schedule = ::Schedule::get(); let min_balance = ::Currency::minimum_balance(); let mut gas_meter = GasMeter::::new(GAS_LIMIT); - let executable = - MockExecutable::from_storage(input_data_ch, &schedule, &mut gas_meter).unwrap(); + let executable = MockExecutable::from_storage(input_data_ch, &mut gas_meter).unwrap(); set_balance(&ALICE, min_balance * 10_000); let contract_origin = Origin::from_account_id(ALICE); let mut storage_meter = @@ -2366,8 +2372,7 @@ mod tests { ExtBuilder::default().existential_deposit(15).build().execute_with(|| { let schedule = ::Schedule::get(); let mut gas_meter = GasMeter::::new(GAS_LIMIT); - let executable = - MockExecutable::from_storage(dummy_ch, &schedule, &mut gas_meter).unwrap(); + let executable = MockExecutable::from_storage(dummy_ch, &mut gas_meter).unwrap(); let contract_origin = Origin::from_account_id(ALICE); let mut storage_meter = storage::meter::Meter::new(&contract_origin, Some(0), 0).unwrap(); @@ -2399,8 +2404,7 @@ mod tests { let schedule = ::Schedule::get(); let min_balance = ::Currency::minimum_balance(); let mut gas_meter = GasMeter::::new(GAS_LIMIT); - let executable = - MockExecutable::from_storage(dummy_ch, &schedule, &mut gas_meter).unwrap(); + let executable = MockExecutable::from_storage(dummy_ch, &mut gas_meter).unwrap(); set_balance(&ALICE, min_balance * 1000); let contract_origin = Origin::from_account_id(ALICE); let mut storage_meter = @@ -2445,8 +2449,7 @@ mod tests { let schedule = ::Schedule::get(); let min_balance = ::Currency::minimum_balance(); let mut gas_meter = GasMeter::::new(GAS_LIMIT); - let executable = - MockExecutable::from_storage(dummy_ch, &schedule, &mut gas_meter).unwrap(); + let executable = MockExecutable::from_storage(dummy_ch, &mut gas_meter).unwrap(); set_balance(&ALICE, min_balance * 1000); let contract_origin = Origin::from_account_id(ALICE); let mut storage_meter = @@ -2614,8 +2617,7 @@ mod tests { ExtBuilder::default().existential_deposit(15).build().execute_with(|| { let schedule = ::Schedule::get(); let mut gas_meter = GasMeter::::new(GAS_LIMIT); - let executable = - MockExecutable::from_storage(terminate_ch, &schedule, &mut gas_meter).unwrap(); + let executable = MockExecutable::from_storage(terminate_ch, &mut gas_meter).unwrap(); set_balance(&ALICE, 10_000); let contract_origin = Origin::from_account_id(ALICE); let mut storage_meter = @@ -2717,7 +2719,7 @@ mod tests { let schedule = ::Schedule::get(); let min_balance = ::Currency::minimum_balance(); let mut gas_meter = GasMeter::::new(GAS_LIMIT); - let executable = MockExecutable::from_storage(code, &schedule, &mut gas_meter).unwrap(); + let executable = MockExecutable::from_storage(code, &mut gas_meter).unwrap(); set_balance(&ALICE, min_balance * 10_000); let contract_origin = Origin::from_account_id(ALICE); let mut storage_meter = @@ -3141,14 +3143,13 @@ mod tests { let schedule = ::Schedule::get(); let min_balance = ::Currency::minimum_balance(); let mut gas_meter = GasMeter::::new(GAS_LIMIT); - let fail_executable = - MockExecutable::from_storage(fail_code, &schedule, &mut gas_meter).unwrap(); + let fail_executable = MockExecutable::from_storage(fail_code, &mut gas_meter).unwrap(); let success_executable = - MockExecutable::from_storage(success_code, &schedule, &mut gas_meter).unwrap(); + MockExecutable::from_storage(success_code, &mut gas_meter).unwrap(); let succ_fail_executable = - MockExecutable::from_storage(succ_fail_code, &schedule, &mut gas_meter).unwrap(); + MockExecutable::from_storage(succ_fail_code, &mut gas_meter).unwrap(); let succ_succ_executable = - MockExecutable::from_storage(succ_succ_code, &schedule, &mut gas_meter).unwrap(); + MockExecutable::from_storage(succ_succ_code, &mut gas_meter).unwrap(); set_balance(&ALICE, min_balance * 10_000); let contract_origin = Origin::from_account_id(ALICE); let mut storage_meter = diff --git a/substrate/frame/contracts/src/gas.rs b/substrate/frame/contracts/src/gas.rs index f6484fbcf4..7d17642d92 100644 --- a/substrate/frame/contracts/src/gas.rs +++ b/substrate/frame/contracts/src/gas.rs @@ -23,6 +23,7 @@ use frame_support::{ weights::Weight, DefaultNoBound, }; +use sp_core::Get; use sp_runtime::traits::Zero; use sp_std::marker::PhantomData; @@ -80,6 +81,8 @@ pub struct GasMeter { gas_left: Weight, /// Due to `adjust_gas` and `nested` the `gas_left` can temporarily dip below its final value. gas_left_lowest: Weight, + /// Amount of fuel consumed by the engine from the last host function call. + engine_consumed: u64, _phantom: PhantomData, #[cfg(test)] tokens: Vec, @@ -91,6 +94,7 @@ impl GasMeter { gas_limit, gas_left: gas_limit, gas_left_lowest: gas_limit, + engine_consumed: Default::default(), _phantom: PhantomData, #[cfg(test)] tokens: Vec::new(), @@ -151,7 +155,7 @@ impl GasMeter { /// Amount is calculated by the given `token`. /// /// Returns `OutOfGas` if there is not enough gas or addition of the specified - /// amount of gas has lead to overflow. On success returns `Proceed`. + /// amount of gas has lead to overflow. /// /// NOTE that amount isn't consumed if there is not enough gas. This is considered /// safe because we always charge gas before performing any resource-spending action. @@ -181,17 +185,45 @@ impl GasMeter { self.gas_left = self.gas_left.saturating_add(adjustment).min(self.gas_limit); } + /// This method is used for gas syncs with the engine. + /// + /// Updates internal `engine_comsumed` tracker of engine fuel consumption. + /// + /// Charges self with the `ref_time` Weight corresponding to wasmi fuel consumed on the engine + /// side since last sync. Passed value is scaled by multiplying it by the weight of a basic + /// operation, as such an operation in wasmi engine costs 1. + /// + /// Returns the updated `gas_left` `Weight` value from the meter. + /// Normally this would never fail, as engine should fail first when out of gas. + pub fn charge_fuel(&mut self, wasmi_fuel_total: u64) -> Result { + // Take the part consumed since the last update. + let wasmi_fuel = wasmi_fuel_total.saturating_sub(self.engine_consumed); + if !wasmi_fuel.is_zero() { + self.engine_consumed = wasmi_fuel_total; + let reftime_consumed = + wasmi_fuel.saturating_mul(T::Schedule::get().instruction_weights.base as u64); + let ref_time_left = self + .gas_left + .ref_time() + .checked_sub(reftime_consumed) + .ok_or_else(|| Error::::OutOfGas)?; + + *(self.gas_left.ref_time_mut()) = ref_time_left; + } + Ok(self.gas_left) + } + /// Returns the amount of gas that is required to run the same call. /// /// This can be different from `gas_spent` because due to `adjust_gas` the amount of /// spent gas can temporarily drop and be refunded later. pub fn gas_required(&self) -> Weight { - self.gas_limit - self.gas_left_lowest() + self.gas_limit.saturating_sub(self.gas_left_lowest()) } /// Returns how much gas was spent pub fn gas_consumed(&self) -> Weight { - self.gas_limit - self.gas_left + self.gas_limit.saturating_sub(self.gas_left) } /// Returns how much gas left from the initial budget. diff --git a/substrate/frame/contracts/src/lib.rs b/substrate/frame/contracts/src/lib.rs index 0b765a2e89..e855eb8917 100644 --- a/substrate/frame/contracts/src/lib.rs +++ b/substrate/frame/contracts/src/lib.rs @@ -30,7 +30,7 @@ //! These "smart-contract accounts" have the ability to instantiate smart-contracts and make calls //! to other contract and non-contract accounts. //! -//! The smart-contract code is stored once in a code cache, and later retrievable via its hash. +//! The smart-contract code is stored once, and later retrievable via its hash. //! This means that multiple smart-contracts can be instantiated from the same hash, without //! replicating the code each time. //! @@ -41,14 +41,14 @@ //! Finally, when an account is reaped, its associated code and storage of the smart-contract //! account will also be deleted. //! -//! ### Gas +//! ### Weight //! -//! Senders must specify a gas limit with every call, as all instructions invoked by the -//! smart-contract require gas. Unused gas is refunded after the call, regardless of the execution -//! outcome. +//! Senders must specify a [`Weight`] limit with every call, as all instructions invoked by the +//! smart-contract require weight. Unused weight is refunded after the call, regardless of the +//! execution outcome. //! -//! If the gas limit is reached, then all calls and state changes (including balance transfers) are -//! only reverted at the current call's contract level. For example, if contract A calls B and B +//! If the weight limit is reached, then all calls and state changes (including balance transfers) +//! are only reverted at the current call's contract level. For example, if contract A calls B and B //! runs out of gas mid-call, then all of B's calls are reverted. Assuming correct error handling by //! contract A, A's other calls and state changes still persist. //! @@ -63,22 +63,25 @@ //! //! ### Dispatchable functions //! -//! * [`Pallet::instantiate_with_code`] - Deploys a new contract from the supplied wasm binary, +//! * [`Pallet::instantiate_with_code`] - Deploys a new contract from the supplied Wasm binary, //! optionally transferring //! some balance. This instantiates a new smart contract account with the supplied code and //! calls its constructor to initialize the contract. //! * [`Pallet::instantiate`] - The same as `instantiate_with_code` but instead of uploading new //! code an existing `code_hash` is supplied. //! * [`Pallet::call`] - Makes a call to an account, optionally transferring some balance. +//! * [`Pallet::upload_code`] - Uploads new code without instantiating a contract from it. +//! * [`Pallet::remove_code`] - Removes the stored code and refunds the deposit to its owner. Only +//! allowed to code owner. +//! * [`Pallet::set_code`] - Changes the code of an existing contract. Only allowed to `Root` +//! origin. +//! * [`Pallet::migrate`] - Runs migration steps of curent multi-block migration in priority, before +//! [`Hooks::on_idle`][frame_support::traits::Hooks::on_idle] activates. //! //! ## Usage //! -//! The Contracts module is a work in progress. The following examples show how this module -//! can be used to instantiate and call contracts. -//! -//! * [`ink!`](https://use.ink) is -//! an [`eDSL`](https://wiki.haskell.org/Embedded_domain_specific_language) that enables writing -//! WebAssembly based smart contracts in the Rust programming language. +//! * [`ink!`](https://use.ink) is language that enables writing Wasm-based smart contracts in plain +//! Rust. #![allow(rustdoc::private_intra_doc_links)] #![cfg_attr(not(feature = "std"), no_std)] @@ -102,7 +105,7 @@ use crate::{ exec::{AccountIdOf, ErrorOrigin, ExecError, Executable, Key, Stack as ExecStack}, gas::GasMeter, storage::{meter::Meter as StorageMeter, ContractInfo, DeletionQueueManager}, - wasm::{OwnerInfo, PrefabWasmModule, TryInstantiate}, + wasm::{CodeInfo, TryInstantiate, WasmBlob}, }; use codec::{Codec, Decode, Encode, HasCompact}; use environmental::*; @@ -118,7 +121,7 @@ use frame_support::{ ReservableCurrency, Time, }, weights::Weight, - BoundedVec, RuntimeDebugNoBound, WeakBoundedVec, + BoundedVec, RuntimeDebugNoBound, }; use frame_system::{ensure_signed, pallet_prelude::OriginFor, EventRecord, Pallet as System}; use pallet_contracts_primitives::{ @@ -149,7 +152,6 @@ type TrieId = BoundedVec>; type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; type CodeVec = BoundedVec::MaxCodeLen>; -type RelaxedCodeVec = WeakBoundedVec::MaxCodeLen>; type AccountIdLookupOf = <::Lookup as StaticLookup>::Source; type DebugBufferVec = BoundedVec::MaxDebugBufferLen>; type EventRecordOf = @@ -184,7 +186,7 @@ pub mod pallet { /// The current storage version. #[cfg(not(any(test, feature = "runtime-benchmarks")))] - const STORAGE_VERSION: StorageVersion = StorageVersion::new(11); + const STORAGE_VERSION: StorageVersion = StorageVersion::new(12); /// Hard coded storage version for running tests that depend on the current storage version. #[cfg(any(test, feature = "runtime-benchmarks"))] @@ -291,9 +293,7 @@ pub mod pallet { /// The address generator used to generate the addresses of contracts. type AddressGenerator: AddressGenerator; - /// The maximum length of a contract code in bytes. This limit applies to the instrumented - /// version of the code. Therefore `instantiate_with_code` can fail even when supplying - /// a wasm binary below this maximum size. + /// The maximum length of a contract code in bytes. /// /// The value should be chosen carefully taking into the account the overall memory limit /// your runtime has, as well as the [maximum allowed callstack @@ -380,19 +380,19 @@ pub mod pallet { // Check that given configured `MaxCodeLen`, runtime heap memory limit can't be broken. // - // In worst case, the decoded wasm contract code would be `x16` times larger than the + // In worst case, the decoded Wasm contract code would be `x16` times larger than the // encoded one. This is because even a single-byte wasm instruction has 16-byte size in // wasmi. This gives us `MaxCodeLen*16` safety margin. // - // Next, the pallet keeps both the original and instrumented wasm blobs for each - // contract, hence we add up `MaxCodeLen*2` more to the safety margin. + // Next, the pallet keeps the Wasm blob for each + // contract, hence we add up `MaxCodeLen` to the safety margin. // // Finally, the inefficiencies of the freeing-bump allocator // being used in the client for the runtime memory allocations, could lead to possible // memory allocations for contract code grow up to `x4` times in some extreme cases, - // which gives us total multiplier of `18*4` for `MaxCodeLen`. + // which gives us total multiplier of `17*4` for `MaxCodeLen`. // - // That being said, for every contract executed in runtime, at least `MaxCodeLen*18*4` + // That being said, for every contract executed in runtime, at least `MaxCodeLen*17*4` // memory should be available. Note that maximum allowed heap memory and stack size per // each contract (stack frame) should also be counted. // @@ -401,7 +401,7 @@ pub mod pallet { // // This gives us the following formula: // - // `(MaxCodeLen * 18 * 4 + MAX_STACK_SIZE + max_heap_size) * max_call_depth < + // `(MaxCodeLen * 17 * 4 + MAX_STACK_SIZE + max_heap_size) * max_call_depth < // max_runtime_mem/2` // // Hence the upper limit for the `MaxCodeLen` can be defined as follows: @@ -410,7 +410,7 @@ pub mod pallet { .saturating_div(max_call_depth) .saturating_sub(max_heap_size) .saturating_sub(MAX_STACK_SIZE) - .saturating_div(18 * 4); + .saturating_div(17 * 4); assert!( T::MaxCodeLen::get() < code_len_limit, @@ -521,7 +521,7 @@ pub mod pallet { /// /// If the code does not already exist a deposit is reserved from the caller /// and unreserved only when [`Self::remove_code`] is called. The size of the reserve - /// depends on the instrumented size of the the supplied `code`. + /// depends on the size of the supplied `code`. /// /// If the code already exists in storage it will still return `Ok` and upgrades /// the in storage version to the current @@ -563,7 +563,7 @@ pub mod pallet { ) -> DispatchResultWithPostInfo { Migration::::ensure_migrated()?; let origin = ensure_signed(origin)?; - >::remove(&origin, code_hash)?; + >::remove(&origin, code_hash)?; // we waive the fee because removing unused code is beneficial Ok(Pays::No.into()) } @@ -594,8 +594,8 @@ pub mod pallet { } else { return Err(>::ContractNotFound.into()) }; - >::add_user(code_hash)?; - >::remove_user(contract.code_hash); + >::increment_refcount(code_hash)?; + >::decrement_refcount(contract.code_hash); Self::deposit_event( vec![T::Hashing::hash_of(&dest), code_hash, contract.code_hash], Event::ContractCodeUpdated { @@ -674,8 +674,7 @@ pub mod pallet { /// /// Instantiation is executed as follows: /// - /// - The supplied `code` is instrumented, deployed, and a `code_hash` is created for that - /// code. + /// - The supplied `code` is deployed, and a `code_hash` is created for that code. /// - If the `code_hash` already exists on the chain the underlying `code` will be shared. /// - The destination address is computed based on the sender, code_hash and the salt. /// - The smart-contract account is created at the computed address. @@ -865,8 +864,8 @@ pub mod pallet { #[pallet::error] pub enum Error { - /// A new schedule must have a greater version than the current one. - InvalidScheduleVersion, + /// Invalid schedule supplied, e.g. with zero weight of a basic operation. + InvalidSchedule, /// Invalid combination of flags supplied to `seal_call` or `seal_delegate_call`. InvalidCallFlags, /// The executed contract exhausted its gas limit. @@ -929,7 +928,7 @@ pub mod pallet { /// or via RPC an `Ok` will be returned. In this case the caller needs to inspect the flags /// to determine whether a reversion has taken place. ContractReverted, - /// The contract's code was found to be invalid during validation or instrumentation. + /// The contract's code was found to be invalid during validation. /// /// The most likely cause of this is that an API was used which is not supported by the /// node. This happens if an older node is used with a new version of ink!. Try updating @@ -946,18 +945,13 @@ pub mod pallet { NoMigrationPerformed, } - /// A mapping from an original code hash to the original code, untouched by instrumentation. + /// A mapping from a contract's code hash to its code. #[pallet::storage] pub(crate) type PristineCode = StorageMap<_, Identity, CodeHash, CodeVec>; - /// A mapping between an original code hash and instrumented wasm code, ready for execution. + /// A mapping from a contract's code hash to its code info. #[pallet::storage] - pub(crate) type CodeStorage = - StorageMap<_, Identity, CodeHash, PrefabWasmModule>; - - /// A mapping between an original code hash and its owner information. - #[pallet::storage] - pub(crate) type OwnerInfoOf = StorageMap<_, Identity, CodeHash, OwnerInfo>; + pub(crate) type CodeInfoOf = StorageMap<_, Identity, CodeHash, CodeInfo>; /// This is a **monotonic** counter incremented on contract instantiation. /// @@ -1196,7 +1190,7 @@ impl Invokable for CallInput { }, }; let schedule = T::Schedule::get(); - let result = ExecStack::>::run_call( + let result = ExecStack::>::run_call( origin.clone(), dest.clone(), &mut gas_meter, @@ -1239,7 +1233,7 @@ impl Invokable for InstantiateInput { let origin = contract_origin.account_id()?; let (extra_deposit, executable) = match &self.code { Code::Upload(binary) => { - let executable = PrefabWasmModule::from_code( + let executable = WasmBlob::from_code( binary.clone(), &schedule, origin.clone(), @@ -1257,12 +1251,10 @@ impl Invokable for InstantiateInput { // uploaded module does not already exist. This deposit is not part of the // storage meter because it is not transferred to the contract but // reserved on the uploading account. - (executable.open_deposit(), executable) + (executable.open_deposit(&executable.code_info()), executable) }, - Code::Existing(hash) => ( - Default::default(), - PrefabWasmModule::from_storage(*hash, &schedule, &mut gas_meter)?, - ), + Code::Existing(hash) => + (Default::default(), WasmBlob::from_storage(*hash, &mut gas_meter)?), }; let contract_origin = Origin::from_account_id(origin.clone()); let mut storage_meter = StorageMeter::new( @@ -1271,7 +1263,7 @@ impl Invokable for InstantiateInput { common.value.saturating_add(extra_deposit), )?; let CommonInput { value, data, debug_message, .. } = common; - let result = ExecStack::>::run_instantiate( + let result = ExecStack::>::run_instantiate( origin.clone(), executable, &mut gas_meter, @@ -1443,15 +1435,10 @@ impl Pallet { ) -> CodeUploadResult, BalanceOf> { Migration::::ensure_migrated()?; let schedule = T::Schedule::get(); - let module = PrefabWasmModule::from_code( - code, - &schedule, - origin, - determinism, - TryInstantiate::Instantiate, - ) - .map_err(|(err, _)| err)?; - let deposit = module.open_deposit(); + let module = + WasmBlob::from_code(code, &schedule, origin, determinism, TryInstantiate::Instantiate) + .map_err(|(err, _)| err)?; + let deposit = module.open_deposit(&module.code_info()); if let Some(storage_deposit_limit) = storage_deposit_limit { ensure!(storage_deposit_limit >= deposit, >::StorageDepositLimitExhausted); } @@ -1494,26 +1481,17 @@ impl Pallet { ContractInfo::::load_code_hash(account) } - /// Store code for benchmarks which does not check nor instrument the code. + /// Store code for benchmarks which does not validate the code. #[cfg(feature = "runtime-benchmarks")] fn store_code_raw( code: Vec, owner: T::AccountId, ) -> frame_support::dispatch::DispatchResult { let schedule = T::Schedule::get(); - PrefabWasmModule::store_code_unchecked(code, &schedule, owner)?; + WasmBlob::store_code_unchecked(code, &schedule, owner)?; Ok(()) } - /// This exists so that benchmarks can determine the weight of running an instrumentation. - #[cfg(feature = "runtime-benchmarks")] - fn reinstrument_module( - module: &mut PrefabWasmModule, - schedule: &Schedule, - ) -> frame_support::dispatch::DispatchResult { - self::wasm::reinstrument(module, schedule).map(|_| ()) - } - /// Deposit a pallet contracts event. Handles the conversion to the overarching event type. fn deposit_event(topics: Vec, event: Event) { >::deposit_event_indexed( diff --git a/substrate/frame/contracts/src/migration.rs b/substrate/frame/contracts/src/migration.rs index 5da1bb70a6..827135e081 100644 --- a/substrate/frame/contracts/src/migration.rs +++ b/substrate/frame/contracts/src/migration.rs @@ -58,6 +58,7 @@ pub mod v10; pub mod v11; +pub mod v12; pub mod v9; use crate::{weights::WeightInfo, Config, Error, MigrationInProgress, Pallet, Weight, LOG_TARGET}; @@ -173,7 +174,7 @@ mod private { /// Defines a sequence of migrations. /// /// The sequence must be defined by a tuple of migrations, each of which must implement the -/// `Migrate` trait. Migrations must be ordered by their versions with no gaps. +/// `MigrationStep` trait. Migrations must be ordered by their versions with no gaps. pub trait MigrateSequence: private::Sealed { /// Returns the range of versions that this migrations sequence can handle. /// Migrations must be ordered by their versions with no gaps. diff --git a/substrate/frame/contracts/src/migration/v10.rs b/substrate/frame/contracts/src/migration/v10.rs index 75d794a6d8..40e007bf71 100644 --- a/substrate/frame/contracts/src/migration/v10.rs +++ b/substrate/frame/contracts/src/migration/v10.rs @@ -179,7 +179,11 @@ impl MigrationStep for Migration { }) // If it fails we fallback to minting the ED. .unwrap_or_else(|err| { - log::error!(target: LOG_TARGET, "Failed to transfer the base deposit, reason: {:?}", err); + log::error!( + target: LOG_TARGET, + "Failed to transfer the base deposit, reason: {:?}", + err + ); T::Currency::deposit_creating(&deposit_account, min_balance); min_balance }); diff --git a/substrate/frame/contracts/src/migration/v12.rs b/substrate/frame/contracts/src/migration/v12.rs new file mode 100644 index 0000000000..c7987075f5 --- /dev/null +++ b/substrate/frame/contracts/src/migration/v12.rs @@ -0,0 +1,315 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Move `OwnerInfo` to `CodeInfo`, add `determinism` field to the latter, clear `CodeStorage` and +//! repay deposits. + +use crate::{ + migration::{IsFinished, MigrationStep}, + weights::WeightInfo, + AccountIdOf, BalanceOf, CodeHash, Config, Determinism, Pallet, Weight, LOG_TARGET, +}; +use codec::{Decode, Encode}; +use frame_support::{ + codec, pallet_prelude::*, storage_alias, traits::ReservableCurrency, DefaultNoBound, Identity, +}; +use scale_info::prelude::format; +use sp_core::hexdisplay::HexDisplay; +#[cfg(feature = "try-runtime")] +use sp_runtime::TryRuntimeError; +use sp_runtime::{traits::Zero, FixedPointNumber, FixedU128, Saturating}; +use sp_std::prelude::*; + +mod old { + use super::*; + + #[derive(Encode, Decode, scale_info::TypeInfo, MaxEncodedLen)] + #[codec(mel_bound())] + #[scale_info(skip_type_params(T))] + pub struct OwnerInfo { + pub owner: AccountIdOf, + #[codec(compact)] + pub deposit: BalanceOf, + #[codec(compact)] + pub refcount: u64, + } + + #[derive(Encode, Decode, scale_info::TypeInfo)] + #[codec(mel_bound())] + #[scale_info(skip_type_params(T))] + pub struct PrefabWasmModule { + #[codec(compact)] + pub instruction_weights_version: u32, + #[codec(compact)] + pub initial: u32, + #[codec(compact)] + pub maximum: u32, + pub code: Vec, + pub determinism: Determinism, + } + + #[storage_alias] + pub type OwnerInfoOf = StorageMap, Identity, CodeHash, OwnerInfo>; + + #[storage_alias] + pub type CodeStorage = + StorageMap, Identity, CodeHash, PrefabWasmModule>; +} + +#[derive(Encode, Decode, scale_info::TypeInfo, MaxEncodedLen)] +#[codec(mel_bound())] +#[scale_info(skip_type_params(T))] +pub struct CodeInfo { + owner: AccountIdOf, + #[codec(compact)] + deposit: BalanceOf, + #[codec(compact)] + refcount: u64, + determinism: Determinism, +} + +#[storage_alias] +pub type CodeInfoOf = StorageMap, Twox64Concat, CodeHash, CodeInfo>; + +#[storage_alias] +pub type PristineCode = StorageMap, Identity, CodeHash, Vec>; + +#[cfg(feature = "runtime-benchmarks")] +pub fn store_old_dummy_code(len: usize, account: T::AccountId) { + use sp_runtime::traits::Hash; + + let code = vec![42u8; len]; + let hash = T::Hashing::hash(&code); + PristineCode::::insert(hash, code.clone()); + + let module = old::PrefabWasmModule { + instruction_weights_version: Default::default(), + initial: Default::default(), + maximum: Default::default(), + code, + determinism: Determinism::Enforced, + }; + old::CodeStorage::::insert(hash, module); + + let info = old::OwnerInfo { owner: account, deposit: u32::MAX.into(), refcount: u64::MAX }; + old::OwnerInfoOf::::insert(hash, info); +} + +#[derive(Encode, Decode, MaxEncodedLen, DefaultNoBound)] +pub struct Migration { + last_code_hash: Option>, +} + +impl MigrationStep for Migration { + const VERSION: u16 = 12; + + fn max_step_weight() -> Weight { + T::WeightInfo::v12_migration_step(T::MaxCodeLen::get()) + } + + fn step(&mut self) -> (IsFinished, Weight) { + let mut iter = if let Some(last_key) = self.last_code_hash.take() { + old::OwnerInfoOf::::iter_from(old::OwnerInfoOf::::hashed_key_for(last_key)) + } else { + old::OwnerInfoOf::::iter() + }; + if let Some((hash, old_info)) = iter.next() { + log::debug!(target: LOG_TARGET, "Migrating OwnerInfo for code_hash {:?}", hash); + + let module = old::CodeStorage::::take(hash) + .expect(format!("No PrefabWasmModule found for code_hash: {:?}", hash).as_str()); + + let code_len = module.code.len(); + // We print this to measure the impact of the migration. + // Storage removed: deleted PrefabWasmModule's encoded len. + // Storage added: determinism field encoded len (as all other CodeInfo fields are the + // same as in the deleted OwnerInfo). + log::debug!(target: LOG_TARGET, "Storage removed: 1 item, {} bytes", &code_len,); + + // Storage usage prices could change over time, and accounts who uploaded their + // contracts code before the storage deposits where introduced, had not been ever + // charged with any deposit for that (see migration v6). + // + // This is why deposit to be refunded here is calculated as follows: + // + // 1. Calculate the deposit amount for storage before the migration, given current + // prices. + // 2. Given current reserved deposit amount, calculate the correction factor. + // 3. Calculate the deposit amount for storage after the migration, given current + // prices. + // 4. Calculate real deposit amount to be reserved after the migration. + let price_per_byte = T::DepositPerByte::get(); + let price_per_item = T::DepositPerItem::get(); + let bytes_before = module + .encoded_size() + .saturating_add(code_len) + .saturating_add(old::OwnerInfo::::max_encoded_len()) as u32; + let items_before = 3u32; + let deposit_expected_before = price_per_byte + .saturating_mul(bytes_before.into()) + .saturating_add(price_per_item.saturating_mul(items_before.into())); + let ratio = FixedU128::checked_from_rational(old_info.deposit, deposit_expected_before) + .unwrap_or_default() + .min(FixedU128::from_u32(1)); + let bytes_after = code_len.saturating_add(CodeInfo::::max_encoded_len()) as u32; + let items_after = 2u32; + let deposit_expected_after = price_per_byte + .saturating_mul(bytes_after.into()) + .saturating_add(price_per_item.saturating_mul(items_after.into())); + let deposit = ratio.saturating_mul_int(deposit_expected_after); + + let info = CodeInfo:: { + determinism: module.determinism, + owner: old_info.owner, + deposit, + refcount: old_info.refcount, + }; + + let amount = old_info.deposit.saturating_sub(info.deposit); + if !amount.is_zero() { + T::Currency::unreserve(&info.owner, amount); + log::debug!( + target: LOG_TARGET, + "Deposit refunded: {:?} Balance, to: {:?}", + &amount, + HexDisplay::from(&info.owner.encode()) + ); + } else { + log::warn!( + target: LOG_TARGET, + "new deposit: {:?} >= old deposit: {:?}", + &info.deposit, + &old_info.deposit + ); + } + CodeInfoOf::::insert(hash, info); + + self.last_code_hash = Some(hash); + + (IsFinished::No, T::WeightInfo::v12_migration_step(code_len as u32)) + } else { + log::debug!(target: LOG_TARGET, "No more OwnerInfo to migrate"); + (IsFinished::Yes, T::WeightInfo::v12_migration_step(0)) + } + } + + #[cfg(feature = "try-runtime")] + fn pre_upgrade_step() -> Result, TryRuntimeError> { + let len = 100; + log::debug!(target: LOG_TARGET, "Taking sample of {} OwnerInfo(s)", len); + let sample: Vec<_> = old::OwnerInfoOf::::iter() + .take(len) + .map(|(k, v)| { + let module = old::CodeStorage::::get(k) + .expect("No PrefabWasmModule found for code_hash: {:?}"); + let info: CodeInfo = CodeInfo { + determinism: module.determinism, + deposit: v.deposit, + refcount: v.refcount, + owner: v.owner, + }; + (k, info) + }) + .collect(); + + let storage: u32 = + old::CodeStorage::::iter().map(|(_k, v)| v.encoded_size() as u32).sum(); + let mut deposit: BalanceOf = Default::default(); + old::OwnerInfoOf::::iter().for_each(|(_k, v)| deposit += v.deposit); + + Ok((sample, deposit, storage).encode()) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade_step(state: Vec) -> Result<(), TryRuntimeError> { + let state = <(Vec<(CodeHash, CodeInfo)>, BalanceOf, u32) as Decode>::decode( + &mut &state[..], + ) + .unwrap(); + + log::debug!(target: LOG_TARGET, "Validating state of {} Codeinfo(s)", state.0.len()); + for (hash, old) in state.0 { + let info = CodeInfoOf::::get(&hash) + .expect(format!("CodeInfo for code_hash {:?} not found!", hash).as_str()); + ensure!(info.determinism == old.determinism, "invalid determinism"); + ensure!(info.owner == old.owner, "invalid owner"); + ensure!(info.refcount == old.refcount, "invalid refcount"); + } + + if let Some((k, _)) = old::CodeStorage::::iter().next() { + log::warn!( + target: LOG_TARGET, + "CodeStorage is still NOT empty, found code_hash: {:?}", + k + ); + } else { + log::debug!(target: LOG_TARGET, "CodeStorage is empty."); + } + if let Some((k, _)) = old::OwnerInfoOf::::iter().next() { + log::warn!( + target: LOG_TARGET, + "OwnerInfoOf is still NOT empty, found code_hash: {:?}", + k + ); + } else { + log::debug!(target: LOG_TARGET, "OwnerInfoOf is empty."); + } + + let mut deposit: BalanceOf = Default::default(); + let mut items = 0u32; + let mut storage_info = 0u32; + CodeInfoOf::::iter().for_each(|(_k, v)| { + deposit += v.deposit; + items += 1; + storage_info += v.encoded_size() as u32; + }); + let mut storage_code = 0u32; + PristineCode::::iter().for_each(|(_k, v)| { + storage_code += v.len() as u32; + }); + let (_, old_deposit, storage_module) = state; + // CodeInfoOf::max_encoded_len == OwnerInfoOf::max_encoded_len + 1 + // I.e. code info adds up 1 byte per record. + let info_bytes_added = items.clone(); + // We removed 1 PrefabWasmModule, and added 1 byte of determinism flag, per contract code. + let storage_removed = storage_module.saturating_sub(info_bytes_added); + // module+code+info - bytes + let storage_was = storage_module + .saturating_add(storage_code) + .saturating_add(storage_info) + .saturating_sub(info_bytes_added); + // We removed 1 storage item (PrefabWasmMod) for every stored contract code (was stored 3 + // items per code). + let items_removed = items; + log::info!( + target: LOG_TARGET, + "Storage freed, bytes: {} (of {}), items: {} (of {})", + storage_removed, + storage_was, + items_removed, + items_removed * 3, + ); + log::info!( + target: LOG_TARGET, + "Deposits returned, total: {:?} Balance (of {:?} Balance)", + old_deposit.saturating_sub(deposit), + old_deposit, + ); + + Ok(()) + } +} diff --git a/substrate/frame/contracts/src/schedule.rs b/substrate/frame/contracts/src/schedule.rs index 94307811b8..1e906a9906 100644 --- a/substrate/frame/contracts/src/schedule.rs +++ b/substrate/frame/contracts/src/schedule.rs @@ -18,7 +18,7 @@ //! This module contains the cost schedule and supporting code that constructs a //! sane default schedule from a `WeightInfo` implementation. -use crate::{wasm::Determinism, weights::WeightInfo, Config}; +use crate::{weights::WeightInfo, Config}; use codec::{Decode, Encode}; use frame_support::{weights::Weight, DefaultNoBound}; @@ -28,7 +28,6 @@ use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; use sp_runtime::RuntimeDebug; use sp_std::marker::PhantomData; -use wasm_instrument::{gas_metering, parity_wasm::elements}; /// Definition of the cost schedule and other parameterizations for the wasm vm. /// @@ -50,18 +49,12 @@ use wasm_instrument::{gas_metering, parity_wasm::elements}; /// .. Default::default() /// }, /// instruction_weights: InstructionWeights { -/// version: 5, /// .. Default::default() /// }, /// .. Default::default() /// } /// } /// ``` -/// -/// # Note -/// -/// Please make sure to bump the [`InstructionWeights::version`] whenever substantial -/// changes are made to its values. #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] #[cfg_attr(feature = "std", serde(bound(serialize = "", deserialize = "")))] #[derive(Clone, Encode, Decode, PartialEq, Eq, ScheduleDebug, DefaultNoBound, TypeInfo)] @@ -78,12 +71,6 @@ pub struct Schedule { } /// Describes the upper limits on various metrics. -/// -/// # Note -/// -/// The values in this struct should never be decreased. The reason is that decreasing those -/// values will break existing contracts which are above the new limits when a -/// re-instrumentation is triggered. #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] #[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug, TypeInfo)] pub struct Limits { @@ -140,100 +127,15 @@ impl Limits { } } -/// Describes the weight for all categories of supported wasm instructions. -/// -/// There there is one field for each wasm instruction that describes the weight to -/// execute one instruction of that name. There are a few exceptions: -/// -/// 1. If there is a i64 and a i32 variant of an instruction we use the weight of the former for -/// both. -/// 2. The following instructions are free of charge because they merely structure the wasm module -/// and cannot be spammed without making the module invalid (and rejected): End, Unreachable, -/// Return, Else -/// 3. The following instructions cannot be benchmarked because they are removed by any real world -/// execution engine as a preprocessing step and therefore don't yield a meaningful benchmark -/// result. However, in contrast to the instructions mentioned in 2. they can be spammed. We -/// price them with the same weight as the "default" instruction (i64.const): Block, Loop, Nop -/// 4. We price both i64.const and drop as InstructionWeights.i64const / 2. The reason for that is -/// that we cannot benchmark either of them on its own but we need their individual values to -/// derive (by subtraction) the weight of all other instructions that use them as supporting -/// instructions. Supporting means mainly pushing arguments and dropping return values in order -/// to maintain a valid module. +/// Gas metering of Wasm executed instructions is being done on the engine side. +/// This struct holds a reference value used to gas units scaling between host and engine. #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] #[derive(Clone, Encode, Decode, PartialEq, Eq, ScheduleDebug, TypeInfo)] #[scale_info(skip_type_params(T))] pub struct InstructionWeights { - /// Version of the instruction weights. - /// - /// # Note - /// - /// Should be incremented whenever any instruction weight is changed. The - /// reason is that changes to instruction weights require a re-instrumentation - /// in order to apply the changes to an already deployed code. The re-instrumentation - /// is triggered by comparing the version of the current schedule with the version the code was - /// instrumented with. Changes usually happen when pallet_contracts is re-benchmarked. - /// - /// Changes to other parts of the schedule should not increment the version in - /// order to avoid unnecessary re-instrumentations. - pub version: u32, - /// Weight to be used for instructions which don't have benchmarks assigned. - /// - /// This weight is used whenever a code is uploaded with [`Determinism::Relaxed`] - /// and an instruction (usually a float instruction) is encountered. This weight is **not** - /// used if a contract is uploaded with [`Determinism::Enforced`]. If this field is set to - /// `0` (the default) only deterministic codes are allowed to be uploaded. - pub fallback: u32, - pub i64const: u32, - pub i64load: u32, - pub i64store: u32, - pub select: u32, - pub r#if: u32, - pub br: u32, - pub br_if: u32, - pub br_table: u32, - pub br_table_per_entry: u32, - pub call: u32, - pub call_indirect: u32, - pub call_per_local: u32, - pub local_get: u32, - pub local_set: u32, - pub local_tee: u32, - pub global_get: u32, - pub global_set: u32, - pub memory_current: u32, - pub memory_grow: u32, - pub i64clz: u32, - pub i64ctz: u32, - pub i64popcnt: u32, - pub i64eqz: u32, - pub i64extendsi32: u32, - pub i64extendui32: u32, - pub i32wrapi64: u32, - pub i64eq: u32, - pub i64ne: u32, - pub i64lts: u32, - pub i64ltu: u32, - pub i64gts: u32, - pub i64gtu: u32, - pub i64les: u32, - pub i64leu: u32, - pub i64ges: u32, - pub i64geu: u32, - pub i64add: u32, - pub i64sub: u32, - pub i64mul: u32, - pub i64divs: u32, - pub i64divu: u32, - pub i64rems: u32, - pub i64remu: u32, - pub i64and: u32, - pub i64or: u32, - pub i64xor: u32, - pub i64shl: u32, - pub i64shrs: u32, - pub i64shru: u32, - pub i64rotl: u32, - pub i64rotr: u32, + /// Base instruction `ref_time` Weight. + /// Should match to wasmi's `1` fuel (see ). + pub base: u32, /// The type parameter is used in the default implementation. #[codec(skip)] pub _phantom: PhantomData, @@ -286,9 +188,6 @@ pub struct HostFnWeights { /// Weight of calling `seal_weight_to_fee`. pub weight_to_fee: Weight, - /// Weight of calling `gas`. - pub gas: Weight, - /// Weight of calling `seal_input`. pub input: Weight, @@ -491,63 +390,10 @@ impl Default for Limits { } impl Default for InstructionWeights { + /// We price both `i64.const` and `drop` as `instr_i64const / 2`. The reason + /// for that is that we cannot benchmark either of them on its own. fn default() -> Self { - Self { - version: 4, - fallback: 0, - i64const: cost_instr!(instr_i64const, 1), - i64load: cost_instr!(instr_i64load, 2), - i64store: cost_instr!(instr_i64store, 2), - select: cost_instr!(instr_select, 4), - r#if: cost_instr!(instr_if, 3), - br: cost_instr!(instr_br, 2), - br_if: cost_instr!(instr_br_if, 3), - br_table: cost_instr!(instr_br_table, 3), - br_table_per_entry: cost_instr!(instr_br_table_per_entry, 0), - call: cost_instr!(instr_call, 2), - call_indirect: cost_instr!(instr_call_indirect, 3), - call_per_local: cost_instr!(instr_call_per_local, 0), - local_get: cost_instr!(instr_local_get, 1), - local_set: cost_instr!(instr_local_set, 1), - local_tee: cost_instr!(instr_local_tee, 2), - global_get: cost_instr!(instr_global_get, 1), - global_set: cost_instr!(instr_global_set, 1), - memory_current: cost_instr!(instr_memory_current, 1), - memory_grow: cost_instr!(instr_memory_grow, 1), - i64clz: cost_instr!(instr_i64clz, 2), - i64ctz: cost_instr!(instr_i64ctz, 2), - i64popcnt: cost_instr!(instr_i64popcnt, 2), - i64eqz: cost_instr!(instr_i64eqz, 2), - i64extendsi32: cost_instr!(instr_i64extendsi32, 2), - i64extendui32: cost_instr!(instr_i64extendui32, 2), - i32wrapi64: cost_instr!(instr_i32wrapi64, 2), - i64eq: cost_instr!(instr_i64eq, 3), - i64ne: cost_instr!(instr_i64ne, 3), - i64lts: cost_instr!(instr_i64lts, 3), - i64ltu: cost_instr!(instr_i64ltu, 3), - i64gts: cost_instr!(instr_i64gts, 3), - i64gtu: cost_instr!(instr_i64gtu, 3), - i64les: cost_instr!(instr_i64les, 3), - i64leu: cost_instr!(instr_i64leu, 3), - i64ges: cost_instr!(instr_i64ges, 3), - i64geu: cost_instr!(instr_i64geu, 3), - i64add: cost_instr!(instr_i64add, 3), - i64sub: cost_instr!(instr_i64sub, 3), - i64mul: cost_instr!(instr_i64mul, 3), - i64divs: cost_instr!(instr_i64divs, 3), - i64divu: cost_instr!(instr_i64divu, 3), - i64rems: cost_instr!(instr_i64rems, 3), - i64remu: cost_instr!(instr_i64remu, 3), - i64and: cost_instr!(instr_i64and, 3), - i64or: cost_instr!(instr_i64or, 3), - i64xor: cost_instr!(instr_i64xor, 3), - i64shl: cost_instr!(instr_i64shl, 3), - i64shrs: cost_instr!(instr_i64shrs, 3), - i64shru: cost_instr!(instr_i64shru, 3), - i64rotl: cost_instr!(instr_i64rotl, 3), - i64rotr: cost_instr!(instr_i64rotr, 3), - _phantom: PhantomData, - } + Self { base: cost_instr!(instr_i64const, 1), _phantom: PhantomData } } } @@ -568,12 +414,6 @@ impl Default for HostFnWeights { block_number: cost!(seal_block_number), now: cost!(seal_now), weight_to_fee: cost!(seal_weight_to_fee), - // Manually remove proof size from basic block cost. - // - // Due to imperfect benchmarking some host functions incur a small - // amount of proof size. Usually this is ok. However, charging a basic block is such - // a frequent operation that this would be a vast overestimation. - gas: cost!(seal_gas).set_proof_size(0), input: cost!(seal_input), input_per_byte: cost!(seal_input_per_byte), r#return: cost!(seal_return), @@ -641,113 +481,6 @@ impl Default for HostFnWeights { } } -struct ScheduleRules<'a, T: Config> { - schedule: &'a Schedule, - determinism: Determinism, -} - -impl Schedule { - pub(crate) fn rules(&self, determinism: Determinism) -> impl gas_metering::Rules + '_ { - ScheduleRules { schedule: self, determinism } - } -} - -impl<'a, T: Config> gas_metering::Rules for ScheduleRules<'a, T> { - fn instruction_cost(&self, instruction: &elements::Instruction) -> Option { - use self::elements::Instruction::*; - let w = &self.schedule.instruction_weights; - - let weight = match *instruction { - End | Unreachable | Return | Else => 0, - I32Const(_) | I64Const(_) | Block(_) | Loop(_) | Nop | Drop => w.i64const, - I32Load(_, _) | - I32Load8S(_, _) | - I32Load8U(_, _) | - I32Load16S(_, _) | - I32Load16U(_, _) | - I64Load(_, _) | - I64Load8S(_, _) | - I64Load8U(_, _) | - I64Load16S(_, _) | - I64Load16U(_, _) | - I64Load32S(_, _) | - I64Load32U(_, _) => w.i64load, - I32Store(_, _) | - I32Store8(_, _) | - I32Store16(_, _) | - I64Store(_, _) | - I64Store8(_, _) | - I64Store16(_, _) | - I64Store32(_, _) => w.i64store, - Select => w.select, - If(_) => w.r#if, - Br(_) => w.br, - BrIf(_) => w.br_if, - Call(_) => w.call, - GetLocal(_) => w.local_get, - SetLocal(_) => w.local_set, - TeeLocal(_) => w.local_tee, - GetGlobal(_) => w.global_get, - SetGlobal(_) => w.global_set, - CurrentMemory(_) => w.memory_current, - GrowMemory(_) => w.memory_grow, - CallIndirect(_, _) => w.call_indirect, - BrTable(ref data) => w - .br_table - .saturating_add(w.br_table_per_entry.saturating_mul(data.table.len() as u32)), - I32Clz | I64Clz => w.i64clz, - I32Ctz | I64Ctz => w.i64ctz, - I32Popcnt | I64Popcnt => w.i64popcnt, - I32Eqz | I64Eqz => w.i64eqz, - I64ExtendSI32 => w.i64extendsi32, - I64ExtendUI32 => w.i64extendui32, - I32WrapI64 => w.i32wrapi64, - I32Eq | I64Eq => w.i64eq, - I32Ne | I64Ne => w.i64ne, - I32LtS | I64LtS => w.i64lts, - I32LtU | I64LtU => w.i64ltu, - I32GtS | I64GtS => w.i64gts, - I32GtU | I64GtU => w.i64gtu, - I32LeS | I64LeS => w.i64les, - I32LeU | I64LeU => w.i64leu, - I32GeS | I64GeS => w.i64ges, - I32GeU | I64GeU => w.i64geu, - I32Add | I64Add => w.i64add, - I32Sub | I64Sub => w.i64sub, - I32Mul | I64Mul => w.i64mul, - I32DivS | I64DivS => w.i64divs, - I32DivU | I64DivU => w.i64divu, - I32RemS | I64RemS => w.i64rems, - I32RemU | I64RemU => w.i64remu, - I32And | I64And => w.i64and, - I32Or | I64Or => w.i64or, - I32Xor | I64Xor => w.i64xor, - I32Shl | I64Shl => w.i64shl, - I32ShrS | I64ShrS => w.i64shrs, - I32ShrU | I64ShrU => w.i64shru, - I32Rotl | I64Rotl => w.i64rotl, - I32Rotr | I64Rotr => w.i64rotr, - - // Returning None makes the gas instrumentation fail which we intend for - // unsupported or unknown instructions. Offchain we might allow indeterminism and hence - // use the fallback weight for those instructions. - _ if matches!(self.determinism, Determinism::Relaxed) && w.fallback > 0 => w.fallback, - _ => return None, - }; - Some(weight) - } - - fn memory_grow_cost(&self) -> gas_metering::MemoryGrowCost { - // We benchmarked the memory.grow instruction with the maximum allowed pages. - // The cost for growing is therefore already included in the instruction cost. - gas_metering::MemoryGrowCost::Free - } - - fn call_per_local_cost(&self) -> u32 { - self.schedule.instruction_weights.call_per_local - } -} - #[cfg(test)] mod test { use super::*; diff --git a/substrate/frame/contracts/src/tests.rs b/substrate/frame/contracts/src/tests.rs index 48b56128d5..1347e83ac9 100644 --- a/substrate/frame/contracts/src/tests.rs +++ b/substrate/frame/contracts/src/tests.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use self::test_utils::hash; +use self::test_utils::{ensure_stored, expected_deposit, hash}; use crate as pallet_contracts; use crate::{ chain_extension::{ @@ -25,11 +25,11 @@ use crate::{ exec::{Frame, Key}, storage::DeletionQueueManager, tests::test_utils::{get_contract, get_contract_checked}, - wasm::{Determinism, PrefabWasmModule, ReturnCode as RuntimeReturnCode}, + wasm::{Determinism, ReturnCode as RuntimeReturnCode}, weights::WeightInfo, - BalanceOf, Code, CodeStorage, CollectEvents, Config, ContractInfo, ContractInfoOf, DebugInfo, + BalanceOf, Code, CollectEvents, Config, ContractInfo, ContractInfoOf, DebugInfo, DefaultAddressGenerator, DeletionQueueCounter, Error, MigrationInProgress, NoopMigration, - Origin, Pallet, Schedule, + Origin, Pallet, PristineCode, Schedule, }; use assert_matches::assert_matches; use codec::Encode; @@ -83,15 +83,18 @@ macro_rules! assert_return_code { macro_rules! assert_refcount { ( $code_hash:expr , $should:expr $(,)? ) => {{ - let is = crate::OwnerInfoOf::::get($code_hash).map(|m| m.refcount()).unwrap(); + let is = crate::CodeInfoOf::::get($code_hash).map(|m| m.refcount()).unwrap(); assert_eq!(is, $should); }}; } pub mod test_utils { - use super::{Balances, Hash, SysConfig, Test}; - use crate::{exec::AccountIdOf, CodeHash, Config, ContractInfo, ContractInfoOf, Nonce}; - use codec::Encode; + use super::{Balances, DepositPerByte, DepositPerItem, Hash, SysConfig, Test}; + use crate::{ + exec::AccountIdOf, CodeHash, CodeInfo, CodeInfoOf, Config, ContractInfo, ContractInfoOf, + Nonce, PristineCode, + }; + use codec::{Encode, MaxEncodedLen}; use frame_support::traits::Currency; pub fn place_contract(address: &AccountIdOf, code_hash: CodeHash) { @@ -119,6 +122,20 @@ pub mod test_utils { pub fn hash(s: &S) -> <::Hashing as Hash>::Output { <::Hashing as Hash>::hash_of(s) } + pub fn expected_deposit(code_len: usize) -> u64 { + // For code_info, the deposit for max_encoded_len is taken. + let code_info_len = CodeInfo::::max_encoded_len() as u64; + // Calculate deposit to be reserved. + // We add 2 storage items: one for code, other for code_info + DepositPerByte::get().saturating_mul(code_len as u64 + code_info_len) + + DepositPerItem::get().saturating_mul(2) + } + pub fn ensure_stored(code_hash: CodeHash) -> usize { + // Assert that code_info is stored + assert!(CodeInfoOf::::contains_key(&code_hash)); + // Assert that contract code is stored, and get its size. + PristineCode::::try_get(&code_hash).unwrap().len() + } } impl Test { @@ -174,6 +191,8 @@ impl ChainExtension for TestExtension { where E: Ext, { + use codec::Decode; + let func_id = env.func_id(); let id = env.ext_id() as u32 | func_id as u32; match func_id { @@ -193,7 +212,11 @@ impl ChainExtension for TestExtension { }, 2 => { let mut env = env.buf_in_buf_out(); - let weight = Weight::from_parts(env.read(5)?[4].into(), 0); + let mut enc = &env.read(9)?[4..8]; + let weight = Weight::from_parts( + u32::decode(&mut enc).map_err(|_| Error::::ContractTrapped)?.into(), + 0, + ); env.charge_weight(weight)?; Ok(RetVal::Converging(id)) }, @@ -357,8 +380,7 @@ impl pallet_proxy::Config for Test { parameter_types! { pub MySchedule: Schedule = { - let mut schedule = >::default(); - schedule.instruction_weights.fallback = 1; + let schedule = >::default(); schedule }; pub static DepositPerByte: BalanceOf = 1; @@ -802,8 +824,9 @@ fn deposit_event_max_value_limit() { }); } +// Fail out of fuel (ref_time weight) in the engine. #[test] -fn run_out_of_gas() { +fn run_out_of_fuel_engine() { let (wasm, _code_hash) = compile_module::("run_out_of_gas").unwrap(); ExtBuilder::default().existential_deposit(50).build().execute_with(|| { let min_balance = ::Currency::minimum_balance(); @@ -840,6 +863,155 @@ fn run_out_of_gas() { }); } +// Fail out of fuel (ref_time weight) in the host. +#[test] +fn run_out_of_fuel_host() { + let (code, _hash) = compile_module::("chain_extension").unwrap(); + ExtBuilder::default().existential_deposit(50).build().execute_with(|| { + let min_balance = ::Currency::minimum_balance(); + let _ = Balances::deposit_creating(&ALICE, 1000 * min_balance); + + let addr = Contracts::bare_instantiate( + ALICE, + min_balance * 100, + GAS_LIMIT, + None, + Code::Upload(code), + vec![], + vec![], + DebugInfo::Skip, + CollectEvents::Skip, + ) + .result + .unwrap() + .account_id; + + let gas_limit = Weight::from_parts(u32::MAX as u64, GAS_LIMIT.proof_size()); + + // Use chain extension to charge more ref_time than it is available. + let result = Contracts::bare_call( + ALICE, + addr.clone(), + 0, + gas_limit, + None, + ExtensionInput { extension_id: 0, func_id: 2, extra: &u32::MAX.encode() }.into(), + DebugInfo::Skip, + CollectEvents::Skip, + Determinism::Enforced, + ) + .result; + assert_err!(result, >::OutOfGas); + }); +} + +#[test] +fn gas_syncs_work() { + let (wasm0, _code_hash) = compile_module::("seal_input_noop").unwrap(); + let (wasm1, _code_hash) = compile_module::("seal_input_once").unwrap(); + let (wasm2, _code_hash) = compile_module::("seal_input_twice").unwrap(); + ExtBuilder::default().existential_deposit(200).build().execute_with(|| { + let _ = Balances::deposit_creating(&ALICE, 1_000_000); + // Instantiate noop contract. + let addr0 = Contracts::bare_instantiate( + ALICE, + 0, + GAS_LIMIT, + None, + Code::Upload(wasm0), + vec![], + vec![], + DebugInfo::Skip, + CollectEvents::Skip, + ) + .result + .unwrap() + .account_id; + + // Instantiate 1st contract. + let addr1 = Contracts::bare_instantiate( + ALICE, + 0, + GAS_LIMIT, + None, + Code::Upload(wasm1), + vec![], + vec![], + DebugInfo::Skip, + CollectEvents::Skip, + ) + .result + .unwrap() + .account_id; + + // Instantiate 2nd contract. + let addr2 = Contracts::bare_instantiate( + ALICE, + 0, + GAS_LIMIT, + None, + Code::Upload(wasm2), + vec![], + vec![], + DebugInfo::Skip, + CollectEvents::Skip, + ) + .result + .unwrap() + .account_id; + + let result = Contracts::bare_call( + ALICE, + addr0, + 0, + GAS_LIMIT, + None, + 1u8.to_le_bytes().to_vec(), + DebugInfo::Skip, + CollectEvents::Skip, + Determinism::Enforced, + ); + assert_ok!(result.result); + let engine_consumed_noop = result.gas_consumed.ref_time(); + + let result = Contracts::bare_call( + ALICE, + addr1, + 0, + GAS_LIMIT, + None, + 1u8.to_le_bytes().to_vec(), + DebugInfo::Skip, + CollectEvents::Skip, + Determinism::Enforced, + ); + assert_ok!(result.result); + let gas_consumed_once = result.gas_consumed.ref_time(); + let host_consumed_once = ::Schedule::get().host_fn_weights.input.ref_time(); + let engine_consumed_once = gas_consumed_once - host_consumed_once - engine_consumed_noop; + + let result = Contracts::bare_call( + ALICE, + addr2, + 0, + GAS_LIMIT, + None, + 1u8.to_le_bytes().to_vec(), + DebugInfo::Skip, + CollectEvents::Skip, + Determinism::Enforced, + ); + assert_ok!(result.result); + let gas_consumed_twice = result.gas_consumed.ref_time(); + let host_consumed_twice = host_consumed_once * 2; + let engine_consumed_twice = gas_consumed_twice - host_consumed_twice - engine_consumed_noop; + + // Second contract just repeats first contract's instructions twice. + // If runtime syncs gas with the engine properly, this should pass. + assert_eq!(engine_consumed_twice, engine_consumed_once * 2); + }); +} + /// Check that contracts with the same account id have different trie ids. /// Check the `Nonce` storage item for more information. #[test] @@ -1949,7 +2121,7 @@ fn chain_extension_works() { 0, GAS_LIMIT, None, - ExtensionInput { extension_id: 0, func_id: 2, extra: &[0] }.into(), + ExtensionInput { extension_id: 0, func_id: 2, extra: &0u32.encode() }.into(), DebugInfo::Skip, CollectEvents::Skip, Determinism::Enforced, @@ -1962,7 +2134,7 @@ fn chain_extension_works() { 0, GAS_LIMIT, None, - ExtensionInput { extension_id: 0, func_id: 2, extra: &[42] }.into(), + ExtensionInput { extension_id: 0, func_id: 2, extra: &42u32.encode() }.into(), DebugInfo::Skip, CollectEvents::Skip, Determinism::Enforced, @@ -1975,7 +2147,7 @@ fn chain_extension_works() { 0, GAS_LIMIT, None, - ExtensionInput { extension_id: 0, func_id: 2, extra: &[95] }.into(), + ExtensionInput { extension_id: 0, func_id: 2, extra: &95u32.encode() }.into(), DebugInfo::Skip, CollectEvents::Skip, Determinism::Enforced, @@ -2582,7 +2754,7 @@ fn refcounter() { assert_refcount!(code_hash, 1); // Pristine code should still be there - crate::PristineCode::::get(code_hash).unwrap(); + PristineCode::::get(code_hash).unwrap(); // remove the last contract assert_ok!(Contracts::call( @@ -2597,90 +2769,6 @@ fn refcounter() { // refcount is `0` but code should still exists because it needs to be removed manually assert!(crate::PristineCode::::contains_key(&code_hash)); - assert!(crate::CodeStorage::::contains_key(&code_hash)); - }); -} - -#[test] -fn reinstrument_does_charge() { - let (wasm, code_hash) = compile_module::("return_with_data").unwrap(); - ExtBuilder::default().existential_deposit(50).build().execute_with(|| { - let _ = Balances::deposit_creating(&ALICE, 1_000_000); - let min_balance = ::Currency::minimum_balance(); - let zero = 0u32.to_le_bytes().encode(); - let code_len = wasm.len() as u32; - - let addr = Contracts::bare_instantiate( - ALICE, - min_balance * 100, - GAS_LIMIT, - None, - Code::Upload(wasm), - zero.clone(), - vec![], - DebugInfo::Skip, - CollectEvents::Skip, - ) - .result - .unwrap() - .account_id; - - // Call the contract two times without reinstrument - - let result0 = Contracts::bare_call( - ALICE, - addr.clone(), - 0, - GAS_LIMIT, - None, - zero.clone(), - DebugInfo::Skip, - CollectEvents::Skip, - Determinism::Enforced, - ); - assert!(!result0.result.unwrap().did_revert()); - - let result1 = Contracts::bare_call( - ALICE, - addr.clone(), - 0, - GAS_LIMIT, - None, - zero.clone(), - DebugInfo::Skip, - CollectEvents::Skip, - Determinism::Enforced, - ); - assert!(!result1.result.unwrap().did_revert()); - - // They should match because both where called with the same schedule. - assert_eq!(result0.gas_consumed, result1.gas_consumed); - - // We cannot change the schedule. Instead, we decrease the version of the deployed - // contract below the current schedule's version. - crate::CodeStorage::mutate(&code_hash, |code: &mut Option>| { - code.as_mut().unwrap().decrement_version(); - }); - - // This call should trigger reinstrumentation - let result2 = Contracts::bare_call( - ALICE, - addr.clone(), - 0, - GAS_LIMIT, - None, - zero.clone(), - DebugInfo::Skip, - CollectEvents::Skip, - Determinism::Enforced, - ); - assert!(!result2.result.unwrap().did_revert()); - assert!(result2.gas_consumed.ref_time() > result1.gas_consumed.ref_time()); - assert_eq!( - result2.gas_consumed.ref_time(), - result1.gas_consumed.ref_time() + - ::WeightInfo::reinstrument(code_len).ref_time(), - ); }); } @@ -2874,7 +2962,7 @@ fn gas_estimation_nested_call_fixed_limit() { .result ); - // Make the same call using proof_size a but less than estimated. Should fail with OutOfGas. + // Make the same call using proof_size but less than estimated. Should fail with OutOfGas. let result = Contracts::bare_call( ALICE, addr_caller, @@ -3395,14 +3483,16 @@ fn upload_code_works() { // Drop previous events initialize_block(2); - assert!(!>::contains_key(code_hash)); + assert!(!PristineCode::::contains_key(&code_hash)); + assert_ok!(Contracts::upload_code( RuntimeOrigin::signed(ALICE), wasm, Some(codec::Compact(1_000)), Determinism::Enforced, )); - assert!(>::contains_key(code_hash)); + // Ensure the contract was stored and get expected deposit amount to be reserved. + let deposit_expected = expected_deposit(ensure_stored(code_hash)); assert_eq!( System::events(), @@ -3411,7 +3501,7 @@ fn upload_code_works() { phase: Phase::Initialization, event: RuntimeEvent::Balances(pallet_balances::Event::Reserved { who: ALICE, - amount: 173, + amount: deposit_expected, }), topics: vec![], }, @@ -3428,6 +3518,8 @@ fn upload_code_works() { #[test] fn upload_code_limit_too_low() { let (wasm, _code_hash) = compile_module::("dummy").unwrap(); + let deposit_expected = expected_deposit(wasm.len()); + let deposit_insufficient = deposit_expected.saturating_sub(1); ExtBuilder::default().existential_deposit(100).build().execute_with(|| { let _ = Balances::deposit_creating(&ALICE, 1_000_000); @@ -3439,7 +3531,7 @@ fn upload_code_limit_too_low() { Contracts::upload_code( RuntimeOrigin::signed(ALICE), wasm, - Some(codec::Compact(100)), + Some(codec::Compact(deposit_insufficient)), Determinism::Enforced ), >::StorageDepositLimitExhausted, @@ -3452,9 +3544,11 @@ fn upload_code_limit_too_low() { #[test] fn upload_code_not_enough_balance() { let (wasm, _code_hash) = compile_module::("dummy").unwrap(); + let deposit_expected = expected_deposit(wasm.len()); + let deposit_insufficient = deposit_expected.saturating_sub(1); ExtBuilder::default().existential_deposit(100).build().execute_with(|| { - let _ = Balances::deposit_creating(&ALICE, 150); + let _ = Balances::deposit_creating(&ALICE, deposit_insufficient); // Drop previous events initialize_block(2); @@ -3489,11 +3583,10 @@ fn remove_code_works() { Some(codec::Compact(1_000)), Determinism::Enforced, )); + // Ensure the contract was stored and get expected deposit amount to be reserved. + let deposit_expected = expected_deposit(ensure_stored(code_hash)); - assert!(>::contains_key(code_hash)); assert_ok!(Contracts::remove_code(RuntimeOrigin::signed(ALICE), code_hash)); - assert!(!>::contains_key(code_hash)); - assert_eq!( System::events(), vec![ @@ -3501,7 +3594,7 @@ fn remove_code_works() { phase: Phase::Initialization, event: RuntimeEvent::Balances(pallet_balances::Event::Reserved { who: ALICE, - amount: 173, + amount: deposit_expected, }), topics: vec![], }, @@ -3514,7 +3607,7 @@ fn remove_code_works() { phase: Phase::Initialization, event: RuntimeEvent::Balances(pallet_balances::Event::Unreserved { who: ALICE, - amount: 173, + amount: deposit_expected, }), topics: vec![], }, @@ -3544,6 +3637,8 @@ fn remove_code_wrong_origin() { Some(codec::Compact(1_000)), Determinism::Enforced, )); + // Ensure the contract was stored and get expected deposit amount to be reserved. + let deposit_expected = expected_deposit(ensure_stored(code_hash)); assert_noop!( Contracts::remove_code(RuntimeOrigin::signed(BOB), code_hash), @@ -3557,7 +3652,7 @@ fn remove_code_wrong_origin() { phase: Phase::Initialization, event: RuntimeEvent::Balances(pallet_balances::Event::Reserved { who: ALICE, - amount: 173, + amount: deposit_expected, }), topics: vec![], }, @@ -3648,6 +3743,8 @@ fn instantiate_with_zero_balance_works() { // Check that the BOB contract has been instantiated. let contract = get_contract(&addr); let deposit_account = contract.deposit_account().deref(); + // Ensure the contract was stored and get expected deposit amount to be reserved. + let deposit_expected = expected_deposit(ensure_stored(code_hash)); // Make sure the account exists even though no free balance was send assert_eq!(::Currency::free_balance(&addr), min_balance); @@ -3708,7 +3805,7 @@ fn instantiate_with_zero_balance_works() { phase: Phase::Initialization, event: RuntimeEvent::Balances(pallet_balances::Event::Reserved { who: ALICE, - amount: 173, + amount: deposit_expected, }), topics: vec![], }, @@ -3759,7 +3856,8 @@ fn instantiate_with_below_existential_deposit_works() { // Check that the BOB contract has been instantiated. let contract = get_contract(&addr); let deposit_account = contract.deposit_account().deref(); - + // Ensure the contract was stored and get expected deposit amount to be reserved. + let deposit_expected = expected_deposit(ensure_stored(code_hash)); // Make sure the account exists even though not enough free balance was send assert_eq!(::Currency::free_balance(&addr), min_balance + 50); assert_eq!(::Currency::total_balance(&addr), min_balance + 50); @@ -3828,7 +3926,7 @@ fn instantiate_with_below_existential_deposit_works() { phase: Phase::Initialization, event: RuntimeEvent::Balances(pallet_balances::Event::Reserved { who: ALICE, - amount: 173, + amount: deposit_expected, }), topics: vec![], }, @@ -4321,7 +4419,7 @@ fn code_rejected_error_works() { assert_err!(result.result, >::CodeRejected); assert_eq!( std::str::from_utf8(&result.debug_message).unwrap(), - "validation of new code failed" + "Validation of new code failed!" ); let (wasm, _) = compile_module::("invalid_contract").unwrap(); diff --git a/substrate/frame/contracts/src/wasm/code_cache.rs b/substrate/frame/contracts/src/wasm/code_cache.rs deleted file mode 100644 index 7dbce367ca..0000000000 --- a/substrate/frame/contracts/src/wasm/code_cache.rs +++ /dev/null @@ -1,239 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! A module that implements instrumented code cache. -//! -//! - In order to run contract code we need to instrument it with gas metering. -//! To do that we need to provide the schedule which will supply exact gas costs values. -//! We cache this code in the storage saving the schedule version. -//! - Before running contract code we check if the cached code has the schedule version that -//! is equal to the current saved schedule. -//! If it is equal then run the code, if it isn't reinstrument with the current schedule. -//! - When we update the schedule we want it to have strictly greater version than the current saved -//! one: -//! this guarantees that every instrumented contract code in cache cannot have the version equal to -//! the current one. Thus, before executing a contract it should be reinstrument with new schedule. - -use crate::{ - gas::{GasMeter, Token}, - wasm::{prepare, PrefabWasmModule}, - weights::WeightInfo, - CodeHash, CodeStorage, Config, Error, Event, OwnerInfoOf, Pallet, PristineCode, Schedule, - Weight, -}; -use frame_support::{ - dispatch::{DispatchError, DispatchResult}, - ensure, - traits::{Get, ReservableCurrency}, - WeakBoundedVec, -}; -use sp_runtime::traits::BadOrigin; -use sp_std::vec; - -/// Put the instrumented module in storage. -/// -/// Increments the refcount of the in-storage `prefab_module` if it already exists in storage -/// under the specified `code_hash`. -pub fn store(mut module: PrefabWasmModule, instantiated: bool) -> DispatchResult { - let code_hash = sp_std::mem::take(&mut module.code_hash); - >::mutate(&code_hash, |owner_info| { - match owner_info { - // Instantiate existing contract. - // - // No need to update the `CodeStorage` as any re-instrumentation eagerly saves - // the re-instrumented code. - Some(owner_info) if instantiated => { - owner_info.refcount = owner_info.refcount.checked_add(1).expect( - " - refcount is 64bit. Generating this overflow would require to store - _at least_ 18 exabyte of data assuming that a contract consumes only - one byte of data. Any node would run out of storage space before hitting - this overflow. - qed - ", - ); - Ok(()) - }, - // Re-upload existing contract without executing it. - // - // We are careful here to just overwrite the code to not include it into the PoV. - // We do this because the uploaded code was instrumented with the latest schedule - // and hence we persist those changes. Otherwise the next execution will pay again - // for the instrumentation. - Some(_) => { - >::insert(&code_hash, module); - Ok(()) - }, - // Upload a new contract. - // - // We need to write all data structures and collect the deposit. - None => { - let orig_code = module.original_code.take().expect( - " - If an executable isn't in storage it was uploaded. - If it was uploaded the original code must exist. qed - ", - ); - let mut new_owner_info = module.owner_info.take().expect( - "If an executable isn't in storage it was uploaded. - If it was uploaded the owner info was generated and attached. qed - ", - ); - // This `None` case happens only in freshly uploaded modules. This means that - // the `owner` is always the origin of the current transaction. - T::Currency::reserve(&new_owner_info.owner, new_owner_info.deposit) - .map_err(|_| >::StorageDepositNotEnoughFunds)?; - new_owner_info.refcount = if instantiated { 1 } else { 0 }; - >::insert(&code_hash, orig_code); - >::insert(&code_hash, module); - *owner_info = Some(new_owner_info); - >::deposit_event(vec![code_hash], Event::CodeStored { code_hash }); - Ok(()) - }, - } - }) -} - -/// Decrement the refcount of a code in-storage by one. -/// -/// # Note -/// -/// A contract whose refcount dropped to zero isn't automatically removed. A `remove_code` -/// transaction must be submitted by the original uploader to do so. -pub fn decrement_refcount(code_hash: CodeHash) { - >::mutate(code_hash, |existing| { - if let Some(info) = existing { - info.refcount = info.refcount.saturating_sub(1); - } - }); -} - -/// Increment the refcount of a code in-storage by one. -/// -/// # Errors -/// -/// [`Error::CodeNotFound`] is returned if the specified `code_hash` does not exist. -pub fn increment_refcount(code_hash: CodeHash) -> Result<(), DispatchError> { - >::mutate(code_hash, |existing| -> Result<(), DispatchError> { - if let Some(info) = existing { - info.refcount = info.refcount.saturating_add(1); - Ok(()) - } else { - Err(Error::::CodeNotFound.into()) - } - }) -} - -/// Try to remove code together with all associated information. -pub fn try_remove(origin: &T::AccountId, code_hash: CodeHash) -> DispatchResult { - >::try_mutate_exists(&code_hash, |existing| { - if let Some(owner_info) = existing { - ensure!(owner_info.refcount == 0, >::CodeInUse); - ensure!(&owner_info.owner == origin, BadOrigin); - T::Currency::unreserve(&owner_info.owner, owner_info.deposit); - *existing = None; - >::remove(&code_hash); - >::remove(&code_hash); - >::deposit_event(vec![code_hash], Event::CodeRemoved { code_hash }); - Ok(()) - } else { - Err(>::CodeNotFound.into()) - } - }) -} - -/// Load code with the given code hash. -/// -/// If the module was instrumented with a lower version of schedule than -/// the current one given as an argument, then this function will perform -/// re-instrumentation and update the cache in the storage. -pub fn load( - code_hash: CodeHash, - schedule: &Schedule, - gas_meter: &mut GasMeter, -) -> Result, DispatchError> { - let max_code_len = T::MaxCodeLen::get(); - let charged = gas_meter.charge(CodeToken::Load(max_code_len))?; - - let mut prefab_module = >::get(code_hash).ok_or(Error::::CodeNotFound)?; - let instrumented_code_len = prefab_module.code.len() as u32; - gas_meter.adjust_gas(charged, CodeToken::Load(instrumented_code_len)); - prefab_module.code_hash = code_hash; - - if prefab_module.instruction_weights_version < schedule.instruction_weights.version { - // The instruction weights have changed. - // We need to re-instrument the code with the new instruction weights. - let charged = gas_meter.charge(CodeToken::Reinstrument(instrumented_code_len))?; - let orig_code_len = reinstrument(&mut prefab_module, schedule)?; - gas_meter.adjust_gas(charged, CodeToken::Reinstrument(orig_code_len)); - } - - Ok(prefab_module) -} - -/// Instruments the passed prefab wasm module with the supplied schedule. -/// -/// Returns the size in bytes of the uninstrumented code. -pub fn reinstrument( - prefab_module: &mut PrefabWasmModule, - schedule: &Schedule, -) -> Result { - let original_code = - >::get(&prefab_module.code_hash).ok_or(Error::::CodeNotFound)?; - let original_code_len = original_code.len(); - // We need to allow contracts growing too big after re-instrumentation. Otherwise - // the contract can become inaccessible. The user has no influence over this size - // as the contract is already deployed and every change in size would be the result - // of changes in the instrumentation algorithm controlled by the chain authors. - prefab_module.code = WeakBoundedVec::force_from( - prepare::reinstrument::( - &original_code, - schedule, - prefab_module.determinism, - )?, - Some("Contract exceeds size limit after re-instrumentation."), - ); - prefab_module.instruction_weights_version = schedule.instruction_weights.version; - >::insert(&prefab_module.code_hash, &*prefab_module); - Ok(original_code_len as u32) -} - -/// Costs for operations that are related to code handling. -#[cfg_attr(test, derive(Debug, PartialEq, Eq))] -#[derive(Clone, Copy)] -enum CodeToken { - /// Weight for reinstrumenting a contract contract of the supplied size in bytes. - Reinstrument(u32), - /// Weight for loading a contract per byte. - Load(u32), -} - -impl Token for CodeToken { - fn weight(&self) -> Weight { - use self::CodeToken::*; - // In case of `Load` we already covered the general costs of - // calling the storage but still need to account for the actual size of the - // contract code. This is why we subtract `T::*::(0)`. We need to do this at this - // point because when charging the general weight for calling the contract we not know the - // size of the contract. - match *self { - Reinstrument(len) => T::WeightInfo::reinstrument(len), - Load(len) => T::WeightInfo::call_with_code_per_byte(len) - .saturating_sub(T::WeightInfo::call_with_code_per_byte(0)), - } - } -} diff --git a/substrate/frame/contracts/src/wasm/mod.rs b/substrate/frame/contracts/src/wasm/mod.rs index 224c116946..6eca21336b 100644 --- a/substrate/frame/contracts/src/wasm/mod.rs +++ b/substrate/frame/contracts/src/wasm/mod.rs @@ -18,13 +18,9 @@ //! This module provides a means for executing contracts //! represented in wasm. -mod code_cache; mod prepare; mod runtime; -#[cfg(feature = "runtime-benchmarks")] -pub use crate::wasm::code_cache::reinstrument; - #[cfg(doc)] pub use crate::wasm::runtime::api_doc; @@ -41,81 +37,66 @@ pub use crate::wasm::{ use crate::{ exec::{ExecResult, Executable, ExportedFunction, Ext}, - gas::GasMeter, - AccountIdOf, BalanceOf, CodeHash, CodeVec, Config, Error, OwnerInfoOf, RelaxedCodeVec, - Schedule, LOG_TARGET, + gas::{GasMeter, Token}, + wasm::prepare::IMPORT_MODULE_MEMORY, + weights::WeightInfo, + AccountIdOf, BadOrigin, BalanceOf, CodeHash, CodeInfoOf, CodeVec, Config, Error, Event, Pallet, + PristineCode, Schedule, Weight, LOG_TARGET, }; use codec::{Decode, Encode, MaxEncodedLen}; -use frame_support::dispatch::{DispatchError, DispatchResult}; +use frame_support::{ + dispatch::{DispatchError, DispatchResult}, + ensure, + traits::ReservableCurrency, +}; use sp_core::Get; use sp_runtime::RuntimeDebug; use sp_std::prelude::*; use wasmi::{ - Config as WasmiConfig, Engine, Instance, Linker, Memory, MemoryType, Module, StackLimits, Store, + Config as WasmiConfig, Engine, ExternType, FuelConsumptionMode, Instance, Linker, Memory, + MemoryType, Module, StackLimits, Store, }; +const BYTES_PER_PAGE: usize = 64 * 1024; -/// A prepared wasm module ready for execution. -/// -/// # Note -/// -/// This data structure is mostly immutable once created and stored. The exceptions that -/// can be changed by calling a contract are `instruction_weights_version` and `code`. -/// `instruction_weights_version` and `code` change when a contract with an outdated instrumentation -/// is called. Therefore one must be careful when holding any in-memory representation of this -/// type while calling into a contract as those fields can get out of date. -#[derive(Clone, Encode, Decode, scale_info::TypeInfo, MaxEncodedLen)] +/// Validated Wasm module ready for execution. +/// This data structure is immutable once created and stored. +#[derive(Encode, Decode, scale_info::TypeInfo)] #[codec(mel_bound())] #[scale_info(skip_type_params(T))] -pub struct PrefabWasmModule { - /// Version of the instruction weights with which the code was instrumented. - #[codec(compact)] - instruction_weights_version: u32, - /// Initial memory size of a contract's sandbox. - #[codec(compact)] - initial: u32, - /// The maximum memory size of a contract's sandbox. - #[codec(compact)] - maximum: u32, - /// Code instrumented with the latest schedule. - code: RelaxedCodeVec, - /// A code that might contain non deterministic features and is therefore never allowed - /// to be run on chain. Specifically this code can never be instantiated into a contract - /// and can just be used through a delegate call. - determinism: Determinism, - /// The uninstrumented, pristine version of the code. - /// - /// It is not stored because the pristine code has its own storage item. The value - /// is only `Some` when this module was created from an `original_code` and `None` if - /// it was loaded from storage. +pub struct WasmBlob { + code: CodeVec, + // This isn't needed for contract execution and is not stored alongside it. #[codec(skip)] - original_code: Option>, - /// The code hash of the stored code which is defined as the hash over the `original_code`. - /// - /// As the map key there is no need to store the hash in the value, too. It is set manually - /// when loading the module from storage. + code_info: CodeInfo, + // This is for not calculating the hash every time we need it. #[codec(skip)] code_hash: CodeHash, - // This isn't needed for contract execution and does not get loaded from storage by default. - // It is `Some` if and only if this struct was generated from code. - #[codec(skip)] - owner_info: Option>, } -/// Information that belongs to a [`PrefabWasmModule`] but is stored separately. +/// Contract code related data, such as: +/// +/// - owner of the contract, i.e. account uploaded its code, +/// - storage deposit amount, +/// - reference count, +/// - determinism marker. /// /// It is stored in a separate storage entry to avoid loading the code when not necessary. #[derive(Clone, Encode, Decode, scale_info::TypeInfo, MaxEncodedLen)] #[codec(mel_bound())] #[scale_info(skip_type_params(T))] -pub struct OwnerInfo { - /// The account that has deployed the contract and hence is allowed to remove it. +pub struct CodeInfo { + /// The account that has uploaded the contract code and hence is allowed to remove it. owner: AccountIdOf, - /// The amount of balance that was deposited by the owner in order to deploy it. + /// The amount of balance that was deposited by the owner in order to store it on-chain. #[codec(compact)] deposit: BalanceOf, - /// The number of contracts that use this as their code. + /// The number of instantiated contracts that use this as their code. #[codec(compact)] refcount: u64, + /// Marks if the code might contain non-deterministic features and is therefore never allowed + /// to be run on-chain. Specifically, such a code can never be instantiated into a contract + /// and can just be used through a delegate call. + determinism: Determinism, } /// Defines the required determinism level of a wasm blob when either running or uploading code. @@ -149,26 +130,42 @@ impl ExportedFunction { } } -impl PrefabWasmModule { - /// Create the module by checking and instrumenting `original_code`. +/// Cost of code loading from storage. +#[cfg_attr(test, derive(Debug, PartialEq, Eq))] +#[derive(Clone, Copy)] +struct CodeLoadToken(u32); + +impl Token for CodeLoadToken { + fn weight(&self) -> Weight { + // When loading the contract, we already covered the general costs of + // calling the storage but still need to account for the actual size of the + // contract code. This is why we subtract `T::*::(0)`. We need to do this at this + // point because when charging the general weight for calling the contract we don't know the + // size of the contract. + T::WeightInfo::call_with_code_per_byte(self.0) + .saturating_sub(T::WeightInfo::call_with_code_per_byte(0)) + } +} + +impl WasmBlob { + /// Create the module by checking the `code`. /// /// This does **not** store the module. For this one need to either call [`Self::store`] /// or [`::execute`][`Executable::execute`]. pub fn from_code( - original_code: Vec, + code: Vec, schedule: &Schedule, owner: AccountIdOf, determinism: Determinism, try_instantiate: TryInstantiate, ) -> Result { - let module = prepare::prepare::( - original_code.try_into().map_err(|_| (>::CodeTooLarge.into(), ""))?, + prepare::prepare::( + code.try_into().map_err(|_| (>::CodeTooLarge.into(), ""))?, schedule, owner, determinism, try_instantiate, - )?; - Ok(module) + ) } /// Store the code without instantiating it. @@ -176,27 +173,25 @@ impl PrefabWasmModule { /// Otherwise the code is stored when [`::execute`][`Executable::execute`] /// is called. pub fn store(self) -> DispatchResult { - code_cache::store(self, false) + Self::store_code(self, false) } /// Remove the code from storage and refund the deposit to its owner. /// /// Applies all necessary checks before removing the code. pub fn remove(origin: &T::AccountId, code_hash: CodeHash) -> DispatchResult { - code_cache::try_remove::(origin, code_hash) + Self::try_remove_code(origin, code_hash) } /// Returns whether there is a deposit to be paid for this module. /// /// Returns `0` if the module is already in storage and hence no deposit will - /// be charged when storing it. - pub fn open_deposit(&self) -> BalanceOf { - if >::contains_key(&self.code_hash) { + /// be charged for storing it. + pub fn open_deposit(&self, code_info: &CodeInfo) -> BalanceOf { + if >::contains_key(self.code_hash()) { 0u32.into() } else { - // Only already in-storage contracts have their `owner_info` set to `None`. - // Therefore it is correct to return `0` in this case. - self.owner_info.as_ref().map(|i| i.deposit).unwrap_or_default() + code_info.deposit } } @@ -204,14 +199,14 @@ impl PrefabWasmModule { /// /// This is either used for later executing a contract or for validation of a contract. /// When validating we pass `()` as `host_state`. Please note that such a dummy instance must - /// **never** be called/executed since it will panic the executor. + /// **never** be called/executed, since it will panic the executor. pub fn instantiate( code: &[u8], host_state: H, - memory: (u32, u32), + schedule: &Schedule, stack_limits: StackLimits, allow_deprecated: AllowDeprecatedInterface, - ) -> Result<(Store, Memory, Instance), wasmi::Error> + ) -> Result<(Store, Memory, Instance), &'static str> where E: Environment, { @@ -221,9 +216,12 @@ impl PrefabWasmModule { .wasm_multi_value(false) .wasm_mutable_global(false) .wasm_sign_extension(false) - .wasm_saturating_float_to_int(false); + .wasm_saturating_float_to_int(false) + .consume_fuel(true) + .fuel_consumption_mode(FuelConsumptionMode::Eager); + let engine = Engine::new(&config); - let module = Module::new(&engine, code)?; + let module = Module::new(&engine, code.clone()).map_err(|_| "can't decode Wasm module")?; let mut store = Store::new(&engine, host_state); let mut linker = Linker::new(&engine); E::define( @@ -235,55 +233,187 @@ impl PrefabWasmModule { AllowUnstableInterface::No }, allow_deprecated, - )?; - let memory = Memory::new(&mut store, MemoryType::new(memory.0, Some(memory.1))?).expect( - "The limits defined in our `Schedule` limit the amount of memory well below u32::MAX; qed", - ); + ) + .map_err(|_| "can't define host functions to Linker")?; + // Query wasmi for memory limits specified in the module's import entry. + let memory_limits = Self::get_memory_limits(module.imports(), schedule)?; + // Here we allocate this memory in the _store_. It allocates _inital_ value, but allows it + // to grow up to maximum number of memory pages, if neccesary. + let qed = "We checked the limits versus our Schedule, + which specifies the max amount of memory pages + well below u16::MAX; qed"; + let memory = Memory::new( + &mut store, + MemoryType::new(memory_limits.0, Some(memory_limits.1)).expect(qed), + ) + .expect(qed); linker .define("env", "memory", memory) - .expect("We just created the linker. It has no define with this name attached; qed"); + .expect("We just created the Linker. It has no definitions with this name; qed"); - let instance = linker.instantiate(&mut store, &module)?.ensure_no_start(&mut store)?; + let instance = linker + .instantiate(&mut store, &module) + .map_err(|_| "can't instantiate module with provided definitions")? + .ensure_no_start(&mut store) + .map_err(|_| "start function is forbidden but found in the module")?; Ok((store, memory, instance)) } + /// Query wasmi for memory limits specified for the import in Wasm module. + fn get_memory_limits( + imports: wasmi::ModuleImportsIter, + schedule: &Schedule, + ) -> Result<(u32, u32), &'static str> { + let mut mem_type = None; + for import in imports { + match *import.ty() { + ExternType::Memory(mt) => { + if import.module() != IMPORT_MODULE_MEMORY { + return Err("Invalid module for imported memory") + } + if import.name() != "memory" { + return Err("Memory import must have the field name 'memory'") + } + mem_type = Some(mt); + break + }, + _ => continue, + } + } + // We don't need to check here if module memory limits satisfy the schedule, + // as this was already done during the code uploading. + // If none memory imported then set its limits to (0,0). + // Any access to it will then lead to out of bounds trap. + let (initial, maximum) = mem_type.map_or(Default::default(), |mt| { + ( + mt.initial_pages().to_bytes().unwrap_or(0).saturating_div(BYTES_PER_PAGE) as u32, + mt.maximum_pages().map_or(schedule.limits.memory_pages, |p| { + p.to_bytes().unwrap_or(0).saturating_div(BYTES_PER_PAGE) as u32 + }), + ) + }); + if initial > maximum { + return Err( + "Requested initial number of memory pages should not exceed the requested maximum", + ) + } + if maximum > schedule.limits.memory_pages { + return Err("Maximum number of memory pages should not exceed the maximum configured in the Schedule.") + } + Ok((initial, maximum)) + } + + /// Getter method for the code_info. + pub fn code_info(&self) -> &CodeInfo { + &self.code_info + } + + /// Put the module blob into storage. + /// + /// Increments the reference count of the in-storage `WasmBlob`, if it already exists in + /// storage. + fn store_code(mut module: Self, instantiated: bool) -> DispatchResult { + let code_hash = &module.code_hash().clone(); + >::mutate(code_hash, |stored_code_info| { + match stored_code_info { + // Instantiate existing contract. + Some(stored_code_info) if instantiated => { + stored_code_info.refcount = stored_code_info.refcount.checked_add(1).expect( + " + refcount is 64bit. Generating this overflow would require to store + _at least_ 18 exabyte of data assuming that a contract consumes only + one byte of data. Any node would run out of storage space before hitting + this overflow; + qed + ", + ); + Ok(()) + }, + // Contract code is already stored in storage. Nothing to be done here. + Some(_) => Ok(()), + // Upload a new contract code. + // + // We need to store the code and its code_info, and collect the deposit. + None => { + // This `None` case happens only in freshly uploaded modules. This means that + // the `owner` is always the origin of the current transaction. + T::Currency::reserve(&module.code_info.owner, module.code_info.deposit) + .map_err(|_| >::StorageDepositNotEnoughFunds)?; + module.code_info.refcount = if instantiated { 1 } else { 0 }; + >::insert(code_hash, module.code); + *stored_code_info = Some(module.code_info); + >::deposit_event( + vec![*code_hash], + Event::CodeStored { code_hash: *code_hash }, + ); + Ok(()) + }, + } + }) + } + + /// Try to remove code together with all associated information. + fn try_remove_code(origin: &T::AccountId, code_hash: CodeHash) -> DispatchResult { + >::try_mutate_exists(&code_hash, |existing| { + if let Some(code_info) = existing { + ensure!(code_info.refcount == 0, >::CodeInUse); + ensure!(&code_info.owner == origin, BadOrigin); + T::Currency::unreserve(&code_info.owner, code_info.deposit); + *existing = None; + >::remove(&code_hash); + >::deposit_event(vec![code_hash], Event::CodeRemoved { code_hash }); + Ok(()) + } else { + Err(>::CodeNotFound.into()) + } + }) + } + + /// Load code with the given code hash. + fn load_code( + code_hash: CodeHash, + gas_meter: &mut GasMeter, + ) -> Result, DispatchError> { + let max_code_len = T::MaxCodeLen::get(); + let charged = gas_meter.charge(CodeLoadToken(max_code_len))?; + + let code = >::get(code_hash).ok_or(Error::::CodeNotFound)?; + let code_len = code.len() as u32; + gas_meter.adjust_gas(charged, CodeLoadToken(code_len)); + + Ok(code) + } + /// See [`Self::from_code_unchecked`]. #[cfg(feature = "runtime-benchmarks")] pub fn store_code_unchecked( - original_code: Vec, + code: Vec, schedule: &Schedule, owner: T::AccountId, ) -> DispatchResult { - let executable = Self::from_code_unchecked(original_code, schedule, owner)?; - code_cache::store(executable, false) + let executable = Self::from_code_unchecked(code, schedule, owner)?; + Self::store_code(executable, false) } - /// Decrement instruction_weights_version by 1. Panics if it is already 0. - #[cfg(test)] - pub fn decrement_version(&mut self) { - self.instruction_weights_version = self.instruction_weights_version.checked_sub(1).unwrap(); - } - - /// Create the module without checking nor instrumenting the passed code. + /// Create the module without checking the passed code. /// /// # Note /// - /// This is useful for benchmarking where we don't want instrumentation to skew + /// This is useful for benchmarking where we don't want validation of the module to skew /// our results. This also does not collect any deposit from the `owner`. Also useful /// during testing when we want to deploy codes that do not pass the instantiation checks. #[cfg(any(test, feature = "runtime-benchmarks"))] fn from_code_unchecked( - original_code: Vec, + code: Vec, schedule: &Schedule, owner: T::AccountId, ) -> Result { - prepare::benchmarking::prepare(original_code, schedule, owner) - .map_err::(Into::into) + prepare::benchmarking::prepare(code, schedule, owner) } } -impl OwnerInfo { +impl CodeInfo { /// Return the refcount of the module. #[cfg(test)] pub fn refcount(&self) -> u64 { @@ -291,21 +421,38 @@ impl OwnerInfo { } } -impl Executable for PrefabWasmModule { +impl Executable for WasmBlob { fn from_storage( code_hash: CodeHash, - schedule: &Schedule, gas_meter: &mut GasMeter, ) -> Result { - code_cache::load(code_hash, schedule, gas_meter) + let code = Self::load_code(code_hash, gas_meter)?; + // We store `code_info` at the same time as contract code, + // therefore this query shouldn't really fail. + // We consider its failure equal to `CodeNotFound`, as contract code without + // `code_info` is unusable in this pallet. + let code_info = >::get(code_hash).ok_or(Error::::CodeNotFound)?; + + Ok(Self { code, code_info, code_hash }) } - fn add_user(code_hash: CodeHash) -> Result<(), DispatchError> { - code_cache::increment_refcount::(code_hash) + fn increment_refcount(code_hash: CodeHash) -> Result<(), DispatchError> { + >::mutate(code_hash, |existing| -> Result<(), DispatchError> { + if let Some(info) = existing { + info.refcount = info.refcount.saturating_add(1); + Ok(()) + } else { + Err(Error::::CodeNotFound.into()) + } + }) } - fn remove_user(code_hash: CodeHash) { - code_cache::decrement_refcount::(code_hash) + fn decrement_refcount(code_hash: CodeHash) { + >::mutate(code_hash, |existing| { + if let Some(info) = existing { + info.refcount = info.refcount.saturating_sub(1); + } + }); } fn execute>( @@ -314,23 +461,40 @@ impl Executable for PrefabWasmModule { function: &ExportedFunction, input_data: Vec, ) -> ExecResult { + let code = self.code.as_slice(); + // Instantiate the Wasm module to the engine. let runtime = Runtime::new(ext, input_data); + let schedule = ::Schedule::get(); let (mut store, memory, instance) = Self::instantiate::( - self.code.as_slice(), + code, runtime, - (self.initial, self.maximum), + &schedule, StackLimits::default(), match function { - ExportedFunction::Constructor => AllowDeprecatedInterface::No, ExportedFunction::Call => AllowDeprecatedInterface::Yes, + ExportedFunction::Constructor => AllowDeprecatedInterface::No, }, ) .map_err(|msg| { - log::debug!(target: LOG_TARGET, "failed to instantiate code: {}", msg); + log::debug!(target: LOG_TARGET, "failed to instantiate code to wasmi: {}", msg); Error::::CodeRejected })?; store.data_mut().set_memory(memory); + // Set fuel limit for the wasmi execution. + // We normalize it by the base instruction weight, as its cost in wasmi engine is `1`. + let fuel_limit = store + .data_mut() + .ext() + .gas_meter_mut() + .gas_left() + .ref_time() + .checked_div(T::Schedule::get().instruction_weights.base as u64) + .ok_or(Error::::InvalidSchedule)?; + store + .add_fuel(fuel_limit) + .expect("We've set up engine to fuel consuming mode; qed"); + let exported_func = instance .get_export(&store, function.identifier()) .and_then(|export| export.into_func()) @@ -341,10 +505,14 @@ impl Executable for PrefabWasmModule { // We store before executing so that the code hash is available in the constructor. if let &ExportedFunction::Constructor = function { - code_cache::store(self, true)?; + Self::store_code(self, true)?; } let result = exported_func.call(&mut store, &[], &mut []); + let engine_consumed_total = store.fuel_consumed().expect("Fuel metering is enabled; qed"); + // Sync this frame's gas meter with the engine's one. + let gas_meter = store.data_mut().ext().gas_meter_mut(); + gas_meter.charge_fuel(engine_consumed_total)?; store.into_data().to_execution_result(result) } @@ -358,7 +526,7 @@ impl Executable for PrefabWasmModule { } fn is_deterministic(&self) -> bool { - matches!(self.determinism, Determinism::Enforced) + matches!(self.code_info.determinism, Determinism::Enforced) } } @@ -603,7 +771,10 @@ mod tests { fn schedule(&self) -> &Schedule { &self.schedule } - fn gas_meter(&mut self) -> &mut GasMeter { + fn gas_meter(&self) -> &GasMeter { + &self.gas_meter + } + fn gas_meter_mut(&mut self) -> &mut GasMeter { &mut self.gas_meter } fn append_debug_buffer(&mut self, msg: &str) -> bool { @@ -660,13 +831,16 @@ mod tests { type RuntimeConfig = ::T; RuntimeConfig::set_unstable_interface(unstable_interface); let wasm = wat::parse_str(wat).unwrap(); - let schedule = crate::Schedule::default(); let executable = if skip_checks { - PrefabWasmModule::::from_code_unchecked(wasm, &schedule, ALICE)? - } else { - PrefabWasmModule::::from_code( + WasmBlob::::from_code_unchecked( wasm, - &schedule, + ext.borrow_mut().schedule(), + ALICE, + )? + } else { + WasmBlob::::from_code( + wasm, + ext.borrow_mut().schedule(), ALICE, Determinism::Enforced, TryInstantiate::Instantiate, @@ -3161,25 +3335,6 @@ mod tests { execute(CODE, vec![], &mut mock_ext).unwrap(); } - /// Code with deprecated functions cannot be uploaded or instantiated. However, we - /// need to make sure that it still can be re-instrumented. - #[test] - fn can_reinstrument_deprecated() { - const CODE_RANDOM: &str = r#" -(module - (import "seal0" "random" (func $seal_random (param i32 i32 i32 i32))) - (func (export "call")) - (func (export "deploy")) -) - "#; - let wasm = wat::parse_str(CODE_RANDOM).unwrap(); - let schedule = crate::Schedule::::default(); - #[cfg(not(feature = "runtime-benchmarks"))] - assert_err!(execute(CODE_RANDOM, vec![], MockExt::default()), >::CodeRejected); - self::prepare::reinstrument::(&wasm, &schedule, Determinism::Enforced) - .unwrap(); - } - /// This test check that an unstable interface cannot be deployed. In case of runtime /// benchmarks we always allow unstable interfaces. This is why this test does not /// work when this feature is enabled. diff --git a/substrate/frame/contracts/src/wasm/prepare.rs b/substrate/frame/contracts/src/wasm/prepare.rs index 14fec83473..ee267cd0bc 100644 --- a/substrate/frame/contracts/src/wasm/prepare.rs +++ b/substrate/frame/contracts/src/wasm/prepare.rs @@ -22,17 +22,15 @@ use crate::{ chain_extension::ChainExtension, storage::meter::Diff, - wasm::{ - runtime::AllowDeprecatedInterface, Determinism, Environment, OwnerInfo, PrefabWasmModule, - }, + wasm::{runtime::AllowDeprecatedInterface, CodeInfo, Determinism, Environment, WasmBlob}, AccountIdOf, CodeVec, Config, Error, Schedule, LOG_TARGET, }; -use codec::{Encode, MaxEncodedLen}; +use codec::MaxEncodedLen; use sp_runtime::{traits::Hash, DispatchError}; -use sp_std::prelude::*; -use wasm_instrument::{ - gas_metering, - parity_wasm::elements::{self, External, Internal, MemoryType, Type, ValueType}, +#[cfg(any(test, feature = "runtime-benchmarks"))] +use sp_std::prelude::Vec; +use wasm_instrument::parity_wasm::elements::{ + self, External, Internal, MemoryType, Type, ValueType, }; use wasmi::StackLimits; use wasmparser::{Validator, WasmFeatures}; @@ -56,32 +54,20 @@ pub enum TryInstantiate { Skip, } -/// The reason why a contract is instrumented. -enum InstrumentReason { - /// A new code is uploaded. - New, - /// Existing code is re-instrumented. - Reinstrument, -} +/// The inner deserialized module is valid (this is guaranteed by `new` method). +pub struct ContractModule(elements::Module); -struct ContractModule<'a, T: Config> { - /// A deserialized module. The module is valid (this is Guaranteed by `new` method). - module: elements::Module, - schedule: &'a Schedule, -} - -impl<'a, T: Config> ContractModule<'a, T> { +impl ContractModule { /// Creates a new instance of `ContractModule`. /// - /// Returns `Err` if the `original_code` couldn't be decoded or + /// Returns `Err` if the `code` couldn't be decoded or /// if it contains an invalid module. - fn new(original_code: &[u8], schedule: &'a Schedule) -> Result { - let module = - elements::deserialize_buffer(original_code).map_err(|_| "Can't decode wasm code")?; + pub fn new(code: &[u8]) -> Result { + let module = elements::deserialize_buffer(code).map_err(|_| "Can't decode Wasm code")?; // Return a `ContractModule` instance with // __valid__ module. - Ok(ContractModule { module, schedule }) + Ok(ContractModule(module)) } /// Ensures that module doesn't declare internal memories. @@ -90,7 +76,7 @@ impl<'a, T: Config> ContractModule<'a, T> { /// Memory section contains declarations of internal linear memories, so if we find one /// we reject such a module. fn ensure_no_internal_memory(&self) -> Result<(), &'static str> { - if self.module.memory_section().map_or(false, |ms| ms.entries().len() > 0) { + if self.0.memory_section().map_or(false, |ms| ms.entries().len() > 0) { return Err("module declares internal memory") } Ok(()) @@ -98,7 +84,7 @@ impl<'a, T: Config> ContractModule<'a, T> { /// Ensures that tables declared in the module are not too big. fn ensure_table_size_limit(&self, limit: u32) -> Result<(), &'static str> { - if let Some(table_section) = self.module.table_section() { + if let Some(table_section) = self.0.table_section() { // In Wasm MVP spec, there may be at most one table declared. Double check this // explicitly just in case the Wasm version changes. if table_section.entries().len() > 1 { @@ -117,7 +103,7 @@ impl<'a, T: Config> ContractModule<'a, T> { /// Ensure that any `br_table` instruction adheres to its immediate value limit. fn ensure_br_table_size_limit(&self, limit: u32) -> Result<(), &'static str> { - let code_section = if let Some(type_section) = self.module.code_section() { + let code_section = if let Some(type_section) = self.0.code_section() { type_section } else { return Ok(()) @@ -134,7 +120,7 @@ impl<'a, T: Config> ContractModule<'a, T> { } fn ensure_global_variable_limit(&self, limit: u32) -> Result<(), &'static str> { - if let Some(global_section) = self.module.global_section() { + if let Some(global_section) = self.0.global_section() { if global_section.entries().len() > limit as usize { return Err("module declares too many globals") } @@ -143,7 +129,7 @@ impl<'a, T: Config> ContractModule<'a, T> { } fn ensure_local_variable_limit(&self, limit: u32) -> Result<(), &'static str> { - if let Some(code_section) = self.module.code_section() { + if let Some(code_section) = self.0.code_section() { for func_body in code_section.bodies() { let locals_count: u32 = func_body.locals().iter().map(|val_type| val_type.count()).sum(); @@ -157,7 +143,7 @@ impl<'a, T: Config> ContractModule<'a, T> { /// Ensure that no function exists that has more parameters than allowed. fn ensure_parameter_limit(&self, limit: u32) -> Result<(), &'static str> { - let type_section = if let Some(type_section) = self.module.type_section() { + let type_section = if let Some(type_section) = self.0.type_section() { type_section } else { return Ok(()) @@ -172,14 +158,6 @@ impl<'a, T: Config> ContractModule<'a, T> { Ok(()) } - fn inject_gas_metering(self, determinism: Determinism) -> Result { - let gas_rules = self.schedule.rules(determinism); - let backend = gas_metering::host_function::Injector::new("seal0", "gas"); - let contract_module = gas_metering::inject(self.module, backend, &gas_rules) - .map_err(|_| "gas instrumentation failed")?; - Ok(ContractModule { module: contract_module, schedule: self.schedule }) - } - /// Check that the module has required exported functions. For now /// these are just entrypoints: /// @@ -191,7 +169,7 @@ impl<'a, T: Config> ContractModule<'a, T> { let mut deploy_found = false; let mut call_found = false; - let module = &self.module; + let module = &self.0; let types = module.type_section().map(|ts| ts.types()).unwrap_or(&[]); let export_entries = module.export_section().map(|is| is.entries()).unwrap_or(&[]); @@ -261,13 +239,8 @@ impl<'a, T: Config> ContractModule<'a, T> { /// /// This makes sure that the import section looks as we expect it from a contract /// and enforces and returns the memory type declared by the contract if any. - /// - /// `import_fn_banlist`: list of function names that are disallowed to be imported - fn scan_imports( - &self, - import_fn_banlist: &[&[u8]], - ) -> Result, &'static str> { - let module = &self.module; + pub fn scan_imports(&self) -> Result, &'static str> { + let module = &self.0; let import_entries = module.import_section().map(|is| is.entries()).unwrap_or(&[]); let mut imported_mem_type = None; @@ -276,15 +249,11 @@ impl<'a, T: Config> ContractModule<'a, T> { External::Table(_) => return Err("Cannot import tables"), External::Global(_) => return Err("Cannot import globals"), External::Function(_) => { - if !T::ChainExtension::enabled() && + if !::ChainExtension::enabled() && import.field().as_bytes() == b"seal_call_chain_extension" { return Err("module uses chain extensions but chain extensions are disabled") } - - if import_fn_banlist.iter().any(|f| import.field().as_bytes() == *f) { - return Err("module imports a banned function") - } }, External::Memory(ref memory_type) => { if import.module() != IMPORT_MODULE_MEMORY { @@ -301,14 +270,11 @@ impl<'a, T: Config> ContractModule<'a, T> { }, } } + Ok(imported_mem_type) } - - fn into_wasm_code(self) -> Result, &'static str> { - elements::serialize(self.module).map_err(|_| "error serializing instrumented module") - } } - +#[cfg(any(test, feature = "runtime-benchmarks"))] fn get_memory_limits( module: Option<&MemoryType>, schedule: &Schedule, @@ -318,35 +284,30 @@ fn get_memory_limits( let limits = memory_type.limits(); match (limits.initial(), limits.maximum()) { (initial, Some(maximum)) if initial > maximum => - Err("Requested initial number of pages should not exceed the requested maximum"), + Err("Requested initial number of memory pages should not exceed the requested maximum"), (_, Some(maximum)) if maximum > schedule.limits.memory_pages => - Err("Maximum number of pages should not exceed the configured maximum."), + Err("Maximum number of memory pages should not exceed the maximum configured in the Schedule."), (initial, Some(maximum)) => Ok((initial, maximum)), - (_, None) => { - // Maximum number of pages should be always declared. - // This isn't a hard requirement and can be treated as a maximum set - // to configured maximum. - Err("Maximum number of pages should be always declared.") + (initial, None) => { + Ok((initial, schedule.limits.memory_pages)) }, } } else { - // If none memory imported then just create an empty placeholder. - // Any access to it will lead to out of bounds trap. + // None memory imported in the Wasm module, + // any access to it will lead to out of bounds trap. Ok((0, 0)) } } -/// Check and instrument the given `original_code`. +/// Check that given `code` satisfies constraints required for the contract Wasm module. /// -/// On success it returns the instrumented versions together with its `(initial, maximum)` -/// error requirement. The memory requirement was also validated against the `schedule`. -fn instrument( - original_code: &[u8], +/// On success it returns back the code. +fn validate( + code: &[u8], schedule: &Schedule, determinism: Determinism, try_instantiate: TryInstantiate, - reason: InstrumentReason, -) -> Result<(Vec, (u32, u32)), (DispatchError, &'static str)> +) -> Result<(), (DispatchError, &'static str)> where E: Environment<()>, T: Config, @@ -377,189 +338,114 @@ where simd: false, memory_control: false, }) - .validate_all(original_code) + .validate_all(code) .map_err(|err| { log::debug!(target: LOG_TARGET, "{}", err); - (Error::::CodeRejected.into(), "validation of new code failed") + (Error::::CodeRejected.into(), "Validation of new code failed!") })?; - let (code, (initial, maximum)) = (|| { - let contract_module = ContractModule::new(original_code, schedule)?; + (|| { + let contract_module = ContractModule::new(code)?; contract_module.scan_exports()?; + contract_module.scan_imports::()?; contract_module.ensure_no_internal_memory()?; contract_module.ensure_table_size_limit(schedule.limits.table_size)?; contract_module.ensure_global_variable_limit(schedule.limits.globals)?; contract_module.ensure_local_variable_limit(schedule.limits.locals)?; contract_module.ensure_parameter_limit(schedule.limits.parameters)?; contract_module.ensure_br_table_size_limit(schedule.limits.br_table_size)?; - - // We disallow importing `gas` function here since it is treated as implementation detail. - let disallowed_imports = [b"gas".as_ref()]; - let memory_limits = - get_memory_limits(contract_module.scan_imports(&disallowed_imports)?, schedule)?; - - let code = contract_module.inject_gas_metering(determinism)?.into_wasm_code()?; - - Ok((code, memory_limits)) + // Extract memory limits from the module. + // This also checks that module's memory import satisfies the schedule. + Ok(()) })() .map_err(|msg: &str| { - log::debug!(target: LOG_TARGET, "new code rejected: {}", msg); + log::debug!(target: LOG_TARGET, "New code rejected: {}", msg); (Error::::CodeRejected.into(), msg) })?; // This will make sure that the module can be actually run within wasmi: // - // - Doesn't use any unknown imports. - // - Doesn't explode the wasmi bytecode generation. + // - It doesn't use any unknown imports. + // - It doesn't explode the wasmi bytecode generation. if matches!(try_instantiate, TryInstantiate::Instantiate) { // We don't actually ever run any code so we can get away with a minimal stack which // reduces the amount of memory that needs to be zeroed. let stack_limits = StackLimits::new(1, 1, 0).expect("initial <= max; qed"); - PrefabWasmModule::::instantiate::( + WasmBlob::::instantiate::( &code, (), - (initial, maximum), + schedule, stack_limits, - match reason { - InstrumentReason::New => AllowDeprecatedInterface::No, - InstrumentReason::Reinstrument => AllowDeprecatedInterface::Yes, - }, + AllowDeprecatedInterface::No, ) .map_err(|err| { log::debug!(target: LOG_TARGET, "{}", err); - (Error::::CodeRejected.into(), "new code rejected after instrumentation") + (Error::::CodeRejected.into(), "New code rejected on wasmi instantiation!") })?; } - - Ok((code, (initial, maximum))) + Ok(()) } -/// Loads the given module given in `original_code`, performs some checks on it and -/// does some preprocessing. +/// Validates the given binary `code` is a valid Wasm module satisfying following constraints: /// -/// The checks are: +/// - The module doesn't define an internal memory instance. +/// - Imported memory (if any) doesn't reserve more memory than permitted by the `schedule`. +/// - All imported functions from the external environment match defined by `env` module. /// -/// - the provided code is a valid wasm module -/// - the module doesn't define an internal memory instance -/// - imported memory (if any) doesn't reserve more memory than permitted by the `schedule` -/// - all imported functions from the external environment matches defined by `env` module -/// -/// The preprocessing includes injecting code for gas metering and metering the height of stack. +/// Also constructs contract `code_info` by calculating the storage deposit. pub fn prepare( - original_code: CodeVec, + code: CodeVec, schedule: &Schedule, owner: AccountIdOf, determinism: Determinism, try_instantiate: TryInstantiate, -) -> Result, (DispatchError, &'static str)> +) -> Result, (DispatchError, &'static str)> where E: Environment<()>, T: Config, { - let (code, (initial, maximum)) = instrument::( - original_code.as_ref(), - schedule, - determinism, - try_instantiate, - InstrumentReason::New, - )?; + validate::(code.as_ref(), schedule, determinism, try_instantiate)?; - let original_code_len = original_code.len(); - - let mut module = PrefabWasmModule { - instruction_weights_version: schedule.instruction_weights.version, - initial, - maximum, - code: code.try_into().map_err(|_| (>::CodeTooLarge.into(), ""))?, - code_hash: T::Hashing::hash(&original_code), - original_code: Some(original_code), - owner_info: None, - determinism, - }; - - // We need to add the sizes of the `#[codec(skip)]` fields which are stored in different - // storage items. This is also why we have `3` items added and not only one. - let bytes_added = module - .encoded_size() - .saturating_add(original_code_len) - .saturating_add(>::max_encoded_len()) as u32; - let deposit = Diff { bytes_added, items_added: 3, ..Default::default() } + // Calculate deposit for storing contract code and `code_info` in two different storage items. + let bytes_added = code.len().saturating_add(>::max_encoded_len()) as u32; + let deposit = Diff { bytes_added, items_added: 2, ..Default::default() } .update_contract::(None) .charge_or_zero(); - module.owner_info = Some(OwnerInfo { owner, deposit, refcount: 0 }); + let code_info = CodeInfo { owner, deposit, determinism, refcount: 0 }; + let code_hash = T::Hashing::hash(&code); - Ok(module) -} - -/// Same as [`prepare`] but without constructing a new module. -/// -/// Used to update the code of an existing module to the newest [`Schedule`] version. -/// Stictly speaking is not necessary to check the existing code before reinstrumenting because -/// it can't change in the meantime. However, since we recently switched the validation library -/// we want to re-validate to weed out any bugs that were lurking in the old version. -pub fn reinstrument( - original_code: &[u8], - schedule: &Schedule, - determinism: Determinism, -) -> Result, DispatchError> -where - E: Environment<()>, - T: Config, -{ - instrument::( - original_code, - schedule, - determinism, - // This function was triggered by an interaction with an existing contract code - // that will try to instantiate anyways. Failing here would not help - // as the contract is already on chain. - TryInstantiate::Skip, - InstrumentReason::Reinstrument, - ) - .map_err(|(err, msg)| { - log::error!(target: LOG_TARGET, "CodeRejected during reinstrument: {}", msg); - err - }) - .map(|(code, _)| code) + Ok(WasmBlob { code, code_info, code_hash }) } /// Alternate (possibly unsafe) preparation functions used only for benchmarking and testing. /// /// For benchmarking we need to construct special contracts that might not pass our -/// sanity checks or need to skip instrumentation for correct results. We hide functions -/// allowing this behind a feature that is only set during benchmarking or testing to -/// prevent usage in production code. +/// sanity checks. We hide functions allowing this behind a feature that is only set during +/// benchmarking or testing to prevent usage in production code. #[cfg(any(test, feature = "runtime-benchmarks"))] pub mod benchmarking { use super::*; - /// Prepare function that neither checks nor instruments the passed in code. + /// Prepare function that does not perform most checks on the passed in code. pub fn prepare( - original_code: Vec, + code: Vec, schedule: &Schedule, owner: AccountIdOf, - ) -> Result, &'static str> { - let contract_module = ContractModule::new(&original_code, schedule)?; - let memory_limits = get_memory_limits(contract_module.scan_imports(&[])?, schedule)?; - Ok(PrefabWasmModule { - instruction_weights_version: schedule.instruction_weights.version, - initial: memory_limits.0, - maximum: memory_limits.1, - code_hash: T::Hashing::hash(&original_code), - original_code: Some(original_code.try_into().map_err(|_| "Original code too large")?), - code: contract_module - .into_wasm_code()? - .try_into() - .map_err(|_| "Instrumented code too large")?, - owner_info: Some(OwnerInfo { - owner, - // this is a helper function for benchmarking which skips deposit collection - deposit: Default::default(), - refcount: 0, - }), + ) -> Result, DispatchError> { + let contract_module = ContractModule::new(&code)?; + let _ = get_memory_limits(contract_module.scan_imports::()?, schedule)?; + let code_hash = T::Hashing::hash(&code); + let code = code.try_into().map_err(|_| >::CodeTooLarge)?; + let code_info = CodeInfo { + owner, + // this is a helper function for benchmarking which skips deposit collection + deposit: Default::default(), + refcount: 0, determinism: Determinism::Enforced, - }) + }; + + Ok(WasmBlob { code, code_info, code_hash }) } } @@ -574,9 +460,9 @@ mod tests { use pallet_contracts_proc_macro::define_env; use std::fmt; - impl fmt::Debug for PrefabWasmModule { + impl fmt::Debug for WasmBlob { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "PreparedContract {{ .. }}") + write!(f, "ContractCode {{ .. }}") } } @@ -654,7 +540,7 @@ mod tests { ) (func (export "deploy")) )"#, - Err("validation of new code failed") + Err("Validation of new code failed!") ); mod functions { @@ -807,20 +693,7 @@ mod tests { (func (export "deploy")) ) "#, - Err("validation of new code failed") - ); - - prepare_test!( - no_maximum, - r#" - (module - (import "env" "memory" (memory 1)) - - (func (export "call")) - (func (export "deploy")) - ) - "#, - Err("Maximum number of pages should be always declared.") + Err("Validation of new code failed!") ); prepare_test!( @@ -846,7 +719,7 @@ mod tests { (func (export "deploy")) ) "#, - Err("Maximum number of pages should not exceed the configured maximum.") + Err("New code rejected on wasmi instantiation!") ); prepare_test!( @@ -873,7 +746,7 @@ mod tests { (func (export "deploy")) ) "#, - Err("validation of new code failed") + Err("Validation of new code failed!") ); prepare_test!( @@ -987,21 +860,6 @@ mod tests { Ok(_) ); - // even though gas is defined the contract can't import it since - // it is an implementation defined. - prepare_test!( - can_not_import_gas_function, - r#" - (module - (import "seal0" "gas" (func (param i32))) - - (func (export "call")) - (func (export "deploy")) - ) - "#, - Err("module imports a banned function") - ); - // memory is in "env" and not in "seal0" prepare_test!( memory_not_in_seal0, @@ -1043,18 +901,17 @@ mod tests { Ok(_) ); - // wrong signature prepare_test!( wrong_signature, r#" (module - (import "seal0" "gas" (func (param i64))) + (import "seal0" "input" (func (param i64))) (func (export "call")) (func (export "deploy")) ) "#, - Err("module imports a banned function") + Err("New code rejected on wasmi instantiation!") ); prepare_test!( @@ -1067,7 +924,7 @@ mod tests { (func (export "deploy")) ) "#, - Err("new code rejected after instrumentation") + Err("New code rejected on wasmi instantiation!") ); } @@ -1164,7 +1021,7 @@ mod tests { (func (export "deploy")) ) "#, - Err("validation of new code failed") + Err("Validation of new code failed!") ); prepare_test!( @@ -1176,7 +1033,7 @@ mod tests { (func (export "deploy")) ) "#, - Err("validation of new code failed") + Err("Validation of new code failed!") ); prepare_test!( @@ -1188,7 +1045,7 @@ mod tests { (func (export "deploy")) ) "#, - Err("validation of new code failed") + Err("Validation of new code failed!") ); prepare_test!( @@ -1200,7 +1057,7 @@ mod tests { (func (export "deploy")) ) "#, - Err("validation of new code failed") + Err("Validation of new code failed!") ); } } diff --git a/substrate/frame/contracts/src/wasm/runtime.rs b/substrate/frame/contracts/src/wasm/runtime.rs index d541f5b952..b2e2ed0e54 100644 --- a/substrate/frame/contracts/src/wasm/runtime.rs +++ b/substrate/frame/contracts/src/wasm/runtime.rs @@ -67,7 +67,6 @@ pub trait Environment { } /// Type of a storage key. -#[allow(dead_code)] enum KeyType { /// Legacy fix sized key `[u8;32]`. Fix, @@ -174,9 +173,6 @@ impl HostError for TrapReason {} #[cfg_attr(test, derive(Debug, PartialEq, Eq))] #[derive(Copy, Clone)] pub enum RuntimeCosts { - /// Charge the gas meter with the cost of a metering block. The charged costs are - /// the supplied cost of the block plus the overhead of the metering itself. - MeteringBlock(u64), /// Weight charged for copying data from the sandbox. CopyFromContract(u32), /// Weight charged for copying data to the sandbox. @@ -277,7 +273,6 @@ impl RuntimeCosts { fn token(&self, s: &HostFnWeights) -> RuntimeToken { use self::RuntimeCosts::*; let weight = match *self { - MeteringBlock(amount) => s.gas.saturating_add(Weight::from_parts(amount, 0)), CopyFromContract(len) => s.return_per_byte.saturating_mul(len.into()), CopyToContract(len) => s.input_per_byte.saturating_mul(len.into()), Caller => s.caller, @@ -369,7 +364,7 @@ impl RuntimeCosts { macro_rules! charge_gas { ($runtime:expr, $costs:expr) => {{ let token = $costs.token(&$runtime.ext.schedule().host_fn_weights); - $runtime.ext.gas_meter().charge(token) + $runtime.ext.gas_meter_mut().charge(token) }}; } @@ -485,25 +480,40 @@ impl<'a, E: Ext + 'a> Runtime<'a, E> { /// Converts the sandbox result and the runtime state into the execution outcome. pub fn to_execution_result(self, sandbox_result: Result<(), wasmi::Error>) -> ExecResult { + use wasmi::core::TrapCode::OutOfFuel; use TrapReason::*; + match sandbox_result { // Contract returned from main function -> no data was returned. Ok(_) => Ok(ExecReturnValue { flags: ReturnFlags::empty(), data: Vec::new() }), + // `OutOfGas` when host asks engine to consume more than left in the _store_. + // We should never get this case, as gas meter is being charged (and hence raises error) + // first. + Err(wasmi::Error::Store(_)) => Err(Error::::OutOfGas.into()), // Contract either trapped or some host function aborted the execution. Err(wasmi::Error::Trap(trap)) => { - // If we encoded a reason then it is some abort generated by a host function. - // Otherwise the trap came from the contract. - let reason: TrapReason = trap.downcast().ok_or(Error::::ContractTrapped)?; - match reason { - Return(ReturnData { flags, data }) => { - let flags = - ReturnFlags::from_bits(flags).ok_or(Error::::InvalidCallFlags)?; - Ok(ExecReturnValue { flags, data }) - }, - Termination => - Ok(ExecReturnValue { flags: ReturnFlags::empty(), data: Vec::new() }), - SupervisorError(error) => return Err(error.into()), + if let Some(OutOfFuel) = trap.trap_code() { + // `OutOfGas` during engine execution. + return Err(Error::::OutOfGas.into()) } + // If we encoded a reason then it is some abort generated by a host function. + if let Some(reason) = &trap.downcast_ref::() { + match &reason { + Return(ReturnData { flags, data }) => { + let flags = ReturnFlags::from_bits(*flags) + .ok_or(Error::::InvalidCallFlags)?; + return Ok(ExecReturnValue { flags, data: data.to_vec() }) + }, + Termination => + return Ok(ExecReturnValue { + flags: ReturnFlags::empty(), + data: Vec::new(), + }), + SupervisorError(error) => return Err((*error).into()), + } + } + // Otherwise the trap came from the contract itself. + Err(Error::::ContractTrapped.into()) }, // Any other error is returned only if instantiation or linking failed (i.e. // wasm binary tried to import a function that is not provided by the host). @@ -536,7 +546,7 @@ impl<'a, E: Ext + 'a> Runtime<'a, E> { /// refunded to match the actual amount. pub fn adjust_gas(&mut self, charged: ChargedAmount, actual_costs: RuntimeCosts) { let token = actual_costs.token(&self.ext.schedule().host_fn_weights); - self.ext.gas_meter().adjust_gas(charged, token); + self.ext.gas_meter_mut().adjust_gas(charged, token); } /// Read designated chunk from the sandbox memory. @@ -1004,18 +1014,6 @@ impl<'a, E: Ext + 'a> Runtime<'a, E> { // for every function. #[define_env(doc)] pub mod env { - /// Account for used gas. Traps if gas used is greater than gas limit. - /// - /// NOTE: This is a implementation defined call and is NOT a part of the public API. - /// This call is supposed to be called only by instrumentation injected code. - /// It deals only with the *ref_time* Weight. - /// - /// - `amount`: How much gas is used. - fn gas(ctx: _, _memory: _, amount: u64) -> Result<(), TrapReason> { - ctx.charge_gas(RuntimeCosts::MeteringBlock(amount))?; - Ok(()) - } - /// Set the value at the given key in the contract storage. /// /// Equivalent to the newer [`seal1`][`super::api_doc::Version1::set_storage`] version with the diff --git a/substrate/frame/contracts/src/weights.rs b/substrate/frame/contracts/src/weights.rs index 6c6cb0afd4..691e3a2584 100644 --- a/substrate/frame/contracts/src/weights.rs +++ b/substrate/frame/contracts/src/weights.rs @@ -18,28 +18,26 @@ //! Autogenerated weights for pallet_contracts //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-16, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-e8ezs4ez-project-145-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `runner-xerhrdyb-project-145-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/production/substrate +// target/production/substrate // benchmark // pallet -// --chain=dev // --steps=50 // --repeat=20 -// --pallet=pallet_contracts -// --no-storage-info -// --no-median-slopes -// --no-min-squares // --extrinsic=* // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./frame/contracts/src/weights.rs +// --json-file=/builds/parity/mirrors/substrate/.git/.artifacts/bench.json +// --pallet=pallet_contracts +// --chain=dev // --header=./HEADER-APACHE2 +// --output=./frame/contracts/src/weights.rs // --template=./.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] @@ -54,10 +52,10 @@ use core::marker::PhantomData; pub trait WeightInfo { fn on_process_deletion_queue_batch() -> Weight; fn on_initialize_per_trie_key(k: u32, ) -> Weight; - fn reinstrument(c: u32, ) -> Weight; fn v9_migration_step(c: u32, ) -> Weight; fn v10_migration_step() -> Weight; fn v11_migration_step(k: u32, ) -> Weight; + fn v12_migration_step(c: u32, ) -> Weight; fn migration_noop() -> Weight; fn migrate() -> Weight; fn on_runtime_upgrade_noop() -> Weight; @@ -84,7 +82,6 @@ pub trait WeightInfo { fn seal_block_number(r: u32, ) -> Weight; fn seal_now(r: u32, ) -> Weight; fn seal_weight_to_fee(r: u32, ) -> Weight; - fn seal_gas(r: u32, ) -> Weight; fn seal_input(r: u32, ) -> Weight; fn seal_input_per_byte(n: u32, ) -> Weight; fn seal_return(r: u32, ) -> Weight; @@ -129,56 +126,6 @@ pub trait WeightInfo { fn seal_account_reentrance_count(r: u32, ) -> Weight; fn seal_instantiation_nonce(r: u32, ) -> Weight; fn instr_i64const(r: u32, ) -> Weight; - fn instr_i64load(r: u32, ) -> Weight; - fn instr_i64store(r: u32, ) -> Weight; - fn instr_select(r: u32, ) -> Weight; - fn instr_if(r: u32, ) -> Weight; - fn instr_br(r: u32, ) -> Weight; - fn instr_br_if(r: u32, ) -> Weight; - fn instr_br_table(r: u32, ) -> Weight; - fn instr_br_table_per_entry(e: u32, ) -> Weight; - fn instr_call(r: u32, ) -> Weight; - fn instr_call_indirect(r: u32, ) -> Weight; - fn instr_call_per_local(l: u32, ) -> Weight; - fn instr_local_get(r: u32, ) -> Weight; - fn instr_local_set(r: u32, ) -> Weight; - fn instr_local_tee(r: u32, ) -> Weight; - fn instr_global_get(r: u32, ) -> Weight; - fn instr_global_set(r: u32, ) -> Weight; - fn instr_memory_current(r: u32, ) -> Weight; - fn instr_memory_grow(r: u32, ) -> Weight; - fn instr_i64clz(r: u32, ) -> Weight; - fn instr_i64ctz(r: u32, ) -> Weight; - fn instr_i64popcnt(r: u32, ) -> Weight; - fn instr_i64eqz(r: u32, ) -> Weight; - fn instr_i64extendsi32(r: u32, ) -> Weight; - fn instr_i64extendui32(r: u32, ) -> Weight; - fn instr_i32wrapi64(r: u32, ) -> Weight; - fn instr_i64eq(r: u32, ) -> Weight; - fn instr_i64ne(r: u32, ) -> Weight; - fn instr_i64lts(r: u32, ) -> Weight; - fn instr_i64ltu(r: u32, ) -> Weight; - fn instr_i64gts(r: u32, ) -> Weight; - fn instr_i64gtu(r: u32, ) -> Weight; - fn instr_i64les(r: u32, ) -> Weight; - fn instr_i64leu(r: u32, ) -> Weight; - fn instr_i64ges(r: u32, ) -> Weight; - fn instr_i64geu(r: u32, ) -> Weight; - fn instr_i64add(r: u32, ) -> Weight; - fn instr_i64sub(r: u32, ) -> Weight; - fn instr_i64mul(r: u32, ) -> Weight; - fn instr_i64divs(r: u32, ) -> Weight; - fn instr_i64divu(r: u32, ) -> Weight; - fn instr_i64rems(r: u32, ) -> Weight; - fn instr_i64remu(r: u32, ) -> Weight; - fn instr_i64and(r: u32, ) -> Weight; - fn instr_i64or(r: u32, ) -> Weight; - fn instr_i64xor(r: u32, ) -> Weight; - fn instr_i64shl(r: u32, ) -> Weight; - fn instr_i64shrs(r: u32, ) -> Weight; - fn instr_i64shru(r: u32, ) -> Weight; - fn instr_i64rotl(r: u32, ) -> Weight; - fn instr_i64rotr(r: u32, ) -> Weight; } /// Weights for pallet_contracts using the Substrate node and recommended hardware. @@ -190,8 +137,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `142` // Estimated: `1627` - // Minimum execution time: 2_484_000 picoseconds. - Weight::from_parts(2_620_000, 1627) + // Minimum execution time: 2_489_000 picoseconds. + Weight::from_parts(2_592_000, 1627) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: Skipped Metadata (r:0 w:0) @@ -199,46 +146,29 @@ impl WeightInfo for SubstrateWeight { /// The range of component `k` is `[0, 1024]`. fn on_initialize_per_trie_key(k: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `521 + k * (69 ±0)` - // Estimated: `511 + k * (70 ±0)` - // Minimum execution time: 13_405_000 picoseconds. - Weight::from_parts(13_909_000, 511) - // Standard Error: 1_350 - .saturating_add(Weight::from_parts(1_222_889, 0).saturating_mul(k.into())) + // Measured: `451 + k * (69 ±0)` + // Estimated: `441 + k * (70 ±0)` + // Minimum execution time: 12_888_000 picoseconds. + Weight::from_parts(13_135_000, 441) + // Standard Error: 1_171 + .saturating_add(Weight::from_parts(1_260_794, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 70).saturating_mul(k.into())) } - /// Storage: Contracts PristineCode (r:1 w:0) - /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) - /// Storage: Contracts CodeStorage (r:0 w:1) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) - /// The range of component `c` is `[0, 61717]`. - fn reinstrument(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `271 + c * (1 ±0)` - // Estimated: `3741 + c * (1 ±0)` - // Minimum execution time: 31_202_000 picoseconds. - Weight::from_parts(26_528_080, 3741) - // Standard Error: 55 - .saturating_add(Weight::from_parts(55_528, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) - } - /// Storage: Contracts CodeStorage (r:2 w:1) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) - /// The range of component `c` is `[0, 61717]`. + /// Storage: unknown `0x4342193e496fab7ec59d615ed0dc553022fca90611ba8b7942f8bdb3b97f6580` (r:2 w:1) + /// Proof Skipped: unknown `0x4342193e496fab7ec59d615ed0dc553022fca90611ba8b7942f8bdb3b97f6580` (r:2 w:1) + /// The range of component `c` is `[0, 125952]`. fn v9_migration_step(c: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `211 + c * (1 ±0)` - // Estimated: `6147 + c * (1 ±0)` - // Minimum execution time: 8_510_000 picoseconds. - Weight::from_parts(9_274_212, 6147) + // Estimated: `6149 + c * (1 ±0)` + // Minimum execution time: 8_447_000 picoseconds. + Weight::from_parts(9_221_722, 6149) // Standard Error: 2 - .saturating_add(Weight::from_parts(1_311, 0).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(1_323, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) @@ -249,10 +179,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) fn v10_migration_step() -> Weight { // Proof Size summary in bytes: - // Measured: `577` - // Estimated: `6517` - // Minimum execution time: 17_100_000 picoseconds. - Weight::from_parts(17_720_000, 6517) + // Measured: `548` + // Estimated: `6488` + // Minimum execution time: 17_966_000 picoseconds. + Weight::from_parts(18_805_000, 6488) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -265,23 +195,44 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `171 + k * (1 ±0)` // Estimated: `3635 + k * (1 ±0)` - // Minimum execution time: 3_853_000 picoseconds. - Weight::from_parts(3_951_000, 3635) - // Standard Error: 549 - .saturating_add(Weight::from_parts(1_120_241, 0).saturating_mul(k.into())) + // Minimum execution time: 3_848_000 picoseconds. + Weight::from_parts(3_964_000, 3635) + // Standard Error: 691 + .saturating_add(Weight::from_parts(1_143_905, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 1).saturating_mul(k.into())) } + /// Storage: unknown `0x4342193e496fab7ec59d615ed0dc553053f13fd319a03c211337c76e0fe776df` (r:2 w:0) + /// Proof Skipped: unknown `0x4342193e496fab7ec59d615ed0dc553053f13fd319a03c211337c76e0fe776df` (r:2 w:0) + /// Storage: unknown `0x4342193e496fab7ec59d615ed0dc553022fca90611ba8b7942f8bdb3b97f6580` (r:1 w:1) + /// Proof Skipped: unknown `0x4342193e496fab7ec59d615ed0dc553022fca90611ba8b7942f8bdb3b97f6580` (r:1 w:1) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:0 w:1) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) + /// The range of component `c` is `[0, 125952]`. + fn v12_migration_step(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `325 + c * (1 ±0)` + // Estimated: `6263 + c * (1 ±0)` + // Minimum execution time: 16_532_000 picoseconds. + Weight::from_parts(16_729_380, 6263) + // Standard Error: 1 + .saturating_add(Weight::from_parts(427, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) + } /// Storage: Contracts MigrationInProgress (r:1 w:1) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) fn migration_noop() -> Weight { // Proof Size summary in bytes: // Measured: `142` // Estimated: `1627` - // Minimum execution time: 3_390_000 picoseconds. - Weight::from_parts(3_503_000, 1627) + // Minimum execution time: 3_251_000 picoseconds. + Weight::from_parts(3_424_000, 1627) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -293,8 +244,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `166` // Estimated: `3631` - // Minimum execution time: 10_321_000 picoseconds. - Weight::from_parts(10_677_000, 3631) + // Minimum execution time: 12_564_000 picoseconds. + Weight::from_parts(13_051_000, 3631) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -304,8 +255,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `142` // Estimated: `3607` - // Minimum execution time: 3_717_000 picoseconds. - Weight::from_parts(3_866_000, 3607) + // Minimum execution time: 4_784_000 picoseconds. + Weight::from_parts(4_986_000, 3607) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: unknown `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:0) @@ -316,8 +267,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `167` // Estimated: `3632` - // Minimum execution time: 5_668_000 picoseconds. - Weight::from_parts(5_982_000, 3632) + // Minimum execution time: 6_671_000 picoseconds. + Weight::from_parts(7_024_000, 3632) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: unknown `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:0) @@ -328,8 +279,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `142` // Estimated: `3607` - // Minimum execution time: 5_881_000 picoseconds. - Weight::from_parts(6_048_000, 3607) + // Minimum execution time: 6_937_000 picoseconds. + Weight::from_parts(7_314_000, 3607) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -337,8 +288,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System Account (r:1 w:1) @@ -348,20 +301,20 @@ impl WeightInfo for SubstrateWeight { /// The range of component `c` is `[0, 125952]`. fn call_with_code_per_byte(c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `740` - // Estimated: `6689 + c * (1 ±0)` - // Minimum execution time: 283_813_000 picoseconds. - Weight::from_parts(315_949_540, 6689) - // Standard Error: 43 - .saturating_add(Weight::from_parts(37_588, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `786` + // Estimated: `6735 + c * (1 ±0)` + // Minimum execution time: 304_327_000 picoseconds. + Weight::from_parts(309_862_986, 6735) + // Standard Error: 54 + .saturating_add(Weight::from_parts(36_804, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:1 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:1) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Contracts Nonce (r:1 w:1) /// Proof: Contracts Nonce (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) @@ -372,32 +325,32 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: System EventTopics (r:3 w:3) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) - /// Storage: Contracts CodeStorage (r:0 w:1) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) /// Storage: Contracts PristineCode (r:0 w:1) /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) - /// The range of component `c` is `[0, 61717]`. + /// The range of component `c` is `[0, 125952]`. /// The range of component `i` is `[0, 1048576]`. /// The range of component `s` is `[0, 1048576]`. fn instantiate_with_code(c: u32, i: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `303` - // Estimated: `8692` - // Minimum execution time: 3_779_981_000 picoseconds. - Weight::from_parts(109_725_752, 8692) - // Standard Error: 464 - .saturating_add(Weight::from_parts(115_486, 0).saturating_mul(c.into())) - // Standard Error: 27 - .saturating_add(Weight::from_parts(1_624, 0).saturating_mul(i.into())) - // Standard Error: 27 - .saturating_add(Weight::from_parts(2_076, 0).saturating_mul(s.into())) + // Estimated: `8745` + // Minimum execution time: 3_890_645_000 picoseconds. + Weight::from_parts(1_054_159_392, 8745) + // Standard Error: 297 + .saturating_add(Weight::from_parts(63_742, 0).saturating_mul(c.into())) + // Standard Error: 35 + .saturating_add(Weight::from_parts(1_426, 0).saturating_mul(i.into())) + // Standard Error: 35 + .saturating_add(Weight::from_parts(1_849, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(10_u64)) - .saturating_add(T::DbWeight::get().writes(10_u64)) + .saturating_add(T::DbWeight::get().writes(9_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:1) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Contracts Nonce (r:1 w:1) /// Proof: Contracts Nonce (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) @@ -406,22 +359,20 @@ impl WeightInfo for SubstrateWeight { /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System Account (r:2 w:2) /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:1 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) /// Storage: System EventTopics (r:2 w:2) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) /// The range of component `i` is `[0, 1048576]`. /// The range of component `s` is `[0, 1048576]`. fn instantiate(i: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `515` - // Estimated: `6441` - // Minimum execution time: 1_957_086_000 picoseconds. - Weight::from_parts(228_755_581, 6441) - // Standard Error: 9 - .saturating_add(Weight::from_parts(1_823, 0).saturating_mul(i.into())) - // Standard Error: 9 - .saturating_add(Weight::from_parts(1_773, 0).saturating_mul(s.into())) + // Measured: `503` + // Estimated: `6429` + // Minimum execution time: 2_018_386_000 picoseconds. + Weight::from_parts(257_988_354, 6429) + // Standard Error: 11 + .saturating_add(Weight::from_parts(1_924, 0).saturating_mul(i.into())) + // Standard Error: 11 + .saturating_add(Weight::from_parts(1_804, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -429,8 +380,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System Account (r:1 w:1) @@ -439,68 +392,64 @@ impl WeightInfo for SubstrateWeight { /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) fn call() -> Weight { // Proof Size summary in bytes: - // Measured: `792` - // Estimated: `6732` - // Minimum execution time: 194_969_000 picoseconds. - Weight::from_parts(204_325_000, 6732) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `838` + // Estimated: `6778` + // Minimum execution time: 192_981_000 picoseconds. + Weight::from_parts(200_484_000, 6778) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:1 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:1) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: System EventTopics (r:1 w:1) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) - /// Storage: Contracts CodeStorage (r:0 w:1) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) /// Storage: Contracts PristineCode (r:0 w:1) /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) - /// The range of component `c` is `[0, 61717]`. + /// The range of component `c` is `[0, 125952]`. fn upload_code(c: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `142` // Estimated: `3607` - // Minimum execution time: 285_076_000 picoseconds. - Weight::from_parts(309_126_292, 3607) - // Standard Error: 77 - .saturating_add(Weight::from_parts(108_132, 0).saturating_mul(c.into())) + // Minimum execution time: 270_290_000 picoseconds. + Weight::from_parts(249_794_836, 3607) + // Standard Error: 136 + .saturating_add(Weight::from_parts(66_222, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:1 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:1) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: System EventTopics (r:1 w:1) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) - /// Storage: Contracts CodeStorage (r:0 w:1) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) /// Storage: Contracts PristineCode (r:0 w:1) /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) fn remove_code() -> Weight { // Proof Size summary in bytes: - // Measured: `288` - // Estimated: `3753` - // Minimum execution time: 34_633_000 picoseconds. - Weight::from_parts(35_823_000, 3753) + // Measured: `255` + // Estimated: `3720` + // Minimum execution time: 34_086_000 picoseconds. + Weight::from_parts(34_893_000, 3720) .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:2 w:2) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:2 w:2) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: System EventTopics (r:3 w:3) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) fn set_code() -> Weight { // Proof Size summary in bytes: - // Measured: `603` - // Estimated: `9018` - // Minimum execution time: 35_640_000 picoseconds. - Weight::from_parts(37_022_000, 9018) + // Measured: `575` + // Estimated: `8990` + // Minimum execution time: 37_215_000 picoseconds. + Weight::from_parts(38_875_000, 8990) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -510,8 +459,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -519,13 +470,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_caller(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `814 + r * (6 ±0)` - // Estimated: `6755 + r * (6 ±0)` - // Minimum execution time: 274_579_000 picoseconds. - Weight::from_parts(293_784_568, 6755) - // Standard Error: 668 - .saturating_add(Weight::from_parts(332_369, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `860 + r * (6 ±0)` + // Estimated: `6801 + r * (6 ±0)` + // Minimum execution time: 272_512_000 picoseconds. + Weight::from_parts(292_275_248, 6801) + // Standard Error: 816 + .saturating_add(Weight::from_parts(344_261, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } @@ -535,8 +486,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1601 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -544,13 +497,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_is_contract(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `872 + r * (240 ±0)` - // Estimated: `6776 + r * (2715 ±0)` - // Minimum execution time: 258_123_000 picoseconds. - Weight::from_parts(87_353_122, 6776) - // Standard Error: 7_863 - .saturating_add(Weight::from_parts(3_798_056, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `918 + r * (240 ±0)` + // Estimated: `6822 + r * (2715 ±0)` + // Minimum execution time: 272_910_000 picoseconds. + Weight::from_parts(126_963_357, 6822) + // Standard Error: 10_020 + .saturating_add(Weight::from_parts(3_805_261, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 2715).saturating_mul(r.into())) @@ -561,8 +514,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1601 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -570,13 +525,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_code_hash(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `864 + r * (244 ±0)` - // Estimated: `6780 + r * (2719 ±0)` - // Minimum execution time: 263_892_000 picoseconds. - Weight::from_parts(95_671_495, 6780) - // Standard Error: 7_751 - .saturating_add(Weight::from_parts(4_621_396, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `910 + r * (244 ±0)` + // Estimated: `6826 + r * (2719 ±0)` + // Minimum execution time: 275_605_000 picoseconds. + Weight::from_parts(116_757_903, 6826) + // Standard Error: 9_537 + .saturating_add(Weight::from_parts(4_645_380, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 2719).saturating_mul(r.into())) @@ -587,8 +542,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -596,13 +553,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_own_code_hash(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `821 + r * (6 ±0)` - // Estimated: `6763 + r * (6 ±0)` - // Minimum execution time: 256_926_000 picoseconds. - Weight::from_parts(282_224_981, 6763) - // Standard Error: 558 - .saturating_add(Weight::from_parts(437_279, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `867 + r * (6 ±0)` + // Estimated: `6809 + r * (6 ±0)` + // Minimum execution time: 273_998_000 picoseconds. + Weight::from_parts(284_693_047, 6809) + // Standard Error: 774 + .saturating_add(Weight::from_parts(431_720, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } @@ -612,8 +569,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -621,13 +580,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_caller_is_origin(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `811 + r * (3 ±0)` - // Estimated: `6756 + r * (3 ±0)` - // Minimum execution time: 250_653_000 picoseconds. - Weight::from_parts(275_581_829, 6756) - // Standard Error: 504 - .saturating_add(Weight::from_parts(174_168, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `857 + r * (3 ±0)` + // Estimated: `6802 + r * (3 ±0)` + // Minimum execution time: 279_621_000 picoseconds. + Weight::from_parts(286_171_188, 6802) + // Standard Error: 431 + .saturating_add(Weight::from_parts(183_093, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 3).saturating_mul(r.into())) } @@ -635,8 +594,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -644,13 +605,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_caller_is_root(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `701 + r * (3 ±0)` - // Estimated: `6641 + r * (3 ±0)` - // Minimum execution time: 252_729_000 picoseconds. - Weight::from_parts(269_519_695, 6641) - // Standard Error: 364 - .saturating_add(Weight::from_parts(149_029, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6_u64)) + // Measured: `747 + r * (3 ±0)` + // Estimated: `6687 + r * (3 ±0)` + // Minimum execution time: 259_882_000 picoseconds. + Weight::from_parts(275_221_455, 6687) + // Standard Error: 373 + .saturating_add(Weight::from_parts(160_615, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 3).saturating_mul(r.into())) } @@ -660,8 +621,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -669,13 +632,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_address(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `815 + r * (6 ±0)` - // Estimated: `6757 + r * (6 ±0)` - // Minimum execution time: 254_003_000 picoseconds. - Weight::from_parts(273_706_638, 6757) - // Standard Error: 636 - .saturating_add(Weight::from_parts(344_795, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `861 + r * (6 ±0)` + // Estimated: `6803 + r * (6 ±0)` + // Minimum execution time: 257_771_000 picoseconds. + Weight::from_parts(286_698_304, 6803) + // Standard Error: 974 + .saturating_add(Weight::from_parts(345_777, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } @@ -685,8 +648,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -694,13 +659,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_gas_left(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `811 + r * (6 ±0)` - // Estimated: `6752 + r * (6 ±0)` - // Minimum execution time: 258_765_000 picoseconds. - Weight::from_parts(285_314_067, 6752) - // Standard Error: 747 - .saturating_add(Weight::from_parts(530_682, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `857 + r * (6 ±0)` + // Estimated: `6798 + r * (6 ±0)` + // Minimum execution time: 275_924_000 picoseconds. + Weight::from_parts(292_084_788, 6798) + // Standard Error: 1_946 + .saturating_add(Weight::from_parts(543_595, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } @@ -710,8 +675,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -719,12 +686,39 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_balance(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `955 + r * (6 ±0)` - // Estimated: `6879 + r * (6 ±0)` - // Minimum execution time: 249_124_000 picoseconds. - Weight::from_parts(280_931_810, 6879) - // Standard Error: 1_222 - .saturating_add(Weight::from_parts(1_589_424, 0).saturating_mul(r.into())) + // Measured: `1001 + r * (6 ±0)` + // Estimated: `6925 + r * (6 ±0)` + // Minimum execution time: 275_657_000 picoseconds. + Weight::from_parts(290_421_668, 6925) + // Standard Error: 2_153 + .saturating_add(Weight::from_parts(1_583_388, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) + } + /// Storage: Contracts MigrationInProgress (r:1 w:0) + /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) + /// Storage: Contracts ContractInfoOf (r:1 w:1) + /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) + /// Storage: System EventTopics (r:2 w:2) + /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) + /// The range of component `r` is `[0, 1600]`. + fn seal_value_transferred(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `871 + r * (6 ±0)` + // Estimated: `6820 + r * (6 ±0)` + // Minimum execution time: 276_367_000 picoseconds. + Weight::from_parts(287_733_897, 6820) + // Standard Error: 946 + .saturating_add(Weight::from_parts(338_966, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) @@ -735,33 +729,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) - /// The range of component `r` is `[0, 1600]`. - fn seal_value_transferred(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `825 + r * (6 ±0)` - // Estimated: `6774 + r * (6 ±0)` - // Minimum execution time: 262_064_000 picoseconds. - Weight::from_parts(275_109_661, 6774) - // Standard Error: 1_125 - .saturating_add(Weight::from_parts(347_597, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) - } - /// Storage: Contracts MigrationInProgress (r:1 w:0) - /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -769,13 +740,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_minimum_balance(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `823 + r * (6 ±0)` - // Estimated: `6772 + r * (6 ±0)` - // Minimum execution time: 257_647_000 picoseconds. - Weight::from_parts(282_016_138, 6772) - // Standard Error: 598 - .saturating_add(Weight::from_parts(331_430, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `869 + r * (6 ±0)` + // Estimated: `6818 + r * (6 ±0)` + // Minimum execution time: 277_266_000 picoseconds. + Weight::from_parts(291_007_793, 6818) + // Standard Error: 694 + .saturating_add(Weight::from_parts(338_777, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } @@ -785,8 +756,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -794,13 +767,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_block_number(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `820 + r * (6 ±0)` - // Estimated: `6770 + r * (6 ±0)` - // Minimum execution time: 270_534_000 picoseconds. - Weight::from_parts(282_587_049, 6770) - // Standard Error: 558 - .saturating_add(Weight::from_parts(326_833, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `866 + r * (6 ±0)` + // Estimated: `6816 + r * (6 ±0)` + // Minimum execution time: 273_733_000 picoseconds. + Weight::from_parts(286_843_659, 6816) + // Standard Error: 677 + .saturating_add(Weight::from_parts(334_973, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } @@ -810,8 +783,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -819,13 +794,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_now(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `811 + r * (6 ±0)` - // Estimated: `6756 + r * (6 ±0)` - // Minimum execution time: 265_995_000 picoseconds. - Weight::from_parts(281_210_033, 6756) - // Standard Error: 585 - .saturating_add(Weight::from_parts(328_710, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `857 + r * (6 ±0)` + // Estimated: `6802 + r * (6 ±0)` + // Minimum execution time: 274_990_000 picoseconds. + Weight::from_parts(289_331_002, 6802) + // Standard Error: 1_377 + .saturating_add(Weight::from_parts(337_816, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } @@ -835,8 +810,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0) @@ -846,13 +823,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_weight_to_fee(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `885 + r * (14 ±0)` - // Estimated: `6818 + r * (14 ±0)` - // Minimum execution time: 271_858_000 picoseconds. - Weight::from_parts(293_995_797, 6818) - // Standard Error: 2_418 - .saturating_add(Weight::from_parts(1_477_929, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `931 + r * (14 ±0)` + // Estimated: `6864 + r * (14 ±0)` + // Minimum execution time: 272_562_000 picoseconds. + Weight::from_parts(294_251_468, 6864) + // Standard Error: 3_230 + .saturating_add(Weight::from_parts(1_410_191, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 14).saturating_mul(r.into())) } @@ -862,33 +839,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) - /// The range of component `r` is `[0, 1600]`. - fn seal_gas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `778 + r * (4 ±0)` - // Estimated: `6720 + r * (4 ±0)` - // Minimum execution time: 155_850_000 picoseconds. - Weight::from_parts(166_696_760, 6720) - // Standard Error: 406 - .saturating_add(Weight::from_parts(144_167, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 4).saturating_mul(r.into())) - } - /// Storage: Contracts MigrationInProgress (r:1 w:0) - /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -896,13 +850,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_input(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `813 + r * (6 ±0)` - // Estimated: `6757 + r * (6 ±0)` - // Minimum execution time: 250_636_000 picoseconds. - Weight::from_parts(280_298_031, 6757) - // Standard Error: 904 - .saturating_add(Weight::from_parts(275_136, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `859 + r * (6 ±0)` + // Estimated: `6803 + r * (6 ±0)` + // Minimum execution time: 280_635_000 picoseconds. + Weight::from_parts(287_918_595, 6803) + // Standard Error: 695 + .saturating_add(Weight::from_parts(289_762, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } @@ -912,8 +866,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -921,13 +877,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 1048576]`. fn seal_input_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `817` - // Estimated: `6757` - // Minimum execution time: 254_897_000 picoseconds. - Weight::from_parts(225_376_740, 6757) - // Standard Error: 24 - .saturating_add(Weight::from_parts(986, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `863` + // Estimated: `6803` + // Minimum execution time: 280_743_000 picoseconds. + Weight::from_parts(227_444_594, 6803) + // Standard Error: 23 + .saturating_add(Weight::from_parts(1_030, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) @@ -936,8 +892,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -945,13 +903,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1]`. fn seal_return(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `801 + r * (45 ±0)` - // Estimated: `6741 + r * (45 ±0)` - // Minimum execution time: 245_352_000 picoseconds. - Weight::from_parts(272_824_342, 6741) - // Standard Error: 946_718 - .saturating_add(Weight::from_parts(7_323_857, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `847 + r * (45 ±0)` + // Estimated: `6787 + r * (45 ±0)` + // Minimum execution time: 250_827_000 picoseconds. + Weight::from_parts(279_351_093, 6787) + // Standard Error: 876_511 + .saturating_add(Weight::from_parts(92_006, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 45).saturating_mul(r.into())) } @@ -961,8 +919,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -970,13 +930,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 1048576]`. fn seal_return_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `811` - // Estimated: `6764` - // Minimum execution time: 263_036_000 picoseconds. - Weight::from_parts(274_068_287, 6764) - // Standard Error: 0 - .saturating_add(Weight::from_parts(209, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `857` + // Estimated: `6810` + // Minimum execution time: 272_085_000 picoseconds. + Weight::from_parts(284_343_813, 6810) + // Standard Error: 1 + .saturating_add(Weight::from_parts(329, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) @@ -985,14 +945,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:1) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: Contracts DeletionQueueCounter (r:1 w:1) /// Proof: Contracts DeletionQueueCounter (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:1 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) /// Storage: System EventTopics (r:3 w:3) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) /// Storage: Contracts DeletionQueue (r:0 w:1) @@ -1000,17 +960,17 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1]`. fn seal_terminate(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `843 + r * (356 ±0)` - // Estimated: `6783 + r * (7781 ±0)` - // Minimum execution time: 252_516_000 picoseconds. - Weight::from_parts(279_325_114, 6783) - // Standard Error: 934_499 - .saturating_add(Weight::from_parts(133_604_685, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().reads((6_u64).saturating_mul(r.into()))) + // Measured: `889 + r * (300 ±0)` + // Estimated: `6829 + r * (7725 ±0)` + // Minimum execution time: 255_731_000 picoseconds. + Weight::from_parts(282_377_122, 6829) + // Standard Error: 911_459 + .saturating_add(Weight::from_parts(130_693_677, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().reads((5_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((8_u64).saturating_mul(r.into()))) - .saturating_add(Weight::from_parts(0, 7781).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(0, 7725).saturating_mul(r.into())) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) @@ -1018,8 +978,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) @@ -1029,12 +991,39 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_random(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `892 + r * (10 ±0)` - // Estimated: `6833 + r * (10 ±0)` - // Minimum execution time: 267_643_000 picoseconds. - Weight::from_parts(288_437_123, 6833) - // Standard Error: 1_464 - .saturating_add(Weight::from_parts(1_963_778, 0).saturating_mul(r.into())) + // Measured: `938 + r * (10 ±0)` + // Estimated: `6879 + r * (10 ±0)` + // Minimum execution time: 267_767_000 picoseconds. + Weight::from_parts(277_950_288, 6879) + // Standard Error: 3_787 + .saturating_add(Weight::from_parts(1_971_448, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 10).saturating_mul(r.into())) + } + /// Storage: Contracts MigrationInProgress (r:1 w:0) + /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) + /// Storage: Contracts ContractInfoOf (r:1 w:1) + /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) + /// Storage: System EventTopics (r:2 w:2) + /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) + /// The range of component `r` is `[0, 1600]`. + fn seal_deposit_event(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `857 + r * (10 ±0)` + // Estimated: `6802 + r * (10 ±0)` + // Minimum execution time: 270_791_000 picoseconds. + Weight::from_parts(275_451_505, 6802) + // Standard Error: 5_954 + .saturating_add(Weight::from_parts(3_860_605, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 10).saturating_mul(r.into())) @@ -1045,33 +1034,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) - /// The range of component `r` is `[0, 1600]`. - fn seal_deposit_event(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `811 + r * (10 ±0)` - // Estimated: `6756 + r * (10 ±0)` - // Minimum execution time: 253_177_000 picoseconds. - Weight::from_parts(289_366_852, 6756) - // Standard Error: 3_086 - .saturating_add(Weight::from_parts(3_721_716, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 10).saturating_mul(r.into())) - } - /// Storage: Contracts MigrationInProgress (r:1 w:0) - /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:6 w:6) @@ -1080,15 +1046,15 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 16384]`. fn seal_deposit_event_per_topic_and_byte(t: u32, n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `830 + t * (32 ±0)` - // Estimated: `6777 + t * (2508 ±0)` - // Minimum execution time: 269_777_000 picoseconds. - Weight::from_parts(282_461_237, 6777) - // Standard Error: 104_138 - .saturating_add(Weight::from_parts(3_212_141, 0).saturating_mul(t.into())) + // Measured: `876 + t * (32 ±0)` + // Estimated: `6823 + t * (2508 ±0)` + // Minimum execution time: 274_766_000 picoseconds. + Weight::from_parts(291_476_869, 6823) + // Standard Error: 104_473 + .saturating_add(Weight::from_parts(3_104_443, 0).saturating_mul(t.into())) // Standard Error: 29 - .saturating_add(Weight::from_parts(850, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(Weight::from_parts(698, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(t.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(t.into()))) @@ -1100,8 +1066,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -1109,13 +1077,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_debug_message(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `810 + r * (7 ±0)` - // Estimated: `6754 + r * (7 ±0)` - // Minimum execution time: 161_463_000 picoseconds. - Weight::from_parts(175_209_131, 6754) - // Standard Error: 412 - .saturating_add(Weight::from_parts(236_340, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `856 + r * (7 ±0)` + // Estimated: `6800 + r * (7 ±0)` + // Minimum execution time: 169_748_000 picoseconds. + Weight::from_parts(180_313_117, 6800) + // Standard Error: 454 + .saturating_add(Weight::from_parts(245_983, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 7).saturating_mul(r.into())) } @@ -1125,8 +1093,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: MaxEncodedLen) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: MaxEncodedLen) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: MaxEncodedLen) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: MaxEncodedLen) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) /// Storage: System EventTopics (r:2 w:2) @@ -1134,13 +1104,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `i` is `[0, 1048576]`. fn seal_debug_message_per_byte(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `125761` - // Estimated: `131703` - // Minimum execution time: 390_202_000 picoseconds. - Weight::from_parts(366_539_716, 131703) + // Measured: `125807` + // Estimated: `131749` + // Minimum execution time: 415_021_000 picoseconds. + Weight::from_parts(390_542_412, 131749) // Standard Error: 12 - .saturating_add(Weight::from_parts(1_035, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(Weight::from_parts(1_061, 0).saturating_mul(i.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Skipped Metadata (r:0 w:0) @@ -1148,13 +1118,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 800]`. fn seal_set_storage(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `878 + r * (292 ±0)` - // Estimated: `876 + r * (293 ±0)` - // Minimum execution time: 262_008_000 picoseconds. - Weight::from_parts(157_764_815, 876) - // Standard Error: 12_764 - .saturating_add(Weight::from_parts(7_067_072, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `924 + r * (292 ±0)` + // Estimated: `922 + r * (293 ±0)` + // Minimum execution time: 273_094_000 picoseconds. + Weight::from_parts(210_515_595, 922) + // Standard Error: 12_565 + .saturating_add(Weight::from_parts(7_037_698, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) @@ -1165,13 +1135,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 16384]`. fn seal_set_storage_per_new_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1337` - // Estimated: `1313` - // Minimum execution time: 289_607_000 picoseconds. - Weight::from_parts(336_924_770, 1313) - // Standard Error: 60 - .saturating_add(Weight::from_parts(403, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(9_u64)) + // Measured: `1383` + // Estimated: `1359` + // Minimum execution time: 288_990_000 picoseconds. + Weight::from_parts(339_177_945, 1359) + // Standard Error: 67 + .saturating_add(Weight::from_parts(496, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } /// Storage: Skipped Metadata (r:0 w:0) @@ -1179,13 +1149,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 16384]`. fn seal_set_storage_per_old_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1200 + n * (1 ±0)` - // Estimated: `1200 + n * (1 ±0)` - // Minimum execution time: 275_887_000 picoseconds. - Weight::from_parts(301_734_237, 1200) - // Standard Error: 37 - .saturating_add(Weight::from_parts(204, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `1246 + n * (1 ±0)` + // Estimated: `1246 + n * (1 ±0)` + // Minimum execution time: 279_998_000 picoseconds. + Weight::from_parts(302_247_796, 1246) + // Standard Error: 32 + .saturating_add(Weight::from_parts(156, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1194,13 +1164,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 800]`. fn seal_clear_storage(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `874 + r * (288 ±0)` - // Estimated: `878 + r * (289 ±0)` - // Minimum execution time: 253_436_000 picoseconds. - Weight::from_parts(157_140_488, 878) - // Standard Error: 13_050 - .saturating_add(Weight::from_parts(6_929_024, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `920 + r * (288 ±0)` + // Estimated: `924 + r * (289 ±0)` + // Minimum execution time: 272_959_000 picoseconds. + Weight::from_parts(182_351_901, 924) + // Standard Error: 14_269 + .saturating_add(Weight::from_parts(6_959_823, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) @@ -1211,13 +1181,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 16384]`. fn seal_clear_storage_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1196 + n * (1 ±0)` - // Estimated: `1196 + n * (1 ±0)` - // Minimum execution time: 272_714_000 picoseconds. - Weight::from_parts(300_359_254, 1196) - // Standard Error: 35 - .saturating_add(Weight::from_parts(34, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `1242 + n * (1 ±0)` + // Estimated: `1242 + n * (1 ±0)` + // Minimum execution time: 281_078_000 picoseconds. + Weight::from_parts(303_340_005, 1242) + // Standard Error: 32 + .saturating_add(Weight::from_parts(75, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1226,13 +1196,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 800]`. fn seal_get_storage(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `868 + r * (296 ±0)` - // Estimated: `873 + r * (297 ±0)` - // Minimum execution time: 252_868_000 picoseconds. - Weight::from_parts(192_325_247, 873) - // Standard Error: 9_612 - .saturating_add(Weight::from_parts(5_614_703, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `914 + r * (296 ±0)` + // Estimated: `919 + r * (297 ±0)` + // Minimum execution time: 272_204_000 picoseconds. + Weight::from_parts(181_840_247, 919) + // Standard Error: 12_990 + .saturating_add(Weight::from_parts(5_803_235, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 297).saturating_mul(r.into())) @@ -1242,13 +1212,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 16384]`. fn seal_get_storage_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1212 + n * (1 ±0)` - // Estimated: `1212 + n * (1 ±0)` - // Minimum execution time: 275_076_000 picoseconds. - Weight::from_parts(298_464_611, 1212) - // Standard Error: 31 - .saturating_add(Weight::from_parts(691, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `1258 + n * (1 ±0)` + // Estimated: `1258 + n * (1 ±0)` + // Minimum execution time: 285_806_000 picoseconds. + Weight::from_parts(299_198_348, 1258) + // Standard Error: 35 + .saturating_add(Weight::from_parts(1_087, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1257,13 +1227,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 800]`. fn seal_contains_storage(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `889 + r * (288 ±0)` - // Estimated: `890 + r * (289 ±0)` - // Minimum execution time: 271_528_000 picoseconds. - Weight::from_parts(190_055_750, 890) - // Standard Error: 9_295 - .saturating_add(Weight::from_parts(5_481_564, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `935 + r * (288 ±0)` + // Estimated: `936 + r * (289 ±0)` + // Minimum execution time: 266_945_000 picoseconds. + Weight::from_parts(204_591_050, 936) + // Standard Error: 10_852 + .saturating_add(Weight::from_parts(5_489_051, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 289).saturating_mul(r.into())) @@ -1273,13 +1243,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 16384]`. fn seal_contains_storage_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1199 + n * (1 ±0)` - // Estimated: `1199 + n * (1 ±0)` - // Minimum execution time: 272_948_000 picoseconds. - Weight::from_parts(296_828_541, 1199) - // Standard Error: 32 - .saturating_add(Weight::from_parts(224, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `1245 + n * (1 ±0)` + // Estimated: `1245 + n * (1 ±0)` + // Minimum execution time: 269_827_000 picoseconds. + Weight::from_parts(294_861_647, 1245) + // Standard Error: 36 + .saturating_add(Weight::from_parts(385, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1288,13 +1258,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 800]`. fn seal_take_storage(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `862 + r * (296 ±0)` - // Estimated: `869 + r * (297 ±0)` - // Minimum execution time: 261_242_000 picoseconds. - Weight::from_parts(182_730_565, 869) - // Standard Error: 10_598 - .saturating_add(Weight::from_parts(6_955_347, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `908 + r * (296 ±0)` + // Estimated: `915 + r * (297 ±0)` + // Minimum execution time: 270_903_000 picoseconds. + Weight::from_parts(179_016_061, 915) + // Standard Error: 13_815 + .saturating_add(Weight::from_parts(7_103_586, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) @@ -1305,13 +1275,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 16384]`. fn seal_take_storage_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1213 + n * (1 ±0)` - // Estimated: `1213 + n * (1 ±0)` - // Minimum execution time: 273_109_000 picoseconds. - Weight::from_parts(296_844_706, 1213) - // Standard Error: 38 - .saturating_add(Weight::from_parts(922, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `1259 + n * (1 ±0)` + // Estimated: `1259 + n * (1 ±0)` + // Minimum execution time: 285_233_000 picoseconds. + Weight::from_parts(307_266_872, 1259) + // Standard Error: 42 + .saturating_add(Weight::from_parts(340, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1321,8 +1291,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -1330,13 +1302,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_transfer(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1406 + r * (45 ±0)` - // Estimated: `7303 + r * (2520 ±0)` - // Minimum execution time: 258_602_000 picoseconds. - Weight::from_parts(292_720_006, 7303) - // Standard Error: 25_954 - .saturating_add(Weight::from_parts(38_220_140, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `1452 + r * (45 ±0)` + // Estimated: `7349 + r * (2520 ±0)` + // Minimum execution time: 272_760_000 picoseconds. + Weight::from_parts(169_488_533, 7349) + // Standard Error: 29_765 + .saturating_add(Weight::from_parts(39_376_406, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(4_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) @@ -1348,8 +1320,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:801 w:801) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:2 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:2 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:2 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:803 w:803) @@ -1357,13 +1331,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 800]`. fn seal_call(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1173 + r * (276 ±0)` - // Estimated: `9365 + r * (2752 ±0)` - // Minimum execution time: 259_809_000 picoseconds. - Weight::from_parts(272_562_000, 9365) - // Standard Error: 99_053 - .saturating_add(Weight::from_parts(238_943_491, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(9_u64)) + // Measured: `1296 + r * (276 ±0)` + // Estimated: `9481 + r * (2752 ±0)` + // Minimum execution time: 272_684_000 picoseconds. + Weight::from_parts(277_233_000, 9481) + // Standard Error: 118_314 + .saturating_add(Weight::from_parts(248_277_789, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(4_u64)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(r.into()))) @@ -1375,8 +1349,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:736 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:736 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:736 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:737 w:737) @@ -1384,17 +1360,17 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 800]`. fn seal_delegate_call(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + r * (502 ±0)` - // Estimated: `6760 + r * (2572 ±3)` - // Minimum execution time: 251_738_000 picoseconds. - Weight::from_parts(268_350_000, 6760) - // Standard Error: 114_916 - .saturating_add(Weight::from_parts(233_073_585, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(r.into()))) + // Measured: `0 + r * (572 ±0)` + // Estimated: `6806 + r * (2633 ±3)` + // Minimum execution time: 273_037_000 picoseconds. + Weight::from_parts(278_708_000, 6806) + // Standard Error: 148_237 + .saturating_add(Weight::from_parts(246_429_899, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) - .saturating_add(Weight::from_parts(0, 2572).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(0, 2633).saturating_mul(r.into())) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) @@ -1402,8 +1378,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:2 w:2) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:2 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:2 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:2 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:4 w:4) @@ -1412,15 +1390,15 @@ impl WeightInfo for SubstrateWeight { /// The range of component `c` is `[0, 1048576]`. fn seal_call_per_transfer_clone_byte(t: u32, c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1187 + t * (204 ±0)` - // Estimated: `12077 + t * (5154 ±0)` - // Minimum execution time: 457_896_000 picoseconds. - Weight::from_parts(87_898_644, 12077) - // Standard Error: 11_813_448 - .saturating_add(Weight::from_parts(343_454_719, 0).saturating_mul(t.into())) + // Measured: `1308 + t * (204 ±0)` + // Estimated: `12198 + t * (5154 ±0)` + // Minimum execution time: 458_571_000 picoseconds. + Weight::from_parts(82_434_924, 12198) + // Standard Error: 12_112_923 + .saturating_add(Weight::from_parts(375_570_955, 0).saturating_mul(t.into())) // Standard Error: 17 - .saturating_add(Weight::from_parts(954, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(11_u64)) + .saturating_add(Weight::from_parts(1_064, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(t.into()))) .saturating_add(T::DbWeight::get().writes(6_u64)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(t.into()))) @@ -1432,30 +1410,30 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:801 w:801) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:801 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:801 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:801 w:800) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: Contracts Nonce (r:1 w:1) /// Proof: Contracts Nonce (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:800 w:800) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) /// Storage: System EventTopics (r:802 w:802) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) /// The range of component `r` is `[1, 800]`. fn seal_instantiate(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1355 + r * (254 ±0)` - // Estimated: `7179 + r * (5205 ±0)` - // Minimum execution time: 648_531_000 picoseconds. - Weight::from_parts(662_333_000, 7179) - // Standard Error: 358_232 - .saturating_add(Weight::from_parts(380_628_577, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(9_u64)) + // Measured: `1383 + r * (251 ±0)` + // Estimated: `7207 + r * (5202 ±0)` + // Minimum execution time: 660_700_000 picoseconds. + Weight::from_parts(675_097_000, 7207) + // Standard Error: 364_345 + .saturating_add(Weight::from_parts(400_003_245, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().reads((6_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(6_u64)) .saturating_add(T::DbWeight::get().writes((5_u64).saturating_mul(r.into()))) - .saturating_add(Weight::from_parts(0, 5205).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(0, 5202).saturating_mul(r.into())) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) @@ -1463,14 +1441,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:2 w:2) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:2 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:2 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:2 w:1) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: Contracts Nonce (r:1 w:1) /// Proof: Contracts Nonce (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:1 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) /// Storage: System EventTopics (r:3 w:3) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) /// The range of component `t` is `[0, 1]`. @@ -1478,15 +1456,17 @@ impl WeightInfo for SubstrateWeight { /// The range of component `s` is `[0, 983040]`. fn seal_instantiate_per_transfer_input_salt_byte(t: u32, i: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1104 + t * (187 ±0)` - // Estimated: `9525 + t * (2634 ±2)` - // Minimum execution time: 2_264_883_000 picoseconds. - Weight::from_parts(1_359_758_730, 9525) - // Standard Error: 18 - .saturating_add(Weight::from_parts(934, 0).saturating_mul(i.into())) - // Standard Error: 18 - .saturating_add(Weight::from_parts(1_068, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(14_u64)) + // Measured: `1131 + t * (187 ±0)` + // Estimated: `9552 + t * (2634 ±2)` + // Minimum execution time: 2_327_206_000 picoseconds. + Weight::from_parts(1_365_575_361, 9552) + // Standard Error: 16_883_593 + .saturating_add(Weight::from_parts(15_130_866, 0).saturating_mul(t.into())) + // Standard Error: 26 + .saturating_add(Weight::from_parts(1_119, 0).saturating_mul(i.into())) + // Standard Error: 26 + .saturating_add(Weight::from_parts(1_189, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(15_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(t.into()))) .saturating_add(T::DbWeight::get().writes(10_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(t.into()))) @@ -1498,8 +1478,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -1507,13 +1489,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_hash_sha2_256(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `810 + r * (8 ±0)` - // Estimated: `6751 + r * (8 ±0)` - // Minimum execution time: 251_065_000 picoseconds. - Weight::from_parts(273_854_510, 6751) - // Standard Error: 561 - .saturating_add(Weight::from_parts(400_980, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `856 + r * (8 ±0)` + // Estimated: `6797 + r * (8 ±0)` + // Minimum execution time: 271_594_000 picoseconds. + Weight::from_parts(290_678_500, 6797) + // Standard Error: 954 + .saturating_add(Weight::from_parts(401_376, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 8).saturating_mul(r.into())) } @@ -1523,8 +1505,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -1532,13 +1516,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 1048576]`. fn seal_hash_sha2_256_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `818` - // Estimated: `6758` - // Minimum execution time: 267_547_000 picoseconds. - Weight::from_parts(270_366_853, 6758) - // Standard Error: 1 - .saturating_add(Weight::from_parts(1_057, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `864` + // Estimated: `6804` + // Minimum execution time: 269_343_000 picoseconds. + Weight::from_parts(267_274_896, 6804) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_120, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) @@ -1547,8 +1531,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -1556,13 +1542,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_hash_keccak_256(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `812 + r * (8 ±0)` - // Estimated: `6754 + r * (8 ±0)` - // Minimum execution time: 258_631_000 picoseconds. - Weight::from_parts(283_500_925, 6754) - // Standard Error: 580 - .saturating_add(Weight::from_parts(769_767, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `858 + r * (8 ±0)` + // Estimated: `6800 + r * (8 ±0)` + // Minimum execution time: 269_201_000 picoseconds. + Weight::from_parts(282_958_755, 6800) + // Standard Error: 1_051 + .saturating_add(Weight::from_parts(826_056, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 8).saturating_mul(r.into())) } @@ -1572,8 +1558,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -1581,13 +1569,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 1048576]`. fn seal_hash_keccak_256_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `820` - // Estimated: `6762` - // Minimum execution time: 254_901_000 picoseconds. - Weight::from_parts(271_698_192, 6762) - // Standard Error: 1 - .saturating_add(Weight::from_parts(3_307, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `866` + // Estimated: `6808` + // Minimum execution time: 268_620_000 picoseconds. + Weight::from_parts(291_085_767, 6808) + // Standard Error: 2 + .saturating_add(Weight::from_parts(3_364, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) @@ -1596,8 +1584,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -1605,13 +1595,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_hash_blake2_256(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `812 + r * (8 ±0)` - // Estimated: `6757 + r * (8 ±0)` - // Minimum execution time: 251_592_000 picoseconds. - Weight::from_parts(276_726_774, 6757) - // Standard Error: 782 - .saturating_add(Weight::from_parts(454_219, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `858 + r * (8 ±0)` + // Estimated: `6803 + r * (8 ±0)` + // Minimum execution time: 268_594_000 picoseconds. + Weight::from_parts(285_367_992, 6803) + // Standard Error: 715 + .saturating_add(Weight::from_parts(465_706, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 8).saturating_mul(r.into())) } @@ -1621,8 +1611,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -1630,13 +1622,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 1048576]`. fn seal_hash_blake2_256_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `820` - // Estimated: `6766` - // Minimum execution time: 253_548_000 picoseconds. - Weight::from_parts(269_388_353, 6766) + // Measured: `866` + // Estimated: `6812` + // Minimum execution time: 267_616_000 picoseconds. + Weight::from_parts(271_719_406, 6812) // Standard Error: 1 - .saturating_add(Weight::from_parts(1_188, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(Weight::from_parts(1_225, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) @@ -1645,8 +1637,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -1654,13 +1648,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_hash_blake2_128(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `812 + r * (8 ±0)` - // Estimated: `6758 + r * (8 ±0)` - // Minimum execution time: 257_095_000 picoseconds. - Weight::from_parts(278_794_198, 6758) - // Standard Error: 2_136 - .saturating_add(Weight::from_parts(454_483, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `858 + r * (8 ±0)` + // Estimated: `6804 + r * (8 ±0)` + // Minimum execution time: 270_531_000 picoseconds. + Weight::from_parts(283_734_748, 6804) + // Standard Error: 652 + .saturating_add(Weight::from_parts(464_718, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 8).saturating_mul(r.into())) } @@ -1670,8 +1664,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -1679,13 +1675,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 1048576]`. fn seal_hash_blake2_128_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `820` - // Estimated: `6760` - // Minimum execution time: 253_356_000 picoseconds. - Weight::from_parts(267_310_090, 6760) + // Measured: `866` + // Estimated: `6806` + // Minimum execution time: 273_440_000 picoseconds. + Weight::from_parts(273_385_519, 6806) // Standard Error: 1 - .saturating_add(Weight::from_parts(1_190, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(Weight::from_parts(1_221, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) @@ -1694,8 +1690,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -1703,13 +1701,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 125697]`. fn seal_sr25519_verify_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `945 + n * (1 ±0)` - // Estimated: `6882 + n * (1 ±0)` - // Minimum execution time: 330_103_000 picoseconds. - Weight::from_parts(347_576_489, 6882) - // Standard Error: 8 - .saturating_add(Weight::from_parts(5_745, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `991 + n * (1 ±0)` + // Estimated: `6928 + n * (1 ±0)` + // Minimum execution time: 347_494_000 picoseconds. + Weight::from_parts(359_555_666, 6928) + // Standard Error: 19 + .saturating_add(Weight::from_parts(6_073, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -1719,8 +1717,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -1728,13 +1728,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 160]`. fn seal_sr25519_verify(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `759 + r * (112 ±0)` - // Estimated: `6699 + r * (112 ±0)` - // Minimum execution time: 249_849_000 picoseconds. - Weight::from_parts(295_861_610, 6699) - // Standard Error: 7_897 - .saturating_add(Weight::from_parts(56_326_988, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `804 + r * (112 ±0)` + // Estimated: `6745 + r * (112 ±0)` + // Minimum execution time: 271_899_000 picoseconds. + Weight::from_parts(341_998_900, 6745) + // Standard Error: 16_017 + .saturating_add(Weight::from_parts(56_033_707, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 112).saturating_mul(r.into())) } @@ -1744,8 +1744,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -1753,13 +1755,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 160]`. fn seal_ecdsa_recover(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `854 + r * (76 ±0)` - // Estimated: `6749 + r * (77 ±0)` - // Minimum execution time: 252_437_000 picoseconds. - Weight::from_parts(316_808_420, 6749) - // Standard Error: 13_551 - .saturating_add(Weight::from_parts(45_999_840, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `900 + r * (76 ±0)` + // Estimated: `6795 + r * (77 ±0)` + // Minimum execution time: 275_662_000 picoseconds. + Weight::from_parts(351_585_440, 6795) + // Standard Error: 20_452 + .saturating_add(Weight::from_parts(46_289_357, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 77).saturating_mul(r.into())) } @@ -1769,8 +1771,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -1778,13 +1782,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 160]`. fn seal_ecdsa_to_eth_address(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `825 + r * (42 ±0)` - // Estimated: `6764 + r * (42 ±0)` - // Minimum execution time: 265_684_000 picoseconds. - Weight::from_parts(284_413_181, 6764) - // Standard Error: 6_475 - .saturating_add(Weight::from_parts(12_107_021, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `871 + r * (42 ±0)` + // Estimated: `6810 + r * (42 ±0)` + // Minimum execution time: 275_543_000 picoseconds. + Weight::from_parts(329_759_758, 6810) + // Standard Error: 17_863 + .saturating_add(Weight::from_parts(38_645_318, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 42).saturating_mul(r.into())) } @@ -1794,28 +1798,28 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1536 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1536 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1536 w:1536) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:1536 w:1536) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) /// Storage: System EventTopics (r:1538 w:1538) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) /// The range of component `r` is `[0, 1600]`. fn seal_set_code_hash(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + r * (964 ±0)` - // Estimated: `8223 + r * (3090 ±7)` - // Minimum execution time: 251_196_000 picoseconds. - Weight::from_parts(270_744_000, 8223) - // Standard Error: 40_610 - .saturating_add(Weight::from_parts(22_903_375, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `0 + r * (961 ±0)` + // Estimated: `6801 + r * (3087 ±7)` + // Minimum execution time: 274_328_000 picoseconds. + Weight::from_parts(281_508_000, 6801) + // Standard Error: 57_665 + .saturating_add(Weight::from_parts(25_993_241, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(r.into()))) - .saturating_add(Weight::from_parts(0, 3090).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(0, 3087).saturating_mul(r.into())) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) @@ -1823,8 +1827,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -1832,13 +1838,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_reentrance_count(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `806 + r * (3 ±0)` - // Estimated: `6756 + r * (3 ±0)` - // Minimum execution time: 262_805_000 picoseconds. - Weight::from_parts(275_660_655, 6756) - // Standard Error: 380 - .saturating_add(Weight::from_parts(167_290, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `852 + r * (3 ±0)` + // Estimated: `6802 + r * (3 ±0)` + // Minimum execution time: 273_587_000 picoseconds. + Weight::from_parts(284_346_594, 6802) + // Standard Error: 388 + .saturating_add(Weight::from_parts(178_567, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 3).saturating_mul(r.into())) } @@ -1848,8 +1854,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -1857,13 +1865,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_account_reentrance_count(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2008 + r * (39 ±0)` - // Estimated: `7838 + r * (40 ±0)` - // Minimum execution time: 263_232_000 picoseconds. - Weight::from_parts(308_403_848, 7838) - // Standard Error: 695 - .saturating_add(Weight::from_parts(261_716, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `2092 + r * (39 ±0)` + // Estimated: `7919 + r * (40 ±0)` + // Minimum execution time: 262_400_000 picoseconds. + Weight::from_parts(376_113_011, 7919) + // Standard Error: 2_401 + .saturating_add(Weight::from_parts(309_059, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 40).saturating_mul(r.into())) } @@ -1873,8 +1881,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: Contracts Nonce (r:1 w:1) @@ -1884,13 +1894,13 @@ impl WeightInfo for SubstrateWeight { /// The range of component `r` is `[0, 1600]`. fn seal_instantiation_nonce(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `809 + r * (3 ±0)` - // Estimated: `6756 + r * (3 ±0)` - // Minimum execution time: 255_952_000 picoseconds. - Weight::from_parts(285_541_315, 6756) - // Standard Error: 459 - .saturating_add(Weight::from_parts(145_305, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `855 + r * (3 ±0)` + // Estimated: `6802 + r * (3 ±0)` + // Minimum execution time: 259_797_000 picoseconds. + Weight::from_parts(285_980_763, 6802) + // Standard Error: 507 + .saturating_add(Weight::from_parts(159_269, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) .saturating_add(Weight::from_parts(0, 3).saturating_mul(r.into())) } @@ -1899,510 +1909,10 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_405_000 picoseconds. - Weight::from_parts(1_583_300, 0) - // Standard Error: 1 - .saturating_add(Weight::from_parts(2_743, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64load(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_796_000 picoseconds. - Weight::from_parts(2_279_812, 0) - // Standard Error: 7 - .saturating_add(Weight::from_parts(6_339, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64store(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_768_000 picoseconds. - Weight::from_parts(2_274_070, 0) - // Standard Error: 4 - .saturating_add(Weight::from_parts(6_647, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_select(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_396_000 picoseconds. - Weight::from_parts(1_730_388, 0) - // Standard Error: 5 - .saturating_add(Weight::from_parts(8_918, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_if(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_383_000 picoseconds. - Weight::from_parts(1_473_000, 0) - // Standard Error: 22 - .saturating_add(Weight::from_parts(12_167, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_br(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_418_000 picoseconds. - Weight::from_parts(1_490_208, 0) - // Standard Error: 18 - .saturating_add(Weight::from_parts(6_271, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_br_if(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_396_000 picoseconds. - Weight::from_parts(1_584_684, 0) - // Standard Error: 61 - .saturating_add(Weight::from_parts(8_819, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_br_table(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_384_000 picoseconds. - Weight::from_parts(1_501_244, 0) - // Standard Error: 17 - .saturating_add(Weight::from_parts(12_311, 0).saturating_mul(r.into())) - } - /// The range of component `e` is `[1, 256]`. - fn instr_br_table_per_entry(e: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_433_000 picoseconds. - Weight::from_parts(1_594_462, 0) - // Standard Error: 19 - .saturating_add(Weight::from_parts(29, 0).saturating_mul(e.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_call(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_420_000 picoseconds. - Weight::from_parts(1_602_036, 0) - // Standard Error: 16 - .saturating_add(Weight::from_parts(17_082, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_call_indirect(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_619_000 picoseconds. - Weight::from_parts(2_069_590, 0) - // Standard Error: 20 - .saturating_add(Weight::from_parts(24_049, 0).saturating_mul(r.into())) - } - /// The range of component `l` is `[0, 1024]`. - fn instr_call_per_local(l: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_478_000 picoseconds. - Weight::from_parts(1_699_579, 0) - // Standard Error: 13 - .saturating_add(Weight::from_parts(1_651, 0).saturating_mul(l.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_local_get(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_123_000 picoseconds. - Weight::from_parts(3_200_824, 0) - // Standard Error: 12 - .saturating_add(Weight::from_parts(4_187, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_local_set(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_121_000 picoseconds. - Weight::from_parts(3_302_628, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(4_193, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_local_tee(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_155_000 picoseconds. - Weight::from_parts(3_359_832, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(4_829, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_global_get(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_547_000 picoseconds. - Weight::from_parts(1_899_252, 0) - // Standard Error: 13 - .saturating_add(Weight::from_parts(8_373, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_global_set(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_513_000 picoseconds. - Weight::from_parts(1_892_537, 0) - // Standard Error: 15 - .saturating_add(Weight::from_parts(9_177, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_memory_current(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_904_000 picoseconds. - Weight::from_parts(2_140_940, 0) - // Standard Error: 5 - .saturating_add(Weight::from_parts(3_926, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 16]`. - fn instr_memory_grow(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_437_000 picoseconds. - Weight::from_parts(4_481, 0) - // Standard Error: 131_975 - .saturating_add(Weight::from_parts(14_765_592, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64clz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_443_000 picoseconds. - Weight::from_parts(1_596_467, 0) - // Standard Error: 1 - .saturating_add(Weight::from_parts(4_251, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64ctz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_372_000 picoseconds. - Weight::from_parts(1_569_760, 0) - // Standard Error: 7 - .saturating_add(Weight::from_parts(4_777, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64popcnt(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_411_000 picoseconds. - Weight::from_parts(1_642_163, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(4_241, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64eqz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_395_000 picoseconds. - Weight::from_parts(1_726_615, 0) - // Standard Error: 10 - .saturating_add(Weight::from_parts(4_631, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64extendsi32(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_373_000 picoseconds. - Weight::from_parts(1_620_217, 0) - // Standard Error: 1 - .saturating_add(Weight::from_parts(4_220, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64extendui32(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_423_000 picoseconds. - Weight::from_parts(1_611_025, 0) - // Standard Error: 11 - .saturating_add(Weight::from_parts(4_681, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i32wrapi64(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_402_000 picoseconds. - Weight::from_parts(1_616_506, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(4_247, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64eq(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_464_000 picoseconds. - Weight::from_parts(1_641_492, 0) - // Standard Error: 8 - .saturating_add(Weight::from_parts(6_262, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64ne(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_401_000 picoseconds. - Weight::from_parts(1_673_299, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_741, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64lts(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_414_000 picoseconds. - Weight::from_parts(1_615_167, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_767, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64ltu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_445_000 picoseconds. - Weight::from_parts(1_687_595, 0) - // Standard Error: 10 - .saturating_add(Weight::from_parts(6_201, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64gts(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_415_000 picoseconds. - Weight::from_parts(1_629_044, 0) - // Standard Error: 3 - .saturating_add(Weight::from_parts(6_318, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64gtu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_377_000 picoseconds. - Weight::from_parts(1_660_178, 0) - // Standard Error: 3 - .saturating_add(Weight::from_parts(5_774, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64les(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_467_000 picoseconds. - Weight::from_parts(1_619_688, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_761, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64leu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_485_000 picoseconds. - Weight::from_parts(1_619_756, 0) - // Standard Error: 10 - .saturating_add(Weight::from_parts(6_248, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64ges(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_391_000 picoseconds. - Weight::from_parts(1_629_993, 0) - // Standard Error: 3 - .saturating_add(Weight::from_parts(6_339, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64geu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_413_000 picoseconds. - Weight::from_parts(1_605_123, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_774, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64add(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_470_000 picoseconds. - Weight::from_parts(1_699_382, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_736, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64sub(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_394_000 picoseconds. - Weight::from_parts(1_599_038, 0) - // Standard Error: 5 - .saturating_add(Weight::from_parts(6_325, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64mul(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_422_000 picoseconds. - Weight::from_parts(1_655_350, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_753, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64divs(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_407_000 picoseconds. - Weight::from_parts(1_710_195, 0) - // Standard Error: 8 - .saturating_add(Weight::from_parts(6_791, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64divu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_406_000 picoseconds. - Weight::from_parts(2_022_275, 0) - // Standard Error: 13 - .saturating_add(Weight::from_parts(5_864, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64rems(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_424_000 picoseconds. - Weight::from_parts(1_735_622, 0) - // Standard Error: 8 - .saturating_add(Weight::from_parts(6_772, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64remu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_457_000 picoseconds. - Weight::from_parts(1_636_788, 0) - // Standard Error: 4 - .saturating_add(Weight::from_parts(5_794, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64and(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_423_000 picoseconds. - Weight::from_parts(1_703_832, 0) - // Standard Error: 11 - .saturating_add(Weight::from_parts(6_158, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64or(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_401_000 picoseconds. - Weight::from_parts(1_653_216, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_754, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64xor(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_419_000 picoseconds. - Weight::from_parts(1_685_121, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(6_309, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64shl(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_395_000 picoseconds. - Weight::from_parts(1_580_918, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_775, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64shrs(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_408_000 picoseconds. - Weight::from_parts(1_646_493, 0) - // Standard Error: 9 - .saturating_add(Weight::from_parts(6_237, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64shru(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_446_000 picoseconds. - Weight::from_parts(1_633_531, 0) - // Standard Error: 7 - .saturating_add(Weight::from_parts(5_759, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64rotl(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_478_000 picoseconds. - Weight::from_parts(1_634_023, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_771, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64rotr(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_389_000 picoseconds. - Weight::from_parts(1_627_867, 0) - // Standard Error: 10 - .saturating_add(Weight::from_parts(6_175, 0).saturating_mul(r.into())) + // Minimum execution time: 1_253_000 picoseconds. + Weight::from_parts(1_113_896, 0) + // Standard Error: 25 + .saturating_add(Weight::from_parts(10_680, 0).saturating_mul(r.into())) } } @@ -2414,8 +1924,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `142` // Estimated: `1627` - // Minimum execution time: 2_484_000 picoseconds. - Weight::from_parts(2_620_000, 1627) + // Minimum execution time: 2_489_000 picoseconds. + Weight::from_parts(2_592_000, 1627) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: Skipped Metadata (r:0 w:0) @@ -2423,46 +1933,29 @@ impl WeightInfo for () { /// The range of component `k` is `[0, 1024]`. fn on_initialize_per_trie_key(k: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `521 + k * (69 ±0)` - // Estimated: `511 + k * (70 ±0)` - // Minimum execution time: 13_405_000 picoseconds. - Weight::from_parts(13_909_000, 511) - // Standard Error: 1_350 - .saturating_add(Weight::from_parts(1_222_889, 0).saturating_mul(k.into())) + // Measured: `451 + k * (69 ±0)` + // Estimated: `441 + k * (70 ±0)` + // Minimum execution time: 12_888_000 picoseconds. + Weight::from_parts(13_135_000, 441) + // Standard Error: 1_171 + .saturating_add(Weight::from_parts(1_260_794, 0).saturating_mul(k.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(RocksDbWeight::get().writes(2_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 70).saturating_mul(k.into())) } - /// Storage: Contracts PristineCode (r:1 w:0) - /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) - /// Storage: Contracts CodeStorage (r:0 w:1) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) - /// The range of component `c` is `[0, 61717]`. - fn reinstrument(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `271 + c * (1 ±0)` - // Estimated: `3741 + c * (1 ±0)` - // Minimum execution time: 31_202_000 picoseconds. - Weight::from_parts(26_528_080, 3741) - // Standard Error: 55 - .saturating_add(Weight::from_parts(55_528, 0).saturating_mul(c.into())) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) - } - /// Storage: Contracts CodeStorage (r:2 w:1) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) - /// The range of component `c` is `[0, 61717]`. + /// Storage: unknown `0x4342193e496fab7ec59d615ed0dc553022fca90611ba8b7942f8bdb3b97f6580` (r:2 w:1) + /// Proof Skipped: unknown `0x4342193e496fab7ec59d615ed0dc553022fca90611ba8b7942f8bdb3b97f6580` (r:2 w:1) + /// The range of component `c` is `[0, 125952]`. fn v9_migration_step(c: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `211 + c * (1 ±0)` - // Estimated: `6147 + c * (1 ±0)` - // Minimum execution time: 8_510_000 picoseconds. - Weight::from_parts(9_274_212, 6147) + // Estimated: `6149 + c * (1 ±0)` + // Minimum execution time: 8_447_000 picoseconds. + Weight::from_parts(9_221_722, 6149) // Standard Error: 2 - .saturating_add(Weight::from_parts(1_311, 0).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(1_323, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) @@ -2473,10 +1966,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) fn v10_migration_step() -> Weight { // Proof Size summary in bytes: - // Measured: `577` - // Estimated: `6517` - // Minimum execution time: 17_100_000 picoseconds. - Weight::from_parts(17_720_000, 6517) + // Measured: `548` + // Estimated: `6488` + // Minimum execution time: 17_966_000 picoseconds. + Weight::from_parts(18_805_000, 6488) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2489,23 +1982,44 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `171 + k * (1 ±0)` // Estimated: `3635 + k * (1 ±0)` - // Minimum execution time: 3_853_000 picoseconds. - Weight::from_parts(3_951_000, 3635) - // Standard Error: 549 - .saturating_add(Weight::from_parts(1_120_241, 0).saturating_mul(k.into())) + // Minimum execution time: 3_848_000 picoseconds. + Weight::from_parts(3_964_000, 3635) + // Standard Error: 691 + .saturating_add(Weight::from_parts(1_143_905, 0).saturating_mul(k.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 1).saturating_mul(k.into())) } + /// Storage: unknown `0x4342193e496fab7ec59d615ed0dc553053f13fd319a03c211337c76e0fe776df` (r:2 w:0) + /// Proof Skipped: unknown `0x4342193e496fab7ec59d615ed0dc553053f13fd319a03c211337c76e0fe776df` (r:2 w:0) + /// Storage: unknown `0x4342193e496fab7ec59d615ed0dc553022fca90611ba8b7942f8bdb3b97f6580` (r:1 w:1) + /// Proof Skipped: unknown `0x4342193e496fab7ec59d615ed0dc553022fca90611ba8b7942f8bdb3b97f6580` (r:1 w:1) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:0 w:1) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) + /// The range of component `c` is `[0, 125952]`. + fn v12_migration_step(c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `325 + c * (1 ±0)` + // Estimated: `6263 + c * (1 ±0)` + // Minimum execution time: 16_532_000 picoseconds. + Weight::from_parts(16_729_380, 6263) + // Standard Error: 1 + .saturating_add(Weight::from_parts(427, 0).saturating_mul(c.into())) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) + } /// Storage: Contracts MigrationInProgress (r:1 w:1) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) fn migration_noop() -> Weight { // Proof Size summary in bytes: // Measured: `142` // Estimated: `1627` - // Minimum execution time: 3_390_000 picoseconds. - Weight::from_parts(3_503_000, 1627) + // Minimum execution time: 3_251_000 picoseconds. + Weight::from_parts(3_424_000, 1627) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2517,8 +2031,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `166` // Estimated: `3631` - // Minimum execution time: 10_321_000 picoseconds. - Weight::from_parts(10_677_000, 3631) + // Minimum execution time: 12_564_000 picoseconds. + Weight::from_parts(13_051_000, 3631) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -2528,8 +2042,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `142` // Estimated: `3607` - // Minimum execution time: 3_717_000 picoseconds. - Weight::from_parts(3_866_000, 3607) + // Minimum execution time: 4_784_000 picoseconds. + Weight::from_parts(4_986_000, 3607) .saturating_add(RocksDbWeight::get().reads(1_u64)) } /// Storage: unknown `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:0) @@ -2540,8 +2054,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `167` // Estimated: `3632` - // Minimum execution time: 5_668_000 picoseconds. - Weight::from_parts(5_982_000, 3632) + // Minimum execution time: 6_671_000 picoseconds. + Weight::from_parts(7_024_000, 3632) .saturating_add(RocksDbWeight::get().reads(2_u64)) } /// Storage: unknown `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:0) @@ -2552,8 +2066,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `142` // Estimated: `3607` - // Minimum execution time: 5_881_000 picoseconds. - Weight::from_parts(6_048_000, 3607) + // Minimum execution time: 6_937_000 picoseconds. + Weight::from_parts(7_314_000, 3607) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -2561,8 +2075,10 @@ impl WeightInfo for () { /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System Account (r:1 w:1) @@ -2572,20 +2088,20 @@ impl WeightInfo for () { /// The range of component `c` is `[0, 125952]`. fn call_with_code_per_byte(c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `740` - // Estimated: `6689 + c * (1 ±0)` - // Minimum execution time: 283_813_000 picoseconds. - Weight::from_parts(315_949_540, 6689) - // Standard Error: 43 - .saturating_add(Weight::from_parts(37_588, 0).saturating_mul(c.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `786` + // Estimated: `6735 + c * (1 ±0)` + // Minimum execution time: 304_327_000 picoseconds. + Weight::from_parts(309_862_986, 6735) + // Standard Error: 54 + .saturating_add(Weight::from_parts(36_804, 0).saturating_mul(c.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:1 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:1) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Contracts Nonce (r:1 w:1) /// Proof: Contracts Nonce (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) @@ -2596,32 +2112,32 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: System EventTopics (r:3 w:3) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) - /// Storage: Contracts CodeStorage (r:0 w:1) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) /// Storage: Contracts PristineCode (r:0 w:1) /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) - /// The range of component `c` is `[0, 61717]`. + /// The range of component `c` is `[0, 125952]`. /// The range of component `i` is `[0, 1048576]`. /// The range of component `s` is `[0, 1048576]`. fn instantiate_with_code(c: u32, i: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `303` - // Estimated: `8692` - // Minimum execution time: 3_779_981_000 picoseconds. - Weight::from_parts(109_725_752, 8692) - // Standard Error: 464 - .saturating_add(Weight::from_parts(115_486, 0).saturating_mul(c.into())) - // Standard Error: 27 - .saturating_add(Weight::from_parts(1_624, 0).saturating_mul(i.into())) - // Standard Error: 27 - .saturating_add(Weight::from_parts(2_076, 0).saturating_mul(s.into())) + // Estimated: `8745` + // Minimum execution time: 3_890_645_000 picoseconds. + Weight::from_parts(1_054_159_392, 8745) + // Standard Error: 297 + .saturating_add(Weight::from_parts(63_742, 0).saturating_mul(c.into())) + // Standard Error: 35 + .saturating_add(Weight::from_parts(1_426, 0).saturating_mul(i.into())) + // Standard Error: 35 + .saturating_add(Weight::from_parts(1_849, 0).saturating_mul(s.into())) .saturating_add(RocksDbWeight::get().reads(10_u64)) - .saturating_add(RocksDbWeight::get().writes(10_u64)) + .saturating_add(RocksDbWeight::get().writes(9_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:1) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Contracts Nonce (r:1 w:1) /// Proof: Contracts Nonce (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) @@ -2630,22 +2146,20 @@ impl WeightInfo for () { /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System Account (r:2 w:2) /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:1 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) /// Storage: System EventTopics (r:2 w:2) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) /// The range of component `i` is `[0, 1048576]`. /// The range of component `s` is `[0, 1048576]`. fn instantiate(i: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `515` - // Estimated: `6441` - // Minimum execution time: 1_957_086_000 picoseconds. - Weight::from_parts(228_755_581, 6441) - // Standard Error: 9 - .saturating_add(Weight::from_parts(1_823, 0).saturating_mul(i.into())) - // Standard Error: 9 - .saturating_add(Weight::from_parts(1_773, 0).saturating_mul(s.into())) + // Measured: `503` + // Estimated: `6429` + // Minimum execution time: 2_018_386_000 picoseconds. + Weight::from_parts(257_988_354, 6429) + // Standard Error: 11 + .saturating_add(Weight::from_parts(1_924, 0).saturating_mul(i.into())) + // Standard Error: 11 + .saturating_add(Weight::from_parts(1_804, 0).saturating_mul(s.into())) .saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } @@ -2653,8 +2167,10 @@ impl WeightInfo for () { /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System Account (r:1 w:1) @@ -2663,68 +2179,64 @@ impl WeightInfo for () { /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) fn call() -> Weight { // Proof Size summary in bytes: - // Measured: `792` - // Estimated: `6732` - // Minimum execution time: 194_969_000 picoseconds. - Weight::from_parts(204_325_000, 6732) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `838` + // Estimated: `6778` + // Minimum execution time: 192_981_000 picoseconds. + Weight::from_parts(200_484_000, 6778) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:1 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:1) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: System EventTopics (r:1 w:1) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) - /// Storage: Contracts CodeStorage (r:0 w:1) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) /// Storage: Contracts PristineCode (r:0 w:1) /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) - /// The range of component `c` is `[0, 61717]`. + /// The range of component `c` is `[0, 125952]`. fn upload_code(c: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `142` // Estimated: `3607` - // Minimum execution time: 285_076_000 picoseconds. - Weight::from_parts(309_126_292, 3607) - // Standard Error: 77 - .saturating_add(Weight::from_parts(108_132, 0).saturating_mul(c.into())) + // Minimum execution time: 270_290_000 picoseconds. + Weight::from_parts(249_794_836, 3607) + // Standard Error: 136 + .saturating_add(Weight::from_parts(66_222, 0).saturating_mul(c.into())) .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:1 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:1) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: System EventTopics (r:1 w:1) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) - /// Storage: Contracts CodeStorage (r:0 w:1) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) /// Storage: Contracts PristineCode (r:0 w:1) /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) fn remove_code() -> Weight { // Proof Size summary in bytes: - // Measured: `288` - // Estimated: `3753` - // Minimum execution time: 34_633_000 picoseconds. - Weight::from_parts(35_823_000, 3753) + // Measured: `255` + // Estimated: `3720` + // Minimum execution time: 34_086_000 picoseconds. + Weight::from_parts(34_893_000, 3720) .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:2 w:2) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:2 w:2) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: System EventTopics (r:3 w:3) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) fn set_code() -> Weight { // Proof Size summary in bytes: - // Measured: `603` - // Estimated: `9018` - // Minimum execution time: 35_640_000 picoseconds. - Weight::from_parts(37_022_000, 9018) + // Measured: `575` + // Estimated: `8990` + // Minimum execution time: 37_215_000 picoseconds. + Weight::from_parts(38_875_000, 8990) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -2734,8 +2246,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -2743,13 +2257,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_caller(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `814 + r * (6 ±0)` - // Estimated: `6755 + r * (6 ±0)` - // Minimum execution time: 274_579_000 picoseconds. - Weight::from_parts(293_784_568, 6755) - // Standard Error: 668 - .saturating_add(Weight::from_parts(332_369, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `860 + r * (6 ±0)` + // Estimated: `6801 + r * (6 ±0)` + // Minimum execution time: 272_512_000 picoseconds. + Weight::from_parts(292_275_248, 6801) + // Standard Error: 816 + .saturating_add(Weight::from_parts(344_261, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } @@ -2759,8 +2273,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1601 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -2768,13 +2284,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_is_contract(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `872 + r * (240 ±0)` - // Estimated: `6776 + r * (2715 ±0)` - // Minimum execution time: 258_123_000 picoseconds. - Weight::from_parts(87_353_122, 6776) - // Standard Error: 7_863 - .saturating_add(Weight::from_parts(3_798_056, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `918 + r * (240 ±0)` + // Estimated: `6822 + r * (2715 ±0)` + // Minimum execution time: 272_910_000 picoseconds. + Weight::from_parts(126_963_357, 6822) + // Standard Error: 10_020 + .saturating_add(Weight::from_parts(3_805_261, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 2715).saturating_mul(r.into())) @@ -2785,8 +2301,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1601 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -2794,13 +2312,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_code_hash(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `864 + r * (244 ±0)` - // Estimated: `6780 + r * (2719 ±0)` - // Minimum execution time: 263_892_000 picoseconds. - Weight::from_parts(95_671_495, 6780) - // Standard Error: 7_751 - .saturating_add(Weight::from_parts(4_621_396, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `910 + r * (244 ±0)` + // Estimated: `6826 + r * (2719 ±0)` + // Minimum execution time: 275_605_000 picoseconds. + Weight::from_parts(116_757_903, 6826) + // Standard Error: 9_537 + .saturating_add(Weight::from_parts(4_645_380, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 2719).saturating_mul(r.into())) @@ -2811,8 +2329,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -2820,13 +2340,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_own_code_hash(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `821 + r * (6 ±0)` - // Estimated: `6763 + r * (6 ±0)` - // Minimum execution time: 256_926_000 picoseconds. - Weight::from_parts(282_224_981, 6763) - // Standard Error: 558 - .saturating_add(Weight::from_parts(437_279, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `867 + r * (6 ±0)` + // Estimated: `6809 + r * (6 ±0)` + // Minimum execution time: 273_998_000 picoseconds. + Weight::from_parts(284_693_047, 6809) + // Standard Error: 774 + .saturating_add(Weight::from_parts(431_720, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } @@ -2836,8 +2356,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -2845,13 +2367,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_caller_is_origin(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `811 + r * (3 ±0)` - // Estimated: `6756 + r * (3 ±0)` - // Minimum execution time: 250_653_000 picoseconds. - Weight::from_parts(275_581_829, 6756) - // Standard Error: 504 - .saturating_add(Weight::from_parts(174_168, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `857 + r * (3 ±0)` + // Estimated: `6802 + r * (3 ±0)` + // Minimum execution time: 279_621_000 picoseconds. + Weight::from_parts(286_171_188, 6802) + // Standard Error: 431 + .saturating_add(Weight::from_parts(183_093, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 3).saturating_mul(r.into())) } @@ -2859,8 +2381,10 @@ impl WeightInfo for () { /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -2868,13 +2392,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_caller_is_root(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `701 + r * (3 ±0)` - // Estimated: `6641 + r * (3 ±0)` - // Minimum execution time: 252_729_000 picoseconds. - Weight::from_parts(269_519_695, 6641) - // Standard Error: 364 - .saturating_add(Weight::from_parts(149_029, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(6_u64)) + // Measured: `747 + r * (3 ±0)` + // Estimated: `6687 + r * (3 ±0)` + // Minimum execution time: 259_882_000 picoseconds. + Weight::from_parts(275_221_455, 6687) + // Standard Error: 373 + .saturating_add(Weight::from_parts(160_615, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 3).saturating_mul(r.into())) } @@ -2884,8 +2408,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -2893,13 +2419,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_address(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `815 + r * (6 ±0)` - // Estimated: `6757 + r * (6 ±0)` - // Minimum execution time: 254_003_000 picoseconds. - Weight::from_parts(273_706_638, 6757) - // Standard Error: 636 - .saturating_add(Weight::from_parts(344_795, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `861 + r * (6 ±0)` + // Estimated: `6803 + r * (6 ±0)` + // Minimum execution time: 257_771_000 picoseconds. + Weight::from_parts(286_698_304, 6803) + // Standard Error: 974 + .saturating_add(Weight::from_parts(345_777, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } @@ -2909,8 +2435,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -2918,13 +2446,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_gas_left(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `811 + r * (6 ±0)` - // Estimated: `6752 + r * (6 ±0)` - // Minimum execution time: 258_765_000 picoseconds. - Weight::from_parts(285_314_067, 6752) - // Standard Error: 747 - .saturating_add(Weight::from_parts(530_682, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `857 + r * (6 ±0)` + // Estimated: `6798 + r * (6 ±0)` + // Minimum execution time: 275_924_000 picoseconds. + Weight::from_parts(292_084_788, 6798) + // Standard Error: 1_946 + .saturating_add(Weight::from_parts(543_595, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } @@ -2934,8 +2462,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -2943,12 +2473,39 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_balance(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `955 + r * (6 ±0)` - // Estimated: `6879 + r * (6 ±0)` - // Minimum execution time: 249_124_000 picoseconds. - Weight::from_parts(280_931_810, 6879) - // Standard Error: 1_222 - .saturating_add(Weight::from_parts(1_589_424, 0).saturating_mul(r.into())) + // Measured: `1001 + r * (6 ±0)` + // Estimated: `6925 + r * (6 ±0)` + // Minimum execution time: 275_657_000 picoseconds. + Weight::from_parts(290_421_668, 6925) + // Standard Error: 2_153 + .saturating_add(Weight::from_parts(1_583_388, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(9_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) + } + /// Storage: Contracts MigrationInProgress (r:1 w:0) + /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) + /// Storage: Contracts ContractInfoOf (r:1 w:1) + /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) + /// Storage: System EventTopics (r:2 w:2) + /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) + /// The range of component `r` is `[0, 1600]`. + fn seal_value_transferred(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `871 + r * (6 ±0)` + // Estimated: `6820 + r * (6 ±0)` + // Minimum execution time: 276_367_000 picoseconds. + Weight::from_parts(287_733_897, 6820) + // Standard Error: 946 + .saturating_add(Weight::from_parts(338_966, 0).saturating_mul(r.into())) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) @@ -2959,33 +2516,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) - /// The range of component `r` is `[0, 1600]`. - fn seal_value_transferred(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `825 + r * (6 ±0)` - // Estimated: `6774 + r * (6 ±0)` - // Minimum execution time: 262_064_000 picoseconds. - Weight::from_parts(275_109_661, 6774) - // Standard Error: 1_125 - .saturating_add(Weight::from_parts(347_597, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) - } - /// Storage: Contracts MigrationInProgress (r:1 w:0) - /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -2993,13 +2527,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_minimum_balance(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `823 + r * (6 ±0)` - // Estimated: `6772 + r * (6 ±0)` - // Minimum execution time: 257_647_000 picoseconds. - Weight::from_parts(282_016_138, 6772) - // Standard Error: 598 - .saturating_add(Weight::from_parts(331_430, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `869 + r * (6 ±0)` + // Estimated: `6818 + r * (6 ±0)` + // Minimum execution time: 277_266_000 picoseconds. + Weight::from_parts(291_007_793, 6818) + // Standard Error: 694 + .saturating_add(Weight::from_parts(338_777, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } @@ -3009,8 +2543,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3018,13 +2554,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_block_number(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `820 + r * (6 ±0)` - // Estimated: `6770 + r * (6 ±0)` - // Minimum execution time: 270_534_000 picoseconds. - Weight::from_parts(282_587_049, 6770) - // Standard Error: 558 - .saturating_add(Weight::from_parts(326_833, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `866 + r * (6 ±0)` + // Estimated: `6816 + r * (6 ±0)` + // Minimum execution time: 273_733_000 picoseconds. + Weight::from_parts(286_843_659, 6816) + // Standard Error: 677 + .saturating_add(Weight::from_parts(334_973, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } @@ -3034,8 +2570,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3043,13 +2581,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_now(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `811 + r * (6 ±0)` - // Estimated: `6756 + r * (6 ±0)` - // Minimum execution time: 265_995_000 picoseconds. - Weight::from_parts(281_210_033, 6756) - // Standard Error: 585 - .saturating_add(Weight::from_parts(328_710, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `857 + r * (6 ±0)` + // Estimated: `6802 + r * (6 ±0)` + // Minimum execution time: 274_990_000 picoseconds. + Weight::from_parts(289_331_002, 6802) + // Standard Error: 1_377 + .saturating_add(Weight::from_parts(337_816, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } @@ -3059,8 +2597,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0) @@ -3070,13 +2610,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_weight_to_fee(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `885 + r * (14 ±0)` - // Estimated: `6818 + r * (14 ±0)` - // Minimum execution time: 271_858_000 picoseconds. - Weight::from_parts(293_995_797, 6818) - // Standard Error: 2_418 - .saturating_add(Weight::from_parts(1_477_929, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(8_u64)) + // Measured: `931 + r * (14 ±0)` + // Estimated: `6864 + r * (14 ±0)` + // Minimum execution time: 272_562_000 picoseconds. + Weight::from_parts(294_251_468, 6864) + // Standard Error: 3_230 + .saturating_add(Weight::from_parts(1_410_191, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 14).saturating_mul(r.into())) } @@ -3086,33 +2626,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) - /// The range of component `r` is `[0, 1600]`. - fn seal_gas(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `778 + r * (4 ±0)` - // Estimated: `6720 + r * (4 ±0)` - // Minimum execution time: 155_850_000 picoseconds. - Weight::from_parts(166_696_760, 6720) - // Standard Error: 406 - .saturating_add(Weight::from_parts(144_167, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 4).saturating_mul(r.into())) - } - /// Storage: Contracts MigrationInProgress (r:1 w:0) - /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3120,13 +2637,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_input(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `813 + r * (6 ±0)` - // Estimated: `6757 + r * (6 ±0)` - // Minimum execution time: 250_636_000 picoseconds. - Weight::from_parts(280_298_031, 6757) - // Standard Error: 904 - .saturating_add(Weight::from_parts(275_136, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `859 + r * (6 ±0)` + // Estimated: `6803 + r * (6 ±0)` + // Minimum execution time: 280_635_000 picoseconds. + Weight::from_parts(287_918_595, 6803) + // Standard Error: 695 + .saturating_add(Weight::from_parts(289_762, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } @@ -3136,8 +2653,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3145,13 +2664,13 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 1048576]`. fn seal_input_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `817` - // Estimated: `6757` - // Minimum execution time: 254_897_000 picoseconds. - Weight::from_parts(225_376_740, 6757) - // Standard Error: 24 - .saturating_add(Weight::from_parts(986, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `863` + // Estimated: `6803` + // Minimum execution time: 280_743_000 picoseconds. + Weight::from_parts(227_444_594, 6803) + // Standard Error: 23 + .saturating_add(Weight::from_parts(1_030, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) @@ -3160,8 +2679,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3169,13 +2690,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1]`. fn seal_return(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `801 + r * (45 ±0)` - // Estimated: `6741 + r * (45 ±0)` - // Minimum execution time: 245_352_000 picoseconds. - Weight::from_parts(272_824_342, 6741) - // Standard Error: 946_718 - .saturating_add(Weight::from_parts(7_323_857, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `847 + r * (45 ±0)` + // Estimated: `6787 + r * (45 ±0)` + // Minimum execution time: 250_827_000 picoseconds. + Weight::from_parts(279_351_093, 6787) + // Standard Error: 876_511 + .saturating_add(Weight::from_parts(92_006, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 45).saturating_mul(r.into())) } @@ -3185,8 +2706,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3194,13 +2717,13 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 1048576]`. fn seal_return_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `811` - // Estimated: `6764` - // Minimum execution time: 263_036_000 picoseconds. - Weight::from_parts(274_068_287, 6764) - // Standard Error: 0 - .saturating_add(Weight::from_parts(209, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `857` + // Estimated: `6810` + // Minimum execution time: 272_085_000 picoseconds. + Weight::from_parts(284_343_813, 6810) + // Standard Error: 1 + .saturating_add(Weight::from_parts(329, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) @@ -3209,14 +2732,14 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:1) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: Contracts DeletionQueueCounter (r:1 w:1) /// Proof: Contracts DeletionQueueCounter (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:1 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) /// Storage: System EventTopics (r:3 w:3) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) /// Storage: Contracts DeletionQueue (r:0 w:1) @@ -3224,17 +2747,17 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1]`. fn seal_terminate(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `843 + r * (356 ±0)` - // Estimated: `6783 + r * (7781 ±0)` - // Minimum execution time: 252_516_000 picoseconds. - Weight::from_parts(279_325_114, 6783) - // Standard Error: 934_499 - .saturating_add(Weight::from_parts(133_604_685, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) - .saturating_add(RocksDbWeight::get().reads((6_u64).saturating_mul(r.into()))) + // Measured: `889 + r * (300 ±0)` + // Estimated: `6829 + r * (7725 ±0)` + // Minimum execution time: 255_731_000 picoseconds. + Weight::from_parts(282_377_122, 6829) + // Standard Error: 911_459 + .saturating_add(Weight::from_parts(130_693_677, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) + .saturating_add(RocksDbWeight::get().reads((5_u64).saturating_mul(r.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes((8_u64).saturating_mul(r.into()))) - .saturating_add(Weight::from_parts(0, 7781).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(0, 7725).saturating_mul(r.into())) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) @@ -3242,8 +2765,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) @@ -3253,12 +2778,39 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_random(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `892 + r * (10 ±0)` - // Estimated: `6833 + r * (10 ±0)` - // Minimum execution time: 267_643_000 picoseconds. - Weight::from_parts(288_437_123, 6833) - // Standard Error: 1_464 - .saturating_add(Weight::from_parts(1_963_778, 0).saturating_mul(r.into())) + // Measured: `938 + r * (10 ±0)` + // Estimated: `6879 + r * (10 ±0)` + // Minimum execution time: 267_767_000 picoseconds. + Weight::from_parts(277_950_288, 6879) + // Standard Error: 3_787 + .saturating_add(Weight::from_parts(1_971_448, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(9_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 10).saturating_mul(r.into())) + } + /// Storage: Contracts MigrationInProgress (r:1 w:0) + /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) + /// Storage: Contracts ContractInfoOf (r:1 w:1) + /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) + /// Storage: System EventTopics (r:2 w:2) + /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) + /// The range of component `r` is `[0, 1600]`. + fn seal_deposit_event(r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `857 + r * (10 ±0)` + // Estimated: `6802 + r * (10 ±0)` + // Minimum execution time: 270_791_000 picoseconds. + Weight::from_parts(275_451_505, 6802) + // Standard Error: 5_954 + .saturating_add(Weight::from_parts(3_860_605, 0).saturating_mul(r.into())) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 10).saturating_mul(r.into())) @@ -3269,33 +2821,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) - /// The range of component `r` is `[0, 1600]`. - fn seal_deposit_event(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `811 + r * (10 ±0)` - // Estimated: `6756 + r * (10 ±0)` - // Minimum execution time: 253_177_000 picoseconds. - Weight::from_parts(289_366_852, 6756) - // Standard Error: 3_086 - .saturating_add(Weight::from_parts(3_721_716, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 10).saturating_mul(r.into())) - } - /// Storage: Contracts MigrationInProgress (r:1 w:0) - /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:6 w:6) @@ -3304,15 +2833,15 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 16384]`. fn seal_deposit_event_per_topic_and_byte(t: u32, n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `830 + t * (32 ±0)` - // Estimated: `6777 + t * (2508 ±0)` - // Minimum execution time: 269_777_000 picoseconds. - Weight::from_parts(282_461_237, 6777) - // Standard Error: 104_138 - .saturating_add(Weight::from_parts(3_212_141, 0).saturating_mul(t.into())) + // Measured: `876 + t * (32 ±0)` + // Estimated: `6823 + t * (2508 ±0)` + // Minimum execution time: 274_766_000 picoseconds. + Weight::from_parts(291_476_869, 6823) + // Standard Error: 104_473 + .saturating_add(Weight::from_parts(3_104_443, 0).saturating_mul(t.into())) // Standard Error: 29 - .saturating_add(Weight::from_parts(850, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(Weight::from_parts(698, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(t.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(t.into()))) @@ -3324,8 +2853,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3333,13 +2864,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_debug_message(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `810 + r * (7 ±0)` - // Estimated: `6754 + r * (7 ±0)` - // Minimum execution time: 161_463_000 picoseconds. - Weight::from_parts(175_209_131, 6754) - // Standard Error: 412 - .saturating_add(Weight::from_parts(236_340, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `856 + r * (7 ±0)` + // Estimated: `6800 + r * (7 ±0)` + // Minimum execution time: 169_748_000 picoseconds. + Weight::from_parts(180_313_117, 6800) + // Standard Error: 454 + .saturating_add(Weight::from_parts(245_983, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 7).saturating_mul(r.into())) } @@ -3349,8 +2880,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: MaxEncodedLen) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: MaxEncodedLen) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: MaxEncodedLen) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: MaxEncodedLen) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) /// Storage: System EventTopics (r:2 w:2) @@ -3358,13 +2891,13 @@ impl WeightInfo for () { /// The range of component `i` is `[0, 1048576]`. fn seal_debug_message_per_byte(i: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `125761` - // Estimated: `131703` - // Minimum execution time: 390_202_000 picoseconds. - Weight::from_parts(366_539_716, 131703) + // Measured: `125807` + // Estimated: `131749` + // Minimum execution time: 415_021_000 picoseconds. + Weight::from_parts(390_542_412, 131749) // Standard Error: 12 - .saturating_add(Weight::from_parts(1_035, 0).saturating_mul(i.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(Weight::from_parts(1_061, 0).saturating_mul(i.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: Skipped Metadata (r:0 w:0) @@ -3372,13 +2905,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 800]`. fn seal_set_storage(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `878 + r * (292 ±0)` - // Estimated: `876 + r * (293 ±0)` - // Minimum execution time: 262_008_000 picoseconds. - Weight::from_parts(157_764_815, 876) - // Standard Error: 12_764 - .saturating_add(Weight::from_parts(7_067_072, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `924 + r * (292 ±0)` + // Estimated: `922 + r * (293 ±0)` + // Minimum execution time: 273_094_000 picoseconds. + Weight::from_parts(210_515_595, 922) + // Standard Error: 12_565 + .saturating_add(Weight::from_parts(7_037_698, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(r.into()))) @@ -3389,13 +2922,13 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 16384]`. fn seal_set_storage_per_new_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1337` - // Estimated: `1313` - // Minimum execution time: 289_607_000 picoseconds. - Weight::from_parts(336_924_770, 1313) - // Standard Error: 60 - .saturating_add(Weight::from_parts(403, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(9_u64)) + // Measured: `1383` + // Estimated: `1359` + // Minimum execution time: 288_990_000 picoseconds. + Weight::from_parts(339_177_945, 1359) + // Standard Error: 67 + .saturating_add(Weight::from_parts(496, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } /// Storage: Skipped Metadata (r:0 w:0) @@ -3403,13 +2936,13 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 16384]`. fn seal_set_storage_per_old_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1200 + n * (1 ±0)` - // Estimated: `1200 + n * (1 ±0)` - // Minimum execution time: 275_887_000 picoseconds. - Weight::from_parts(301_734_237, 1200) - // Standard Error: 37 - .saturating_add(Weight::from_parts(204, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(8_u64)) + // Measured: `1246 + n * (1 ±0)` + // Estimated: `1246 + n * (1 ±0)` + // Minimum execution time: 279_998_000 picoseconds. + Weight::from_parts(302_247_796, 1246) + // Standard Error: 32 + .saturating_add(Weight::from_parts(156, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -3418,13 +2951,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 800]`. fn seal_clear_storage(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `874 + r * (288 ±0)` - // Estimated: `878 + r * (289 ±0)` - // Minimum execution time: 253_436_000 picoseconds. - Weight::from_parts(157_140_488, 878) - // Standard Error: 13_050 - .saturating_add(Weight::from_parts(6_929_024, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `920 + r * (288 ±0)` + // Estimated: `924 + r * (289 ±0)` + // Minimum execution time: 272_959_000 picoseconds. + Weight::from_parts(182_351_901, 924) + // Standard Error: 14_269 + .saturating_add(Weight::from_parts(6_959_823, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(r.into()))) @@ -3435,13 +2968,13 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 16384]`. fn seal_clear_storage_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1196 + n * (1 ±0)` - // Estimated: `1196 + n * (1 ±0)` - // Minimum execution time: 272_714_000 picoseconds. - Weight::from_parts(300_359_254, 1196) - // Standard Error: 35 - .saturating_add(Weight::from_parts(34, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(8_u64)) + // Measured: `1242 + n * (1 ±0)` + // Estimated: `1242 + n * (1 ±0)` + // Minimum execution time: 281_078_000 picoseconds. + Weight::from_parts(303_340_005, 1242) + // Standard Error: 32 + .saturating_add(Weight::from_parts(75, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -3450,13 +2983,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 800]`. fn seal_get_storage(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `868 + r * (296 ±0)` - // Estimated: `873 + r * (297 ±0)` - // Minimum execution time: 252_868_000 picoseconds. - Weight::from_parts(192_325_247, 873) - // Standard Error: 9_612 - .saturating_add(Weight::from_parts(5_614_703, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `914 + r * (296 ±0)` + // Estimated: `919 + r * (297 ±0)` + // Minimum execution time: 272_204_000 picoseconds. + Weight::from_parts(181_840_247, 919) + // Standard Error: 12_990 + .saturating_add(Weight::from_parts(5_803_235, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 297).saturating_mul(r.into())) @@ -3466,13 +2999,13 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 16384]`. fn seal_get_storage_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1212 + n * (1 ±0)` - // Estimated: `1212 + n * (1 ±0)` - // Minimum execution time: 275_076_000 picoseconds. - Weight::from_parts(298_464_611, 1212) - // Standard Error: 31 - .saturating_add(Weight::from_parts(691, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(8_u64)) + // Measured: `1258 + n * (1 ±0)` + // Estimated: `1258 + n * (1 ±0)` + // Minimum execution time: 285_806_000 picoseconds. + Weight::from_parts(299_198_348, 1258) + // Standard Error: 35 + .saturating_add(Weight::from_parts(1_087, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -3481,13 +3014,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 800]`. fn seal_contains_storage(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `889 + r * (288 ±0)` - // Estimated: `890 + r * (289 ±0)` - // Minimum execution time: 271_528_000 picoseconds. - Weight::from_parts(190_055_750, 890) - // Standard Error: 9_295 - .saturating_add(Weight::from_parts(5_481_564, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `935 + r * (288 ±0)` + // Estimated: `936 + r * (289 ±0)` + // Minimum execution time: 266_945_000 picoseconds. + Weight::from_parts(204_591_050, 936) + // Standard Error: 10_852 + .saturating_add(Weight::from_parts(5_489_051, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 289).saturating_mul(r.into())) @@ -3497,13 +3030,13 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 16384]`. fn seal_contains_storage_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1199 + n * (1 ±0)` - // Estimated: `1199 + n * (1 ±0)` - // Minimum execution time: 272_948_000 picoseconds. - Weight::from_parts(296_828_541, 1199) - // Standard Error: 32 - .saturating_add(Weight::from_parts(224, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(8_u64)) + // Measured: `1245 + n * (1 ±0)` + // Estimated: `1245 + n * (1 ±0)` + // Minimum execution time: 269_827_000 picoseconds. + Weight::from_parts(294_861_647, 1245) + // Standard Error: 36 + .saturating_add(Weight::from_parts(385, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -3512,13 +3045,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 800]`. fn seal_take_storage(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `862 + r * (296 ±0)` - // Estimated: `869 + r * (297 ±0)` - // Minimum execution time: 261_242_000 picoseconds. - Weight::from_parts(182_730_565, 869) - // Standard Error: 10_598 - .saturating_add(Weight::from_parts(6_955_347, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `908 + r * (296 ±0)` + // Estimated: `915 + r * (297 ±0)` + // Minimum execution time: 270_903_000 picoseconds. + Weight::from_parts(179_016_061, 915) + // Standard Error: 13_815 + .saturating_add(Weight::from_parts(7_103_586, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(r.into()))) @@ -3529,13 +3062,13 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 16384]`. fn seal_take_storage_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1213 + n * (1 ±0)` - // Estimated: `1213 + n * (1 ±0)` - // Minimum execution time: 273_109_000 picoseconds. - Weight::from_parts(296_844_706, 1213) - // Standard Error: 38 - .saturating_add(Weight::from_parts(922, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(8_u64)) + // Measured: `1259 + n * (1 ±0)` + // Estimated: `1259 + n * (1 ±0)` + // Minimum execution time: 285_233_000 picoseconds. + Weight::from_parts(307_266_872, 1259) + // Standard Error: 42 + .saturating_add(Weight::from_parts(340, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -3545,8 +3078,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3554,13 +3089,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_transfer(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1406 + r * (45 ±0)` - // Estimated: `7303 + r * (2520 ±0)` - // Minimum execution time: 258_602_000 picoseconds. - Weight::from_parts(292_720_006, 7303) - // Standard Error: 25_954 - .saturating_add(Weight::from_parts(38_220_140, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(8_u64)) + // Measured: `1452 + r * (45 ±0)` + // Estimated: `7349 + r * (2520 ±0)` + // Minimum execution time: 272_760_000 picoseconds. + Weight::from_parts(169_488_533, 7349) + // Standard Error: 29_765 + .saturating_add(Weight::from_parts(39_376_406, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(RocksDbWeight::get().writes(4_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(r.into()))) @@ -3572,8 +3107,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:801 w:801) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:2 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:2 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:2 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:803 w:803) @@ -3581,13 +3118,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 800]`. fn seal_call(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1173 + r * (276 ±0)` - // Estimated: `9365 + r * (2752 ±0)` - // Minimum execution time: 259_809_000 picoseconds. - Weight::from_parts(272_562_000, 9365) - // Standard Error: 99_053 - .saturating_add(Weight::from_parts(238_943_491, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(9_u64)) + // Measured: `1296 + r * (276 ±0)` + // Estimated: `9481 + r * (2752 ±0)` + // Minimum execution time: 272_684_000 picoseconds. + Weight::from_parts(277_233_000, 9481) + // Standard Error: 118_314 + .saturating_add(Weight::from_parts(248_277_789, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(11_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(r.into()))) .saturating_add(RocksDbWeight::get().writes(4_u64)) .saturating_add(RocksDbWeight::get().writes((2_u64).saturating_mul(r.into()))) @@ -3599,8 +3136,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:736 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:736 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:736 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:737 w:737) @@ -3608,17 +3147,17 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 800]`. fn seal_delegate_call(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + r * (502 ±0)` - // Estimated: `6760 + r * (2572 ±3)` - // Minimum execution time: 251_738_000 picoseconds. - Weight::from_parts(268_350_000, 6760) - // Standard Error: 114_916 - .saturating_add(Weight::from_parts(233_073_585, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) - .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(r.into()))) + // Measured: `0 + r * (572 ±0)` + // Estimated: `6806 + r * (2633 ±3)` + // Minimum execution time: 273_037_000 picoseconds. + Weight::from_parts(278_708_000, 6806) + // Standard Error: 148_237 + .saturating_add(Weight::from_parts(246_429_899, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) + .saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(r.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(r.into()))) - .saturating_add(Weight::from_parts(0, 2572).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(0, 2633).saturating_mul(r.into())) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) @@ -3626,8 +3165,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:2 w:2) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:2 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:2 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:2 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:4 w:4) @@ -3636,15 +3177,15 @@ impl WeightInfo for () { /// The range of component `c` is `[0, 1048576]`. fn seal_call_per_transfer_clone_byte(t: u32, c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1187 + t * (204 ±0)` - // Estimated: `12077 + t * (5154 ±0)` - // Minimum execution time: 457_896_000 picoseconds. - Weight::from_parts(87_898_644, 12077) - // Standard Error: 11_813_448 - .saturating_add(Weight::from_parts(343_454_719, 0).saturating_mul(t.into())) + // Measured: `1308 + t * (204 ±0)` + // Estimated: `12198 + t * (5154 ±0)` + // Minimum execution time: 458_571_000 picoseconds. + Weight::from_parts(82_434_924, 12198) + // Standard Error: 12_112_923 + .saturating_add(Weight::from_parts(375_570_955, 0).saturating_mul(t.into())) // Standard Error: 17 - .saturating_add(Weight::from_parts(954, 0).saturating_mul(c.into())) - .saturating_add(RocksDbWeight::get().reads(11_u64)) + .saturating_add(Weight::from_parts(1_064, 0).saturating_mul(c.into())) + .saturating_add(RocksDbWeight::get().reads(13_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(t.into()))) .saturating_add(RocksDbWeight::get().writes(6_u64)) .saturating_add(RocksDbWeight::get().writes((2_u64).saturating_mul(t.into()))) @@ -3656,30 +3197,30 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:801 w:801) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:801 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:801 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:801 w:800) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: Contracts Nonce (r:1 w:1) /// Proof: Contracts Nonce (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:800 w:800) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) /// Storage: System EventTopics (r:802 w:802) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) /// The range of component `r` is `[1, 800]`. fn seal_instantiate(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1355 + r * (254 ±0)` - // Estimated: `7179 + r * (5205 ±0)` - // Minimum execution time: 648_531_000 picoseconds. - Weight::from_parts(662_333_000, 7179) - // Standard Error: 358_232 - .saturating_add(Weight::from_parts(380_628_577, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(9_u64)) + // Measured: `1383 + r * (251 ±0)` + // Estimated: `7207 + r * (5202 ±0)` + // Minimum execution time: 660_700_000 picoseconds. + Weight::from_parts(675_097_000, 7207) + // Standard Error: 364_345 + .saturating_add(Weight::from_parts(400_003_245, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().reads((6_u64).saturating_mul(r.into()))) .saturating_add(RocksDbWeight::get().writes(6_u64)) .saturating_add(RocksDbWeight::get().writes((5_u64).saturating_mul(r.into()))) - .saturating_add(Weight::from_parts(0, 5205).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(0, 5202).saturating_mul(r.into())) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) @@ -3687,14 +3228,14 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:2 w:2) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:2 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:2 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:2 w:1) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: Contracts Nonce (r:1 w:1) /// Proof: Contracts Nonce (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:1 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) /// Storage: System EventTopics (r:3 w:3) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) /// The range of component `t` is `[0, 1]`. @@ -3702,15 +3243,17 @@ impl WeightInfo for () { /// The range of component `s` is `[0, 983040]`. fn seal_instantiate_per_transfer_input_salt_byte(t: u32, i: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1104 + t * (187 ±0)` - // Estimated: `9525 + t * (2634 ±2)` - // Minimum execution time: 2_264_883_000 picoseconds. - Weight::from_parts(1_359_758_730, 9525) - // Standard Error: 18 - .saturating_add(Weight::from_parts(934, 0).saturating_mul(i.into())) - // Standard Error: 18 - .saturating_add(Weight::from_parts(1_068, 0).saturating_mul(s.into())) - .saturating_add(RocksDbWeight::get().reads(14_u64)) + // Measured: `1131 + t * (187 ±0)` + // Estimated: `9552 + t * (2634 ±2)` + // Minimum execution time: 2_327_206_000 picoseconds. + Weight::from_parts(1_365_575_361, 9552) + // Standard Error: 16_883_593 + .saturating_add(Weight::from_parts(15_130_866, 0).saturating_mul(t.into())) + // Standard Error: 26 + .saturating_add(Weight::from_parts(1_119, 0).saturating_mul(i.into())) + // Standard Error: 26 + .saturating_add(Weight::from_parts(1_189, 0).saturating_mul(s.into())) + .saturating_add(RocksDbWeight::get().reads(15_u64)) .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(t.into()))) .saturating_add(RocksDbWeight::get().writes(10_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(t.into()))) @@ -3722,8 +3265,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3731,13 +3276,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_hash_sha2_256(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `810 + r * (8 ±0)` - // Estimated: `6751 + r * (8 ±0)` - // Minimum execution time: 251_065_000 picoseconds. - Weight::from_parts(273_854_510, 6751) - // Standard Error: 561 - .saturating_add(Weight::from_parts(400_980, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `856 + r * (8 ±0)` + // Estimated: `6797 + r * (8 ±0)` + // Minimum execution time: 271_594_000 picoseconds. + Weight::from_parts(290_678_500, 6797) + // Standard Error: 954 + .saturating_add(Weight::from_parts(401_376, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 8).saturating_mul(r.into())) } @@ -3747,8 +3292,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3756,13 +3303,13 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 1048576]`. fn seal_hash_sha2_256_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `818` - // Estimated: `6758` - // Minimum execution time: 267_547_000 picoseconds. - Weight::from_parts(270_366_853, 6758) - // Standard Error: 1 - .saturating_add(Weight::from_parts(1_057, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `864` + // Estimated: `6804` + // Minimum execution time: 269_343_000 picoseconds. + Weight::from_parts(267_274_896, 6804) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_120, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) @@ -3771,8 +3318,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3780,13 +3329,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_hash_keccak_256(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `812 + r * (8 ±0)` - // Estimated: `6754 + r * (8 ±0)` - // Minimum execution time: 258_631_000 picoseconds. - Weight::from_parts(283_500_925, 6754) - // Standard Error: 580 - .saturating_add(Weight::from_parts(769_767, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `858 + r * (8 ±0)` + // Estimated: `6800 + r * (8 ±0)` + // Minimum execution time: 269_201_000 picoseconds. + Weight::from_parts(282_958_755, 6800) + // Standard Error: 1_051 + .saturating_add(Weight::from_parts(826_056, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 8).saturating_mul(r.into())) } @@ -3796,8 +3345,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3805,13 +3356,13 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 1048576]`. fn seal_hash_keccak_256_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `820` - // Estimated: `6762` - // Minimum execution time: 254_901_000 picoseconds. - Weight::from_parts(271_698_192, 6762) - // Standard Error: 1 - .saturating_add(Weight::from_parts(3_307, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `866` + // Estimated: `6808` + // Minimum execution time: 268_620_000 picoseconds. + Weight::from_parts(291_085_767, 6808) + // Standard Error: 2 + .saturating_add(Weight::from_parts(3_364, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) @@ -3820,8 +3371,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3829,13 +3382,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_hash_blake2_256(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `812 + r * (8 ±0)` - // Estimated: `6757 + r * (8 ±0)` - // Minimum execution time: 251_592_000 picoseconds. - Weight::from_parts(276_726_774, 6757) - // Standard Error: 782 - .saturating_add(Weight::from_parts(454_219, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `858 + r * (8 ±0)` + // Estimated: `6803 + r * (8 ±0)` + // Minimum execution time: 268_594_000 picoseconds. + Weight::from_parts(285_367_992, 6803) + // Standard Error: 715 + .saturating_add(Weight::from_parts(465_706, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 8).saturating_mul(r.into())) } @@ -3845,8 +3398,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3854,13 +3409,13 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 1048576]`. fn seal_hash_blake2_256_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `820` - // Estimated: `6766` - // Minimum execution time: 253_548_000 picoseconds. - Weight::from_parts(269_388_353, 6766) + // Measured: `866` + // Estimated: `6812` + // Minimum execution time: 267_616_000 picoseconds. + Weight::from_parts(271_719_406, 6812) // Standard Error: 1 - .saturating_add(Weight::from_parts(1_188, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(Weight::from_parts(1_225, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) @@ -3869,8 +3424,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3878,13 +3435,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_hash_blake2_128(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `812 + r * (8 ±0)` - // Estimated: `6758 + r * (8 ±0)` - // Minimum execution time: 257_095_000 picoseconds. - Weight::from_parts(278_794_198, 6758) - // Standard Error: 2_136 - .saturating_add(Weight::from_parts(454_483, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `858 + r * (8 ±0)` + // Estimated: `6804 + r * (8 ±0)` + // Minimum execution time: 270_531_000 picoseconds. + Weight::from_parts(283_734_748, 6804) + // Standard Error: 652 + .saturating_add(Weight::from_parts(464_718, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 8).saturating_mul(r.into())) } @@ -3894,8 +3451,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3903,13 +3462,13 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 1048576]`. fn seal_hash_blake2_128_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `820` - // Estimated: `6760` - // Minimum execution time: 253_356_000 picoseconds. - Weight::from_parts(267_310_090, 6760) + // Measured: `866` + // Estimated: `6806` + // Minimum execution time: 273_440_000 picoseconds. + Weight::from_parts(273_385_519, 6806) // Standard Error: 1 - .saturating_add(Weight::from_parts(1_190, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(Weight::from_parts(1_221, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: Contracts MigrationInProgress (r:1 w:0) @@ -3918,8 +3477,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3927,13 +3488,13 @@ impl WeightInfo for () { /// The range of component `n` is `[0, 125697]`. fn seal_sr25519_verify_per_byte(n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `945 + n * (1 ±0)` - // Estimated: `6882 + n * (1 ±0)` - // Minimum execution time: 330_103_000 picoseconds. - Weight::from_parts(347_576_489, 6882) - // Standard Error: 8 - .saturating_add(Weight::from_parts(5_745, 0).saturating_mul(n.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `991 + n * (1 ±0)` + // Estimated: `6928 + n * (1 ±0)` + // Minimum execution time: 347_494_000 picoseconds. + Weight::from_parts(359_555_666, 6928) + // Standard Error: 19 + .saturating_add(Weight::from_parts(6_073, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } @@ -3943,8 +3504,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3952,13 +3515,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 160]`. fn seal_sr25519_verify(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `759 + r * (112 ±0)` - // Estimated: `6699 + r * (112 ±0)` - // Minimum execution time: 249_849_000 picoseconds. - Weight::from_parts(295_861_610, 6699) - // Standard Error: 7_897 - .saturating_add(Weight::from_parts(56_326_988, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `804 + r * (112 ±0)` + // Estimated: `6745 + r * (112 ±0)` + // Minimum execution time: 271_899_000 picoseconds. + Weight::from_parts(341_998_900, 6745) + // Standard Error: 16_017 + .saturating_add(Weight::from_parts(56_033_707, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 112).saturating_mul(r.into())) } @@ -3968,8 +3531,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -3977,13 +3542,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 160]`. fn seal_ecdsa_recover(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `854 + r * (76 ±0)` - // Estimated: `6749 + r * (77 ±0)` - // Minimum execution time: 252_437_000 picoseconds. - Weight::from_parts(316_808_420, 6749) - // Standard Error: 13_551 - .saturating_add(Weight::from_parts(45_999_840, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `900 + r * (76 ±0)` + // Estimated: `6795 + r * (77 ±0)` + // Minimum execution time: 275_662_000 picoseconds. + Weight::from_parts(351_585_440, 6795) + // Standard Error: 20_452 + .saturating_add(Weight::from_parts(46_289_357, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 77).saturating_mul(r.into())) } @@ -3993,8 +3558,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -4002,13 +3569,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 160]`. fn seal_ecdsa_to_eth_address(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `825 + r * (42 ±0)` - // Estimated: `6764 + r * (42 ±0)` - // Minimum execution time: 265_684_000 picoseconds. - Weight::from_parts(284_413_181, 6764) - // Standard Error: 6_475 - .saturating_add(Weight::from_parts(12_107_021, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `871 + r * (42 ±0)` + // Estimated: `6810 + r * (42 ±0)` + // Minimum execution time: 275_543_000 picoseconds. + Weight::from_parts(329_759_758, 6810) + // Standard Error: 17_863 + .saturating_add(Weight::from_parts(38_645_318, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 42).saturating_mul(r.into())) } @@ -4018,28 +3585,28 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1536 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1536 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1536 w:1536) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) - /// Storage: Contracts OwnerInfoOf (r:1536 w:1536) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Measured) /// Storage: System EventTopics (r:1538 w:1538) /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Measured) /// The range of component `r` is `[0, 1600]`. fn seal_set_code_hash(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + r * (964 ±0)` - // Estimated: `8223 + r * (3090 ±7)` - // Minimum execution time: 251_196_000 picoseconds. - Weight::from_parts(270_744_000, 8223) - // Standard Error: 40_610 - .saturating_add(Weight::from_parts(22_903_375, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `0 + r * (961 ±0)` + // Estimated: `6801 + r * (3087 ±7)` + // Minimum execution time: 274_328_000 picoseconds. + Weight::from_parts(281_508_000, 6801) + // Standard Error: 57_665 + .saturating_add(Weight::from_parts(25_993_241, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(r.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes((2_u64).saturating_mul(r.into()))) - .saturating_add(Weight::from_parts(0, 3090).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(0, 3087).saturating_mul(r.into())) } /// Storage: Contracts MigrationInProgress (r:1 w:0) /// Proof: Contracts MigrationInProgress (max_values: Some(1), max_size: Some(1026), added: 1521, mode: Measured) @@ -4047,8 +3614,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -4056,13 +3625,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_reentrance_count(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `806 + r * (3 ±0)` - // Estimated: `6756 + r * (3 ±0)` - // Minimum execution time: 262_805_000 picoseconds. - Weight::from_parts(275_660_655, 6756) - // Standard Error: 380 - .saturating_add(Weight::from_parts(167_290, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `852 + r * (3 ±0)` + // Estimated: `6802 + r * (3 ±0)` + // Minimum execution time: 273_587_000 picoseconds. + Weight::from_parts(284_346_594, 6802) + // Standard Error: 388 + .saturating_add(Weight::from_parts(178_567, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 3).saturating_mul(r.into())) } @@ -4072,8 +3641,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: System EventTopics (r:2 w:2) @@ -4081,13 +3652,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_account_reentrance_count(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2008 + r * (39 ±0)` - // Estimated: `7838 + r * (40 ±0)` - // Minimum execution time: 263_232_000 picoseconds. - Weight::from_parts(308_403_848, 7838) - // Standard Error: 695 - .saturating_add(Weight::from_parts(261_716, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `2092 + r * (39 ±0)` + // Estimated: `7919 + r * (40 ±0)` + // Minimum execution time: 262_400_000 picoseconds. + Weight::from_parts(376_113_011, 7919) + // Standard Error: 2_401 + .saturating_add(Weight::from_parts(309_059, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(Weight::from_parts(0, 40).saturating_mul(r.into())) } @@ -4097,8 +3668,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: Measured) /// Storage: Contracts ContractInfoOf (r:1 w:1) /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(290), added: 2765, mode: Measured) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Measured) + /// Storage: Contracts PristineCode (r:1 w:0) + /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Measured) + /// Storage: Contracts CodeInfoOf (r:1 w:0) + /// Proof: Contracts CodeInfoOf (max_values: None, max_size: Some(89), added: 2564, mode: Measured) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Measured) /// Storage: Contracts Nonce (r:1 w:1) @@ -4108,13 +3681,13 @@ impl WeightInfo for () { /// The range of component `r` is `[0, 1600]`. fn seal_instantiation_nonce(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `809 + r * (3 ±0)` - // Estimated: `6756 + r * (3 ±0)` - // Minimum execution time: 255_952_000 picoseconds. - Weight::from_parts(285_541_315, 6756) - // Standard Error: 459 - .saturating_add(Weight::from_parts(145_305, 0).saturating_mul(r.into())) - .saturating_add(RocksDbWeight::get().reads(8_u64)) + // Measured: `855 + r * (3 ±0)` + // Estimated: `6802 + r * (3 ±0)` + // Minimum execution time: 259_797_000 picoseconds. + Weight::from_parts(285_980_763, 6802) + // Standard Error: 507 + .saturating_add(Weight::from_parts(159_269, 0).saturating_mul(r.into())) + .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) .saturating_add(Weight::from_parts(0, 3).saturating_mul(r.into())) } @@ -4123,509 +3696,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_405_000 picoseconds. - Weight::from_parts(1_583_300, 0) - // Standard Error: 1 - .saturating_add(Weight::from_parts(2_743, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64load(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_796_000 picoseconds. - Weight::from_parts(2_279_812, 0) - // Standard Error: 7 - .saturating_add(Weight::from_parts(6_339, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64store(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_768_000 picoseconds. - Weight::from_parts(2_274_070, 0) - // Standard Error: 4 - .saturating_add(Weight::from_parts(6_647, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_select(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_396_000 picoseconds. - Weight::from_parts(1_730_388, 0) - // Standard Error: 5 - .saturating_add(Weight::from_parts(8_918, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_if(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_383_000 picoseconds. - Weight::from_parts(1_473_000, 0) - // Standard Error: 22 - .saturating_add(Weight::from_parts(12_167, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_br(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_418_000 picoseconds. - Weight::from_parts(1_490_208, 0) - // Standard Error: 18 - .saturating_add(Weight::from_parts(6_271, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_br_if(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_396_000 picoseconds. - Weight::from_parts(1_584_684, 0) - // Standard Error: 61 - .saturating_add(Weight::from_parts(8_819, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_br_table(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_384_000 picoseconds. - Weight::from_parts(1_501_244, 0) - // Standard Error: 17 - .saturating_add(Weight::from_parts(12_311, 0).saturating_mul(r.into())) - } - /// The range of component `e` is `[1, 256]`. - fn instr_br_table_per_entry(e: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_433_000 picoseconds. - Weight::from_parts(1_594_462, 0) - // Standard Error: 19 - .saturating_add(Weight::from_parts(29, 0).saturating_mul(e.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_call(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_420_000 picoseconds. - Weight::from_parts(1_602_036, 0) - // Standard Error: 16 - .saturating_add(Weight::from_parts(17_082, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_call_indirect(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_619_000 picoseconds. - Weight::from_parts(2_069_590, 0) - // Standard Error: 20 - .saturating_add(Weight::from_parts(24_049, 0).saturating_mul(r.into())) - } - /// The range of component `l` is `[0, 1024]`. - fn instr_call_per_local(l: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_478_000 picoseconds. - Weight::from_parts(1_699_579, 0) - // Standard Error: 13 - .saturating_add(Weight::from_parts(1_651, 0).saturating_mul(l.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_local_get(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_123_000 picoseconds. - Weight::from_parts(3_200_824, 0) - // Standard Error: 12 - .saturating_add(Weight::from_parts(4_187, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_local_set(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_121_000 picoseconds. - Weight::from_parts(3_302_628, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(4_193, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_local_tee(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_155_000 picoseconds. - Weight::from_parts(3_359_832, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(4_829, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_global_get(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_547_000 picoseconds. - Weight::from_parts(1_899_252, 0) - // Standard Error: 13 - .saturating_add(Weight::from_parts(8_373, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_global_set(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_513_000 picoseconds. - Weight::from_parts(1_892_537, 0) - // Standard Error: 15 - .saturating_add(Weight::from_parts(9_177, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_memory_current(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_904_000 picoseconds. - Weight::from_parts(2_140_940, 0) - // Standard Error: 5 - .saturating_add(Weight::from_parts(3_926, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 16]`. - fn instr_memory_grow(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_437_000 picoseconds. - Weight::from_parts(4_481, 0) - // Standard Error: 131_975 - .saturating_add(Weight::from_parts(14_765_592, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64clz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_443_000 picoseconds. - Weight::from_parts(1_596_467, 0) - // Standard Error: 1 - .saturating_add(Weight::from_parts(4_251, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64ctz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_372_000 picoseconds. - Weight::from_parts(1_569_760, 0) - // Standard Error: 7 - .saturating_add(Weight::from_parts(4_777, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64popcnt(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_411_000 picoseconds. - Weight::from_parts(1_642_163, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(4_241, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64eqz(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_395_000 picoseconds. - Weight::from_parts(1_726_615, 0) - // Standard Error: 10 - .saturating_add(Weight::from_parts(4_631, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64extendsi32(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_373_000 picoseconds. - Weight::from_parts(1_620_217, 0) - // Standard Error: 1 - .saturating_add(Weight::from_parts(4_220, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64extendui32(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_423_000 picoseconds. - Weight::from_parts(1_611_025, 0) - // Standard Error: 11 - .saturating_add(Weight::from_parts(4_681, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i32wrapi64(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_402_000 picoseconds. - Weight::from_parts(1_616_506, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(4_247, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64eq(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_464_000 picoseconds. - Weight::from_parts(1_641_492, 0) - // Standard Error: 8 - .saturating_add(Weight::from_parts(6_262, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64ne(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_401_000 picoseconds. - Weight::from_parts(1_673_299, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_741, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64lts(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_414_000 picoseconds. - Weight::from_parts(1_615_167, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_767, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64ltu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_445_000 picoseconds. - Weight::from_parts(1_687_595, 0) - // Standard Error: 10 - .saturating_add(Weight::from_parts(6_201, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64gts(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_415_000 picoseconds. - Weight::from_parts(1_629_044, 0) - // Standard Error: 3 - .saturating_add(Weight::from_parts(6_318, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64gtu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_377_000 picoseconds. - Weight::from_parts(1_660_178, 0) - // Standard Error: 3 - .saturating_add(Weight::from_parts(5_774, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64les(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_467_000 picoseconds. - Weight::from_parts(1_619_688, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_761, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64leu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_485_000 picoseconds. - Weight::from_parts(1_619_756, 0) - // Standard Error: 10 - .saturating_add(Weight::from_parts(6_248, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64ges(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_391_000 picoseconds. - Weight::from_parts(1_629_993, 0) - // Standard Error: 3 - .saturating_add(Weight::from_parts(6_339, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64geu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_413_000 picoseconds. - Weight::from_parts(1_605_123, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_774, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64add(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_470_000 picoseconds. - Weight::from_parts(1_699_382, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_736, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64sub(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_394_000 picoseconds. - Weight::from_parts(1_599_038, 0) - // Standard Error: 5 - .saturating_add(Weight::from_parts(6_325, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64mul(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_422_000 picoseconds. - Weight::from_parts(1_655_350, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_753, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64divs(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_407_000 picoseconds. - Weight::from_parts(1_710_195, 0) - // Standard Error: 8 - .saturating_add(Weight::from_parts(6_791, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64divu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_406_000 picoseconds. - Weight::from_parts(2_022_275, 0) - // Standard Error: 13 - .saturating_add(Weight::from_parts(5_864, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64rems(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_424_000 picoseconds. - Weight::from_parts(1_735_622, 0) - // Standard Error: 8 - .saturating_add(Weight::from_parts(6_772, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64remu(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_457_000 picoseconds. - Weight::from_parts(1_636_788, 0) - // Standard Error: 4 - .saturating_add(Weight::from_parts(5_794, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64and(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_423_000 picoseconds. - Weight::from_parts(1_703_832, 0) - // Standard Error: 11 - .saturating_add(Weight::from_parts(6_158, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64or(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_401_000 picoseconds. - Weight::from_parts(1_653_216, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_754, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64xor(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_419_000 picoseconds. - Weight::from_parts(1_685_121, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(6_309, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64shl(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_395_000 picoseconds. - Weight::from_parts(1_580_918, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_775, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64shrs(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_408_000 picoseconds. - Weight::from_parts(1_646_493, 0) - // Standard Error: 9 - .saturating_add(Weight::from_parts(6_237, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64shru(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_446_000 picoseconds. - Weight::from_parts(1_633_531, 0) - // Standard Error: 7 - .saturating_add(Weight::from_parts(5_759, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64rotl(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_478_000 picoseconds. - Weight::from_parts(1_634_023, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(5_771, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 5000]`. - fn instr_i64rotr(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_389_000 picoseconds. - Weight::from_parts(1_627_867, 0) - // Standard Error: 10 - .saturating_add(Weight::from_parts(6_175, 0).saturating_mul(r.into())) + // Minimum execution time: 1_253_000 picoseconds. + Weight::from_parts(1_113_896, 0) + // Standard Error: 25 + .saturating_add(Weight::from_parts(10_680, 0).saturating_mul(r.into())) } }