Skip to content

Commit

Permalink
Update TxPool base fee prior to filtering txs based on effective tip
Browse files Browse the repository at this point in the history
  • Loading branch information
darioush committed Jan 27, 2024
1 parent 0f31c49 commit 24a0c34
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/txpool/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -1841,6 +1841,13 @@ func (pool *TxPool) updateBaseFee() {
}
}

func (pool *TxPool) SetBaseFee(baseFee *big.Int) {
pool.mu.Lock()
defer pool.mu.Unlock()

pool.priced.SetBaseFee(baseFee)
}

// addressByHeartbeat is an account address tagged with its last activity timestamp.
type addressByHeartbeat struct {
address common.Address
Expand Down
3 changes: 3 additions & 0 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ func (w *worker) commitNewWork(predicateContext *precompileconfig.PredicateConte
}

// Fill the block with all available pending transactions.
if header.BaseFee != nil {
w.eth.TxPool().SetBaseFee(header.BaseFee)
}
pending := w.eth.TxPool().Pending(true)

// Split the pending transactions into locals and remotes
Expand Down

0 comments on commit 24a0c34

Please sign in to comment.