Skip to content

Conversation

StefanBratanov
Copy link
Contributor

@StefanBratanov StefanBratanov commented Oct 21, 2025

PR Description

Add the necessary methods to implement for the Payload timeliness attestation duty

This PR implements getPtcDuties as a start and adds PayloadAttestationPool which is to be implemented in future PRs. Also changed the BlockOperationSelectorFactory to use the pool as well as handle gossip for payload attestations to be redirected to the pool. Also add publishing of the payload attestation message when added locally.

Fixed Issue(s)

related to #10041

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

Implements PTC duties retrieval and scaffolds payload attestation pooling with gossip integration across block production, APIs, spec utilities, networking, metrics, and tests.

  • Validator/API:
    • Add getPtcDuties with state/epoch validation and new JSON types (PtcDuties, PtcDuty).
    • Stub createPayloadAttestationData and sendPayloadAttestationMessages endpoints; extend metrics labels.
    • Minor refactor: proposer duties helper.
  • Spec/Logic:
    • Add PTC assignment helpers: Spec.getPtcAssignment, getValidatorIndexToPtcAssignmentMap; base stubs in ValidatorsUtil, Gloas impl in ValidatorsUtilGloas.
    • Use RestApiConstants.DEPENDENT_ROOT in attester duties JSON.
  • Gossip/P2P:
    • Add PayloadAttestationMessage publish path in Eth2P2PNetwork, ActiveEth2P2PNetwork, and GossipForkManager.
  • State Transition / Pools:
    • Introduce PayloadAttestationPool (NOOP + AggregatingPayloadAttestationPool) and PayloadAttestationMessageValidator.
    • Wire pool in BeaconChainController (init, gossip processing, local publish).
  • Block Production:
    • BlockOperationSelectorFactory now sources payload attestations from the pool (tests updated; BeaconBlockBodyLists.createPayloadAttestations).
  • Tests:
    • Update factories and assertions across milestones to include payload attestations and new API (getPtcDuties).

Written by Cursor Bugbot for commit 3220c7f. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

PayloadAttestationMessage payloadAttestationMessage, Optional<UInt64> arrivalTimestamp);

SszList<PayloadAttestation> getPayloadAttestationsForBlock(
BeaconState blockSlotState, Bytes32 parentRoot);

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'parentRoot' is never used.
public class PayloadAttestationMessageValidator {

public SafeFuture<InternalValidationResult> validate(
final PayloadAttestationMessage payloadAttestationMessage) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'payloadAttestationMessage' is never used.
@StefanBratanov StefanBratanov changed the title Implement retrieving PTC duties for validator indices Implement retrieving PTC duties + PayloadAttestationPool skeleton Oct 22, 2025
cursor[bot]

This comment was marked as outdated.

}

@SuppressWarnings("unused")
private void doAdd(final PayloadAttestationMessage payloadAttestationMessage) {}

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'payloadAttestationMessage' is never used.
@cursor
Copy link

cursor bot commented Oct 23, 2025

Bug: Epoch Mismatch in Duty Calculation

The getPtcDuties method retrieves BeaconState from the previous epoch, but then uses this state to calculate duties and the dependent root for the requested epoch. This mismatch can result in incorrect PTC assignments and an improperly selected dependent root.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant