Skip to content

Rewrite submit_block relay communication to support SSZ and JSON#468

Open
JasonVranek wants to merge 1 commit into
pr/ssz-routesfrom
pr/ssz-submit-block
Open

Rewrite submit_block relay communication to support SSZ and JSON#468
JasonVranek wants to merge 1 commit into
pr/ssz-routesfrom
pr/ssz-submit-block

Conversation

@JasonVranek
Copy link
Copy Markdown
Collaborator

Summary

Rewrites submit_block relay communication to support SSZ and JSON content negotiation.

What's in this PR

  • SSZ-first request encoding with automatic JSON fallback on 406/415 (per builder-spec)
  • Content-Type and Eth-Consensus-Version header handling for submit_block
  • Fork-aware SSZ decoding for relay responses
  • v2→v1 fallback now forwards the v1 payload to the beacon node instead of returning an empty 202 (prevents silent block loss)
  • V2_FALLBACK_TO_V1 metric counter for observability
  • Submit_block integration tests covering SSZ/JSON encoding, v1/v2 paths, and fallback behavior

Review 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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant