Uh oh!
There was an error while loading. Please reload this page.
Rewrite submit_block relay communication to support SSZ and JSON - #468
Conversation
c800921 to
cbf451dCompared468365 to
3740824Compare3740824 to
0d76e5cCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
77f7d4f to
7e7d8b7CompareUh oh!
There was an error while loading. Please reload this page.
7e7d8b7 to
f113898CompareUh oh!
There was an error while loading. Please reload this page.
f113898 to
5085cdfCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
7939e87 to
a374d82CompareUh oh!
There was an error while loading. Please reload this page.
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.
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