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

Refactor upgrade_to_electra() #3711

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions specs/electra/fork.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,18 @@ def upgrade_to_electra(pre: deneb.BeaconState) -> BeaconState:
deposit_receipts_start_index=UNSET_DEPOSIT_RECEIPTS_START_INDEX,
# [New in Electra:EIP7251]
deposit_balance_to_consume=0,
exit_balance_to_consume=get_activation_exit_churn_limit(pre),
exit_balance_to_consume=0,
earliest_exit_epoch=earliest_exit_epoch,
consolidation_balance_to_consume=get_consolidation_churn_limit(pre),
consolidation_balance_to_consume=0,
earliest_consolidation_epoch=compute_activation_exit_epoch(get_current_epoch(pre)),
pending_balance_deposits=[],
pending_partial_withdrawals=[],
pending_consolidations=[],
)

post.exit_balance_to_consume = get_activation_exit_churn_limit(post)
post.consolidation_balance_to_consume = get_consolidation_churn_limit(post)

# [New in Electra:EIP7251]
# add validators that are not yet active to pending balance deposits
pre_activation = sorted([
Expand Down
Loading