core: apply fixes for 8037

This commit is contained in:
Marius van der Wijden 2026-04-22 15:00:52 +02:00 committed by MariusVanDerWijden
parent c6c5536226
commit 2d708415d7

View file

@ -578,7 +578,6 @@ func (st *stateTransition) execute() (*ExecutionResult, error) {
var (
ret []byte
vmerr error // vm errors do not effect consensus and are therefore not assigned to err
authRefund uint64
)
var execGasUsed vm.GasUsed
if contractCreation {
@ -591,8 +590,7 @@ func (st *stateTransition) execute() (*ExecutionResult, error) {
if msg.SetCodeAuthorizations != nil {
for _, auth := range msg.SetCodeAuthorizations {
// Note errors are ignored, we simply skip invalid authorizations here.
refund, _ := st.applyAuthorization(rules, &auth)
authRefund += refund
st.applyAuthorization(rules, &auth)
}
}
@ -639,8 +637,7 @@ func (st *stateTransition) execute() (*ExecutionResult, error) {
// EIP-8037: 2D gas accounting for Amsterdam.
// tx_regular = intrinsic_regular + exec_regular_gas_used
// tx_state = intrinsic_state (adjusted) + exec_state_gas_used
// These are tracked independently, not derived from remaining gas.
txState := (cost.StateGas - authRefund) + execGasUsed.StateGas
txState := cost.StateGas + execGasUsed.StateGas
txRegular := cost.RegularGas + execGasUsed.RegularGas
txRegular = max(txRegular, floorDataGas)
if err := st.gp.ReturnGasAmsterdam(txRegular, txState, st.gasUsed()); err != nil {