Skip to main content

OpStep

Represents a single opcode execution step with strongly-typed EVM state (stack, memory, storage, gas).

Overview

OpStep captures the EVM state at a specific instruction. It’s the typed equivalent of StructLog with proper types for stack/memory/storage instead of hex strings.

Type Definition

Usage

Creating OpSteps

Checking for Errors

Common Patterns

Analyzing Stack Operations

Memory Analysis

Storage Access Patterns

Gas Analysis

Call Depth Tracking

Opcode Categories

Converting from StructLog

Performance Tips

  • OpStep with stack/memory/storage consumes significant memory
  • Use TraceConfig to disable tracking you don’t need
  • Process steps in streaming fashion for large traces
  • Consider sampling for performance profiling (every Nth step)

See Also