--- a/runtime/common/config/xcm/mod.rs +++ b/runtime/common/config/xcm/mod.rs @@ -125,29 +125,6 @@ } } -pub struct DenyTransact; -impl TryPass for DenyTransact { - fn try_pass( - _origin: &MultiLocation, - message: &mut [Instruction], - ) -> Result<(), ()> { - let transact_inst = message - .iter() - .find(|inst| matches![inst, Instruction::Transact { .. }]); - - if transact_inst.is_some() { - log::warn!( - target: "xcm::barrier", - "transact XCM rejected" - ); - - Err(()) - } else { - Ok(()) - } - } -} - /// Deny executing the XCM if it matches any of the Deny filter regardless of anything else. /// If it passes the Deny, and matches one of the Allow cases then it is let through. pub struct DenyThenTry(PhantomData, PhantomData) @@ -234,7 +211,9 @@ type MessageExporter = (); type UniversalAliases = Nothing; type CallDispatcher = RuntimeCall; - type SafeCallFilter = Nothing; // ? Only non-recursive calls may go here, but do we need this? + + // Deny all XCM Transacts. + type SafeCallFilter = Nothing; } #[cfg(feature = "runtime-benchmarks")] --- a/runtime/opal/src/xcm_barrier.rs +++ b/runtime/opal/src/xcm_barrier.rs @@ -20,8 +20,6 @@ use xcm_builder::{AllowTopLevelPaidExecutionFrom, TakeWeightCredit}; use xcm_executor::traits::ShouldExecute; -use crate::runtime_common::config::xcm::{DenyThenTry, DenyTransact}; - /// Execution barrier that just takes `max_weight` from `weight_credit`. /// /// Useful to allow XCM execution by local chain users via extrinsics. @@ -39,11 +37,8 @@ } } -pub type Barrier = DenyThenTry< - DenyTransact, - ( - TakeWeightCredit, - AllowTopLevelPaidExecutionFrom, - AllowAllDebug, - ), ->; +pub type Barrier = ( + TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, + AllowAllDebug, +); --- a/runtime/quartz/src/xcm_barrier.rs +++ b/runtime/quartz/src/xcm_barrier.rs @@ -28,7 +28,7 @@ use crate::{ Runtime, ParachainInfo, PolkadotXcm, runtime_common::{ - config::xcm::{DenyThenTry, DenyTransact, DenyExchangeWithUnknownLocation}, + config::xcm::{DenyThenTry, DenyExchangeWithUnknownLocation}, xcm::OverridableAllowedLocations, }, }; @@ -76,12 +76,9 @@ } pub type Barrier = DenyThenTry< - ( - DenyTransact, - DenyExchangeWithUnknownLocation< - OverridableAllowedLocations, - >, - ), + DenyExchangeWithUnknownLocation< + OverridableAllowedLocations, + >, ( TakeWeightCredit, AllowTopLevelPaidExecutionFrom, --- a/runtime/unique/src/xcm_barrier.rs +++ b/runtime/unique/src/xcm_barrier.rs @@ -28,7 +28,7 @@ use crate::{ Runtime, ParachainInfo, PolkadotXcm, runtime_common::{ - config::xcm::{DenyThenTry, DenyTransact, DenyExchangeWithUnknownLocation}, + config::xcm::{DenyThenTry, DenyExchangeWithUnknownLocation}, xcm::OverridableAllowedLocations, }, }; @@ -76,12 +76,9 @@ } pub type Barrier = DenyThenTry< - ( - DenyTransact, - DenyExchangeWithUnknownLocation< - OverridableAllowedLocations, - >, - ), + DenyExchangeWithUnknownLocation< + OverridableAllowedLocations, + >, ( TakeWeightCredit, AllowTopLevelPaidExecutionFrom,