|
|
|
@ -428,6 +428,7 @@ func (miner *Miner) commitTransactions(env *environment, plainTxs, blobTxs *tran |
|
|
|
|
func (miner *Miner) fillTransactions(interrupt *atomic.Int32, env *environment) error { |
|
|
|
|
miner.confMu.RLock() |
|
|
|
|
tip := miner.config.GasPrice |
|
|
|
|
prio := miner.prio |
|
|
|
|
miner.confMu.RUnlock() |
|
|
|
|
|
|
|
|
|
// Retrieve the pending transactions pre-filtered by the 1559/4844 dynamic fees
|
|
|
|
@ -447,31 +448,31 @@ func (miner *Miner) fillTransactions(interrupt *atomic.Int32, env *environment) |
|
|
|
|
pendingBlobTxs := miner.txpool.Pending(filter) |
|
|
|
|
|
|
|
|
|
// Split the pending transactions into locals and remotes.
|
|
|
|
|
localPlainTxs, remotePlainTxs := make(map[common.Address][]*txpool.LazyTransaction), pendingPlainTxs |
|
|
|
|
localBlobTxs, remoteBlobTxs := make(map[common.Address][]*txpool.LazyTransaction), pendingBlobTxs |
|
|
|
|
prioPlainTxs, normalPlainTxs := make(map[common.Address][]*txpool.LazyTransaction), pendingPlainTxs |
|
|
|
|
prioBlobTxs, normalBlobTxs := make(map[common.Address][]*txpool.LazyTransaction), pendingBlobTxs |
|
|
|
|
|
|
|
|
|
for _, account := range miner.txpool.Locals() { |
|
|
|
|
if txs := remotePlainTxs[account]; len(txs) > 0 { |
|
|
|
|
delete(remotePlainTxs, account) |
|
|
|
|
localPlainTxs[account] = txs |
|
|
|
|
for _, account := range prio { |
|
|
|
|
if txs := normalPlainTxs[account]; len(txs) > 0 { |
|
|
|
|
delete(normalPlainTxs, account) |
|
|
|
|
prioPlainTxs[account] = txs |
|
|
|
|
} |
|
|
|
|
if txs := remoteBlobTxs[account]; len(txs) > 0 { |
|
|
|
|
delete(remoteBlobTxs, account) |
|
|
|
|
localBlobTxs[account] = txs |
|
|
|
|
if txs := normalBlobTxs[account]; len(txs) > 0 { |
|
|
|
|
delete(normalBlobTxs, account) |
|
|
|
|
prioBlobTxs[account] = txs |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// Fill the block with all available pending transactions.
|
|
|
|
|
if len(localPlainTxs) > 0 || len(localBlobTxs) > 0 { |
|
|
|
|
plainTxs := newTransactionsByPriceAndNonce(env.signer, localPlainTxs, env.header.BaseFee) |
|
|
|
|
blobTxs := newTransactionsByPriceAndNonce(env.signer, localBlobTxs, env.header.BaseFee) |
|
|
|
|
if len(prioPlainTxs) > 0 || len(prioBlobTxs) > 0 { |
|
|
|
|
plainTxs := newTransactionsByPriceAndNonce(env.signer, prioPlainTxs, env.header.BaseFee) |
|
|
|
|
blobTxs := newTransactionsByPriceAndNonce(env.signer, prioBlobTxs, env.header.BaseFee) |
|
|
|
|
|
|
|
|
|
if err := miner.commitTransactions(env, plainTxs, blobTxs, interrupt); err != nil { |
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if len(remotePlainTxs) > 0 || len(remoteBlobTxs) > 0 { |
|
|
|
|
plainTxs := newTransactionsByPriceAndNonce(env.signer, remotePlainTxs, env.header.BaseFee) |
|
|
|
|
blobTxs := newTransactionsByPriceAndNonce(env.signer, remoteBlobTxs, env.header.BaseFee) |
|
|
|
|
if len(normalPlainTxs) > 0 || len(normalBlobTxs) > 0 { |
|
|
|
|
plainTxs := newTransactionsByPriceAndNonce(env.signer, normalPlainTxs, env.header.BaseFee) |
|
|
|
|
blobTxs := newTransactionsByPriceAndNonce(env.signer, normalBlobTxs, env.header.BaseFee) |
|
|
|
|
|
|
|
|
|
if err := miner.commitTransactions(env, plainTxs, blobTxs, interrupt); err != nil { |
|
|
|
|
return err |
|
|
|
|