Skip to content

prefer headers with proofs#7886

Open
AdoAdoAdo wants to merge 1 commit into
feat/testnet-fixesfrom
resolve-by-proof
Open

prefer headers with proofs#7886
AdoAdoAdo wants to merge 1 commit into
feat/testnet-fixesfrom
resolve-by-proof

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 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 HeaderResolver and 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 thread process/sync/baseSync.go
Comment on lines +842 to +844
if boot.hasProof(hash, hdr) {
return
}
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.63%. Comparing base (53da698) to head (88d62b4).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

3 participants