Add equivocation_delay mutation to fork choice compliance tests - #5572
Open
ensi321 wants to merge 1 commit into
Open
Add equivocation_delay mutation to fork choice compliance tests#5572ensi321 wants to merge 1 commit into
equivocation_delay mutation to fork choice compliance tests#5572ensi321 wants to merge 1 commit into
Conversation
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.
ericsson49
reviewed
Aug 28, 2026
ericsson49
left a comment
Contributor
There was a problem hiding this comment.
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" |
Contributor
There was a problem hiding this comment.
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.
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.
Introduce randomized delay to equivocating sibling. This is particularly important to test out
should_apply_proposer_boostwith the case where a sibling exists but not PTC-timely.Vectors without proposer equivocations are unaffected.