Add support for the Filecoin.EthTraceFilter V2#6522
Add support for the Filecoin.EthTraceFilter V2#6522sudo-shashank wants to merge 8 commits intomainfrom
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
WalkthroughAdds a v2 RPC endpoint Filecoin.EthTraceFilter (EthTraceFilterV2) that mirrors v1 behavior but resolves block identifiers via the v2 tipset resolver; registers the new method and adds a corresponding test and snapshot entry. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant RPC as RpcServer/EthTraceFilterV2
participant Resolver as TipsetResolverV2
participant Trace as TraceFilterLogic
participant DB as Blockstore
Client->>RPC: RPC call (EthTraceFilter criteria)
RPC->>Resolver: resolve fromBlock/toBlock (tipset_by_block_number_or_hash_v2)
Resolver->>DB: fetch tipset by number or hash
DB-->>Resolver: tipset (epoch)
Resolver-->>RPC: epoch numbers (from/to)
RPC->>Trace: invoke trace_filter with resolved epochs
Trace-->>RPC: traces (sorted)
RPC-->>Client: return Vec<EthBlockTrace>
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Line 52: Update the CHANGELOG.md entry that currently references PR `#6522` to
reference issue `#6307` instead; replace the PR link
"[`#6522`](https://github.com/ChainSafe/forest/pull/6522): Implemented
`Filecoin.EthTraceFilter` for API v2." with the issue-style entry
"[`#6307`](https://github.com/ChainSafe/forest/issues/6307): Implemented
`Filecoin.EthTraceFilter` for API v2." so the changelog points to the issue
rather than the PR.
In `@src/rpc/methods/eth.rs`:
- Around line 4144-4189: The public enum EthTraceFilterV2 lacks rustdoc; add a
concise triple-slash doc comment above pub enum EthTraceFilterV2 describing its
purpose (RPC method Filecoin.EthTraceFilter / alias "trace_filter"), expected
parameter (EthTraceFilterCriteria), return type (Vec<EthBlockTrace>), and a
brief note about behavior (returns traces for transactions matching the filter
between from_block and to_block as handled in impl RpcMethod for
EthTraceFilterV2), so readers of the type and generated docs immediately
understand what this RPC endpoint represents and how it is used.
Summary of changes
Changes introduced in this pull request:
Filecoin.EthTraceFilterV2 and added test.Reference issue to close (if applicable)
Closes #6307
Other information and links
Change checklist
Outside contributions
Summary by CodeRabbit
New Features
Tests
Changelog
Snapshots