Skip to content

chore: update the chain follower logs to report validation#7382

Merged
akaladarshi merged 3 commits into
mainfrom
akaladarshi/sync-log-validation-start
Jul 24, 2026
Merged

chore: update the chain follower logs to report validation#7382
akaladarshi merged 3 commits into
mainfrom
akaladarshi/sync-log-validation-start

Conversation

@akaladarshi

@akaladarshi akaladarshi commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary of changes

Changes introduced in this pull request:

  • Instead of the max forks epoch remaining to start validation, now log shows min epochs remaining to start validation
  • Update the chain follower logs to report the remaining tipset to start validation instead of remaining downloads

Reference issue to close (if applicable)

Closes #5499

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • This pull request is based on an issue that a maintainer has accepted (see Before Opening a Pull Request).
  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • Bug Fixes
    • Improved chain synchronization progress reporting while catching up to the latest chain head by showing the heaviest epoch, expected head, and the computed difference.
    • Progress messages now include clearer stage-based status (e.g., validating tipsets, remaining header fetches, or waiting for tipsets).
    • Log updates are emitted only when the node is significantly behind, reducing unnecessary log noise during normal operation.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e7eb15e3-8c50-43bc-9e3b-22054ec0afc8

📥 Commits

Reviewing files that changed from the base of the PR and between 099662b and 4254e60.

📒 Files selected for processing (1)
  • src/chain_sync/chain_follower.rs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • filecoin-project/lotus (manual)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/chain_sync/chain_follower.rs

Walkthrough

ChainFollower catch-up progress logging now uses the epoch gap to HEAD and reports active fork synchronization stages instead of queued tipset counts.

Changes

Catch-up progress reporting

Layer / File(s) Summary
Epoch-based fork status logging
src/chain_sync/chain_follower.rs
Imports now include Cow and grouped time types. Progress logs skip gaps of 10 epochs or fewer, calculate header-fetch estimates from active forks, and report validating, header-fetching, or tipset-waiting stages.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • ChainSafe/forest#7380: Also updates chain_follower.rs catch-up progress logging based on epoch distance.

Suggested reviewers: hanabi1224

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately describes the logging change around validation progress.
Linked Issues check ✅ Passed The updated logs estimate remaining tipsets before validation and no longer rely on fork-based download counts.
Out of Scope Changes check ✅ Passed The changes stay within the logging/reporting scope and do not introduce unrelated behavior.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch akaladarshi/sync-log-validation-start
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch akaladarshi/sync-log-validation-start

Comment @coderabbitai help to get the list of available commands.

@akaladarshi
akaladarshi force-pushed the akaladarshi/sync-log-validation-start branch from 9c61bfd to 9cb988c Compare July 20, 2026 12:14
@akaladarshi
akaladarshi marked this pull request as ready for review July 20, 2026 12:15
@akaladarshi
akaladarshi requested a review from a team as a code owner July 20, 2026 12:15
@akaladarshi
akaladarshi requested review from LesnyRumcajs, hanabi1224 and sudo-shashank and removed request for a team July 20, 2026 12:15
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.20%. Comparing base (a6f303b) to head (4254e60).
⚠️ Report is 21 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/chain_sync/chain_follower.rs 0.00% 25 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/chain_sync/chain_follower.rs 30.68% <0.00%> (-0.26%) ⬇️

... and 57 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d44ecc7...4254e60. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sudo-shashank

Copy link
Copy Markdown
Contributor

No green checkmark

sudo-shashank
sudo-shashank previously approved these changes Jul 22, 2026
Comment thread src/chain_sync/chain_follower.rs Outdated
Comment thread src/chain_sync/chain_follower.rs Outdated
@akaladarshi
akaladarshi force-pushed the akaladarshi/sync-log-validation-start branch from 8eebcd2 to 099662b Compare July 23, 2026 09:28
Comment thread src/chain_sync/chain_follower.rs Outdated
Comment thread src/chain_sync/chain_follower.rs Outdated
Comment thread src/chain_sync/chain_follower.rs Outdated

@LesnyRumcajs LesnyRumcajs 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

@akaladarshi
akaladarshi added this pull request to the merge queue Jul 24, 2026
Merged via the queue into main with commit 0603a92 Jul 24, 2026
34 checks passed
@akaladarshi
akaladarshi deleted the akaladarshi/sync-log-validation-start branch July 24, 2026 13:52
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.

The ChainFollower should report when tipset validation will start

3 participants