Skip to content

Conversation

@rflechtner
Copy link
Contributor

Allows unstaking for all collator candidates and delegators in the staking pallet with minimum delay.
Also prevents additional candidates or delegators from joining, and existing ones from increasing their stake.

Note that collator selection is no longer dependent on the staking pallet, so removal of all candidates is inconsequential for the collator set.

Checklist:

  • I have verified that the code works
    • No panics! (checked arithmetic ops, no indexing array[3] use get(3), ...)
  • I have verified that the code is easy to understand
    • If not, I have left a well-balanced amount of inline comments
  • I have left the code in a better state
  • I have documented the changes (where applicable)
    • Either PR or Ticket to update the Docs
    • Link the PR/Ticket here

@rflechtner rflechtner requested review from Ad96el and ntn-x2 and removed request for Ad96el July 3, 2025 14:47
pub const STAKE_DURATION: BlockNumber = 1;

#[cfg(feature = "fast-gov")]
pub const MIN_COLLATORS: u32 = 4;
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we want to change this too?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this constant is very important. It's only used in set_max_selected_candidates as a validation parameter.
The pallet isn't used to fetch collators anyway

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this constraints the setting determining how many candidates are selected as collators. Which has become irrelevant now, and I would want to avoid fiddling with settings where not required, given that the pallet is pretty complex and it's hard to foresee all consequences of such changes.

Ad96el
Ad96el previously approved these changes Jul 16, 2025
Copy link
Contributor

@Ad96el Ad96el left a comment

Choose a reason for hiding this comment

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

LGTM

@rflechtner rflechtner added the ci-skip-docs-pr ci-skip-docs-pr label Jul 16, 2025
@rflechtner rflechtner merged commit 329c5b7 into develop Jul 16, 2025
13 of 16 checks passed
@rflechtner rflechtner deleted the fix-allow-unstaking-for-all branch July 16, 2025 09:55
rflechtner added a commit that referenced this pull request Jul 16, 2025
Allows unstaking for all collator candidates and delegators in the
staking pallet with minimum delay.
Also prevents additional candidates or delegators from joining, and
existing ones from increasing their stake.
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.

4 participants