feat(engine): SSZ-over-REST transport per execution-apis #764#4
Merged
Conversation
Negotiates via engine_exchangeCapabilities (JSON-RPC remains the default and
the fallback). When both sides advertise an SSZ REST endpoint, requests use
application/octet-stream with raw SSZ bodies on the same 8551 port with the
same JWT auth.
- consensoor/engine/ssz_types.py: SSZ containers for ExecutionPayloadV{1-4},
PayloadStatusV1, ForkchoiceStateV1, PayloadAttributesV{1-4},
ForkchoiceUpdatedResponseV1, BlobsBundleV{1,2}, GetPayloadResponseV{2-6},
NewPayloadV{1-5}Request, ForkchoiceUpdatedV{1-4}Request. Nullable fields
encoded as List[T, 1].
- consensoor/engine/client.py: track EL-advertised SSZ endpoints, route
new_payload_v{3,4,5}/forkchoice_updated_v{3,4}/get_payload_v{3,4,5,6}
through SSZ when supported, JSON-RPC otherwise. exchange_capabilities now
advertises the 20 SSZ REST capability strings alongside JSON-RPC names.
Verified against ethpandaops/nethermind:master in a kurtosis enclave: 21 SSZ
forkchoice calls, 3 newPayloadV4 calls, 3 getPayloadV5 calls all returned
200; chain stayed in sync with a Lighthouse peer.
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
engine_exchangeCapabilitiesper execution-apis#764. JSON-RPC stays the default and the fallback.consensoor/engine/ssz_types.pywith the spec's containers (ExecutionPayloadV{1-4},PayloadStatusV1,ForkchoiceStateV1,PayloadAttributesV{1-4},ForkchoiceUpdatedResponseV1,BlobsBundleV{1,2},GetPayloadResponseV{2-6},NewPayloadV{1-5}Request,ForkchoiceUpdatedV{1-4}Request). Nullable JSON fields encoded asList[T, 1].consensoor/engine/client.pytracks the EL-advertised SSZ endpoints, routesnew_payload_v{3,4,5}/forkchoice_updated_v{3,4}/get_payload_v{3,4,5,6}through SSZ when supported, and otherwise falls through to JSON-RPC.exchange_capabilitiesnow advertises the 20 SSZ REST capability strings alongside the JSON-RPC method names.Test plan
consensoor:ssz-testand ran againstethpandaops/nethermind:masterin a Kurtosis enclave (mainnet preset, Fulu).application/octet-streamrequests to/engine/v3/forkchoice(×23 → 200),/engine/v4/payloads(×3 → 200), and/engine/v5/payloads/{id}(×3 → 200).