Expand description
EVM execution inspectors for debugging and analysis.
This module provides various inspector implementations that hook into the EVM execution process to collect debugging information, create snapshots, and modify execution behavior for debugging purposes.
§Inspector Types
§CallTracer
Traces all contract calls during execution, building a hierarchical call tree that captures the complete execution flow including internal calls, delegate calls, and create operations.
§HookSnapshotInspector
Creates detailed snapshots at specific hook points during execution, capturing local variables, state variables, and execution context for source-level debugging. This inspector works with source maps and debug information to provide high-level debugging capabilities.
§OpcodeSnapshotInspector
Creates snapshots at the opcode level, capturing low-level EVM state including stack, memory, storage, and transient storage. Useful for detailed execution analysis and opcode-level debugging.
§TweakInspector
Allows runtime modification of contract bytecode and behavior for debugging purposes. Can inject custom logic, modify return values, and alter execution flow to test different scenarios.
§Usage
Inspectors are typically chained together to provide comprehensive debugging:
let call_tracer = CallTracer::new();
let hook_inspector = HookSnapshotInspector::new(context);
let opcode_inspector = OpcodeSnapshotInspector::new(context);§Architecture
All inspectors implement the REVM Inspector trait. Each inspector focuses
on a specific aspect of execution analysis while maintaining minimal overhead
when not actively collecting data.
Structs§
- Call
Tracer - Complete call tracer that captures execution flow
- Hook
Snapshot - Single hook execution snapshot
- Hook
Snapshot Inspector - Inspector that records hook-triggered snapshots
- Hook
Snapshots - Collection of hook snapshots organized by execution order
- Opcode
Snapshot - Single opcode execution snapshot
- Opcode
Snapshot Inspector - Inspector that records detailed opcode execution snapshots
- Opcode
Snapshots - Collection of opcode snapshots
- Trace
Replay Result - Result of transaction replay with call trace
- Tweak
Inspector - Inspector that intercepts and modifies contract deployments
Constants§
- MAGIC_
SNAPSHOT_ NUMBER - Magic number that indicates a snapshot to be taken
- MAGIC_
VARIABLE_ UPDATE_ NUMBER - Magic number that indicates a variable update to be recorded
Functions§
- decode_
variable_ value - Decode the variable value from the given ABI-encoded data according to the variable declaration.