mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-16 20:01:37 +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
|
var allReceipts []*types.Receipt
|
||||||
for _, result := range results {
|
for _, result := range results {
|
||||||
// EIP-8037 check_transaction: verify this tx fits in remaining
|
// EIP-8037 check_transaction: verify this tx fits in remaining
|
||||||
// block capacity per-dimension BEFORE adding its actual usage.
|
// regular gas capacity. State gas is not checked per-tx;
|
||||||
// Regular gas is capped at MaxTxGas; state gas uses full tx.gas.
|
// block-end validation enforces max(regular, state) <= gas_limit.
|
||||||
regularAvailable := header.GasLimit - sumRegular
|
regularAvailable := header.GasLimit - sumRegular
|
||||||
stateAvailable := header.GasLimit - sumState
|
if min(params.MaxTxGas, result.txGasLimit) > regularAvailable {
|
||||||
if min(params.MaxTxGas, result.txGasLimit) > regularAvailable ||
|
|
||||||
result.txGasLimit > stateAvailable {
|
|
||||||
return &ProcessResultWithMetrics{
|
return &ProcessResultWithMetrics{
|
||||||
ProcessResult: &ProcessResult{Error: ErrGasLimitReached},
|
ProcessResult: &ProcessResult{Error: ErrGasLimitReached},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue