Skip to content

Conversation

@akaladarshi
Copy link
Collaborator

@akaladarshi akaladarshi commented Aug 4, 2025

Summary of changes

Changes introduced in this pull request:

  • Adds support for verifiedreg actor methods in StateDecodeParams

Reference issue to close (if applicable)

Closes: #5720

Other information and links

@elmattic here are the metadata for the test that rpcsnap files are testing.

File Name Method Name Method Number
filecoin_verified_reg_statedecodeparams_1754401651142334.rpcsnap.json.zst Constructor 1
filecoin_verified_reg_statedecodeparams_1754401651146144.rpcsnap.json.zst AddVerifier 2
filecoin_verified_reg_statedecodeparams_1754401651146246.rpcsnap.json.zst RemoveVerifier 3
filecoin_verified_reg_statedecodeparams_1754401651146327.rpcsnap.json.zst AddVerifiedClient 4
filecoin_verified_reg_statedecodeparams_1754401651146402.rpcsnap.json.zst RemoveVerifiedClientDataCap 7
filecoin_verified_reg_statedecodeparams_1754401651146485.rpcsnap.json.zst RemoveExpiredAllocations 8
filecoin_verified_reg_statedecodeparams_1754401651146560.rpcsnap.json.zst ClaimAllocations 9
filecoin_verified_reg_statedecodeparams_1754401651146644.rpcsnap.json.zst GetClaims 10
filecoin_verified_reg_statedecodeparams_1754401651146719.rpcsnap.json.zst ExtendClaimTerms 11
filecoin_verified_reg_statedecodeparams_1754401651146788.rpcsnap.json.zst RemoveExpiredClaims 12
filecoin_verified_reg_statedecodeparams_1754401651146860.rpcsnap.json.zst AddVerifiedClientExported 3916220144
filecoin_verified_reg_statedecodeparams_1754401651146948.rpcsnap.json.zst RemoveExpiredAllocationsExported 2421068268
filecoin_verified_reg_statedecodeparams_1754401651147022.rpcsnap.json.zst GetClaimsExported 2199871187
filecoin_verified_reg_statedecodeparams_1754401651147091.rpcsnap.json.zst ExtendClaimTermsExported 1752273514
filecoin_verified_reg_statedecodeparams_1754401651147157.rpcsnap.json.zst RemoveExpiredClaimsExported 2873373899
filecoin_verified_reg_statedecodeparams_1754401651147231.rpcsnap.json.zst UniversalReceiverHook 3726118371

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

  • New Features

    • Added full support for the Verified Registry actor across versions v8–v16, including method registration and parameter JSON mappings.
    • Introduced versioned signature and signature-type JSON handling for multi-version compatibility.
  • Tests

    • Expanded API comparison tests with extensive Verified Registry coverage and added related snapshots.
    • Reorganized per-actor test helpers for clearer, modular test generation.
  • Chores

    • Registered Verified Registry in the method registry.
    • Removed unused imports and added an optional dependency.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 4, 2025

Walkthrough

Adds Verified Registry (VerifReg) actor support to StateDecodeParams across versions v8–v16: new RPC registry module and registrations, comprehensive Lotus JSON mappings for VerifReg method parameters, versioned signature/type Lotus JSON bridges, expanded API tests and snapshots, an optional fvm_actor_utils dependency, and minor unused-import removals.

Changes

Cohort / File(s) Summary
Verified Registry RPC module & registration
src/rpc/registry/actors/mod.rs, src/rpc/registry/actors/verified_reg.rs, src/rpc/registry/methods_reg.rs
Adds verified_reg actor module; registers VerifReg methods per actor version (v8–v16) in the method registry; updates registration closure to use anyhow::Result.
VerifReg Lotus JSON mappings
src/lotus_json/actor_states/methods/mod.rs, src/lotus_json/actor_states/methods/verified_reg_actor.rs
Exposes verified_reg_actor module and implements extensive Lotus JSON structs and HasLotusJson conversions for VerifReg method parameters across v8–v16, including UniversalReceiverParams.
Versioned signature/type Lotus JSON
src/lotus_json/signature.rs, src/lotus_json/signature_type.rs
Adds SignatureV2/V3/V4 and SignatureTypeV2/V3/V4 Lotus JSON representations and HasLotusJson impls for fvm_shared2/3/4 signature types; includes test snapshots.
API tests & snapshots
src/tool/subcommands/api_cmd/api_compare_tests.rs, src/tool/subcommands/api_cmd/test_snapshots.txt
Refactors state_decode_params tests into per-actor helpers; adds VerifReg parameter tests and appends corresponding snapshots.
Dependency update
Cargo.toml
Adds optional dependency fvm_actor_utils = "14.0.0" (used for UniversalReceiverParams).
Minor import cleanups
src/rpc/registry/actors/account.rs, .../evm.rs, .../init.rs, .../miner.rs, .../power.rs, .../reward.rs, .../cron.rs, .../datacap.rs, .../multisig.rs
Removes unused anyhow::Result imports; no logic changes.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant MethodRegistry
  participant VerifiedRegModule as VerifiedReg (v8–v16)
  participant LotusJson as LotusJson Converters

  Client->>MethodRegistry: StateDecodeParams(actorCid, methodNum, params, tipset)
  MethodRegistry->>VerifiedRegModule: register_actor_methods(actorCid, version)
  MethodRegistry->>LotusJson: select param LotusJson type for (version, methodNum)
  LotusJson-->>MethodRegistry: deserialize params → versioned struct
  MethodRegistry-->>Client: return decoded params (Lotus JSON)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Assessment against linked issues

Objective Addressed Explanation
Support VerifReg StateDecodeParams for v8–v16 (#5720)

Possibly related PRs

Suggested reviewers

  • sudo-shashank
  • LesnyRumcajs

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch akaladarshi/add-verifiedreg-actor-decode-params

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@akaladarshi akaladarshi added the RPC requires calibnet RPC checks to run on CI label Aug 4, 2025
@akaladarshi akaladarshi force-pushed the akaladarshi/add-verifiedreg-actor-decode-params branch from 04acaa2 to dfd085f Compare August 5, 2025 14:26
@akaladarshi akaladarshi marked this pull request as ready for review August 5, 2025 14:27
@akaladarshi akaladarshi requested a review from a team as a code owner August 5, 2025 14:27
@akaladarshi akaladarshi requested review from LesnyRumcajs and sudo-shashank and removed request for a team August 5, 2025 14:27
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: 2

♻️ Duplicate comments (2)
src/shim/crypto.rs (2)

128-141: Same unsafe signature conversion issue

This implementation has the same issue with converting SignatureType::Delegated to BLS. See the critical issue raised above.


143-156: Verify fvm_shared4 signature type support

The comment claims v4 doesn't have Delegated signature type, but this should be verified. If true, the same unsafe conversion issue applies.

#!/bin/bash
# Description: Verify if fvm_shared4 supports Delegated signature type

# Check fvm_shared4 SignatureType definition
fd -e rs . | xargs rg "enum SignatureType" -A 10 | grep -A 10 "fvm_shared4"

# Check if there's any Delegated variant in fvm_shared4
rg "Delegated" --type rust | grep "fvm_shared4"
🧹 Nitpick comments (2)
src/rpc/registry/actors/verified_reg.rs (1)

229-251: Efficient consolidation for v12+ versions.

The register_verified_reg_v12_plus macro effectively handles versions 12-16 which share the same method set. The main dispatch function correctly routes to version-specific implementations.

Consider adding a debug log or comment for the empty default case to document that unknown versions are intentionally ignored.

-        _ => {}
+        _ => {
+            // Unknown versions are ignored - only known actor versions are supported
+        }
src/lotus_json/actor_states/methods/verified_reg_actor.rs (1)

1019-1035: Document version-specific implementations

Consider adding comments to explain:

  1. Why v8 and v9 are excluded from impl_verifier_params (line 1020)
  2. The mapping between actor versions and fvm_shared versions (lines 1027-1029)
  3. Why different claim allocation param structures are used for v9-v11 vs v12+ (lines 1031-1033)

This will help future maintainers understand the version-specific logic.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6fa222b and dfd085f.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (15)
  • Cargo.toml (1 hunks)
  • src/lotus_json/actor_states/methods/mod.rs (2 hunks)
  • src/lotus_json/actor_states/methods/verified_reg_actor.rs (1 hunks)
  • src/rpc/registry/actors/account.rs (0 hunks)
  • src/rpc/registry/actors/evm.rs (0 hunks)
  • src/rpc/registry/actors/init.rs (0 hunks)
  • src/rpc/registry/actors/miner.rs (0 hunks)
  • src/rpc/registry/actors/mod.rs (1 hunks)
  • src/rpc/registry/actors/power.rs (0 hunks)
  • src/rpc/registry/actors/reward.rs (0 hunks)
  • src/rpc/registry/actors/verified_reg.rs (1 hunks)
  • src/rpc/registry/methods_reg.rs (3 hunks)
  • src/shim/crypto.rs (1 hunks)
  • src/tool/subcommands/api_cmd/api_compare_tests.rs (2 hunks)
  • src/tool/subcommands/api_cmd/test_snapshots.txt (1 hunks)
💤 Files with no reviewable changes (6)
  • src/rpc/registry/actors/init.rs
  • src/rpc/registry/actors/account.rs
  • src/rpc/registry/actors/evm.rs
  • src/rpc/registry/actors/reward.rs
  • src/rpc/registry/actors/power.rs
  • src/rpc/registry/actors/miner.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). (9)
  • GitHub Check: tests-release
  • GitHub Check: Build forest binaries on Linux AMD64
  • GitHub Check: tests
  • GitHub Check: All lint checks
  • GitHub Check: cargo-publish-dry-run
  • GitHub Check: Build Ubuntu
  • GitHub Check: Build MacOS
  • GitHub Check: Analyze (rust)
  • GitHub Check: Analyze (go)
🔇 Additional comments (19)
Cargo.toml (1)

223-223: fvm_actor_utils dependency usage verified

The fvm_actor_utils crate is referenced in multiple places in production code, so it must remain a required dependency:

• src/tool/subcommands/api_cmd/api_compare_tests.rs
• src/rpc/registry/actors/verified_reg.rs
• src/lotus_json/actor_states/methods/verified_reg_actor.rs

Since none of these usages are gated behind a Cargo feature, leaving fvm_actor_utils = "14.0.0" as a non-optional dependency is correct. Only if you intend to make VerifiedRegistry support truly optional should you add optional = true and expose it via a new feature.

src/lotus_json/actor_states/methods/mod.rs (2)

3-3: Good formatting improvement.

Adding the newline after the SPDX license identifier improves readability and follows standard formatting conventions.


15-15: LGTM: Module declaration follows existing patterns.

The verified_reg_actor module declaration is consistent with the existing module structure and correctly uses pub visibility to match other actor modules.

src/rpc/registry/actors/mod.rs (1)

11-11: LGTM: Module declaration is consistent.

The verified_reg module declaration follows the established pattern and uses appropriate pub(crate) visibility for the RPC registry actors module.

src/tool/subcommands/api_cmd/test_snapshots.txt (1)

146-157: Excellent test coverage for VerifiedRegistry actor.

The addition of 12 new snapshot files demonstrates comprehensive test coverage for the VerifiedRegistry actor's StateDecodeParams functionality. The files follow the established naming convention and are properly sequenced.

src/rpc/registry/methods_reg.rs (3)

76-78: LGTM: Clean import organization.

The addition of verified_reg to the imports is well-organized and follows the existing alphabetical ordering pattern.


91-93: LGTM: Consistent actor registration pattern.

The VerifiedRegistry actor registration follows the established pattern used by other builtin actors and correctly delegates to the version-specific registration function.


135-135: Good error type consistency improvement.

Changing the closure return type from Result<$param_type> to anyhow::Result<$param_type> improves consistency with the rest of the codebase's error handling approach.

src/tool/subcommands/api_cmd/api_compare_tests.rs (2)

1899-1988: LGTM! Comprehensive parameter declarations for Verified Registry actor.

The parameter structs cover all major Verified Registry operations and use the correct types from fil_actor_verifreg_state::v16. The test data includes appropriate dummy values for signatures and addresses.


2101-2196: Well-structured test coverage for all Verified Registry methods.

The tests correctly use the Method enum for method numbers and appropriately reuse parameter instances for exported method variants. All major Verified Registry operations are covered, including the UniversalReceiverHook.

src/rpc/registry/actors/verified_reg.rs (4)

11-78: Excellent version-aware handling of core methods.

The macro correctly handles the evolution of parameter types across versions:

  • v8: Uses generic VerifierParams
  • v9-v10: Introduces specialized parameter types
  • v11+: Full set of typed parameters including ConstructorParams

This approach maintains backward compatibility while supporting newer versions.


81-158: Good handling of method evolution across versions.

The macros correctly capture the evolution of allocation-related methods:

  • v8 has unique UseBytes/RestoreBytes methods
  • v9 introduced allocation/claims methods including ClaimAllocations
  • v10-v11 temporarily removed ClaimAllocations (no_claim variant)
  • v12+ restored ClaimAllocations

This accurately reflects the actor's method evolution.


160-202: Clean implementation of exported methods and universal receiver.

The macros effectively handle:

  • Registration of exported method variants for public API
  • Dynamic version-specific imports using the paste! macro
  • Proper use of fvm_actor_utils::receiver::UniversalReceiverParams for cross-actor communication

204-227: Correct version-specific method registration.

Each version function accurately registers the appropriate method set:

  • v8: Basic verifier management
  • v9: Adds allocation/claims functionality
  • v10-v11: Adds exported methods API while temporarily removing ClaimAllocations

The registration order and method selection align with the actor's historical evolution.

src/shim/crypto.rs (3)

71-83: LGTM!

The conversion from fvm_shared3::crypto::signature::Signature to local Signature is correctly implemented.


85-97: LGTM!

The conversion from fvm_shared4::crypto::signature::Signature to local Signature is correctly implemented.


114-126: LGTM!

The conversion from fvm_shared2::crypto::signature::Signature to local Signature is correctly implemented.

src/lotus_json/actor_states/methods/verified_reg_actor.rs (2)

181-181: PaddedPieceSize usage is consistent

After inspection, all Lotus JSON structs in src/lotus_json/ (e.g., in both verified_reg_actor.rs and allocation.rs) declare their size fields using the PaddedPieceSize newtype. There is no occurrence of a raw u64 for these fields, so the originally flagged inconsistency does not exist. No changes are needed here.

Likely an incorrect or invalid review comment.


551-628: Verify signature conversions in impl_remove_data_cap_params macro

The .into() calls in the macro (lines 601, 605, 616, 620) rely on the From implementations in the fvm_shared2::crypto, fvm_shared3::crypto, and fvm_shared4::crypto crates. You should confirm whether these conversions preserve the Delegated signature variant (if supported) or erroneously coerce everything to BLS, which would break signature verification for actor versions 8–11.

Paths to inspect:

  • src/lotus_json/actor_states/methods/verified_reg_actor.rs around the impl_remove_data_cap_params macro (lines 551–628)
  • Signature From impls in the fvm_shared2, fvm_shared3, and fvm_shared4 crypto modules

If Delegated signatures must be supported, update the conversion logic to handle them explicitly; otherwise, verify that only BLS signatures are used here.

Cargo.toml Outdated
tikv-jemallocator = { version = "0.6", optional = true }
tracing-chrome = { version = "0.7", optional = true }
tracing-loki = { version = "0.2", default-features = false, features = ["compat-0-2-1", "rustls"], optional = true }
use = "0.0.1-pre.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Clarify the purpose and naming of the use dependency.

The dependency name use is unusual and may cause confusion since use is a Rust keyword. Please clarify:

  1. What functionality this dependency provides
  2. Whether this is the correct/intended package name
  3. Consider if a more descriptive alias should be used

🏁 Script executed:

#!/bin/bash
# Description: Verify the use dependency exists and check its purpose
# Expected: Find usage in codebase and verify package exists

rg -A 3 "extern crate use|use use::" --type rust
curl -s https://crates.io/api/v1/crates/use | jq '.crate.description'

Length of output: 142


Clarify and alias the use dependency in Cargo.toml

It looks like you’re pulling in the use crate (description: “plugin based design”) but its name collides with Rust’s use keyword and isn’t self-descriptive. Please:

  • Summarize its purpose (e.g. “plugin-based extension framework”) in a comment above the dependency.
  • Alias it to something clearer (for example plugin_framework or plugins) by renaming the dependency:
# plugin-based extension framework
[dependencies]
plugin_framework = { package = "use", version = "0.0.1-pre.0" }

This makes its intent clear and avoids confusion with the use statement.

🤖 Prompt for AI Agents
In Cargo.toml at line 228, the dependency named "use" conflicts with Rust's
keyword and is unclear. Add a comment above this dependency summarizing its
purpose as a "plugin-based extension framework" and rename the dependency by
aliasing it to a clearer name like "plugin_framework" using the syntax:
plugin_framework = { package = "use", version = "0.0.1-pre.0" }. This clarifies
intent and avoids confusion.

Comment on lines 146 to 157
filecoin_statedecodeparams_1754401651142334.rpcsnap.json.zst
filecoin_statedecodeparams_1754401651146485.rpcsnap.json.zst
filecoin_statedecodeparams_1754401651146560.rpcsnap.json.zst
filecoin_statedecodeparams_1754401651146644.rpcsnap.json.zst
filecoin_statedecodeparams_1754401651146719.rpcsnap.json.zst
filecoin_statedecodeparams_1754401651146788.rpcsnap.json.zst
filecoin_statedecodeparams_1754401651146860.rpcsnap.json.zst
filecoin_statedecodeparams_1754401651146948.rpcsnap.json.zst
filecoin_statedecodeparams_1754401651147022.rpcsnap.json.zst
filecoin_statedecodeparams_1754401651147091.rpcsnap.json.zst
filecoin_statedecodeparams_1754401651147157.rpcsnap.json.zst
filecoin_statedecodeparams_1754401651147231.rpcsnap.json.zst
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's embed verified registry in the name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does filecoin_verifie_reg_statedecodeparams_1754230255606413.rpcsnap.json.zst works ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akaladarshi lets also add method name here, so we know which method is getting tested
filecoin_verifie_reg_constructor_statedecodeparams_1754230255606413.rpcsnap.json.zst

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sudo-shashank It's already there

Copy link
Contributor

@sudo-shashank sudo-shashank Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filecoin_verified_reg_statedecodeparams_1754401651142334.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754401651146144.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754401651146246.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754401651146327.rpcsnap.json.zst

@akaladarshi with the addition of actor name we now know that these are used for testing verifreg state decode params but it would be better to know which method of verifreg actor it's testing like Constructor, AddVerifier, GetClaimsExported etc

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we really need that, #5904 (comment), it is being done separately.

We just need to include the name of actor in the file and add the details in the PR description about which snap file is tested with method name as mentioned in the comment.

You can check the description of this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel it's helpful but i'll let @elmattic suggest here

14 => register_verified_reg_v12_plus!(registry, cid, fil_actor_verifreg_state::v14, v14),
15 => register_verified_reg_v12_plus!(registry, cid, fil_actor_verifreg_state::v15, v15),
16 => register_verified_reg_v12_plus!(registry, cid, fil_actor_verifreg_state::v16, v16),
_ => {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'd be better to actually report some error in this case

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually we are not returning anything here, this is just populating the registry with the
codecid -> methodsParams type for a specific version, so if the version that we are not supporting will just not register and when the StateDecodeParams api actually called with unregistered version(actor code cid), we are returning an error if the code_cid is not there.

Copy link
Member

@LesnyRumcajs LesnyRumcajs Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, okay. I'd love if we wouldn't use integers here and matching on them. But it doesn't have to be in this PR.

Imagine a scenario that will come in a month or so; a new actors version is released: 17. A nice thing to have is let the compiler tell you where you need to update your code with the new version. A good thing about matching on an enum is that whenever a new variant is introduced, the entire build fails for places where it's matched non-exhaustively.

The alternative is finding the issues in runtime, which is not ideal and brings us closer to Python land (a bad place).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, I’ll keep this in mind.

I’m planning to open a PR once we’ve implemented all the actor methods. In that PR, we can review the overall design and suggest changes like renaming files or doing cleanups. I’ll introduce this change in that PR as well.

LesnyRumcajs
LesnyRumcajs previously approved these changes Aug 6, 2025
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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 662e926 and 91c4223.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • Cargo.toml (1 hunks)
  • src/lotus_json/actor_states/methods/verified_reg_actor.rs (1 hunks)
  • src/shim/crypto.rs (2 hunks)
  • src/tool/subcommands/api_cmd/test_snapshots.txt (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • Cargo.toml
  • src/shim/crypto.rs
  • src/tool/subcommands/api_cmd/test_snapshots.txt
⏰ 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). (9)
  • GitHub Check: tests
  • GitHub Check: tests-release
  • GitHub Check: cargo-publish-dry-run
  • GitHub Check: Build MacOS
  • GitHub Check: Build Ubuntu
  • GitHub Check: Build forest binaries on Linux AMD64
  • GitHub Check: All lint checks
  • GitHub Check: Analyze (rust)
  • GitHub Check: Analyze (go)
🔇 Additional comments (2)
src/lotus_json/actor_states/methods/verified_reg_actor.rs (2)

1-14: Well-structured implementation with comprehensive version support

The file successfully implements Lotus JSON serialization/deserialization for VerifReg actor parameters across multiple versions. The use of macros effectively reduces code duplication while handling version-specific differences.


1019-1025: Confirm version coverage for VerifReg actor methods
It looks like you’ve intentionally omitted versions 8–10 from:

  • impl_constructor_params (starts at v11)
  • impl_remove_verifier_params (starts at v11)
  • and omitted v8 from impl_remove_expired_allocations_params.

Because these type definitions live in external crates (not in this repo), I can’t automatically verify which actor versions actually introduced those methods.
Please double-check and document in comments or the PR description that:

  • “Constructor” truly only exists from v11 onward
  • “RemoveVerifier” only exists from v11 onward
  • “RemoveExpiredAllocations” only exists from v9 onward

This will ensure future readers know these gaps are intentional.

@akaladarshi akaladarshi marked this pull request as draft August 7, 2025 11:50
@akaladarshi akaladarshi force-pushed the akaladarshi/add-verifiedreg-actor-decode-params branch 2 times, most recently from a4d9d56 to 30f5dbc Compare August 7, 2025 16:05
@akaladarshi akaladarshi force-pushed the akaladarshi/add-verifiedreg-actor-decode-params branch from 30f5dbc to b40cd3f Compare August 14, 2025 09:26
@akaladarshi akaladarshi marked this pull request as ready for review August 18, 2025 12:06
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: 7

♻️ Duplicate comments (1)
src/rpc/registry/actors/verified_reg.rs (1)

238-251: Prefer a version enum over raw integers for exhaustiveness

Matching on raw u64 is fragile. An enum representing actor versions would force exhaustive matches at compile time when v17+ arrive, preventing silent runtime fallthrough.

🧹 Nitpick comments (6)
src/rpc/registry/actors/verified_reg.rs (2)

10-78: Reduce duplication across version arms in core method registration

The v8/v9/v10 arms largely mirror the generic path used for v11+, with only a few type deltas. Consider consolidating these via a single macro with small overrides (e.g., by passing a flag or a tiny per-version mapping), to reduce maintenance when adding v17+ later.


186-202: Optional dependency fvm_actor_utils used unconditionally

register_universal_receiver_hook! uses fvm_actor_utils::receiver::UniversalReceiverParams. If fvm_actor_utils is marked optional in Cargo.toml (as indicated in the PR summary), this unconditional use could break builds when the feature isn’t enabled.

Either:

  • gate the use with a feature, or
  • make the dependency non-optional or part of default features.

I can propose a feature-gated variant if desired.

Would you like me to generate a small Cargo.toml feature snippet and cfg-gates here?

src/lotus_json/signature_type.rs (1)

52-69: Minor simplification: avoid untagged single-variant enums

Since these are always integers, an enum with a single Integer variant and #[serde(untagged)] is unnecessary. A transparent newtype is simpler and more explicit.

Example for v2 (apply similarly to v3/v4):

-#[derive(Deserialize, Serialize, JsonSchema)]
-#[serde(untagged)]
-pub enum SignatureTypeV2LotusJson {
-    Integer(#[schemars(with = "u8")] fvm_shared2::crypto::signature::SignatureType),
-}
+#[derive(Deserialize, Serialize, JsonSchema)]
+#[serde(transparent)]
+pub struct SignatureTypeV2LotusJson(
+    #[schemars(with = "u8")] fvm_shared2::crypto::signature::SignatureType
+);
src/tool/subcommands/api_cmd/api_compare_tests.rs (1)

2287-2399: Duplicate LockBalance test — remove one occurrence

LockBalance is added twice with identical params (Lines 2381–2385 and 2386–2391). It’ll be deduped later, but better to drop the duplicate for clarity.

Apply this diff:

         RpcTest::identity(StateDecodeParams::request((
             Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/,
             fil_actor_multisig_state::v16::Method::LockBalance as u64,
             to_vec(&multisig_lock_bal_params)?,
             tipset.key().into(),
         ))?),
-        RpcTest::identity(StateDecodeParams::request((
-            Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/,
-            fil_actor_multisig_state::v16::Method::LockBalance as u64,
-            to_vec(&multisig_lock_bal_params)?,
-            tipset.key().into(),
-        ))?),
src/lotus_json/actor_states/methods/verified_reg_actor.rs (2)

41-52: Schema derivations are inconsistent across v2/v3/v4 RemoveDataCap params.

Minor, but for API docs consistency, consider deriving JsonSchema on RemoveDataCapParamsV2LotusJson and V3LotusJson (as done on requests) so all public LotusJson types have schema metadata.

-#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
+#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone, PartialEq)]
 pub struct RemoveDataCapParamsV2LotusJson {
-#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
+#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone, PartialEq)]
 pub struct RemoveDataCapParamsV3LotusJson {

111-120: Validate lotus_json adapters on primitive Vec usage.

You're using #[schemars(with = "LotusJson<Vec<u64>>")] and #[serde(with = "crate::lotus_json")] on Vec fields. If crate::lotus_json doesn't special-case Vec, this indirection is unnecessary and could cause trait bound friction. If it's intentional and supported, ignore this. Otherwise, consider removing the lotus_json adapter and letting serde handle primitives directly.

Would you like me to grep the codebase for existing patterns and adjust accordingly?

Also applies to: 173-182, 202-211

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 91c4223 and 41a3e90.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (19)
  • Cargo.toml (1 hunks)
  • src/lotus_json/actor_states/methods/mod.rs (2 hunks)
  • src/lotus_json/actor_states/methods/verified_reg_actor.rs (1 hunks)
  • src/lotus_json/signature.rs (2 hunks)
  • src/lotus_json/signature_type.rs (1 hunks)
  • src/rpc/registry/actors/account.rs (0 hunks)
  • src/rpc/registry/actors/cron.rs (0 hunks)
  • src/rpc/registry/actors/datacap.rs (0 hunks)
  • src/rpc/registry/actors/evm.rs (0 hunks)
  • src/rpc/registry/actors/init.rs (0 hunks)
  • src/rpc/registry/actors/miner.rs (0 hunks)
  • src/rpc/registry/actors/mod.rs (1 hunks)
  • src/rpc/registry/actors/multisig.rs (0 hunks)
  • src/rpc/registry/actors/power.rs (0 hunks)
  • src/rpc/registry/actors/reward.rs (0 hunks)
  • src/rpc/registry/actors/verified_reg.rs (1 hunks)
  • src/rpc/registry/methods_reg.rs (3 hunks)
  • src/tool/subcommands/api_cmd/api_compare_tests.rs (7 hunks)
  • src/tool/subcommands/api_cmd/test_snapshots.txt (1 hunks)
💤 Files with no reviewable changes (9)
  • src/rpc/registry/actors/cron.rs
  • src/rpc/registry/actors/datacap.rs
  • src/rpc/registry/actors/evm.rs
  • src/rpc/registry/actors/power.rs
  • src/rpc/registry/actors/multisig.rs
  • src/rpc/registry/actors/init.rs
  • src/rpc/registry/actors/account.rs
  • src/rpc/registry/actors/reward.rs
  • src/rpc/registry/actors/miner.rs
🚧 Files skipped from review as they are similar to previous changes (4)
  • Cargo.toml
  • src/rpc/registry/methods_reg.rs
  • src/lotus_json/actor_states/methods/mod.rs
  • src/tool/subcommands/api_cmd/test_snapshots.txt
🧰 Additional context used
🧬 Code Graph Analysis (5)
src/rpc/registry/actors/verified_reg.rs (3)
src/rpc/registry/actors/init.rs (1)
  • register_actor_methods (41-54)
src/rpc/registry/actors/power.rs (1)
  • register_actor_methods (116-129)
src/rpc/registry/actors/reward.rs (1)
  • register_actor_methods (49-73)
src/lotus_json/signature.rs (5)
src/lotus_json/signature_type.rs (12)
  • snapshots (29-31)
  • snapshots (74-82)
  • snapshots (99-107)
  • snapshots (124-132)
  • into_lotus_json (33-35)
  • into_lotus_json (84-86)
  • into_lotus_json (109-111)
  • into_lotus_json (134-136)
  • from_lotus_json (37-41)
  • from_lotus_json (88-92)
  • from_lotus_json (113-117)
  • from_lotus_json (138-142)
src/lotus_json/mod.rs (17)
  • snapshots (147-147)
  • snapshots (539-541)
  • snapshots (553-555)
  • snapshots (570-572)
  • snapshots (594-596)
  • serde_json (273-273)
  • serde_json (297-297)
  • into_lotus_json (148-148)
  • into_lotus_json (542-544)
  • into_lotus_json (556-558)
  • into_lotus_json (573-579)
  • into_lotus_json (597-604)
  • from_lotus_json (149-149)
  • from_lotus_json (545-547)
  • from_lotus_json (559-564)
  • from_lotus_json (580-586)
  • from_lotus_json (605-612)
src/lotus_json/key_info.rs (3)
  • snapshots (23-34)
  • into_lotus_json (36-42)
  • from_lotus_json (44-50)
src/lotus_json/signed_message.rs (3)
  • snapshots (41-69)
  • into_lotus_json (71-79)
  • from_lotus_json (81-88)
src/lotus_json/vec_u8.rs (2)
  • into_lotus_json (38-43)
  • from_lotus_json (45-50)
src/lotus_json/signature_type.rs (2)
src/lotus_json/signature.rs (12)
  • snapshots (59-67)
  • snapshots (90-98)
  • snapshots (119-127)
  • snapshots (148-156)
  • into_lotus_json (69-75)
  • into_lotus_json (100-105)
  • into_lotus_json (129-134)
  • into_lotus_json (158-163)
  • from_lotus_json (77-83)
  • from_lotus_json (107-112)
  • from_lotus_json (136-141)
  • from_lotus_json (165-170)
src/lotus_json/mod.rs (15)
  • snapshots (147-147)
  • snapshots (539-541)
  • snapshots (553-555)
  • snapshots (570-572)
  • snapshots (594-596)
  • into_lotus_json (148-148)
  • into_lotus_json (542-544)
  • into_lotus_json (556-558)
  • into_lotus_json (573-579)
  • into_lotus_json (597-604)
  • from_lotus_json (149-149)
  • from_lotus_json (545-547)
  • from_lotus_json (559-564)
  • from_lotus_json (580-586)
  • from_lotus_json (605-612)
src/tool/subcommands/api_cmd/api_compare_tests.rs (3)
src/rpc/reflect/mod.rs (1)
  • request (250-260)
src/rpc/client.rs (2)
  • request (272-285)
  • client (114-114)
src/blocks/tipset.rs (7)
  • key (335-338)
  • key (529-532)
  • from (104-109)
  • from (159-161)
  • from (165-167)
  • from (171-176)
  • from (180-185)
src/lotus_json/actor_states/methods/verified_reg_actor.rs (5)
src/shim/address.rs (2)
  • with (72-77)
  • new_id (142-144)
src/lotus_json/signature_type.rs (8)
  • snapshots (29-31)
  • snapshots (74-82)
  • snapshots (99-107)
  • snapshots (124-132)
  • into_lotus_json (33-35)
  • into_lotus_json (84-86)
  • into_lotus_json (109-111)
  • into_lotus_json (134-136)
src/lotus_json/signature.rs (8)
  • snapshots (59-67)
  • snapshots (90-98)
  • snapshots (119-127)
  • snapshots (148-156)
  • into_lotus_json (69-75)
  • into_lotus_json (100-105)
  • into_lotus_json (129-134)
  • into_lotus_json (158-163)
src/rpc/client.rs (1)
  • client (114-114)
src/shim/crypto.rs (4)
  • new (72-74)
  • bytes (186-188)
  • try_from (205-217)
  • try_from (325-332)
⏰ 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). (9)
  • GitHub Check: Build forest binaries on Linux AMD64
  • GitHub Check: tests-release
  • GitHub Check: tests
  • GitHub Check: Build MacOS
  • GitHub Check: Build Ubuntu
  • GitHub Check: cargo-publish-dry-run
  • GitHub Check: All lint checks
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (rust)
🔇 Additional comments (16)
src/rpc/registry/actors/mod.rs (1)

14-14: Module wiring LGTM

Clean addition of the verified_reg actor module alongside existing ones. This keeps registry structure consistent.

src/rpc/registry/actors/verified_reg.rs (1)

215-227: Method coverage across versions looks correct

v10/v11 registering allocation methods without ClaimAllocations (no_claim) and exported variants, plus URH, matches actors’ historical method sets.

src/lotus_json/signature_type.rs (2)

52-69: Versioned SignatureType LotusJson bridges are sound

Good separation for v2/v3/v4 with schemars using u8 and integer-only JSON, matching Lotus expectations for SigType. This aligns with the new versioned Signature wrappers elsewhere.


70-143: Impls and snapshots look correct

Round-trip mappings for Secp256k1 and BLS across versions are covered. No concerns.

src/lotus_json/signature.rs (2)

19-54: Versioned Signature LotusJson structs are correct

Per-version typing of the Type field via corresponding SignatureType bridges is clean and maintains schema fidelity. Good reuse of the existing Vec LotusJson for Data.


86-171: HasLotusJson impls for fvm_shared{2,3,4}::Signature are consistent

The into/from conversions and test snapshots are straightforward and mirror the generic Signature path. No issues spotted.

src/tool/subcommands/api_cmd/api_compare_tests.rs (7)

1815-1850: Good: keep Cron Constructor test gated

Leaving the Cron Constructor test commented until upstream go-state-types support lands is practical and documented. The EVM and System decode-param tests look fine.


1864-1893: Miner decode-param tests LGTM

Constructor and ChangeWorkerAddress cover common paths with realistic params.


1895-1919: Account decode-param tests LGTM

Constructor and AuthenticateMessage (frc42 hash) params provide solid coverage.


1921-1957: Init decode-param tests LGTM

Covers Constructor, Exec, and Exec4 with minimal raw bytes payloads, which is adequate for schema compatibility.


1959-2003: Reward decode-param tests LGTM

AwardBlockReward, UpdateNetworkKPI, and ThisEpochReward cases are well represented. Using Option mirrors Lotus JSONs.


2005-2117: Power decode-param tests LGTM; method spread is sensible

Good balance across constructor, power mutation, cron, and exported views. The two Lotus-blocked cases are correctly left commented with tracking.


2401-2591: Verified Registry decode-param tests: great coverage

Constructor, verifier/client ops, allocations/claims, exported variants, and UniversalReceiverHook are all covered. Mixed signature types in RemoveDataCap params meaningfully exercise the new versioned Signature{Type} LotusJson bridges.

src/lotus_json/actor_states/methods/verified_reg_actor.rs (3)

597-680: Nice partitioning of RemoveDataCap across signature versions.

The versioned LotusJson request/param types cleanly avoid cross-version signature conversions and the associated panics. Snapshots align with per-version field names after the V2 "Signature" fix.

Also applies to: 682-764, 766-848


850-951: ClaimAllocations mappings look correct across v9–v16 (post expiry fix).

The split into v11 flat and v12+ nested shapes is accurate, and the PaddedPieceSize handling in conversions is sound.

Also applies to: 952-1032


501-532: UniversalReceiverParams wiring LGTM (post key rename).

Using fvm_actor_utils for UniversalReceiverParams with RawBytes via lotus_json is appropriate. After renaming "Type", the snapshots should pass.

@akaladarshi akaladarshi enabled auto-merge August 18, 2025 14:11
@LesnyRumcajs
Copy link
Member

no green checkmark, no review!


# optional dependencies
console-subscriber = { version = "0.4", features = ["parking_lot"], optional = true }
fvm_actor_utils = "14.0.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please summarise why it is needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is one method UniversalReceiverHook that uses fvm_actor_utils::receiver::UniversalReceiverParams type as param

Method::UniversalReceiverHook,

so we have to implement the HasLotusJson trait for it :

impl HasLotusJson for fvm_actor_utils::receiver::UniversalReceiverParams {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably should be a re-export in fil-actor-states, then. Not a blocker, obviously.

Copy link
Member

@LesnyRumcajs LesnyRumcajs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +181 to +196
filecoin_verified_reg_statedecodeparams_1754401651142334.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754492006350827.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754401651146246.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754401651146327.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754401651146402.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754401651146485.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754401651146560.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754401651146644.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754401651146719.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754401651146788.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754401651146860.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754401651146948.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754401651147022.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754401651147091.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754401651147157.rpcsnap.json.zst
filecoin_verified_reg_statedecodeparams_1754401651147231.rpcsnap.json.zst
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a blocker, but for future it might make sense to add method names here. This, or we should prioritize #5894 for structured input.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have mostly prioritized the #5894, hence update the PR description

Ok(tests)
}

fn multisig_actor_state_decode_params_tests(tipset: &Tipset) -> anyhow::Result<Vec<RpcTest>> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'd be nice to refactor those to separate files - this file is getting quite large. Not a blocker here, can be a part of future refactor.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this in the checklist of the cleanup issue: #5937

@elmattic
Copy link
Contributor

LGTM too!

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: 0

♻️ Duplicate comments (1)
src/tool/subcommands/api_cmd/api_compare_tests.rs (1)

2278-2278: Acknowledging file size: refactor to separate files is tracked

Prior feedback about splitting into separate files is already tracked in #5937. Not blocking here.

🧹 Nitpick comments (6)
src/tool/subcommands/api_cmd/api_compare_tests.rs (6)

1816-1819: Prefer enum method constants over raw numbers for EVM constructor

Use the typed method enum to reduce drift and improve readability.

Apply this diff:

-            1,
+            fil_actor_evm_state::v16::Method::Constructor as u64,

1871-1883: Use miner Method enum instead of raw method numbers (1, 3)

This avoids silent breakage if method numbers change between versions and improves clarity.

Apply this diff:

         RpcTest::identity(StateDecodeParams::request((
             MINER_ADDRESS,
-            1,
+            fil_actor_miner_state::v16::Method::Constructor as u64,
             to_vec(&miner_constructor_params)?,
             tipset.key().into(),
         ))?),
         RpcTest::identity(StateDecodeParams::request((
             MINER_ADDRESS,
-            3,
+            fil_actor_miner_state::v16::Method::ChangeWorkerAddress as u64,
             to_vec(&miner_change_worker_params)?,
             tipset.key().into(),
         ))?),

1904-1906: Compute FRC-42 method number at build-time instead of hardcoding

Use the macro to avoid drift and improve readability.

Apply this diff:

-            2643134072, // frc42_dispatch::method_hash!("AuthenticateMessage"),
+            frc42_dispatch::method_hash!("AuthenticateMessage"),

1918-1926: Consider using a minimal valid CID instead of Cid::default()

While decode-only paths often tolerate placeholder CIDs, using an explicit minimal valid CID reduces the chance of cross-implementation quirks during Lotus JSON bridging.

Apply this diff:

-        code_cid: Cid::default(),
+        code_cid: Cid::from_str("bafkqaaa").unwrap(), // minimal valid identity CID
@@
-        code_cid: Cid::default(),
+        code_cid: Cid::from_str("bafkqaaa").unwrap(), // minimal valid identity CID

Also applies to: 1924-1926


2278-2390: Duplicate multisig LockBalance test

The LockBalance decode test is included twice, which adds noise (it’ll be deduped later anyway). Remove one.

Apply this diff to drop the duplicate block:

-        RpcTest::identity(StateDecodeParams::request((
-            Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/,
-            fil_actor_multisig_state::v16::Method::LockBalance as u64,
-            to_vec(&multisig_lock_bal_params)?,
-            tipset.key().into(),
-        ))?),

1931-1946: Use typed Init method enums instead of raw 1/2/3

This mirrors the approach used elsewhere and reduces ambiguity.

Apply this diff:

-            1,
+            fil_actor_init_state::v16::Method::Constructor as u64,
@@
-            2,
+            fil_actor_init_state::v16::Method::Exec as u64,
@@
-            3,
+            fil_actor_init_state::v16::Method::Exec4 as u64,
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 41a3e90 and be91d34.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • src/tool/subcommands/api_cmd/api_compare_tests.rs (7 hunks)
⏰ 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). (9)
  • GitHub Check: Build forest binaries on Linux AMD64
  • GitHub Check: tests
  • GitHub Check: tests-release
  • GitHub Check: All lint checks
  • GitHub Check: Build Ubuntu
  • GitHub Check: Build MacOS
  • GitHub Check: cargo-publish-dry-run
  • GitHub Check: Analyze (rust)
  • GitHub Check: Analyze (go)
🔇 Additional comments (12)
src/tool/subcommands/api_cmd/api_compare_tests.rs (12)

1806-1814: Good call keeping Cron constructor decode test gated until go-state-types supports it

The TODO with a link is clear. Once upstream lands support, we can just uncomment and wire it in.


1814-1841: Base StateDecodeParams tests look solid (EVM constructor, System constructor, Cron EpochTick)

Nice coverage and consistent use of v16 Method enums where available (except the EVM constructor; see suggestion below).


1843-1853: Great modularization: delegating per-actor decode tests keeps the top-level readable

This makes future extensions much easier.


1855-1863: Miner params setup is correct and realistic

Constructor and ChangeWorker params are well-formed for v16.


1886-1895: Account params look good

Using v16 types for constructor and AuthenticateMessage is correct.


1969-1993: Reward decode tests cover the main surfaces and use enums consistently

Constructor, AwardBlockReward, UpdateNetworkKPI, and ThisEpochReward look correct for v16.


1996-2050: Power actor params setup is correct; nice coverage including exported variants

Good use of RegisteredPoStProof, UpdateClaimedPower, EnrollCronEvent, UpdatePledgeTotal, and raw power queries.


2064-2071: Keeping unsupported Lotus methods commented with upstream issue link is appropriate

Once go-state-types issue 401 is resolved, we can enable the test.


2072-2107: Zero-parameter decode tests for Power actor are comprehensive

Constructor, tick end, and read-only exported methods are all covered.


2392-2483: VerifReg params look well-formed across constructors and admin ops

Constructor, AddVerifier, RemoveVerifier, AddVerifiedClient, and RemoveDataCap are set up with plausible placeholder data and correct v16 types.


2485-2581: Excellent VerifReg coverage, including exported FRC-42 variants and URH

You’ve covered the main methods plus exported aliases. If scope permits, verify whether any additional exported VerifReg methods (e.g., for AddVerifier/RemoveVerifier) exist in v8–v16 and add corresponding decode tests for completeness.

Would you like me to open a checklist of VerifReg v8–v16 methods vs tests present here to ensure we meet #5720’s completion criteria?


2478-2483: No changes required: fvm_actor_utils is already enabled

The root Cargo.toml declares

fvm_actor_utils = "14.0.0"

as a normal (non-optional) dependency, so UniversalReceiverParams is available without any feature flag or fallback.

Likely an incorrect or invalid review comment.

@akaladarshi akaladarshi added this pull request to the merge queue Aug 19, 2025
Merged via the queue into main with commit f70961e Aug 19, 2025
44 checks passed
@akaladarshi akaladarshi deleted the akaladarshi/add-verifiedreg-actor-decode-params branch August 19, 2025 14:55
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.

Add support for the VerifReg actor state in Filecoin.StateDecodeParams API

5 participants