-
Notifications
You must be signed in to change notification settings - Fork 996
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
eip7251: Add missed exit checks to consolidation processing #4000
Conversation
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.
This makes sense to me.
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.
Great catch. Thank you! I see no issues.
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.
looks good; nice catch!
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
A side note, the cause of this issue makes me think that we need one function that checks all exit conditions to be used in already three places: voluntary_exit, withdrawal_request and consolidation_request processing. This can be done in a separate PR |
lgtm :) |
A couple of checks that the protocol does when processing a voluntary exit was not included into consolidation request processing, this PR fixes that, those checks are:
assert current_epoch >= source_validator.activation_epoch + SHARD_COMMITTEE_PERIOD
assert get_pending_balance_to_withdraw(state, source_index) == 0
Since the exit is the first step of consolidation process, it makes sense to preserve all invariants that we have for voluntary exit conditions. cc @fradamt