Skip to content

Commit

Permalink
Revert "use current block's base fee in txpool"
Browse files Browse the repository at this point in the history
This reverts commit 8a7d7ff.
  • Loading branch information
Thegaram committed Oct 1, 2024
1 parent a874fdb commit 7823bdf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/tx_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ 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 @@ -1333,9 +1334,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))) {
// 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)
l1BaseFee := fees.GetL1BaseFee(pool.currentState)
pendingBaseFee := misc.CalcBaseFee(pool.chainconfig, reset.newHead, l1BaseFee)
pool.priced.SetBaseFee(pendingBaseFee)
}
// Update all accounts to the latest known pending nonce
nonces := make(map[common.Address]uint64, len(pool.pending))
Expand Down

0 comments on commit 7823bdf

Please sign in to comment.