Let exits use consolidation queue (EIP-8080)#5116
Draft
barnabasbusa wants to merge 4 commits intoethereum:masterfrom
Draft
Let exits use consolidation queue (EIP-8080)#5116barnabasbusa wants to merge 4 commits intoethereum:masterfrom
barnabasbusa wants to merge 4 commits intoethereum:masterfrom
Conversation
…8080) Modify compute_exit_epoch_and_update_churn so that whenever the exit queue is longer than the consolidation queue, the exit is routed through compute_consolidation_epoch_and_update_churn with a 2/3 balance conversion factor. This reflects the relative weak-subjectivity impact of exit vs. consolidation churn, democratizes an existing loophole currently only available to validators holding >= 2048 ETH, and increases maximum exit throughput ~2.5x without changing the total weak-subjectivity budget. Tests cover: no routing when queues are equal, no routing when the consolidation queue is longer, routing when the exit queue is longer, the 2/3 conversion factor, one-epoch edge case, and that exit-queue state is preserved when a routing occurs.
On small test states get_consolidation_churn_limit(state) rounds to zero (no floor, unlike activation/exit churn). Routing an exit through compute_consolidation_epoch_and_update_churn with zero per-epoch churn triggers a divide-by-zero. The guard skips the reroute whenever consolidation churn is unusable, so the exit stays on the exit queue. Rewrite routing-path unit tests to use scaled_churn_balances_exceed_activation_exit_churn_limit, which guarantees a non-zero consolidation churn. Add a small-state test documenting the zero-churn-no-routing branch.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements EIP-8080 ("Let exits use the consolidation queue") at the Gloas fork.
Spec change
Single function override in
specs/gloas/beacon-chain.md— Modifiedcompute_exit_epoch_and_update_churn. Adds a routing prefix that checks whether the exit queue has grown longer than the consolidation queue; if so, the exit is satisfied throughcompute_consolidation_epoch_and_update_churnwithexit_balanceconverted by the2/3factor that reflects the relative weak-subjectivity weight of exit vs. consolidation churn.Intro bullet list updated to reference EIP-8080.
No new constants, no new state fields, no fork transition logic.
Composition with EIP-8061 (#5061)
This PR is written against current
master, so the inner churn-limit call in the preserved tail ofcompute_exit_epoch_and_update_churnis stillget_activation_exit_churn_limit(state)(the Electra form). If #5061 lands first, this PR needs a one-line update in the same function to switch toget_exit_churn_limit(state)— mechanical rebase, no semantic change.The EIP-8080 addition and the EIP-8061 rewrite are orthogonal: 8080 adds a routing prefix, 8061 changes the churn-limit accessor in the tail. They compose cleanly regardless of merge order.
Design notes
earliest_exit_epoch/earliest_consolidation_epoch(bothmax()-clamped toactivation_exit_epoch), matching the "full function" form in the EIP and the correction in ethereum/EIPs#10883.Gwei(2 * exit_balance // 3)wrap is required by the mypy type check (theGweityped constant is not auto-coerced from the dividedint).2/3of a unit of consolidation churn, so the total weak-subjectivity impact is preserved whether consolidation churn is spent on consolidations or on rerouted exits.Tests
Six unit tests under
tests/core/pyspec/eth_consensus_specs/test/gloas/unittests/test_compute_exit_epoch_and_update_churn.py:2/3conversion factor applied toexit_balancewhen routedearliest_exit_epoch,exit_balance_to_consume) are preserved across a routing callLocal verification:
make lintclean, all 6 tests pass on theminimalpreset.Test plan
per_epoch_churnaccessor accordinglyearliest_consolidation_epochbookkeeping when exits and consolidations arrive in the same blockRelated