From 533050174da8bb3e6e9e01276491760ce2a77bbb Mon Sep 17 00:00:00 2001 From: Adrian Catangiu Date: Mon, 24 Jun 2024 21:37:46 +0300 Subject: [PATCH] polkadot chains: allow arbitrary XCM execution (#345) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Following #261 where arbitrary XCM execution was enabled on Kusama chains, this commit enables the same for Polkadot chains. Allowing `XcmExecuteFilter = Everything` is considered safe at this point, and doing so greatly increases the usability of these chains since many custom actions can be done through XCM without needing specialized calls for them anymore. This is also a major step in improving dApps integration as they can now interact uniformly with multiple chains, directly using XCM programs. --------- Signed-off-by: Adrian Catangiu Co-authored-by: Bastian Köcher --- CHANGELOG.md | 6 ++++++ relay/kusama/src/xcm_config.rs | 2 +- relay/polkadot/src/xcm_config.rs | 7 +++---- .../asset-hubs/asset-hub-polkadot/src/xcm_config.rs | 6 ++---- .../bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs | 5 ++--- .../collectives/collectives-polkadot/src/xcm_config.rs | 5 ++--- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba4394af42..d0b7d194b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ Changelog for the runtimes governed by the Polkadot Fellowship. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## Unreleased + +### Changed + +- Polkadot chains: allow arbitrary XCM execution ([polkadot-fellows/runtimes#345](https://github.com/polkadot-fellows/runtimes/pull/345)) + ## [1.2.7] 14.06.2024 Note: This release only affects the following runtimes and is not a full system release: diff --git a/relay/kusama/src/xcm_config.rs b/relay/kusama/src/xcm_config.rs index 106550cc19..b7e5dd0599 100644 --- a/relay/kusama/src/xcm_config.rs +++ b/relay/kusama/src/xcm_config.rs @@ -216,7 +216,7 @@ impl xcm_executor::Config for XcmConfig { WaivedLocations, XcmFeeToAccount, >; - // No bridges yet... + // No bridges on the Relay Chain type MessageExporter = (); type UniversalAliases = Nothing; type CallDispatcher = RuntimeCall; diff --git a/relay/polkadot/src/xcm_config.rs b/relay/polkadot/src/xcm_config.rs index 87fbd6560b..33c9b56edd 100644 --- a/relay/polkadot/src/xcm_config.rs +++ b/relay/polkadot/src/xcm_config.rs @@ -232,7 +232,7 @@ impl xcm_executor::Config for XcmConfig { WaivedLocations, XcmFeeToAccount, >; - // No bridges yet... + // No bridges on the Relay Chain type MessageExporter = (); type UniversalAliases = Nothing; type CallDispatcher = RuntimeCall; @@ -294,10 +294,9 @@ impl pallet_xcm::Config for Runtime { // messages. type SendXcmOrigin = xcm_builder::EnsureXcmOrigin; type XcmRouter = XcmRouter; - // Anyone can execute XCM messages locally... + // Anyone can execute XCM messages locally. type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin; - // ...but they must match our filter, which rejects all. - type XcmExecuteFilter = Nothing; // == Deny All + type XcmExecuteFilter = Everything; type XcmExecutor = xcm_executor::XcmExecutor; type XcmTeleportFilter = Everything; // == Allow All type XcmReserveTransferFilter = Everything; // == Allow All diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs index eddc63a0ee..dfce27d97a 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs @@ -486,11 +486,9 @@ impl pallet_xcm::Config for Runtime { // We want to disallow users sending (arbitrary) XCMs from this chain. type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - // We support local origins dispatching XCM executions in principle... + // Anyone can execute XCM messages locally. type ExecuteXcmOrigin = EnsureXcmOrigin; - // ... but disallow generic XCM execution. As a result only teleports and reserve transfers are - // allowed. - type XcmExecuteFilter = Nothing; + type XcmExecuteFilter = Everything; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs index 66c6cb772e..6c7ad9086f 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs @@ -264,10 +264,9 @@ impl pallet_xcm::Config for Runtime { // We want to disallow users sending (arbitrary) XCMs from this chain. type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - // We support local origins dispatching XCM executions in principle... + // Anyone can execute XCM messages locally. type ExecuteXcmOrigin = EnsureXcmOrigin; - // ... but disallow generic XCM execution. As a result only teleports are allowed. - type XcmExecuteFilter = Nothing; + type XcmExecuteFilter = Everything; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Nothing; // This parachain is not meant as a reserve location. diff --git a/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs b/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs index 5f9b7c807c..29847a3fc0 100644 --- a/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs +++ b/system-parachains/collectives/collectives-polkadot/src/xcm_config.rs @@ -259,10 +259,9 @@ impl pallet_xcm::Config for Runtime { // We only allow the Fellows to send messages. type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - // We support local origins dispatching XCM executions in principle... + // Anyone can execute XCM messages locally. type ExecuteXcmOrigin = EnsureXcmOrigin; - // ... but disallow generic XCM execution. As a result only teleports are allowed. - type XcmExecuteFilter = Nothing; + type XcmExecuteFilter = Everything; type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Nothing; // This parachain is not meant as a reserve location.