Skip to main content

validate_block_pre_execution

Function validate_block_pre_execution 

Source
pub fn validate_block_pre_execution(
    block: &Block,
    parent_header: &BlockHeader,
    chain_config: &ChainConfig,
    elasticity_multiplier: u64,
) -> Result<(), InvalidBlockError>
Expand description

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.

§WARNING

This doesn’t validate that the transactions or withdrawals root of the header matches the body contents, since we assume the caller already did it. And, in any case, that wouldn’t invalidate the block header.

To validate it, use [ethrex_common::types::validate_block_body]