-
Notifications
You must be signed in to change notification settings - Fork 303
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
Logic to handle new validators during epoch processing #8874
Logic to handle new validators during epoch processing #8874
Conversation
final BeaconState state, | ||
final ValidatorStatuses validatorStatuses, | ||
final UInt64 currentEpoch) { | ||
final int preValidatorCount = validatorStatuses.getValidatorCount(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd probably call this cachedValidatorCount
final ValidatorStatuses validatorStatuses, | ||
final UInt64 currentEpoch) { | ||
final int preValidatorCount = validatorStatuses.getValidatorCount(); | ||
final int postValidatorCount = state.getValidators().size(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stateValidatorCount
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM just nits.
PR Description
This PR updates epoch processing logic to consider that post-Electra, the validator set can be updated in the mid-epoch processing (this did not happen before). The gist of the change is that we might need to update our
ValidatorStatuses
object, which acts as a cache of the validators in the validator set. We don't ever want to run this logic before Electra, and even in Electra, we only want to do it if we detect the validator set has changed.Fixed Issue(s)
fixes #8849
Documentation
doc-change-required
label to this PR if updates are required.Changelog