mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
core/txpool/blobpool: fixup comments
This commit is contained in:
parent
3d40d32e41
commit
7c00fb981b
1 changed files with 3 additions and 9 deletions
|
|
@ -890,9 +890,7 @@ func (p *BlobPool) Reset(oldHead, newHead *types.Header) {
|
||||||
|
|
||||||
// Perform the conversion logic at the fork boundary
|
// Perform the conversion logic at the fork boundary
|
||||||
if !p.chain.Config().IsOsaka(oldHead.Number, oldHead.Time) && p.chain.Config().IsOsaka(newHead.Number, newHead.Time) {
|
if !p.chain.Config().IsOsaka(oldHead.Number, oldHead.Time) && p.chain.Config().IsOsaka(newHead.Number, newHead.Time) {
|
||||||
// Evicts all transactions from the pool. The pool should, at this stage,
|
// Deep copy all indexed transaction metadata.
|
||||||
// contain only legacy blob transactions. Evicting any new-format blob
|
|
||||||
// transactions is also safe, as they will be re-injected later.
|
|
||||||
all := make(map[common.Address]map[uint64]*blobTxMeta)
|
all := make(map[common.Address]map[uint64]*blobTxMeta)
|
||||||
for sender, txs := range p.index {
|
for sender, txs := range p.index {
|
||||||
all[sender] = make(map[uint64]*blobTxMeta)
|
all[sender] = make(map[uint64]*blobTxMeta)
|
||||||
|
|
@ -900,8 +898,7 @@ func (p *BlobPool) Reset(oldHead, newHead *types.Header) {
|
||||||
all[sender][m.nonce] = m
|
all[sender][m.nonce] = m
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Initiate the background conversion thread, the mutex is not required
|
// Initiate the background conversion thread.
|
||||||
// and won't block any pool operation.
|
|
||||||
go p.convertLegacySidecars(all)
|
go p.convertLegacySidecars(all)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -919,7 +916,7 @@ func (p *BlobPool) convertLegacySidecars(txs map[common.Address]map[uint64]*blob
|
||||||
nonces := slices.Collect(maps.Keys(list))
|
nonces := slices.Collect(maps.Keys(list))
|
||||||
slices.Sort(nonces)
|
slices.Sort(nonces)
|
||||||
|
|
||||||
// Convert and insert the txs in order
|
// Convert and insert the txs in order.
|
||||||
for _, nonce := range nonces {
|
for _, nonce := range nonces {
|
||||||
m := list[nonce]
|
m := list[nonce]
|
||||||
p.lock.RLock()
|
p.lock.RLock()
|
||||||
|
|
@ -929,7 +926,6 @@ func (p *BlobPool) convertLegacySidecars(txs map[common.Address]map[uint64]*blob
|
||||||
fail++
|
fail++
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use this to remove the blob transaction regardless of if the conversion
|
// Use this to remove the blob transaction regardless of if the conversion
|
||||||
// succeeds or not.
|
// succeeds or not.
|
||||||
delete := func() {
|
delete := func() {
|
||||||
|
|
@ -939,7 +935,6 @@ func (p *BlobPool) convertLegacySidecars(txs map[common.Address]map[uint64]*blob
|
||||||
log.Error("Failed to delete blob transaction", "from", addr, "id", m.id, "err", err)
|
log.Error("Failed to delete blob transaction", "from", addr, "id", m.id, "err", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decode the transaction and perform the migration.
|
// Decode the transaction and perform the migration.
|
||||||
var tx types.Transaction
|
var tx types.Transaction
|
||||||
if err = rlp.DecodeBytes(blob, &tx); err != nil {
|
if err = rlp.DecodeBytes(blob, &tx); err != nil {
|
||||||
|
|
@ -954,7 +949,6 @@ func (p *BlobPool) convertLegacySidecars(txs map[common.Address]map[uint64]*blob
|
||||||
fail++
|
fail++
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now atomically swap the old sidecar with the converted sidecar.
|
// Now atomically swap the old sidecar with the converted sidecar.
|
||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
p.remove(m, addr)
|
p.remove(m, addr)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue