Skip to content

feat(api): register missing miner actor v18 methods#6950

Merged
akaladarshi merged 3 commits intomainfrom
akaladarshi/add-missing-v18-methods
Apr 21, 2026
Merged

feat(api): register missing miner actor v18 methods#6950
akaladarshi merged 3 commits intomainfrom
akaladarshi/add-missing-v18-methods

Conversation

@akaladarshi
Copy link
Copy Markdown
Collaborator

@akaladarshi akaladarshi commented Apr 21, 2026

Summary of changes

Changes introduced in this pull request:

  • Includes the :
    • GenerateSectorLocationExported
    • ValidateSectorStatusExported
    • GetNominalSectorExpirationExported

Reference issue to close (if applicable)

Closes #6920

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

    • Added support for miner v18 sector management functionality, including sector location generation, sector status validation, and nominal sector expiration retrieval.
  • Chores

    • Updated Filecoin FVM actor dependencies to version 26.1.0.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

Walkthrough

This PR updates Filecoin actor crate dependencies from version 26.0.0 to 26.1.0 and adds Lotus-JSON serialization support for new miner v18 sector management methods (GenerateSectorLocation, ValidateSectorStatus), registering these methods in the miner actor RPC registry for v18 and onwards.

Changes

Cohort / File(s) Summary
Dependency Updates
Cargo.toml
Bumped all fil_actor_*_state and fil_actors_shared crate versions from 26.0.0 to 26.1.0.
Miner v18 Lotus-JSON Types
src/lotus_json/actors/params/miner_params.rs
Added GenerateSectorLocationParamsLotusJson, SectorStatusCodeLotusJson (u8-backed enum with Dead/Active/Faulty variants), and ValidateSectorStatusParamsLotusJson types. Implemented three macros that generate HasLotusJson trait implementations, snapshot tests, and JSON conversion methods for v18 miner parameters.
Miner RPC Method Registration
src/rpc/registry/actors/miner.rs
Added register_miner_common_method_v18_onwards! macro to register GenerateSectorLocationExported, ValidateSectorStatusExported, and GetNominalSectorExpirationExported methods for v18. Wired the macro into ActorVersion::V18 registration. Updated imports to include SectorNumber.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • hanabi1224
  • LesnyRumcajs
  • sudo-shashank
🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(api): register missing miner actor v18 methods' accurately reflects the main change - registering three missing v18 miner actor methods and their Lotus-JSON support types.
Linked Issues check ✅ Passed The PR addresses the core objective from issue #6920 by registering missing v18 miner actor methods and updating fil_actors_* dependencies to v26.1.0, fulfilling the requirement to apply diffs between releases.
Out of Scope Changes check ✅ Passed All changes are directly related to issue #6920 objectives: registering miner v18 methods, adding Lotus-JSON support types, and updating actor-state crate dependencies as part of the fil-actor-states version synchronization.

✏️ 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 akaladarshi/add-missing-v18-methods
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch akaladarshi/add-missing-v18-methods

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

@akaladarshi akaladarshi added the RPC requires calibnet RPC checks to run on CI label Apr 21, 2026
@akaladarshi akaladarshi marked this pull request as ready for review April 21, 2026 16:34
@akaladarshi akaladarshi requested a review from a team as a code owner April 21, 2026 16:34
@akaladarshi akaladarshi requested review from LesnyRumcajs and hanabi1224 and removed request for a team April 21, 2026 16:34
@akaladarshi akaladarshi enabled auto-merge April 21, 2026 16:36
Copy link
Copy Markdown
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.

🧹 Nitpick comments (2)
src/rpc/registry/actors/miner.rs (1)

415-420: Consider a small regression test for v18 method registry completeness.

This change fixes a real gap; a focused assertion that v18 includes these exported miner methods would guard against future misses.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/rpc/registry/actors/miner.rs` around lines 415 - 420, Add a small
regression test that calls register_miner_version_18(registry, cid) and then
asserts the MethodRegistry contains the exported miner methods expected for
fil_actor_miner_state::v18; specifically build a test that creates a fresh
MethodRegistry, invokes register_miner_version_18, and checks presence (by
method name or method ID) of the key exported methods registered by
register_miner_common_methods_v10_onwards!,
register_miner_common_method_v14_onwards!,
register_miner_common_method_v16_onwards!, and
register_miner_common_method_v18_onwards! to detect future omissions; place the
test alongside other miner registry tests and use the same helper utilities used
by existing tests to construct the CID and lookup entries in MethodRegistry.
src/lotus_json/actors/params/miner_params.rs (1)

4130-4180: Optional: rename macro for clearer intent.

impl_lotus_json_for_validate_sector_status_change_params reads slightly off from the actual type (ValidateSectorStatusParams); a small rename would improve maintainability.

♻️ Proposed rename
-macro_rules! impl_lotus_json_for_validate_sector_status_change_params {
+macro_rules! impl_lotus_json_for_validate_sector_status_params {
@@
-impl_lotus_json_for_validate_sector_status_change_params!(18);
+impl_lotus_json_for_validate_sector_status_params!(18);

Also applies to: 4243-4243

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lotus_json/actors/params/miner_params.rs` around lines 4130 - 4180,
Rename the macro impl_lotus_json_for_validate_sector_status_change_params to
more accurately reflect the target type, e.g.
impl_lotus_json_for_validate_sector_status_params; update the macro definition
and all call sites to the new name, ensuring the inner generated module, the
referenced type fil_actor_miner_state::v{n}::ValidateSectorStatusParams, and the
HasLotusJson impl remain unchanged (look for occurrences of
impl_lotus_json_for_validate_sector_status_change_params and rename them
consistently, including the other occurrence noted in the diff).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/lotus_json/actors/params/miner_params.rs`:
- Around line 4130-4180: Rename the macro
impl_lotus_json_for_validate_sector_status_change_params to more accurately
reflect the target type, e.g. impl_lotus_json_for_validate_sector_status_params;
update the macro definition and all call sites to the new name, ensuring the
inner generated module, the referenced type
fil_actor_miner_state::v{n}::ValidateSectorStatusParams, and the HasLotusJson
impl remain unchanged (look for occurrences of
impl_lotus_json_for_validate_sector_status_change_params and rename them
consistently, including the other occurrence noted in the diff).

In `@src/rpc/registry/actors/miner.rs`:
- Around line 415-420: Add a small regression test that calls
register_miner_version_18(registry, cid) and then asserts the MethodRegistry
contains the exported miner methods expected for fil_actor_miner_state::v18;
specifically build a test that creates a fresh MethodRegistry, invokes
register_miner_version_18, and checks presence (by method name or method ID) of
the key exported methods registered by
register_miner_common_methods_v10_onwards!,
register_miner_common_method_v14_onwards!,
register_miner_common_method_v16_onwards!, and
register_miner_common_method_v18_onwards! to detect future omissions; place the
test alongside other miner registry tests and use the same helper utilities used
by existing tests to construct the CID and lookup entries in MethodRegistry.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: efaa9561-24c2-4e93-a12a-1bb1fda48771

📥 Commits

Reviewing files that changed from the base of the PR and between 799007a and 5a2b0cc.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • Cargo.toml
  • src/lotus_json/actors/params/miner_params.rs
  • src/rpc/registry/actors/miner.rs

@akaladarshi akaladarshi added this pull request to the merge queue Apr 21, 2026
Merged via the queue into main with commit 2cc54ee Apr 21, 2026
39 of 43 checks passed
@akaladarshi akaladarshi deleted the akaladarshi/add-missing-v18-methods branch April 21, 2026 18:15
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.

[NV28] fil-actor-states update and release

2 participants