Skip to content

Commit

Permalink
use current block's base fee in txpool
Browse files Browse the repository at this point in the history
  • Loading branch information
Thegaram committed Oct 1, 2024
1 parent 95a7837 commit 8a7d7ff
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/tx_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 8a7d7ff

Please sign in to comment.