Skip to main content

execute_transactions

Function execute_transactions 

Source
pub fn execute_transactions<S, T, EvmTypes>(
    builder: S,
    state_provider: impl StateProvider,
    calls: Vec<RpcTxReq<T::Network>>,
    remaining_call_gas_limit: &mut Option<u64>,
    chain_id: u64,
    simulation_state: Option<&mut SimulatedState>,
    converter: &T,
    call_nonce: impl FnMut(&RpcTxReq<T::Network>, &mut dyn DynDatabase) -> Result<Option<u64>, EthApiError>,
) -> Result<(BlockBuilderOutcome<S::Primitives>, Vec<TxResult<EvmTypes>>), EthApiError>
where S: BlockBuilder<Executor: BlockExecutor<Evm: RethEvm<EvmTypes = EvmTypes>>>, T: RpcConvert<Primitives = S::Primitives>, EvmTypes: EvmTypes,
Expand description

Converts all TransactionRequests into [Recovered] transactions and applies them to the given BlockBuilder.

Returns all executed transactions and the result of the execution.

For each call without an explicit gas field, the remaining block gas is used as the default. The RPC gas cap is tracked as a request-wide remaining budget and caps each call before execution. This matches the spec rule "gasLimit: blockGasLimit - soFarUsedGasInBlock" and geth’s per-call sanitizeCall behavior.

call_nonce returns the nonce for a call without one from the state before the call, or None to use the sender’s account nonce.