Skip to content

Fix PublishBlockRequest SSZ decoding#5078

Merged
michaelsproul merged 3 commits intosigp:unstablefrom
michaelsproul:publish-block-decoding-fix
Jan 19, 2024
Merged

Fix PublishBlockRequest SSZ decoding#5078
michaelsproul merged 3 commits intosigp:unstablefrom
michaelsproul:publish-block-decoding-fix

Conversation

@michaelsproul
Copy link
Member

@michaelsproul michaelsproul commented Jan 16, 2024

Issue Addressed

Fix the SSZ decoder for the POST block endpoints (both v1 and v2). They were buggy due to interpreting the SSZ length at the start of the buffer as the slot. Credit to @realbigsean for the find.

Proposed Changes

Use the ForkName derived from the POST header. That's what it's there for 🤷‍♂️

Additional Info

I've updated one of the tests to exercise the fork decoding more. Our existing tests that hit this codepath just happened to work because the misinterpreted slot matched the fork schedule 😱

@michaelsproul michaelsproul added bug Something isn't working work-in-progress PR is a work-in-progress HTTP-API v4.6.0 ETA Q1 2024 labels Jan 16, 2024
@michaelsproul michaelsproul added ready-for-review The code is ready for review and removed work-in-progress PR is a work-in-progress labels Jan 19, 2024
Copy link
Member

@realbigsean realbigsean 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! There's just a lint to fix, I think that's what's breaking CI

@michaelsproul michaelsproul added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Jan 19, 2024
@michaelsproul michaelsproul merged commit 185646a into sigp:unstable Jan 19, 2024
@michaelsproul michaelsproul deleted the publish-block-decoding-fix branch January 19, 2024 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working HTTP-API ready-for-merge This PR is ready to merge. v4.6.0 ETA Q1 2024

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants