From 7e3130880d429780f6150f84fa22321971cac794 Mon Sep 17 00:00:00 2001
From: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com>
Date: Thu, 1 Aug 2024 15:02:39 +0200
Subject: [PATCH] remove XVM pallet code (#1303)
---
Cargo.lock | 89 ---
Cargo.toml | 5 -
chain-extensions/types/xvm/Cargo.toml | 26 -
chain-extensions/types/xvm/src/lib.rs | 76 --
chain-extensions/xvm/Cargo.toml | 45 --
chain-extensions/xvm/src/lib.rs | 193 -----
pallets/ethereum-checked/src/lib.rs | 26 +-
pallets/ethereum-checked/src/mock.rs | 1 -
pallets/ethereum-checked/src/tests.rs | 23 +-
pallets/xvm/Cargo.toml | 83 ---
pallets/xvm/src/benchmarking.rs | 88 ---
pallets/xvm/src/lib.rs | 353 ----------
pallets/xvm/src/mock.rs | 233 ------
pallets/xvm/src/tests.rs | 195 ------
pallets/xvm/src/weights.rs | 90 ---
precompiles/xvm/Cargo.toml | 61 --
precompiles/xvm/evm_sdk/XVM.sol | 24 -
precompiles/xvm/evm_sdk/flipper.sol | 19 -
precompiles/xvm/src/lib.rs | 145 ----
precompiles/xvm/src/mock.rs | 323 ---------
precompiles/xvm/src/tests.rs | 128 ----
primitives/src/ethereum_checked.rs | 20 +-
primitives/src/lib.rs | 3 -
primitives/src/xvm.rs | 172 -----
runtime/local/Cargo.toml | 8 -
runtime/local/src/chain_extensions.rs | 10 +-
runtime/local/src/lib.rs | 17 +-
runtime/local/src/precompiles.rs | 7 +-
runtime/shibuya/Cargo.toml | 8 -
runtime/shibuya/src/chain_extensions.rs | 10 +-
runtime/shibuya/src/lib.rs | 18 +-
runtime/shibuya/src/precompiles.rs | 9 +-
tests/ink-contracts/README.md | 2 +-
tests/ink-contracts/call_xvm_payable.json | 438 ------------
tests/ink-contracts/call_xvm_payable.wasm | Bin 13469 -> 0 bytes
tests/integration/src/lib.rs | 3 -
tests/integration/src/xvm.rs | 816 ----------------------
37 files changed, 20 insertions(+), 3747 deletions(-)
delete mode 100644 chain-extensions/types/xvm/Cargo.toml
delete mode 100644 chain-extensions/types/xvm/src/lib.rs
delete mode 100644 chain-extensions/xvm/Cargo.toml
delete mode 100644 chain-extensions/xvm/src/lib.rs
delete mode 100644 pallets/xvm/Cargo.toml
delete mode 100644 pallets/xvm/src/benchmarking.rs
delete mode 100644 pallets/xvm/src/lib.rs
delete mode 100644 pallets/xvm/src/mock.rs
delete mode 100644 pallets/xvm/src/tests.rs
delete mode 100644 pallets/xvm/src/weights.rs
delete mode 100644 precompiles/xvm/Cargo.toml
delete mode 100644 precompiles/xvm/evm_sdk/XVM.sol
delete mode 100644 precompiles/xvm/evm_sdk/flipper.sol
delete mode 100644 precompiles/xvm/src/lib.rs
delete mode 100644 precompiles/xvm/src/mock.rs
delete mode 100644 precompiles/xvm/src/tests.rs
delete mode 100644 primitives/src/xvm.rs
delete mode 100644 tests/ink-contracts/call_xvm_payable.json
delete mode 100644 tests/ink-contracts/call_xvm_payable.wasm
delete mode 100644 tests/integration/src/xvm.rs
diff --git a/Cargo.lock b/Cargo.lock
index 98c3112147..aacd4cbd09 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6508,7 +6508,6 @@ dependencies = [
"pallet-balances",
"pallet-chain-extension-assets",
"pallet-chain-extension-unified-accounts",
- "pallet-chain-extension-xvm",
"pallet-collective",
"pallet-collective-proxy",
"pallet-contracts",
@@ -6531,7 +6530,6 @@ dependencies = [
"pallet-evm-precompile-sr25519",
"pallet-evm-precompile-substrate-ecdsa",
"pallet-evm-precompile-unified-accounts",
- "pallet-evm-precompile-xvm",
"pallet-grandpa",
"pallet-inflation",
"pallet-insecure-randomness-collective-flip",
@@ -6548,7 +6546,6 @@ dependencies = [
"pallet-unified-accounts",
"pallet-utility",
"pallet-vesting",
- "pallet-xvm",
"parity-scale-codec",
"precompile-utils",
"scale-info",
@@ -8178,25 +8175,6 @@ dependencies = [
"unified-accounts-chain-extension-types",
]
-[[package]]
-name = "pallet-chain-extension-xvm"
-version = "0.1.1"
-dependencies = [
- "astar-primitives",
- "frame-support",
- "frame-system",
- "log",
- "num-traits",
- "pallet-contracts",
- "pallet-unified-accounts",
- "parity-scale-codec",
- "scale-info",
- "sp-core",
- "sp-runtime",
- "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.9.0)",
- "xvm-chain-extension-types",
-]
-
[[package]]
name = "pallet-child-bounties"
version = "27.0.0"
@@ -8851,32 +8829,6 @@ dependencies = [
"staging-xcm-executor",
]
-[[package]]
-name = "pallet-evm-precompile-xvm"
-version = "0.1.1"
-dependencies = [
- "astar-primitives",
- "derive_more",
- "fp-evm",
- "frame-support",
- "frame-system",
- "hex",
- "hex-literal",
- "log",
- "num_enum 0.5.11",
- "pallet-balances",
- "pallet-evm",
- "pallet-timestamp",
- "parity-scale-codec",
- "precompile-utils",
- "scale-info",
- "serde",
- "sp-core",
- "sp-io",
- "sp-runtime",
- "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.9.0)",
-]
-
[[package]]
name = "pallet-fast-unstake"
version = "27.0.0"
@@ -9722,33 +9674,6 @@ dependencies = [
"staging-xcm-executor",
]
-[[package]]
-name = "pallet-xvm"
-version = "0.2.2"
-dependencies = [
- "astar-primitives",
- "environmental",
- "fp-evm",
- "frame-benchmarking",
- "frame-support",
- "frame-system",
- "hex",
- "log",
- "pallet-balances",
- "pallet-contracts",
- "pallet-contracts-uapi",
- "pallet-evm",
- "pallet-insecure-randomness-collective-flip",
- "pallet-timestamp",
- "parity-scale-codec",
- "scale-info",
- "serde",
- "sp-core",
- "sp-io",
- "sp-runtime",
- "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.9.0)",
-]
-
[[package]]
name = "parachains-common"
version = "7.0.0"
@@ -14253,7 +14178,6 @@ dependencies = [
"pallet-balances",
"pallet-chain-extension-assets",
"pallet-chain-extension-unified-accounts",
- "pallet-chain-extension-xvm",
"pallet-collator-selection 3.3.2",
"pallet-collective",
"pallet-collective-proxy",
@@ -14279,7 +14203,6 @@ dependencies = [
"pallet-evm-precompile-substrate-ecdsa",
"pallet-evm-precompile-unified-accounts",
"pallet-evm-precompile-xcm",
- "pallet-evm-precompile-xvm",
"pallet-identity",
"pallet-inflation",
"pallet-insecure-randomness-collective-flip",
@@ -14302,7 +14225,6 @@ dependencies = [
"pallet-xc-asset-config",
"pallet-xcm",
"pallet-xcm-benchmarks",
- "pallet-xvm",
"parachains-common",
"parity-scale-codec",
"polkadot-parachain-primitives",
@@ -17987,17 +17909,6 @@ dependencies = [
"substrate-build-script-utils",
]
-[[package]]
-name = "xvm-chain-extension-types"
-version = "0.1.0"
-dependencies = [
- "astar-primitives",
- "parity-scale-codec",
- "scale-info",
- "sp-runtime",
- "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.9.0)",
-]
-
[[package]]
name = "yamux"
version = "0.10.2"
diff --git a/Cargo.toml b/Cargo.toml
index b2c464e763..b00ca59d0c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,6 @@ members = [
"precompiles/*",
"primitives",
"chain-extensions/pallet-assets",
- "chain-extensions/xvm",
"chain-extensions/unified-accounts",
"chain-extensions/types/*",
"vendor/evm-tracing",
@@ -284,7 +283,6 @@ pallet-collator-selection = { path = "./pallets/collator-selection", default-fea
pallet-dapp-staking-v3 = { path = "./pallets/dapp-staking-v3", default-features = false }
pallet-dapp-staking-migration = { path = "./pallets/dapp-staking-migration", default-features = false }
pallet-xc-asset-config = { path = "./pallets/xc-asset-config", default-features = false }
-pallet-xvm = { path = "./pallets/xvm", default-features = false }
pallet-ethereum-checked = { path = "./pallets/ethereum-checked", default-features = false }
pallet-inflation = { path = "./pallets/inflation", default-features = false }
pallet-dynamic-evm-base-fee = { path = "./pallets/dynamic-evm-base-fee", default-features = false }
@@ -303,16 +301,13 @@ pallet-evm-precompile-assets-erc20 = { path = "./precompiles/assets-erc20", defa
pallet-evm-precompile-sr25519 = { path = "./precompiles/sr25519", default-features = false }
pallet-evm-precompile-substrate-ecdsa = { path = "./precompiles/substrate-ecdsa", default-features = false }
pallet-evm-precompile-xcm = { path = "./precompiles/xcm", default-features = false }
-pallet-evm-precompile-xvm = { path = "./precompiles/xvm", default-features = false }
pallet-evm-precompile-dapp-staking-v3 = { path = "./precompiles/dapp-staking-v3", default-features = false }
pallet-evm-precompile-unified-accounts = { path = "./precompiles/unified-accounts", default-features = false }
pallet-evm-precompile-dispatch-lockdrop = { path = "./precompiles/dispatch-lockdrop", default-features = false }
-pallet-chain-extension-xvm = { path = "./chain-extensions/xvm", default-features = false }
pallet-chain-extension-assets = { path = "./chain-extensions/pallet-assets", default-features = false }
pallet-chain-extension-unified-accounts = { path = "./chain-extensions/unified-accounts", default-features = false }
-xvm-chain-extension-types = { path = "./chain-extensions/types/xvm", default-features = false }
assets-chain-extension-types = { path = "./chain-extensions/types/assets", default-features = false }
unified-accounts-chain-extension-types = { path = "./chain-extensions/types/unified-accounts", default-features = false }
diff --git a/chain-extensions/types/xvm/Cargo.toml b/chain-extensions/types/xvm/Cargo.toml
deleted file mode 100644
index e9888174c8..0000000000
--- a/chain-extensions/types/xvm/Cargo.toml
+++ /dev/null
@@ -1,26 +0,0 @@
-[package]
-name = "xvm-chain-extension-types"
-version = "0.1.0"
-license = "Apache-2.0"
-description = "Types definitions for contracts using xvm chain-extension."
-authors.workspace = true
-edition.workspace = true
-homepage.workspace = true
-repository.workspace = true
-
-[dependencies]
-astar-primitives = { workspace = true }
-parity-scale-codec = { workspace = true }
-scale-info = { workspace = true }
-sp-runtime = { workspace = true }
-sp-std = { workspace = true }
-
-[features]
-default = ["std"]
-std = [
- "parity-scale-codec/std",
- "scale-info/std",
- "sp-runtime/std",
- "sp-std/std",
- "astar-primitives/std",
-]
diff --git a/chain-extensions/types/xvm/src/lib.rs b/chain-extensions/types/xvm/src/lib.rs
deleted file mode 100644
index 4b6b615059..0000000000
--- a/chain-extensions/types/xvm/src/lib.rs
+++ /dev/null
@@ -1,76 +0,0 @@
-// This file is part of Astar.
-
-// Copyright (C) Stake Technologies Pte.Ltd.
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-// Astar is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Astar is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Astar. If not, see .
-
-#![cfg_attr(not(feature = "std"), no_std)]
-
-use astar_primitives::{
- xvm::{FailureError, FailureReason, FailureRevert},
- Balance,
-};
-use parity_scale_codec::{Decode, Encode};
-use sp_std::vec::Vec;
-
-#[cfg_attr(feature = "std", derive(scale_info::TypeInfo))]
-#[derive(PartialEq, Eq, Copy, Clone, Encode, Decode, Debug)]
-pub enum XvmExecutionResult {
- /// Success
- Ok,
- /// Failure
- Err(u32),
-}
-
-impl From for XvmExecutionResult {
- fn from(input: FailureReason) -> Self {
- // `0` is reserved for `Ok`
- let error_code = match input {
- // Revert failure: 1 - 127
- FailureReason::Revert(FailureRevert::InvalidTarget) => 1,
- FailureReason::Revert(FailureRevert::InputTooLarge) => 2,
- FailureReason::Revert(FailureRevert::VmRevert(_)) => 3,
-
- // Error failure: 128 - 255
- FailureReason::Error(FailureError::InvalidVmId) => 128,
- FailureReason::Error(FailureError::SameVmCallDenied) => 129,
- FailureReason::Error(FailureError::ReentranceDenied) => 130,
- FailureReason::Error(FailureError::VmError(_)) => 131,
- FailureReason::Error(FailureError::OutOfGas) => 132,
- };
- Self::Err(error_code)
- }
-}
-
-impl From for u32 {
- fn from(input: XvmExecutionResult) -> Self {
- match input {
- XvmExecutionResult::Ok => 0,
- XvmExecutionResult::Err(code) => code,
- }
- }
-}
-
-#[derive(Clone, PartialEq, Eq, Encode, Decode, Debug)]
-pub struct XvmCallArgs {
- /// virtual machine identifier
- pub vm_id: u8,
- /// Call destination (e.g. address)
- pub to: Vec,
- /// Encoded call params
- pub input: Vec,
- /// Value to transfer
- pub value: Balance,
-}
diff --git a/chain-extensions/xvm/Cargo.toml b/chain-extensions/xvm/Cargo.toml
deleted file mode 100644
index 0c79a43bd7..0000000000
--- a/chain-extensions/xvm/Cargo.toml
+++ /dev/null
@@ -1,45 +0,0 @@
-[package]
-name = "pallet-chain-extension-xvm"
-version = "0.1.1"
-license = "Apache-2.0"
-description = "Chain extension for XVM"
-authors.workspace = true
-edition.workspace = true
-homepage.workspace = true
-repository.workspace = true
-
-[dependencies]
-frame-support = { workspace = true }
-frame-system = { workspace = true }
-log = { workspace = true }
-num-traits = { workspace = true }
-pallet-contracts = { workspace = true }
-pallet-unified-accounts = { workspace = true }
-parity-scale-codec = { workspace = true }
-scale-info = { workspace = true }
-sp-core = { workspace = true }
-sp-runtime = { workspace = true }
-sp-std = { workspace = true }
-
-# Astar
-astar-primitives = { workspace = true }
-xvm-chain-extension-types = { workspace = true }
-
-[features]
-default = ["std"]
-std = [
- "parity-scale-codec/std",
- "frame-support/std",
- "frame-system/std",
- "num-traits/std",
- "pallet-contracts/std",
- "pallet-unified-accounts/std",
- "scale-info/std",
- "sp-std/std",
- "sp-core/std",
- "sp-runtime/std",
- # Astar
- "astar-primitives/std",
- "log/std",
- "xvm-chain-extension-types/std",
-]
diff --git a/chain-extensions/xvm/src/lib.rs b/chain-extensions/xvm/src/lib.rs
deleted file mode 100644
index d64ef179d6..0000000000
--- a/chain-extensions/xvm/src/lib.rs
+++ /dev/null
@@ -1,193 +0,0 @@
-// This file is part of Astar.
-
-// Copyright (C) Stake Technologies Pte.Ltd.
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-// Astar is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Astar is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Astar. If not, see .
-
-#![cfg_attr(not(feature = "std"), no_std)]
-
-extern crate alloc;
-use alloc::format;
-
-use astar_primitives::{
- evm::UnifiedAddressMapper,
- xvm::{CallFailure, Context, FailureError, VmId, XvmCall},
-};
-use frame_support::weights::Weight;
-use frame_system::RawOrigin;
-use pallet_contracts::chain_extension::{
- ChainExtension, Environment, Ext, InitState, RetVal, ReturnFlags,
-};
-use pallet_unified_accounts::WeightInfo;
-use parity_scale_codec::Encode;
-use sp_runtime::DispatchError;
-use sp_std::marker::PhantomData;
-use xvm_chain_extension_types::{XvmCallArgs, XvmExecutionResult};
-
-enum XvmFuncId {
- Call,
-}
-
-impl TryFrom for XvmFuncId {
- type Error = DispatchError;
-
- fn try_from(value: u16) -> Result {
- match value {
- 1 => Ok(XvmFuncId::Call),
- _ => Err(DispatchError::Other(
- "Unsupported func id in Xvm chain extension",
- )),
- }
- }
-}
-
-/// XVM chain extension.
-pub struct XvmExtension(PhantomData<(T, XC, UA)>);
-
-impl Default for XvmExtension {
- fn default() -> Self {
- XvmExtension(PhantomData)
- }
-}
-
-impl ChainExtension for XvmExtension
-where
- T: pallet_contracts::Config + pallet_unified_accounts::Config,
- XC: XvmCall,
- UA: UnifiedAddressMapper,
-{
- fn call(&mut self, env: Environment) -> Result
- where
- E: Ext,
- {
- let func_id = env.func_id().try_into()?;
- let mut env = env.buf_in_buf_out();
-
- match func_id {
- XvmFuncId::Call => {
- // We need to immediately charge for the worst case scenario. Gas equals Weight in pallet-contracts context.
- let weight_limit = env.ext().gas_meter().gas_left();
- let charged_weight = env.charge_weight(weight_limit)?;
-
- let XvmCallArgs {
- vm_id,
- to,
- input,
- value,
- } = env.read_as_unbounded(env.in_len())?;
-
- // Similar to EVM behavior, the `source` should be (limited to) the
- // contract address. Otherwise contracts would be able to do arbitrary
- // things on behalf of the caller via XVM.
- let source = env.ext().address().clone();
-
- // Claim the default evm address if needed.
- let mut actual_weight = Weight::zero();
- if value > 0 {
- // `UA::to_h160`.
- actual_weight.saturating_accrue(
- ::WeightInfo::to_h160(),
- );
-
- if actual_weight.any_gt(weight_limit) {
- return out_of_gas_err(actual_weight);
- }
-
- if UA::to_h160(&source).is_none() {
- let weight_of_claim = ::WeightInfo::claim_default_evm_address();
- actual_weight.saturating_accrue(weight_of_claim);
- if actual_weight.any_gt(weight_limit) {
- return out_of_gas_err(actual_weight);
- }
-
- let claim_result =
- pallet_unified_accounts::Pallet::::claim_default_evm_address(
- RawOrigin::Signed(source.clone()).into(),
- );
- if claim_result.is_err() {
- return Ok(RetVal::Diverging {
- flags: ReturnFlags::REVERT,
- data: format!("{:?}", claim_result.err()).into(),
- });
- }
- }
- }
-
- let xvm_context = Context {
- source_vm_id: VmId::Wasm,
- // Weight limit left for XVM call.
- weight_limit: weight_limit.saturating_sub(actual_weight),
- };
- let vm_id = {
- match TryInto::::try_into(vm_id) {
- Ok(id) => id,
- Err(err) => {
- return Ok(RetVal::Diverging {
- flags: ReturnFlags::REVERT,
- data: format!("{:?}", err).into(),
- });
- }
- }
- };
- let call_result = XC::call(xvm_context, vm_id, source, to, input, value, None);
-
- let used_weight = match call_result {
- Ok(ref info) => info.used_weight,
- Err(ref err) => err.used_weight,
- };
- actual_weight.saturating_accrue(used_weight);
- env.adjust_weight(charged_weight, actual_weight);
-
- match call_result {
- Ok(info) => {
- log::trace!(
- target: "xvm-extension::xvm_call",
- "info: {:?}", info
- );
-
- let buffer: sp_std::vec::Vec<_> = info.output.encode();
- env.write(&buffer, false, None)?;
- Ok(RetVal::Converging(XvmExecutionResult::Ok.into()))
- }
-
- Err(err) => {
- log::trace!(
- target: "xvm-extension::xvm_call",
- "err: {:?}", err
- );
-
- // `Diverging` is used instead of `Err` to make sure the control
- // doesn't return to the caller.
- Ok(RetVal::Diverging {
- flags: ReturnFlags::REVERT,
- data: format!("{:?}", err).into(),
- })
- }
- }
- }
- }
- }
-}
-
-fn out_of_gas_err(actual_weight: Weight) -> Result {
- Ok(RetVal::Diverging {
- flags: ReturnFlags::REVERT,
- data: format!(
- "{:?}",
- CallFailure::error(FailureError::OutOfGas, actual_weight)
- )
- .into(),
- })
-}
diff --git a/pallets/ethereum-checked/src/lib.rs b/pallets/ethereum-checked/src/lib.rs
index 2585278a12..e0c9b96d81 100644
--- a/pallets/ethereum-checked/src/lib.rs
+++ b/pallets/ethereum-checked/src/lib.rs
@@ -21,7 +21,7 @@
//! ## Overview
//!
//! A `pallet-ethereum like pallet that execute transactions from checked source,
-//! like XCM remote call, cross-VM call, etc. Only `Call` transactions are supported
+//! like XCM remote call. Only `Call` transactions are supported
//! (no `Create`).
//!
//! The checked source guarantees that transactions are valid with prior checks, so these
@@ -36,10 +36,6 @@
//! - `transact`: transact an Ethereum transaction. Similar to `pallet_ethereum::Transact`,
//! but is only for XCM remote call.
//!
-//! ### Implementation
-//!
-//! - Implements `CheckedEthereumTransact` trait.
-//!
#![cfg_attr(not(feature = "std"), no_std)]
@@ -64,10 +60,7 @@ use sp_runtime::traits::TrailingZeroInput;
use sp_runtime::traits::UniqueSaturatedInto;
use sp_std::{marker::PhantomData, result::Result};
-use astar_primitives::{
- ethereum_checked::{CheckedEthereumTransact, CheckedEthereumTx},
- evm::UnifiedAddressMapper,
-};
+use astar_primitives::{ethereum_checked::CheckedEthereumTx, evm::UnifiedAddressMapper};
pub use pallet::*;
@@ -116,8 +109,6 @@ impl, O>> + From>, Acco
pub enum CheckedEthereumTxKind {
/// The tx is from XCM remote call.
Xcm,
- /// The tx is from cross-VM call.
- Xvm,
}
#[frame_support::pallet]
@@ -132,9 +123,6 @@ pub mod pallet {
/// Reserved Xcmp weight for block gas limit calculation.
type ReservedXcmpWeight: Get;
- /// Xcm transaction weight limit, for block gas limit calculation.
- type XvmTxWeightLimit: Get;
-
/// Invalid tx error.
type InvalidEvmTransactionError: From;
@@ -270,7 +258,6 @@ impl Pallet {
fn block_gas_limit(tx_kind: &CheckedEthereumTxKind) -> u64 {
let weight_limit = match tx_kind {
CheckedEthereumTxKind::Xcm => T::ReservedXcmpWeight::get(),
- CheckedEthereumTxKind::Xvm => T::XvmTxWeightLimit::get(),
};
T::GasWeightMapping::weight_to_gas(weight_limit)
}
@@ -292,12 +279,3 @@ impl Pallet {
.map(|(post_info, _)| post_info)
}
}
-
-impl CheckedEthereumTransact for Pallet {
- fn xvm_transact(
- source: H160,
- checked_tx: CheckedEthereumTx,
- ) -> Result<(PostDispatchInfo, CallInfo), DispatchErrorWithPostInfo> {
- Self::do_transact(source, checked_tx, CheckedEthereumTxKind::Xvm, false)
- }
-}
diff --git a/pallets/ethereum-checked/src/mock.rs b/pallets/ethereum-checked/src/mock.rs
index 23464c97c1..fc68a7231a 100644
--- a/pallets/ethereum-checked/src/mock.rs
+++ b/pallets/ethereum-checked/src/mock.rs
@@ -206,7 +206,6 @@ parameter_types! {
impl pallet_ethereum_checked::Config for TestRuntime {
type ReservedXcmpWeight = TxWeightLimit;
- type XvmTxWeightLimit = TxWeightLimit;
type InvalidEvmTransactionError = pallet_ethereum::InvalidTransactionWrapper;
type ValidatedTransaction = pallet_ethereum::ValidatedTransaction;
type AddressMapper = MockAddressMapper;
diff --git a/pallets/ethereum-checked/src/tests.rs b/pallets/ethereum-checked/src/tests.rs
index 8193b41cba..4eaa356063 100644
--- a/pallets/ethereum-checked/src/tests.rs
+++ b/pallets/ethereum-checked/src/tests.rs
@@ -23,7 +23,6 @@ use mock::*;
use astar_primitives::ethereum_checked::EthereumTxInput;
use ethereum::{ReceiptV3 as Receipt, TransactionV2 as Transaction};
-pub use fp_rpc::TransactionStatus;
use frame_support::{assert_noop, assert_ok};
use sp_runtime::DispatchError;
@@ -73,18 +72,6 @@ fn transact_works() {
_ => panic!("unexpected transaction type"),
}
assert_eq!(Nonce::::get(), U256::from(2));
-
- let retrieve_tx = CheckedEthereumTx {
- gas_limit: U256::from(1_000_000),
- target: contract_address(),
- value: U256::zero(),
- // Calling `retrieve`
- input: bounded_input("2e64cec1"),
- maybe_access_list: None,
- };
- let (_, call_info) =
- EthereumChecked::xvm_transact(ALICE_H160, retrieve_tx).expect("failed to retrieve");
- assert_eq!(U256::from_big_endian(&(call_info.value)), 3.into());
});
}
@@ -134,14 +121,6 @@ fn no_hash_collision() {
RawOrigin::XcmEthereumTx(ALICE).into(),
store_tx.clone()
));
- assert_ok!(::xvm_transact(
- BOB_H160,
- store_tx.clone()
- ));
- assert_ok!(::xvm_transact(
- CHARLIE_H160,
- store_tx.clone()
- ));
}
let mut tx_hashes = pallet_ethereum::Pending::::get()
@@ -149,6 +128,6 @@ fn no_hash_collision() {
.map(|(tx, _, _)| tx.hash())
.collect::>();
tx_hashes.dedup();
- assert_eq!(tx_hashes.len(), 15);
+ assert_eq!(tx_hashes.len(), 5);
});
}
diff --git a/pallets/xvm/Cargo.toml b/pallets/xvm/Cargo.toml
deleted file mode 100644
index 50b68addb6..0000000000
--- a/pallets/xvm/Cargo.toml
+++ /dev/null
@@ -1,83 +0,0 @@
-[package]
-name = "pallet-xvm"
-version = "0.2.2"
-authors.workspace = true
-edition.workspace = true
-homepage.workspace = true
-repository.workspace = true
-
-[dependencies]
-environmental = { workspace = true }
-log = { workspace = true }
-serde = { workspace = true, optional = true }
-
-# Substrate
-frame-support = { workspace = true }
-frame-system = { workspace = true }
-parity-scale-codec = { workspace = true }
-scale-info = { workspace = true }
-sp-core = { workspace = true }
-sp-runtime = { workspace = true }
-sp-std = { workspace = true }
-
-# Benchmarks
-frame-benchmarking = { workspace = true, optional = true }
-
-# EVM
-fp-evm = { workspace = true }
-pallet-evm = { workspace = true }
-
-# Substrate WASM VM support
-pallet-contracts = { workspace = true }
-pallet-contracts-uapi = { workspace = true }
-
-# Astar
-astar-primitives = { workspace = true }
-
-[dev-dependencies]
-hex = { workspace = true }
-pallet-balances = { workspace = true, features = ["std"] }
-pallet-insecure-randomness-collective-flip = { workspace = true, features = ["std"] }
-pallet-timestamp = { workspace = true, features = ["std"] }
-sp-io = { workspace = true }
-
-[features]
-default = ["std"]
-std = [
- "environmental/std",
- "log/std",
- "parity-scale-codec/std",
- "fp-evm/std",
- "frame-support/std",
- "frame-system/std",
- "pallet-contracts/std",
- "pallet-evm/std",
- "pallet-insecure-randomness-collective-flip/std",
- "scale-info/std",
- "serde",
- "sp-core/std",
- "sp-runtime/std",
- "sp-std/std",
- "astar-primitives/std",
- "frame-benchmarking?/std",
- "serde?/std",
-]
-
-runtime-benchmarks = [
- "frame-benchmarking",
- "astar-primitives/runtime-benchmarks",
- "frame-benchmarking/runtime-benchmarks",
- "frame-support/runtime-benchmarks",
- "frame-system/runtime-benchmarks",
- "pallet-contracts/runtime-benchmarks",
- "pallet-evm/runtime-benchmarks",
- "sp-runtime/runtime-benchmarks",
-]
-try-runtime = [
- "frame-support/try-runtime",
- "pallet-contracts/try-runtime",
- "pallet-evm/try-runtime",
- "astar-primitives/try-runtime",
- "frame-system/try-runtime",
- "sp-runtime/try-runtime",
-]
diff --git a/pallets/xvm/src/benchmarking.rs b/pallets/xvm/src/benchmarking.rs
deleted file mode 100644
index 5b7fe5f057..0000000000
--- a/pallets/xvm/src/benchmarking.rs
+++ /dev/null
@@ -1,88 +0,0 @@
-// This file is part of Astar.
-
-// Copyright (C) Stake Technologies Pte.Ltd.
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-// Astar is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Astar is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Astar. If not, see .
-
-use super::*;
-
-use frame_benchmarking::v2::*;
-use frame_support::weights::Weight;
-use parity_scale_codec::Encode;
-use sp_core::H160;
-use sp_runtime::MultiAddress;
-
-use astar_primitives::Balance;
-
-#[benchmarks(
- where ::Currency: Inspect,
-)]
-mod benchmarks {
- use super::*;
-
- #[benchmark]
- fn evm_call_overheads() {
- let context = Context {
- source_vm_id: VmId::Wasm,
- weight_limit: Weight::from_parts(1_000_000, 1_000_000),
- };
- let vm_id = VmId::Evm;
- let source = whitelisted_caller();
- let target = H160::repeat_byte(1).encode();
- let input = vec![1, 2, 3];
- let value = 1_000_000u128;
-
- #[block]
- {
- Pallet::::call_without_execution(context, vm_id, source, target, input, value, None)
- .unwrap();
- }
- }
-
- #[benchmark]
- fn wasm_call_overheads() {
- let context = Context {
- source_vm_id: VmId::Evm,
- weight_limit: Weight::from_parts(1_000_000, 1_000_000),
- };
- let vm_id = VmId::Wasm;
- let source = whitelisted_caller();
- let target = MultiAddress::::Id(whitelisted_caller()).encode();
- let input = vec![1, 2, 3];
- let value = 1_000_000u128;
-
- #[block]
- {
- Pallet::::call_without_execution(context, vm_id, source, target, input, value, None)
- .unwrap();
- }
- }
-
- impl_benchmark_test_suite!(
- Pallet,
- crate::benchmarking::tests::new_test_ext(),
- crate::mock::TestRuntime,
- );
-}
-
-#[cfg(test)]
-mod tests {
- use crate::mock;
- use sp_io::TestExternalities;
-
- pub fn new_test_ext() -> TestExternalities {
- mock::ExtBuilder::default().build()
- }
-}
diff --git a/pallets/xvm/src/lib.rs b/pallets/xvm/src/lib.rs
deleted file mode 100644
index b9e21af88d..0000000000
--- a/pallets/xvm/src/lib.rs
+++ /dev/null
@@ -1,353 +0,0 @@
-// This file is part of Astar.
-
-// Copyright (C) Stake Technologies Pte.Ltd.
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-// Astar is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Astar is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Astar. If not, see .
-
-//! # XVM pallet
-//!
-//! A module to provide
-//!
-//! ## Overview
-//!
-//! The XVM pallet provides a runtime interface to call different VMs. It currently
-//! supports two VMs: EVM and WASM. With further development, more VMs can be added.
-//!
-//! Together with other functionalities like Chain Extension and precompiles,
-//! the XVM pallet enables the runtime to support cross-VM calls.
-//!
-//! ## Interface
-//!
-//! ### Implementation
-//!
-//! - Implements `XvmCall` trait.
-//!
-
-#![cfg_attr(not(feature = "std"), no_std)]
-
-extern crate alloc;
-use alloc::format;
-
-use fp_evm::ExitReason;
-use frame_support::{ensure, traits::fungible::Inspect, weights::Weight};
-use pallet_contracts::{CollectEvents, DebugInfo, Determinism};
-use pallet_contracts_uapi::ReturnFlags;
-use pallet_evm::GasWeightMapping;
-use parity_scale_codec::Decode;
-use sp_core::{H160, U256};
-use sp_std::{marker::PhantomData, prelude::*};
-
-use astar_primitives::{
- ethereum_checked::{CheckedEthereumTransact, CheckedEthereumTx, EthereumTxInput},
- evm::UnifiedAddressMapper,
- xvm::{
- CallFailure, CallOutput, CallResult, Context, FailureError::*, FailureRevert::*, VmId,
- XvmCall,
- },
- Balance,
-};
-
-#[cfg(feature = "runtime-benchmarks")]
-mod benchmarking;
-
-pub mod weights;
-pub use weights::WeightInfo;
-
-mod mock;
-mod tests;
-
-pub use pallet::*;
-
-pub type WeightInfoOf = ::WeightInfo;
-
-environmental::thread_local_impl!(static IN_XVM: environmental::RefCell = environmental::RefCell::new(false));
-
-#[frame_support::pallet]
-pub mod pallet {
- use super::*;
-
- #[pallet::pallet]
- pub struct Pallet(PhantomData);
-
- #[pallet::config]
- pub trait Config: frame_system::Config + pallet_contracts::Config {
- /// Mapping from `Account` to `H160`.
- type AddressMapper: UnifiedAddressMapper;
-
- /// Mapping from Ethereum gas to Substrate weight.
- type GasWeightMapping: GasWeightMapping;
-
- /// `CheckedEthereumTransact` implementation.
- type EthereumTransact: CheckedEthereumTransact;
-
- /// Weight information for extrinsics in this pallet.
- type WeightInfo: WeightInfo;
- }
-}
-
-impl XvmCall for Pallet
-where
- T: Config,
- T::Currency: Inspect,
-{
- fn call(
- context: Context,
- vm_id: VmId,
- source: T::AccountId,
- target: Vec,
- input: Vec,
- value: Balance,
- storage_deposit_limit: Option,
- ) -> CallResult {
- Pallet::::do_call(
- context,
- vm_id,
- source,
- target,
- input,
- value,
- storage_deposit_limit,
- false,
- )
- }
-}
-
-impl Pallet
-where
- T: Config,
- T::Currency: Inspect,
-{
- fn do_call(
- context: Context,
- vm_id: VmId,
- source: T::AccountId,
- target: Vec,
- input: Vec,
- value: Balance,
- storage_deposit_limit: Option,
- skip_execution: bool,
- ) -> CallResult {
- let overheads = match vm_id {
- VmId::Evm => WeightInfoOf::::evm_call_overheads(),
- VmId::Wasm => WeightInfoOf::::wasm_call_overheads(),
- };
-
- ensure!(
- context.source_vm_id != vm_id,
- CallFailure::error(SameVmCallDenied, overheads)
- );
-
- // Set `IN_XVM` to true & check reentrance.
- if IN_XVM.with(|in_xvm| in_xvm.replace(true)) {
- return Err(CallFailure::error(ReentranceDenied, overheads));
- }
-
- let res = match vm_id {
- VmId::Evm => Pallet::::evm_call(
- context,
- source,
- target,
- input,
- value,
- overheads,
- skip_execution,
- ),
- VmId::Wasm => Pallet::::wasm_call(
- context,
- source,
- target,
- input,
- value,
- overheads,
- storage_deposit_limit,
- skip_execution,
- ),
- };
-
- // Set `IN_XVM` to false.
- // We should make sure that this line is executed whatever the execution path.
- let _ = IN_XVM.with(|in_xvm| in_xvm.take());
-
- res
- }
-
- fn evm_call(
- context: Context,
- source: T::AccountId,
- target: Vec,
- input: Vec,
- value: Balance,
- overheads: Weight,
- skip_execution: bool,
- ) -> CallResult {
- log::trace!(
- target: "xvm::evm_call",
- "Calling EVM: {:?} {:?}, {:?}, {:?}, {:?}",
- context, source, target, input, value,
- );
-
- ensure!(
- target.len() == H160::len_bytes(),
- CallFailure::revert(InvalidTarget, overheads)
- );
- let target_decoded = Decode::decode(&mut target.as_ref())
- .map_err(|_| CallFailure::revert(InvalidTarget, overheads))?;
- let bounded_input = EthereumTxInput::try_from(input)
- .map_err(|_| CallFailure::revert(InputTooLarge, overheads))?;
-
- let value_u256 = U256::from(value);
- // With overheads, less weight is available.
- let weight_limit = context.weight_limit.saturating_sub(overheads);
- let gas_limit = U256::from(T::GasWeightMapping::weight_to_gas(weight_limit));
-
- let source = T::AddressMapper::to_h160_or_default(&source).into_address();
- let tx = CheckedEthereumTx {
- gas_limit,
- target: target_decoded,
- value: value_u256,
- input: bounded_input,
- maybe_access_list: None,
- };
-
- // Note the skip execution check should be exactly before `T::EthereumTransact::xvm_transact`
- // to benchmark the correct overheads.
- if skip_execution {
- return Ok(CallOutput::new(vec![], overheads));
- }
-
- let transact_result = T::EthereumTransact::xvm_transact(source, tx);
- log::trace!(
- target: "xvm::evm_call",
- "EVM call result: {:?}", transact_result,
- );
-
- match transact_result {
- Ok((post_dispatch_info, call_info)) => {
- let used_weight = post_dispatch_info
- .actual_weight
- .unwrap_or_default()
- .saturating_add(overheads);
- match call_info.exit_reason {
- ExitReason::Succeed(_) => Ok(CallOutput::new(call_info.value, used_weight)),
- ExitReason::Revert(_) => {
- // On revert, the `call_info.value` is the encoded error data. Refer to Contract
- // ABI specification for details. https://docs.soliditylang.org/en/latest/abi-spec.html#errors
- Err(CallFailure::revert(VmRevert(call_info.value), used_weight))
- }
- ExitReason::Error(err) => Err(CallFailure::error(
- VmError(format!("EVM call error: {:?}", err).into()),
- used_weight,
- )),
- ExitReason::Fatal(err) => Err(CallFailure::error(
- VmError(format!("EVM call error: {:?}", err).into()),
- used_weight,
- )),
- }
- }
- Err(e) => {
- let used_weight = e
- .post_info
- .actual_weight
- .unwrap_or_default()
- .saturating_add(overheads);
- Err(CallFailure::error(
- VmError(format!("EVM call error: {:?}", e.error).into()),
- used_weight,
- ))
- }
- }
- }
-
- fn wasm_call(
- context: Context,
- source: T::AccountId,
- target: Vec,
- input: Vec,
- value: Balance,
- overheads: Weight,
- storage_deposit_limit: Option,
- skip_execution: bool,
- ) -> CallResult {
- log::trace!(
- target: "xvm::wasm_call",
- "Calling WASM: {:?} {:?}, {:?}, {:?}, {:?}, {:?}",
- context, source, target, input, value, storage_deposit_limit,
- );
-
- let dest = {
- let error = CallFailure::revert(InvalidTarget, overheads);
- Decode::decode(&mut target.as_ref()).map_err(|_| error.clone())
- }?;
-
- // With overheads, less weight is available.
- let weight_limit = context.weight_limit.saturating_sub(overheads);
-
- // Note the skip execution check should be exactly before `pallet_contracts::bare_call`
- // to benchmark the correct overheads.
- if skip_execution {
- return Ok(CallOutput::new(vec![], overheads));
- }
-
- let call_result = pallet_contracts::Pallet::::bare_call(
- source,
- dest,
- value,
- weight_limit,
- storage_deposit_limit,
- input,
- DebugInfo::Skip,
- CollectEvents::Skip,
- Determinism::Enforced,
- );
- log::trace!(target: "xvm::wasm_call", "WASM call result: {:?}", call_result);
-
- let used_weight = call_result.gas_consumed.saturating_add(overheads);
- match call_result.result {
- Ok(val) => {
- if val.flags.contains(ReturnFlags::REVERT) {
- Err(CallFailure::revert(VmRevert(val.data), used_weight))
- } else {
- Ok(CallOutput::new(val.data, used_weight))
- }
- }
- Err(error) => Err(CallFailure::error(
- VmError(format!("WASM call error: {:?}", error).into()),
- used_weight,
- )),
- }
- }
-
- #[cfg(feature = "runtime-benchmarks")]
- pub fn call_without_execution(
- context: Context,
- vm_id: VmId,
- source: T::AccountId,
- target: Vec,
- input: Vec,
- value: Balance,
- storage_deposit_limit: Option,
- ) -> CallResult {
- Self::do_call(
- context,
- vm_id,
- source,
- target,
- input,
- value,
- storage_deposit_limit,
- true,
- )
- }
-}
diff --git a/pallets/xvm/src/mock.rs b/pallets/xvm/src/mock.rs
deleted file mode 100644
index e35927a86e..0000000000
--- a/pallets/xvm/src/mock.rs
+++ /dev/null
@@ -1,233 +0,0 @@
-// This file is part of Astar.
-
-// Copyright (C) Stake Technologies Pte.Ltd.
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-// Astar is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Astar is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Astar. If not, see .
-
-#![cfg(test)]
-
-use super::*;
-use crate as pallet_xvm;
-
-use astar_primitives::evm::HashedDefaultMappings;
-use fp_evm::{CallInfo as EvmCallInfo, ExitReason, ExitSucceed, UsedGas};
-use frame_support::{
- construct_runtime,
- dispatch::{DispatchErrorWithPostInfo, PostDispatchInfo},
- pallet_prelude::*,
- parameter_types,
- traits::{ConstBool, ConstU128, ConstU64, Nothing},
-};
-use frame_system::EnsureSigned;
-use sp_core::{H160, H256};
-use sp_io::TestExternalities;
-use sp_runtime::{
- traits::{AccountIdLookup, BlakeTwo256},
- AccountId32, BuildStorage, Perbill,
-};
-use sp_std::cell::RefCell;
-
-parameter_types! {
- pub BlockWeights: frame_system::limits::BlockWeights =
- frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0));
-}
-
-impl frame_system::Config for TestRuntime {
- type BaseCallFilter = frame_support::traits::Everything;
- type BlockWeights = ();
- type BlockLength = ();
- type RuntimeOrigin = RuntimeOrigin;
- type Nonce = u64;
- type RuntimeCall = RuntimeCall;
- type Block = Block;
- type Hash = H256;
- type Hashing = BlakeTwo256;
- type AccountId = AccountId;
- type Lookup = AccountIdLookup;
- type RuntimeEvent = RuntimeEvent;
- type BlockHashCount = ConstU64<250>;
- type DbWeight = ();
- type Version = ();
- type PalletInfo = PalletInfo;
- type AccountData = pallet_balances::AccountData;
- type OnNewAccount = ();
- type OnKilledAccount = ();
- type SystemWeightInfo = ();
- type SS58Prefix = ();
- type OnSetCode = ();
- type MaxConsumers = frame_support::traits::ConstU32<16>;
- type RuntimeTask = RuntimeTask;
- type SingleBlockMigrations = ();
- type MultiBlockMigrator = ();
- type PreInherents = ();
- type PostInherents = ();
- type PostTransactions = ();
-}
-
-impl pallet_balances::Config for TestRuntime {
- type MaxLocks = ConstU32<4>;
- type MaxReserves = ();
- type ReserveIdentifier = [u8; 8];
- type Balance = Balance;
- type RuntimeEvent = RuntimeEvent;
- type DustRemoval = ();
- type ExistentialDeposit = ConstU128<2>;
- type AccountStore = System;
- type WeightInfo = ();
- type RuntimeHoldReason = RuntimeHoldReason;
- type FreezeIdentifier = ();
- type RuntimeFreezeReason = ();
- type MaxFreezes = ConstU32<0>;
-}
-
-impl pallet_timestamp::Config for TestRuntime {
- type Moment = u64;
- type OnTimestampSet = ();
- type MinimumPeriod = ConstU64<3>;
- type WeightInfo = ();
-}
-
-impl pallet_insecure_randomness_collective_flip::Config for TestRuntime {}
-
-parameter_types! {
- pub const DepositPerItem: Balance = 1_000;
- pub const DepositPerByte: Balance = 1_000;
- pub const DefaultDepositLimit: Balance = 1_000;
- pub const MaxDelegateDependencies: u32 = 32;
- pub const CodeHashLockupDepositPercent: Perbill = Perbill::from_percent(10);
- pub Schedule: pallet_contracts::Schedule = Default::default();
-}
-
-impl pallet_contracts::Config for TestRuntime {
- type Time = Timestamp;
- type Randomness = RandomnessCollectiveFlip;
- type Currency = Balances;
- type RuntimeEvent = RuntimeEvent;
- type RuntimeCall = RuntimeCall;
- type RuntimeHoldReason = RuntimeHoldReason;
- type CallFilter = Nothing;
- type DepositPerItem = DepositPerItem;
- type DepositPerByte = DepositPerByte;
- type DefaultDepositLimit = DefaultDepositLimit;
- type CallStack = [pallet_contracts::Frame; 5];
- type WeightPrice = ();
- type WeightInfo = pallet_contracts::weights::SubstrateWeight;
- type ChainExtension = ();
- type Schedule = Schedule;
- type AddressGenerator = pallet_contracts::DefaultAddressGenerator;
- type MaxCodeLen = ConstU32<{ 123 * 1024 }>;
- type MaxStorageKeyLen = ConstU32<128>;
- type UnsafeUnstableInterface = ConstBool;
- type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>;
- type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent;
- type MaxDelegateDependencies = MaxDelegateDependencies;
- type Migrations = ();
- type Debug = ();
- type Environment = ();
- type Xcm = ();
- type UploadOrigin = EnsureSigned;
- type InstantiateOrigin = EnsureSigned;
- type ApiVersion = ();
-}
-
-thread_local! {
- static TRANSACTED: RefCell