mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 09:51:36 +00:00
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:
parent
bf53d63b3e
commit
59617bacd8
1 changed files with 3 additions and 5 deletions
|
|
@ -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},
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue