feat: return 204 when producing payload attestation if there is no block#9589
feat: return 204 when producing payload attestation if there is no block#9589nflaig wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec90d98b08
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| try { | ||
| const payloadAttestationData = await this.producePayloadAttestationData(slot); | ||
| // No canonical block at slot resolves to `undefined` | ||
| const payloadAttestationData = (await this.api.validator.producePayloadAttestationData({slot})).value(); |
There was a problem hiding this comment.
Handle legacy 404 no-block responses
When the VC is pointed at a beacon node that still returns 404 for “no canonical block at this slot” (the behavior this code handled before, and still plausible while the endpoint semantics are unsettled), calling value() directly makes ApiResponse.value() assert the response is OK and throw. The outer catch then logs Error on PTC routine instead of quietly skipping the payload attestation, reintroducing the noise this change is meant to avoid for mixed-version or non-updated beacon nodes. Keep the 404-as-empty handling alongside the new 204/undefined path.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
not a concern, this is only relevant for devnets right now
There was a problem hiding this comment.
Code Review
This pull request updates the producePayloadAttestationData endpoint to return a 204 No Content status with undefined data instead of throwing a 404 Not Found error when no canonical block is found at the specified slot. While this is a solid improvement, the reviewer noted that returning early on a 204 response in the Fastify handler without setting metadata headers will cause client-side parsing errors, as the client expects the Eth-Consensus-Version header. It is recommended to serialize and set these headers before returning.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Performance Report✔️ no performance regression detected Full benchmark results
|
As per ethereum/beacon-APIs#612 (comment)
the spec has not settled yet but to avoid noise in the logs we should use 204 for now. Can always revert back to 404 if that's what we decide to go with on the spec side.