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

Closed
wants to merge 5 commits into 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
@terencechain terencechain force-pushed the consolidation-exit-checks branch from 53d5e21 to 386424c Compare November 1, 2024 18:35
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.

prestonvanloon
prestonvanloon previously approved these changes Nov 2, 2024
james-prysm
james-prysm previously approved these changes Nov 4, 2024
@james-prysm james-prysm enabled auto-merge November 4, 2024 16:44
@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

@terencechain terencechain force-pushed the consolidation-exit-checks branch from 7794a0a to 717e122 Compare November 23, 2024 18:49
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants