Validator activation queue off by one#50
Merged
JamesEjembi merged 2 commits intoJun 27, 2026
Merged
Conversation
…or-activation Fix validator activation epoch boundary
JamesEjembi
approved these changes
Jun 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
activation_epoch == current_epochcould be skipped and never activated.Description
src/validator/activation_queue.rswithMAX_PENDING_VALIDATORS,compute_activation_epoch(), capacity/duplicate checks and an inclusive drain (activation_epoch <= current_epoch).src/validator/mod.rsand extendingValidatorSetinsrc/validator/validator_set.rswith aPendingstatus, anactivation_queuefield,add_pending_validator(),activate_validator(),queued_activations()andprocess_activation_queue()that activates drained validators exactly once.tests/activation_queue_test.rsthat verify boundary-epoch activation, multiple validators sharing the boundary, future delayed activation usingcompute_activation_epoch(), and duplicate/capacity rejection.Testing
cargo test --test activation_queue_testand all activation-queue tests passed.cargo test --test exit_queue_ordering_testand the existing exit-queue ordering tests passed.cargo testand the repository tests completed successfully with no failures.Closes #16