From 9c904eef58fab1ac250791cf46c0e0f2080283ac Mon Sep 17 00:00:00 2001 From: Santi Balaguer Date: Wed, 8 Jan 2025 18:35:45 +0100 Subject: [PATCH] ParaRegistration proxy to Polkadot and Kusama (#520) 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> --- CHANGELOG.md | 2 ++ relay/kusama/src/lib.rs | 11 +++++++++++ relay/polkadot/src/lib.rs | 10 ++++++++++ 3 files changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8daaefb1be..efc2200872 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs index 7649d2df0f..5252cf8728 100644 --- a/relay/kusama/src/lib.rs +++ b/relay/kusama/src/lib.rs @@ -1143,6 +1143,8 @@ pub enum ProxyType { NominationPools, #[codec(index = 9)] Spokesperson, + #[codec(index = 10)] + ParaRegistration, } impl Default for ProxyType { @@ -1247,6 +1249,15 @@ impl InstanceFilter 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 { diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs index 7008b5bd75..4bd27abc7d 100644 --- a/relay/polkadot/src/lib.rs +++ b/relay/polkadot/src/lib.rs @@ -1007,6 +1007,7 @@ pub enum ProxyType { CancelProxy = 6, Auction = 7, NominationPools = 8, + ParaRegistration = 9, } #[cfg(test)] @@ -1121,6 +1122,15 @@ impl InstanceFilter 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 {