Skip to content

fix index backfill start epoch - #7480

Merged
sudo-shashank merged 3 commits into
mainfrom
shashank/fix-backfilling
Aug 13, 2026
Merged

fix index backfill start epoch#7480
sudo-shashank merged 3 commits into
mainfrom
shashank/fix-backfilling

Conversation

@sudo-shashank

@sudo-shashank sudo-shashank commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

Changes introduced in this pull request:

  • forest-tool api serve --index-backfill-epochs N now backfills N epochs below the chain head. Previously the chain head consumed one of the requested epochs, so only N-1 were indexed.

Reference issue to close (if applicable)

Closes

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

    • Fixed offline server index backfilling to process the requested number of epochs below the chain head.
    • The chain head is no longer counted toward the configured backfill total.
  • Documentation

    • Added a changelog entry describing the corrected backfill behavior.

@coderabbitai

coderabbitai Bot commented Aug 12, 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: a523e056-e1f1-413c-a087-5ab7d5194aff

📥 Commits

Reviewing files that changed from the base of the PR and between b94e322 and d18311c.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • src/tool/offline_server/server.rs
🔗 Linked repositories identified

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

  • filecoin-project/lotus (manual)

Walkthrough

The offline server backfill now requests one additional tipset so the chain head does not count toward index_backfill_epochs. The changelog documents the corrected behavior.

Changes

Offline index backfill

Layer / File(s) Summary
Correct the backfill epoch count
src/tool/offline_server/server.rs, CHANGELOG.md
The backfill range uses saturating addition to include one extra tipset. The changelog records the corrected epoch count.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Mergeability Score: ⚪ Minimal · up to d1831

This localized change corrects the requested number of epochs backfilled below the chain head, with no actionable merge-blocking risk remaining beyond normal checks and review.

Possibly related PRs

Suggested reviewers: lesnyrumcajs, hanabi1224, akaladarshi

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the index backfill epoch fix described in the changeset.
✨ 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 shashank/fix-backfilling
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch shashank/fix-backfilling

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

@sudo-shashank
sudo-shashank force-pushed the shashank/fix-backfilling branch from ec13a64 to 52684e6 Compare August 13, 2026 01:41
@sudo-shashank
sudo-shashank marked this pull request as ready for review August 13, 2026 01:54
@sudo-shashank
sudo-shashank requested a review from a team as a code owner August 13, 2026 01:54
@sudo-shashank
sudo-shashank requested review from EclesioMeloJunior and LesnyRumcajs and removed request for a team August 13, 2026 01:54
@sudo-shashank
sudo-shashank marked this pull request as draft August 13, 2026 01:55
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.21%. Comparing base (4363d7a) to head (ac38986).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/tool/offline_server/server.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/tool/offline_server/server.rs 29.91% <0.00%> (-0.14%) ⬇️

... and 11 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 4363d7a...ac38986. 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 sudo-shashank added the RPC requires calibnet RPC checks to run on CI label Aug 13, 2026
@sudo-shashank
sudo-shashank marked this pull request as ready for review August 13, 2026 05:59

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

No existing scripts need to be updated?

@sudo-shashank

Copy link
Copy Markdown
Contributor Author

No existing scripts need to be updated?

No

@LesnyRumcajs

Copy link
Copy Markdown
Member

No existing scripts need to be updated?

No

Why? Is this feature not used anywhere?

@sudo-shashank

Copy link
Copy Markdown
Contributor Author

No existing scripts need to be updated?

No

Why? Is this feature not used anywhere?

We use --index-backfill-epochs 200 in api-compare. Previously it backfilled 200 tipsets but counted the head as one of them; now it backfills 200 epochs below the head.

In the test @EclesioMeloJunior is working on, where the backfilled epoch count is exactly what's being tested, he had to compensate with BACKFILL=$((EPOCHS + 1)). That won't be needed anymore.

@LesnyRumcajs

Copy link
Copy Markdown
Member

We use --index-backfill-epochs 200 in api-compare. Previously it backfilled 200 tipsets but counted the head as one of them; now it backfills 200 epochs below the head.

So, it this wasteful? Do we need all 200 in practice?

@sudo-shashank

Copy link
Copy Markdown
Contributor Author

We use --index-backfill-epochs 200 in api-compare. Previously, it backfilled 200 tipsets but counted the head as one of them; now it backfills 200 epochs below the head.

So, it this wasteful? Do we need all 200 in practice?

I'll check whether we need all 200 in practice. We can limit the backfill to what is needed.

@sudo-shashank

Copy link
Copy Markdown
Contributor Author

We use --index-backfill-epochs 200 in api-compare. Previously, it backfilled 200 tipsets but counted the head as one of them; now it backfills 200 epochs below the head.

So, it this wasteful? Do we need all 200 in practice?

I'll check whether we need all 200 in practice. We can limit the backfill to what is needed.

It was increased from 50 to 200 in this PR; we can leave it as is.

@sudo-shashank
sudo-shashank added this pull request to the merge queue Aug 13, 2026
Merged via the queue into main with commit a22f32e Aug 13, 2026
68 of 69 checks passed
@sudo-shashank
sudo-shashank deleted the shashank/fix-backfilling branch August 13, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RPC requires calibnet RPC checks to run on CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants