Skip to content

Add equivocation_delay mutation to fork choice compliance tests - #5572

Open
ensi321 wants to merge 1 commit into
ethereum:masterfrom
ensi321:nc/comptest-equivocation-delay
Open

Add equivocation_delay mutation to fork choice compliance tests#5572
ensi321 wants to merge 1 commit into
ethereum:masterfrom
ensi321:nc/comptest-equivocation-delay

Conversation

@ensi321

@ensi321 ensi321 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Introduce randomized delay to equivocating sibling. This is particularly important to test out should_apply_proposer_boost with the case where a sibling exists but not PTC-timely.

Vectors without proposer equivocations are unaffected.

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.
@github-actions github-actions Bot added the testing CI, actions, tests, testing infra label Aug 26, 2026
@jtraglia
jtraglia requested a review from mkalinin August 27, 2026 00:26

@ericsson49 ericsson49 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me overall.
The only minor point is that it affects weight distribution and can be implemented in a less intrusive way.

groups = self.equivocating_block_groups(tv)
if len(groups) == 0:
# No proposer equivocation in this vector; fall back to a shift.
op_kind = "shift"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice idea!
One minor issue about implementation.
The new mutation kind will behave like "shift" in vast majority of cases. So, if we just append it as one more option, it effectively changes the shift weight.
I think it would be a less intrusive change if we just replace the shift op with the new "equivocation_delay", or maybe split weights between them.

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