Skip to content

Conversation

@Ad96el
Copy link
Contributor

@Ad96el Ad96el commented Apr 22, 2025

fixes #3822

This PR introduces permissioned collators to the Peregrine and Spirtinet runtimes. The council or governance is now allowed to add and remove members through the newly deployed pallet-membership. This pallet is then used by a new session manager implementation. The old session manager implementation remains untouched—it's only moved out of the runtime.

After the migration, the parachain-staking pallet becomes essentially obsolete, as collators no longer receive rewards for block production.

A follow-up PR will reduce rewards in the parachain-staking pallet accordingly.

The round information (which determines session length) still resides in the parachain-staking pallet. Before it can be removed, a new source for round length must be implemented—either directly in the runtime or via a custom pallet that includes collator information.

How to test

  • Navigate to the zombienet directory and spin up a Peregrine runtime.
  • Perform the runtime upgrade (sudo -> system -> set_code).
  • Add a new collator via sudo or start a council motion (sudo -> permissionedCollators -> add_member).
  • Force a new round (sudo -> parachainStaking -> forceNewRound).
  • Verify in the session pallet that the new collator is queued. (To use a new collator, spin up a node with the correct keys. Using an existing collator is usually easier.)
  • Force another new round.
  • Only the new collator should be producing blocks now.

@Ad96el Ad96el changed the title Ag collators feat: Permissioned collators Apr 22, 2025
@Ad96el Ad96el added the ci-skip-docs-pr ci-skip-docs-pr label Apr 22, 2025
@Ad96el Ad96el marked this pull request as ready for review April 22, 2025 12:52
@Ad96el Ad96el requested review from abdulmth and rflechtner and removed request for abdulmth and rflechtner April 22, 2025 12:52
@Ad96el Ad96el marked this pull request as draft April 23, 2025 08:14
@Ad96el
Copy link
Contributor Author

Ad96el commented Apr 23, 2025

I decided to add the benchmarking in this PR.

@Ad96el Ad96el marked this pull request as ready for review April 23, 2025 09:08
@Ad96el Ad96el requested review from abdulmth and rflechtner April 23, 2025 09:08
@Ad96el Ad96el enabled auto-merge (squash) April 30, 2025 13:24
@Ad96el Ad96el merged commit c8ae0f4 into develop Apr 30, 2025
17 checks passed
@Ad96el Ad96el deleted the ag_collators branch April 30, 2025 14:24
Copy link
Contributor

@ntn-x2 ntn-x2 left a comment

Choose a reason for hiding this comment

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

Minor things. Also, it seems the PR description is outdated, since I can't see where the staking pallet is being used? Session length has a fixed duration now, so the only thing that the staking pallet does, is to provide collators until there is a well formed collator set (meaning non empty and with all session keys set) that is returned by the new session manager.


if collators.is_empty() || !has_collator_keys {
// we never want to pass an empty set of collators. This would brick the chain.
log::error!("💥 keeping old session because of empty collator set!");
Copy link
Contributor

Choose a reason for hiding this comment

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

I think a different error message depending on which condition is false would massively reduce headaches in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point. I created a new PR: #887

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-skip-docs-pr ci-skip-docs-pr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants