diff --git a/core/vm/evm.go b/core/vm/evm.go index 13fea79f57..c530a0ef0e 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -83,7 +83,8 @@ type BlockContext struct { Random *common.Hash // Provides information for PREVRANDAO // Arbitrum information - ArbOSVersion uint64 + ArbOSVersion uint64 + BaseFeeInBlock *big.Int // Copy of BaseFee to be used in arbitrum's geth hooks and precompiles when BaseFee is lowered to 0 when vm runs with NoBaseFee flag and 0 gas price. Is nil when BaseFee isn't lowered to 0 } // TxContext provides the EVM with information about a transaction. @@ -141,8 +142,8 @@ func NewEVM(blockCtx BlockContext, txCtx TxContext, statedb StateDB, chainConfig // gas prices were specified, lower the basefee to 0 to avoid breaking EVM // invariants (basefee < feecap) if config.NoBaseFee { - // Currently we don't set block context's BaseFee to zero, since nitro uses this field - if txCtx.GasPrice.BitLen() == 0 && !chainConfig.IsArbitrum() { + if txCtx.GasPrice.BitLen() == 0 { + blockCtx.BaseFeeInBlock = new(big.Int).Set(blockCtx.BaseFee) blockCtx.BaseFee = new(big.Int) } if txCtx.BlobFeeCap != nil && txCtx.BlobFeeCap.BitLen() == 0 {