fix(http): unwrap JSON data envelope for execution payload envelopes#36
Open
samcm wants to merge 2 commits into
Open
fix(http): unwrap JSON data envelope for execution payload envelopes#36samcm wants to merge 2 commits into
samcm wants to merge 2 commits into
Conversation
The JSON path of SignedExecutionPayloadEnvelope and
AgnosticSignedExecutionPayloadEnvelope passed the raw response body to
UnmarshalJSON, which fails with "message missing" because beacon nodes
wrap the payload as {"version":...,"data":{...}}. Use
decodeJSONResponse like the other endpoints so the data field is
extracted (and response metadata preserved). SSZ responses were
unaffected, which hid the bug from SSZ-preferring clients.
The beacon-API eventstream spec wraps payload_attestation_message,
execution_payload_bid and proposer_preferences as
{"version": ..., "data": {...}}. Lighthouse follows the spec; Prysm
still sends the bare object. Decode the wrapper when present and fall
back to the bare shape, so both clients parse.
Observed live on glamsterdam-devnet-6: every lighthouse PTC message
failed with 'invalid JSON: beacon block root missing'.
Member
Author
|
Pushed a second fix to this branch: the gloas SSE events ( |
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.
The JSON path of
SignedExecutionPayloadEnvelopeandAgnosticSignedExecutionPayloadEnvelopepassed the raw response body toUnmarshalJSON, which fails withmessage missingbecause beacon nodes wrap the payload as{"version":...,"data":{...}}. SSZ responses were unaffected, which hid the bug from SSZ-preferring clients — xatu cannon negotiates JSON and could not fetch any envelope from glamsterdam-devnet-6 (every envelope-sourced deriver failed).Fix: use
decodeJSONResponselike the other endpoints so thedatafield is extracted and response metadata is preserved.Verification:
{version, execution_optimistic, finalized, data}— unwrappingdatais the spec-mandated behavior, not a client quirk./eth/v1/node/version+ envelope requests through the network's load-balanced endpoint).Side observation from testing (not addressed here): envelope retention varies by client — Nimbus serves historical envelopes, Prysm only a narrow near-head window (404
execution payload envelope not foundotherwise).