TraceConfig
Configuration options for Ethereum execution tracing viadebug_traceTransaction and debug_traceCall RPC methods.
Overview
TraceConfig controls what data is collected during transaction execution tracing. Different options trade off between detail and performance.Type Definition
Usage
Basic Configuration
Using Tracers
Performance Optimization
Built-in Tracers
callTracer
Traces the call tree structure. Returns nested calls with gas usage, errors, and return data.prestateTracer
Captures pre-execution state for all accessed accounts and storage slots.4byteTracer
Counts function selector usage (first 4 bytes of calldata).opcodeTracer
Default tracer that logs every opcode execution.Performance Considerations
Memory Overhead
- disableMemory: true - Saves significant memory for contracts with large memory usage
- enableMemory: true - Required for debugging memory-related issues
- Default: Memory tracking disabled
Storage Overhead
- disableStorage: true - Reduces trace size for contracts with heavy SSTORE/SLOAD
- Default: Storage tracking enabled
Stack Overhead
- disableStack: true - Minimal savings, stack is usually small
- Default: Stack tracking enabled
Recommended Configurations
Use Cases
Debugging Transaction Reverts
Gas Profiling
Call Tree Analysis
State Access Patterns
RPC Methods
TraceConfig is used with these Geth debug RPC methods:debug_traceTransaction
debug_traceCall
debug_traceBlockByNumber
debug_traceBlockByHash
See Also
- TraceResult - Execution trace result
- StructLog - Opcode-level trace entry
- CallTrace - Call tree structure
- OpStep - Single opcode step

