Skip to content

Fix ssz formatting for /light_client/updates beacon API endpoint #7806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 15, 2025

Conversation

eserilev
Copy link
Member

@eserilev eserilev commented Jul 28, 2025

Issue Addressed

#7759

Proposed Changes

We were incorrectly encoding the full response from /light_client/updates instead of only encoding the light client update

Additional Notes

This repo has a script that verifies light client data. I've used the repo to verify lc updates generated from both lodestar and lighthouse

https://github.com/eserilev/verify_light_client_update/tree/main

@eserilev eserilev added bug Something isn't working light-client work-in-progress PR is a work-in-progress labels Jul 28, 2025
@eserilev eserilev force-pushed the light_client_update_ssz_bug branch from 4c84840 to 8de9157 Compare July 28, 2025 23:52
@eserilev eserilev added ready-for-review The code is ready for review and removed work-in-progress PR is a work-in-progress labels Jul 29, 2025
Copy link

mergify bot commented Jul 29, 2025

Some required checks have failed. Could you please take a look @eserilev? 🙏

@mergify mergify bot 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 Jul 29, 2025
@mergify mergify bot 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 Aug 1, 2025
@eserilev eserilev added the v8.0.0-rc.0 Q3 2025 release for Fusaka on Holesky label Aug 5, 2025
@michaelsproul michaelsproul self-requested a review August 5, 2025 00:58
Comment on lines 849 to 859
fn ssz_append(&self, buf: &mut Vec<u8>) {
buf.extend_from_slice(&self.response_chunk_len.to_le_bytes());
buf.extend_from_slice(&self.response_chunk.context);
match &self.response_chunk.payload {
LightClientUpdate::Altair(lc) => lc.ssz_append(buf),
LightClientUpdate::Capella(lc) => lc.ssz_append(buf),
LightClientUpdate::Deneb(lc) => lc.ssz_append(buf),
LightClientUpdate::Electra(lc) => lc.ssz_append(buf),
LightClientUpdate::Fulu(lc) => lc.ssz_append(buf),
};
}
Copy link
Member

Choose a reason for hiding this comment

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

This looks a bit sus to me, how does this differ from what derive generates?

Copy link
Member Author

Choose a reason for hiding this comment

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

you're right, the match is exactly what derive generates. I cleaned things up a bit 67b45a9

Copy link

mergify bot commented Aug 13, 2025

Some required checks have failed. Could you please take a look @eserilev? 🙏

@mergify mergify bot 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 Aug 13, 2025
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.

LGTM!

@jimmygchen jimmygchen added ready-for-merge This PR is ready to merge. and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Aug 15, 2025
mergify bot added a commit that referenced this pull request Aug 15, 2025
mergify bot added a commit that referenced this pull request Aug 15, 2025
@mergify mergify bot merged commit 90fa7c2 into sigp:unstable Aug 15, 2025
34 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. v8.0.0-rc.0 Q3 2025 release for Fusaka on Holesky
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants