Skip to content

fix(transformations): correct head vote assessment for missed slots#242

Open
samcm wants to merge 2 commits into
masterfrom
fix/head-correctness-missed-slots
Open

fix(transformations): correct head vote assessment for missed slots#242
samcm wants to merge 2 commits into
masterfrom
fix/head-correctness-missed-slots

Conversation

@samcm

@samcm samcm commented Mar 16, 2026

Copy link
Copy Markdown
Member

Summary

When a slot has a missed block proposal, the correct head vote per the Ethereum spec is the most recent canonical ancestor block. Both fct_attestation_vote_correctness_by_validator and fct_attestation_correctness_by_validator_head incorrectly penalized validators who correctly voted for that ancestor block.

  • fct_attestation_vote_correctness_by_validator: Added expected_head CTE that resolves the correct head block_root for each duty slot (the most recent canonical block at or before that slot). head_correct now compares the validator's voted head_root against the expected head rather than comparing slot numbers.
  • fct_attestation_correctness_by_validator_head: Added expected_head CTE that resolves the expected head slot for each duty slot. slot_distance is now computed as expected_head.slot - blocks.slot instead of duties.slot - blocks.slot, so voting for the correct ancestor gives distance 0.

Impact: ~14 missed slots per day on mainnet, each affecting ~29k+ attesting validators, totaling ~400k+ validator-slot rows per day incorrectly marked as wrong head votes.

When a slot has a missed block proposal, the correct head vote is the
most recent canonical ancestor block. Both models incorrectly marked
validators as wrong for voting for that ancestor block.

- fct_attestation_vote_correctness_by_validator: compare head_root
  against expected head (most recent canonical block at or before duty
  slot) instead of comparing duty slot against voted block slot
- fct_attestation_correctness_by_validator_head: compute slot_distance
  relative to expected head slot instead of duty slot
@samcm
samcm requested a review from Savid as a code owner March 16, 2026 01:53
Add missed-slot head correctness assertions to
fct_attestation_correctness_by_validator_head tests.
Create test file for fct_attestation_vote_correctness_by_validator
with comprehensive assertions including missed-slot validation.
@samcm
samcm force-pushed the fix/head-correctness-missed-slots branch from b7b0269 to a7d8ef6 Compare March 16, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants