Skip to content

Let exits use consolidation queue (EIP-8080)#5116

Draft
barnabasbusa wants to merge 4 commits intoethereum:masterfrom
barnabasbusa:eip-8080-exits-use-consolidation-queue
Draft

Let exits use consolidation queue (EIP-8080)#5116
barnabasbusa wants to merge 4 commits intoethereum:masterfrom
barnabasbusa:eip-8080-exits-use-consolidation-queue

Conversation

@barnabasbusa
Copy link
Copy Markdown
Member

Summary

Implements EIP-8080 ("Let exits use the consolidation queue") at the Gloas fork.

Spec change

Single function override in specs/gloas/beacon-chain.mdModified compute_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 through compute_consolidation_epoch_and_update_churn with exit_balance converted by the 2/3 factor 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 of compute_exit_epoch_and_update_churn is still get_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 to get_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

  • The comparison uses the adjusted earliest_exit_epoch / earliest_consolidation_epoch (both max()-clamped to activation_exit_epoch), matching the "full function" form in the EIP and the correction in ethereum/EIPs#10883.
  • The Gwei(2 * exit_balance // 3) wrap is required by the mypy type check (the Gwei typed constant is not auto-coerced from the divided int).
  • Weak-subjectivity budget is unchanged — one unit of exit churn corresponds to 2/3 of 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:

  • No routing when exit and consolidation queues are equal length
  • No routing when consolidation queue is longer than exit queue
  • Routes through consolidation queue when exit queue is longer
  • 2/3 conversion factor applied to exit_balance when routed
  • One-epoch difference is enough to trigger routing (edge case)
  • Exit-queue state fields (earliest_exit_epoch, exit_balance_to_consume) are preserved across a routing call

Local verification: make lint clean, all 6 tests pass on the minimal preset.

Test plan

  • CI passes on all presets
  • Rebase onto Add EIP-8061 churn adjustment tests and config #5061 (or vice versa) once either PR lands and sync the per_epoch_churn accessor accordingly
  • Cross-client review, especially around the interaction with earliest_consolidation_epoch bookkeeping when exits and consolidations arrive in the same block

Related

…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.
@github-actions github-actions Bot added testing CI, actions, tests, testing infra gloas labels Apr 16, 2026
@barnabasbusa barnabasbusa changed the title Gloas: route exits through the consolidation queue when shorter (EIP-8080) Gloas: let exits use consolidation queue (EIP-8080) Apr 16, 2026
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.
@barnabasbusa barnabasbusa changed the title Gloas: let exits use consolidation queue (EIP-8080) add 8080 let exits use consolidation queue Apr 16, 2026
@jtraglia jtraglia changed the title add 8080 let exits use consolidation queue Let exits use consolidation queue (EIP-8080) Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gloas testing CI, actions, tests, testing infra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant