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

[WIP] Implementation of ah-client and rc-client staking pallets #7357

Draft
wants to merge 3 commits into
base: kiz-multi-block-eletion
Choose a base branch
from

Conversation

tdimitrov
Copy link
Contributor

@tdimitrov tdimitrov commented Jan 28, 2025

This PR is work in progress.

Related issues: #6167 and #6166

@Ank4n @kianenigma I'm opening this PR to discuss the new staking pallets, stay up to date on the implementation and last but not least - to ask questions.

TODOs:

origin: OriginFor<T>,
new_validator_set: Vec<(T::AccountId, Exposure<T::AccountId, BalanceOf<T>>)>,
) -> DispatchResult {
// TODO: origin?
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be a permissioned origin that can only be called by XCM. I think from the pallet you can use EnsureOrigin and configure it in the runtime.

Look into the coretime stuff, it uses the same mechanism.

Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

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

Good start, but not much to add for now.

I suggest following these steps next to make it more concrete:

  • Get the XCM transfer going and working. This is isolated work, and a 100% useful primitive.
  • Once the transfer layer is in place, do these two:
  1. receive some validator set "at some point" in rc-client, and you forward it to ah-client.
  2. Forward session updates in the reverse way.

@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/13030947117
Failed job name: test-linux-stable-int

@tdimitrov
Copy link
Contributor Author

Thanks for the advice @kianenigma. Indeed the PR is just a boilerplate code so far. Before diving into the XCM I wanted to 'plug' the new pallet-staking-ah-client into the westend runtime to see if there are any issues with trait implementations, dependencies, etc. I'm done with this to the XCM is the next step.

Two questions so far.

  1. Should I commit the changes to the westend runtime in this PR? They are minor so it's not a problem to keep them uncommitted for local testing only. I have added AssetHubStakingClient pallet to the runtime and:
  • Use AssetHubStakingClient instead of Staking in pallet_authorship's event handler.
  • Use AssetHubStakingClient as a SessionManager for pallet_session
  • Use AssetHubStakingClient as a OnOffenceHandler for pallet_offences
  1. pallet_bags_list is going to be migrated on AH, right?

sp-staking = { features = ["serde"], workspace = true }
pallet-authorship = { workspace = true }
pallet-session = { features = [ "historical",], workspace = true }
pallet-staking = { workspace = true} # todo: probably not a good idea to depend on the whole staking pallet
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it a bad idea to depend on the whole pallet-staking just to use ExposureOf?

@seadanda
Copy link
Contributor

  1. Should I commit the changes to the westend runtime in this PR? They are minor so it's not a problem to keep them uncommitted for local testing only.

Yea I'd commit those changes and also remove the migrated pallets from the relay while you're there, as that will expose any missing trait boundaries etc that the pallet needs to satisfy.

  1. pallet_bags_list is going to be migrated on AH, right?

Yes. You can see the pallets which are added to AH-next here, which also should be a 1to1 mapping of what is being moved off the relay chain. I'd stick to the staking-related ones for now for what you're doing, as the gov ones will take some untangling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants