core: remove per-tx state gas pre-check from parallel processor

The per-tx state gas check reserved a transaction's full gas limit
against the state gas budget, double-counting across both dimensions.
Block-end validation (max(regular, state) <= gas_limit) catches state
gas overflow. See ethereum/execution-specs#2578.
This commit is contained in:
spencer-tb 2026-03-28 18:11:30 +00:00
parent bf53d63b3e
commit 59617bacd8

View file

@ -106,12 +106,10 @@ func (p *ParallelStateProcessor) prepareExecResult(block *types.Block, tExecStar
var allReceipts []*types.Receipt
for _, result := range results {
// EIP-8037 check_transaction: verify this tx fits in remaining
// block capacity per-dimension BEFORE adding its actual usage.
// Regular gas is capped at MaxTxGas; state gas uses full tx.gas.
// regular gas capacity. State gas is not checked per-tx;
// block-end validation enforces max(regular, state) <= gas_limit.
regularAvailable := header.GasLimit - sumRegular
stateAvailable := header.GasLimit - sumState
if min(params.MaxTxGas, result.txGasLimit) > regularAvailable ||
result.txGasLimit > stateAvailable {
if min(params.MaxTxGas, result.txGasLimit) > regularAvailable {
return &ProcessResultWithMetrics{
ProcessResult: &ProcessResult{Error: ErrGasLimitReached},
}