Skip to content

Commit baa5c0a

Browse files
core, eth, miner: rebase on latest blobpool
1 parent 8dcb6a3 commit baa5c0a

File tree

5 files changed

+7
-32
lines changed

5 files changed

+7
-32
lines changed

core/txpool/blobpool/blobpool.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ func New(config Config, chain BlockChain) *BlobPool {
326326
lookup: make(map[common.Hash]uint64),
327327
index: make(map[common.Address][]*blobTxMeta),
328328
spent: make(map[common.Address]*uint256.Int),
329-
cache: make(map[common.Hash]*blobTxMeta),
330329
}
331330
}
332331

core/txpool/legacypool/legacypool.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -508,19 +508,11 @@ func (pool *LegacyPool) ContentFrom(addr common.Address) ([]*types.Transaction,
508508
// The enforceTips parameter can be used to do an extra filtering on the pending
509509
// transactions and only return those whose **effective** tip is large enough in
510510
// the next pending execution environment.
511-
<<<<<<< HEAD
512511
func (pool *LegacyPool) Pending(enforceTips bool) map[common.Address][]*txpool.LazyTransaction {
513512
pool.mu.Lock()
514513
defer pool.mu.Unlock()
515514

516515
pending := make(map[common.Address][]*txpool.LazyTransaction, len(pool.pending))
517-
=======
518-
func (pool *LegacyPool) Pending(enforceTips bool) map[common.Address][]*txpool.Transaction {
519-
pool.mu.Lock()
520-
defer pool.mu.Unlock()
521-
522-
pending := make(map[common.Address][]*txpool.Transaction, len(pool.pending))
523-
>>>>>>> ceafc2a1d (core, eth, miner: do integration with miner, todo clean up)
524516
for addr, list := range pool.pending {
525517
txs := list.Flatten()
526518

eth/handler.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,7 @@ type txPool interface {
6767

6868
// Pending should return pending transactions.
6969
// The slice should be modifiable by the caller.
70-
<<<<<<< HEAD
7170
Pending(enforceTips bool) map[common.Address][]*txpool.LazyTransaction
72-
=======
73-
Pending(enforceTips bool) map[common.Address][]*txpool.Transaction
74-
>>>>>>> ceafc2a1d (core, eth, miner: do integration with miner, todo clean up)
7571

7672
// SubscribeNewTxsEvent should return an event subscription of
7773
// NewTxsEvent and send events to the given channel.

eth/handler_test.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,24 +100,18 @@ func (p *testTxPool) Add(txs []*txpool.Transaction, local bool, sync bool) []err
100100
return make([]error, len(unwrapped))
101101
}
102102

103-
type TxByNonce []*txpool.Transaction
104-
105-
func (s TxByNonce) Len() int { return len(s) }
106-
func (s TxByNonce) Less(i, j int) bool { return s[i].Tx.Nonce() < s[j].Tx.Nonce() }
107-
func (s TxByNonce) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
108-
109103
// Pending returns all the transactions known to the pool
110104
func (p *testTxPool) Pending(enforceTips bool) map[common.Address][]*txpool.LazyTransaction {
111105
p.lock.RLock()
112106
defer p.lock.RUnlock()
113107

114-
batches := make(map[common.Address][]*txpool.Transaction)
108+
batches := make(map[common.Address][]*types.Transaction)
115109
for _, tx := range p.pool {
116110
from, _ := types.Sender(types.HomesteadSigner{}, tx)
117-
batches[from] = append(batches[from], &txpool.Transaction{Tx: tx})
111+
batches[from] = append(batches[from], tx)
118112
}
119113
for _, batch := range batches {
120-
sort.Sort(TxByNonce(batch))
114+
sort.Sort(types.TxByNonce(batch))
121115
}
122116
pending := make(map[common.Address][]*txpool.LazyTransaction)
123117
for addr, batch := range batches {

miner/worker.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ func (w *worker) commitTransaction(env *environment, tx *txpool.Transaction) ([]
760760
gp = env.gasPool.Gas()
761761
)
762762
// TODO (MariusVanDerWijden): Move this check
763-
if len(env.blobs)+len(tx.BlobHashes())*params.BlobTxDataGasPerBlob > params.BlobTxMaxDataGasPerBlock {
763+
if len(env.blobs)+len(tx.Tx.BlobHashes())*params.BlobTxDataGasPerBlob > params.BlobTxMaxDataGasPerBlock {
764764
return nil, errors.New("max data blobs reached")
765765
}
766766
receipt, err := core.ApplyTransaction(w.chainConfig, w.chain, &env.coinbase, env.gasPool, env.state, env.header, tx.Tx, &env.header.GasUsed, *w.chain.GetVMConfig())
@@ -833,8 +833,8 @@ func (w *worker) commitTransactions(env *environment, txs *transactionsByPriceAn
833833
coalescedLogs = append(coalescedLogs, logs...)
834834
env.tcount++
835835
txs.Shift()
836-
if tx.Type() == types.BlobTxType {
837-
txWrap := w.eth.TxPool().Get(tx.Hash())
836+
if tx.Tx.Type() == types.BlobTxType {
837+
txWrap := w.eth.TxPool().Get(tx.Tx.Hash())
838838
env.blobs = append(env.blobs, txWrap.BlobTxBlobs...)
839839
env.commitments = append(env.commitments, txWrap.BlobTxCommits...)
840840
env.proofs = append(env.proofs, txWrap.BlobTxProofs...)
@@ -964,16 +964,10 @@ func (w *worker) fillTransactions(interrupt *atomic.Int32, env *environment) err
964964
if txs := pending[account]; len(txs) > 0 {
965965
delete(pending, account)
966966
for _, tx := range txs {
967-
localTxs[account] = append(localTxs[account], tx.Tx)
967+
localTxs[account] = append(localTxs[account], tx)
968968
}
969969
}
970970
}
971-
for account, remotes := range pending {
972-
remoteTxs[account] = make([]*types.Transaction, 0, len(remotes))
973-
for _, tx := range remotes {
974-
remoteTxs[account] = append(remoteTxs[account], tx.Tx)
975-
}
976-
}
977971

978972
if len(localTxs) > 0 {
979973
txs := newTransactionsByPriceAndNonce(env.signer, localTxs, env.header.BaseFee)

0 commit comments

Comments
 (0)