EEVM.Interpreter.MachineState.Substate (eevm v0.1.0)

Copy Markdown View Source

Transaction-scoped accumulators that survive nested call frames.

Fields

  • touched_addresses — EIP-161 cleanup set; empty accounts touched during the transaction are deleted on commit.
  • accessed_addresses / accessed_storage_keys — EIP-2929 access lists powering cold/warm gas pricing.
  • created_addresses — EIP-6780 set of contracts created in this tx; only these can be fully deleted by SELFDESTRUCT post-Cancun. An address joins the set before its initcode runs, so a SELFDESTRUCT during init deletes it, and leaves the set if that creation fails.
  • original_storage — per-tx snapshot of the first-observed value of each storage slot, used by EIP-2200 SSTORE accounting.
  • transient_storage — EIP-1153 per-tx store keyed by {address, slot}, passed into every child frame and cleared at tx end.
  • logs — emitted log entries, parent-then-child on success.

All seven fields revert together when a child frame fails (see EEVM.Interpreter.Journal). Stack, memory, pc, and gas are not substate — they belong to the per-frame execution context.

Summary

Functions

Builds a substate, taking each field from the option of the same name and defaulting to an empty set, map, or list.

Types

log_entry()

@type log_entry() :: %{
  address: non_neg_integer(),
  data: binary(),
  topics: [non_neg_integer()]
}

t()

@type t() :: %EEVM.Interpreter.MachineState.Substate{
  accessed_addresses: MapSet.t(non_neg_integer()),
  accessed_storage_keys: MapSet.t({non_neg_integer(), non_neg_integer()}),
  created_addresses: MapSet.t(non_neg_integer()),
  logs: [log_entry()],
  original_storage: %{required(non_neg_integer()) => non_neg_integer()},
  touched_addresses: MapSet.t(non_neg_integer()),
  transient_storage: %{
    required({non_neg_integer(), non_neg_integer()}) => non_neg_integer()
  }
}

Functions

new(opts \\ [])

@spec new(keyword()) :: t()

Builds a substate, taking each field from the option of the same name and defaulting to an empty set, map, or list.