ReturnGasAmsterdam was draining the gas pool by the 1D sum of
regular+state gas consumed per tx (tx_gas_used), but EIP-8037 defines
block validity as max(sum_regular, sum_state) <= gas_limit. This caused
valid blocks to be rejected when the sum of both dimensions exceeded
the gas limit, even though each dimension individually was within bounds.
Fix: set remaining = initial - max(cumulativeRegular, cumulativeState)
after each tx, so SubGas correctly gates subsequent transactions against
the 2D block capacity.
Co-authored-by: Jared Wasinger <j-wasinger@hotmail.com>
This change fixes a flaw where, in certain scenarios, the block sealer did not accurately reset the remaining gas after failing to include an invalid transaction. Fixes#26791
This removes the burden on a single object to take care of all
validation and state processing. Now instead the validation is done by
the `core.BlockValidator` (`types.Validator`) that takes care of both
header and uncle validation through the `ValidateBlock` method and state
validation through the `ValidateState` method. The state processing is
done by a new object `core.StateProcessor` (`types.Processor`) and
accepts a new state as input and uses that to process the given block's
transactions (and uncles for rewords) to calculate the state root for
the next block (P_n + 1).