Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/txpool/blobpool: avoid possible zero index panic #30430

Merged
merged 3 commits into from
Sep 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
avoid posible zero index panic
  • Loading branch information
mask-pp committed Sep 13, 2024
commit 0476172e20fd9f45cc95a819c03cb6b04d1a3f45
3 changes: 1 addition & 2 deletions core/txpool/blobpool/blobpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ func (p *BlobPool) recheck(addr common.Address, inclusions map[common.Hash]uint6
ids []uint64
nonces []uint64
)
for txs[0].nonce < next {
for ; len(txs) > 0 && txs[0].nonce < next; txs = txs[1:] {
mask-pp marked this conversation as resolved.
Show resolved Hide resolved
ids = append(ids, txs[0].id)
nonces = append(nonces, txs[0].nonce)

Expand All @@ -578,7 +578,6 @@ func (p *BlobPool) recheck(addr common.Address, inclusions map[common.Hash]uint6
if inclusions != nil {
p.offload(addr, txs[0].nonce, txs[0].id, inclusions)
}
txs = txs[1:]
mask-pp marked this conversation as resolved.
Show resolved Hide resolved
}
log.Trace("Dropping overlapped blob transactions", "from", addr, "overlapped", nonces, "ids", ids, "left", len(txs))
dropOverlappedMeter.Mark(int64(len(ids)))
Expand Down