From 8a7d7ff87d6a9fb5124d72767c9ca24302673752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Garamv=C3=B6lgyi?= Date: Tue, 1 Oct 2024 12:58:51 +0200 Subject: [PATCH] use current block's base fee in txpool --- core/tx_pool.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/tx_pool.go b/core/tx_pool.go index e7d5062fd523..5c694a97a78e 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -28,7 +28,6 @@ import ( "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common/prque" - "github.com/scroll-tech/go-ethereum/consensus/misc" "github.com/scroll-tech/go-ethereum/core/rawdb" "github.com/scroll-tech/go-ethereum/core/state" "github.com/scroll-tech/go-ethereum/core/types" @@ -1334,9 +1333,9 @@ func (pool *TxPool) runReorg(done chan struct{}, reset *txpoolResetRequest, dirt if reset != nil { pool.demoteUnexecutables() if reset.newHead != nil && pool.chainconfig.IsCurie(new(big.Int).Add(reset.newHead.Number, big.NewInt(1))) { - l1BaseFee := fees.GetL1BaseFee(pool.currentState) - pendingBaseFee := misc.CalcBaseFee(pool.chainconfig, reset.newHead, l1BaseFee) - pool.priced.SetBaseFee(pendingBaseFee) + // note: we cannot predict the next block's base fee since it is set + // by the sequencer, so we use the current block's base fee instead. + pool.priced.SetBaseFee(reset.newHead.BaseFee) } // Update all accounts to the latest known pending nonce nonces := make(map[common.Address]uint64, len(pool.pending))