Skip to main content

Module execute

Module execute 

Source
Expand description

BAL executor.

Read execute_block as two execution paths over the same parent state.

Worker states run transactions speculatively. Each worker gets one fresh cache-filling database from make_db(true), installs the received BAL, sets the transaction BAL index for each streamed transaction, and returns uncommitted results. Execution errors rebuild the State, EVM, and executor while retaining the worker’s database.

The canonical state owns block effects. It runs the normal pre/post block hooks, commits worker results in transaction order, tracks block gas admission, and builds the BAL that this execution actually produced.

Recovery and speculative execution failures are deferred to their transaction slot and adjudicated in block order: block-gas admission at an earlier slot takes precedence, otherwise the first failure decides the block’s verdict. Workers trust the received BAL before its hash is validated against the rebuilt BAL. An undeclared access therefore short-circuits execution at that slot, and its error may differ from serial execution against canonical state (which can instead fail nonce, balance, or later block checks). Failed transactions are not replayed.

The rebuilt BAL is returned to the outer payload validator for consensus post-execution validation. This module only logs the first divergence between the received BAL and the BAL rebuilt from canonical execution.

Functions§

execute_block
Executes one block on the BAL path using the runtime’s persistent BAL worker pool.