Add SSZ types, content negotiation, and encoding helpers#466
Open
JasonVranek wants to merge 1 commit into
Open
Add SSZ types, content negotiation, and encoding helpers#466JasonVranek wants to merge 1 commit into
JasonVranek wants to merge 1 commit into
Conversation
Introduce EncodingType, AcceptedEncodings, and content negotiation primitives for SSZ support in the PBS pipeline. Includes: - EncodingType enum with FromStr/Display and MIME param tolerance - AcceptedEncodings with q-value aware Accept header parsing - SSZ bid value extraction from SignedBuilderBid by fork - deserialize_body and parse_response_encoding_and_fork helpers - Per-fork type aliases for BuilderBid and ExecutionPayloadHeader - SszValueError, PbsError::GeneralRequest, PbsClientError variants - Comprehensive unit tests for all new types and helpers - New deps: headers-accept, mediatype
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
Introduces the types and helpers needed for SSZ support in the PBS pipeline. No behavior changes, just plumbing the follow-up PRs build on.
What's in this PR
EncodingTypeenum withFromStr/Display, including MIME parameter tolerance (RFC 7231 §3.1.1.1)AcceptedEncodingswith q-value-aware Accept header parsing (RFC 9110 §12.5.1)SignedBuilderBidfor all supported forks (Bellatrix through Fulu)deserialize_bodyandparse_response_encoding_and_forkhelpersBuilderBidandExecutionPayloadHeaderSszValueError,PbsError::GeneralRequest,PbsClientError::DecodeError/RelayErrorheaders-accept,mediatypeReview notes
Part 1 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