From 94d14dd248ecdca9dc2d8c46dc73256deb946989 Mon Sep 17 00:00:00 2001 From: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com> Date: Mon, 29 Aug 2022 15:12:31 +0200 Subject: [PATCH] BaseFee is nil prior to London hard fork (#5213) --- eth/stagedsync/stage_mining_create_block.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eth/stagedsync/stage_mining_create_block.go b/eth/stagedsync/stage_mining_create_block.go index af63902eb..e8ddd14ba 100644 --- a/eth/stagedsync/stage_mining_create_block.go +++ b/eth/stagedsync/stage_mining_create_block.go @@ -390,12 +390,12 @@ func filterBadTransactions(tx kv.Tx, transactions []types.Transaction, config pa continue } - baseFee256 := uint256.NewInt(0) - if baseFee256.SetFromBig(baseFee) { - return nil, fmt.Errorf("bad baseFee") - } - // Make sure the transaction gasFeeCap is greater than the block's baseFee. if config.IsLondon(blockNumber) { + baseFee256 := uint256.NewInt(0) + if overflow := baseFee256.SetFromBig(baseFee); overflow { + return nil, fmt.Errorf("bad baseFee %s", baseFee) + } + // Make sure the transaction gasFeeCap is greater than the block's baseFee. if !transaction.GetFeeCap().IsZero() || !transaction.GetTip().IsZero() { if err := core.CheckEip1559TxGasFeeCap(sender, transaction.GetFeeCap(), transaction.GetTip(), baseFee256); err != nil { transactions = transactions[1:]