Skip to content

Return 204 for producePayloadAttestationData when no block seen at slot#10965

Open
rolfyone wants to merge 3 commits into
Consensys:masterfrom
rolfyone:204_payloadAttestationData
Open

Return 204 for producePayloadAttestationData when no block seen at slot#10965
rolfyone wants to merge 3 commits into
Consensys:masterfrom
rolfyone:204_payloadAttestationData

Conversation

@rolfyone

@rolfyone rolfyone commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

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

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

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 producePayloadAttestationData with beacon-APIs#612: GET /eth/v1/validator/payload_attestation_data now takes slot as 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.

GetPayloadAttestationData updates route metadata, OpenAPI responses (drops 404, documents 204), and maps Optional.empty() from the provider to SC_NO_CONTENT. The remote validator client CreatePayloadAttestationDataRequest and ValidatorApiMethod are updated to call the new URL shape with ?slot=…; existing ResponseHandler behavior 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.

rolfyone added 3 commits July 13, 2026 12:00
  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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant