From f252730f7d5f3db446e8791b3a33518d773126df Mon Sep 17 00:00:00 2001 From: Lee Gyumin Date: Tue, 31 Mar 2026 02:57:45 +0900 Subject: [PATCH] core: warn on unexpected pre-london genesis base fee --- core/genesis.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/genesis.go b/core/genesis.go index 6edc6e6779..b5779be21c 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -510,17 +510,20 @@ func (g *Genesis) toBlockWithRoot(root common.Hash) *types.Block { head.Difficulty = params.GenesisDifficulty } } - if g.Config != nil && g.Config.IsLondon(common.Big0) { + conf := g.Config + if conf != nil { if g.BaseFee != nil { - head.BaseFee = g.BaseFee - } else { + if !conf.IsLondon(common.Big0) { + log.Warn("Invalid genesis, unexpected BaseFee set before London, allowing it for testing purposes") + } + } else if conf.IsLondon(common.Big0) { head.BaseFee = new(big.Int).SetUint64(params.InitialBaseFee) } } var ( withdrawals []*types.Withdrawal ) - if conf := g.Config; conf != nil { + if conf != nil { num := big.NewInt(int64(g.Number)) if conf.IsShanghai(num, g.Timestamp) { head.WithdrawalsHash = &types.EmptyWithdrawalsHash