Skip to content

fix(rpc): use large message lookback limit in API tests to mitigate offline test failure#6857

Merged
hanabi1224 merged 1 commit intomainfrom
hm/use-larger-message-lookback-limit
Apr 6, 2026
Merged

fix(rpc): use large message lookback limit in API tests to mitigate offline test failure#6857
hanabi1224 merged 1 commit intomainfrom
hm/use-larger-message-lookback-limit

Conversation

@hanabi1224
Copy link
Copy Markdown
Contributor

@hanabi1224 hanabi1224 commented Apr 6, 2026

Summary of changes

Chain head difference between offline server and lotus node can be larger than 800. The tests passed previously because of a bug in Lotus that has been fixed by filecoin-project/lotus#13562

Changes introduced in this pull request:

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

  • Refactor
    • Improved test configuration management by consolidating hardcoded values into a reusable constant for enhanced maintainability and consistency across test cases.

@hanabi1224 hanabi1224 added the RPC requires calibnet RPC checks to run on CI label Apr 6, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 6, 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: fb32c436-78a8-4b16-a92f-6904df2a1342

📥 Commits

Reviewing files that changed from the base of the PR and between e7c2f0f and 4d2e201.

📒 Files selected for processing (1)
  • src/tool/subcommands/api_cmd/api_compare_tests.rs

Walkthrough

This change introduces a constant MESSAGE_LOOKBACK_LIMIT set to 2000 and replaces hardcoded lookback values of 800 throughout test generation functions with this constant.

Changes

Cohort / File(s) Summary
Constant Extraction & Test Refactoring
src/tool/subcommands/api_cmd/api_compare_tests.rs
Added MESSAGE_LOOKBACK_LIMIT constant (value: 2000) and replaced hardcoded lookback values (800) with this constant in message lookup and Ethereum receipt-limited test generation functions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • ChainSafe/forest#6813: Touches the same RPC methods (StateSearchMsg and EthGetTransactionReceiptLimited) being tested.
  • ChainSafe/forest#6589: Also adjusts the message lookback limit to 2000 for state/message lookup behavior.

Suggested reviewers

  • akaladarshi
  • sudo-shashank
🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: using a larger message lookback limit in API tests to fix offline test failures.

✏️ 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-larger-message-lookback-limit
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch hm/use-larger-message-lookback-limit

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

@hanabi1224 hanabi1224 marked this pull request as ready for review April 6, 2026 13:20
@hanabi1224 hanabi1224 requested a review from a team as a code owner April 6, 2026 13:20
@hanabi1224 hanabi1224 requested review from akaladarshi and sudo-shashank and removed request for a team April 6, 2026 13:20
@hanabi1224 hanabi1224 enabled auto-merge April 6, 2026 13:34
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.97%. Comparing base (e7c2f0f) to head (4d2e201).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

see 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 e7c2f0f...4d2e201. 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.

@hanabi1224 hanabi1224 added this pull request to the merge queue Apr 6, 2026
Merged via the queue into main with commit 3bdb46c Apr 6, 2026
42 of 66 checks passed
@hanabi1224 hanabi1224 deleted the hm/use-larger-message-lookback-limit branch April 6, 2026 13:59
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