From 7aa3143f6e7904b5c0a586c817b6c47a4649ac71 Mon Sep 17 00:00:00 2001
From: Cyrill Leutwiler <cyrill@parity.io>
Date: Wed, 30 Oct 2024 16:39:00 +0100
Subject: [PATCH] [pallet-revive] code size API (#6260)

This PR implements the contract API to query the code size of a given
address.

---------

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: xermicus <cyrill@parity.io>
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: command-bot <>
Co-authored-by: PG Herveou <pgherveou@gmail.com>
---
 prdoc/pr_6260.prdoc                           |  12 +
 .../revive/fixtures/contracts/extcodesize.rs  |  36 +
 .../frame/revive/src/benchmarking/mod.rs      |  18 +
 substrate/frame/revive/src/exec.rs            |  10 +
 substrate/frame/revive/src/tests.rs           |  31 +
 substrate/frame/revive/src/wasm/mod.rs        |   5 +
 substrate/frame/revive/src/wasm/runtime.rs    |  43 +-
 substrate/frame/revive/src/weights.rs         | 927 +++++++++---------
 substrate/frame/revive/uapi/src/host.rs       |  12 +
 .../frame/revive/uapi/src/host/riscv32.rs     |   5 +
 10 files changed, 636 insertions(+), 463 deletions(-)
 create mode 100644 prdoc/pr_6260.prdoc
 create mode 100644 substrate/frame/revive/fixtures/contracts/extcodesize.rs

diff --git a/prdoc/pr_6260.prdoc b/prdoc/pr_6260.prdoc
new file mode 100644
index 00000000000..d49b3706873
--- /dev/null
+++ b/prdoc/pr_6260.prdoc
@@ -0,0 +1,12 @@
+title: '[pallet-revive] code size API'
+doc:
+- audience: Runtime Dev
+  description: This PR implements the contract API to query the code size of a given
+    address.
+crates:
+- name: pallet-revive
+  bump: minor
+- name: pallet-revive-uapi
+  bump: minor
+- name: pallet-revive-fixtures
+  bump: minor
diff --git a/substrate/frame/revive/fixtures/contracts/extcodesize.rs b/substrate/frame/revive/fixtures/contracts/extcodesize.rs
new file mode 100644
index 00000000000..0a1171be30e
--- /dev/null
+++ b/substrate/frame/revive/fixtures/contracts/extcodesize.rs
@@ -0,0 +1,36 @@
+// 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.
+
+#![no_std]
+#![no_main]
+
+use common::{input, u64_output};
+use uapi::{HostFn, HostFnImpl as api};
+
+#[no_mangle]
+#[polkavm_derive::polkavm_export]
+pub extern "C" fn deploy() {}
+
+#[no_mangle]
+#[polkavm_derive::polkavm_export]
+pub extern "C" fn call() {
+	input!(address: &[u8; 20], expected: u64,);
+
+	let received = u64_output!(api::code_size, address);
+
+	assert_eq!(expected, received);
+}
diff --git a/substrate/frame/revive/src/benchmarking/mod.rs b/substrate/frame/revive/src/benchmarking/mod.rs
index bf27c660e1a..1ca4f4e1fb8 100644
--- a/substrate/frame/revive/src/benchmarking/mod.rs
+++ b/substrate/frame/revive/src/benchmarking/mod.rs
@@ -593,6 +593,24 @@ mod benchmarks {
 		);
 	}
 
+	#[benchmark(pov_mode = Measured)]
+	fn seal_code_size() {
+		let contract = Contract::<T>::with_index(1, WasmModule::dummy(), vec![]).unwrap();
+		build_runtime!(runtime, memory: [contract.address.encode(), vec![0u8; 32], ]);
+
+		let result;
+		#[block]
+		{
+			result = runtime.bench_code_size(memory.as_mut_slice(), 0, 20);
+		}
+
+		assert_ok!(result);
+		assert_eq!(
+			U256::from_little_endian(&memory[20..]),
+			U256::from(WasmModule::dummy().code.len())
+		);
+	}
+
 	#[benchmark(pov_mode = Measured)]
 	fn seal_caller_is_origin() {
 		build_runtime!(runtime, memory: []);
diff --git a/substrate/frame/revive/src/exec.rs b/substrate/frame/revive/src/exec.rs
index 8b9fd660296..af11a6c43fb 100644
--- a/substrate/frame/revive/src/exec.rs
+++ b/substrate/frame/revive/src/exec.rs
@@ -294,6 +294,9 @@ pub trait Ext: sealing::Sealed {
 	/// If not a contract but account exists then `keccak_256([])` is returned, otherwise `zero`.
 	fn code_hash(&self, address: &H160) -> H256;
 
+	/// Returns the code size of the contract at the given `address` or zero.
+	fn code_size(&self, address: &H160) -> U256;
+
 	/// Returns the code hash of the contract being executed.
 	fn own_code_hash(&mut self) -> &H256;
 
@@ -1569,6 +1572,13 @@ where
 			})
 	}
 
+	fn code_size(&self, address: &H160) -> U256 {
+		<ContractInfoOf<T>>::get(&address)
+			.and_then(|contract| CodeInfoOf::<T>::get(contract.code_hash))
+			.map(|info| info.code_len())
+			.unwrap_or_default()
+	}
+
 	fn own_code_hash(&mut self) -> &H256 {
 		&self.top_frame_mut().contract_info().code_hash
 	}
diff --git a/substrate/frame/revive/src/tests.rs b/substrate/frame/revive/src/tests.rs
index 37167d20a43..47f1377f467 100644
--- a/substrate/frame/revive/src/tests.rs
+++ b/substrate/frame/revive/src/tests.rs
@@ -4534,6 +4534,37 @@ mod run_tests {
 		});
 	}
 
+	#[test]
+	fn code_size_works() {
+		let (tester_code, _) = compile_module("extcodesize").unwrap();
+		let tester_code_len = tester_code.len() as u64;
+
+		let (dummy_code, _) = compile_module("dummy").unwrap();
+		let dummy_code_len = dummy_code.len() as u64;
+
+		ExtBuilder::default().existential_deposit(1).build().execute_with(|| {
+			let _ = <Test as Config>::Currency::set_balance(&ALICE, 1_000_000);
+
+			let Contract { addr: tester_addr, .. } =
+				builder::bare_instantiate(Code::Upload(tester_code)).build_and_unwrap_contract();
+			let Contract { addr: dummy_addr, .. } =
+				builder::bare_instantiate(Code::Upload(dummy_code)).build_and_unwrap_contract();
+
+			// code size of another contract address
+			assert_ok!(builder::call(tester_addr)
+				.data((dummy_addr, dummy_code_len).encode())
+				.build());
+
+			// code size of own contract address
+			assert_ok!(builder::call(tester_addr)
+				.data((tester_addr, tester_code_len).encode())
+				.build());
+
+			// code size of non contract accounts
+			assert_ok!(builder::call(tester_addr).data(([8u8; 20], 0u64).encode()).build());
+		});
+	}
+
 	#[test]
 	fn origin_must_be_mapped() {
 		let (code, hash) = compile_module("dummy").unwrap();
diff --git a/substrate/frame/revive/src/wasm/mod.rs b/substrate/frame/revive/src/wasm/mod.rs
index 2b802290384..66844dbf114 100644
--- a/substrate/frame/revive/src/wasm/mod.rs
+++ b/substrate/frame/revive/src/wasm/mod.rs
@@ -248,6 +248,11 @@ impl<T: Config> CodeInfo<T> {
 	pub fn deposit(&self) -> BalanceOf<T> {
 		self.deposit
 	}
+
+	/// Returns the code length.
+	pub fn code_len(&self) -> U256 {
+		self.code_len.into()
+	}
 }
 
 pub struct PreparedCall<'a, E: Ext> {
diff --git a/substrate/frame/revive/src/wasm/runtime.rs b/substrate/frame/revive/src/wasm/runtime.rs
index 4221498a725..d9e8c6ae9c3 100644
--- a/substrate/frame/revive/src/wasm/runtime.rs
+++ b/substrate/frame/revive/src/wasm/runtime.rs
@@ -103,6 +103,13 @@ pub trait Memory<T: Config> {
 		Ok(U256::from_little_endian(&buf))
 	}
 
+	/// Read a `H160` from the sandbox memory.
+	fn read_h160(&self, ptr: u32) -> Result<H160, DispatchError> {
+		let mut buf = H160::default();
+		self.read_into_buf(ptr, buf.as_bytes_mut())?;
+		Ok(buf)
+	}
+
 	/// Read a `H256` from the sandbox memory.
 	fn read_h256(&self, ptr: u32) -> Result<H256, DispatchError> {
 		let mut code_hash = H256::default();
@@ -299,6 +306,8 @@ pub enum RuntimeCosts {
 	CodeHash,
 	/// Weight of calling `seal_own_code_hash`.
 	OwnCodeHash,
+	/// Weight of calling `seal_code_size`.
+	CodeSize,
 	/// Weight of calling `seal_caller_is_origin`.
 	CallerIsOrigin,
 	/// Weight of calling `caller_is_root`.
@@ -453,6 +462,7 @@ impl<T: Config> Token<T> for RuntimeCosts {
 			Origin => T::WeightInfo::seal_origin(),
 			IsContract => T::WeightInfo::seal_is_contract(),
 			CodeHash => T::WeightInfo::seal_code_hash(),
+			CodeSize => T::WeightInfo::seal_code_size(),
 			OwnCodeHash => T::WeightInfo::seal_own_code_hash(),
 			CallerIsOrigin => T::WeightInfo::seal_caller_is_origin(),
 			CallerIsRoot => T::WeightInfo::seal_caller_is_root(),
@@ -997,8 +1007,7 @@ impl<'a, E: Ext, M: ?Sized + Memory<E::T>> Runtime<'a, E, M> {
 
 		let call_outcome = match call_type {
 			CallType::Call { callee_ptr, value_ptr, deposit_ptr, weight } => {
-				let mut callee = H160::zero();
-				memory.read_into_buf(callee_ptr, callee.as_bytes_mut())?;
+				let callee = memory.read_h160(callee_ptr)?;
 				let deposit_limit = if deposit_ptr == SENTINEL {
 					U256::zero()
 				} else {
@@ -1128,8 +1137,7 @@ impl<'a, E: Ext, M: ?Sized + Memory<E::T>> Runtime<'a, E, M> {
 		let count = self.ext.locked_delegate_dependencies_count() as _;
 		self.charge_gas(RuntimeCosts::Terminate(count))?;
 
-		let mut beneficiary = H160::zero();
-		memory.read_into_buf(beneficiary_ptr, beneficiary.as_bytes_mut())?;
+		let beneficiary = memory.read_h160(beneficiary_ptr)?;
 		self.ext.terminate(&beneficiary)?;
 		Err(TrapReason::Termination)
 	}
@@ -1235,8 +1243,7 @@ pub mod env {
 		value_ptr: u32,
 	) -> Result<ReturnErrorCode, TrapReason> {
 		self.charge_gas(RuntimeCosts::Transfer)?;
-		let mut callee = H160::zero();
-		memory.read_into_buf(address_ptr, callee.as_bytes_mut())?;
+		let callee = memory.read_h160(address_ptr)?;
 		let value: U256 = memory.read_u256(value_ptr)?;
 		let result = self.ext.transfer(&callee, value);
 		match result {
@@ -1411,8 +1418,7 @@ pub mod env {
 	#[api_version(0)]
 	fn is_contract(&mut self, memory: &mut M, account_ptr: u32) -> Result<u32, TrapReason> {
 		self.charge_gas(RuntimeCosts::IsContract)?;
-		let mut address = H160::zero();
-		memory.read_into_buf(account_ptr, address.as_bytes_mut())?;
+		let address = memory.read_h160(account_ptr)?;
 		Ok(self.ext.is_contract(&address) as u32)
 	}
 
@@ -1421,8 +1427,7 @@ pub mod env {
 	#[api_version(0)]
 	fn code_hash(&mut self, memory: &mut M, addr_ptr: u32, out_ptr: u32) -> Result<(), TrapReason> {
 		self.charge_gas(RuntimeCosts::CodeHash)?;
-		let mut address = H160::zero();
-		memory.read_into_buf(addr_ptr, address.as_bytes_mut())?;
+		let address = memory.read_h160(addr_ptr)?;
 		Ok(self.write_fixed_sandbox_output(
 			memory,
 			out_ptr,
@@ -1432,6 +1437,21 @@ pub mod env {
 		)?)
 	}
 
+	/// Retrieve the code size for a given contract address.
+	/// See [`pallet_revive_uapi::HostFn::code_size`].
+	#[api_version(0)]
+	fn code_size(&mut self, memory: &mut M, addr_ptr: u32, out_ptr: u32) -> Result<(), TrapReason> {
+		self.charge_gas(RuntimeCosts::CodeSize)?;
+		let address = memory.read_h160(addr_ptr)?;
+		Ok(self.write_fixed_sandbox_output(
+			memory,
+			out_ptr,
+			&self.ext.code_size(&address).to_little_endian(),
+			false,
+			already_charged,
+		)?)
+	}
+
 	/// Retrieve the code hash of the currently executing contract.
 	/// See [`pallet_revive_uapi::HostFn::own_code_hash`].
 	#[api_version(0)]
@@ -1574,8 +1594,7 @@ pub mod env {
 		out_ptr: u32,
 	) -> Result<(), TrapReason> {
 		self.charge_gas(RuntimeCosts::BalanceOf)?;
-		let mut address = H160::zero();
-		memory.read_into_buf(addr_ptr, address.as_bytes_mut())?;
+		let address = memory.read_h160(addr_ptr)?;
 		Ok(self.write_fixed_sandbox_output(
 			memory,
 			out_ptr,
diff --git a/substrate/frame/revive/src/weights.rs b/substrate/frame/revive/src/weights.rs
index bf2beb94d7a..43927da8d2e 100644
--- a/substrate/frame/revive/src/weights.rs
+++ b/substrate/frame/revive/src/weights.rs
@@ -18,7 +18,7 @@
 //! Autogenerated weights for `pallet_revive`
 //!
 //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
-//! DATE: 2024-10-29, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! DATE: 2024-10-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
 //! WORST CASE MAP SIZE: `1000000`
 //! HOSTNAME: `runner-wmcgzesc-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
 //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024`
@@ -67,6 +67,7 @@ pub trait WeightInfo {
 	fn seal_is_contract() -> Weight;
 	fn seal_code_hash() -> Weight;
 	fn seal_own_code_hash() -> Weight;
+	fn seal_code_size() -> Weight;
 	fn seal_caller_is_origin() -> Weight;
 	fn seal_caller_is_root() -> Weight;
 	fn seal_address() -> Weight;
@@ -130,8 +131,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `109`
 		//  Estimated: `1594`
-		// Minimum execution time: 3_293_000 picoseconds.
-		Weight::from_parts(3_530_000, 1594)
+		// Minimum execution time: 3_055_000 picoseconds.
+		Weight::from_parts(3_377_000, 1594)
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 	}
 	/// Storage: `Skipped::Metadata` (r:0 w:0)
@@ -141,10 +142,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `425 + k * (69 ±0)`
 		//  Estimated: `415 + k * (70 ±0)`
-		// Minimum execution time: 16_103_000 picoseconds.
-		Weight::from_parts(16_692_000, 415)
-			// Standard Error: 2_700
-			.saturating_add(Weight::from_parts(1_493_715, 0).saturating_mul(k.into()))
+		// Minimum execution time: 15_564_000 picoseconds.
+		Weight::from_parts(14_949_168, 415)
+			// Standard Error: 1_113
+			.saturating_add(Weight::from_parts(1_315_153, 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))
@@ -164,14 +165,12 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 	/// Storage: `System::Account` (r:1 w:1)
 	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`)
 	/// The range of component `c` is `[0, 262144]`.
-	fn call_with_code_per_byte(c: u32, ) -> Weight {
-		// Proof Size summary in bytes:
-		//  Measured:  `1561`
-		//  Estimated: `7501`
-		// Minimum execution time: 98_125_000 picoseconds.
-		Weight::from_parts(105_486_409, 7501)
-			// Standard Error: 2
-			.saturating_add(Weight::from_parts(4, 0).saturating_mul(c.into()))
+	fn call_with_code_per_byte(_c: u32, ) -> Weight {
+		// Proof Size summary in bytes:
+		//  Measured:  `1465`
+		//  Estimated: `7405`
+		// Minimum execution time: 98_113_000 picoseconds.
+		Weight::from_parts(101_964_040, 7405)
 			.saturating_add(T::DbWeight::get().reads(7_u64))
 			.saturating_add(T::DbWeight::get().writes(2_u64))
 	}
@@ -194,11 +193,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 	fn instantiate_with_code(_c: u32, i: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `416`
-		//  Estimated: `6348`
-		// Minimum execution time: 204_069_000 picoseconds.
-		Weight::from_parts(206_289_328, 6348)
-			// Standard Error: 16
-			.saturating_add(Weight::from_parts(4_438, 0).saturating_mul(i.into()))
+		//  Estimated: `6333`
+		// Minimum execution time: 207_612_000 picoseconds.
+		Weight::from_parts(202_394_849, 6333)
+			// Standard Error: 12
+			.saturating_add(Weight::from_parts(4_108, 0).saturating_mul(i.into()))
 			.saturating_add(T::DbWeight::get().reads(7_u64))
 			.saturating_add(T::DbWeight::get().writes(6_u64))
 	}
@@ -219,12 +218,12 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 	/// The range of component `i` is `[0, 262144]`.
 	fn instantiate(i: u32, ) -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `1334`
-		//  Estimated: `4782`
-		// Minimum execution time: 171_790_000 picoseconds.
-		Weight::from_parts(152_418_252, 4782)
-			// Standard Error: 20
-			.saturating_add(Weight::from_parts(4_271, 0).saturating_mul(i.into()))
+		//  Measured:  `1296`
+		//  Estimated: `4741`
+		// Minimum execution time: 172_403_000 picoseconds.
+		Weight::from_parts(151_999_812, 4741)
+			// Standard Error: 15
+			.saturating_add(Weight::from_parts(3_948, 0).saturating_mul(i.into()))
 			.saturating_add(T::DbWeight::get().reads(7_u64))
 			.saturating_add(T::DbWeight::get().writes(4_u64))
 	}
@@ -242,10 +241,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`)
 	fn call() -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `1561`
-		//  Estimated: `7501`
-		// Minimum execution time: 150_910_000 picoseconds.
-		Weight::from_parts(163_308_000, 7501)
+		//  Measured:  `1465`
+		//  Estimated: `7405`
+		// Minimum execution time: 149_755_000 picoseconds.
+		Weight::from_parts(166_190_000, 7405)
 			.saturating_add(T::DbWeight::get().reads(7_u64))
 			.saturating_add(T::DbWeight::get().writes(2_u64))
 	}
@@ -256,14 +255,12 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 	/// Storage: `Revive::PristineCode` (r:0 w:1)
 	/// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`)
 	/// The range of component `c` is `[0, 262144]`.
-	fn upload_code(c: u32, ) -> Weight {
+	fn upload_code(_c: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `109`
 		//  Estimated: `3574`
-		// Minimum execution time: 57_970_000 picoseconds.
-		Weight::from_parts(62_605_851, 3574)
-			// Standard Error: 3
-			.saturating_add(Weight::from_parts(6, 0).saturating_mul(c.into()))
+		// Minimum execution time: 58_481_000 picoseconds.
+		Weight::from_parts(61_009_506, 3574)
 			.saturating_add(T::DbWeight::get().reads(2_u64))
 			.saturating_add(T::DbWeight::get().writes(3_u64))
 	}
@@ -277,8 +274,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `285`
 		//  Estimated: `3750`
-		// Minimum execution time: 47_117_000 picoseconds.
-		Weight::from_parts(48_310_000, 3750)
+		// Minimum execution time: 47_485_000 picoseconds.
+		Weight::from_parts(48_962_000, 3750)
 			.saturating_add(T::DbWeight::get().reads(2_u64))
 			.saturating_add(T::DbWeight::get().writes(3_u64))
 	}
@@ -290,8 +287,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `529`
 		//  Estimated: `6469`
-		// Minimum execution time: 30_754_000 picoseconds.
-		Weight::from_parts(32_046_000, 6469)
+		// Minimum execution time: 30_752_000 picoseconds.
+		Weight::from_parts(32_401_000, 6469)
 			.saturating_add(T::DbWeight::get().reads(3_u64))
 			.saturating_add(T::DbWeight::get().writes(3_u64))
 	}
@@ -303,8 +300,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `109`
 		//  Estimated: `3574`
-		// Minimum execution time: 46_338_000 picoseconds.
-		Weight::from_parts(47_697_000, 3574)
+		// Minimum execution time: 47_042_000 picoseconds.
+		Weight::from_parts(48_378_000, 3574)
 			.saturating_add(T::DbWeight::get().reads(2_u64))
 			.saturating_add(T::DbWeight::get().writes(2_u64))
 	}
@@ -316,8 +313,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `56`
 		//  Estimated: `3521`
-		// Minimum execution time: 36_480_000 picoseconds.
-		Weight::from_parts(37_310_000, 3521)
+		// Minimum execution time: 36_705_000 picoseconds.
+		Weight::from_parts(37_313_000, 3521)
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 			.saturating_add(T::DbWeight::get().writes(2_u64))
 	}
@@ -329,8 +326,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `145`
 		//  Estimated: `3610`
-		// Minimum execution time: 12_950_000 picoseconds.
-		Weight::from_parts(13_431_000, 3610)
+		// Minimum execution time: 13_275_000 picoseconds.
+		Weight::from_parts(13_593_000, 3610)
 			.saturating_add(T::DbWeight::get().reads(2_u64))
 	}
 	/// The range of component `r` is `[0, 1600]`.
@@ -338,24 +335,24 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 7_540_000 picoseconds.
-		Weight::from_parts(8_481_295, 0)
-			// Standard Error: 900
-			.saturating_add(Weight::from_parts(183_511, 0).saturating_mul(r.into()))
+		// Minimum execution time: 6_708_000 picoseconds.
+		Weight::from_parts(7_740_679, 0)
+			// Standard Error: 133
+			.saturating_add(Weight::from_parts(175_535, 0).saturating_mul(r.into()))
 	}
 	fn seal_caller() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 328_000 picoseconds.
-		Weight::from_parts(361_000, 0)
+		// Minimum execution time: 277_000 picoseconds.
+		Weight::from_parts(326_000, 0)
 	}
 	fn seal_origin() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 272_000 picoseconds.
-		Weight::from_parts(310_000, 0)
+		// Minimum execution time: 260_000 picoseconds.
+		Weight::from_parts(273_000, 0)
 	}
 	/// Storage: `Revive::ContractInfoOf` (r:1 w:0)
 	/// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`)
@@ -363,8 +360,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `306`
 		//  Estimated: `3771`
-		// Minimum execution time: 7_755_000 picoseconds.
-		Weight::from_parts(8_364_000, 3771)
+		// Minimum execution time: 7_700_000 picoseconds.
+		Weight::from_parts(8_207_000, 3771)
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 	}
 	/// Storage: `Revive::ContractInfoOf` (r:1 w:0)
@@ -373,51 +370,63 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `403`
 		//  Estimated: `3868`
-		// Minimum execution time: 8_848_000 picoseconds.
-		Weight::from_parts(9_317_000, 3868)
+		// Minimum execution time: 8_719_000 picoseconds.
+		Weight::from_parts(9_077_000, 3868)
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 	}
 	fn seal_own_code_hash() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 285_000 picoseconds.
-		Weight::from_parts(333_000, 0)
+		// Minimum execution time: 250_000 picoseconds.
+		Weight::from_parts(273_000, 0)
+	}
+	/// Storage: `Revive::ContractInfoOf` (r:1 w:0)
+	/// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`)
+	/// Storage: `Revive::CodeInfoOf` (r:1 w:0)
+	/// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`)
+	fn seal_code_size() -> Weight {
+		// Proof Size summary in bytes:
+		//  Measured:  `473`
+		//  Estimated: `3938`
+		// Minimum execution time: 13_910_000 picoseconds.
+		Weight::from_parts(14_687_000, 3938)
+			.saturating_add(T::DbWeight::get().reads(2_u64))
 	}
 	fn seal_caller_is_origin() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 314_000 picoseconds.
-		Weight::from_parts(418_000, 0)
+		// Minimum execution time: 351_000 picoseconds.
+		Weight::from_parts(389_000, 0)
 	}
 	fn seal_caller_is_root() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 297_000 picoseconds.
-		Weight::from_parts(353_000, 0)
+		// Minimum execution time: 285_000 picoseconds.
+		Weight::from_parts(307_000, 0)
 	}
 	fn seal_address() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 285_000 picoseconds.
-		Weight::from_parts(316_000, 0)
+		// Minimum execution time: 264_000 picoseconds.
+		Weight::from_parts(292_000, 0)
 	}
 	fn seal_weight_left() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 676_000 picoseconds.
-		Weight::from_parts(895_000, 0)
+		// Minimum execution time: 631_000 picoseconds.
+		Weight::from_parts(684_000, 0)
 	}
 	fn seal_balance() -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `178`
+		//  Measured:  `103`
 		//  Estimated: `0`
-		// Minimum execution time: 6_842_000 picoseconds.
-		Weight::from_parts(7_790_000, 0)
+		// Minimum execution time: 4_754_000 picoseconds.
+		Weight::from_parts(5_107_000, 0)
 	}
 	/// Storage: `Revive::AddressSuffix` (r:1 w:0)
 	/// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`)
@@ -427,8 +436,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `264`
 		//  Estimated: `3729`
-		// Minimum execution time: 10_982_000 picoseconds.
-		Weight::from_parts(13_664_000, 3729)
+		// Minimum execution time: 11_156_000 picoseconds.
+		Weight::from_parts(11_558_000, 3729)
 			.saturating_add(T::DbWeight::get().reads(2_u64))
 	}
 	/// Storage: `Revive::ImmutableDataOf` (r:1 w:0)
@@ -438,10 +447,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `238 + n * (1 ±0)`
 		//  Estimated: `3703 + n * (1 ±0)`
-		// Minimum execution time: 6_690_000 picoseconds.
-		Weight::from_parts(7_522_685, 3703)
-			// Standard Error: 21
-			.saturating_add(Weight::from_parts(1_084, 0).saturating_mul(n.into()))
+		// Minimum execution time: 6_637_000 picoseconds.
+		Weight::from_parts(7_510_923, 3703)
+			// Standard Error: 12
+			.saturating_add(Weight::from_parts(955, 0).saturating_mul(n.into()))
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 			.saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into()))
 	}
@@ -452,39 +461,39 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 3_090_000 picoseconds.
-		Weight::from_parts(3_585_913, 0)
-			// Standard Error: 11
-			.saturating_add(Weight::from_parts(594, 0).saturating_mul(n.into()))
+		// Minimum execution time: 2_717_000 picoseconds.
+		Weight::from_parts(3_109_103, 0)
+			// Standard Error: 3
+			.saturating_add(Weight::from_parts(666, 0).saturating_mul(n.into()))
 			.saturating_add(T::DbWeight::get().writes(1_u64))
 	}
 	fn seal_value_transferred() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 261_000 picoseconds.
-		Weight::from_parts(305_000, 0)
+		// Minimum execution time: 253_000 picoseconds.
+		Weight::from_parts(318_000, 0)
 	}
 	fn seal_minimum_balance() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 279_000 picoseconds.
-		Weight::from_parts(299_000, 0)
+		// Minimum execution time: 263_000 picoseconds.
+		Weight::from_parts(309_000, 0)
 	}
 	fn seal_block_number() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 280_000 picoseconds.
-		Weight::from_parts(317_000, 0)
+		// Minimum execution time: 239_000 picoseconds.
+		Weight::from_parts(278_000, 0)
 	}
 	fn seal_now() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 285_000 picoseconds.
-		Weight::from_parts(313_000, 0)
+		// Minimum execution time: 266_000 picoseconds.
+		Weight::from_parts(300_000, 0)
 	}
 	/// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0)
 	/// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `Measured`)
@@ -492,8 +501,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `67`
 		//  Estimated: `1552`
-		// Minimum execution time: 6_116_000 picoseconds.
-		Weight::from_parts(6_584_000, 1552)
+		// Minimum execution time: 6_300_000 picoseconds.
+		Weight::from_parts(6_588_000, 1552)
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 	}
 	/// The range of component `n` is `[0, 262140]`.
@@ -501,20 +510,20 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 477_000 picoseconds.
-		Weight::from_parts(887_560, 0)
+		// Minimum execution time: 457_000 picoseconds.
+		Weight::from_parts(533_616, 0)
 			// Standard Error: 0
-			.saturating_add(Weight::from_parts(154, 0).saturating_mul(n.into()))
+			.saturating_add(Weight::from_parts(148, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `n` is `[0, 262140]`.
 	fn seal_return(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 315_000 picoseconds.
-		Weight::from_parts(870_254, 0)
-			// Standard Error: 1
-			.saturating_add(Weight::from_parts(248, 0).saturating_mul(n.into()))
+		// Minimum execution time: 287_000 picoseconds.
+		Weight::from_parts(450_119, 0)
+			// Standard Error: 0
+			.saturating_add(Weight::from_parts(295, 0).saturating_mul(n.into()))
 	}
 	/// Storage: `Revive::AddressSuffix` (r:1 w:0)
 	/// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`)
@@ -529,12 +538,12 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 	/// The range of component `n` is `[0, 32]`.
 	fn seal_terminate(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `323 + n * (88 ±0)`
-		//  Estimated: `3789 + n * (2563 ±0)`
-		// Minimum execution time: 23_098_000 picoseconds.
-		Weight::from_parts(26_001_186, 3789)
-			// Standard Error: 23_098
-			.saturating_add(Weight::from_parts(4_935_203, 0).saturating_mul(n.into()))
+		//  Measured:  `321 + n * (88 ±0)`
+		//  Estimated: `3787 + n * (2563 ±0)`
+		// Minimum execution time: 22_885_000 picoseconds.
+		Weight::from_parts(25_158_434, 3787)
+			// Standard Error: 9_482
+			.saturating_add(Weight::from_parts(4_623_850, 0).saturating_mul(n.into()))
 			.saturating_add(T::DbWeight::get().reads(3_u64))
 			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into())))
 			.saturating_add(T::DbWeight::get().writes(4_u64))
@@ -547,22 +556,22 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 5_271_000 picoseconds.
-		Weight::from_parts(5_803_969, 0)
-			// Standard Error: 10_511
-			.saturating_add(Weight::from_parts(163_106, 0).saturating_mul(t.into()))
-			// Standard Error: 93
-			.saturating_add(Weight::from_parts(361, 0).saturating_mul(n.into()))
+		// Minimum execution time: 5_172_000 picoseconds.
+		Weight::from_parts(5_112_915, 0)
+			// Standard Error: 3_042
+			.saturating_add(Weight::from_parts(220_337, 0).saturating_mul(t.into()))
+			// Standard Error: 27
+			.saturating_add(Weight::from_parts(1_077, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `i` is `[0, 262144]`.
 	fn seal_debug_message(i: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 375_000 picoseconds.
-		Weight::from_parts(1_601_309, 0)
-			// Standard Error: 3
-			.saturating_add(Weight::from_parts(787, 0).saturating_mul(i.into()))
+		// Minimum execution time: 332_000 picoseconds.
+		Weight::from_parts(830_275, 0)
+			// Standard Error: 0
+			.saturating_add(Weight::from_parts(803, 0).saturating_mul(i.into()))
 	}
 	/// Storage: `Skipped::Metadata` (r:0 w:0)
 	/// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`)
@@ -570,8 +579,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `744`
 		//  Estimated: `744`
-		// Minimum execution time: 9_557_000 picoseconds.
-		Weight::from_parts(10_131_000, 744)
+		// Minimum execution time: 9_628_000 picoseconds.
+		Weight::from_parts(10_193_000, 744)
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 	}
 	/// Storage: `Skipped::Metadata` (r:0 w:0)
@@ -580,8 +589,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `10754`
 		//  Estimated: `10754`
-		// Minimum execution time: 45_601_000 picoseconds.
-		Weight::from_parts(46_296_000, 10754)
+		// Minimum execution time: 45_621_000 picoseconds.
+		Weight::from_parts(46_237_000, 10754)
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 	}
 	/// Storage: `Skipped::Metadata` (r:0 w:0)
@@ -590,8 +599,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `744`
 		//  Estimated: `744`
-		// Minimum execution time: 10_718_000 picoseconds.
-		Weight::from_parts(12_282_000, 744)
+		// Minimum execution time: 10_918_000 picoseconds.
+		Weight::from_parts(11_441_000, 744)
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 			.saturating_add(T::DbWeight::get().writes(1_u64))
 	}
@@ -601,8 +610,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `10754`
 		//  Estimated: `10754`
-		// Minimum execution time: 47_580_000 picoseconds.
-		Weight::from_parts(50_301_000, 10754)
+		// Minimum execution time: 47_445_000 picoseconds.
+		Weight::from_parts(49_049_000, 10754)
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 			.saturating_add(T::DbWeight::get().writes(1_u64))
 	}
@@ -614,12 +623,12 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `248 + o * (1 ±0)`
 		//  Estimated: `247 + o * (1 ±0)`
-		// Minimum execution time: 11_483_000 picoseconds.
-		Weight::from_parts(13_084_262, 247)
-			// Standard Error: 218
-			.saturating_add(Weight::from_parts(83, 0).saturating_mul(n.into()))
-			// Standard Error: 218
-			.saturating_add(Weight::from_parts(683, 0).saturating_mul(o.into()))
+		// Minimum execution time: 11_215_000 picoseconds.
+		Weight::from_parts(11_943_073, 247)
+			// Standard Error: 50
+			.saturating_add(Weight::from_parts(844, 0).saturating_mul(n.into()))
+			// Standard Error: 50
+			.saturating_add(Weight::from_parts(891, 0).saturating_mul(o.into()))
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 			.saturating_add(T::DbWeight::get().writes(1_u64))
 			.saturating_add(Weight::from_parts(0, 1).saturating_mul(o.into()))
@@ -631,8 +640,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `248 + n * (1 ±0)`
 		//  Estimated: `247 + n * (1 ±0)`
-		// Minimum execution time: 10_972_000 picoseconds.
-		Weight::from_parts(12_960_831, 247)
+		// Minimum execution time: 10_794_000 picoseconds.
+		Weight::from_parts(11_993_996, 247)
+			// Standard Error: 75
+			.saturating_add(Weight::from_parts(759, 0).saturating_mul(n.into()))
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 			.saturating_add(T::DbWeight::get().writes(1_u64))
 			.saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into()))
@@ -644,8 +655,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `248 + n * (1 ±0)`
 		//  Estimated: `247 + n * (1 ±0)`
-		// Minimum execution time: 9_989_000 picoseconds.
-		Weight::from_parts(12_783_294, 247)
+		// Minimum execution time: 10_345_000 picoseconds.
+		Weight::from_parts(11_428_949, 247)
+			// Standard Error: 80
+			.saturating_add(Weight::from_parts(1_525, 0).saturating_mul(n.into()))
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 			.saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into()))
 	}
@@ -656,10 +669,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `248 + n * (1 ±0)`
 		//  Estimated: `247 + n * (1 ±0)`
-		// Minimum execution time: 9_732_000 picoseconds.
-		Weight::from_parts(11_156_576, 247)
-			// Standard Error: 255
-			.saturating_add(Weight::from_parts(1_956, 0).saturating_mul(n.into()))
+		// Minimum execution time: 9_858_000 picoseconds.
+		Weight::from_parts(10_787_656, 247)
+			// Standard Error: 64
+			.saturating_add(Weight::from_parts(789, 0).saturating_mul(n.into()))
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 			.saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into()))
 	}
@@ -670,10 +683,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `248 + n * (1 ±0)`
 		//  Estimated: `247 + n * (1 ±0)`
-		// Minimum execution time: 10_883_000 picoseconds.
-		Weight::from_parts(13_454_925, 247)
-			// Standard Error: 276
-			.saturating_add(Weight::from_parts(1_509, 0).saturating_mul(n.into()))
+		// Minimum execution time: 11_303_000 picoseconds.
+		Weight::from_parts(12_595_161, 247)
+			// Standard Error: 81
+			.saturating_add(Weight::from_parts(1_311, 0).saturating_mul(n.into()))
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 			.saturating_add(T::DbWeight::get().writes(1_u64))
 			.saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into()))
@@ -682,36 +695,36 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 1_586_000 picoseconds.
-		Weight::from_parts(1_869_000, 0)
+		// Minimum execution time: 1_618_000 picoseconds.
+		Weight::from_parts(1_768_000, 0)
 	}
 	fn set_transient_storage_full() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 1_997_000 picoseconds.
-		Weight::from_parts(2_093_000, 0)
+		// Minimum execution time: 1_936_000 picoseconds.
+		Weight::from_parts(2_146_000, 0)
 	}
 	fn get_transient_storage_empty() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 1_531_000 picoseconds.
-		Weight::from_parts(1_734_000, 0)
+		// Minimum execution time: 1_616_000 picoseconds.
+		Weight::from_parts(1_816_000, 0)
 	}
 	fn get_transient_storage_full() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 1_635_000 picoseconds.
-		Weight::from_parts(1_880_000, 0)
+		// Minimum execution time: 1_716_000 picoseconds.
+		Weight::from_parts(1_928_000, 0)
 	}
 	fn rollback_transient_storage() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 1_192_000 picoseconds.
-		Weight::from_parts(1_339_000, 0)
+		// Minimum execution time: 1_070_000 picoseconds.
+		Weight::from_parts(1_201_000, 0)
 	}
 	/// The range of component `n` is `[0, 512]`.
 	/// The range of component `o` is `[0, 512]`.
@@ -720,58 +733,58 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		//  Measured:  `0`
 		//  Estimated: `0`
 		// Minimum execution time: 2_294_000 picoseconds.
-		Weight::from_parts(2_848_884, 0)
-			// Standard Error: 53
-			.saturating_add(Weight::from_parts(176, 0).saturating_mul(n.into()))
-			// Standard Error: 53
-			.saturating_add(Weight::from_parts(148, 0).saturating_mul(o.into()))
+		Weight::from_parts(2_562_977, 0)
+			// Standard Error: 16
+			.saturating_add(Weight::from_parts(274, 0).saturating_mul(n.into()))
+			// Standard Error: 16
+			.saturating_add(Weight::from_parts(374, 0).saturating_mul(o.into()))
 	}
 	/// The range of component `n` is `[0, 512]`.
 	fn seal_clear_transient_storage(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 2_073_000 picoseconds.
-		Weight::from_parts(2_670_081, 0)
-			// Standard Error: 64
-			.saturating_add(Weight::from_parts(270, 0).saturating_mul(n.into()))
+		// Minimum execution time: 2_016_000 picoseconds.
+		Weight::from_parts(2_487_058, 0)
+			// Standard Error: 27
+			.saturating_add(Weight::from_parts(434, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `n` is `[0, 512]`.
 	fn seal_get_transient_storage(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 1_879_000 picoseconds.
-		Weight::from_parts(2_294_904, 0)
-			// Standard Error: 55
-			.saturating_add(Weight::from_parts(481, 0).saturating_mul(n.into()))
+		// Minimum execution time: 1_892_000 picoseconds.
+		Weight::from_parts(2_207_388, 0)
+			// Standard Error: 27
+			.saturating_add(Weight::from_parts(443, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `n` is `[0, 512]`.
 	fn seal_contains_transient_storage(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 1_711_000 picoseconds.
-		Weight::from_parts(2_151_924, 0)
-			// Standard Error: 56
-			.saturating_add(Weight::from_parts(98, 0).saturating_mul(n.into()))
+		// Minimum execution time: 1_709_000 picoseconds.
+		Weight::from_parts(2_050_395, 0)
+			// Standard Error: 19
+			.saturating_add(Weight::from_parts(184, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `n` is `[0, 512]`.
 	fn seal_take_transient_storage(_n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 2_615_000 picoseconds.
-		Weight::from_parts(3_050_600, 0)
+		// Minimum execution time: 2_516_000 picoseconds.
+		Weight::from_parts(2_873_575, 0)
 	}
 	/// Storage: `Revive::AddressSuffix` (r:1 w:0)
 	/// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`)
 	fn seal_transfer() -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `390`
-		//  Estimated: `3855`
-		// Minimum execution time: 18_629_000 picoseconds.
-		Weight::from_parts(19_520_000, 3855)
+		//  Measured:  `315`
+		//  Estimated: `3780`
+		// Minimum execution time: 17_252_000 picoseconds.
+		Weight::from_parts(17_661_000, 3780)
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 	}
 	/// Storage: `Revive::AddressSuffix` (r:1 w:0)
@@ -786,15 +799,15 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 	/// The range of component `i` is `[0, 262144]`.
 	fn seal_call(t: u32, i: u32, ) -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `1319 + t * (178 ±0)`
-		//  Estimated: `4784 + t * (178 ±0)`
-		// Minimum execution time: 43_655_000 picoseconds.
-		Weight::from_parts(50_252_813, 4784)
-			// Standard Error: 1
-			.saturating_add(Weight::from_parts(1, 0).saturating_mul(i.into()))
+		//  Measured:  `1292 + t * (103 ±0)`
+		//  Estimated: `4757 + t * (103 ±0)`
+		// Minimum execution time: 40_689_000 picoseconds.
+		Weight::from_parts(45_233_426, 4757)
+			// Standard Error: 0
+			.saturating_add(Weight::from_parts(3, 0).saturating_mul(i.into()))
 			.saturating_add(T::DbWeight::get().reads(4_u64))
 			.saturating_add(T::DbWeight::get().writes(1_u64))
-			.saturating_add(Weight::from_parts(0, 178).saturating_mul(t.into()))
+			.saturating_add(Weight::from_parts(0, 103).saturating_mul(t.into()))
 	}
 	/// Storage: `Revive::CodeInfoOf` (r:1 w:0)
 	/// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`)
@@ -802,10 +815,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 	/// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`)
 	fn seal_delegate_call() -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `1089`
-		//  Estimated: `4554`
-		// Minimum execution time: 31_153_000 picoseconds.
-		Weight::from_parts(33_625_000, 4554)
+		//  Measured:  `1064`
+		//  Estimated: `4529`
+		// Minimum execution time: 31_110_000 picoseconds.
+		Weight::from_parts(32_044_000, 4529)
 			.saturating_add(T::DbWeight::get().reads(2_u64))
 	}
 	/// Storage: `Revive::CodeInfoOf` (r:1 w:1)
@@ -819,12 +832,12 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 	/// The range of component `i` is `[0, 262144]`.
 	fn seal_instantiate(i: u32, ) -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `1360`
-		//  Estimated: `4814`
-		// Minimum execution time: 130_134_000 picoseconds.
-		Weight::from_parts(120_699_282, 4814)
-			// Standard Error: 20
-			.saturating_add(Weight::from_parts(4_054, 0).saturating_mul(i.into()))
+		//  Measured:  `1273`
+		//  Estimated: `4732`
+		// Minimum execution time: 129_979_000 picoseconds.
+		Weight::from_parts(118_301_199, 4732)
+			// Standard Error: 10
+			.saturating_add(Weight::from_parts(3_697, 0).saturating_mul(i.into()))
 			.saturating_add(T::DbWeight::get().reads(4_u64))
 			.saturating_add(T::DbWeight::get().writes(3_u64))
 	}
@@ -833,64 +846,64 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 665_000 picoseconds.
-		Weight::from_parts(1_964_310, 0)
-			// Standard Error: 4
-			.saturating_add(Weight::from_parts(1_091, 0).saturating_mul(n.into()))
+		// Minimum execution time: 696_000 picoseconds.
+		Weight::from_parts(1_036_915, 0)
+			// Standard Error: 0
+			.saturating_add(Weight::from_parts(1_117, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `n` is `[0, 262144]`.
 	fn seal_hash_keccak_256(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 1_245_000 picoseconds.
-		Weight::from_parts(2_362_235, 0)
-			// Standard Error: 10
-			.saturating_add(Weight::from_parts(3_360, 0).saturating_mul(n.into()))
+		// Minimum execution time: 1_117_000 picoseconds.
+		Weight::from_parts(631_314, 0)
+			// Standard Error: 1
+			.saturating_add(Weight::from_parts(3_318, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `n` is `[0, 262144]`.
 	fn seal_hash_blake2_256(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 668_000 picoseconds.
-		Weight::from_parts(1_216_363, 0)
-			// Standard Error: 4
-			.saturating_add(Weight::from_parts(1_231, 0).saturating_mul(n.into()))
+		// Minimum execution time: 686_000 picoseconds.
+		Weight::from_parts(427_696, 0)
+			// Standard Error: 0
+			.saturating_add(Weight::from_parts(1_244, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `n` is `[0, 262144]`.
 	fn seal_hash_blake2_128(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 702_000 picoseconds.
-		Weight::from_parts(1_283_345, 0)
-			// Standard Error: 5
-			.saturating_add(Weight::from_parts(1_230, 0).saturating_mul(n.into()))
+		// Minimum execution time: 663_000 picoseconds.
+		Weight::from_parts(440_191, 0)
+			// Standard Error: 0
+			.saturating_add(Weight::from_parts(1_243, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `n` is `[0, 261889]`.
 	fn seal_sr25519_verify(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 45_690_000 picoseconds.
-		Weight::from_parts(28_207_599, 0)
-			// Standard Error: 18
-			.saturating_add(Weight::from_parts(5_142, 0).saturating_mul(n.into()))
+		// Minimum execution time: 49_781_000 picoseconds.
+		Weight::from_parts(32_846_276, 0)
+			// Standard Error: 14
+			.saturating_add(Weight::from_parts(4_798, 0).saturating_mul(n.into()))
 	}
 	fn seal_ecdsa_recover() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 51_869_000 picoseconds.
-		Weight::from_parts(56_118_000, 0)
+		// Minimum execution time: 48_044_000 picoseconds.
+		Weight::from_parts(49_512_000, 0)
 	}
 	fn seal_ecdsa_to_eth_address() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 12_927_000 picoseconds.
-		Weight::from_parts(13_256_000, 0)
+		// Minimum execution time: 12_680_000 picoseconds.
+		Weight::from_parts(12_967_000, 0)
 	}
 	/// Storage: `Revive::CodeInfoOf` (r:1 w:1)
 	/// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`)
@@ -898,8 +911,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `300`
 		//  Estimated: `3765`
-		// Minimum execution time: 16_969_000 picoseconds.
-		Weight::from_parts(17_796_000, 3765)
+		// Minimum execution time: 16_707_000 picoseconds.
+		Weight::from_parts(17_318_000, 3765)
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 			.saturating_add(T::DbWeight::get().writes(1_u64))
 	}
@@ -907,10 +920,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 	/// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`)
 	fn lock_delegate_dependency() -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `338`
-		//  Estimated: `3803`
-		// Minimum execution time: 11_827_000 picoseconds.
-		Weight::from_parts(13_675_000, 3803)
+		//  Measured:  `337`
+		//  Estimated: `3802`
+		// Minimum execution time: 11_962_000 picoseconds.
+		Weight::from_parts(12_283_000, 3802)
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 			.saturating_add(T::DbWeight::get().writes(1_u64))
 	}
@@ -918,10 +931,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 	/// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`)
 	fn unlock_delegate_dependency() -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `338`
+		//  Measured:  `337`
 		//  Estimated: `3561`
-		// Minimum execution time: 10_529_000 picoseconds.
-		Weight::from_parts(12_080_000, 3561)
+		// Minimum execution time: 10_477_000 picoseconds.
+		Weight::from_parts(11_018_000, 3561)
 			.saturating_add(T::DbWeight::get().reads(1_u64))
 			.saturating_add(T::DbWeight::get().writes(1_u64))
 	}
@@ -930,10 +943,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 8_269_000 picoseconds.
-		Weight::from_parts(11_148_702, 0)
-			// Standard Error: 366
-			.saturating_add(Weight::from_parts(87_469, 0).saturating_mul(r.into()))
+		// Minimum execution time: 8_136_000 picoseconds.
+		Weight::from_parts(9_712_463, 0)
+			// Standard Error: 42
+			.saturating_add(Weight::from_parts(71_916, 0).saturating_mul(r.into()))
 	}
 }
 
@@ -945,8 +958,8 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `109`
 		//  Estimated: `1594`
-		// Minimum execution time: 3_293_000 picoseconds.
-		Weight::from_parts(3_530_000, 1594)
+		// Minimum execution time: 3_055_000 picoseconds.
+		Weight::from_parts(3_377_000, 1594)
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 	}
 	/// Storage: `Skipped::Metadata` (r:0 w:0)
@@ -956,10 +969,10 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `425 + k * (69 ±0)`
 		//  Estimated: `415 + k * (70 ±0)`
-		// Minimum execution time: 16_103_000 picoseconds.
-		Weight::from_parts(16_692_000, 415)
-			// Standard Error: 2_700
-			.saturating_add(Weight::from_parts(1_493_715, 0).saturating_mul(k.into()))
+		// Minimum execution time: 15_564_000 picoseconds.
+		Weight::from_parts(14_949_168, 415)
+			// Standard Error: 1_113
+			.saturating_add(Weight::from_parts(1_315_153, 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))
@@ -979,14 +992,12 @@ impl WeightInfo for () {
 	/// Storage: `System::Account` (r:1 w:1)
 	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`)
 	/// The range of component `c` is `[0, 262144]`.
-	fn call_with_code_per_byte(c: u32, ) -> Weight {
-		// Proof Size summary in bytes:
-		//  Measured:  `1561`
-		//  Estimated: `7501`
-		// Minimum execution time: 98_125_000 picoseconds.
-		Weight::from_parts(105_486_409, 7501)
-			// Standard Error: 2
-			.saturating_add(Weight::from_parts(4, 0).saturating_mul(c.into()))
+	fn call_with_code_per_byte(_c: u32, ) -> Weight {
+		// Proof Size summary in bytes:
+		//  Measured:  `1465`
+		//  Estimated: `7405`
+		// Minimum execution time: 98_113_000 picoseconds.
+		Weight::from_parts(101_964_040, 7405)
 			.saturating_add(RocksDbWeight::get().reads(7_u64))
 			.saturating_add(RocksDbWeight::get().writes(2_u64))
 	}
@@ -1009,11 +1020,11 @@ impl WeightInfo for () {
 	fn instantiate_with_code(_c: u32, i: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `416`
-		//  Estimated: `6348`
-		// Minimum execution time: 204_069_000 picoseconds.
-		Weight::from_parts(206_289_328, 6348)
-			// Standard Error: 16
-			.saturating_add(Weight::from_parts(4_438, 0).saturating_mul(i.into()))
+		//  Estimated: `6333`
+		// Minimum execution time: 207_612_000 picoseconds.
+		Weight::from_parts(202_394_849, 6333)
+			// Standard Error: 12
+			.saturating_add(Weight::from_parts(4_108, 0).saturating_mul(i.into()))
 			.saturating_add(RocksDbWeight::get().reads(7_u64))
 			.saturating_add(RocksDbWeight::get().writes(6_u64))
 	}
@@ -1034,12 +1045,12 @@ impl WeightInfo for () {
 	/// The range of component `i` is `[0, 262144]`.
 	fn instantiate(i: u32, ) -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `1334`
-		//  Estimated: `4782`
-		// Minimum execution time: 171_790_000 picoseconds.
-		Weight::from_parts(152_418_252, 4782)
-			// Standard Error: 20
-			.saturating_add(Weight::from_parts(4_271, 0).saturating_mul(i.into()))
+		//  Measured:  `1296`
+		//  Estimated: `4741`
+		// Minimum execution time: 172_403_000 picoseconds.
+		Weight::from_parts(151_999_812, 4741)
+			// Standard Error: 15
+			.saturating_add(Weight::from_parts(3_948, 0).saturating_mul(i.into()))
 			.saturating_add(RocksDbWeight::get().reads(7_u64))
 			.saturating_add(RocksDbWeight::get().writes(4_u64))
 	}
@@ -1057,10 +1068,10 @@ impl WeightInfo for () {
 	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`)
 	fn call() -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `1561`
-		//  Estimated: `7501`
-		// Minimum execution time: 150_910_000 picoseconds.
-		Weight::from_parts(163_308_000, 7501)
+		//  Measured:  `1465`
+		//  Estimated: `7405`
+		// Minimum execution time: 149_755_000 picoseconds.
+		Weight::from_parts(166_190_000, 7405)
 			.saturating_add(RocksDbWeight::get().reads(7_u64))
 			.saturating_add(RocksDbWeight::get().writes(2_u64))
 	}
@@ -1071,14 +1082,12 @@ impl WeightInfo for () {
 	/// Storage: `Revive::PristineCode` (r:0 w:1)
 	/// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`)
 	/// The range of component `c` is `[0, 262144]`.
-	fn upload_code(c: u32, ) -> Weight {
+	fn upload_code(_c: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `109`
 		//  Estimated: `3574`
-		// Minimum execution time: 57_970_000 picoseconds.
-		Weight::from_parts(62_605_851, 3574)
-			// Standard Error: 3
-			.saturating_add(Weight::from_parts(6, 0).saturating_mul(c.into()))
+		// Minimum execution time: 58_481_000 picoseconds.
+		Weight::from_parts(61_009_506, 3574)
 			.saturating_add(RocksDbWeight::get().reads(2_u64))
 			.saturating_add(RocksDbWeight::get().writes(3_u64))
 	}
@@ -1092,8 +1101,8 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `285`
 		//  Estimated: `3750`
-		// Minimum execution time: 47_117_000 picoseconds.
-		Weight::from_parts(48_310_000, 3750)
+		// Minimum execution time: 47_485_000 picoseconds.
+		Weight::from_parts(48_962_000, 3750)
 			.saturating_add(RocksDbWeight::get().reads(2_u64))
 			.saturating_add(RocksDbWeight::get().writes(3_u64))
 	}
@@ -1105,8 +1114,8 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `529`
 		//  Estimated: `6469`
-		// Minimum execution time: 30_754_000 picoseconds.
-		Weight::from_parts(32_046_000, 6469)
+		// Minimum execution time: 30_752_000 picoseconds.
+		Weight::from_parts(32_401_000, 6469)
 			.saturating_add(RocksDbWeight::get().reads(3_u64))
 			.saturating_add(RocksDbWeight::get().writes(3_u64))
 	}
@@ -1118,8 +1127,8 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `109`
 		//  Estimated: `3574`
-		// Minimum execution time: 46_338_000 picoseconds.
-		Weight::from_parts(47_697_000, 3574)
+		// Minimum execution time: 47_042_000 picoseconds.
+		Weight::from_parts(48_378_000, 3574)
 			.saturating_add(RocksDbWeight::get().reads(2_u64))
 			.saturating_add(RocksDbWeight::get().writes(2_u64))
 	}
@@ -1131,8 +1140,8 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `56`
 		//  Estimated: `3521`
-		// Minimum execution time: 36_480_000 picoseconds.
-		Weight::from_parts(37_310_000, 3521)
+		// Minimum execution time: 36_705_000 picoseconds.
+		Weight::from_parts(37_313_000, 3521)
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 			.saturating_add(RocksDbWeight::get().writes(2_u64))
 	}
@@ -1144,8 +1153,8 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `145`
 		//  Estimated: `3610`
-		// Minimum execution time: 12_950_000 picoseconds.
-		Weight::from_parts(13_431_000, 3610)
+		// Minimum execution time: 13_275_000 picoseconds.
+		Weight::from_parts(13_593_000, 3610)
 			.saturating_add(RocksDbWeight::get().reads(2_u64))
 	}
 	/// The range of component `r` is `[0, 1600]`.
@@ -1153,24 +1162,24 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 7_540_000 picoseconds.
-		Weight::from_parts(8_481_295, 0)
-			// Standard Error: 900
-			.saturating_add(Weight::from_parts(183_511, 0).saturating_mul(r.into()))
+		// Minimum execution time: 6_708_000 picoseconds.
+		Weight::from_parts(7_740_679, 0)
+			// Standard Error: 133
+			.saturating_add(Weight::from_parts(175_535, 0).saturating_mul(r.into()))
 	}
 	fn seal_caller() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 328_000 picoseconds.
-		Weight::from_parts(361_000, 0)
+		// Minimum execution time: 277_000 picoseconds.
+		Weight::from_parts(326_000, 0)
 	}
 	fn seal_origin() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 272_000 picoseconds.
-		Weight::from_parts(310_000, 0)
+		// Minimum execution time: 260_000 picoseconds.
+		Weight::from_parts(273_000, 0)
 	}
 	/// Storage: `Revive::ContractInfoOf` (r:1 w:0)
 	/// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`)
@@ -1178,8 +1187,8 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `306`
 		//  Estimated: `3771`
-		// Minimum execution time: 7_755_000 picoseconds.
-		Weight::from_parts(8_364_000, 3771)
+		// Minimum execution time: 7_700_000 picoseconds.
+		Weight::from_parts(8_207_000, 3771)
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 	}
 	/// Storage: `Revive::ContractInfoOf` (r:1 w:0)
@@ -1188,51 +1197,63 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `403`
 		//  Estimated: `3868`
-		// Minimum execution time: 8_848_000 picoseconds.
-		Weight::from_parts(9_317_000, 3868)
+		// Minimum execution time: 8_719_000 picoseconds.
+		Weight::from_parts(9_077_000, 3868)
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 	}
 	fn seal_own_code_hash() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 285_000 picoseconds.
-		Weight::from_parts(333_000, 0)
+		// Minimum execution time: 250_000 picoseconds.
+		Weight::from_parts(273_000, 0)
+	}
+	/// Storage: `Revive::ContractInfoOf` (r:1 w:0)
+	/// Proof: `Revive::ContractInfoOf` (`max_values`: None, `max_size`: Some(1779), added: 4254, mode: `Measured`)
+	/// Storage: `Revive::CodeInfoOf` (r:1 w:0)
+	/// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`)
+	fn seal_code_size() -> Weight {
+		// Proof Size summary in bytes:
+		//  Measured:  `473`
+		//  Estimated: `3938`
+		// Minimum execution time: 13_910_000 picoseconds.
+		Weight::from_parts(14_687_000, 3938)
+			.saturating_add(RocksDbWeight::get().reads(2_u64))
 	}
 	fn seal_caller_is_origin() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 314_000 picoseconds.
-		Weight::from_parts(418_000, 0)
+		// Minimum execution time: 351_000 picoseconds.
+		Weight::from_parts(389_000, 0)
 	}
 	fn seal_caller_is_root() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 297_000 picoseconds.
-		Weight::from_parts(353_000, 0)
+		// Minimum execution time: 285_000 picoseconds.
+		Weight::from_parts(307_000, 0)
 	}
 	fn seal_address() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 285_000 picoseconds.
-		Weight::from_parts(316_000, 0)
+		// Minimum execution time: 264_000 picoseconds.
+		Weight::from_parts(292_000, 0)
 	}
 	fn seal_weight_left() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 676_000 picoseconds.
-		Weight::from_parts(895_000, 0)
+		// Minimum execution time: 631_000 picoseconds.
+		Weight::from_parts(684_000, 0)
 	}
 	fn seal_balance() -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `178`
+		//  Measured:  `103`
 		//  Estimated: `0`
-		// Minimum execution time: 6_842_000 picoseconds.
-		Weight::from_parts(7_790_000, 0)
+		// Minimum execution time: 4_754_000 picoseconds.
+		Weight::from_parts(5_107_000, 0)
 	}
 	/// Storage: `Revive::AddressSuffix` (r:1 w:0)
 	/// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`)
@@ -1242,8 +1263,8 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `264`
 		//  Estimated: `3729`
-		// Minimum execution time: 10_982_000 picoseconds.
-		Weight::from_parts(13_664_000, 3729)
+		// Minimum execution time: 11_156_000 picoseconds.
+		Weight::from_parts(11_558_000, 3729)
 			.saturating_add(RocksDbWeight::get().reads(2_u64))
 	}
 	/// Storage: `Revive::ImmutableDataOf` (r:1 w:0)
@@ -1253,10 +1274,10 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `238 + n * (1 ±0)`
 		//  Estimated: `3703 + n * (1 ±0)`
-		// Minimum execution time: 6_690_000 picoseconds.
-		Weight::from_parts(7_522_685, 3703)
-			// Standard Error: 21
-			.saturating_add(Weight::from_parts(1_084, 0).saturating_mul(n.into()))
+		// Minimum execution time: 6_637_000 picoseconds.
+		Weight::from_parts(7_510_923, 3703)
+			// Standard Error: 12
+			.saturating_add(Weight::from_parts(955, 0).saturating_mul(n.into()))
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 			.saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into()))
 	}
@@ -1267,39 +1288,39 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 3_090_000 picoseconds.
-		Weight::from_parts(3_585_913, 0)
-			// Standard Error: 11
-			.saturating_add(Weight::from_parts(594, 0).saturating_mul(n.into()))
+		// Minimum execution time: 2_717_000 picoseconds.
+		Weight::from_parts(3_109_103, 0)
+			// Standard Error: 3
+			.saturating_add(Weight::from_parts(666, 0).saturating_mul(n.into()))
 			.saturating_add(RocksDbWeight::get().writes(1_u64))
 	}
 	fn seal_value_transferred() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 261_000 picoseconds.
-		Weight::from_parts(305_000, 0)
+		// Minimum execution time: 253_000 picoseconds.
+		Weight::from_parts(318_000, 0)
 	}
 	fn seal_minimum_balance() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 279_000 picoseconds.
-		Weight::from_parts(299_000, 0)
+		// Minimum execution time: 263_000 picoseconds.
+		Weight::from_parts(309_000, 0)
 	}
 	fn seal_block_number() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 280_000 picoseconds.
-		Weight::from_parts(317_000, 0)
+		// Minimum execution time: 239_000 picoseconds.
+		Weight::from_parts(278_000, 0)
 	}
 	fn seal_now() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 285_000 picoseconds.
-		Weight::from_parts(313_000, 0)
+		// Minimum execution time: 266_000 picoseconds.
+		Weight::from_parts(300_000, 0)
 	}
 	/// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0)
 	/// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `Measured`)
@@ -1307,8 +1328,8 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `67`
 		//  Estimated: `1552`
-		// Minimum execution time: 6_116_000 picoseconds.
-		Weight::from_parts(6_584_000, 1552)
+		// Minimum execution time: 6_300_000 picoseconds.
+		Weight::from_parts(6_588_000, 1552)
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 	}
 	/// The range of component `n` is `[0, 262140]`.
@@ -1316,20 +1337,20 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 477_000 picoseconds.
-		Weight::from_parts(887_560, 0)
+		// Minimum execution time: 457_000 picoseconds.
+		Weight::from_parts(533_616, 0)
 			// Standard Error: 0
-			.saturating_add(Weight::from_parts(154, 0).saturating_mul(n.into()))
+			.saturating_add(Weight::from_parts(148, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `n` is `[0, 262140]`.
 	fn seal_return(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 315_000 picoseconds.
-		Weight::from_parts(870_254, 0)
-			// Standard Error: 1
-			.saturating_add(Weight::from_parts(248, 0).saturating_mul(n.into()))
+		// Minimum execution time: 287_000 picoseconds.
+		Weight::from_parts(450_119, 0)
+			// Standard Error: 0
+			.saturating_add(Weight::from_parts(295, 0).saturating_mul(n.into()))
 	}
 	/// Storage: `Revive::AddressSuffix` (r:1 w:0)
 	/// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`)
@@ -1344,12 +1365,12 @@ impl WeightInfo for () {
 	/// The range of component `n` is `[0, 32]`.
 	fn seal_terminate(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `323 + n * (88 ±0)`
-		//  Estimated: `3789 + n * (2563 ±0)`
-		// Minimum execution time: 23_098_000 picoseconds.
-		Weight::from_parts(26_001_186, 3789)
-			// Standard Error: 23_098
-			.saturating_add(Weight::from_parts(4_935_203, 0).saturating_mul(n.into()))
+		//  Measured:  `321 + n * (88 ±0)`
+		//  Estimated: `3787 + n * (2563 ±0)`
+		// Minimum execution time: 22_885_000 picoseconds.
+		Weight::from_parts(25_158_434, 3787)
+			// Standard Error: 9_482
+			.saturating_add(Weight::from_parts(4_623_850, 0).saturating_mul(n.into()))
 			.saturating_add(RocksDbWeight::get().reads(3_u64))
 			.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into())))
 			.saturating_add(RocksDbWeight::get().writes(4_u64))
@@ -1362,22 +1383,22 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 5_271_000 picoseconds.
-		Weight::from_parts(5_803_969, 0)
-			// Standard Error: 10_511
-			.saturating_add(Weight::from_parts(163_106, 0).saturating_mul(t.into()))
-			// Standard Error: 93
-			.saturating_add(Weight::from_parts(361, 0).saturating_mul(n.into()))
+		// Minimum execution time: 5_172_000 picoseconds.
+		Weight::from_parts(5_112_915, 0)
+			// Standard Error: 3_042
+			.saturating_add(Weight::from_parts(220_337, 0).saturating_mul(t.into()))
+			// Standard Error: 27
+			.saturating_add(Weight::from_parts(1_077, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `i` is `[0, 262144]`.
 	fn seal_debug_message(i: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 375_000 picoseconds.
-		Weight::from_parts(1_601_309, 0)
-			// Standard Error: 3
-			.saturating_add(Weight::from_parts(787, 0).saturating_mul(i.into()))
+		// Minimum execution time: 332_000 picoseconds.
+		Weight::from_parts(830_275, 0)
+			// Standard Error: 0
+			.saturating_add(Weight::from_parts(803, 0).saturating_mul(i.into()))
 	}
 	/// Storage: `Skipped::Metadata` (r:0 w:0)
 	/// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`)
@@ -1385,8 +1406,8 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `744`
 		//  Estimated: `744`
-		// Minimum execution time: 9_557_000 picoseconds.
-		Weight::from_parts(10_131_000, 744)
+		// Minimum execution time: 9_628_000 picoseconds.
+		Weight::from_parts(10_193_000, 744)
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 	}
 	/// Storage: `Skipped::Metadata` (r:0 w:0)
@@ -1395,8 +1416,8 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `10754`
 		//  Estimated: `10754`
-		// Minimum execution time: 45_601_000 picoseconds.
-		Weight::from_parts(46_296_000, 10754)
+		// Minimum execution time: 45_621_000 picoseconds.
+		Weight::from_parts(46_237_000, 10754)
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 	}
 	/// Storage: `Skipped::Metadata` (r:0 w:0)
@@ -1405,8 +1426,8 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `744`
 		//  Estimated: `744`
-		// Minimum execution time: 10_718_000 picoseconds.
-		Weight::from_parts(12_282_000, 744)
+		// Minimum execution time: 10_918_000 picoseconds.
+		Weight::from_parts(11_441_000, 744)
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 			.saturating_add(RocksDbWeight::get().writes(1_u64))
 	}
@@ -1416,8 +1437,8 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `10754`
 		//  Estimated: `10754`
-		// Minimum execution time: 47_580_000 picoseconds.
-		Weight::from_parts(50_301_000, 10754)
+		// Minimum execution time: 47_445_000 picoseconds.
+		Weight::from_parts(49_049_000, 10754)
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 			.saturating_add(RocksDbWeight::get().writes(1_u64))
 	}
@@ -1429,12 +1450,12 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `248 + o * (1 ±0)`
 		//  Estimated: `247 + o * (1 ±0)`
-		// Minimum execution time: 11_483_000 picoseconds.
-		Weight::from_parts(13_084_262, 247)
-			// Standard Error: 218
-			.saturating_add(Weight::from_parts(83, 0).saturating_mul(n.into()))
-			// Standard Error: 218
-			.saturating_add(Weight::from_parts(683, 0).saturating_mul(o.into()))
+		// Minimum execution time: 11_215_000 picoseconds.
+		Weight::from_parts(11_943_073, 247)
+			// Standard Error: 50
+			.saturating_add(Weight::from_parts(844, 0).saturating_mul(n.into()))
+			// Standard Error: 50
+			.saturating_add(Weight::from_parts(891, 0).saturating_mul(o.into()))
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 			.saturating_add(RocksDbWeight::get().writes(1_u64))
 			.saturating_add(Weight::from_parts(0, 1).saturating_mul(o.into()))
@@ -1446,8 +1467,10 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `248 + n * (1 ±0)`
 		//  Estimated: `247 + n * (1 ±0)`
-		// Minimum execution time: 10_972_000 picoseconds.
-		Weight::from_parts(12_960_831, 247)
+		// Minimum execution time: 10_794_000 picoseconds.
+		Weight::from_parts(11_993_996, 247)
+			// Standard Error: 75
+			.saturating_add(Weight::from_parts(759, 0).saturating_mul(n.into()))
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 			.saturating_add(RocksDbWeight::get().writes(1_u64))
 			.saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into()))
@@ -1459,8 +1482,10 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `248 + n * (1 ±0)`
 		//  Estimated: `247 + n * (1 ±0)`
-		// Minimum execution time: 9_989_000 picoseconds.
-		Weight::from_parts(12_783_294, 247)
+		// Minimum execution time: 10_345_000 picoseconds.
+		Weight::from_parts(11_428_949, 247)
+			// Standard Error: 80
+			.saturating_add(Weight::from_parts(1_525, 0).saturating_mul(n.into()))
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 			.saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into()))
 	}
@@ -1471,10 +1496,10 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `248 + n * (1 ±0)`
 		//  Estimated: `247 + n * (1 ±0)`
-		// Minimum execution time: 9_732_000 picoseconds.
-		Weight::from_parts(11_156_576, 247)
-			// Standard Error: 255
-			.saturating_add(Weight::from_parts(1_956, 0).saturating_mul(n.into()))
+		// Minimum execution time: 9_858_000 picoseconds.
+		Weight::from_parts(10_787_656, 247)
+			// Standard Error: 64
+			.saturating_add(Weight::from_parts(789, 0).saturating_mul(n.into()))
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 			.saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into()))
 	}
@@ -1485,10 +1510,10 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `248 + n * (1 ±0)`
 		//  Estimated: `247 + n * (1 ±0)`
-		// Minimum execution time: 10_883_000 picoseconds.
-		Weight::from_parts(13_454_925, 247)
-			// Standard Error: 276
-			.saturating_add(Weight::from_parts(1_509, 0).saturating_mul(n.into()))
+		// Minimum execution time: 11_303_000 picoseconds.
+		Weight::from_parts(12_595_161, 247)
+			// Standard Error: 81
+			.saturating_add(Weight::from_parts(1_311, 0).saturating_mul(n.into()))
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 			.saturating_add(RocksDbWeight::get().writes(1_u64))
 			.saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into()))
@@ -1497,36 +1522,36 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 1_586_000 picoseconds.
-		Weight::from_parts(1_869_000, 0)
+		// Minimum execution time: 1_618_000 picoseconds.
+		Weight::from_parts(1_768_000, 0)
 	}
 	fn set_transient_storage_full() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 1_997_000 picoseconds.
-		Weight::from_parts(2_093_000, 0)
+		// Minimum execution time: 1_936_000 picoseconds.
+		Weight::from_parts(2_146_000, 0)
 	}
 	fn get_transient_storage_empty() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 1_531_000 picoseconds.
-		Weight::from_parts(1_734_000, 0)
+		// Minimum execution time: 1_616_000 picoseconds.
+		Weight::from_parts(1_816_000, 0)
 	}
 	fn get_transient_storage_full() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 1_635_000 picoseconds.
-		Weight::from_parts(1_880_000, 0)
+		// Minimum execution time: 1_716_000 picoseconds.
+		Weight::from_parts(1_928_000, 0)
 	}
 	fn rollback_transient_storage() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 1_192_000 picoseconds.
-		Weight::from_parts(1_339_000, 0)
+		// Minimum execution time: 1_070_000 picoseconds.
+		Weight::from_parts(1_201_000, 0)
 	}
 	/// The range of component `n` is `[0, 512]`.
 	/// The range of component `o` is `[0, 512]`.
@@ -1535,58 +1560,58 @@ impl WeightInfo for () {
 		//  Measured:  `0`
 		//  Estimated: `0`
 		// Minimum execution time: 2_294_000 picoseconds.
-		Weight::from_parts(2_848_884, 0)
-			// Standard Error: 53
-			.saturating_add(Weight::from_parts(176, 0).saturating_mul(n.into()))
-			// Standard Error: 53
-			.saturating_add(Weight::from_parts(148, 0).saturating_mul(o.into()))
+		Weight::from_parts(2_562_977, 0)
+			// Standard Error: 16
+			.saturating_add(Weight::from_parts(274, 0).saturating_mul(n.into()))
+			// Standard Error: 16
+			.saturating_add(Weight::from_parts(374, 0).saturating_mul(o.into()))
 	}
 	/// The range of component `n` is `[0, 512]`.
 	fn seal_clear_transient_storage(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 2_073_000 picoseconds.
-		Weight::from_parts(2_670_081, 0)
-			// Standard Error: 64
-			.saturating_add(Weight::from_parts(270, 0).saturating_mul(n.into()))
+		// Minimum execution time: 2_016_000 picoseconds.
+		Weight::from_parts(2_487_058, 0)
+			// Standard Error: 27
+			.saturating_add(Weight::from_parts(434, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `n` is `[0, 512]`.
 	fn seal_get_transient_storage(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 1_879_000 picoseconds.
-		Weight::from_parts(2_294_904, 0)
-			// Standard Error: 55
-			.saturating_add(Weight::from_parts(481, 0).saturating_mul(n.into()))
+		// Minimum execution time: 1_892_000 picoseconds.
+		Weight::from_parts(2_207_388, 0)
+			// Standard Error: 27
+			.saturating_add(Weight::from_parts(443, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `n` is `[0, 512]`.
 	fn seal_contains_transient_storage(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 1_711_000 picoseconds.
-		Weight::from_parts(2_151_924, 0)
-			// Standard Error: 56
-			.saturating_add(Weight::from_parts(98, 0).saturating_mul(n.into()))
+		// Minimum execution time: 1_709_000 picoseconds.
+		Weight::from_parts(2_050_395, 0)
+			// Standard Error: 19
+			.saturating_add(Weight::from_parts(184, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `n` is `[0, 512]`.
 	fn seal_take_transient_storage(_n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 2_615_000 picoseconds.
-		Weight::from_parts(3_050_600, 0)
+		// Minimum execution time: 2_516_000 picoseconds.
+		Weight::from_parts(2_873_575, 0)
 	}
 	/// Storage: `Revive::AddressSuffix` (r:1 w:0)
 	/// Proof: `Revive::AddressSuffix` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `Measured`)
 	fn seal_transfer() -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `390`
-		//  Estimated: `3855`
-		// Minimum execution time: 18_629_000 picoseconds.
-		Weight::from_parts(19_520_000, 3855)
+		//  Measured:  `315`
+		//  Estimated: `3780`
+		// Minimum execution time: 17_252_000 picoseconds.
+		Weight::from_parts(17_661_000, 3780)
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 	}
 	/// Storage: `Revive::AddressSuffix` (r:1 w:0)
@@ -1601,15 +1626,15 @@ impl WeightInfo for () {
 	/// The range of component `i` is `[0, 262144]`.
 	fn seal_call(t: u32, i: u32, ) -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `1319 + t * (178 ±0)`
-		//  Estimated: `4784 + t * (178 ±0)`
-		// Minimum execution time: 43_655_000 picoseconds.
-		Weight::from_parts(50_252_813, 4784)
-			// Standard Error: 1
-			.saturating_add(Weight::from_parts(1, 0).saturating_mul(i.into()))
+		//  Measured:  `1292 + t * (103 ±0)`
+		//  Estimated: `4757 + t * (103 ±0)`
+		// Minimum execution time: 40_689_000 picoseconds.
+		Weight::from_parts(45_233_426, 4757)
+			// Standard Error: 0
+			.saturating_add(Weight::from_parts(3, 0).saturating_mul(i.into()))
 			.saturating_add(RocksDbWeight::get().reads(4_u64))
 			.saturating_add(RocksDbWeight::get().writes(1_u64))
-			.saturating_add(Weight::from_parts(0, 178).saturating_mul(t.into()))
+			.saturating_add(Weight::from_parts(0, 103).saturating_mul(t.into()))
 	}
 	/// Storage: `Revive::CodeInfoOf` (r:1 w:0)
 	/// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`)
@@ -1617,10 +1642,10 @@ impl WeightInfo for () {
 	/// Proof: `Revive::PristineCode` (`max_values`: None, `max_size`: Some(262180), added: 264655, mode: `Measured`)
 	fn seal_delegate_call() -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `1089`
-		//  Estimated: `4554`
-		// Minimum execution time: 31_153_000 picoseconds.
-		Weight::from_parts(33_625_000, 4554)
+		//  Measured:  `1064`
+		//  Estimated: `4529`
+		// Minimum execution time: 31_110_000 picoseconds.
+		Weight::from_parts(32_044_000, 4529)
 			.saturating_add(RocksDbWeight::get().reads(2_u64))
 	}
 	/// Storage: `Revive::CodeInfoOf` (r:1 w:1)
@@ -1634,12 +1659,12 @@ impl WeightInfo for () {
 	/// The range of component `i` is `[0, 262144]`.
 	fn seal_instantiate(i: u32, ) -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `1360`
-		//  Estimated: `4814`
-		// Minimum execution time: 130_134_000 picoseconds.
-		Weight::from_parts(120_699_282, 4814)
-			// Standard Error: 20
-			.saturating_add(Weight::from_parts(4_054, 0).saturating_mul(i.into()))
+		//  Measured:  `1273`
+		//  Estimated: `4732`
+		// Minimum execution time: 129_979_000 picoseconds.
+		Weight::from_parts(118_301_199, 4732)
+			// Standard Error: 10
+			.saturating_add(Weight::from_parts(3_697, 0).saturating_mul(i.into()))
 			.saturating_add(RocksDbWeight::get().reads(4_u64))
 			.saturating_add(RocksDbWeight::get().writes(3_u64))
 	}
@@ -1648,64 +1673,64 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 665_000 picoseconds.
-		Weight::from_parts(1_964_310, 0)
-			// Standard Error: 4
-			.saturating_add(Weight::from_parts(1_091, 0).saturating_mul(n.into()))
+		// Minimum execution time: 696_000 picoseconds.
+		Weight::from_parts(1_036_915, 0)
+			// Standard Error: 0
+			.saturating_add(Weight::from_parts(1_117, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `n` is `[0, 262144]`.
 	fn seal_hash_keccak_256(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 1_245_000 picoseconds.
-		Weight::from_parts(2_362_235, 0)
-			// Standard Error: 10
-			.saturating_add(Weight::from_parts(3_360, 0).saturating_mul(n.into()))
+		// Minimum execution time: 1_117_000 picoseconds.
+		Weight::from_parts(631_314, 0)
+			// Standard Error: 1
+			.saturating_add(Weight::from_parts(3_318, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `n` is `[0, 262144]`.
 	fn seal_hash_blake2_256(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 668_000 picoseconds.
-		Weight::from_parts(1_216_363, 0)
-			// Standard Error: 4
-			.saturating_add(Weight::from_parts(1_231, 0).saturating_mul(n.into()))
+		// Minimum execution time: 686_000 picoseconds.
+		Weight::from_parts(427_696, 0)
+			// Standard Error: 0
+			.saturating_add(Weight::from_parts(1_244, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `n` is `[0, 262144]`.
 	fn seal_hash_blake2_128(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 702_000 picoseconds.
-		Weight::from_parts(1_283_345, 0)
-			// Standard Error: 5
-			.saturating_add(Weight::from_parts(1_230, 0).saturating_mul(n.into()))
+		// Minimum execution time: 663_000 picoseconds.
+		Weight::from_parts(440_191, 0)
+			// Standard Error: 0
+			.saturating_add(Weight::from_parts(1_243, 0).saturating_mul(n.into()))
 	}
 	/// The range of component `n` is `[0, 261889]`.
 	fn seal_sr25519_verify(n: u32, ) -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 45_690_000 picoseconds.
-		Weight::from_parts(28_207_599, 0)
-			// Standard Error: 18
-			.saturating_add(Weight::from_parts(5_142, 0).saturating_mul(n.into()))
+		// Minimum execution time: 49_781_000 picoseconds.
+		Weight::from_parts(32_846_276, 0)
+			// Standard Error: 14
+			.saturating_add(Weight::from_parts(4_798, 0).saturating_mul(n.into()))
 	}
 	fn seal_ecdsa_recover() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 51_869_000 picoseconds.
-		Weight::from_parts(56_118_000, 0)
+		// Minimum execution time: 48_044_000 picoseconds.
+		Weight::from_parts(49_512_000, 0)
 	}
 	fn seal_ecdsa_to_eth_address() -> Weight {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 12_927_000 picoseconds.
-		Weight::from_parts(13_256_000, 0)
+		// Minimum execution time: 12_680_000 picoseconds.
+		Weight::from_parts(12_967_000, 0)
 	}
 	/// Storage: `Revive::CodeInfoOf` (r:1 w:1)
 	/// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`)
@@ -1713,8 +1738,8 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `300`
 		//  Estimated: `3765`
-		// Minimum execution time: 16_969_000 picoseconds.
-		Weight::from_parts(17_796_000, 3765)
+		// Minimum execution time: 16_707_000 picoseconds.
+		Weight::from_parts(17_318_000, 3765)
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 			.saturating_add(RocksDbWeight::get().writes(1_u64))
 	}
@@ -1722,10 +1747,10 @@ impl WeightInfo for () {
 	/// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `Measured`)
 	fn lock_delegate_dependency() -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `338`
-		//  Estimated: `3803`
-		// Minimum execution time: 11_827_000 picoseconds.
-		Weight::from_parts(13_675_000, 3803)
+		//  Measured:  `337`
+		//  Estimated: `3802`
+		// Minimum execution time: 11_962_000 picoseconds.
+		Weight::from_parts(12_283_000, 3802)
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 			.saturating_add(RocksDbWeight::get().writes(1_u64))
 	}
@@ -1733,10 +1758,10 @@ impl WeightInfo for () {
 	/// Proof: `Revive::CodeInfoOf` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`)
 	fn unlock_delegate_dependency() -> Weight {
 		// Proof Size summary in bytes:
-		//  Measured:  `338`
+		//  Measured:  `337`
 		//  Estimated: `3561`
-		// Minimum execution time: 10_529_000 picoseconds.
-		Weight::from_parts(12_080_000, 3561)
+		// Minimum execution time: 10_477_000 picoseconds.
+		Weight::from_parts(11_018_000, 3561)
 			.saturating_add(RocksDbWeight::get().reads(1_u64))
 			.saturating_add(RocksDbWeight::get().writes(1_u64))
 	}
@@ -1745,9 +1770,9 @@ impl WeightInfo for () {
 		// Proof Size summary in bytes:
 		//  Measured:  `0`
 		//  Estimated: `0`
-		// Minimum execution time: 8_269_000 picoseconds.
-		Weight::from_parts(11_148_702, 0)
-			// Standard Error: 366
-			.saturating_add(Weight::from_parts(87_469, 0).saturating_mul(r.into()))
+		// Minimum execution time: 8_136_000 picoseconds.
+		Weight::from_parts(9_712_463, 0)
+			// Standard Error: 42
+			.saturating_add(Weight::from_parts(71_916, 0).saturating_mul(r.into()))
 	}
 }
diff --git a/substrate/frame/revive/uapi/src/host.rs b/substrate/frame/revive/uapi/src/host.rs
index aa92ed73a05..b1f1583bcdd 100644
--- a/substrate/frame/revive/uapi/src/host.rs
+++ b/substrate/frame/revive/uapi/src/host.rs
@@ -263,6 +263,18 @@ pub trait HostFn: private::Sealed {
 	/// otherwise `zero`.
 	fn code_hash(addr: &[u8; 20], output: &mut [u8; 32]);
 
+	/// Retrieve the code size for a specified contract address.
+	///
+	/// # Parameters
+	///
+	/// - `addr`: The address of the contract.
+	/// - `output`: A reference to the output data buffer to write the code size.
+	///
+	/// # Note
+	///
+	/// If `addr` is not a contract the `output` will be zero.
+	fn code_size(addr: &[u8; 20], output: &mut [u8; 32]);
+
 	/// Checks whether there is a value stored under the given key.
 	///
 	/// The key length must not exceed the maximum defined by the contracts module parameter.
diff --git a/substrate/frame/revive/uapi/src/host/riscv32.rs b/substrate/frame/revive/uapi/src/host/riscv32.rs
index 07bbb24aded..dcdf3e92eea 100644
--- a/substrate/frame/revive/uapi/src/host/riscv32.rs
+++ b/substrate/frame/revive/uapi/src/host/riscv32.rs
@@ -76,6 +76,7 @@ mod sys {
 		pub fn origin(out_ptr: *mut u8);
 		pub fn is_contract(account_ptr: *const u8) -> ReturnCode;
 		pub fn code_hash(address_ptr: *const u8, out_ptr: *mut u8);
+		pub fn code_size(address_ptr: *const u8, out_ptr: *mut u8);
 		pub fn own_code_hash(out_ptr: *mut u8);
 		pub fn caller_is_origin() -> ReturnCode;
 		pub fn caller_is_root() -> ReturnCode;
@@ -533,6 +534,10 @@ impl HostFn for HostFnImpl {
 		unsafe { sys::code_hash(address.as_ptr(), output.as_mut_ptr()) }
 	}
 
+	fn code_size(address: &[u8; 20], output: &mut [u8; 32]) {
+		unsafe { sys::code_size(address.as_ptr(), output.as_mut_ptr()) }
+	}
+
 	fn own_code_hash(output: &mut [u8; 32]) {
 		unsafe { sys::own_code_hash(output.as_mut_ptr()) }
 	}
-- 
GitLab