Skip to main content

Module validation

Module validation 

Source
Expand description

Stateless block validation utilities.

This module provides pure validation functions that can be used without storage dependencies, making them suitable for use in zkVM guest programs.

Functions§

get_total_blob_gas
Calculates the blob gas required by a transaction.
validate_block_access_list_hash
Validates that the block access list hash matches the block header (Amsterdam+). Also validates that all BlockAccessIndex values are within valid bounds per EIP-7928, and that the BAL size does not exceed the gas-derived limit.
validate_block_access_list_size
Validates that the block access list does not exceed the maximum allowed size (Amsterdam+). Per EIP-7928: bal_items <= block_gas_limit // GAS_BLOCK_ACCESS_LIST_ITEM
validate_block_pre_execution
Performs pre-execution validation of the block’s header values in reference to the parent_header. Verifies that blob gas fields in the header are correct in reference to the block’s body. If a block passes this check, execution will still fail with execute_block when a transaction runs out of gas.
validate_gas_used
Validates that the block gas used matches the block header. For Amsterdam+ (EIP-7778), block_gas_used is PRE-REFUND and differs from receipt cumulative_gas_used which is POST-REFUND.
validate_header_bal_indices
Validates that all indices in the header BAL are within valid bounds (Amsterdam+). This is a subset of the full hash check — used in the parallel execution path where we have the header BAL but do not build a new BAL during execution. Per EIP-7928: valid indices are 0 (pre-exec) through len(transactions)+1 (post-exec).
validate_receipts_root_and_logs_bloom
Validates both the receipts root and the header logs_bloom against the executed receipts in a single pass.
validate_requests_hash
Validates that the requests hash matches the block header (Prague+).