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

Add missed exit checks to consolidation processing #14603

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

terencechain
Copy link
Member

This PR adds a couple of checks that were missing from the consolidation request processing when handling a voluntary exit. These checks are:

assert current_epoch >= source_validator.activation_epoch + SHARD_COMMITTEE_PERIOD
assert get_pending_balance_to_withdraw(state, source_index) == 0

reference: ethereum/consensus-specs#4000

@terencechain terencechain added the Electra electra hardfork label Nov 1, 2024
@terencechain terencechain requested a review from a team as a code owner November 1, 2024 18:33
james-prysm
james-prysm previously approved these changes Nov 1, 2024
@@ -258,6 +265,18 @@ func ProcessConsolidationRequests(ctx context.Context, st state.BeaconState, req
continue
}

if curEpoch < srcV.ActivationEpoch+params.BeaconConfig().ShardCommitteePeriod {
Copy link
Member

Choose a reason for hiding this comment

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

Overflow shouldn't be possible here since we verified that srcV is active, but we could defensively future proof here with an overflow check or math.SafeAdd.

What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

@terencechain terencechain added the Ready For Review A pull request ready for code review label Nov 2, 2024
prestonvanloon
prestonvanloon previously approved these changes Nov 2, 2024
james-prysm
james-prysm previously approved these changes Nov 4, 2024
@james-prysm
Copy link
Contributor

gaz

@james-prysm
Copy link
Contributor

hmm tests failing?

@terencechain terencechain added the Blocked Blocked by research or external factors label Nov 4, 2024
@terencechain
Copy link
Member Author

hmm tests failing?

Blocked by new spec tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked Blocked by research or external factors Electra electra hardfork Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants