Skip to content

Exclude slashed validators from all duties (EIP-8045)#5115

Open
barnabasbusa wants to merge 4 commits intoethereum:masterfrom
barnabasbusa:eip-8045-exclude-slashed-from-duties
Open

Exclude slashed validators from all duties (EIP-8045)#5115
barnabasbusa wants to merge 4 commits intoethereum:masterfrom
barnabasbusa:eip-8045-exclude-slashed-from-duties

Conversation

@barnabasbusa
Copy link
Copy Markdown
Member

@barnabasbusa barnabasbusa commented Apr 16, 2026

Summary

Implements EIP-8045 ("Exclude slashed validators from all duties") at the Gloas fork. Paired with the EIP text update in ethereum/EIPs#11443.

Spec changes (specs/gloas/beacon-chain.md)

  • Modified get_beacon_proposer_indices — filter slashed validators out of the active set upfront, before invoking compute_proposer_indices. The EIP-7917 proposer_lookahead is populated from this function each epoch, so it is guaranteed to contain only active and unslashed validators.
  • Modified compute_balance_weighted_selection — in-loop slashed skip after the candidate is drawn. Because Gloas routes sync committee selection, proposer selection, and PTC selection (get_next_sync_committee_indices, compute_proposer_indices, compute_ptc) through this helper, a single change covers every balance-weighted duty, including any future one built on the same primitive.

The two layers intentionally use different filtering strategies, consistent with the EIP's rationale: upfront for proposer (small candidate set, avoids wasted shuffling work), in-loop for the helper (matches its existing iterative acceptance-check shape).

Intro bullet list updated to reference EIP-8045 alongside EIP-7732. No new state fields, no fork transition logic, so specs/gloas/fork.md is untouched.

Scope note

EIP-8045 targets balance-weighted duty selection. Attestation beacon committees (compute_committee) are not modified — they're shuffle-based, not balance-weighted, and slashed attestors are already rejected at process_attestation time. See the EIP text for the full rationale.

Design notes

  • proposer_lookahead is pre-computed once per epoch by process_proposer_lookahead. A validator slashed inside an already-populated lookahead window is not retroactively removed — the EIP security considerations explicitly accept this, since with EIP-7917 the lookahead is state-resident and slashings no longer reshuffle it.
  • With the proposer-level upfront filter in place, the compute_balance_weighted_selection slashed skip is a defense-in-depth no-op for the proposer path, but load-bearing for sync committee and PTC.
  • No get_next_sync_committee_indices override needed in this PR — the Gloas version already calls compute_balance_weighted_selection, and the updated EIP text (Update EIP-8045: Exclude slashed validators from all duties EIPs#11443) was trimmed accordingly.

Tests

All six EIP test cases (plus PTC coverage) are included under tests/core/pyspec/eth_consensus_specs/test/gloas/:

  • Slashed validators absent from newly-appended entries of state.proposer_lookahead after process_proposer_lookahead
  • Full SLOTS_PER_EPOCH lookahead entries still produced with many slashed validators
  • Slashed validators absent from get_next_sync_committee_indices output
  • Full SYNC_COMMITTEE_SIZE committee produced with many slashed validators
  • compute_balance_weighted_selection skips slashed (shuffled path)
  • compute_balance_weighted_selection skips slashed (in-order path, PTC code path)
  • compute_ptc excludes slashed validators from every slot's PTC
  • Existing EIP-7917 invariant (slashing inside the filled lookahead window does not mutate preserved entries) — already covered by test/fulu/epoch_processing/test_process_proposer_lookahead.py

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

Test plan

  • CI passes on all presets
  • Cross-client review of slashed-skip behavior in mass-slashing regimes

Related

Filter slashed validators from the proposer candidate pool upfront in
get_beacon_proposer_indices, so the EIP-7917 proposer_lookahead only
contains active and unslashed indices.

Add an in-loop slashed skip to compute_balance_weighted_selection,
which transitively covers sync committee selection
(get_next_sync_committee_indices), the payload timeliness committee
(compute_ptc), and any future duty selection built on this primitive.
@github-actions github-actions Bot added the gloas label Apr 16, 2026
Covers the six test cases listed in the EIP text:

proposer_lookahead (epoch_processing):
- slashed validators do not appear in the newly appended lookahead
  epoch after process_proposer_lookahead
- a full SLOTS_PER_EPOCH worth of proposers is still produced when
  the bulk of active validators are slashed

compute_balance_weighted_selection (unittests):
- shuffled sampling never returns slashed indices
- in-order sampling (shuffle_indices=False, PTC code path) also
  skips slashed candidates

get_next_sync_committee_indices (unittests):
- sync committee output excludes slashed validators
- a full SYNC_COMMITTEE_SIZE committee is still generated with many
  slashed validators

compute_ptc (unittests):
- every slot's PTC excludes slashed validators
@github-actions github-actions Bot added the testing CI, actions, tests, testing infra label Apr 16, 2026
@barnabasbusa barnabasbusa marked this pull request as ready for review April 16, 2026 12:52
@barnabasbusa barnabasbusa changed the title Gloas: exclude slashed validators from all duties (EIP-8045) add 8045 exclude slashed validators from all duties Apr 16, 2026
@jtraglia jtraglia changed the title add 8045 exclude slashed validators from all duties Exclude slashed validators from all duties (EIP-8045) Apr 16, 2026
The in-loop slashed skip could spin indefinitely whenever every
candidate in the input pool is slashed (e.g. a minimal-preset test
state where every beacon committee member of a slot is slashed,
which compute_ptc passes through this helper). Move the filter
in front of the selection loop so the degenerate all-slashed input
terminates cleanly, and fall back to the original pool when no
unslashed candidates remain so the helper stays live in that edge
case. Also materially faster in realistic cases since we skip
shuffled_index work on slashed candidates.

Local: the full gloas minimal suite ran in 5:56 (1096 passed,
0 failed). With the previous in-loop skip the same suite hung
indefinitely on CI.
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