EVM execution types¶
The per-transaction environment, the transaction validity and frame-result records, and the per-frame call Message. Pure data — no registers, no externs.
type TxEnvFields¶
The per-transaction environment: ORIGIN/GASPRICE (YP I_o, I_p)
plus the EIP-4844 blob versioned hashes the BLOBHASH opcode reads.
struct TxEnvFields('blob_limit : Int), transaction_blob_limit_value('blob_limit) = {
origin : address,
gas_price : word,
blob_hashes : BlobHashesFields('blob_limit),
}The source-backed EIP-4844 versioned blob hashes of a transaction. The
limit index records which fork-selected transaction range admitted the
observed count. It is carried by the enclosing transaction rather than
hidden in a nested existential, so consumers retain count <= limit.
struct BlobHashesFields('limit : Int), transaction_blob_limit_value('limit) = {
bytes : StatelessInputSlice,
count : transaction_blob_count('limit),
}A 20-byte account address (YP §4.1), in canonical protocol byte order.
type address = vector(20, inc, byte)The fork-selected maximum number of blobs carried by one transaction. Zero denotes a profile before blob transactions activate.
type transaction_blob_limit_value('value : Int) -> Bool =
'value == blob_schedule_inactive_count
| 'value == cancun_blob_max_count
| 'value == prague_blob_max_countThe EVM 256-bit machine word (YP §9.1). A transparent range keeps the mathematical subtype relation visible: narrower non-negative ranges can be passed as words without a model-level conversion.
type word = range(0, 2 ^ 256 - 1)type TxEnv¶
A transaction environment packing its fork-selected blob-count limit existentially.
type TxEnv = {
'blob_limit,
transaction_blob_limit_value('blob_limit).
TxEnvFields('blob_limit)
}The per-transaction environment: ORIGIN/GASPRICE (YP I_o, I_p)
plus the EIP-4844 blob versioned hashes the BLOBHASH opcode reads.
struct TxEnvFields('blob_limit : Int), transaction_blob_limit_value('blob_limit) = {
origin : address,
gas_price : word,
blob_hashes : BlobHashesFields('blob_limit),
}The fork-selected maximum number of blobs carried by one transaction. Zero denotes a profile before blob transactions activate.
type transaction_blob_limit_value('value : Int) -> Bool =
'value == blob_schedule_inactive_count
| 'value == cancun_blob_max_count
| 'value == prague_blob_max_countfunction tx_env¶
function tx_env(origin, gas_price, blob_hashes) =
struct { origin = origin, gas_price = gas_price, blob_hashes = blob_hashes }function tx_env(origin, gas_price, blob_hashes) =
struct { origin = origin, gas_price = gas_price, blob_hashes = blob_hashes }type TransactionGasAllowanceFields¶
The header/profile-bounded gas allowance attached to one decoded transaction before stateful validation. The total allowance funds both gas dimensions; the regular allowance is the portion available to ordinary EVM execution.
struct TransactionGasAllowanceFields(
'total : Int,
'regular : Int,
), 0 <= 'regular & 'regular <= 'total & 'total <= block_gas_limit_bound = {
total : int('total),
regular : int('regular),
}The maximum block gas limit admitted by the execution-payload SSZ
uint64 field. Provenance: consensus ExecutionPayload.gas_limit and
Amsterdam SszExecutionPayload.gas_limit.
type block_gas_limit_bound : Int = ssz_uint_boundtype TransactionGasAllowance¶
A transaction gas allowance with existentially hidden total and regular budgets.
type TransactionGasAllowance = {
'total 'regular,
0 <= 'regular & 'regular <= 'total & 'total <= block_gas_limit_bound.
TransactionGasAllowanceFields('total, 'regular)
}The header/profile-bounded gas allowance attached to one decoded transaction before stateful validation. The total allowance funds both gas dimensions; the regular allowance is the portion available to ordinary EVM execution.
struct TransactionGasAllowanceFields(
'total : Int,
'regular : Int,
), 0 <= 'regular & 'regular <= 'total & 'total <= block_gas_limit_bound = {
total : int('total),
regular : int('regular),
}The maximum block gas limit admitted by the execution-payload SSZ
uint64 field. Provenance: consensus ExecutionPayload.gas_limit and
Amsterdam SszExecutionPayload.gas_limit.
type block_gas_limit_bound : Int = ssz_uint_boundtype transaction_initial_gas_relation¶
The post-intrinsic gas state admitted for a transaction. Keeping the admitted limit, the regular-gas ceiling, both intrinsic charges, and the two live reservoirs in one dependent value preserves the conservation equation established by transaction validation.
type transaction_initial_gas_relation(
'total : Int,
'regular : Int,
'intrinsic_execution : Int,
'intrinsic_state : Int,
'calldata_floor : Int,
'execution : Int,
'state : Int,
) -> Bool =
0 <= 'intrinsic_execution
& 0 <= 'intrinsic_state
& 0 <= 'calldata_floor
& 'intrinsic_execution <= 'regular
& 'calldata_floor <= 'regular
& 'regular <= 'total
& 'total <= block_gas_limit_bound
& 0 <= 'execution
& 0 <= 'state
& 'execution + 'state + 'intrinsic_execution + 'intrinsic_state == 'total
& 'execution <= 'regular - 'intrinsic_executionThe maximum block gas limit admitted by the execution-payload SSZ
uint64 field. Provenance: consensus ExecutionPayload.gas_limit and
Amsterdam SszExecutionPayload.gas_limit.
type block_gas_limit_bound : Int = ssz_uint_boundtype TransactionInitialGasFields¶
The concrete post-intrinsic gas record whose indices retain the transaction conservation relation.
struct TransactionInitialGasFields(
'total : Int,
'regular : Int,
'intrinsic_execution : Int,
'intrinsic_state : Int,
'calldata_floor : Int,
'execution : Int,
'state : Int,
), transaction_initial_gas_relation(
'total,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
) = {
admitted_limit : int('total),
regular_limit : int('regular),
intrinsic_execution : int('intrinsic_execution),
intrinsic_state : int('intrinsic_state),
calldata_floor : int('calldata_floor),
execution_remaining : int('execution),
state_remaining : int('state),
}The post-intrinsic gas state admitted for a transaction. Keeping the admitted limit, the regular-gas ceiling, both intrinsic charges, and the two live reservoirs in one dependent value preserves the conservation equation established by transaction validation.
type transaction_initial_gas_relation(
'total : Int,
'regular : Int,
'intrinsic_execution : Int,
'intrinsic_state : Int,
'calldata_floor : Int,
'execution : Int,
'state : Int,
) -> Bool =
0 <= 'intrinsic_execution
& 0 <= 'intrinsic_state
& 0 <= 'calldata_floor
& 'intrinsic_execution <= 'regular
& 'calldata_floor <= 'regular
& 'regular <= 'total
& 'total <= block_gas_limit_bound
& 0 <= 'execution
& 0 <= 'state
& 'execution + 'state + 'intrinsic_execution + 'intrinsic_state == 'total
& 'execution <= 'regular - 'intrinsic_executiontype TransactionInitialGas¶
The initial gas state with every conserved quantity hidden existentially.
type TransactionInitialGas = {
'total
'regular
'intrinsic_execution
'intrinsic_state
'calldata_floor
'execution
'state,
transaction_initial_gas_relation(
'total,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
).
TransactionInitialGasFields(
'total,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
)
}The concrete post-intrinsic gas record whose indices retain the transaction conservation relation.
struct TransactionInitialGasFields(
'total : Int,
'regular : Int,
'intrinsic_execution : Int,
'intrinsic_state : Int,
'calldata_floor : Int,
'execution : Int,
'state : Int,
), transaction_initial_gas_relation(
'total,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
) = {
admitted_limit : int('total),
regular_limit : int('regular),
intrinsic_execution : int('intrinsic_execution),
intrinsic_state : int('intrinsic_state),
calldata_floor : int('calldata_floor),
execution_remaining : int('execution),
state_remaining : int('state),
}The post-intrinsic gas state admitted for a transaction. Keeping the admitted limit, the regular-gas ceiling, both intrinsic charges, and the two live reservoirs in one dependent value preserves the conservation equation established by transaction validation.
type transaction_initial_gas_relation(
'total : Int,
'regular : Int,
'intrinsic_execution : Int,
'intrinsic_state : Int,
'calldata_floor : Int,
'execution : Int,
'state : Int,
) -> Bool =
0 <= 'intrinsic_execution
& 0 <= 'intrinsic_state
& 0 <= 'calldata_floor
& 'intrinsic_execution <= 'regular
& 'calldata_floor <= 'regular
& 'regular <= 'total
& 'total <= block_gas_limit_bound
& 0 <= 'execution
& 0 <= 'state
& 'execution + 'state + 'intrinsic_execution + 'intrinsic_state == 'total
& 'execution <= 'regular - 'intrinsic_executiontype TransactionInitialGasFor¶
The initial gas state for one concrete admitted transaction limit. This view hides the internal split while retaining the limit that the block transaction loop has already checked against its remaining budgets.
type TransactionInitialGasFor('total : Int) = {
'regular
'intrinsic_execution
'intrinsic_state
'calldata_floor
'execution
'state,
transaction_initial_gas_relation(
'total,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
).
TransactionInitialGasFields(
'total,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
)
}The concrete post-intrinsic gas record whose indices retain the transaction conservation relation.
struct TransactionInitialGasFields(
'total : Int,
'regular : Int,
'intrinsic_execution : Int,
'intrinsic_state : Int,
'calldata_floor : Int,
'execution : Int,
'state : Int,
), transaction_initial_gas_relation(
'total,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
) = {
admitted_limit : int('total),
regular_limit : int('regular),
intrinsic_execution : int('intrinsic_execution),
intrinsic_state : int('intrinsic_state),
calldata_floor : int('calldata_floor),
execution_remaining : int('execution),
state_remaining : int('state),
}The post-intrinsic gas state admitted for a transaction. Keeping the admitted limit, the regular-gas ceiling, both intrinsic charges, and the two live reservoirs in one dependent value preserves the conservation equation established by transaction validation.
type transaction_initial_gas_relation(
'total : Int,
'regular : Int,
'intrinsic_execution : Int,
'intrinsic_state : Int,
'calldata_floor : Int,
'execution : Int,
'state : Int,
) -> Bool =
0 <= 'intrinsic_execution
& 0 <= 'intrinsic_state
& 0 <= 'calldata_floor
& 'intrinsic_execution <= 'regular
& 'calldata_floor <= 'regular
& 'regular <= 'total
& 'total <= block_gas_limit_bound
& 0 <= 'execution
& 0 <= 'state
& 'execution + 'state + 'intrinsic_execution + 'intrinsic_state == 'total
& 'execution <= 'regular - 'intrinsic_executiontype TransactionInitialGasForLimits¶
The initial gas state retaining both the complete and regular execution allowances checked by the block loop.
type TransactionInitialGasForLimits(
'total : Int,
'regular : Int,
) = {
'intrinsic_execution
'intrinsic_state
'calldata_floor
'execution
'state,
transaction_initial_gas_relation(
'total,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
).
TransactionInitialGasFields(
'total,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
)
}The concrete post-intrinsic gas record whose indices retain the transaction conservation relation.
struct TransactionInitialGasFields(
'total : Int,
'regular : Int,
'intrinsic_execution : Int,
'intrinsic_state : Int,
'calldata_floor : Int,
'execution : Int,
'state : Int,
), transaction_initial_gas_relation(
'total,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
) = {
admitted_limit : int('total),
regular_limit : int('regular),
intrinsic_execution : int('intrinsic_execution),
intrinsic_state : int('intrinsic_state),
calldata_floor : int('calldata_floor),
execution_remaining : int('execution),
state_remaining : int('state),
}The post-intrinsic gas state admitted for a transaction. Keeping the admitted limit, the regular-gas ceiling, both intrinsic charges, and the two live reservoirs in one dependent value preserves the conservation equation established by transaction validation.
type transaction_initial_gas_relation(
'total : Int,
'regular : Int,
'intrinsic_execution : Int,
'intrinsic_state : Int,
'calldata_floor : Int,
'execution : Int,
'state : Int,
) -> Bool =
0 <= 'intrinsic_execution
& 0 <= 'intrinsic_state
& 0 <= 'calldata_floor
& 'intrinsic_execution <= 'regular
& 'calldata_floor <= 'regular
& 'regular <= 'total
& 'total <= block_gas_limit_bound
& 0 <= 'execution
& 0 <= 'state
& 'execution + 'state + 'intrinsic_execution + 'intrinsic_state == 'total
& 'execution <= 'regular - 'intrinsic_executionfunction transaction_initial_gas_fields¶
function transaction_initial_gas_fields(
total,
regular,
intrinsic_execution,
intrinsic_state,
calldata_floor,
execution,
state,
) =
struct {
admitted_limit = total,
regular_limit = regular,
intrinsic_execution = intrinsic_execution,
intrinsic_state = intrinsic_state,
calldata_floor = calldata_floor,
execution_remaining = execution,
state_remaining = state,
}function transaction_initial_gas_fields(
total,
regular,
intrinsic_execution,
intrinsic_state,
calldata_floor,
execution,
state,
) =
struct {
admitted_limit = total,
regular_limit = regular,
intrinsic_execution = intrinsic_execution,
intrinsic_state = intrinsic_state,
calldata_floor = calldata_floor,
execution_remaining = execution,
state_remaining = state,
}type TxValidityFields¶
The values established by successful up-front transaction validation (YP §6.2): sender, pre-state nonce, intrinsic gas, blob fee, and the EIP-1559 effective gas and priority prices. Invalid transactions terminate before this value is constructed.
struct TxValidityFields(
'limit : Int,
'regular : Int,
'intrinsic_execution : Int,
'intrinsic_state : Int,
'calldata_floor : Int,
'execution : Int,
'state : Int,
), transaction_initial_gas_relation(
'limit,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
) = {
sender : address,
nonce_before : account_nonce,
gas : TransactionInitialGasFields(
'limit,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
),
blob_fee : word,
/* effective gas price (EIP-1559, from the caps + base fee) */
gas_price : word,
/* coinbase tip per gas (effective price minus base fee) */
priority_fee : word,
}The concrete post-intrinsic gas record whose indices retain the transaction conservation relation.
struct TransactionInitialGasFields(
'total : Int,
'regular : Int,
'intrinsic_execution : Int,
'intrinsic_state : Int,
'calldata_floor : Int,
'execution : Int,
'state : Int,
), transaction_initial_gas_relation(
'total,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
) = {
admitted_limit : int('total),
regular_limit : int('regular),
intrinsic_execution : int('intrinsic_execution),
intrinsic_state : int('intrinsic_state),
calldata_floor : int('calldata_floor),
execution_remaining : int('execution),
state_remaining : int('state),
}An account transaction-count nonce (EIP-2681).
type account_nonce = range(0, account_nonce_bound)A 20-byte account address (YP §4.1), in canonical protocol byte order.
type address = vector(20, inc, byte)Available gas in a running EVM frame. Every admitted transaction gas
limit originates in the execution payload's SSZ uint64 gas-limit
domain, and child frames can only receive gas from their parent.
type gas = range(0, 2 ^ 64 - 1)The post-intrinsic gas state admitted for a transaction. Keeping the admitted limit, the regular-gas ceiling, both intrinsic charges, and the two live reservoirs in one dependent value preserves the conservation equation established by transaction validation.
type transaction_initial_gas_relation(
'total : Int,
'regular : Int,
'intrinsic_execution : Int,
'intrinsic_state : Int,
'calldata_floor : Int,
'execution : Int,
'state : Int,
) -> Bool =
0 <= 'intrinsic_execution
& 0 <= 'intrinsic_state
& 0 <= 'calldata_floor
& 'intrinsic_execution <= 'regular
& 'calldata_floor <= 'regular
& 'regular <= 'total
& 'total <= block_gas_limit_bound
& 0 <= 'execution
& 0 <= 'state
& 'execution + 'state + 'intrinsic_execution + 'intrinsic_state == 'total
& 'execution <= 'regular - 'intrinsic_executionThe EVM 256-bit machine word (YP §9.1). A transparent range keeps the mathematical subtype relation visible: narrower non-negative ranges can be passed as words without a model-level conversion.
type word = range(0, 2 ^ 256 - 1)function tx_validity_fields¶
function tx_validity_fields(sender, nonce_before, gas, blob_fee, gas_price, priority_fee) =
struct {
sender = sender,
nonce_before = nonce_before,
gas = gas,
blob_fee = blob_fee,
gas_price = gas_price,
priority_fee = priority_fee,
}function tx_validity_fields(sender, nonce_before, gas, blob_fee, gas_price, priority_fee) =
struct {
sender = sender,
nonce_before = nonce_before,
gas = gas,
blob_fee = blob_fee,
gas_price = gas_price,
priority_fee = priority_fee,
}Available gas in a running EVM frame. Every admitted transaction gas
limit originates in the execution payload's SSZ uint64 gas-limit
domain, and child frames can only receive gas from their parent.
type gas = range(0, 2 ^ 64 - 1)type TxValidityForLimits¶
A validity result retaining the transaction's admitted total and regular gas limits while hiding the internal initial split.
type TxValidityForLimits(
'limit : Int,
'regular : Int,
) = {
'intrinsic_execution
'intrinsic_state
'calldata_floor
'execution
'state,
transaction_initial_gas_relation(
'limit,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
).
TxValidityFields(
'limit,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
)
}The values established by successful up-front transaction validation (YP §6.2): sender, pre-state nonce, intrinsic gas, blob fee, and the EIP-1559 effective gas and priority prices. Invalid transactions terminate before this value is constructed.
struct TxValidityFields(
'limit : Int,
'regular : Int,
'intrinsic_execution : Int,
'intrinsic_state : Int,
'calldata_floor : Int,
'execution : Int,
'state : Int,
), transaction_initial_gas_relation(
'limit,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
) = {
sender : address,
nonce_before : account_nonce,
gas : TransactionInitialGasFields(
'limit,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
),
blob_fee : word,
/* effective gas price (EIP-1559, from the caps + base fee) */
gas_price : word,
/* coinbase tip per gas (effective price minus base fee) */
priority_fee : word,
}The post-intrinsic gas state admitted for a transaction. Keeping the admitted limit, the regular-gas ceiling, both intrinsic charges, and the two live reservoirs in one dependent value preserves the conservation equation established by transaction validation.
type transaction_initial_gas_relation(
'total : Int,
'regular : Int,
'intrinsic_execution : Int,
'intrinsic_state : Int,
'calldata_floor : Int,
'execution : Int,
'state : Int,
) -> Bool =
0 <= 'intrinsic_execution
& 0 <= 'intrinsic_state
& 0 <= 'calldata_floor
& 'intrinsic_execution <= 'regular
& 'calldata_floor <= 'regular
& 'regular <= 'total
& 'total <= block_gas_limit_bound
& 0 <= 'execution
& 0 <= 'state
& 'execution + 'state + 'intrinsic_execution + 'intrinsic_state == 'total
& 'execution <= 'regular - 'intrinsic_executiontype TxValidity¶
A validity result whose limit is not needed by the consumer.
type TxValidity = {
'limit
'regular
'intrinsic_execution
'intrinsic_state
'calldata_floor
'execution
'state,
transaction_initial_gas_relation(
'limit,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
).
TxValidityFields(
'limit,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
)
}The values established by successful up-front transaction validation (YP §6.2): sender, pre-state nonce, intrinsic gas, blob fee, and the EIP-1559 effective gas and priority prices. Invalid transactions terminate before this value is constructed.
struct TxValidityFields(
'limit : Int,
'regular : Int,
'intrinsic_execution : Int,
'intrinsic_state : Int,
'calldata_floor : Int,
'execution : Int,
'state : Int,
), transaction_initial_gas_relation(
'limit,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
) = {
sender : address,
nonce_before : account_nonce,
gas : TransactionInitialGasFields(
'limit,
'regular,
'intrinsic_execution,
'intrinsic_state,
'calldata_floor,
'execution,
'state,
),
blob_fee : word,
/* effective gas price (EIP-1559, from the caps + base fee) */
gas_price : word,
/* coinbase tip per gas (effective price minus base fee) */
priority_fee : word,
}The post-intrinsic gas state admitted for a transaction. Keeping the admitted limit, the regular-gas ceiling, both intrinsic charges, and the two live reservoirs in one dependent value preserves the conservation equation established by transaction validation.
type transaction_initial_gas_relation(
'total : Int,
'regular : Int,
'intrinsic_execution : Int,
'intrinsic_state : Int,
'calldata_floor : Int,
'execution : Int,
'state : Int,
) -> Bool =
0 <= 'intrinsic_execution
& 0 <= 'intrinsic_state
& 0 <= 'calldata_floor
& 'intrinsic_execution <= 'regular
& 'calldata_floor <= 'regular
& 'regular <= 'total
& 'total <= block_gas_limit_bound
& 0 <= 'execution
& 0 <= 'state
& 'execution + 'state + 'intrinsic_execution + 'intrinsic_state == 'total
& 'execution <= 'regular - 'intrinsic_executiontype tx_frame_gas_snapshot_relation¶
The transaction gas conserved at the top-level frame boundary. The snapshot retains both admitted budgets and the exact split consumed by ordinary execution and state access. Settlement can therefore apply refunds and the calldata floor without reconstructing or revalidating either contribution.
type tx_frame_gas_snapshot_relation(
'limit : Int,
'regular : Int,
'calldata_floor : Int,
'remaining : Int,
'state_used : Int,
) -> Bool =
0 <= 'regular
& 'regular <= 'limit
& 'limit <= block_gas_limit_bound
& 0 <= 'calldata_floor
& 'calldata_floor <= 'regular
& 0 <= 'remaining
& 0 <= 'state_used
& 'state_used <= 'limit
& 'remaining + 'state_used <= 'limit
& 'limit - 'remaining - 'state_used <= 'regularThe maximum block gas limit admitted by the execution-payload SSZ
uint64 field. Provenance: consensus ExecutionPayload.gas_limit and
Amsterdam SszExecutionPayload.gas_limit.
type block_gas_limit_bound : Int = ssz_uint_boundtype TxFrameGasSnapshotFields¶
The concrete top-level frame gas snapshot whose indices retain the transaction admission and conservation proof.
struct TxFrameGasSnapshotFields(
'limit : Int,
'regular : Int,
'calldata_floor : Int,
'remaining : Int,
'state_used : Int,
), tx_frame_gas_snapshot_relation(
'limit,
'regular,
'calldata_floor,
'remaining,
'state_used,
) = {
admitted_limit : int('limit),
regular_limit : int('regular),
calldata_floor : int('calldata_floor),
remaining : int('remaining),
state_used : int('state_used),
}The transaction gas conserved at the top-level frame boundary. The snapshot retains both admitted budgets and the exact split consumed by ordinary execution and state access. Settlement can therefore apply refunds and the calldata floor without reconstructing or revalidating either contribution.
type tx_frame_gas_snapshot_relation(
'limit : Int,
'regular : Int,
'calldata_floor : Int,
'remaining : Int,
'state_used : Int,
) -> Bool =
0 <= 'regular
& 'regular <= 'limit
& 'limit <= block_gas_limit_bound
& 0 <= 'calldata_floor
& 'calldata_floor <= 'regular
& 0 <= 'remaining
& 0 <= 'state_used
& 'state_used <= 'limit
& 'remaining + 'state_used <= 'limit
& 'limit - 'remaining - 'state_used <= 'regularfunction tx_frame_gas_snapshot_fields¶
function tx_frame_gas_snapshot_fields(limit, regular, calldata_floor, remaining, state_used) =
struct {
admitted_limit = limit,
regular_limit = regular,
calldata_floor = calldata_floor,
remaining = remaining,
state_used = state_used,
}function tx_frame_gas_snapshot_fields(limit, regular, calldata_floor, remaining, state_used) =
struct {
admitted_limit = limit,
regular_limit = regular,
calldata_floor = calldata_floor,
remaining = remaining,
state_used = state_used,
}type TxFrameGasSnapshot¶
A top-level frame gas snapshot with existentially hidden gas totals.
type TxFrameGasSnapshot = {
'limit 'regular 'calldata_floor 'remaining 'state_used,
tx_frame_gas_snapshot_relation(
'limit,
'regular,
'calldata_floor,
'remaining,
'state_used,
).
TxFrameGasSnapshotFields(
'limit,
'regular,
'calldata_floor,
'remaining,
'state_used,
)
}The concrete top-level frame gas snapshot whose indices retain the transaction admission and conservation proof.
struct TxFrameGasSnapshotFields(
'limit : Int,
'regular : Int,
'calldata_floor : Int,
'remaining : Int,
'state_used : Int,
), tx_frame_gas_snapshot_relation(
'limit,
'regular,
'calldata_floor,
'remaining,
'state_used,
) = {
admitted_limit : int('limit),
regular_limit : int('regular),
calldata_floor : int('calldata_floor),
remaining : int('remaining),
state_used : int('state_used),
}The transaction gas conserved at the top-level frame boundary. The snapshot retains both admitted budgets and the exact split consumed by ordinary execution and state access. Settlement can therefore apply refunds and the calldata floor without reconstructing or revalidating either contribution.
type tx_frame_gas_snapshot_relation(
'limit : Int,
'regular : Int,
'calldata_floor : Int,
'remaining : Int,
'state_used : Int,
) -> Bool =
0 <= 'regular
& 'regular <= 'limit
& 'limit <= block_gas_limit_bound
& 0 <= 'calldata_floor
& 'calldata_floor <= 'regular
& 0 <= 'remaining
& 0 <= 'state_used
& 'state_used <= 'limit
& 'remaining + 'state_used <= 'limit
& 'limit - 'remaining - 'state_used <= 'regulartype TxFrameGasSnapshotForLimits¶
A completed top-level frame tied to both admitted transaction limits.
type TxFrameGasSnapshotForLimits(
'limit : Int,
'regular : Int,
) = {
'calldata_floor 'remaining 'state_used,
tx_frame_gas_snapshot_relation(
'limit,
'regular,
'calldata_floor,
'remaining,
'state_used,
).
TxFrameGasSnapshotFields(
'limit,
'regular,
'calldata_floor,
'remaining,
'state_used,
)
}The concrete top-level frame gas snapshot whose indices retain the transaction admission and conservation proof.
struct TxFrameGasSnapshotFields(
'limit : Int,
'regular : Int,
'calldata_floor : Int,
'remaining : Int,
'state_used : Int,
), tx_frame_gas_snapshot_relation(
'limit,
'regular,
'calldata_floor,
'remaining,
'state_used,
) = {
admitted_limit : int('limit),
regular_limit : int('regular),
calldata_floor : int('calldata_floor),
remaining : int('remaining),
state_used : int('state_used),
}The transaction gas conserved at the top-level frame boundary. The snapshot retains both admitted budgets and the exact split consumed by ordinary execution and state access. Settlement can therefore apply refunds and the calldata floor without reconstructing or revalidating either contribution.
type tx_frame_gas_snapshot_relation(
'limit : Int,
'regular : Int,
'calldata_floor : Int,
'remaining : Int,
'state_used : Int,
) -> Bool =
0 <= 'regular
& 'regular <= 'limit
& 'limit <= block_gas_limit_bound
& 0 <= 'calldata_floor
& 'calldata_floor <= 'regular
& 0 <= 'remaining
& 0 <= 'state_used
& 'state_used <= 'limit
& 'remaining + 'state_used <= 'limit
& 'limit - 'remaining - 'state_used <= 'regulartype TxFrameResultFields¶
The result of a transaction's top-level frame: success, the bounded gas snapshot consumed by settlement, and refunds.
struct TxFrameResultFields(
'limit : Int,
'regular : Int,
), 0 <= 'regular & 'regular <= 'limit & 'limit <= block_gas_limit_bound = {
success : bool,
gas : TxFrameGasSnapshotForLimits('limit, 'regular),
refund : gas_refund,
}A completed top-level frame tied to both admitted transaction limits.
type TxFrameGasSnapshotForLimits(
'limit : Int,
'regular : Int,
) = {
'calldata_floor 'remaining 'state_used,
tx_frame_gas_snapshot_relation(
'limit,
'regular,
'calldata_floor,
'remaining,
'state_used,
).
TxFrameGasSnapshotFields(
'limit,
'regular,
'calldata_floor,
'remaining,
'state_used,
)
}The maximum block gas limit admitted by the execution-payload SSZ
uint64 field. Provenance: consensus ExecutionPayload.gas_limit and
Amsterdam SszExecutionPayload.gas_limit.
type block_gas_limit_bound : Int = ssz_uint_boundAvailable gas in a running EVM frame. Every admitted transaction gas
limit originates in the execution payload's SSZ uint64 gas-limit
domain, and child frames can only receive gas from their parent.
type gas = range(0, 2 ^ 64 - 1)The signed transaction refund accumulator before capping.
type gas_refund = range(
-gas_refund_bound,
gas_refund_bound,
)type TxFrameResult¶
A completed top-level frame with existentially hidden admitted limits.
type TxFrameResult = {
'limit 'regular,
0 <= 'regular & 'regular <= 'limit & 'limit <= block_gas_limit_bound.
TxFrameResultFields('limit, 'regular)
}The result of a transaction's top-level frame: success, the bounded gas snapshot consumed by settlement, and refunds.
struct TxFrameResultFields(
'limit : Int,
'regular : Int,
), 0 <= 'regular & 'regular <= 'limit & 'limit <= block_gas_limit_bound = {
success : bool,
gas : TxFrameGasSnapshotForLimits('limit, 'regular),
refund : gas_refund,
}The maximum block gas limit admitted by the execution-payload SSZ
uint64 field. Provenance: consensus ExecutionPayload.gas_limit and
Amsterdam SszExecutionPayload.gas_limit.
type block_gas_limit_bound : Int = ssz_uint_boundtype CallKind¶
The four CALL-family execution modes. Call is an ordinary call;
CallCode combines the caller's storage with the target's code;
DelegateCall additionally inherits the caller and value; and
StaticCall enters a read-only frame.
enum CallKind = { Call, CallCode, DelegateCall, StaticCall }type CreateKind¶
The two contract-creation address schemes. CreateByNonce is ordinary
CREATE; CreateBySalt is EIP-1014 CREATE2. Keeping this as a closed
semantic tag prevents callers from encoding an execution mode in an
otherwise unexplained boolean.
enum CreateKind = { CreateByNonce, CreateBySalt }type Message¶
The per-frame call message (YP §8, the I tuple): caller, executing address, code owner, value, calldata length, static flag, and call depth.
struct Message = {
/* CALLER (I_s) */
caller : address,
/* account whose code runs (differs under DELEGATECALL/CALLCODE and
EIP-7702 delegation) */
code_address : address,
/* ADDRESS / storage owner = self (I_a) */
address : address,
/* CALLVALUE (I_v) */
value : word,
/* State-gas reservoir available when the frame was entered. */
state_gas_reservoir : state_gas,
/* inside a STATICCALL frame (EIP-214) */
is_static : bool,
/* call depth (YP I_e), bounded by call_depth_limit */
depth : frame_depth,
}A 20-byte account address (YP §4.1), in canonical protocol byte order.
type address = vector(20, inc, byte)The nesting depth of an execution frame.
type frame_depth = range(0, call_depth_limit)Amsterdam's per-frame state-gas reservoir. The transaction's total gas
allowance remains in the execution payload's uint64 domain; only the
regular-gas portion and state-gas spill into that portion are capped by
EIP-7825.
type state_gas = range(0, 2 ^ 64 - 1)The EVM 256-bit machine word (YP §9.1). A transparent range keeps the mathematical subtype relation visible: narrower non-negative ranges can be passed as words without a model-level conversion.
type word = range(0, 2 ^ 256 - 1)type FrameTransition¶
The complete carried state installed after entering or resuming a frame. Named fields replace the former positional 19-tuple at this cold semantic boundary; the optimized interpreter immediately unpacks the record into its hot scalar locals.
struct FrameTransition = {
pc : code_pointer,
gas_remaining : gas,
state_gas_remaining : state_gas,
state_gas_spilled : state_gas_spill,
refund : gas_refund,
status : FrameStatus,
stack_top : StackPointer,
memory_base : memory_base,
memory_height : memory_height,
message : Message,
code : Code,
calldata : CalldataSlice,
returndata : OutputSlice,
}Calldata is either the immutable top-level transaction input or a frozen range of the suspended caller's memory. The variants state the only two protocol-valid provenances instead of exposing the host's region enum.
union CalldataSlice = {
/* the immutable top-level transaction input */
InputCalldata : StatelessInputSlice,
/* a frozen range of the suspended caller's memory */
MemoryCalldata : EvmMemorySlice,
}Existential executable-code value whose concrete byte address and length
remain correlated inside CodeFields.
type Code = {
'off 'len,
code_region_valid_range('off, 'len) & code_valid_length('len).
CodeFields('off, 'len)
}Per-frame execution status: running, halted normally, or exceptionally halted.
union FrameStatus = {
/* mid-execution */
Running : unit,
/* halted normally (YP §9.4.4) */
Halted : HaltKind,
/* halted exceptionally: all frame gas consumed, effects void */
Exceptional : ExceptionKind
}The per-frame call message (YP §8, the I tuple): caller, executing address, code owner, value, calldata length, static flag, and call depth.
struct Message = {
/* CALLER (I_s) */
caller : address,
/* account whose code runs (differs under DELEGATECALL/CALLCODE and
EIP-7702 delegation) */
code_address : address,
/* ADDRESS / storage owner = self (I_a) */
address : address,
/* CALLVALUE (I_v) */
value : word,
/* State-gas reservoir available when the frame was entered. */
state_gas_reservoir : state_gas,
/* inside a STATICCALL frame (EIP-214) */
is_static : bool,
/* call depth (YP I_e), bounded by call_depth_limit */
depth : frame_depth,
}A frame-output range with its coordinate and length packed existentially.
type OutputSlice = {
'off 'len,
output_region_valid_range('off, 'len).
OutputSliceFields('off, 'len)
}The operand-stack cursor for the active frame, threaded by value through
the interpreter in the state-passing convention and held in the
stack_top frame register at frame boundaries. storage is an opaque
host coordinate while height is the semantic stack height. Keeping the
height in the cursor makes stack validation independent of the host stack
representation. Optimized C refines storage to a native u256 *.
struct StackPointer = {
storage : bits(64),
height : operand_stack_height,
}An absolute byte position in the code arena.
type code_pointer = range(0, code_region_bound)Available gas in a running EVM frame. Every admitted transaction gas
limit originates in the execution payload's SSZ uint64 gas-limit
domain, and child frames can only receive gas from their parent.
type gas = range(0, 2 ^ 64 - 1)The signed transaction refund accumulator before capping.
type gas_refund = range(
-gas_refund_bound,
gas_refund_bound,
)An absolute byte position in the shared EVM-memory arena.
type memory_base = range(0, memory_region_bound)The active EVM frame's exact relative byte high-water mark. It is carried
beside the frame's absolute memory_base; the host retains no hidden
frame coordinate or lifecycle state.
type memory_height = memory_lengthAmsterdam's per-frame state-gas reservoir. The transaction's total gas
allowance remains in the execution payload's uint64 domain; only the
regular-gas portion and state-gas spill into that portion are capped by
EIP-7825.
type state_gas = range(0, 2 ^ 64 - 1)Execution gas temporarily consumed by Amsterdam state charges. EIP-8037 draws spill only from the regular-gas pool, which is capped by EIP-7825.
type state_gas_spill = range(0, transaction_execution_gas_limit_value)type ExceptionalStateTransition¶
State installed when an executing frame enters an exceptional halt. Keeping the normalized Amsterdam state-gas values together prevents the transition from being represented as an anonymous positional tuple.
struct ExceptionalStateTransition = {
state_gas_remaining : state_gas,
state_gas_spilled : state_gas_spill,
status : FrameStatus,
}Per-frame execution status: running, halted normally, or exceptionally halted.
union FrameStatus = {
/* mid-execution */
Running : unit,
/* halted normally (YP §9.4.4) */
Halted : HaltKind,
/* halted exceptionally: all frame gas consumed, effects void */
Exceptional : ExceptionKind
}Amsterdam's per-frame state-gas reservoir. The transaction's total gas
allowance remains in the execution payload's uint64 domain; only the
regular-gas portion and state-gas spill into that portion are capped by
EIP-7825.
type state_gas = range(0, 2 ^ 64 - 1)Execution gas temporarily consumed by Amsterdam state charges. EIP-8037 draws spill only from the regular-gas pool, which is capped by EIP-7825.
type state_gas_spill = range(0, transaction_execution_gas_limit_value)type OpcodeOutcome¶
Lightweight result of one opcode handler.
union OpcodeOutcome = {
/*! Continue executing the active frame. */
Continue : unit,
/*! Stop the active opcode path with the given exceptional halt. */
Failed : ExceptionKind,
}Exceptional halts (YP §9.4.2): each consumes all remaining gas and reverts the frame's state changes.
enum ExceptionKind = {
/* an opcode pops more items than the stack holds */
StackUnderflow,
/* a push would exceed the 1024-item stack limit */
StackOverflow,
/* the operation's cost exceeds the remaining gas */
OutOfGas,
/* an unassigned or fork-inactive opcode, or INVALID (0xfe) */
InvalidOpcode,
/* a jump target that is not a valid JUMPDEST */
InvalidJump,
/* EIP-214: state-changing op inside a STATICCALL */
StaticViolation,
/* a call or create beyond depth 1024 */
CallDepthExceeded,
/* a value transfer exceeding the sender's balance */
InsufficientBalance,
/* EIP-214 write protection */
WriteProtection,
/* EIP-3860 */
InitCodeTooLarge,
/* a nonce at its maximum cannot be bumped (EIP-2681) */
NonceOverflow,
/* EIP-684: CREATE into an occupied account */
AddressCollision,
}type FrameCheckpoint¶
The suspended parent-frame state restored after nested execution.
struct FrameCheckpoint = {
pc : code_pointer,
gas_remaining : gas,
stack_top : StackPointer,
state_gas_remaining : state_gas,
state_gas_spilled : state_gas_spill,
refund : gas_refund,
status : FrameStatus,
message : Message,
code : Code,
calldata : CalldataSlice,
memory_height : memory_height,
}Calldata is either the immutable top-level transaction input or a frozen range of the suspended caller's memory. The variants state the only two protocol-valid provenances instead of exposing the host's region enum.
union CalldataSlice = {
/* the immutable top-level transaction input */
InputCalldata : StatelessInputSlice,
/* a frozen range of the suspended caller's memory */
MemoryCalldata : EvmMemorySlice,
}Existential executable-code value whose concrete byte address and length
remain correlated inside CodeFields.
type Code = {
'off 'len,
code_region_valid_range('off, 'len) & code_valid_length('len).
CodeFields('off, 'len)
}Per-frame execution status: running, halted normally, or exceptionally halted.
union FrameStatus = {
/* mid-execution */
Running : unit,
/* halted normally (YP §9.4.4) */
Halted : HaltKind,
/* halted exceptionally: all frame gas consumed, effects void */
Exceptional : ExceptionKind
}The per-frame call message (YP §8, the I tuple): caller, executing address, code owner, value, calldata length, static flag, and call depth.
struct Message = {
/* CALLER (I_s) */
caller : address,
/* account whose code runs (differs under DELEGATECALL/CALLCODE and
EIP-7702 delegation) */
code_address : address,
/* ADDRESS / storage owner = self (I_a) */
address : address,
/* CALLVALUE (I_v) */
value : word,
/* State-gas reservoir available when the frame was entered. */
state_gas_reservoir : state_gas,
/* inside a STATICCALL frame (EIP-214) */
is_static : bool,
/* call depth (YP I_e), bounded by call_depth_limit */
depth : frame_depth,
}The operand-stack cursor for the active frame, threaded by value through
the interpreter in the state-passing convention and held in the
stack_top frame register at frame boundaries. storage is an opaque
host coordinate while height is the semantic stack height. Keeping the
height in the cursor makes stack validation independent of the host stack
representation. Optimized C refines storage to a native u256 *.
struct StackPointer = {
storage : bits(64),
height : operand_stack_height,
}An absolute byte position in the code arena.
type code_pointer = range(0, code_region_bound)Available gas in a running EVM frame. Every admitted transaction gas
limit originates in the execution payload's SSZ uint64 gas-limit
domain, and child frames can only receive gas from their parent.
type gas = range(0, 2 ^ 64 - 1)The signed transaction refund accumulator before capping.
type gas_refund = range(
-gas_refund_bound,
gas_refund_bound,
)The active EVM frame's exact relative byte high-water mark. It is carried
beside the frame's absolute memory_base; the host retains no hidden
frame coordinate or lifecycle state.
type memory_height = memory_lengthAmsterdam's per-frame state-gas reservoir. The transaction's total gas
allowance remains in the execution payload's uint64 domain; only the
regular-gas portion and state-gas spill into that portion are capped by
EIP-7825.
type state_gas = range(0, 2 ^ 64 - 1)Execution gas temporarily consumed by Amsterdam state charges. EIP-8037 draws spill only from the regular-gas pool, which is capped by EIP-7825.
type state_gas_spill = range(0, transaction_execution_gas_limit_value)type CallContinuation¶
The suspended parent information needed after a message call returns.
struct CallContinuation = {
checkpoint : FrameCheckpoint,
return_offset : memory_base,
return_length : memory_length,
/* Amsterdam NEW_ACCOUNT state gas paid for the child target. */
new_account_charged : bool,
}The suspended parent-frame state restored after nested execution.
struct FrameCheckpoint = {
pc : code_pointer,
gas_remaining : gas,
stack_top : StackPointer,
state_gas_remaining : state_gas,
state_gas_spilled : state_gas_spill,
refund : gas_refund,
status : FrameStatus,
message : Message,
code : Code,
calldata : CalldataSlice,
memory_height : memory_height,
}An absolute byte position in the shared EVM-memory arena.
type memory_base = range(0, memory_region_bound)A materialized length or allocation size in the EVM-memory arena.
type memory_length = range(0, memory_region_bound)type CreateContinuation¶
The suspended parent information needed after initcode returns.
struct CreateContinuation = {
checkpoint : FrameCheckpoint,
address : address,
/* Amsterdam NEW_ACCOUNT state gas paid for the created address. */
new_account_charged : bool,
}The suspended parent-frame state restored after nested execution.
struct FrameCheckpoint = {
pc : code_pointer,
gas_remaining : gas,
stack_top : StackPointer,
state_gas_remaining : state_gas,
state_gas_spilled : state_gas_spill,
refund : gas_refund,
status : FrameStatus,
message : Message,
code : Code,
calldata : CalldataSlice,
memory_height : memory_height,
}A 20-byte account address (YP §4.1), in canonical protocol byte order.
type address = vector(20, inc, byte)type FrameContinuation¶
The pending action performed when a child frame finishes.
union FrameContinuation = {
/*! No suspended parent remains; the completed frame was top-level. */
Empty : unit,
/*! Resume a suspended message-call parent. */
ResumeCall : CallContinuation,
/*! Resume a suspended contract-creation parent. */
ResumeCreate : CreateContinuation
}The suspended parent information needed after a message call returns.
struct CallContinuation = {
checkpoint : FrameCheckpoint,
return_offset : memory_base,
return_length : memory_length,
/* Amsterdam NEW_ACCOUNT state gas paid for the child target. */
new_account_charged : bool,
}The suspended parent information needed after initcode returns.
struct CreateContinuation = {
checkpoint : FrameCheckpoint,
address : address,
/* Amsterdam NEW_ACCOUNT state gas paid for the created address. */
new_account_charged : bool,
}let DEFAULT_MESSAGE¶
The zero message; frame registers reset to it between transactions.
let DEFAULT_MESSAGE : Message = struct {
caller = ZERO_ADDRESS,
address = ZERO_ADDRESS,
code_address = ZERO_ADDRESS,
value = ZERO_WORD,
state_gas_reservoir = STATE_GAS_ZERO,
is_static = false,
depth = 0,
}let STATE_GAS_ZERO : int(0) = 0let ZERO_ADDRESS : address = address_from_bits(0x0000000000000000000000000000000000000000000000000000000000000000)let ZERO_WORD : word = word_from_bits(0x0000000000000000000000000000000000000000000000000000000000000000)The per-frame call message (YP §8, the I tuple): caller, executing address, code owner, value, calldata length, static flag, and call depth.
struct Message = {
/* CALLER (I_s) */
caller : address,
/* account whose code runs (differs under DELEGATECALL/CALLCODE and
EIP-7702 delegation) */
code_address : address,
/* ADDRESS / storage owner = self (I_a) */
address : address,
/* CALLVALUE (I_v) */
value : word,
/* State-gas reservoir available when the frame was entered. */
state_gas_reservoir : state_gas,
/* inside a STATICCALL frame (EIP-214) */
is_static : bool,
/* call depth (YP I_e), bounded by call_depth_limit */
depth : frame_depth,
}A 20-byte account address (YP §4.1), in canonical protocol byte order.
type address = vector(20, inc, byte)