Skip to content

Add DESCRIPTION to all RPC methods #6460

Closed
Patrick-Ehimen/forest
#1

Description

@coderabbitai

Background

Many RPC method implementations in Forest are missing the DESCRIPTION constant, which should provide documentation about what each method does.

Task

Add the DESCRIPTION field to all RPC method implementations throughout the codebase. This will improve API documentation and help users understand what each method does.

Example

impl RpcMethod<2> for EthTraceReplayBlockTransactions {
    const NAME: &'static str = "Filecoin.EthTraceReplayBlockTransactions";
    const NAME_ALIAS: Option<&'static str> = Some("trace_replayBlockTransactions");
    const DESCRIPTION: Option<&'static str> = Some(
        "Replays all transactions in a block returning the requested traces for each transaction.",
    );
    // ...
}

Context

Related PR: #6444
Related comment: #6444 (comment)

cc: @akaladarshi

Missing

File Missing Area
f3.rs 20 F3 sidecar (Fast Finality)
chain.rs 12 chain queries + Forest snapshot/export family
wallet.rs 8 key management
state.rs 6 state tree queries
net.rs 5 networking
msig.rs 4 multisig
common.rs 4 node/system
auth.rs 2 auth tokens
sync.rs 2 bad-block tracking
node.rs 1 NodeStatus
market.rs 1 MarketAddBalance
beacon.rs 1 BeaconGetEntry

Activity

  1. hanabi1224 commented on Jan 22, 2026

    @hanabi1224
    Contributor

    @coderabbitai could you make a PR for this?

  2. coderabbitai commented on Jan 22, 2026

    @coderabbitai
    ContributorAuthor

    Coding Plan

    Approach

    Add the DESCRIPTION constant to all 110 RPC method implementations that are currently missing it across 13 files in src/rpc/methods/. This is a documentation-only change that will improve API documentation by providing human-readable descriptions of what each method does.

    Observations

    The Forest codebase implements 229 RPC methods across files in src/rpc/methods/. Each method is defined as an enum that implements the RpcMethod<ARITY> trait (defined in src/rpc/reflect/mod.rs). The trait includes an optional DESCRIPTION constant that defaults to None but can be overridden to provide documentation. Currently, 119 methods (52%) have descriptions while 110 methods (48%) are missing them. The DESCRIPTION value flows directly into the OpenRPC specification generation for API documentation.

    Assumptions
    Assumption 1: Description Writing Style

    Options Considered:

    1. Create formal style guidelines first, then add descriptions
    2. Follow existing patterns observed in the codebase without creating formal guidelines

    Chosen Option: 2

    Rationale: Follow existing patterns—descriptions should be action-oriented, start with present tense verbs (Returns, Retrieves, Checks, etc.), and be concise single sentences. This aligns with 119 existing descriptions and avoids scope creep.

    Assumption 2: Description Content Sources

    Options Considered:

    1. Use only method names and implementation code
    2. Reference Lotus documentation and existing Forest descriptions
    3. Reference FRC-0104 Common Node API specification

    Chosen Option: 2

    Rationale: Use Lotus documentation as primary reference for standard Filecoin methods, derive Forest-specific method descriptions from implementation code, and use existing well-documented methods as templates. FRC-0104 is referenced indirectly through Lotus docs.

    💡 User Tips

    Regenerate the plan with different choices with @coderabbitai <feedback>.

    Implementation Steps

    Phase 1: Small Modules - Foundation Documentation

    Add DESCRIPTION to all methods in modules with 1-4 missing descriptions. These quick wins establish the pattern and complete several modules entirely.

    Task Numbering Convention: Tasks use flat sequential numbering (Task 1, Task 2, etc.) for unambiguous reference. Phases group related tasks but each task can be referenced and implemented independently.

    Task 1: Document Authentication and System Methods

    Add descriptions to auth, common, beacon, market, and node modules which are currently 0% documented.

    • Update src/rpc/methods/auth.rs to add DESCRIPTION for 2 methods: AuthNew ("Creates a new authentication token with the specified permissions"), AuthVerify ("Verifies an authentication token and returns its permissions")
    • Update src/rpc/methods/common.rs to add DESCRIPTION for 4 methods: Session, Version, Shutdown, StartTime
    • Update src/rpc/methods/beacon.rs to add DESCRIPTION for 1 method: BeaconGetEntry
    • Update src/rpc/methods/market.rs to add DESCRIPTION for 1 method: MarketAddBalance
    • Update src/rpc/methods/node.rs to add DESCRIPTION for 1 method: NodeStatus
    Task 2: Document Multisig Methods

    Add descriptions to the msig module which is currently 0% documented.

    • Update src/rpc/methods/msig.rs to add DESCRIPTION for 4 methods: MsigGetAvailableBalance, MsigGetPending, MsigGetVested, MsigGetVestingSchedule
    • Reference Lotus multisig documentation for accurate descriptions of vesting and balance semantics
    🤖 Prompt for AI agents
    This phase adds DESCRIPTION constants to small modules (auth, common, beacon,
    market, node, msig) to complete foundation documentation. The goal is to
    establish consistent patterns and achieve 100% documentation coverage for these
    modules.
    
    For each RPC method enum in the following files, add a DESCRIPTION constant:
    - src/rpc/methods/auth.rs: Add descriptions for AuthNew and AuthVerify methods
    - src/rpc/methods/common.rs: Add descriptions for Session, Version, Shutdown,
    and StartTime methods
    - src/rpc/methods/beacon.rs: Add description for BeaconGetEntry method
    - src/rpc/methods/market.rs: Add description for MarketAddBalance method
    - src/rpc/methods/node.rs: Add description for NodeStatus method
    - src/rpc/methods/msig.rs: Add descriptions for MsigGetAvailableBalance,
    MsigGetPending, MsigGetVested, and MsigGetVestingSchedule methods
    
    Format: const DESCRIPTION: Option<&'static str> = Some("description text");
    Style: Use present tense action verbs (Returns, Retrieves, Creates, Verifies,
    etc.), keep concise and single-sentence
    Reference existing documented methods in the codebase for style consistency
    

    Phase 2: Medium Modules - Core API Documentation

    Add DESCRIPTION to modules with 5-12 missing descriptions covering sync, network, wallet, state, and chain operations.

    Task 1: Document Sync and Network Methods

    Complete documentation for sync and net modules.

    • Update src/rpc/methods/sync.rs to add DESCRIPTION for 2 methods: SyncCheckBad, SyncMarkBad
    • Update src/rpc/methods/net.rs to add DESCRIPTION for 5 methods: NetFindPeer, NetListening, NetInfo, NetAutoNatStatus, NetVersion
    • Use existing NetPeers, NetConnect descriptions as style reference
    Task 2: Document Wallet Methods

    Add descriptions to the remaining undocumented wallet methods.

    • Update src/rpc/methods/wallet.rs to add DESCRIPTION for 8 methods: WalletDefaultAddress, WalletExport, WalletImport, WalletNew, WalletSetDefault, WalletValidateAddress, WalletVerify, WalletDelete
    • Reference existing WalletBalance and WalletSign descriptions for consistent style
    Task 3: Document State Query Methods

    Add descriptions to the remaining undocumented state methods.

    • Update src/rpc/methods/state.rs to add DESCRIPTION for 7 methods: StateNetworkName, StateGetReceipt, StateWaitMsgV0, StateFetchRoot, ForestStateCompute, StateSectorPreCommitInfoV0, StateMinerInitialPledgeForSector
    • This module is already 90% documented; follow existing patterns closely
    Task 4: Document Chain Methods

    Add descriptions to the remaining undocumented chain methods including Forest-specific exports.

    • Update src/rpc/methods/chain.rs to add DESCRIPTION for 12 methods including: ChainGetMessagesInTipset, ChainPruneSnapshot, ChainExport, ChainStatObj, ChainGetGenesis, ChainSetHead, ChainGetMinBaseFee, ChainGetTipsetByParentState
    • Add descriptions for Forest-specific methods: ForestChainExport, ForestChainExportStatus, ForestChainExportCancel, ForestChainExportDiff
    • Forest-specific methods should note they are Forest extensions not in standard Lotus API
    🤖 Prompt for AI agents
    This phase adds DESCRIPTION constants to medium-sized modules (sync, net,
    wallet, state, chain) covering core API functionality. The goal is to document
    essential sync, network, wallet, state query, and chain operations.
    
    For each RPC method enum in the following files, add a DESCRIPTION constant:
    - src/rpc/methods/sync.rs: Add descriptions for SyncCheckBad and SyncMarkBad
    methods
    - src/rpc/methods/net.rs: Add descriptions for NetFindPeer, NetListening,
    NetInfo, NetAutoNatStatus, and NetVersion methods
    - src/rpc/methods/wallet.rs: Add descriptions for WalletDefaultAddress,
    WalletExport, WalletImport, WalletNew, WalletSetDefault, WalletValidateAddress,
    WalletVerify, and WalletDelete methods
    - src/rpc/methods/state.rs: Add descriptions for StateNetworkName,
    StateGetReceipt, StateWaitMsgV0, StateFetchRoot, ForestStateCompute,
    StateSectorPreCommitInfoV0, and StateMinerInitialPledgeForSector methods
    - src/rpc/methods/chain.rs: Add descriptions for ChainGetMessagesInTipset,
    ChainPruneSnapshot, ChainExport, ChainStatObj, ChainGetGenesis, ChainSetHead,
    ChainGetMinBaseFee, ChainGetTipsetByParentState, and Forest-specific methods
    (ForestChainExport, ForestChainExportStatus, ForestChainExportCancel,
    ForestChainExportDiff)
    
    Format: const DESCRIPTION: Option<&'static str> = Some("description text");
    Style: Follow existing descriptions in these modules, use present tense action
    verbs
    Note: Forest-specific methods should indicate they are Forest extensions
    

    Phase 3: Large Modules - Ethereum and F3 Documentation

    Add DESCRIPTION to the two largest undocumented modules covering Ethereum compatibility and F3 consensus.

    Task 1: Document F3 Consensus Methods

    Add descriptions to F3 methods which are critical for understanding Fast Finality consensus.

    • Update src/rpc/methods/f3.rs to add DESCRIPTION for 20 methods including: GetRawNetworkName, GetTipsetByEpoch, GetTipset, GetHead, GetParent, GetPowerTable, ProtectPeer, GetParticipatingMinerIDs, Finalize, SignMessage
    • Add descriptions for F3-prefixed methods: F3GetCertificate, F3GetLatestCertificate, F3GetECPowerTable, F3IsRunning, F3GetProgress, F3GetManifest, F3ListParticipants, F3GetOrRenewParticipationTicket, F3Participate
    • F3 methods may require referencing implementation code as primary source since these are newer APIs
    Task 2: Document Ethereum RPC Compatibility Methods - Core

    Add descriptions to core Ethereum compatibility methods for basic operations.

    • Update src/rpc/methods/eth.rs to add DESCRIPTION for basic Eth methods: Web3ClientVersion, EthAccounts, EthBlockNumber, EthChainId, EthSyncing, EthProtocolVersion
    • Add descriptions for block-related methods: EthGetBlockByHash, EthGetBlockByNumber, EthGetBlockByNumberV2, EthGetBlockReceipts, EthGetBlockReceiptsLimited, EthGetBlockTransactionCount variants
    • Reference standard Ethereum JSON-RPC documentation for accurate descriptions
    Task 3: Document Ethereum RPC Compatibility Methods - Transactions

    Add descriptions to Ethereum transaction-related methods.

    • Update src/rpc/methods/eth.rs to add DESCRIPTION for transaction methods: EthGetTransactionByHash, EthGetTransactionByHashLimited, EthGetTransactionByBlockHashAndIndex, EthGetTransactionByBlockNumberAndIndex
    • Add descriptions for: EthGetTransactionCount, EthGetTransactionCountV2, EthGetTransactionReceipt, EthGetTransactionReceiptLimited, EthSendRawTransaction
    • Add descriptions for: EthGetMessageCidByTransactionHash
    Task 4: Document Ethereum RPC Compatibility Methods - State and Execution

    Add descriptions to Ethereum state query and execution methods.

    • Update src/rpc/methods/eth.rs to add DESCRIPTION for: EthCall, EthCallV2, EthEstimateGas, EthEstimateGasV2, EthGetCode, EthGetStorageAt
    • Add descriptions for fee methods: EthFeeHistory, EthFeeHistoryV2, EthMaxPriorityFeePerGas
    • Add descriptions for: EthGetLogs, EthGetFilterLogs, EthGetFilterChanges
    Task 5: Document Ethereum RPC Compatibility Methods - Filters and Subscriptions

    Add descriptions to Ethereum filter and subscription methods.

    • Update src/rpc/methods/eth.rs to add DESCRIPTION for filter methods: EthNewFilter, EthNewPendingTransactionFilter, EthNewBlockFilter, EthUninstallFilter
    • Add descriptions for subscription methods: EthSubscribe, EthUnsubscribe
    • Add descriptions for trace methods: EthTraceBlock, EthTraceReplayBlockTransactions, EthTraceFilter, EthTraceTransaction
    🤖 Prompt for AI agents
    This phase adds DESCRIPTION constants to the largest modules (f3.rs and eth.rs)
    covering F3 consensus and Ethereum compatibility. The goal is to document all
    remaining methods for Fast Finality consensus and Ethereum JSON-RPC
    compatibility layer.
    
    For each RPC method enum in the following files, add a DESCRIPTION constant:
    - src/rpc/methods/f3.rs: Add descriptions for 20 methods including
    GetRawNetworkName, GetTipsetByEpoch, GetTipset, GetHead, GetParent,
    GetPowerTable, ProtectPeer, GetParticipatingMinerIDs, Finalize, SignMessage, and
    F3-prefixed methods (F3GetCertificate, F3GetLatestCertificate,
    F3GetECPowerTable, F3IsRunning, F3GetProgress, F3GetManifest,
    F3ListParticipants, F3GetOrRenewParticipationTicket, F3Participate)
    - src/rpc/methods/eth.rs: Add descriptions for all Ethereum compatibility
    methods organized by category:
    - Core methods: Web3ClientVersion, EthAccounts, EthBlockNumber, EthChainId,
    EthSyncing, EthProtocolVersion
    - Block methods: EthGetBlockByHash, EthGetBlockByNumber, EthGetBlockByNumberV2,
    EthGetBlockReceipts, EthGetBlockReceiptsLimited, EthGetBlockTransactionCount
    variants
    - Transaction methods: EthGetTransactionByHash, EthGetTransactionByHashLimited,
    EthGetTransactionByBlockHashAndIndex, EthGetTransactionByBlockNumberAndIndex,
    EthGetTransactionCount, EthGetTransactionCountV2, EthGetTransactionReceipt,
    EthGetTransactionReceiptLimited, EthSendRawTransaction,
    EthGetMessageCidByTransactionHash
    - State/execution methods: EthCall, EthCallV2, EthEstimateGas, EthEstimateGasV2,
    EthGetCode, EthGetStorageAt, EthFeeHistory, EthFeeHistoryV2,
    EthMaxPriorityFeePerGas, EthGetLogs, EthGetFilterLogs, EthGetFilterChanges
    - Filter/subscription methods: EthNewFilter, EthNewPendingTransactionFilter,
    EthNewBlockFilter, EthUninstallFilter, EthSubscribe, EthUnsubscribe,
    EthTraceBlock, EthTraceReplayBlockTransactions, EthTraceFilter,
    EthTraceTransaction
    
    Format: const DESCRIPTION: Option<&'static str> = Some("description text");
    Style: Use present tense action verbs, keep concise
    Reference: Use implementation code for F3 methods, use standard Ethereum
    JSON-RPC docs for Eth methods
    

    🚀 Next Steps

    🤖 All AI agent prompts combined
    Task: 1
    
    This phase adds DESCRIPTION constants to small modules (auth, common, beacon,
    market, node, msig) to complete foundation documentation. The goal is to
    establish consistent patterns and achieve 100% documentation coverage for these
    modules.
    
    For each RPC method enum in the following files, add a DESCRIPTION constant:
    - src/rpc/methods/auth.rs: Add descriptions for AuthNew and AuthVerify methods
    - src/rpc/methods/common.rs: Add descriptions for Session, Version, Shutdown,
    and StartTime methods
    - src/rpc/methods/beacon.rs: Add description for BeaconGetEntry method
    - src/rpc/methods/market.rs: Add description for MarketAddBalance method
    - src/rpc/methods/node.rs: Add description for NodeStatus method
    - src/rpc/methods/msig.rs: Add descriptions for MsigGetAvailableBalance,
    MsigGetPending, MsigGetVested, and MsigGetVestingSchedule methods
    
    Format: const DESCRIPTION: Option<&'static str> = Some("description text");
    Style: Use present tense action verbs (Returns, Retrieves, Creates, Verifies,
    etc.), keep concise and single-sentence
    Reference existing documented methods in the codebase for style consistency
    ===============================================================================
    
    Task: 2
    
    This phase adds DESCRIPTION constants to medium-sized modules (sync, net,
    wallet, state, chain) covering core API functionality. The goal is to document
    essential sync, network, wallet, state query, and chain operations.
    
    For each RPC method enum in the following files, add a DESCRIPTION constant:
    - src/rpc/methods/sync.rs: Add descriptions for SyncCheckBad and SyncMarkBad
    methods
    - src/rpc/methods/net.rs: Add descriptions for NetFindPeer, NetListening,
    NetInfo, NetAutoNatStatus, and NetVersion methods
    - src/rpc/methods/wallet.rs: Add descriptions for WalletDefaultAddress,
    WalletExport, WalletImport, WalletNew, WalletSetDefault, WalletValidateAddress,
    WalletVerify, and WalletDelete methods
    - src/rpc/methods/state.rs: Add descriptions for StateNetworkName,
    StateGetReceipt, StateWaitMsgV0, StateFetchRoot, ForestStateCompute,
    StateSectorPreCommitInfoV0, and StateMinerInitialPledgeForSector methods
    - src/rpc/methods/chain.rs: Add descriptions for ChainGetMessagesInTipset,
    ChainPruneSnapshot, ChainExport, ChainStatObj, ChainGetGenesis, ChainSetHead,
    ChainGetMinBaseFee, ChainGetTipsetByParentState, and Forest-specific methods
    (ForestChainExport, ForestChainExportStatus, ForestChainExportCancel,
    ForestChainExportDiff)
    
    Format: const DESCRIPTION: Option<&'static str> = Some("description text");
    Style: Follow existing descriptions in these modules, use present tense action
    verbs
    Note: Forest-specific methods should indicate they are Forest extensions
    ===============================================================================
    
    Task: 3
    
    This phase adds DESCRIPTION constants to the largest modules (f3.rs and eth.rs)
    covering F3 consensus and Ethereum compatibility. The goal is to document all
    remaining methods for Fast Finality consensus and Ethereum JSON-RPC
    compatibility layer.
    
    For each RPC method enum in the following files, add a DESCRIPTION constant:
    - src/rpc/methods/f3.rs: Add descriptions for 20 methods including
    GetRawNetworkName, GetTipsetByEpoch, GetTipset, GetHead, GetParent,
    GetPowerTable, ProtectPeer, GetParticipatingMinerIDs, Finalize, SignMessage, and
    F3-prefixed methods (F3GetCertificate, F3GetLatestCertificate,
    F3GetECPowerTable, F3IsRunning, F3GetProgress, F3GetManifest,
    F3ListParticipants, F3GetOrRenewParticipationTicket, F3Participate)
    - src/rpc/methods/eth.rs: Add descriptions for all Ethereum compatibility
    methods organized by category:
    - Core methods: Web3ClientVersion, EthAccounts, EthBlockNumber, EthChainId,
    EthSyncing, EthProtocolVersion
    - Block methods: EthGetBlockByHash, EthGetBlockByNumber, EthGetBlockByNumberV2,
    EthGetBlockReceipts, EthGetBlockReceiptsLimited, EthGetBlockTransactionCount
    variants
    - Transaction methods: EthGetTransactionByHash, EthGetTransactionByHashLimited,
    EthGetTransactionByBlockHashAndIndex, EthGetTransactionByBlockNumberAndIndex,
    EthGetTransactionCount, EthGetTransactionCountV2, EthGetTransactionReceipt,
    EthGetTransactionReceiptLimited, EthSendRawTransaction,
    EthGetMessageCidByTransactionHash
    - State/execution methods: EthCall, EthCallV2, EthEstimateGas, EthEstimateGasV2,
    EthGetCode, EthGetStorageAt, EthFeeHistory, EthFeeHistoryV2,
    EthMaxPriorityFeePerGas, EthGetLogs, EthGetFilterLogs, EthGetFilterChanges
    - Filter/subscription methods: EthNewFilter, EthNewPendingTransactionFilter,
    EthNewBlockFilter, EthUninstallFilter, EthSubscribe, EthUnsubscribe,
    EthTraceBlock, EthTraceReplayBlockTransactions, EthTraceFilter,
    EthTraceTransaction
    
    Format: const DESCRIPTION: Option<&'static str> = Some("description text");
    Style: Use present tense action verbs, keep concise
    Reference: Use implementation code for F3 methods, use standard Ethereum
    JSON-RPC docs for Eth methods
    
    💡 Iterate on the plan with: @coderabbitai <feedback>
    Example Feedback
    - @coderabbitai You can skip phase 3. Add a simple unit test case for phase 2.
    - @coderabbitai For assumption 1 go ahead with option 3 and replan.
    

    💬 Have feedback or questions? Drop into our discord!

  3. hanabi1224 commented on Jan 23, 2026

    @hanabi1224
    Contributor

    @coderabbitai please create a PR with task 1

  4. coderabbitai commented on Jan 23, 2026

    @coderabbitai
    ContributorAuthor

    I've updated the plan above based on your feedback. Ready to proceed when you are!

  5. moved this from New to Ready in Forest Backlog 🌲on Jan 29, 2026
  6. added a commit that references this issue on May 23, 2026
    f69d6cf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Fields

Priority

None yet

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions