From e7314c8a13dad73bc98e53d9a94e6f429a6e00dc Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Mon, 13 Jul 2026 03:38:54 +0200 Subject: [PATCH] core: charge floorDataGas if it exceeds regularGas (#35342) Implement EIP spec change https://github.com/ethereum/EIPs/pull/11908/changes --------- Co-authored-by: Gary Rong --- core/state_transition.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/state_transition.go b/core/state_transition.go index a3a9efeaa4..4967675164 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -882,14 +882,14 @@ func (st *stateTransition) settleGas(rules params.Rules, floorDataGas uint64) (g // EIP-8037: // tx_gas_used_before_refund = tx.gas - tx_output.gas_left - tx_output.state_gas_reservoir // tx_state_gas = intrinsic_state_gas + tx_output.execution_state_gas_used - // tx_regular_gas = tx_gas_used_before_refund - tx_state_gas + // tx_regular_gas = max(tx_gas_used_before_refund - tx_state_gas, calldata_floor_gas_cost) gasLeft := st.gasRemaining.RegularGas + st.gasRemaining.StateGas gasUsedBeforeRefund := st.msg.GasLimit - gasLeft if gasUsedBeforeRefund < txStateGas { return 0, 0, fmt.Errorf("negative topmost frame regular gas usage, total: %d, state: %d", gasUsedBeforeRefund, txStateGas) } - txRegularGas := gasUsedBeforeRefund - txStateGas + txRegularGas := max(gasUsedBeforeRefund-txStateGas, floorDataGas) // EIP-3529: tx_gas_refund = min(tx_gas_used_before_refund/5, refund_counter). refund := st.calcRefund(gasUsedBeforeRefund)