prefer headers with proofs#7886
Conversation
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.
| if boot.hasProof(hash, hdr) { | ||
| return | ||
| } |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/testnet-fixes #7886 +/- ##
======================================================
+ Coverage 77.61% 77.63% +0.01%
======================================================
Files 885 885
Lines 125414 125461 +47
======================================================
+ Hits 97340 97400 +60
+ Misses 21591 21582 -9
+ Partials 6483 6479 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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?