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

Primed for suspension #1293

Merged
merged 21 commits into from
Dec 10, 2024
Merged

Primed for suspension #1293

merged 21 commits into from
Dec 10, 2024

Conversation

drsk0
Copy link
Contributor

@drsk0 drsk0 commented Dec 5, 2024

Purpose

This is the implementation of automatic suspension for validators that missed too many rounds. Suspension happens at snapshot, while priming new validators for suspension at payday.

We compute the to be suspended validators during epoch transition at snapshot before we prime validators for future suspension. This is to avoid priming and then immediately suspending validators when the length of the payday is one.

Changes

  • two block state operations: bsoPrimeValidators and bsoSuspendValidators
  • automatic suspend logic in the scheduler
  • change computeBakerStakesAndCapital to ignore newly suspended validators at snapshot
  • a bit of boilerplate code for the chain parameters version 3 slipped in this PR
  • tests

Checklist

  • My code follows the style of this project.
  • The code compiles without warnings.
  • I have performed a self-review of the changes.
  • I have documented my code, in particular the intent of the
    hard-to-understand areas.
  • (If necessary) I have updated the CHANGELOG.

CLA acceptance

_Remove if not applicable.

By submitting the contribution I accept the terms and conditions of the
Contributor License Agreement v1.0

@drsk0 drsk0 requested a review from td202 December 5, 2024 20:22
td202
td202 previously requested changes Dec 6, 2024
Copy link
Contributor

@td202 td202 left a comment

Choose a reason for hiding this comment

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

Looks good. Just a few changes.

@td202 td202 requested a review from eb-concordium December 6, 2024 14:40
@drsk0 drsk0 force-pushed the primed_for_suspension branch from cc68cc4 to 46c2dcc Compare December 9, 2024 10:00
@drsk0 drsk0 force-pushed the primed_for_suspension branch from 46c2dcc to 63378e0 Compare December 9, 2024 10:11
@drsk0 drsk0 force-pushed the primed_for_suspension branch from 63378e0 to af93309 Compare December 9, 2024 10:25
@drsk0 drsk0 force-pushed the primed_for_suspension branch from 9c9c419 to cf99cb0 Compare December 9, 2024 11:22
@drsk0 drsk0 force-pushed the primed_for_suspension branch from cf99cb0 to e04d097 Compare December 9, 2024 11:39
@drsk0 drsk0 mentioned this pull request Dec 9, 2024
6 tasks
Copy link
Contributor

@eb-concordium eb-concordium left a comment

Choose a reason for hiding this comment

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

Looks good to me (modulo existing comments)! 💪

@drsk0 drsk0 requested a review from td202 December 9, 2024 17:05
@drsk0 drsk0 dismissed td202’s stale review December 9, 2024 17:06

td202 is on holiday, all requested changes have been discussed/implemented.

@drsk0 drsk0 removed the request for review from td202 December 9, 2024 17:06
@drsk0 drsk0 merged commit 182a32b into main Dec 10, 2024
3 checks passed
@drsk0 drsk0 deleted the primed_for_suspension branch December 10, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants