Skip to content

fix: use smaller skip length for tipset_by_height cache#6880

Merged
hanabi1224 merged 3 commits intomainfrom
hm/use-small-skip-length
Apr 9, 2026
Merged

fix: use smaller skip length for tipset_by_height cache#6880
hanabi1224 merged 3 commits intomainfrom
hm/use-small-skip-length

Conversation

@hanabi1224
Copy link
Copy Markdown
Contributor

@hanabi1224 hanabi1224 commented Apr 9, 2026

Summary of changes

Changes introduced in this pull request:

  • use smaller skip length for tipset_by_height cache to match Lotus for better RPC performance

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

  • 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

  • Chores
    • Increased internal lookup cache capacity to improve responsiveness and reduce lookup latency.
    • Standardized epoch checkpointing to a fixed interval for more consistent and efficient epoch processing.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

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: 3dd70da7-1f96-45ac-965a-e881863513c6

📥 Commits

Reviewing files that changed from the base of the PR and between adfa0a5 and 74bbc5c.

📒 Files selected for processing (1)
  • src/chain/store/index.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/chain/store/index.rs

Walkthrough

The PR increases the tipset-height LRU cache size and replaces use of CHAIN_FINALITY for checkpointing with a fixed CHECKPOINT_INTERVAL: ChainEpoch = 20, updating related alignment/detection logic and comments.

Changes

Cohort / File(s) Summary
Cache & checkpoint config
src/chain/store/index.rs
Increased ts_height_cache capacity from 20480_usize to 1048576_usize. Replaced dynamic CHAIN_FINALITY-based checkpoint interval with a fixed CHECKPOINT_INTERVAL: ChainEpoch = 20, adjusted next_checkpoint and is_checkpoint logic, and updated comments.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested labels

RPC

Suggested reviewers

  • LesnyRumcajs
  • akaladarshi
🚥 Pre-merge checks | ✅ 3
✅ 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 change: using a smaller skip length (fixed CHECKPOINT_INTERVAL of 20 instead of CHAIN_FINALITY) for the tipset_by_height cache lookup optimization.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ 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 hm/use-small-skip-length
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch hm/use-small-skip-length

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

@hanabi1224 hanabi1224 marked this pull request as ready for review April 9, 2026 08:00
@hanabi1224 hanabi1224 requested a review from a team as a code owner April 9, 2026 08:00
@hanabi1224 hanabi1224 requested review from LesnyRumcajs and akaladarshi and removed request for a team April 9, 2026 08:00
Comment thread src/chain/store/index.rs Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.56%. Comparing base (160617b) to head (74bbc5c).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
Files with missing lines Coverage Δ
src/chain/store/index.rs 85.79% <100.00%> (ø)

... and 13 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 160617b...74bbc5c. 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.

Comment thread src/chain/store/index.rs
Comment thread src/chain/store/index.rs
@hanabi1224 hanabi1224 enabled auto-merge April 9, 2026 12:04
@hanabi1224 hanabi1224 added this pull request to the merge queue Apr 9, 2026
Merged via the queue into main with commit c77d176 Apr 9, 2026
46 checks passed
@hanabi1224 hanabi1224 deleted the hm/use-small-skip-length branch April 9, 2026 12:25
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