Skip to content

fix: don't mark tipsets with temporal errors as permanently bad#6613

Merged
LesnyRumcajs merged 2 commits intomainfrom
dont-mark-time-travelling-tipsets-as-bad
Feb 16, 2026
Merged

fix: don't mark tipsets with temporal errors as permanently bad#6613
LesnyRumcajs merged 2 commits intomainfrom
dont-mark-time-travelling-tipsets-as-bad

Conversation

@LesnyRumcajs
Copy link
Copy Markdown
Member

@LesnyRumcajs LesnyRumcajs commented Feb 16, 2026

Summary of changes

Forest marks blocks as bad to avoid dealing with them later on. This is good. Temporal errors are kind of special case, and we might receive them eventually with correct timestamp. We have logic to ignore them, so that the node doesn't get stuck if such a block becomes part of the canonical chain. Unfortunately, we also have similar logic for entire tipsets, and so we didn't ban the block... we banned the entire tipset. 🙂 This made the node get stuck, as no valid chain could now be constructed.

Changes introduced in this pull request:

  • Fixes partial handling of temporal errors.

Reference issue to close (if applicable)

Closes

Other information and links

2026-02-12T11:06:55.854316Z  WARN forest::chain_sync::tipset_syncer: Validating block [CID = bafy2bzaceclhbj54ptqyoguqzy6dcemjexw4p5mxtcigrle3nm7aaw2upyt5w] in EPOCH = 5752934 failed: Block received from the future: now = 1770894415, block = 1770894420
2026-02-12T11:06:55.854428Z  WARN forest::chain_sync::chain_follower: Error validating tipset: Block received from the future: now = 1770894415, block = 1770894420
2026-02-12T11:07:00.144243Z  INFO forest::state_manager: Evaluating tipset: EPOCH=5752933, blocks=6, tsk=[bafy2bzacea5vkxbjr5pvjglnl7mqkplr65lehshiiipuiepaoiawzvdqgal2s, bafy2bzacecdyo7vckr2vxyojpv7k5vr4do5c7hqkw7z2pe5yphzgaibng3cus, bafy2bzaced7qab7rmtdcygolkiyxik4rzujfwiox54kh37g5yj74ivppodnhu, bafy2bzacecp3obetj5x6efl3kap5r6zptyqjwt7qn3b4bfn6hspdiedgunnlm, bafy2bzacedibylxgobuujjprilxk3d255vpxwvrny2cubnczs747k2yuh6ofg, bafy2bzacebxp2b2x742hujze37mpxsnqbqhll6pkj2ugqjjedfmlxtecghk62]
2026-02-12T11:07:15.646522Z  INFO forest::libp2p::service: Re-dialing to bootstrap peer at /dns/bootstrap-venus.mainnet.filincubator.com/tcp/8888/p2p/QmQu8C6deXwKvJP2D8B6QGyhngc3ZiDnFzEHBDx8yeBXST
2026-02-12T11:07:30.583262Z  INFO forest::state_manager: Evaluating tipset: EPOCH=5752934, blocks=4, tsk=[bafy2bzaceaqq7d6ga52eo6slh3jndxtss7ghqyiiienh3jhp7t2a3xtrqf4cc, bafy2bzacea6xn366l7ivnq3ngmeviedqffmrdod4cwjw6aw2kngka3tqte4mw, bafy2bzacecp35nxc5cjngdk4kno44vxn5zjozb2dh4ca5k3edtf73hriumomc, bafy2bzaceb2a7rkrlfprerlo7dg7ff4ojg3ccbwrgg26xynsdxvfr4wk56b3q]
2026-02-12T11:07:31.336854Z  INFO forest::state_manager: Evaluating tipset: EPOCH=5752934, blocks=5, tsk=[bafy2bzaceaqq7d6ga52eo6slh3jndxtss7ghqyiiienh3jhp7t2a3xtrqf4cc, bafy2bzacea6xn366l7ivnq3ngmeviedqffmrdod4cwjw6aw2kngka3tqte4mw, bafy2bzacecp35nxc5cjngdk4kno44vxn5zjozb2dh4ca5k3edtf73hriumomc, bafy2bzaceb2a7rkrlfprerlo7dg7ff4ojg3ccbwrgg26xynsdxvfr4wk56b3q, bafy2bzaceclhbj54ptqyoguqzy6dcemjexw4p5mxtcigrle3nm7aaw2upyt5w]
2026-02-12T11:08:15.646306Z  INFO forest::libp2p::service: Re-dialing to bootstrap peer at /dns/bootstrap-venus.mainnet.filincubator.com/tcp/8888/p2p/QmQu8C6deXwKvJP2D8B6QGyhngc3ZiDnFzEHBDx8yeBXST
2026-02-12T11:08:15.646355Z  INFO forest::libp2p::service: Re-dialing to bootstrap peer at /dns/bootstrap.filecoin.chain.love/tcp/1235/p2p/12D3KooWBF8cpp65hp2u9LK5mh19x67ftAam84z9LsfaquTDSBpt
2026-02-12T11:09:15.646451Z  INFO forest::libp2p::service: Re-dialing to bootstrap peer at /dns/bootstrap-venus.mainnet.filincubator.com/tcp/8888/p2p/QmQu8C6deXwKvJP2D8B6QGyhngc3ZiDnFzEHBDx8yeBXST
2026-02-12T11:10:15.646217Z  INFO forest::libp2p::service: Re-dialing to bootstrap peer at /dns/bootstrap-venus.mainnet.filincubator.com/tcp/8888/p2p/QmQu8C6deXwKvJP2D8B6QGyhngc3ZiDnFzEHBDx8yeBXST
2026-02-12T11:11:15.645719Z  INFO forest::libp2p::service: Re-dialing to bootstrap peer at /dns/bootstrap-venus.mainnet.filincubator.com/tcp/8888/p2p/QmQu8C6deXwKvJP2D8B6QGyhngc3ZiDnFzEHBDx8yeBXST
2026-02-12T11:12:15.646346Z  INFO forest::libp2p::service: Re-dialing to bootstrap peer at /dns/bootstrap-venus.mainnet.filincubator.com/tcp/8888/p2p/QmQu8C6deXwKvJP2D8B6QGyhngc3ZiDnFzEHBDx8yeBXST
2026-02-12T11:13:02.746873Z  INFO forest::chain_sync::chain_follower: Catching up to HEAD: 5752935[bafy2bzacebuvxf5knf4cc5yvjolmyhfn3gopouhlkbr3qfblsxcehqmtw6i6w, bafy2bzacecudl2k7rooqeoynagymtyo6jkd3r74kqsdz5q2spe4f4tfjltq7g, bafy2bzacebxlzkmanaek5j4rebcwfq44zkdx54eur7ig2hjlk2uaaxssaa4bc] -> 5752946
2026-02-12T11:13:12.748054Z  INFO forest::chain_sync::chain_follower: Catching up to HEAD: 5752935[bafy2bzacebuvxf5knf4cc5yvjolmyhfn3gopouhlkbr3qfblsxcehqmtw6i6w, bafy2bzacecudl2k7rooqeoynagymtyo6jkd3r74kqsdz5q2spe4f4tfjltq7g, bafy2bzacebxlzkmanaek5j4rebcwfq44zkdx54eur7ig2hjlk2uaaxssaa4bc] -> 5752946
2026-02-12T11:13:15.646580Z  INFO forest::libp2p::service: Re-dialing to bootstrap peer at /dns/bootstrap-venus.mainnet.filincubator.com/tcp/8888/p2p/QmQu8C6deXwKvJP2D8B6QGyhngc3ZiDnFzEHBDx8yeBXST
2026-02-12T11:13:22.748751Z  INFO forest::chain_sync::chain_follower: Catching up to HEAD: 5752935[bafy2bzacebuvxf5knf4cc5yvjolmyhfn3gopouhlkbr3qfblsxcehqmtw6i6w, bafy2bzacecudl2k7rooqeoynagymtyo6jkd3r74kqsdz5q2spe4f4tfjltq7g, bafy2bzacebxlzkmanaek5j4rebcwfq44zkdx54eur7ig2hjlk2uaaxssaa4bc] -> 5752946
2026-02-12T11:13:32.750058Z  INFO forest::chain_sync::chain_follower: Catching up to HEAD: 5752935[bafy2bzacebuvxf5knf4cc5yvjolmyhfn3gopouhlkbr3qfblsxcehqmtw6i6w, bafy2bzacecudl2k7rooqeoynagymtyo6jkd3r74kqsdz5q2spe4f4tfjltq7g, bafy2bzacebxlzkmanaek5j4rebcwfq44zkdx54eur7ig2hjlk2uaaxssaa4bc] -> 5752947
2026-02-12T11:13:42.751160Z  INFO forest::chain_sync::chain_follower: Catching up to HEAD: 5752935[bafy2bzacebuvxf5knf4cc5yvjolmyhfn3gopouhlkbr3qfblsxcehqmtw6i6w, bafy2bzacecudl2k7rooqeoynagymtyo6jkd3r74kqsdz5q2spe4f4tfjltq7g, bafy2bzacebxlzkmanaek5j4rebcwfq44zkdx54eur7ig2hjlk2uaaxssaa4bc] -> 5752947
2026-02-12T11:13:52.751997Z  INFO forest::chain_sync::chain_follower: Catching up to HEAD: 5752935[bafy2bzacebuvxf5knf4cc5yvjolmyhfn3gopouhlkbr3qfblsxcehqmtw6i6w, bafy2bzacecudl2k7rooqeoynagymtyo6jkd3r74kqsdz5q2spe4f4tfjltq7g, bafy2bzacebxlzkmanaek5j4rebcwfq44zkdx54eur7ig2hjlk2uaaxssaa4bc] -> 5752947
2026-02-12T11:14:02.752806Z  INFO forest::chain_sync::chain_follower: Catching up to HEAD: 5752935[bafy2bzacebuvxf5knf4cc5yvjolmyhfn3gopouhlkbr3qfblsxcehqmtw6i6w, bafy2bzacecudl2k7rooqeoynagymtyo6jkd3r74kqsdz5q2spe4f4tfjltq7g, bafy2bzacebxlzkmanaek5j4rebcwfq44zkdx54eur7ig2hjlk2uaaxssaa4bc] -> 5752948
2026-02-12T11:14:12.754485Z  INFO forest::chain_sync::chain_follower: Catching up to HEAD: 5752935[bafy2bzacebuvxf5knf4cc5yvjolmyhfn3gopouhlkbr3qfblsxcehqmtw6i6w, bafy2bzacecudl2k7rooqeoynagymtyo6jkd3r74kqsdz5q2spe4f4tfjltq7g, bafy2bzacebxlzkmanaek5j4rebcwfq44zkdx54eur7ig2hjlk2uaaxssaa4bc] -> 5752948
2026-02-12T11:14:15.646271Z  INFO forest::libp2p::service: Re-dialing to bootstrap peer at /dns/bootstrap-venus.mainnet.filincubator.com/tcp/8888/p2p/QmQu8C6deXwKvJP2D8B6QGyhngc3ZiDnFzEHBDx8yeBXST
2026-02-12T11:14:15.646326Z  INFO forest::libp2p::service: Re-dialing to bootstrap peer at /dns/bootstrap.filecoin.chain.love/tcp/1235/p2p/12D3KooWBF8cpp65hp2u9LK5mh19x67ftAam84z9LsfaquTDSBpt
2026-02-12T11:14:22.755061Z  INFO forest::chain_sync::chain_follower: Catching up to HEAD: 5752935[bafy2bzacebuvxf5knf4cc5yvjolmyhfn3gopouhlkbr3qfblsxcehqmtw6i6w, bafy2bzacecudl2k7rooqeoynagymtyo6jkd3r74kqsdz5q2spe4f4tfjltq7g, bafy2bzacebxlzkmanaek5j4rebcwfq44zkdx54eur7ig2hjlk2uaaxssaa4bc] -> 5752948
2026-02-12T11:14:32.756244Z  INFO forest::chain_sync::chain_follower: Catching up to HEAD: 5752935[bafy2bzacebuvxf5knf4cc5yvjolmyhfn3gopouhlkbr3qfblsxcehqmtw6i6w, bafy2bzacecudl2k7rooqeoynagymtyo6jkd3r74kqsdz5q2spe4f4tfjltq7g, bafy2bzacebxlzkmanaek5j4rebcwfq44zkdx54eur7ig2hjlk2uaaxssaa4bc] -> 5752949
2026-02-12T11:14:42.757452Z  INFO forest::chain_sync::chain_follower: Catching up to HEAD: 5752935[bafy2bzacebuvxf5knf4cc5yvjolmyhfn3gopouhlkbr3qfblsxcehqmtw6i6w, bafy2bzacecudl2k7rooqeoynagymtyo6jkd3r74kqsdz5q2spe4f4tfjltq7g, bafy2bzacebxlzkmanaek5j4rebcwfq44zkdx54eur7ig2hjlk2uaaxssaa4bc] -> 5752949
2026-02-12T11:14:52.758584Z  INFO forest::chain_sync::chain_follower: Catching up to HEAD: 5752935[bafy2bzacebuvxf5knf4cc5yvjolmyhfn3gopouhlkbr3qfblsxcehqmtw6i6w, bafy2bzacecudl2k7rooqeoynagymtyo6jkd3r74kqsdz5q2spe4f4tfjltq7g, bafy2bzacebxlzkmanaek5j4rebcwfq44zkdx54eur7ig2hjlk2uaaxssaa4bc] -> 5752949
2026-02-12T11:15:02.758831Z  INFO forest::chain_sync::chain_follower: Catching up to HEAD: 5752935[bafy2bzacebuvxf5knf4cc5yvjolmyhfn3gopouhlkbr3qfblsxcehqmtw6i6w, bafy2bzacecudl2k7rooqeoynagymtyo6jkd3r74kqsdz5q2spe4f4tfjltq7g, bafy2bzacebxlzkmanaek5j4rebcwfq44zkdx54eur7ig2hjlk2uaaxssaa4bc] -> 5752950
2026-02-12T11:15:12.760149Z  INFO forest::chain_sync::chain_follower: Catching up to HEAD: 5752935[bafy2bzacebuvxf5knf4cc5yvjolmyhfn3gopouhlkbr3qfblsxcehqmtw6i6w, bafy2bzacecudl2k7rooqeoynagymtyo6jkd3r74kqsdz5q2spe4f4tfjltq7g, bafy2bzacebxlzkmanaek5j4rebcwfq44zkdx54eur7ig2hjlk2uaaxssaa4bc] -> 5752950

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

  • 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
    • Fixed an issue where chain synchronization could become stuck when encountering time-travelling blocks. Previously, affected tipsets were permanently marked as bad, halting progress. The fix now allows graceful skipping of these blocks, enabling future re-validation attempts and continuous synchronization.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 16, 2026

Walkthrough

This PR fixes a chain sync bug where blocks with timestamps in the future (time-travelling blocks) cause the sync process to get stuck. The fix updates the validation logic to skip such blocks rather than permanently marking them as bad, allowing future re-validation and preventing sync stalls.

Changes

Cohort / File(s) Summary
Documentation
CHANGELOG.md
Added release note documenting the bug fix for chain sync getting stuck on time-travelling blocks.
Chain Sync Validation Logic
src/chain_sync/chain_follower.rs
Updated import to include TipsetSyncerError; modified validation error handling to skip (return None) when encountering TimeTravellingBlock errors instead of marking the tipset as permanently bad, with explanatory comments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • akaladarshi
  • sudo-shashank
🚥 Pre-merge checks | ✅ 3 | ❌ 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 (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main fix: preventing tipsets with temporal errors from being permanently marked as bad, which directly addresses the core issue in the changeset.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dont-mark-time-travelling-tipsets-as-bad

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

@LesnyRumcajs LesnyRumcajs force-pushed the dont-mark-time-travelling-tipsets-as-bad branch from e7ed52d to b7a27e3 Compare February 16, 2026 10:13
@LesnyRumcajs LesnyRumcajs marked this pull request as ready for review February 16, 2026 10:13
@LesnyRumcajs LesnyRumcajs requested a review from a team as a code owner February 16, 2026 10:13
@LesnyRumcajs LesnyRumcajs requested review from akaladarshi and sudo-shashank and removed request for a team February 16, 2026 10:13
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/chain_sync/chain_follower.rs (1)

846-858: ⚠️ Potential issue | 🔴 Critical

Fix the TimeTravellingBlock match pattern—it uses struct syntax for a tuple variant.

The enum at tipset_syncer.rs:48 defines TimeTravellingBlock(u64, u64) as a tuple variant. The pattern at line 855 incorrectly uses { .. } (struct syntax). Change it to (..) to match the tuple variant shape. The existing code at tipset_syncer.rs:131 uses the correct (_, _) pattern.

✅ Proposed fix
-                Err(e) if matches!(e, TipsetSyncerError::TimeTravellingBlock { .. }) => {
+                Err(e) if matches!(e, TipsetSyncerError::TimeTravellingBlock(..)) => {
                     warn!("Time travelling block detected, skipping tipset for now: {e}");
                     None
                 }
🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Line 38: The changelog entry currently references the PR number [`#6613`] —
update the entry in CHANGELOG.md to reference the corresponding issue instead
(use the format [`#ISSUE_NO`](link-to-issue): Fixed chain sync getting stuck when
encountering time-travelling blocks by not marking the corresponding tipsets as
permanently bad) if an issue exists; replace the PR link/text with the issue
link and number, keeping the description exact, and only fall back to the PR
number if no issue exists.

Comment thread CHANGELOG.md
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.18%. Comparing base (3846543) to head (b7a27e3).
⚠️ Report is 2 commits behind head on main.

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

... and 19 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

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

@LesnyRumcajs LesnyRumcajs added this pull request to the merge queue Feb 16, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Feb 16, 2026
@LesnyRumcajs LesnyRumcajs added this pull request to the merge queue Feb 16, 2026
Merged via the queue into main with commit a180702 Feb 16, 2026
47 of 49 checks passed
@LesnyRumcajs LesnyRumcajs deleted the dont-mark-time-travelling-tipsets-as-bad branch February 16, 2026 12:33
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