Rewrite submit_block relay communication to support SSZ and JSON - #468
Merged
Conversation
JasonVranek
force-pushed
the
pr/ssz-routes
branch
2 times, most recently
from
June 2, 2026 03:30
c800921 to
cbf451d
Compare
JasonVranek
force-pushed
the
pr/ssz-routes
branch
from
June 9, 2026 20:53
a52b531 to
2565c31
Compare
JasonVranek
force-pushed
the
pr/ssz-submit-block
branch
from
July 10, 2026 20:23
d468365 to
3740824
Compare
JasonVranek
force-pushed
the
pr/ssz-submit-block
branch
from
July 10, 2026 22:29
3740824 to
0d76e5c
Compare
0w3n-d
reviewed
Jul 13, 2026
ninaiiad
suggested changes
Jul 14, 2026
JasonVranek
force-pushed
the
pr/ssz-submit-block
branch
from
July 14, 2026 19:20
77f7d4f to
7e7d8b7
Compare
JasonVranek
force-pushed
the
pr/ssz-submit-block
branch
from
July 14, 2026 19:40
7e7d8b7 to
f113898
Compare
JasonVranek
force-pushed
the
pr/ssz-submit-block
branch
from
July 14, 2026 21:52
f113898 to
5085cdf
Compare
ManuelBilbao
previously approved these changes
Jul 14, 2026
ninaiiad
approved these changes
Jul 15, 2026
ltitanb
reviewed
Jul 21, 2026
ltitanb
approved these changes
Jul 24, 2026
ManuelBilbao
approved these changes
Jul 24, 2026
content negotiation. Includes: - SSZ-first request encoding with JSON fallback on 406/415 - Content-Type and Eth-Consensus-Version header handling - Fork-aware SSZ decoding for relay responses - MIME parameter tolerance on relay response Content-Type - v2 to v1 fallback forwards payload to BN (prevents silent block loss) - V2 fallback metric counter - Comprehensive submit_block integration tests for both encodings
- L275 pass headers by ref - L350 / L386 use content_type_header - L508 drop redundant to_string - bump transitive dep versions for CI
- JsonEncode error instead of unwrap() for both submit_block and register_validators - json timeout budget now accounts for prior ssz attempt
…n v1-only relays Content negotiation (Builder API): - Missing Accept defaults the response to JSON instead of inheriting the request Content-Type; request and response encodings are independent. - v2 succeeds with an empty 202 and has no body to negotiate, so it skips Accept entirely -- a bad Accept no longer 406s a v2 submission before it reaches a relay. - An unrecognized request Content-Type returns 415 instead of 400. - Always request SSZ from the relay (JSON fallback) rather than mirroring the caller's format: PBS decodes and re-validates the payload and the route re-encodes to the BN's Accept regardless, so SSZ is the fastest wire format on the relay hop. Fail loud on v1-only relays: - Drop the v2->v1 fallback. It returned the relay's v1 payload as a 200 body, but a v2 caller (Lighthouse, Prysm) requires exactly 202 and never reads the body, so the block was silently dropped. PBS cannot publish the payload itself, so a relay that 404s v2 now fails loud (RELAY_V2_UNSUPPORTED) and other relays still get a chance.
JasonVranek
force-pushed
the
pr/ssz-submit-block
branch
from
July 24, 2026 21:58
7939e87 to
a374d82
Compare
JasonVranek
added a commit
that referenced
this pull request
Aug 11, 2026
Adds the ePBS (gloas) builder-API surface and the strict header rulings, rebased onto main so it sits on top of the SSZ rewrite (#468) and the fork-from-slot fix (#487). ePBS endpoints: - getExecutionPayloadBid, submitBuilderPreferences, submitSignedBeaconBlock, with per-builder routing by SignedRequestAuth.data (no Eth-Builder-Url). - SSZ-first request/response with JSON fallback; the bid poll ladder honors the proposer's timing headers. Header discipline (builder-specs #165): - Eth-Consensus-Version required for JSON and SSZ on the request-auth endpoints; absent -> MissingVersionHeader, present-but-unsupported -> InvalidVersionHeader, both 400. The accepted set is Gloas only; any other fork name is a client bug. - A relay bid whose response fork is not Gloas on the Gloas-only endpoint is a bad relay response: dropped, never forwarded under the wrong fork. Status + observability: - zero addressed builders accepting an ePBS submission maps to 500, not 502 (neither endpoint declares 502); new PbsClientError::NoBuilderResponse. - decode/accept rejections counted in BEACON_NODE_STATUS via record_client_error; dropped relay responses in pbs_relay_invalid_response_total{reason,endpoint,relay_id}. Legacy PBS, the websocket get_header stream (#483), and the #487 fork fix are unchanged. Suite green, clippy clean.
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.
Summary
Rewrites submit_block relay communication to support SSZ and JSON content negotiation.
What's in this PR
V2_FALLBACK_TO_V1metric counter for observabilityReview notes
The v2→v1 fallback behavior is an intentional change from the previous code which silently discarded the v1 payload. The beacon node needs the unblinded execution payload to broadcast the block (returning an empty 202 on fallback would cause silent block loss).
Part 3 of 4: SSZ types → get_header → submit_block → validation bypassing
Attribution
This work builds on the SSZ builder flow originally implemented by @eserilev
in #252 and ported to the current codebase by @jclapis in #403.
Co-authored-by: Eitan Seri-Levi eserilev@ucsc.edu
Co-authored-by: Joe Clapis jclapis@outlook.com