Skip to content

Implement PTC reprocess queue - #9458

Merged
mergify[bot] merged 12 commits into
sigp:unstablefrom
conache:ptc-payload-attestations-reprocess-queue
Jul 9, 2026
Merged

Implement PTC reprocess queue#9458
mergify[bot] merged 12 commits into
sigp:unstablefrom
conache:ptc-payload-attestations-reprocess-queue

Conversation

@conache

@conache conache commented Jun 11, 2026

Copy link
Copy Markdown

Issue Addressed

This PR closes issue #9421.

Proposed Changes

  • Payload attestation messages that reference an unknown block are now queued for reprocessing and retried once the block is imported, instead of being dropped.
  • Retained the existing sync lookup trigger; the gossipsub validation result is withheld until the retry resolves so late-validated votes still propagate.
  • Follows the same reprocess-queue pattern used by unaggregated/aggregated attestations (UnknownBlockUnaggregate).
  • Includes e2e tests mirroring attestation_to_unknown_block_processed (gossip and RPC block import variants).

@conache conache changed the title Ptc payload attestations reprocess queue Implement PTC reprocess queue Jun 11, 2026
@conache
conache marked this pull request as ready for review June 12, 2026 08:41
@conache
conache requested a review from jxs as a code owner June 12, 2026 08:41
conache and others added 2 commits June 15, 2026 10:34
…c-payload-attestations-reprocess-queue

# Conflicts:
#	beacon_node/beacon_processor/src/scheduler/work_reprocessing_queue.rs
#	beacon_node/network/src/network_beacon_processor/tests.rs

@eserilev eserilev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, just some small changes

Also would be good to add reprocess metrics, see BEACON_PROCESSOR_AGGREGATED_ATTESTATION_REQUEUED_TOTAL and BEACON_PROCESSOR_UNAGGREGATED_ATTESTATION_REQUEUED_TOTAL as examples

We can introduce a BEACON_PROCESSOR_PAYLOAD_ATTESTATION_REQUEUED_TOTAL when a payload attestation gets queued for reprocessing

Also we have a test case requeue_unknown_block_gossip_attestation_without_import. I think we could add a similar test cases for payload attestations.

Comment on lines +191 to +192
// PTC size ~512 per slot, buffer 2-3 slots for reorgs and processing delays (512 * 3 = 1536)
// TODO(EIP-7732): verify if this is preferable queue length or otherwise

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this is fine, you can remove this TODO

Comment on lines +4213 to +4221
self.send_sync_message(SyncMessage::UnknownBlockHashFromAttestation(
peer_id,
*beacon_block_root,
))
));

if allow_reprocess {
// Queue the payload attestation for re-processing
let processor = self.clone();
let msg = ReprocessQueueMessage::UnknownBlockPayloadAttestation(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we call UnknownBlockHashFromAttestation both inside and outside the if allow_reprocess. we should only call it inside the if allow_reprocess

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed in 577bc98

error: PayloadAttestationError,
message_slot: Slot,
payload_attestation_message: Box<PayloadAttestationMessage>,
allow_reprocess: bool,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #9440 introduced a ReprocessAllowance enum. We should use that instead of the allow_reprocess flag. We'd probably want to add a new variant to the enum BlockOnly

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the context on this! I added the new variant and switched to using the ReprocessAllowance enum in 918ea83

@eserilev eserilev added the waiting-on-author The reviewer has suggested changes and awaits thier implementation. label Jul 7, 2026
@conache

conache commented Jul 8, 2026

Copy link
Copy Markdown
Author

Looks pretty good, just some small changes

Also would be good to add reprocess metrics, see BEACON_PROCESSOR_AGGREGATED_ATTESTATION_REQUEUED_TOTAL and BEACON_PROCESSOR_UNAGGREGATED_ATTESTATION_REQUEUED_TOTAL as examples

We can introduce a BEACON_PROCESSOR_PAYLOAD_ATTESTATION_REQUEUED_TOTAL when a payload attestation gets queued for reprocessing

Also we have a test case requeue_unknown_block_gossip_attestation_without_import. I think we could add a similar test cases for payload attestations.

Thank you for the review and the guidance! 🙏 I addressed the comments and added the suggested test and metric.
The PR should be ready for another look.

@conache
conache requested a review from eserilev July 8, 2026 08:45

@eserilev eserilev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@eserilev eserilev removed the waiting-on-author The reviewer has suggested changes and awaits thier implementation. label Jul 8, 2026
@mergify

mergify Bot commented Jul 8, 2026

Copy link
Copy Markdown

Queued — the merge queue status continues in this comment ↓.

@eserilev eserilev added the ready-for-merge This PR is ready to merge. label Jul 8, 2026
@mergify

mergify Bot commented Jul 8, 2026

Copy link
Copy Markdown

Merge Queue Status

This pull request spent 29 minutes in the queue, including 27 minutes 12 seconds running CI.

Waiting for
  • check-success=local-testnet-success
All conditions

Reason

The merge conditions cannot be satisfied due to failing checks

  • local-testnet-success

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Requeued — the merge queue status continues in this comment ↓.

@eserilev

eserilev commented Jul 8, 2026

Copy link
Copy Markdown
Member

@mergify requeue

@mergify

mergify Bot commented Jul 8, 2026

Copy link
Copy Markdown

Merge Queue Status

This pull request spent 30 minutes 11 seconds in the queue, including 28 minutes 29 seconds running CI.

Waiting for
  • check-success=local-testnet-success
All conditions

Reason

The merge conditions cannot be satisfied due to failing checks

  • local-testnet-success

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Requeued — the merge queue status continues in this comment ↓.

@eserilev

eserilev commented Jul 9, 2026

Copy link
Copy Markdown
Member

@mergify requeue

@mergify

mergify Bot commented Jul 9, 2026

Copy link
Copy Markdown

Merge Queue Status

This pull request spent 29 minutes 13 seconds in the queue, including 27 minutes 46 seconds running CI.

Waiting for
  • check-success=local-testnet-success
  • check-success=test-suite-success
All conditions

Reason

The merge conditions cannot be satisfied due to failing checks

  • local-testnet-success

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Requeued — the merge queue status continues in this comment ↓.

@mergify mergify Bot added queued and removed dequeued labels Jul 9, 2026
mergify Bot added a commit that referenced this pull request Jul 9, 2026
@mergify mergify Bot added dequeued and removed queued labels Jul 9, 2026
@mergify

mergify Bot commented Jul 9, 2026

Copy link
Copy Markdown

Merge Queue Status

This pull request spent 28 minutes 47 seconds in the queue, including 27 minutes 32 seconds running CI.

Required conditions to merge

@mergify mergify Bot added the queued label Jul 9, 2026
mergify Bot added a commit that referenced this pull request Jul 9, 2026
@mergify mergify Bot removed the dequeued label Jul 9, 2026
@mergify
mergify Bot merged commit 3d9b46e into sigp:unstable Jul 9, 2026
38 checks passed
@mergify mergify Bot removed the queued label Jul 9, 2026
@conache
conache deleted the ptc-payload-attestations-reprocess-queue branch July 23, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gloas ready-for-merge This PR is ready to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants