Replace BlockExecutionError::msg(...) with
BlockValidationError::TransactionGasLimitMoreThanAvailableBlockGas in
MorphBlockExecutor::execute_transaction_without_commit so a transaction
exceeding the remaining block gas pool is classified as a Validation error
(matching upstream EthBlockExecutor) rather than an Internal execution error.
This ensures:
- Engine/tree validation rejects malformed blocks cleanly as invalid rather
than surfacing a fatal internal execution error.
- Payload builder supplied/pool transaction execution handles gas-pool
overflow through its BlockExecutionError::Validation arms instead of
aborting with a fatal EvmExecutionError.
Adds unit tests covering single-tx overflow, overflow after a regular tx,
and overflow after an L1 message reserving its full gas_limit.
Summary
Fixes gas-pool overflow error classification in
MorphBlockExecutor::execute_transaction_without_commit(crates/evm/src/block/mod.rs):BlockExecutionError::msg(...)(which constructsBlockExecutionError::Internal(InternalBlockExecutionError::Other(...))) withBlockValidationError::TransactionGasLimitMoreThanAvailableBlockGas { transaction_gas_limit: recovered.tx().gas_limit(), block_available_gas }.into(), matching upstreamalloy-evm'sEthBlockExecutor.morph-payload-builderhandles supplied transactions through itsBlockExecutionError::Validationarm (InvalidSuppliedTransaction) and pool transactions by skipping/marking the transaction invalid rather than aborting block building withEvmExecutionError.BlockExecutionError::msg/BlockExecutionError::otheroccurrences across the repository (crates/evm/src/block/mod.rs:131, 134, 159, 202); all remaining ones are genuine internal invariants or database read failures.crates/evm/src/block/mod.rsassertingerr.as_validation().is_some()and exactTransactionGasLimitMoreThanAvailableBlockGasfields for:gas_limitpool reservation)Verification
cargo fmt --all -- --check: passedcargo clippy -p morph-evm -p morph-payload-builder -p morph-node --all-targets -- -D warnings: passed (0 warnings)cargo test -p morph-evm: 24 passedcargo test -p morph-payload-builder: 39 passedcargo test -p morph-node --features test-utils --test it -- block_building consensus engine invalid_payload_recovery: 46 passedSummary by CodeRabbit