Skip to content

feat: add DESCRIPTION to all missing RPC methods#7070

Open
Patrick-Ehimen wants to merge 1 commit into
ChainSafe:mainfrom
Patrick-Ehimen:fix/rpc-missing-descriptions
Open

feat: add DESCRIPTION to all missing RPC methods#7070
Patrick-Ehimen wants to merge 1 commit into
ChainSafe:mainfrom
Patrick-Ehimen:fix/rpc-missing-descriptions

Conversation

@Patrick-Ehimen
Copy link
Copy Markdown

@Patrick-Ehimen Patrick-Ehimen commented May 16, 2026

Summary

  • Adds const DESCRIPTION to all 96 RpcMethod implementations that were missing it
  • Brings coverage from 133/229 (58%) to 229/229 (100%)
  • Descriptions follow the existing style: present-tense, action-oriented, single sentence
  • Descriptions flow directly into the OpenRPC spec via Self::DESCRIPTION in reflect/mod.rs

Closes #6460

Test plan

  • cargo check passes (pre-existing local env issue with spaces in path is unrelated)
  • OpenRPC spec: Self::DESCRIPTION maps to the description field in the OpenRPC method descriptor (src/rpc/reflect/mod.rs:242) — same wiring used by the 133 already-described methods

Summary by CodeRabbit

  • Documentation
    • Enhanced RPC API documentation by adding comprehensive descriptions to numerous RPC methods across authentication, beacon, chain, network, state, sync, wallet, and Ethereum-compatible endpoints. All RPC methods now include human-readable explanations of their functionality, improving API discoverability and usability for developers.

Review Change Stack

@Patrick-Ehimen Patrick-Ehimen requested a review from a team as a code owner May 16, 2026 13:44
@Patrick-Ehimen Patrick-Ehimen requested review from hanabi1224 and sudo-shashank and removed request for a team May 16, 2026 13:44
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 16, 2026

Walkthrough

This PR adds DESCRIPTION metadata constants to RPC method implementations across 13 files, systematically documenting the purpose and behavior of each RPC endpoint without modifying any logic or request/response handling.

Changes

RPC Method Documentation

Layer / File(s) Summary
Core node and auth methods
src/rpc/methods/auth.rs, src/rpc/methods/beacon.rs, src/rpc/methods/common.rs, src/rpc/methods/node.rs, src/rpc/methods/sync.rs
Authentication token creation/verification, beacon entry lookup, session/version/shutdown/startup queries, and bad block cache management are now documented.
Chain and state query methods
src/rpc/methods/chain.rs, src/rpc/methods/state.rs
Chain operations (tipset queries, message retrieval, export/snapshot management) and state lookups (network names, receipts, sector info, pledge calculations) are documented.
Network and connectivity methods
src/rpc/methods/net.rs
Peer discovery, listening status, node info, NAT status, and version reporting are documented.
Market and multisig contract methods
src/rpc/methods/market.rs, src/rpc/methods/msig.rs
Market escrow balance management and multisig operations (vesting, pending transactions) are documented.
Wallet operations
src/rpc/methods/wallet.rs
Wallet address management, key export/import, signature verification, and address validation are documented.
Ethereum JSON-RPC compatibility methods
src/rpc/methods/eth.rs
31 Ethereum-compatible endpoints including Web3 client info, account queries, block/transaction operations, gas estimation, filters, logs, subscriptions, and raw transaction submission are documented.
F3 finality consensus methods
src/rpc/methods/f3.rs
20 F3 protocol methods for tipset/network queries, power tables, consensus participation, certificates, and participant management are documented.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

RPC

Suggested reviewers

  • akaladarshi
  • LesnyRumcajs
  • hanabi1224
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding DESCRIPTION constants to all missing RPC methods across the codebase.
Linked Issues check ✅ Passed The PR fully satisfies all coding requirements from issue #6460: DESCRIPTION constants added to all 96 missing RPC methods, bringing coverage to 100%, following established style, and descriptions integrated with OpenRPC generation.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue objective of adding DESCRIPTION constants to RPC methods; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

📋 Issue Planner

Built with CodeRabbit's Coding Plans for faster development and fewer bugs.

View plan used: #6460

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/rpc/methods/eth.rs`:
- Around line 2743-2745: The RpcMethod descriptions for EthUnsubscribe and
EthSubscribe are misleading because their PARAM_NAMES arrays are empty; either
change the DESCRIPTION constants to match the no-parameter metadata (e.g., for
EthUnsubscribe use a neutral phrase like "Cancels a subscription." and for
EthSubscribe use "Creates a subscription.") or add the actual parameter names to
the PARAM_NAMES arrays and update the method implementations to accept those
params. Locate the DESCRIPTION and PARAM_NAMES constants for EthUnsubscribe and
EthSubscribe and make the descriptions and parameter metadata consistent (update
DESCRIPTION text if you want zero-param docs, or populate PARAM_NAMES and
signatures if these methods should accept params).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e53e6856-9b9f-41a0-bbb7-320eea2d8da2

📥 Commits

Reviewing files that changed from the base of the PR and between 388dc34 and 03950b4.

📒 Files selected for processing (13)
  • src/rpc/methods/auth.rs
  • src/rpc/methods/beacon.rs
  • src/rpc/methods/chain.rs
  • src/rpc/methods/common.rs
  • src/rpc/methods/eth.rs
  • src/rpc/methods/f3.rs
  • src/rpc/methods/market.rs
  • src/rpc/methods/msig.rs
  • src/rpc/methods/net.rs
  • src/rpc/methods/node.rs
  • src/rpc/methods/state.rs
  • src/rpc/methods/sync.rs
  • src/rpc/methods/wallet.rs

Comment thread src/rpc/methods/eth.rs
Comment on lines +2743 to 2745
const DESCRIPTION: Option<&'static str> =
Some("Cancels the subscription with the given ID.");
const PARAM_NAMES: [&'static str; 0] = [];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Description text is inconsistent with the exposed subscription method metadata.

On Line 2744, EthUnsubscribe says it cancels a subscription “with the given ID”, but this RpcMethod exposes zero params.
On Line 2772, EthSubscribe says “specified events”, but it also exposes zero params.

Because these descriptions are now surfaced in OpenRPC, this creates misleading API docs. Please align wording with the placeholder/no-param metadata (or expose actual params if these methods should document them here).

Suggested wording-only fix
-    const DESCRIPTION: Option<&'static str> =
-        Some("Cancels the subscription with the given ID.");
+    const DESCRIPTION: Option<&'static str> =
+        Some("Cancels an active subscription.");

-    const DESCRIPTION: Option<&'static str> =
-        Some("Creates a subscription to specified events.");
+    const DESCRIPTION: Option<&'static str> =
+        Some("Creates an event subscription.");

Also applies to: 2771-2773

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/rpc/methods/eth.rs` around lines 2743 - 2745, The RpcMethod descriptions
for EthUnsubscribe and EthSubscribe are misleading because their PARAM_NAMES
arrays are empty; either change the DESCRIPTION constants to match the
no-parameter metadata (e.g., for EthUnsubscribe use a neutral phrase like
"Cancels a subscription." and for EthSubscribe use "Creates a subscription.") or
add the actual parameter names to the PARAM_NAMES arrays and update the method
implementations to accept those params. Locate the DESCRIPTION and PARAM_NAMES
constants for EthUnsubscribe and EthSubscribe and make the descriptions and
parameter metadata consistent (update DESCRIPTION text if you want zero-param
docs, or populate PARAM_NAMES and signatures if these methods should accept
params).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add DESCRIPTION to all RPC methods

2 participants