Expand description
Call-frame tracing and a composing inspector seam.
This module provides CallTracer, a revm::Inspector that reconstructs
the call-frame tree of a simulation — the top-level call plus every nested
CALL/STATICCALL/DELEGATECALL/CALLCODE and CREATE/CREATE2 frame —
without opcode/step-level tracing. Each CallTrace records the caller, the
callee (or created address), the call value, calldata, gas used, return data,
a CallStatus, the call depth, and its child frames.
It also provides InspectorStack, a tiny composing inspector that fans out
every Inspector hook to two inner inspectors so, e.g., a CallTracer and a
TransferInspector can run in a single
pass and each produce its own independent result.
Attach either via the inspector-generic
EvmOverlay::call_raw_with_inspector.
§Calldata resolution caveat
revm represents a frame’s calldata as a CallInput, which is either owned
CallInput::Bytes or a CallInput::SharedBuffer range into the EVM’s
shared-memory scratch buffer. Resolving a SharedBuffer range back to bytes
requires the concrete EVM context (ContextTr), which this inspector — written
against the same fully-generic CTX as the existing
TransferInspector — deliberately does
not bind. The top-level call’s calldata is always CallInput::Bytes (revm
builds it directly from the transaction), so a root frame’s
input is always the real calldata. Nested calls whose
calldata is a SharedBuffer are recorded with an empty input; their
callee address, value, gas, status, and subcalls are captured faithfully. This
is a documented limitation, not a correctness bug: the tracer never fabricates
calldata it cannot resolve.
Structs§
- Call
Trace - A single node in the call-frame tree captured by a
CallTracer. - Call
Tracer - A
revm::Inspectorthat builds aCallTracetree from the call/create frame hooks. - Inspector
Stack - Runs two
Inspectors over the same execution.
Enums§
- Call
Kind - The kind of EVM frame a
CallTracerepresents. - Call
Status - The terminal status of an EVM frame.