Skip to content

Add fork-choice tests for should_apply_proposer_boost - #5441

Merged
jtraglia merged 2 commits into
ethereum:masterfrom
ensi321:nc/gloas-should-apply-proposer-boost-tests
Jul 9, 2026
Merged

Add fork-choice tests for should_apply_proposer_boost#5441
jtraglia merged 2 commits into
ethereum:masterfrom
ensi321:nc/gloas-should-apply-proposer-boost-tests

Conversation

@ensi321

@ensi321 ensi321 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Lodestar currently passing all fork choice spec test without having should_apply_proposer_boost implemented.

Add 4 test vectors that mirror the conditions in should_apply_proposer_boost:

  • parent not adjacent -> boost applies
  • parent not weak -> boost applies
  • no equivocation -> boost applies
  • withhold -> boost withheld

Add MC/DC coverage for the gloas `should_apply_proposer_boost` gate with four
generator vectors:
  - parent not adjacent  -> boost applies
  - parent not weak      -> boost applies
  - no equivocation      -> boost applies
  - withhold             -> boost withheld

The head-discriminating rows engineer a weight tie (weak zero-weight parent vs a
same-slot sibling whose root is tuned to win the fork-choice tiebreak) so the
apply/withhold decision flips `get_head`; each test also asserts the boosted
leaf's weight for clients that validate `viable_for_head_roots_and_weights`.

Add a shared `setup_finalized_store` helper to helpers/fork_choice.py (also
introduced by ethereum#5385; identical, drop one on merge).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the testing CI, actions, tests, testing infra label Jul 9, 2026
Comment thread tests/core/pyspec/eth_consensus_specs/test/helpers/fork_choice.py
@ensi321 ensi321 changed the title test: add spec test for should_apply_proposer_boost Add fork-choice tests for gloas should_apply_proposer_boost Jul 9, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@jtraglia jtraglia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me, thanks @ensi321!

@jtraglia jtraglia changed the title Add fork-choice tests for gloas should_apply_proposer_boost Add fork-choice tests for should_apply_proposer_boost Jul 9, 2026
@jtraglia
jtraglia merged commit 83d3d91 into ethereum:master Jul 9, 2026
17 checks passed
ensi321 added a commit to ensi321/consensus-specs that referenced this pull request Aug 26, 2026
The compliance test generator delivers every block at its slot start,
and the untargeted random mutations almost never move an equivocating
sibling, so same-slot same-proposer blocks in generated vectors are in
practice always timely. Timeliness-sensitive logic keyed on
equivocations is therefore only exercised in one direction: for
`should_apply_proposer_boost`, the case where a sibling exists but is
not PTC-timely, so the boost must be applied despite the equivocation,
never appears. That direction is currently covered only by the fixed
vectors from ethereum#5441.

Add a mutation operator that finds same-slot same-proposer block pairs
in the test vector and moves one of the pair to a random whole second
within its own or the following slot, straddling the intra-slot
timeliness deadlines. All copies of the delayed block move together
since timeliness is recorded at first import. Vectors without proposer
equivocations are unaffected.
ensi321 added a commit to ensi321/consensus-specs that referenced this pull request Aug 26, 2026
The compliance test generator delivers every block at its slot start,
and the untargeted random mutations almost never move an equivocating
sibling, so same-slot same-proposer blocks in generated vectors are in
practice always timely. Timeliness-sensitive logic keyed on
equivocations is therefore only exercised in one direction: for
`should_apply_proposer_boost`, the case where a sibling exists but is
not PTC-timely, so the boost must be applied despite the equivocation,
never appears. That direction is currently covered only by the fixed
vectors from ethereum#5441.

Add a mutation operator that finds same-slot same-proposer block pairs
in the test vector and moves one of the pair to a random whole second
within its own or the following slot, straddling the intra-slot
timeliness deadlines. All copies of the delayed block move together
since timeliness is recorded at first import. Vectors without proposer
equivocations are unaffected.
gitToki pushed a commit to gitToki/prysm that referenced this pull request Sep 9, 2026
- Bump consensus spec tests from v1.7.0-alpha.12 to v1.7.0-beta.0,
through alpha.13 and alpha.14
- alpha.13: Look up payload availability at the parent block's slot
([consensus-specs#5473](ethereum/consensus-specs#5473))
- alpha.13: Enable equivocation tracking by default, gated on the early
cutoff window, required by the `should_apply_proposer_boost` fork-choice
tests
([consensus-specs#5441](ethereum/consensus-specs#5441))
- alpha.13: Source KZG spec test vectors from
ethereum/cryptography-specs
([consensus-specs#5398](ethereum/consensus-specs#5398))
- alpha.14: Explicitly set bid fields, including the slot, when
upgrading to Gloas
([consensus-specs#5550](ethereum/consensus-specs#5550),
[consensus-specs#5553](ethereum/consensus-specs#5553))
- alpha.14: Disallow proposer reorgs at epoch boundaries before Fulu
([consensus-specs#5547](ethereum/consensus-specs#5547))
- alpha.14: Refresh ethspecify references, add exceptions for named SSZ
collections
([consensus-specs#5528](ethereum/consensus-specs#5528)),
executable gossip validation functions
([consensus-specs#5294](ethereum/consensus-specs#5294)),
and the gas limit schedule
([consensus-specs#5533](ethereum/consensus-specs#5533))
- beta.0: Reject bids whose block hash equals the parent block hash, in
state transition and gossip
([consensus-specs#5594](ethereum/consensus-specs#5594),
cherry-picked from OffchainLabs#17443)
- beta.0: Read the parent slot from the latest block header when
applying the parent payload
([consensus-specs#5554](ethereum/consensus-specs#5554))
- beta.0: Rename the PTC SSZ types to `PayloadTimelinessCommittee*` in
ethspecify references
([consensus-specs#5558](ethereum/consensus-specs#5558))
- The beta.0 `minimal.tar.gz` is not published yet, so the WORKSPACE
minimal hash still points at alpha.14 and will be updated once the asset
lands

---------

Co-authored-by: Potuz <potuz@prysmaticlabs.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing CI, actions, tests, testing infra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants