perf(pbs): always request SSZ from relays on get_header#481
Open
JasonVranek wants to merge 8 commits into
Open
perf(pbs): always request SSZ from relays on get_header#481JasonVranek wants to merge 8 commits into
JasonVranek wants to merge 8 commits into
Conversation
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.
PBS decodes and validates every relay bid and the route re-encodes the winning bid to the beacon node's Accept regardless, so the relay->PBS wire format never changes what the BN receives. Always request SSZ (JSON fallback) instead of mirroring the caller's format: SSZ is smaller on the wire and faster to decode, which matters across N relay bids on the proposal critical path. Mirrors the same change already made to submit_block. Adds a test asserting the relay receives an SSZ-first Accept regardless of the BN's preference (the mock relay now records the Accept it was sent), and updates the now-stale build_outbound_accept doc comment.
JasonVranek
force-pushed
the
pr/ssz-submit-block
branch
from
July 24, 2026 21:58
7939e87 to
a374d82
Compare
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.
PBS decodes and validates every relay bid and the route re-encodes the winning bid to the beacon node's Accept regardless, so the relay->PBS wire format never changes what the BN receives. Always request SSZ (JSON fallback) instead of mirroring the caller's format: SSZ is smaller on the wire and faster to decode, which matters across N relay bids on the proposal critical path. Mirrors the same change already made to submit_block.