Skip to content

Conversation

@akaladarshi
Copy link
Collaborator

@akaladarshi akaladarshi commented Oct 20, 2025

Summary of changes

Changes introduced in this pull request:

  • Enable V2 API support for all the Eth and Filecoin API's which doesn't rely on the F3 Finality
  • Added temporary ApiPaths::all_with_v2 so we can rollout incremental V2 support and later on delete the all_with_v2 and use all direcly.

Reference issue to close (if applicable)

Closes: #6170

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Summary by CodeRabbit

  • New Features

    • Enabled V2 API route support for many Ethereum RPC methods and Net endpoints (expanded V2 coverage).
  • Chores

    • Updated routing configuration so numerous RPC methods use the V2 route set to support incremental migration.
    • Added a temporary helper to expose V2 routes during the migration.
  • Documentation

    • Updated changelog noting V2 route availability for affected RPC methods.

@akaladarshi akaladarshi requested a review from a team as a code owner October 20, 2025 11:20
@akaladarshi akaladarshi requested review from elmattic and hanabi1224 and removed request for a team October 20, 2025 11:20
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

Walkthrough

Added a temporary ApiPaths helper all_with_v2() that includes V0|V1|V2 and updated many Eth and Net RPC methods to use it (changing their declared API_PATHS from ApiPaths::all() to ApiPaths::all_with_v2()). CHANGELOG updated to note V2 enablement for basic Eth RPCs.

Changes

Cohort / File(s) Summary
New API path helper
src/rpc/reflect/mod.rs
Added pub const fn all_with_v2() -> BitFlags<Self> returning V0
Eth RPC method path updates (many impls)
src/rpc/methods/eth.rs
Replaced const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all(); with ApiPaths::all_with_v2(); across numerous impl RpcMethod<*> for ... entries (Web3ClientVersion, EthAccounts, EthBlockNumber, EthChainId, EthGasPrice, EthGetBlockByHash/ByNumber, EthProtocolVersion, EthMaxPriorityFeePerGas, EthSyncing, EthGetTransaction* variants, EthCall, EthNewFilter / EthNewPendingTransactionFilter / EthNewBlockFilter, EthUninstallFilter, EthSubscribe / EthUnsubscribe, EthAddressToFilecoinAddress, EthGetCode, EthTraceBlock/Transaction/Replay..., EthGetLogs, EthGetFilterLogs/Changes, EthTraceFilter, EthEstimateGas, EthGetBlockReceipts, EthGetBlockTransactionCount*, EthGetTransactionReceipt/ReceiptLimited, EthSendRawTransaction, EthGetStorageAt, EthGetBalance, EthGetTransactionCount, and others). Signatures unchanged; only API_PATHS value updated.
Net RPC method path updates
src/rpc/methods/net.rs
Updated const API_PATHS from ApiPaths::all() to ApiPaths::all_with_v2() for NetListening and NetVersion.
CHANGELOG
CHANGELOG.md
Documented enabling V2 API support for basic Eth RPC methods (EthChainId, EthProtocolVersion, EthSyncing, EthAccounts).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client
  participant Router as RPC Router
  participant Method as RPC Method Impl

  Note over Router,Method: Method.impl.API_PATHS may now include V2 via all_with_v2()
  Client->>Router: send eth/* or net/* request (URI)
  Router->>Method: resolve method and check API_PATHS vs request URI
  alt allowed (V0 | V1 | V2)
    Method->>Router: handle request -> success
    Router->>Client: return result
  else not allowed
    Method->>Router: reject -> error
    Router->>Client: return error
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

  • Filecoin V2 APIs #5636 — The change (adding ApiPaths::all_with_v2 and switching many Eth/Net API_PATHS) directly implements enabling V2 API paths for the listed Eth/Net methods noted in that issue.

Suggested reviewers

  • hanabi1224
  • LesnyRumcajs
  • elmattic

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning The linked issue #6170 explicitly specifies which methods should be enabled for V2 support and marks specific items as complete (EthBasic methods, NetListening, NetVersion, EthSendRawTransaction). The PR description states the objective is to "Enable V2 API support for the Eth Basic APIs," and the CHANGELOG entry confirms this by listing only "EthChainId, EthProtocolVersion, EthSyncing, EthAccounts" as the targeted basic methods. However, reviewing the actual code changes shows the PR also updates many methods marked as "not yet implemented" in the issue, including EthGetBlockByHash, EthGetTransactionByHash, EthGasPrice, EthTraceTransaction, EthGetLogs, and others from EthTransaction, EthGas, EthTrace, and EthEvents categories. These updates are inconsistent with both the stated PR objective and the completion criteria in issue #6170. The PR should either be narrowed to include only the methods explicitly marked as complete in issue #6170 (as documented in the CHANGELOG), or the PR description, CHANGELOG, and issue checklist should be updated to reflect the expanded scope. Additionally, clarify whether the extended methods are intentionally being enabled for V2 or if they were inadvertently included in the batch update to use all_with_v2().
Out of Scope Changes Check ⚠️ Warning The PR introduces changes to methods that extend beyond the documented scope of the linked issue #6170 and the stated PR objectives. While the issue specifies that basic APIs (EthChainId, EthProtocolVersion, EthSyncing, EthAccounts, Web3ClientVersion, NetListening, NetVersion) and EthSendRawTransaction should be enabled for V2, the actual code changes systematically update many additional methods including EthGetBlockByHash, EthGetTransactionByHash, EthGasPrice, EthMaxPriorityFeePerGas, EthTraceTransaction, EthGetLogs, and numerous others from EthTransaction, EthGas, EthTrace, and EthEvents categories. These methods are explicitly listed as "not yet implemented" in issue #6170 and are not mentioned in the CHANGELOG, indicating they are out of scope for this PR. Review the full list of methods being updated in src/rpc/methods/eth.rs and src/rpc/methods/net.rs. If these expanded methods should indeed be enabled for V2, update the linked issue #6170 to reflect their completion status and update the CHANGELOG to document all methods being enabled. If they should not be updated as part of this PR, revert the changes for out-of-scope methods to keep the scope aligned with the documented requirements.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "feat: enable V2 API support for basic Eth RPC methods" is directly and accurately related to the changeset. The PR's primary objective is to enable V2 API support through the introduction of a temporary all_with_v2() helper function and subsequent updates to the API_PATHS constant across multiple RPC method implementations in eth.rs and net.rs. The title appropriately identifies both the action (enable V2 API support) and the scope (basic Eth RPC methods), which aligns with the stated PR objectives and CHANGELOG entry. The title is clear, concise, and specific enough that a developer scanning commit history would immediately understand the PR's primary purpose.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch akaladarshi/extend-eth-basic-api-v2

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 Oct 20, 2025
hanabi1224
hanabi1224 previously approved these changes Oct 20, 2025
@akaladarshi akaladarshi enabled auto-merge October 21, 2025 08:45
// Remove this helper once all RPC methods are migrated to V2.
// We're incrementally migrating methods to V2 support. Once complete,
// update all() to include V2 and remove this temporary helper.
pub const fn with_v2() -> BitFlags<Self> {
Copy link
Member

Choose a reason for hiding this comment

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

The method name is a bit misleading. When calling ApiPaths::with_v2 I'd expect only the v2 to be set.

Suggested change
pub const fn with_v2() -> BitFlags<Self> {
pub const fn all_with_v2() -> BitFlags<Self> {

For the logic - it'd be cleaner to call all and just set v2.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

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

🧹 Nitpick comments (1)
src/rpc/reflect/mod.rs (1)

137-142: LGTM! Clean implementation of the temporary V2 migration helper.

The implementation correctly unions V0, V1, and V2 flags, and the comment clearly explains the temporary nature of this helper. The const function allows for compile-time evaluation, which is appropriate for API path configuration.

Optional enhancement: Consider referencing the tracking issue in the comment for better traceability:

-    // Remove this helper once all RPC methods are migrated to V2.
+    // TODO(#6170): Remove this helper once all RPC methods are migrated to V2.
     // We're incrementally migrating methods to V2 support. Once complete,
     // update all() to include V2 and remove this temporary helper.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c7a73be and 7e17165.

📒 Files selected for processing (2)
  • src/rpc/methods/eth.rs (4 hunks)
  • src/rpc/reflect/mod.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/rpc/methods/eth.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). (8)
  • GitHub Check: Check
  • GitHub Check: Build Ubuntu
  • GitHub Check: cargo-publish-dry-run
  • GitHub Check: Build MacOS
  • GitHub Check: tests-release
  • GitHub Check: tests
  • GitHub Check: Build forest binaries on Linux AMD64
  • GitHub Check: All lint checks

@akaladarshi akaladarshi marked this pull request as draft October 22, 2025 06:48
auto-merge was automatically disabled October 22, 2025 06:48

Pull request was converted to draft

@akaladarshi akaladarshi marked this pull request as ready for review October 22, 2025 07:34
@akaladarshi akaladarshi changed the title feat: enable V2 API support for basic Eth RPC methods feat: enable V2 API support for basic Eth and Filecoin RPC methods Oct 22, 2025
@akaladarshi akaladarshi added this pull request to the merge queue Oct 22, 2025
Merged via the queue into main with commit 86d7178 Oct 22, 2025
78 of 79 checks passed
@akaladarshi akaladarshi deleted the akaladarshi/extend-eth-basic-api-v2 branch October 22, 2025 11: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.

Extend Eth and Filecoin Basic API's to support V2

4 participants