Return 204 for producePayloadAttestationData when no block seen at slot#10965
Open
rolfyone wants to merge 3 commits into
Open
Return 204 for producePayloadAttestationData when no block seen at slot#10965rolfyone wants to merge 3 commits into
rolfyone wants to merge 3 commits into
Conversation
Implements compliance with beacon-APIs#612.
Previously, GET /eth/v1/validator/payload_attestation_data/{slot} returned 404 Not Found when no block had been seen at the requested slot. This was incorrect — a missing block is not an error condition; it is a normal signal to the PTC validator
that it should not cast a payload attestation.
The endpoint now returns 204 No Content in this case, matching the updated API specification. No changes were required on the client side (CreatePayloadAttestationDataRequest), as the base ResponseHandler already maps 204 to Optional.empty() via
its default noValueHandler.
Changes:
- GetPayloadAttestationData: replace 404 with 204 in both the OpenAPI metadata and the response handler
- GetPayloadAttestationDataTest: update tests to assert SC_NO_CONTENT and use verifyMetadataEmptyResponse
- GetPayloadAttestationData.java: Route drops /{slot}, pathParam → queryParam, getPathParameter → getQueryParameter, and response(SC_NO_CONTENT, ...) moved after withChainDataResponses() so our description wins
- ValidatorApiMethod.java: GET_PAYLOAD_ATTESTATION_DATA path drops :slot
- CreatePayloadAttestationDataRequest.java: Slot moves from URL path params to query params
- CreatePayloadAttestationDataRequestTest.java: Path assertion uses encodedPath(), query param assertion now checks slot=1
- GetPayloadAttestationDataTest.java: setPathParameter → setQueryParameter, route assertion updated
- _eth_v1_validator_payload_attestation_data.json: New reference file (query param, 204 response, no 404)
- _eth_v1_validator_payload_attestation_data_{slot}.json: Deleted
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.
Implements compliance with beacon-APIs#612.
Previously, GET /eth/v1/validator/payload_attestation_data/{slot} returned 404 Not Found when no block had been seen at the requested slot. This was incorrect — a missing block is not an error condition; it is a normal signal to the PTC validator
that it should not cast a payload attestation.
The endpoint now returns 204 No Content in this case, matching the updated API specification. No changes were required on the client side (CreatePayloadAttestationDataRequest), as the base ResponseHandler already maps 204 to Optional.empty() via
its default noValueHandler.
Changes:
Documentation
doc-change-requiredlabel to this PR if updates are required.Changelog
Note
Low Risk
Targeted REST contract and client URL changes for one validator endpoint; behavior for success paths is unchanged aside from parameter location.
Overview
Aligns
producePayloadAttestationDatawith beacon-APIs#612:GET /eth/v1/validator/payload_attestation_datanow takesslotas a query parameter (not a path segment), and when no block has been seen for that slot the beacon node returns 204 No Content instead of 404, telling PTC validators not to cast a payload attestation.GetPayloadAttestationDataupdates route metadata, OpenAPI responses (drops 404, documents 204), and mapsOptional.empty()from the provider toSC_NO_CONTENT. The remote validator clientCreatePayloadAttestationDataRequestandValidatorApiMethodare updated to call the new URL shape with?slot=…; existingResponseHandlerbehavior for 204 →Optional.empty()is unchanged. Tests and the integration OpenAPI fixture are updated accordingly.Reviewed by Cursor Bugbot for commit 1f1e640. Bugbot is set up for automated code reviews on this repo. Configure here.