mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
Update worker.go
This commit is contained in:
parent
a7d6c7746b
commit
6a64ac5383
1 changed files with 23 additions and 9 deletions
|
|
@ -122,6 +122,10 @@ func (miner *Miner) generateWork(genParam *generateParams, witness bool) *newPay
|
|||
// Also add size of withdrawals to work block size.
|
||||
work.size += uint64(genParam.withdrawals.Size())
|
||||
|
||||
if err = miner.commitPoLTx(work); err != nil {
|
||||
return &newPayloadResult{err: err}
|
||||
}
|
||||
|
||||
if !genParam.noTxs {
|
||||
interrupt := new(atomic.Int32)
|
||||
timer := time.AfterFunc(miner.config.Recommit, func() {
|
||||
|
|
@ -467,15 +471,7 @@ func (miner *Miner) commitTransactions(env *environment, plainTxs, blobTxs *tran
|
|||
return nil
|
||||
}
|
||||
|
||||
// fillTransactions retrieves the pending transactions from the txpool and fills them
|
||||
// into the given sealing block. The transaction selection and ordering strategy can
|
||||
// be customized with the plugin in the future.
|
||||
func (miner *Miner) fillTransactions(interrupt *atomic.Int32, env *environment) error {
|
||||
miner.confMu.RLock()
|
||||
tip := miner.config.GasPrice
|
||||
prio := miner.prio
|
||||
miner.confMu.RUnlock()
|
||||
|
||||
func (miner *Miner) commitPoLTx(env *environment) error {
|
||||
// Berachain: Post-Prague1, add PoL tx to the block according to BRIP-0004.
|
||||
if env.gasPool == nil {
|
||||
// NOTE: this check is moved here from the commitTransactions loop because we are
|
||||
|
|
@ -503,6 +499,24 @@ func (miner *Miner) fillTransactions(interrupt *atomic.Int32, env *environment)
|
|||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// fillTransactions retrieves the pending transactions from the txpool and fills them
|
||||
// into the given sealing block. The transaction selection and ordering strategy can
|
||||
// be customized with the plugin in the future.
|
||||
func (miner *Miner) fillTransactions(interrupt *atomic.Int32, env *environment) error {
|
||||
miner.confMu.RLock()
|
||||
tip := miner.config.GasPrice
|
||||
prio := miner.prio
|
||||
miner.confMu.RUnlock()
|
||||
|
||||
// Berachain: Post-Prague1, add PoL tx to the block according to BRIP-0004.
|
||||
if env.gasPool == nil {
|
||||
// NOTE: this check is moved here from the commitTransactions loop because we are
|
||||
// "committing" a transaction outside of the loop.
|
||||
env.gasPool = new(core.GasPool).AddGas(env.header.GasLimit)
|
||||
}
|
||||
|
||||
// Retrieve the pending transactions pre-filtered by the 1559/4844 dynamic fees
|
||||
filter := txpool.PendingFilter{
|
||||
|
|
|
|||
Loading…
Reference in a new issue