Block types¶
Block-level data structures. BlockHeader is pure data;
its k_header register lives in the kernel environment alongside the
EIP-4895 withdrawal record.
type LogsBloom¶
The 2048-bit logs bloom filter (YP §4.4.1), as 256 bytes.
type LogsBloom = vector(256, dec, byte)An 8-bit byte.
type byte = bits(8)type LogsBloomRef¶
The payload header's 2048-bit logs bloom in canonical SSZ wire order. Keeping the authenticated input range by reference lets consumers that already operate on bytes avoid an eager 256-byte materialization.
type LogsBloomRef = StatelessInputSliceLength(256)A stateless-input range of exactly 'required bytes.
type StatelessInputSliceLength('required : Int) = {
'off 'len,
stateless_input_valid_range('off, 'len) & 'len == 'required.
StatelessInputSliceFields('off, 'len)
}let EMPTY_LOGS_BLOOM¶
let EMPTY_LOGS_BLOOM : LogsBloom = vector_init(256, 0x00)val vector_init = pure {lean: "vectorInit", _: "vector_init"}: forall ('n : Int) ('a : Type), 'n >= 0.
(implicit('n), 'a) -> vector('n, 'a)The 2048-bit logs bloom filter (YP §4.4.1), as 256 bytes.
type LogsBloom = vector(256, dec, byte)function logs_bloom_equal¶
Byte-wise bloom equality (the header logs_bloom check).
function logs_bloom_equal(a : LogsBloom, b : LogsBloom) -> bool = {
var equal : bool = true;
foreach (i from 0 to 255) {
equal = equal & (a[i] == b[i])
};
equal
}The 2048-bit logs bloom filter (YP §4.4.1), as 256 bytes.
type LogsBloom = vector(256, dec, byte)function logs_bloom_from_ref¶
Materializes a referenced wire-order bloom into the decreasing-index semantic vector used by the Yellow Paper equations.
function logs_bloom_from_ref(reference : LogsBloomRef) -> LogsBloom = {
var out : LogsBloom = EMPTY_LOGS_BLOOM;
foreach (i from 0 to 255) {
out[255 - i] = slice_byte(reference, i)
};
out
}let EMPTY_LOGS_BLOOM : LogsBloom = vector_init(256, 0x00)The 2048-bit logs bloom filter (YP §4.4.1), as 256 bytes.
type LogsBloom = vector(256, dec, byte)The payload header's 2048-bit logs bloom in canonical SSZ wire order. Keeping the authenticated input range by reference lets consumers that already operate on bytes avoid an eager 256-byte materialization.
type LogsBloomRef = StatelessInputSliceLength(256)function logs_bloom_matches_ref¶
Compares the computed block bloom with the payload-header commitment.
function logs_bloom_matches_ref(computed : LogsBloom, reference : LogsBloomRef) -> bool = {
let expected = logs_bloom_from_ref(reference);
logs_bloom_equal(computed, expected)
}Byte-wise bloom equality (the header logs_bloom check).
function logs_bloom_equal(a : LogsBloom, b : LogsBloom) -> bool = {
var equal : bool = true;
foreach (i from 0 to 255) {
equal = equal & (a[i] == b[i])
};
equal
}Materializes a referenced wire-order bloom into the decreasing-index semantic vector used by the Yellow Paper equations.
function logs_bloom_from_ref(reference : LogsBloomRef) -> LogsBloom = {
var out : LogsBloom = EMPTY_LOGS_BLOOM;
foreach (i from 0 to 255) {
out[255 - i] = slice_byte(reference, i)
};
out
}The 2048-bit logs bloom filter (YP §4.4.1), as 256 bytes.
type LogsBloom = vector(256, dec, byte)The payload header's 2048-bit logs bloom in canonical SSZ wire order. Keeping the authenticated input range by reference lets consumers that already operate on bytes avoid an eager 256-byte materialization.
type LogsBloomRef = StatelessInputSliceLength(256)type BlockHeader¶
The execution-payload header fields the model reads and validates
(YP §4.4). Scalar wire bounds come from the consensus/Amsterdam SSZ
ExecutionPayload schema. gas_used <= gas_limit and the active
blob-schedule rules are execution-protocol constraints checked when the
payload is admitted. extra_data retains the schema's
ByteList[MAX_EXTRA_DATA_BYTES] bound while staying source-backed; it is
RLP-encoded whole for the header hash and never inspected. The fixed
logs_bloom commitment likewise stays source-backed until a semantic
consumer explicitly decodes it.
struct BlockHeader = {
number : block_number,
timestamp : block_timestamp,
gas_limit : block_gas_limit,
gas_used : block_gas,
prev_randao : word,
base_fee : word,
/* EIP-4844: a multiple of GAS_PER_BLOB within the active schedule. */
blob_gas_used : blob_gas_used,
/* EIP-4844 uint64 on the wire; narrowed to the documented reachable-chain
invariant at the authenticated input boundary. */
excess_blob_gas : excess_blob_gas,
state_root : hash,
receipts_root : hash,
logs_bloom : LogsBloomRef,
fee_recipient : address,
parent_hash : hash,
parent_beacon_block_root : hash,
/* uint64 (EIP-7843 and the Amsterdam stateless SSZ schema). */
slot_number : slot_number,
extra_data : StatelessInputSliceAtMost(extra_data_length_bound),
}The payload header's 2048-bit logs bloom in canonical SSZ wire order. Keeping the authenticated input range by reference lets consumers that already operate on bytes avoid an eager 256-byte materialization.
type LogsBloomRef = StatelessInputSliceLength(256)A stateless-input range of at most 'maximum bytes.
type StatelessInputSliceAtMost('maximum : Int) = {
'off 'len,
stateless_input_valid_range('off, 'len) & 0 <= 'maximum & 'len <= 'maximum.
StatelessInputSliceFields('off, 'len)
}A 20-byte account address (YP §4.1), in canonical protocol byte order.
type address = vector(20, inc, byte)Blob gas used by one supported block. The existential count retains that
every value is exactly a multiple of GAS_PER_BLOB; profile-indexed
decoding applies the selected schedule's tighter range before values enter
this heterogeneous header domain.
type blob_gas_used = {
'count,
0 <= 'count
& 'count <= bpo2_blob_max_count.
int(gas_per_blob_value * 'count)
}Gas consumed by a block header. Provenance: the execution-payload SSZ
schema declares gas_used: uint64. The separate payload-validity rule
gas_used <= gas_limit is checked when the header is admitted.
type block_gas = range(0, block_gas_limit_bound)A block header's gas limit. Its SSZ execution-payload field is uint64;
GASLIMIT widens this bounded natural into an EVM word when it pushes the
value onto the stack (Yellow Paper equation 147).
type block_gas_limit = range(0, block_gas_limit_bound)An execution block number. Provenance: the execution-payload SSZ schema
declares block_number: uint64. The execution rules do not impose a
tighter supported-fork bound.
type block_number = range(0, ssz_uint_bound)An execution block timestamp in seconds. Provenance: the
execution-payload SSZ schema declares timestamp: uint64; no tighter
supported-fork protocol bound is applied.
type block_timestamp = range(0, ssz_uint_bound)The accumulated excess blob gas carried between headers (EIP-4844).
type excess_blob_gas = range(0, excess_blob_gas_bound)Maximum byte length of execution-payload extra data. Provenance:
consensus MAX_EXTRA_DATA_BYTES and Amsterdam
SszExecutionPayload.extra_data.
type extra_data_length_bound : Int = 2 ^ 5The common digest type used by trie, code, and block hashes.
type hash = b256A beacon-chain slot number. Provenance: EIP-7843 and Amsterdam's
stateless SSZ payload declare this field as uint64.
type slot_number = range(0, ssz_uint_bound)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)let EMPTY_OMMER_HASH¶
keccak256(rlp([])) — the ommers hash of every post-merge block
(EIP-3675 requires an empty ommers list).
let EMPTY_OMMER_HASH : hash = hash_from_bits(0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347)Interprets canonical full-width bits directly as a digest.
function hash_from_bits(value : bits(256)) -> hash = {
let word_value = word_from_bits(value);
word_to_hash(word_value)
}The common digest type used by trie, code, and block hashes.
type hash = b256type Withdrawal¶
An EIP-4895 beacon-chain withdrawal: index, validator, recipient, and amount in gwei.
struct Withdrawal = {
index : withdrawal_index,
validator_index : validator_index,
address : address,
amount : withdrawal_amount,
}A 20-byte account address (YP §4.1), in canonical protocol byte order.
type address = vector(20, inc, byte)An EIP-4895 validator index, encoded as SSZ uint64.
type validator_index = range(0, ssz_uint_bound)An EIP-4895 withdrawal amount in gwei, encoded as SSZ uint64.
type withdrawal_amount = range(0, ssz_uint_bound)An EIP-4895 withdrawal index, encoded as SSZ uint64.
type withdrawal_index = range(0, ssz_uint_bound)type BlockBody¶
The block body. The semantic structure is explicit while its potentially large fields stay source-backed until individual elements are needed.
struct BlockBody = {
transactions : TransactionListRef,
withdrawals : WithdrawalListRef,
block_access_list : StatelessInputSliceAtMost(block_access_list_length_bound),
}A stateless-input range of at most 'maximum bytes.
type StatelessInputSliceAtMost('maximum : Int) = {
'off 'len,
stateless_input_valid_range('off, 'len) & 0 <= 'maximum & 'len <= 'maximum.
StatelessInputSliceFields('off, 'len)
}A schema-bounded source reference to encoded transaction envelopes.
type TransactionListRef = BoundedSszListRef(transaction_count_bound)A schema-bounded source reference to withdrawals.
type WithdrawalListRef = BoundedSszListRef(withdrawal_count_bound)Maximum byte length of the block access list. Provenance: Amsterdam
SszExecutionPayload.block_access_list uses
ByteList[MAX_BYTES_PER_TRANSACTION].
type block_access_list_length_bound : Int = 2 ^ 30type Block¶
A block: header plus body.
struct Block = {
header : BlockHeader,
body : BlockBody,
}The block body. The semantic structure is explicit while its potentially large fields stay source-backed until individual elements are needed.
struct BlockBody = {
transactions : TransactionListRef,
withdrawals : WithdrawalListRef,
block_access_list : StatelessInputSliceAtMost(block_access_list_length_bound),
}The execution-payload header fields the model reads and validates
(YP §4.4). Scalar wire bounds come from the consensus/Amsterdam SSZ
ExecutionPayload schema. gas_used <= gas_limit and the active
blob-schedule rules are execution-protocol constraints checked when the
payload is admitted. extra_data retains the schema's
ByteList[MAX_EXTRA_DATA_BYTES] bound while staying source-backed; it is
RLP-encoded whole for the header hash and never inspected. The fixed
logs_bloom commitment likewise stays source-backed until a semantic
consumer explicitly decodes it.
struct BlockHeader = {
number : block_number,
timestamp : block_timestamp,
gas_limit : block_gas_limit,
gas_used : block_gas,
prev_randao : word,
base_fee : word,
/* EIP-4844: a multiple of GAS_PER_BLOB within the active schedule. */
blob_gas_used : blob_gas_used,
/* EIP-4844 uint64 on the wire; narrowed to the documented reachable-chain
invariant at the authenticated input boundary. */
excess_blob_gas : excess_blob_gas,
state_root : hash,
receipts_root : hash,
logs_bloom : LogsBloomRef,
fee_recipient : address,
parent_hash : hash,
parent_beacon_block_root : hash,
/* uint64 (EIP-7843 and the Amsterdam stateless SSZ schema). */
slot_number : slot_number,
extra_data : StatelessInputSliceAtMost(extra_data_length_bound),
}type ExecutionPayload¶
The execution payload under validation: the block and the block hash the consensus layer expects it to commit to.
A block: header plus body.
struct Block = {
header : BlockHeader,
body : BlockBody,
}The common digest type used by trie, code, and block hashes.
type hash = b256