prefer headers with proofs#7886
Open
AdoAdoAdo wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates sync and data-retrieval behavior to prefer headers that already have an equivalent proof when multiple headers exist for the same nonce (e.g., competing forks), and adds safeguards to unblock sync when an unproven header blocks progress.
Changes:
- Prefer “proven” headers (based on proofs pool) when resolving headers by nonce in
HeaderResolverand in the meta epoch-start watchdog path. - Add logic in base sync failure handling to remove a blocking unproven “next header” once the sync-error limit is reached (plus tests for this behavior).
- Extend resolver factory wiring and tests to pass the proofs pool into
HeaderResolver.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| process/sync/shardblock_test.go | Adds tests validating removal of blocking unproven next-header when sync repeatedly fails/timeouts. |
| process/sync/metablock.go | Meta epoch-start watchdog now prefers a header referenced by an existing proof (when available). |
| process/sync/metablock_test.go | Adds coverage for proof-preference when multiple metablock headers exist at the same nonce. |
| process/sync/baseSync.go | Adds logic to drop a blocking unproven header (and reset error counter) when sync is stuck and rollback didn’t happen. |
| dataRetriever/resolvers/headerResolver.go | Header resolver now prefers the header that matches a known proof for the requested nonce. |
| dataRetriever/resolvers/headerResolver_test.go | Adds tests for nil proofs pool arg + proof-preference vs “last-seen” behavior. |
| dataRetriever/factory/resolverscontainer/shardResolversContainerFactory.go | Wires proofs pool into header resolver args. |
| dataRetriever/factory/resolverscontainer/metaResolversContainerFactory.go | Wires proofs pool into header resolver args. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+842
to
+844
| if boot.hasProof(hash, hdr) { | ||
| return | ||
| } |
sstanculeanu
approved these changes
Jun 19, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/testnet-fixes #7886 +/- ##
======================================================
+ Coverage 77.62% 77.63% +0.01%
======================================================
Files 885 885
Lines 125425 125472 +47
======================================================
+ Hits 97357 97415 +58
+ Misses 21585 21576 -9
+ Partials 6483 6481 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
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:
featbranch created?featbranch merging, do all satellite projects have a proper tag insidego.mod?