Skip to content

Commit

Permalink
ParaRegistration proxy to Polkadot and Kusama (#520)
Browse files Browse the repository at this point in the history
<!-- Remember that you can run `/merge` to enable auto-merge in the PR
-->

<!-- Remember to modify the changelog. If you don't need to modify it,
you can check the following box.
Instead, if you have already modified it, simply delete the following
line. -->

This adds a new type of Proxy called ParaRegistration to both Kusama and
Polkadot's runtime. This change aids the development of deployment
portals that want to execute actions related to deploying parachains.

The allowed actions on this proxy are:

1. Reserving a paraID.
2. Registering a Parachain.
3. Removing proxy.

---------

Co-authored-by: fellowship-merge-bot[bot] <151052383+fellowship-merge-bot[bot]@users.noreply.github.com>
  • Loading branch information
SBalaguer and fellowship-merge-bot[bot] authored Jan 8, 2025
1 parent 510e26a commit 9c904ee
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- Location conversion tests for relays and parachains ([polkadot-fellows/runtimes#487](https://github.com/polkadot-fellows/runtimes/pull/487))

- ParaRegistration proxy for Polkadot and Kusama ([polkadot-fellows/runtimes#520](https://github.com/polkadot-fellows/runtimes/pull/520))

### Changed

- Kusama Treasury: remove funding to the Kappa Sigma Mu Society and disable burn ([polkadot-fellows/runtimes#507](https://github.com/polkadot-fellows/runtimes/pull/507))
Expand Down
11 changes: 11 additions & 0 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,8 @@ pub enum ProxyType {
NominationPools,
#[codec(index = 9)]
Spokesperson,
#[codec(index = 10)]
ParaRegistration,
}

impl Default for ProxyType {
Expand Down Expand Up @@ -1247,6 +1249,15 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::System(frame_system::Call::remark { .. }) |
RuntimeCall::System(frame_system::Call::remark_with_event { .. })
),
ProxyType::ParaRegistration => matches!(
c,
RuntimeCall::Registrar(paras_registrar::Call::reserve { .. }) |
RuntimeCall::Registrar(paras_registrar::Call::register { .. }) |
RuntimeCall::Utility(pallet_utility::Call::batch { .. }) |
RuntimeCall::Utility(pallet_utility::Call::batch_all { .. }) |
RuntimeCall::Utility(pallet_utility::Call::force_batch { .. }) |
RuntimeCall::Proxy(pallet_proxy::Call::remove_proxy { .. })
),
}
}
fn is_superset(&self, o: &Self) -> bool {
Expand Down
10 changes: 10 additions & 0 deletions relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,7 @@ pub enum ProxyType {
CancelProxy = 6,
Auction = 7,
NominationPools = 8,
ParaRegistration = 9,
}

#[cfg(test)]
Expand Down Expand Up @@ -1121,6 +1122,15 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::Registrar(..) |
RuntimeCall::Slots(..)
),
ProxyType::ParaRegistration => matches!(
c,
RuntimeCall::Registrar(paras_registrar::Call::reserve { .. }) |
RuntimeCall::Registrar(paras_registrar::Call::register { .. }) |
RuntimeCall::Utility(pallet_utility::Call::batch { .. }) |
RuntimeCall::Utility(pallet_utility::Call::batch_all { .. }) |
RuntimeCall::Utility(pallet_utility::Call::force_batch { .. }) |
RuntimeCall::Proxy(pallet_proxy::Call::remove_proxy { .. })
),
}
}
fn is_superset(&self, o: &Self) -> bool {
Expand Down

0 comments on commit 9c904ee

Please sign in to comment.