# evm.execution_frames

One row per contextual attempt owner and frame_index. A reused physical attempt expands once for each execution step or observation owner; use attempt_id for physical deduplication.

Canonical HTML: <https://determica.com/docs/tables/evm-execution-frames>

- Kind: View
- Layer: execution_read_model
- Category: Simulation
- Tags: Program, Execution, Public, View

## Contract and lifecycle

**Grain:** One contextual attempt fact per (execution_id, attempt_kind, step_index or observation_index, frame_index); attempt_id identifies the reusable physical attempt.

**Lifecycle:** run publishes this immutable row set atomically with its owning run. Statement failure or caller rollback publishes no durable prefix; direct DML is unsupported because it can corrupt the documented invariants.

**Status and NULLs:** Interpret nullable payloads only through their owning status fields. Defensive poisoned and engine_error outcomes mean the engine refused to claim a trustworthy normal result; broad view nullability also covers owner alternatives and left-joined evidence.

### Join guidance

- Join evm.executions on execution_id for candidate and run context.
- Use attempt_id to deduplicate physical facts expanded across contextual owners.
- For program owners use step_index; for observation-call owners use observation_index and observation_key.

### Effect semantics

- Access flags describe attempted EVM access, not committed state change.
- Effect facts retain attempted evidence and final committed, reverted, discarded, or poisoned disposition.
- execution_state_deltas contains committed checkpoint transitions only; observation-call effects are excluded from execution_effect_summary.

## Columns

### Identity and ownership

Contextual keys and reusable identities that establish row ownership.

- `execution_id` (UUID; nullable) — Contextual execution association identity; do not use it as reusable artifact identity.
- `attempt_kind` (VARCHAR; nullable) — Owner kind: program_step or observation_call.
- `observation_key` (VARCHAR; nullable) — Byte-exact caller observation identity for an observation_call owner; otherwise NULL.
- `attempt_id` (UUID; nullable) — Reusable physical attempt identity; contextual owners may share this value.

### Chain context

Pinned chain, block, profile, and revision context.

- `chain_id` (UBIGINT; nullable) — EVM chain identifier frozen for the owning execution.
- `chain_profile` (VARCHAR; nullable) — Named chain-rules profile frozen for the owning execution.

### Ordering and cardinality

Stable indexes and counts used to reconstruct deterministic order.

- `step_index` (UINTEGER; nullable) — Zero-based program order; NULL for observation_call attempt owners.
- `observation_index` (UINTEGER; nullable) — Zero-based expanded point order; identifies observation-call ownership.
- `frame_index` (UINTEGER; nullable) — Frame sequence index
- `parent_frame_index` (UINTEGER; nullable) — Parent frame index

### Payload and evidence

Operation-specific inputs, outputs, and authenticated evidence.

- `depth` (INTEGER; nullable) — EVMC message depth
- `call_kind` (VARCHAR; nullable) — EVMC call kind
- `context_address` (ADDRESS; nullable) — Storage and balance context address
- `code_address` (ADDRESS; nullable) — Executed code address
- `executed_code_kind` (VARCHAR; nullable) — Kind of bytes executed by the frame
- `delegated` (BOOLEAN; nullable) — Whether EIP-7702 delegation selected code_address
- `delegation_target` (ADDRESS; nullable) — First delegation target when delegated
- `sender` (ADDRESS; nullable) — Message sender
- `value_raw_bytes32` (BYTES32; nullable) — EVMC message value, exact when non-null
- `static_mode` (BOOLEAN; nullable) — Whether the frame ran in static mode
- `reverted` (BOOLEAN; nullable) — Whether the frame returned EVMC_REVERT
- `error` (VARCHAR; nullable) — Frame error status
- `input_data` (BYTES; nullable) — EVMC message input bytes
- `return_data` (BYTES; nullable) — Frame return bytes; empty blob when successful with no output
- `revert_data` (BYTES; nullable) — Frame revert bytes; empty blob when reverted with no output
- `revert_selector` (BYTES4; nullable) — First four bytes of frame revert data
- `gas_limit` (UBIGINT; nullable) — Gas supplied to this frame
- `gas_left` (UBIGINT; nullable) — Gas left returned by EVMC for this frame
- `gas_used` (UBIGINT; nullable) — gas_limit - gas_left when both are valid
- `value` (UINT256; nullable) — Message value as an unsigned EVM integer.
- `calldata_selector` (BYTES4; nullable) — First four calldata bytes when present.

### Status and disposition

Outcome vocabulary and NULL-controlling disposition fields.

- `success` (BOOLEAN; nullable) — Whether the frame returned EVMC_SUCCESS
- `frame_status` (VARCHAR; nullable) — Final disposition after applying all ancestor outcomes
- `evmc_status_code` (INTEGER; nullable) — Raw EVMC status code for this frame

### Effects

Attempted and final effect facts or aggregates.

- `committed_effect_count` (UBIGINT; nullable) — Effects propagated from this frame
- `reverted_effect_count` (UBIGINT; nullable) — Effects discarded by revert
- `discarded_effect_count` (UBIGINT; nullable) — Effects discarded by failure
- `poisoned_effect_count` (UBIGINT; nullable) — Effects discarded by poisoned execution

### Commitments

Hashes and roots authenticating specifications, facts, state, or results.

- `executed_code_hash` (BYTES32; nullable) — Keccak hash of the exact executed bytes

## Linked joins

- `execution_id` → [evm.executions](/docs/tables/evm-executions.md) (`execution_id`) — Contextual execution that exposes this public row.

## Related public objects

- [evm.executions](/docs/tables/evm-executions.md) — upstream

## Verified queries

### Confirm fixture coverage

Confirm that this object has rows owned by the stable seven-candidate public fixture.

```sql
SELECT 'evm.execution_frames'::VARCHAR AS object_name, CASE WHEN count(*) > 0 THEN 'PASS' ELSE 'FAIL' END::VARCHAR AS status FROM evm."execution_frames" o JOIN evm.executions e USING (execution_id) WHERE e.candidate_key IN ('complete-effects', 'later-revert', 'ordered-logs', 'create', 'selfdestruct', 'blockhash', 'transient-access');
```

### Check candidate ownership

Diagnose whether this object remains linked to at least one stable fixture candidate through public keys.

```sql
SELECT 'evm.execution_frames'::VARCHAR AS object_name, CASE WHEN count(DISTINCT e.candidate_key) > 0 THEN 'PASS' ELSE 'FAIL' END::VARCHAR AS status FROM evm."execution_frames" o JOIN evm.executions e USING (execution_id) WHERE e.candidate_key IN ('complete-effects', 'later-revert', 'ordered-logs', 'create', 'selfdestruct', 'blockhash', 'transient-access');
```
