feat(rpc): implement Parity trace_ namespace (9 methods)#121
Draft
prestwich wants to merge 11 commits intoprestwich/eng-960-rpc-namespace-completenessfrom
Draft
feat(rpc): implement Parity trace_ namespace (9 methods)#121prestwich wants to merge 11 commits intoprestwich/eng-960-rpc-namespace-completenessfrom
prestwich wants to merge 11 commits intoprestwich/eng-960-rpc-namespace-completenessfrom
Conversation
8221a2c to
b3d7ca3
Compare
9af104c to
4dd2e29
Compare
b3d7ca3 to
552d4ff
Compare
4dd2e29 to
03bbd7c
Compare
552d4ff to
d3034ae
Compare
03bbd7c to
c0379af
Compare
d3034ae to
d12d1b2
Compare
Fraser999
reviewed
Mar 30, 2026
| /// Maximum block range for trace_filter queries. | ||
| #[from_env( | ||
| var = "SIGNET_RPC_MAX_TRACE_FILTER_BLOCKS", | ||
| desc = "Maximum block range for trace_filter queries", |
Contributor
There was a problem hiding this comment.
Suggested change
| desc = "Maximum block range for trace_filter queries", | |
| desc = "Maximum block range for trace_filter queries [default: 100]", |
| /// | ||
| /// Replays all transactions in a block (stopping at the first | ||
| /// magic-signature tx) and returns localized Parity traces. | ||
| #[allow(clippy::too_many_arguments)] |
Contributor
There was a problem hiding this comment.
I think this can be removed?
| <Db as Database>::Error: DBErrorMarker, | ||
| <Db as DatabaseRef>::Error: DBErrorMarker, | ||
| { | ||
| use itertools::Itertools; |
Contributor
There was a problem hiding this comment.
Import once at the top of the file rather than multiple times inline?
| constants: SignetSystemConstants, | ||
| spec_id: SpecId, | ||
| header: &alloy::consensus::Header, | ||
| _block_hash: B256, |
Contributor
There was a problem hiding this comment.
Can we remove this param? If we can, we can also remove the #[allow(clippy::too_many_arguments)].
| } | ||
|
|
||
| let max = ctx.config().max_trace_filter_blocks; | ||
| let distance = end.saturating_sub(start); |
Contributor
There was a problem hiding this comment.
Suggested change
| let distance = end.saturating_sub(start); | |
| let distance = end.saturating_sub(start) + 1; |
| return Err(TraceError::BlockNotFound(BlockId::latest())); | ||
| } | ||
| if start > end { | ||
| return Err(TraceError::EvmHalt { |
Contributor
There was a problem hiding this comment.
Not sure that EvmHalt is the best way to describe this. Maybe we could change BlockRangeExceeded to something like InvalidBlockRange and make the requested field a negative value in this case, or just add a completely new error variant for this case?
Comment on lines
+576
to
+578
| if start > latest || end > latest { | ||
| return Err(TraceError::BlockNotFound(BlockId::latest())); | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| if start > latest || end > latest { | |
| return Err(TraceError::BlockNotFound(BlockId::latest())); | |
| } | |
| if start > latest { | |
| return Err(TraceError::BlockNotFound(BlockId::Number(start.into()))); | |
| } | |
| if end > latest { | |
| return Err(TraceError::BlockNotFound(BlockId::Number(end.into()))); | |
| } |
c0379af to
f3d693c
Compare
12 tasks covering TraceError, param types, config, Parity tracer functions, block replay helpers, 9 trace_ endpoints, and router wiring. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements the trace_block and trace_transaction async RPC handlers, calling the existing trace_block_localized helper for block-level and per-transaction Parity trace output. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e_get, and trace_filter Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Creates trace/mod.rs with the router constructor and wires it into the combined router. Fixes HashSet type mismatch (std to alloy) and removes erroneous accept_state() call on already-needs-tx state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d12d1b2 to
8eb7f8c
Compare
The docs/ directory is already in .gitignore — these were force-added. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the complete Parity/OpenEthereum
trace_JSON-RPC namespace (9 methods) insignet-rpcfor Blockscout and general tooling compatibility. Stacks on top of #120.trace_block,trace_transaction,trace_get— localized Parity tracestrace_replayBlockTransactions,trace_replayTransaction— replay with trace type selection (trace,vmTrace,stateDiff)trace_call,trace_callMany— call tracing with state/block overrides and accumulated statetrace_rawTransaction— trace from raw RLP bytestrace_filter— brute-force block range filter with configurable limit (default 100, envSIGNET_RPC_MAX_TRACE_FILTER_BLOCKS)Architecture: new
tracemodule mirroringdebug; two shared Parity tracer functions indebug/tracer.rs; two shared block replay helpers; all handlers semaphore-gated.Closes ENG-2088, ENG-1064, ENG-1065
Test plan
cargo t -p signet-rpc— 35 unit + 6 doc-tests passcargo clippy -p signet-rpc --all-features --all-targets— cleancargo clippy --all-features --all-targets— workspace cleancargo +nightly fmt --check— clean🤖 Generated with Claude Code