Skip to content

Commit

Permalink
polkadot chains: allow arbitrary XCM execution (#345)
Browse files Browse the repository at this point in the history
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 <adrian@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
  • Loading branch information
acatangiu and bkchr authored Jun 24, 2024
1 parent 6cdd183 commit 5330501
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion relay/kusama/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl xcm_executor::Config for XcmConfig {
WaivedLocations,
XcmFeeToAccount<Self::AssetTransactor, AccountId, TreasuryAccount>,
>;
// No bridges yet...
// No bridges on the Relay Chain
type MessageExporter = ();
type UniversalAliases = Nothing;
type CallDispatcher = RuntimeCall;
Expand Down
7 changes: 3 additions & 4 deletions relay/polkadot/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ impl xcm_executor::Config for XcmConfig {
WaivedLocations,
XcmFeeToAccount<Self::AssetTransactor, AccountId, TreasuryAccount>,
>;
// No bridges yet...
// No bridges on the Relay Chain
type MessageExporter = ();
type UniversalAliases = Nothing;
type CallDispatcher = RuntimeCall;
Expand Down Expand Up @@ -294,10 +294,9 @@ impl pallet_xcm::Config for Runtime {
// messages.
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalPalletOriginToLocation>;
type XcmRouter = XcmRouter;
// Anyone can execute XCM messages locally...
// Anyone can execute XCM messages locally.
type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
// ...but they must match our filter, which rejects all.
type XcmExecuteFilter = Nothing; // == Deny All
type XcmExecuteFilter = Everything;
type XcmExecutor = xcm_executor::XcmExecutor<XcmConfig>;
type XcmTeleportFilter = Everything; // == Allow All
type XcmReserveTransferFilter = Everything; // == Allow All
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,9 @@ impl pallet_xcm::Config for Runtime {
// We want to disallow users sending (arbitrary) XCMs from this chain.
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, ()>;
type XcmRouter = XcmRouter;
// We support local origins dispatching XCM executions in principle...
// Anyone can execute XCM messages locally.
type ExecuteXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
// ... but disallow generic XCM execution. As a result only teleports and reserve transfers are
// allowed.
type XcmExecuteFilter = Nothing;
type XcmExecuteFilter = Everything;
type XcmExecutor = XcmExecutor<XcmConfig>;
type XcmTeleportFilter = Everything;
type XcmReserveTransferFilter = Everything;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,9 @@ impl pallet_xcm::Config for Runtime {
// We want to disallow users sending (arbitrary) XCMs from this chain.
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, ()>;
type XcmRouter = XcmRouter;
// We support local origins dispatching XCM executions in principle...
// Anyone can execute XCM messages locally.
type ExecuteXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
// ... but disallow generic XCM execution. As a result only teleports are allowed.
type XcmExecuteFilter = Nothing;
type XcmExecuteFilter = Everything;
type XcmExecutor = XcmExecutor<XcmConfig>;
type XcmTeleportFilter = Everything;
type XcmReserveTransferFilter = Nothing; // This parachain is not meant as a reserve location.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,9 @@ impl pallet_xcm::Config for Runtime {
// We only allow the Fellows to send messages.
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, FellowsToPlurality>;
type XcmRouter = XcmRouter;
// We support local origins dispatching XCM executions in principle...
// Anyone can execute XCM messages locally.
type ExecuteXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
// ... but disallow generic XCM execution. As a result only teleports are allowed.
type XcmExecuteFilter = Nothing;
type XcmExecuteFilter = Everything;
type XcmExecutor = XcmExecutor<XcmConfig>;
type XcmTeleportFilter = Everything;
type XcmReserveTransferFilter = Nothing; // This parachain is not meant as a reserve location.
Expand Down

0 comments on commit 5330501

Please sign in to comment.