test: integrate fork choice test vectors#1314
Open
unnawut wants to merge 7 commits intoReamLabs:masterfrom
Open
test: integrate fork choice test vectors#1314unnawut wants to merge 7 commits intoReamLabs:masterfrom
unnawut wants to merge 7 commits intoReamLabs:masterfrom
Conversation
unnawut
commented
Mar 18, 2026
Comment on lines
126
to
159
Contributor
Author
There was a problem hiding this comment.
triggers an actual tick so attestations get aggregated
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.
What was wrong? & How was it fixed?
I just spotted that we have the fork choice test vectors implemented but they're not being run. After enabling them there were 3 main groups of failures:
(vote_weight, slot, *child_hash)so it's ordered by weight, then slot number first before the hash. In test cases where it intentionally puts 2 blocks of equal votes, but the block at lower slot has a higher lexical block, the test failed. --> This is fixed by removing slot from the tuple.on_block(), the fork choice store collects the attestation data fromblock.body.attestationsintoattestation_data_by_root_provider, but it doesn't collect fromBlockWithAttestation::proposer_attestationso in test vectors where it's quite normal to have a block with only the proposer's attestation and no non-proposer attestation, the fork choice store won't have the attestation data, and so won't aggregate the proposer's attestation and so the weight is never updated. --> Fixed by adding proposer's attestation data toattestation_data_by_root_providerSignature::blank()while the test vectors are using real signatures now. -> Fixed by downloading the keys from https://github.com/leanEthereum/leansig-test-keys and use them in lean-spec-testsNote that there are 2 changes to the fork choice store logic, but I think at most it would make the weights stronger so hopefully this doesn't break our devnet participation.
To-Do