Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParaRegistration proxy to Polkadot and Kusama #520

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,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
9 changes: 9 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,13 @@ 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 { .. }) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need batch or similar as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't. Reserve and Register happen at two different moments in time (in the middle you build the wasm and genesis), so we don't batch both transactions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And register batched with remove proxy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not being used right now, but I still think it could be useful down the line. I just added the Utilities pallet as well for this proxy type.

RuntimeCall::Registrar(paras_registrar::Call::register { .. }) |
RuntimeCall::Utility(..) |
SBalaguer marked this conversation as resolved.
Show resolved Hide resolved
RuntimeCall::Proxy(pallet_proxy::Call::remove_proxy { .. })
),
}
}
fn is_superset(&self, o: &Self) -> bool {
Expand Down
8 changes: 8 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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worth making this also 10 so the encoding is the same between Kusama and Polkadot? (Basti probably disagrees with me on this!)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha :P Yeah, I don't see any reason for this. They are already different and they are highly chain specific any way.

}

#[cfg(test)]
Expand Down Expand Up @@ -1121,6 +1122,13 @@ 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(..) |
SBalaguer marked this conversation as resolved.
Show resolved Hide resolved
RuntimeCall::Proxy(pallet_proxy::Call::remove_proxy { .. })
),
}
}
fn is_superset(&self, o: &Self) -> bool {
Expand Down
Loading