core/state_transition.go¶
| Type | MOD |
| Upstream Lines | 968 |
| Changed | +3 -2 |
Honour IsSpiral as an EIP-3860 activator in IntrinsicGas; rename IsLondon→IsEIP1559 in the EIP-1559 path
diff --git a/core/state_transition.go b/core/state_transition.go
index dac812353..06117a062 100644
--- a/core/state_transition.go
+++ b/core/state_transition.go
@@ -112,7 +112,7 @@ func IntrinsicGas(data []byte, accessList types.AccessList, authList []types.Set
}
gas.RegularGas += z * params.TxDataZeroGas
- if isContractCreation && rules.IsShanghai {
+ if isContractCreation && (rules.IsShanghai || rules.IsSpiral) {
lenWords := toWordSize(dataLen)
if (math.MaxUint64-gas.RegularGas)/params.InitCodeWordGas < lenWords {
return vm.GasCosts{}, ErrGasUintOverflow
@@ -525,7 +525,7 @@ func (st *stateTransition) preCheck() error {
}
}
// Make sure that transaction gasFeeCap is greater than the baseFee (post london)
- if st.evm.ChainConfig().IsLondon(st.evm.Context.BlockNumber) {
+ if st.evm.ChainConfig().IsEIP1559(st.evm.Context.BlockNumber) {
// Skip the checks if gas fields are zero and baseFee was explicitly disabled (eth_call)
skipCheck := st.evm.Config.NoBaseFee && msg.GasFeeCap.BitLen() == 0 && msg.GasTipCap.BitLen() == 0
if !skipCheck {
@@ -614,6 +614,7 @@ func (st *stateTransition) execute() (*ExecutionResult, error) {
contractCreation = msg.To == nil
floorDataGas uint64
)
+ // Check clauses 4-5, subtract intrinsic gas if everything is correct
cost, err := IntrinsicGas(msg.Data, msg.AccessList, msg.SetCodeAuthorizations, contractCreation, rules, st.evm.Context.CostPerStateByte)
if err != nil {
return nil, err