Skip to content

Commit

Permalink
polkadot chains: allow arbitrary XCM execution
Browse files Browse the repository at this point in the history
Following polkadot-fellows#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 <[email protected]>
  • Loading branch information
acatangiu committed Jun 7, 2024
1 parent 0185f7c commit a0dc9f9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
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 @@ -229,7 +229,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 @@ -291,10 +291,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 a0dc9f9

Please sign in to comment.