You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 612b4a4
Browse filesBrowse the repository at this point in the historyBrowse files
feat(evmonly): add debug_trace* RPC methods to EVM-only RPC (#4597)
This PR adds the following methods to EVM-only (Autobahn) RPC.
- `debug_traceTransaction`
- `debug_traceCall`
- `debug_traceBlockByNumber` / `debug_traceBlockByHash`
How it works
- debugAPI hands requests to go-ethereum's tracers.API through
traceBackend, our implementation of tracers.Backend. Request and
response shapes and the native tracers therefore match go-ethereum and
v2.
- The state before a transaction comes from Executor.ReplayState. It
re-applies the block's earlier transactions with executeTx, the same
function block execution uses.
- The app exposes this as EvmStateAt, EvmStateBeforeTx and
EvmBlockContext on proxy.EVMApplication. FinalizeBlock and tracing build
the block context through one shared helper, blockContext.
- debug_traceCall runs against the state after the named block. latest
means the latest committed block.
Only go-ethereum's native tracers run. JavaScript tracers are refused,
including inside muxTracer. State and block overrides are refused for
now, will be addressed via a separate PR.
New [giga.rpc] keys, with v2's defaults:
- `max_concurrent_trace_calls` (10)
- `trace_timeout` (30s)
- `max_trace_struct_log_bytes` (32 MiB)
There is no consensus or state impact. The only executor changes are
exporting EVMBlockContext and adding SetTxContext/GetLogs to
nativeStateDB; only the tracer calls those two. Past transactions and
blocks can only be traced on a full node, because validators keep no
state history. The oldest retained block can't be traced because its
parent has been pruned. Block traces skip transactions the block
rejected. As a result, flatCallTracer's transactionPosition counts only
executed transactions and can differ from the receipt's index. This is
listed as a known issue in the README and will be revisited with the
block-filtering work.
Checklist
- [x] RPC tests: refusals (unknown hash, JavaScript tracers, muxTracer
nesting, overrides, concurrency limit, timeout, struct-log cap) and edge
cases (rejected transactions skipped, block 1, txIndex on an empty
block, latest for calls, blocks not yet indexed)
- [x] Fixture test: every transaction, block and recorded call of the
synthetic-basic parity fixture, traced with every native tracer and the
struct logger, compared against recorded output
- [x] Executor and app tests: replay matches the committed state; unheld
heights, block 0 and validator history are refused
- [x] EVMProxy / EVMEnvironment pass-through tests; config keys and
defaults
- [x] Autobahn integration test: the deploy and its block traced on the
RPC node, a call traced on every node, a validator refusing a past
transaction
- [x] go test -race on the affected packages; golangci-lint and fmt
--diff clean
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments