Skip to main content

TraceResult

Complete execution trace result returned by debug_traceTransaction and debug_traceCall. Contains either opcode-level logs or call tree depending on tracer configuration.

Overview

TraceResult is the top-level response from Geth’s debug tracing methods. It provides execution outcome (gas used, success/failure, return data) plus optional detailed trace data.

Type Definition

Usage

Creating TraceResults

Accessing Trace Data

RPC Usage

debug_traceTransaction

debug_traceCall

Common Patterns

Analyzing Failed Transactions

Gas Profiling

Finding Expensive Operations

Extracting Storage Changes

Call Flow Visualization

Tracer-Specific Results

Default Tracer (structLogs)

callTracer

prestateTracer

Performance Considerations

Memory Usage

  • structLogs can be very large (10k+ entries for complex transactions)
  • Each log contains stack/memory/storage snapshots
  • Use TraceConfig.disableAll() for minimal memory

Processing Time

  • Opcode-level tracing is slow (10-100x slower than normal execution)
  • callTracer is faster (only tracks calls, not every opcode)
  • Use timeouts in TraceConfig for long-running traces

Best Practices

Security Analysis

Reentrancy Detection

SELFDESTRUCT Detection

See Also