diff --git a/primitives/src/precompiles.rs b/primitives/src/precompiles.rs index 54f588a92a..ac4cabb213 100644 --- a/primitives/src/precompiles.rs +++ b/primitives/src/precompiles.rs @@ -27,6 +27,7 @@ use frame_support::{ }; use pallet_evm_precompile_dispatch::DispatchValidateT; +/// Struct that blocks all runtime calls to Dispatch Precompile pub struct BlockAllDispatchValidate; /// The default implementation of `DispatchValidateT`. @@ -43,6 +44,8 @@ impl DispatchValidateT } } +/// Struct that allows only whitelisted runtime calls to pass through dispatch precompile, +/// Whitelisted calls are defined in runtime pub struct DispatchFilterValidate + Default>( PhantomData<(RuntimeCall, Filter)>, ); diff --git a/runtime/astar/src/lib.rs b/runtime/astar/src/lib.rs index b7c8038aca..05a0f59abe 100644 --- a/runtime/astar/src/lib.rs +++ b/runtime/astar/src/lib.rs @@ -844,6 +844,7 @@ impl pallet_xc_asset_config::Config for Runtime { type WeightInfo = pallet_xc_asset_config::weights::SubstrateWeight; } +/// Filter that only allows whitelisted runtime call to pass through dispatch precompile #[derive(Default)] pub struct DispatchPrecompileFilter; diff --git a/runtime/local/src/lib.rs b/runtime/local/src/lib.rs index de118941f2..88bceef723 100644 --- a/runtime/local/src/lib.rs +++ b/runtime/local/src/lib.rs @@ -845,6 +845,7 @@ impl pallet_sudo::Config for Runtime { type WeightInfo = pallet_sudo::weights::SubstrateWeight; } +/// Filter that only allows whitelisted runtime call to pass through dispatch precompile #[derive(Default)] pub struct DispatchPrecompileFilter; diff --git a/runtime/shibuya/src/lib.rs b/runtime/shibuya/src/lib.rs index 3a1a28cedb..deb3ca96f8 100644 --- a/runtime/shibuya/src/lib.rs +++ b/runtime/shibuya/src/lib.rs @@ -1052,6 +1052,8 @@ impl pallet_sudo::Config for Runtime { type RuntimeCall = RuntimeCall; type WeightInfo = pallet_sudo::weights::SubstrateWeight; } + +/// Filter that only allows whitelisted runtime call to pass through dispatch precompile #[derive(Default)] pub struct DispatchPrecompileFilter; diff --git a/runtime/shiden/src/lib.rs b/runtime/shiden/src/lib.rs index c1e9713019..4c479f9481 100644 --- a/runtime/shiden/src/lib.rs +++ b/runtime/shiden/src/lib.rs @@ -832,6 +832,7 @@ impl pallet_xc_asset_config::Config for Runtime { type WeightInfo = pallet_xc_asset_config::weights::SubstrateWeight; } +/// Filter that only allows whitelisted runtime call to pass through dispatch precompile #[derive(Default)] pub struct DispatchPrecompileFilter; diff --git a/tests/integration/src/lib.rs b/tests/integration/src/lib.rs index 4779ed24a4..d114457172 100644 --- a/tests/integration/src/lib.rs +++ b/tests/integration/src/lib.rs @@ -32,5 +32,5 @@ mod assets; #[cfg(feature = "shibuya")] mod xvm; -#[cfg(feature = "shibuya")] +#[cfg(any(feature = "shibuya", feature = "shiden", feature = "astar"))] mod dispatch_filter;