diff --git a/Cargo.lock b/Cargo.lock index 17e46a698..779703674 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -819,7 +819,6 @@ dependencies = [ "pallet-evm-precompile-bn128", "pallet-evm-precompile-dapp-staking", "pallet-evm-precompile-dispatch", - "pallet-evm-precompile-dispatch-lockdrop", "pallet-evm-precompile-ed25519", "pallet-evm-precompile-modexp", "pallet-evm-precompile-sha3fips", @@ -15139,7 +15138,6 @@ dependencies = [ "pallet-evm-precompile-bn128", "pallet-evm-precompile-dapp-staking", "pallet-evm-precompile-dispatch", - "pallet-evm-precompile-dispatch-lockdrop", "pallet-evm-precompile-ed25519", "pallet-evm-precompile-modexp", "pallet-evm-precompile-sha3fips", @@ -15253,7 +15251,6 @@ dependencies = [ "pallet-evm-precompile-bn128", "pallet-evm-precompile-dapp-staking", "pallet-evm-precompile-dispatch", - "pallet-evm-precompile-dispatch-lockdrop", "pallet-evm-precompile-ed25519", "pallet-evm-precompile-modexp", "pallet-evm-precompile-sha3fips", diff --git a/runtime/astar/Cargo.toml b/runtime/astar/Cargo.toml index b23953844..e7395cb15 100644 --- a/runtime/astar/Cargo.toml +++ b/runtime/astar/Cargo.toml @@ -125,7 +125,6 @@ pallet-collective-proxy = { workspace = true } pallet-dapp-staking = { workspace = true } pallet-evm-precompile-assets-erc20 = { workspace = true } pallet-evm-precompile-dapp-staking = { workspace = true } -pallet-evm-precompile-dispatch-lockdrop = { workspace = true } pallet-evm-precompile-sr25519 = { workspace = true } pallet-evm-precompile-substrate-ecdsa = { workspace = true } pallet-evm-precompile-xcm = { workspace = true } @@ -193,7 +192,6 @@ std = [ "pallet-evm-precompile-blake2/std", "pallet-evm-precompile-bn128/std", "pallet-evm-precompile-dapp-staking/std", - "pallet-evm-precompile-dispatch-lockdrop/std", "pallet-evm-precompile-dispatch/std", "pallet-evm-precompile-ed25519/std", "pallet-evm-precompile-modexp/std", diff --git a/runtime/astar/src/precompiles.rs b/runtime/astar/src/precompiles.rs index 25f1ad0c3..09b6c4ef7 100644 --- a/runtime/astar/src/precompiles.rs +++ b/runtime/astar/src/precompiles.rs @@ -26,7 +26,6 @@ use pallet_evm_precompile_blake2::Blake2F; use pallet_evm_precompile_bn128::{Bn128Add, Bn128Mul, Bn128Pairing}; use pallet_evm_precompile_dapp_staking::DappStakingV3Precompile; use pallet_evm_precompile_dispatch::Dispatch; -use pallet_evm_precompile_dispatch_lockdrop::DispatchLockdrop; use pallet_evm_precompile_ed25519::Ed25519Verify; use pallet_evm_precompile_modexp::Modexp; use pallet_evm_precompile_sha3fips::Sha3FIPS256; @@ -35,7 +34,6 @@ use pallet_evm_precompile_sr25519::Sr25519Precompile; use pallet_evm_precompile_substrate_ecdsa::SubstrateEcdsaPrecompile; use pallet_evm_precompile_xcm::XcmPrecompile; use precompile_utils::precompile_set::*; -use sp_core::ConstU32; use sp_std::fmt::Debug; /// The asset precompile address prefix. Addresses that match against this prefix will be routed @@ -73,27 +71,6 @@ impl Contains for WhitelistedCalls { } } -/// Filter that only allows whitelisted runtime call to pass through dispatch-lockdrop precompile -pub struct WhitelistedLockdropCalls; - -impl Contains for WhitelistedLockdropCalls { - fn contains(t: &RuntimeCall) -> bool { - match t { - RuntimeCall::Utility(pallet_utility::Call::batch { calls }) - | RuntimeCall::Utility(pallet_utility::Call::batch_all { calls }) => calls - .iter() - .all(|call| WhitelistedLockdropCalls::contains(call)), - RuntimeCall::DappStaking(pallet_dapp_staking::Call::unbond_and_unstake { .. }) => true, - RuntimeCall::DappStaking(pallet_dapp_staking::Call::withdraw_unbonded { .. }) => true, - RuntimeCall::Balances(pallet_balances::Call::transfer_all { .. }) => true, - RuntimeCall::Balances(pallet_balances::Call::transfer_keep_alive { .. }) => true, - RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death { .. }) => true, - RuntimeCall::Assets(pallet_assets::Call::transfer { .. }) => true, - _ => false, - } - } -} - /// The PrecompileSet installed in the Astar runtime. #[precompile_utils::precompile_name_from_address] pub type AstarPrecompilesSetAt = ( @@ -148,18 +125,6 @@ pub type AstarPrecompilesSetAt = ( CallableByPrecompile, ), >, - // Skipping 20485 and 20486 to make sure all network have consistent - // precompiles address - PrecompileAt< - AddressU64<20487>, - DispatchLockdrop< - R, - DispatchFilterValidate, - ConstU32<8>, - >, - // Not callable from smart contract nor precompiled, only EOA accounts - (), - >, ); pub type AstarPrecompiles = PrecompileSetBuilder< @@ -168,7 +133,7 @@ pub type AstarPrecompiles = PrecompileSetBuilder< // Skip precompiles if out of range. PrecompilesInRangeInclusive< // We take range as last precompile index, UPDATE this once new prcompile is added - (AddressU64<1>, AddressU64<20487>), + (AddressU64<1>, AddressU64<20484>), AstarPrecompilesSetAt, >, // Prefixed precompile sets (XC20) diff --git a/runtime/shibuya/Cargo.toml b/runtime/shibuya/Cargo.toml index 404d65e11..443e3c74b 100644 --- a/runtime/shibuya/Cargo.toml +++ b/runtime/shibuya/Cargo.toml @@ -117,7 +117,6 @@ pallet-dapp-staking = { workspace = true } pallet-dynamic-evm-base-fee = { workspace = true } pallet-evm-precompile-assets-erc20 = { workspace = true } pallet-evm-precompile-dapp-staking = { workspace = true } -pallet-evm-precompile-dispatch-lockdrop = { workspace = true } pallet-evm-precompile-sr25519 = { workspace = true } pallet-evm-precompile-substrate-ecdsa = { workspace = true } pallet-evm-precompile-xcm = { workspace = true } @@ -193,7 +192,6 @@ std = [ "pallet-evm-precompile-blake2/std", "pallet-evm-precompile-bn128/std", "pallet-evm-precompile-dapp-staking/std", - "pallet-evm-precompile-dispatch-lockdrop/std", "pallet-evm-precompile-dispatch/std", "pallet-evm-precompile-ed25519/std", "pallet-evm-precompile-modexp/std", diff --git a/runtime/shibuya/src/precompiles.rs b/runtime/shibuya/src/precompiles.rs index a59777b41..7c31b7dbb 100644 --- a/runtime/shibuya/src/precompiles.rs +++ b/runtime/shibuya/src/precompiles.rs @@ -20,14 +20,12 @@ use crate::{Runtime, RuntimeCall}; use astar_primitives::precompiles::DispatchFilterValidate; -use frame_support::traits::ConstU32; use frame_support::{parameter_types, traits::Contains}; use pallet_evm_precompile_assets_erc20::Erc20AssetsPrecompileSet; use pallet_evm_precompile_blake2::Blake2F; use pallet_evm_precompile_bn128::{Bn128Add, Bn128Mul, Bn128Pairing}; use pallet_evm_precompile_dapp_staking::DappStakingV3Precompile; use pallet_evm_precompile_dispatch::Dispatch; -use pallet_evm_precompile_dispatch_lockdrop::DispatchLockdrop; use pallet_evm_precompile_ed25519::Ed25519Verify; use pallet_evm_precompile_modexp::Modexp; use pallet_evm_precompile_sha3fips::Sha3FIPS256; @@ -73,27 +71,6 @@ impl Contains for WhitelistedCalls { } } -/// Filter that only allows whitelisted runtime call to pass through dispatch-lockdrop precompile -pub struct WhitelistedLockdropCalls; - -impl Contains for WhitelistedLockdropCalls { - fn contains(t: &RuntimeCall) -> bool { - match t { - RuntimeCall::Utility(pallet_utility::Call::batch { calls }) - | RuntimeCall::Utility(pallet_utility::Call::batch_all { calls }) => calls - .iter() - .all(|call| WhitelistedLockdropCalls::contains(call)), - RuntimeCall::DappStaking(pallet_dapp_staking::Call::unbond_and_unstake { .. }) => true, - RuntimeCall::DappStaking(pallet_dapp_staking::Call::withdraw_unbonded { .. }) => true, - RuntimeCall::Balances(pallet_balances::Call::transfer_all { .. }) => true, - RuntimeCall::Balances(pallet_balances::Call::transfer_keep_alive { .. }) => true, - RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death { .. }) => true, - RuntimeCall::Assets(pallet_assets::Call::transfer { .. }) => true, - _ => false, - } - } -} - /// The PrecompileSet installed in the Shibuya runtime. #[precompile_utils::precompile_name_from_address] pub type ShibuyaPrecompilesSetAt = ( @@ -147,18 +124,6 @@ pub type ShibuyaPrecompilesSetAt = ( CallableByPrecompile, ), >, - // Skipping 20485 to make sure all network have consistent precompiles address - // Skipping 20486 - UnifiedAccountsPrecompile previously - PrecompileAt< - AddressU64<20487>, - DispatchLockdrop< - R, - DispatchFilterValidate, - ConstU32<8>, - >, - // Not callable from smart contract nor precompiled, only EOA accounts - (), - >, ); pub type ShibuyaPrecompiles = PrecompileSetBuilder< diff --git a/runtime/shiden/Cargo.toml b/runtime/shiden/Cargo.toml index 3244491d5..a06dc20f5 100644 --- a/runtime/shiden/Cargo.toml +++ b/runtime/shiden/Cargo.toml @@ -119,7 +119,6 @@ pallet-collator-selection = { workspace = true } pallet-dapp-staking = { workspace = true } pallet-evm-precompile-assets-erc20 = { workspace = true } pallet-evm-precompile-dapp-staking = { workspace = true } -pallet-evm-precompile-dispatch-lockdrop = { workspace = true } pallet-evm-precompile-sr25519 = { workspace = true } pallet-evm-precompile-substrate-ecdsa = { workspace = true } pallet-evm-precompile-xcm = { workspace = true } @@ -178,7 +177,6 @@ std = [ "pallet-evm-precompile-bn128/std", "sp-genesis-builder/std", "pallet-evm-precompile-dispatch/std", - "pallet-evm-precompile-dispatch-lockdrop/std", "pallet-evm-precompile-ed25519/std", "pallet-evm-precompile-modexp/std", "xcm-runtime-apis/std", diff --git a/runtime/shiden/src/precompiles.rs b/runtime/shiden/src/precompiles.rs index 85f768854..0ff5b32f4 100644 --- a/runtime/shiden/src/precompiles.rs +++ b/runtime/shiden/src/precompiles.rs @@ -20,14 +20,12 @@ use crate::{Runtime, RuntimeCall}; use astar_primitives::precompiles::DispatchFilterValidate; -use frame_support::pallet_prelude::ConstU32; use frame_support::{parameter_types, traits::Contains}; use pallet_evm_precompile_assets_erc20::Erc20AssetsPrecompileSet; use pallet_evm_precompile_blake2::Blake2F; use pallet_evm_precompile_bn128::{Bn128Add, Bn128Mul, Bn128Pairing}; use pallet_evm_precompile_dapp_staking::DappStakingV3Precompile; use pallet_evm_precompile_dispatch::Dispatch; -use pallet_evm_precompile_dispatch_lockdrop::DispatchLockdrop; use pallet_evm_precompile_ed25519::Ed25519Verify; use pallet_evm_precompile_modexp::Modexp; use pallet_evm_precompile_sha3fips::Sha3FIPS256; @@ -67,27 +65,6 @@ impl Contains for WhitelistedCalls { } } } -/// Filter that only allows whitelisted runtime call to pass through dispatch-lockdrop precompile -pub struct WhitelistedLockdropCalls; - -impl Contains for WhitelistedLockdropCalls { - fn contains(t: &RuntimeCall) -> bool { - match t { - RuntimeCall::Utility(pallet_utility::Call::batch { calls }) - | RuntimeCall::Utility(pallet_utility::Call::batch_all { calls }) => calls - .iter() - .all(|call| WhitelistedLockdropCalls::contains(call)), - RuntimeCall::DappStaking(pallet_dapp_staking::Call::unbond_and_unstake { .. }) => true, - RuntimeCall::DappStaking(pallet_dapp_staking::Call::withdraw_unbonded { .. }) => true, - RuntimeCall::Balances(pallet_balances::Call::transfer_all { .. }) => true, - RuntimeCall::Balances(pallet_balances::Call::transfer_keep_alive { .. }) => true, - RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death { .. }) => true, - RuntimeCall::Assets(pallet_assets::Call::transfer { .. }) => true, - _ => false, - } - } -} - /// The PrecompileSet installed in the Shiden runtime. #[precompile_utils::precompile_name_from_address] pub type ShidenPrecompilesSetAt = ( @@ -141,18 +118,6 @@ pub type ShidenPrecompilesSetAt = ( CallableByPrecompile, ), >, - // Skipping 20485 and 20486 to make sure all network have consistent - // precompiles address - PrecompileAt< - AddressU64<20487>, - DispatchLockdrop< - R, - DispatchFilterValidate, - ConstU32<8>, - >, - // Not callable from smart contract nor precompiled, only EOA accounts - (), - >, ); pub type ShidenPrecompiles = PrecompileSetBuilder< @@ -161,7 +126,7 @@ pub type ShidenPrecompiles = PrecompileSetBuilder< // Skip precompiles if out of range. PrecompilesInRangeInclusive< // We take range as last precompile index, UPDATE this once new prcompile is added - (AddressU64<1>, AddressU64<20487>), + (AddressU64<1>, AddressU64<20484>), ShidenPrecompilesSetAt, >, // Prefixed precompile sets (XC20)