-
Notifications
You must be signed in to change notification settings - Fork 182
feat: enable V2 API support for basic Eth and Filecoin RPC methods #6171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdded a temporary ApiPaths helper Changes
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
src/rpc/reflect/mod.rs
Outdated
| // 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> { |
There was a problem hiding this comment.
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.
| 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this 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
📒 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
Pull request was converted to draft
Summary of changes
Changes introduced in this pull request:
V2API support for all the Eth and Filecoin API's which doesn't rely on the F3 FinalityApiPaths::all_with_v2so we can rollout incremental V2 support and later on delete theall_with_v2and usealldirecly.Reference issue to close (if applicable)
Closes: #6170
Other information and links
Change checklist
Summary by CodeRabbit
New Features
Chores
Documentation