diff --git a/Cargo.lock b/Cargo.lock index a2d9587be..9082a39f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3815,7 +3815,7 @@ dependencies = [ [[package]] name = "hydradx-runtime" -version = "168.0.0" +version = "169.0.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", @@ -10084,7 +10084,7 @@ dependencies = [ [[package]] name = "runtime-integration-tests" -version = "1.8.0" +version = "1.8.1" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 6906a5e87..99e769eac 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runtime-integration-tests" -version = "1.8.0" +version = "1.8.1" description = "Integration tests" authors = ["GalacticCouncil"] edition = "2021" diff --git a/integration-tests/src/cross_chain_transfer.rs b/integration-tests/src/cross_chain_transfer.rs index 2467825a6..3bc596437 100644 --- a/integration-tests/src/cross_chain_transfer.rs +++ b/integration-tests/src/cross_chain_transfer.rs @@ -427,3 +427,27 @@ fn claim_asset(asset: MultiAsset, recipient: [u8; 32]) { )); }); } + +#[test] +fn polkadot_xcm_execute_extrinsic_should_not_be_allowed() { + TestNet::reset(); + + Hydra::execute_with(|| { + let message = VersionedXcm::V3(Xcm(vec![ + WithdrawAsset((Here, 410000000000u128).into()), + BuyExecution { + fees: (Here, 400000000000u128).into(), + weight_limit: Unlimited, + }, + ])); + + assert_noop!( + hydradx_runtime::PolkadotXcm::execute( + hydradx_runtime::RuntimeOrigin::signed(ALICE.into()), + Box::new(message), + Weight::from_ref_time(400_000_000_000) + ), + pallet_xcm::Error::::Filtered + ); + }); +} diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index 00b823e57..c37dfe1ac 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-runtime" -version = "168.0.0" +version = "169.0.0" authors = ["GalacticCouncil"] edition = "2021" license = "Apache 2.0" diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index 76f3450d1..47f8dac3e 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -95,7 +95,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("hydradx"), impl_name: create_runtime_str!("hydradx"), authoring_version: 1, - spec_version: 168, + spec_version: 169, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/runtime/hydradx/src/xcm.rs b/runtime/hydradx/src/xcm.rs index 9669b5ad9..214020646 100644 --- a/runtime/hydradx/src/xcm.rs +++ b/runtime/hydradx/src/xcm.rs @@ -24,7 +24,7 @@ use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, EnsureXcmOrigin, FixedWeightBounds, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, - TakeWeightCredit, + TakeWeightCredit, WithComputedOrigin, }; use xcm_executor::{Config, XcmExecutor}; @@ -35,11 +35,18 @@ pub type LocalOriginToLocation = SignedToAccountId32, // Expected responses are OK. AllowKnownQueryResponses, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, + // Evaluate the barriers with the effective origin + WithComputedOrigin< + ( + AllowTopLevelPaidExecutionFrom, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), + UniversalLocation, + ConstU32<8>, + >, ); parameter_types! { @@ -197,7 +204,7 @@ impl pallet_xcm::Config for Runtime { type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; type ExecuteXcmOrigin = EnsureXcmOrigin; - type XcmExecuteFilter = Everything; + type XcmExecuteFilter = Nothing; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Nothing; type XcmReserveTransferFilter = Everything;