Skip to content

remove request duplicates - #7972

Merged
AdoAdoAdo merged 2 commits into
refactor-contended-headers-gatefrom
remove-request-duplicates
Aug 21, 2026
Merged

remove request duplicates#7972
AdoAdoAdo merged 2 commits into
refactor-contended-headers-gatefrom
remove-request-duplicates

Conversation

@AdoAdoAdo

Copy link
Copy Markdown
Contributor

Reasoning behind the pull request

Proposed changes

Testing procedure

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR reduces duplicate network requests during syncing by (1) gating the sync-stuck watchdog when there is a known backlog already handled by normal sync, and (2) coalescing concurrent “equivalent proof by nonce” requests so only one in-flight network request is performed per nonce+shard key. It also adds targeted tests to validate both behaviors.

Changes:

  • Gate shouldTryToRequestHeaders() for unsynchronized nodes when ProbableHighestNonce() > currentCommittedNonce() to avoid watchdog-triggered duplicate header requests.
  • Add in-flight coalescing for RequestEquivalentProofByNonceForEpoch() via a per-key reservation map to suppress duplicate proof requests.
  • Add tests covering watchdog gating and proof-request coalescing behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
process/sync/resyncRecovery_test.go Adds tests for watchdog gating behavior and lookahead proof-request windowing.
process/sync/baseSync.go Gates watchdog header requests for unsynchronized nodes when a backlog is already known.
dataRetriever/requestHandlers/requestHandler.go Adds in-flight deduplication for equivalent-proof-by-nonce requests and refactors request flow.
dataRetriever/requestHandlers/requestHandler_test.go Adds concurrency tests ensuring proof-by-nonce requests are coalesced and reservations are released.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread dataRetriever/requestHandlers/requestHandler.go
@AdoAdoAdo
AdoAdoAdo merged commit a599f7b into refactor-contended-headers-gate Aug 21, 2026
7 checks passed
@AdoAdoAdo
AdoAdoAdo deleted the remove-request-duplicates branch August 21, 2026 14:04
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.

4 participants