Skip to content

Conversation

eserilev
Copy link
Member

@eserilev eserilev commented Mar 7, 2025

This fixes a bug where, after a fork, we construct invalid light client updates for at least two epochs (until we reach finality). This is because the beacon states finalized checkpoint lies on the previous fork for at least the first two epochs. We will try to use that finalized checkpoint to construct a finalized light client header for the current fork variant instead of the previous fork variant.

This PR adds a check that the finalized_header.fork_name == attested_header.fork_name. If the check fails, we construct a "default" finalized light client header, one whose values are all set to 0x0.

Note that this also resolves an issue that we thought was related to light client data construction requiring fork epochs to be divisible by 256. I've tested on kurtosis with electra_epoch = 1 and the node was able to construct light client updates without any problems.

I've also re-introduced verifying light client updates in basic-sim

@eserilev eserilev added the ready-for-review The code is ready for review label Mar 7, 2025
Copy link
Collaborator

@dapplion dapplion left a comment

Choose a reason for hiding this comment

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

Nice find and solution!

Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

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

Looks good

Just a few suggested edits

@michaelsproul michaelsproul added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Mar 11, 2025
@eserilev eserilev added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Mar 11, 2025
@michaelsproul michaelsproul added the v7.0.0-beta.clean Clean release post Holesky rescue label Mar 13, 2025
@michaelsproul michaelsproul added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Mar 17, 2025
mergify bot added a commit that referenced this pull request Mar 17, 2025
@mergify mergify bot merged commit 9db29b0 into sigp:release-v7.0.0 Mar 17, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working light-client ready-for-merge This PR is ready to merge. v7.0.0-beta.clean Clean release post Holesky rescue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants