fix: skip casting payload attestation when there is no block at slot#9406
Merged
Conversation
Per the gloas honest validator spec, a PTC member must not submit a
payload attestation when no beacon block has been seen for the assigned
slot. Previously, producePayloadAttestationData fell back to the most
recent canonical block at or before the assigned slot, causing the
validator to attest with a stale beaconBlockRoot that peers ignore.
Change the beacon node endpoint to look up the canonical block at the
exact slot and return 404 when none is found, matching the 404 behavior
of /eth/v2/beacon/blocks/{block_id} for empty slots. The validator
client treats 404 as a skip signal and logs at debug rather than error,
since empty slots are an expected condition.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Restructure the payloadInput branch so payloadPresent / blobDataAvailable are computed inside a single null-check rather than separate guards. Resolves the lint/complexity/useOptionalChain warning surfaced by biome after removing the now-redundant blockIsForSlot gate. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the validator API and PTC service to handle cases where no beacon block is seen at a specific slot. It switches from retrieving the closest block less than or equal to the slot to retrieving the block exactly at the slot. If no block is found, a 404 error is thrown, allowing the validator client to skip submitting payload attestations for that slot. Unit tests and API mocking helpers have been updated and added to cover this scenario. No review comments were provided, so there is no additional feedback to address.
nflaig
reviewed
May 27, 2026
nflaig
reviewed
May 28, 2026
Collapse let/if guard into single optional-chain expression with `?? false` fallback so payloadPresent and blobDataAvailable stay boolean (SSZ Boolean field). Addresses review feedback on ChainSafe#9406. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
nflaig
reviewed
May 28, 2026
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.
No description provided.