Skip to content

Conversation

@hanabi1224
Copy link
Contributor

@hanabi1224 hanabi1224 commented Nov 4, 2025

Summary of changes

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.

Summary by CodeRabbit

  • Refactor
    • Simplified RPC method naming for state operations
    • Re-enabled Filecoin F3 manifest API method support

@hanabi1224 hanabi1224 added the RPC requires calibnet RPC checks to run on CI label Nov 4, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 4, 2025

Walkthrough

Two RPC method identifiers (StateWaitMsg and StateSectorPreCommitInfo) have their version suffixes removed from their public NAME constants in state.rs. Corresponding entries are removed from test filter and ignore lists to re-enable testing of these methods.

Changes

Cohort / File(s) Change Summary
RPC Method Naming
src/rpc/methods/state.rs
Removed "V0" suffix from two RPC method NAME constants: StateWaitMsgV0 now maps to "Filecoin.StateWaitMsg" and StateSectorPreCommitInfoV0 now maps to "Filecoin.StateSectorPreCommitInfo"
Test Configuration
scripts/tests/api_compare/filter-list
Removed exclusion entry !Filecoin.F3GetManifest and associated disable comment
Test Snapshots
src/tool/subcommands/api_cmd/test_snapshots_ignored.txt
Removed two entries from ignored snapshot list: Filecoin.StateSectorPreCommitInfoV0 and Filecoin.StateWaitMsgV0

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Straightforward configuration and naming updates across three files
  • Homogeneous changes (coordinated removals and renames)
  • No logic or control flow modifications

Suggested reviewers

  • LesnyRumcajs
  • sudo-shashank

Pre-merge checks and finishing touches

✅ 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 'fix(rpc): method name of V0 only RPC methods' accurately summarizes the main change: renaming V0 RPC method identifiers by removing the V0 suffix from their public NAME constants.
✨ 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 hm/fix-v0-rpc-method-name

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 717af47 and 05c1fe8.

📒 Files selected for processing (3)
  • scripts/tests/api_compare/filter-list (0 hunks)
  • src/rpc/methods/state.rs (2 hunks)
  • src/tool/subcommands/api_cmd/test_snapshots_ignored.txt (0 hunks)
💤 Files with no reviewable changes (2)
  • src/tool/subcommands/api_cmd/test_snapshots_ignored.txt
  • scripts/tests/api_compare/filter-list
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: akaladarshi
Repo: ChainSafe/forest PR: 6000
File: src/rpc/registry/actors/miner.rs:388-392
Timestamp: 2025-09-10T10:32:54.333Z
Learning: In miner actor v17, the methods ExtendSectorExpiration, ProveCommitAggregate, and ProveReplicaUpdates have been deprecated and are intentionally not registered, unlike in v16 where they are still supported.
Learnt from: hanabi1224
Repo: ChainSafe/forest PR: 5930
File: build.rs:64-77
Timestamp: 2025-08-13T09:43:20.301Z
Learning: hanabi1224 prefers hard compile-time errors in build scripts rather than runtime safeguards or collision detection, believing it's better to fail fast and fix root causes of issues like malformed snapshot names.
Learnt from: hanabi1224
Repo: ChainSafe/forest PR: 6057
File: src/cli/subcommands/f3_cmd.rs:0-0
Timestamp: 2025-09-09T10:37:17.947Z
Learning: hanabi1224 prefers having default timeouts (like 10m for --no-progress-timeout) to prevent commands from hanging indefinitely, even when the timeout flag isn't explicitly provided by users. This fail-fast approach is preferred over requiring explicit flag usage.
📚 Learning: 2025-09-02T10:05:34.350Z
Learnt from: akaladarshi
Repo: ChainSafe/forest PR: 5923
File: src/rpc/registry/actors/miner.rs:221-223
Timestamp: 2025-09-02T10:05:34.350Z
Learning: For miner actor ChangeOwnerAddress and ChangeOwnerAddressExported methods: versions 8-10 use bare Address as parameter type, while versions 11+ use ChangeOwnerAddressParams. This reflects the evolution of the Filecoin miner actor parameter structures across versions.

Applied to files:

  • src/rpc/methods/state.rs
📚 Learning: 2025-08-14T06:46:08.056Z
Learnt from: akaladarshi
Repo: ChainSafe/forest PR: 5923
File: src/rpc/registry/actors/miner.rs:0-0
Timestamp: 2025-08-14T06:46:08.056Z
Learning: ProveCommitSectors3 method is available in fil_actor_miner_state::v13 and should be mapped to ProveCommitSectors3Params, not ProveCommitSectorParams.

Applied to files:

  • src/rpc/methods/state.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: tests
  • GitHub Check: tests-release
  • GitHub Check: Build forest binaries on Linux AMD64
  • GitHub Check: V2 snapshot export checks
  • GitHub Check: Diff snapshot export checks
🔇 Additional comments (2)
src/rpc/methods/state.rs (2)

2050-2050: LGTM - Consistent with StateWaitMsg changes.

The removal of the V0 suffix from StateSectorPreCommitInfoV0::NAME is consistent with the earlier change to StateWaitMsgV0. Both V0 and V1 implementations now share the same method name and are distinguished by their API_PATHS flags. Note that the V0 implementation returns a non-optional SectorPreCommitOnChainInfo while V1 returns Option<SectorPreCommitOnChainInfo>, which aligns with the API evolution.


1112-1112: No issues found—design is correct.

The duplicate NAMEs across API versions are intentional and properly handled by the RPC framework. Methods are registered into separate modules per API version (HashMap<ApiPaths, Methods> at mod.rs:536-537), and the segregation layer checks API_PATHS.contains(version) to filter which methods are available per endpoint. Within each version module, NAMEs remain unique. The name unification (removing V0 suffix) was intentional per git commit 05c1fe8 "fix(rpc): method name of V0 only RPC methods".

Both struct implementations remain distinct internally with different parameter counts and API_PATHS flags, ensuring correct dispatch without routing conflicts.


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

@hanabi1224 hanabi1224 marked this pull request as ready for review November 4, 2025 08:08
@hanabi1224 hanabi1224 requested a review from a team as a code owner November 4, 2025 08:08
@hanabi1224 hanabi1224 requested review from LesnyRumcajs and elmattic and removed request for a team November 4, 2025 08:08
@LesnyRumcajs LesnyRumcajs added this pull request to the merge queue Nov 4, 2025
Merged via the queue into main with commit 39b45d9 Nov 4, 2025
46 of 71 checks passed
@LesnyRumcajs LesnyRumcajs deleted the hm/fix-v0-rpc-method-name branch November 4, 2025 09:37
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.

3 participants