From c7adf4b31abf106b5a435d0990874eeb133df6c1 Mon Sep 17 00:00:00 2001 From: ionodeionode Date: Tue, 24 Feb 2026 15:10:58 +0700 Subject: [PATCH] core/txpool/blobpool: remove unused adds slice in Add() The adds slice in BlobPool.Add() is populated but never read, causing unnecessary memory allocation and WithoutBlobTxSidecar() calls for each successfully added transaction. Remove the dead code to reduce allocations in the hot path. Fixes #33871 --- core/txpool/blobpool/blobpool.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/core/txpool/blobpool/blobpool.go b/core/txpool/blobpool/blobpool.go index 3947ba50a1..6022514750 100644 --- a/core/txpool/blobpool/blobpool.go +++ b/core/txpool/blobpool/blobpool.go @@ -1476,17 +1476,12 @@ func (p *BlobPool) AvailableBlobs(vhashes []common.Hash) int { // Add inserts a set of blob transactions into the pool if they pass validation (both // consensus validity and pool restrictions). func (p *BlobPool) Add(txs []*types.Transaction, sync bool) []error { - var ( - errs = make([]error, len(txs)) - adds = make([]*types.Transaction, 0, len(txs)) - ) + errs := make([]error, len(txs)) for i, tx := range txs { if errs[i] = p.ValidateTxBasics(tx); errs[i] != nil { continue } - if errs[i] = p.add(tx); errs[i] == nil { - adds = append(adds, tx.WithoutBlobTxSidecar()) - } + errs[i] = p.add(tx) } return errs }