Skip to content

fix(rpc): make ChainGetTipset v2 work with lotus-gateway#6553

Open
hanabi1224 wants to merge 5 commits intomainfrom
hm/fix-chain-get-tipset-v2-gateway-compatibility
Open

fix(rpc): make ChainGetTipset v2 work with lotus-gateway#6553
hanabi1224 wants to merge 5 commits intomainfrom
hm/fix-chain-get-tipset-v2-gateway-compatibility

Conversation

@hanabi1224
Copy link
Contributor

@hanabi1224 hanabi1224 commented Feb 6, 2026

Summary of changes

Changes introduced in this pull request:

Reference issue to close (if applicable)

Closes #6552

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

  • New Features

    • Filecoin.ChainGetTipset RPC now works with lotus-gateway.
  • Improvements

    • More robust tipset selection handling with improved defaulting and serialization behavior.
    • Normalized RPC error messages for clearer, consistent error text when calling APIs.
  • Documentation

    • Added changelog entry noting the lotus-gateway compatibility fix.
  • Tests

    • Expanded test coverage to validate URL parsing and error-message normalization.

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

coderabbitai bot commented Feb 6, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • src/rpc/snapshots/forest__rpc__tests__rpc__v2.snap is excluded by !**/*.snap

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Walkthrough

Adds serde defaults for TipsetSelector fields, normalizes lotus-gateway-wrapped RPC error messages in API comparison tests, updates test endpoints to WebSocket, and adds related tests and changelog entry.

Changes

Cohort / File(s) Summary
Serde serialization defaults
src/rpc/types/tipset_selector.rs
Added default to TipsetHeight.anchor, TipsetAnchor::key and TipsetAnchor::tag serde attributes and skip_serializing_if for key, adjusting (de)serialization to accept missing/None values.
API test infra: endpoints
scripts/tests/api_compare/docker-compose.yml
Switched online API comparison endpoints to use WebSocket (/ws) and added clarifying comments for online/offline blocks.
API test infra: auth checks
src/rpc/mod.rs
In tests, added an HTTP AuthVerify call using the HTTP client alongside the existing WebSocket AuthVerify check.
RPC error normalization
src/tool/subcommands/api_cmd/api_compare_tests.rs
Added normalized_error_message(s: &str) -> Cow<'_, str> to strip lotus-gateway RPC prefixes from error messages and updated test logic to use normalized messages; includes unit tests.
Tests & changelog
src/utils/mod.rs, CHANGELOG.md
Added a WebSocket URL parsing test case and improved assertion messages; added changelog entry noting Filecoin.ChainGetTipset lotus-gateway compatibility fix.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • LesnyRumcajs
  • sudo-shashank
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 70.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 accurately describes the main change: fixing RPC compatibility for ChainGetTipset v2 with lotus-gateway, which aligns with the primary objectives.
Linked Issues check ✅ Passed All code changes address the core issue #6552 requirements: serde attributes added for proper deserialization, WebSocket support verified, error normalization for gateway compatibility, and HTTP client testing added.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing ChainGetTipset v2 compatibility with lotus-gateway; no out-of-scope modifications detected.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hm/fix-chain-get-tipset-v2-gateway-compatibility

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

@hanabi1224 hanabi1224 marked this pull request as ready for review February 6, 2026 14:22
@hanabi1224 hanabi1224 requested a review from a team as a code owner February 6, 2026 14:22
@hanabi1224 hanabi1224 requested review from LesnyRumcajs and sudo-shashank and removed request for a team February 6, 2026 14:22
Copy link
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

🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Line 66: Update the changelog entry that currently references issue `#6553` so
it points to issue `#6552` instead: replace the link and number in the line "-
[`#6553`](https://github.com/ChainSafe/forest/issues/6553):
`Filecoin.ChainGetTipset` now works with `lotus-gateway`." to use "#6552" and
the URL "https://github.com/ChainSafe/forest/issues/6552" so the entry reads "-
[`#6552`](https://github.com/ChainSafe/forest/issues/6552):
`Filecoin.ChainGetTipset` now works with `lotus-gateway`."

@LesnyRumcajs
Copy link
Member

no green checkmark, no review

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.

Filecoin.ChainGetTipSet@v2 not working with lotus-gateway

2 participants