Add Beacon API endpoints for EIP-8025 execution proofs - #43
Merged
Conversation
Serve `POST /eth/v1/beacon/execution_proofs` and
`GET /eth/v1/beacon/execution_proofs/{block_id}`, and expose matching
`BeaconNodeHttpClient` methods in JSON and SSZ.
Submitted `SignedExecutionProofEnvelope`s go through the same
verification as the `execution_proof` gossip topic, are published to the
network and cached in the pending payload cache, importing the payload
envelope when the proof gate is satisfied. Retrieval returns the
envelopes cached for a block's payload, keyed by beacon block root and
ordered by proof type.
Responses follow existing conventions: 200 when every proof is on the
network (published now or already known), an indexed 400 naming the
proofs gossip would drop, 404 for unknown blocks, 500 for proof engine
or beacon chain faults, and 501 on nodes without a proof engine.
Both encodings use the new `SignedExecutionProofEnvelopes` list bounded
by EIP-8025 `MAX_EXECUTION_PROOFS_PER_PAYLOAD`, and `proof_type` is now
quoted in JSON to match the beacon-APIs `Uint8` schema.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QMcYSjxdgRfab7TaYXFV3E
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.
Add Beacon API endpoints for EIP-8025 execution proofs
Adds Lighthouse Beacon API server and client support for submitting and retrieving execution proofs, on top of
optional-proofs-gloas(base535046063).Endpoints
POST /eth/v1/beacon/execution_proofs— accepts a JSON array or SSZList[SignedExecutionProofEnvelope, MAX_EXECUTION_PROOFS_PER_PAYLOAD=4]. Each proof runs the same verification as theexecution_proofgossip topic, is published to the network, and is cached in the pending payload cache, importing the payload envelope when the proof gate is satisfied.GET /eth/v1/beacon/execution_proofs/{block_id}— returns the proof envelopes cached for a block's payload, keyed by beacon block root and ordered by proof type, as JSON ({ execution_optimistic, finalized, data }) or SSZ.Client
BeaconNodeHttpClientgainspost_beacon_execution_proofs[_ssz]andget_beacon_execution_proofs[_ssz]over the sharedSignedExecutionProofEnvelopeswire type (no duplicated structs).Response codes
200when every proof is on the network (published now or already known); an indexed400naming the proofs gossip would drop;404for unknown blocks;500for proof engine or beacon chain faults;501on nodes without--proof-engine.Contract decisions (for the beacon-APIs PR)
{ "proofs": [...] }.SignedExecutionProofEnvelope, never re-signed, adapted from the olderSignedExecutionProof+PublicInputshape.proof_typeserializes as a quoted string in JSON to match the beacon-APIsUint8schema; SSZ and gossip encoding are unchanged.MAX_EXECUTION_PROOFS_PER_PAYLOAD = 4taken from the EIP text.Validation
cargo fmt --all -- --check: clean.cargo test -p types execution_proof(7),-p warp_utils(3),-p beacon_chain --lib pending_payload_cache(12),-p eth2(13): pass.cargo test --release -p http_api --test bn_http_api_tests execution_proof_tests(3): pass — JSON and SSZ submit/get, publication, lookup by root/head/slot,404,501, indexed400failures.cargo clippyon the five changed crates with themake lintflags: no issues.bn_http_api_testssuite, theFORK_NAMEmatrix, workspace clippy, network/Kurtosis.Note
Retrieval currently reads the in-memory pending payload cache (last 32 payloads); a follow-up persistent-storage task will extend this beyond recent blocks.