Repository navigation
fix(rpc): serve the endpoints and body encodings other validator clients use - #667
MegaRedHand wants to merge 6 commits into
Conversation
Foreign validator clients refuse or stall on a node that 404s these:
- GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}: lighthouse
resolves every key to an index this way; without it all its validators stay
inactive and no proposal is made. Same entry shape, state-id handling and
flags as the list form; an unknown validator is a 404.
- GET /eth/v1/config/fork_schedule: nimbus reads it every epoch and marks a
node it cannot decode as incompatible. Phase0 first and its own predecessor,
then each scheduled fork, so the list is the linked list nimbus validates.
A test pins every key nimbus's spec comparison reads.
…e submissions Prysm posts aggregate_and_proofs and payload attestations as application/octet-stream and only retries as JSON on a 415; our JSON-only decoder answered 400 "invalid request body" and its aggregates were never published. Nimbus submits attestations as SSZ too. The three batch endpoints now take either encoding, picked by Content-Type (none still means JSON), through one decode_list helper. SSZ is the specification's List[...] of the same items. Any other content type is a 415, the answer prysm's fallback keys on, and a body that does not decode is a 400.
…reign validator clients
…rom Beacon API JSON The Beacon API's block and envelope request bodies are JSON as well as SSZ, and several validator clients post only JSON (teku's envelopes, nimbus's blocks, lodestar's everything). Every container a fulu or gloas signed block or execution payload envelope holds now derives Deserialize, mirroring each Serialize adapter: seq, quoted_u64_seq, ssz_hex and ssz_hex_seq gain the inverse (collected through the collection's TryFrom<Vec<T>>, so a list bound is refused rather than truncated), and U256, KzgCommitment and KzgProof read the way they are written. Round-trip tests cover a populated fulu block, gloas block and gloas envelope.
Teku's validator client posts the gloas execution payload envelope as JSON and got a 415, so its blocks never had their payload published; nimbus posts blocks as JSON and lodestar posts both as JSON by default. POST /eth/v2/beacon/blocks (fulu SignedBlockContents, gloas SignedBeaconBlock) and POST /eth/v1/beacon/execution_payload_envelopes (SignedExecutionPayloadEnvelope or, with Eth-Blob-Data-Included: true, the Contents form) now take either encoding by Content-Type, through the BodyEncoding that decode_list already used. The decoded value goes through the same validation as the SSZ one. Any other content type is still a 415, and a body that is not the container a 400. The envelope test that asserted JSON was refused now asserts what is still true: an unsupported type is a 415 and SSZ bytes labelled JSON are a 400.
🤖 Codex Code ReviewOverall this PR looks solid: the JSON deserialization coverage for Beacon API containers is useful, the new
If you want, I can turn Point 3 into a concrete patch recommendation. Automated review by OpenAI Codex · gpt-5.4 · custom prompt |
🤖 Kimi Code ReviewI'll review this PR which adds JSON deserialization support for beacon containers, SSZ body encoding negotiation, and related Beacon API endpoints. Let me analyze the changes systematically. OverviewThe PR makes three main changes:
Code ReviewItem 1:
|
| Priority | Item | Location | Issue |
|---|---|---|---|
| Medium | 3 | serde_helpers.rs |
`{: |
Automated review by Kimi (Moonshot AI) · kimi-k2.6 · custom prompt
🤖 Claude Code ReviewSay in a few words what I'm doing: I've read the whole diff and I'm writing up the review now. Review of PR 667: JSON request bodies for the Beacon API, plus
|
Motivation
Running other clients' validator clients against
ethlambda beaconon a fulu->gloas Kurtosis devnet (lighthouse v8.3.0-rc.0, teku 26.9.1, nimbus v26.10.0, prysm v7.2.0, lodestar v1.49.0, each driving 77 keys on its own ethlambda node) showed four ways our node turned them away:GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}, which it resolves indices withGET /eth/v1/config/fork_scheduleChanges
GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}: one entry, by index or pubkey; 404 when unknown.GET /eth/v1/config/fork_schedule: every scheduled fork as a linked{previous_version, current_version, epoch}list (nimbus checks the linking).Content-Type(none means JSON, anything else is a 415, which prysm answers by retrying with JSON):POST /eth/v2/beacon/pool/attestations,POST /eth/v2/validator/aggregate_and_proofs,POST /eth/v1/beacon/pool/payload_attestations;POST /eth/v2/beacon/blocks(fuluSignedBlockContents, gloasSignedBeaconBlock) andPOST /eth/v1/beacon/execution_payload_envelopes(envelope or envelope contents perEth-Blob-Data-Included).Deserializefor every container a fulu/gloas block or envelope carries, with the inverse of each serde adapter (oversized lists are refused, not truncated).Content types per VC, read from their tagged sources:
Validation
tmp/bci-626-63-64-633-636-638-gloas-live(with fix(rpc): bound duties by the wall clock, advance the head for later epochs #663): fulu genesis, gloas at epoch 5, 1536 validators, ethlambda nodes holding 50% (half of that driven by the five foreign VCs above).proposer_preferences/register_validator(builder path), which lighthouse and prysm call and get a 404.