Skip to content

Commit

Permalink
Allow Sending XCM messages using a Signed origin on Kusama (polkadot-…
Browse files Browse the repository at this point in the history
…fellows#290)

Since the introduction of this origin control, the XCMv3 release has
been integrated on Kusama, and now the `xcm-pallet` is perfectly able to
prepend a `DescendOrigin` instruction to the sent message when calling
`send`. Allowing signed origins to send messages through the network
would extend the possibilities for better integrations with parachains.

---------

Co-authored-by: fellowship-merge-bot[bot] <151052383+fellowship-merge-bot[bot]@users.noreply.github.com>
  • Loading branch information
pandres95 and fellowship-merge-bot[bot] authored May 17, 2024
1 parent c2886b9 commit c08d8ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- Remove one-shot migrations from Kusama Coretime ([polkadot-fellows/runtimes#300](https://github.com/polkadot-fellows/runtimes/pull/300))
- Remove DMP queue and allow `system::authorize_upgrade` in XCM's call filter ([polkadot-fellows/runtimes#280](https://github.com/polkadot-fellows/runtimes/pull/280))
- Allow Sending XCM messages using a Signed origin on Kusama ([polkadot-fellows/runtimes#290](https://github.com/polkadot-fellows/runtimes/pull/290))

### Fixed

Expand Down
11 changes: 6 additions & 5 deletions relay/kusama/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,20 +248,21 @@ pub type FellowsToPlurality = OriginToPluralityVoice<RuntimeOrigin, Fellows, Fel

/// Type to convert a pallet `Origin` type value into a `Location` value which represents an
/// interior location of this chain for a destination chain.
pub type LocalPalletOriginToLocation = (
pub type LocalPalletOrSignedOriginToLocation = (
// StakingAdmin origin to be used in XCM as a corresponding Plurality `Location` value.
StakingAdminToPlurality,
// Fellows origin to be used in XCM as a corresponding Plurality `Location` value.
FellowsToPlurality,
// And a usual Signed origin to be used in XCM as a corresponding AccountId32
SignedToAccountId32<RuntimeOrigin, AccountId, ThisNetwork>,
);

impl pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
// We only allow the root, fellows and the staking admin to send messages.
// This is basically safe to enable for everyone (safe the possibility of someone spamming the
// parachain if they're willing to pay the KSM to send from the Relay-chain), but it's useless
// until we bring in XCM v3 which will make `DescendOrigin` a bit more useful.
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalPalletOriginToLocation>;
// parachain if they're willing to pay the KSM to send from the Relay-chain).
type SendXcmOrigin =
xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalPalletOrSignedOriginToLocation>;
type XcmRouter = XcmRouter;
// Anyone can execute XCM messages locally.
type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
Expand Down

0 comments on commit c08d8ca

Please sign in to comment.