From ea7deacb76f5951ff09d61469411e964aa147290 Mon Sep 17 00:00:00 2001 From: healthykim Date: Mon, 15 Jun 2026 23:10:17 +0200 Subject: [PATCH] improve comments --- core/txpool/blobpool/blobpool.go | 2 +- core/txpool/blobpool/cache.go | 2 +- eth/fetcher/tx_fetcher.go | 2 +- eth/protocols/eth/broadcast.go | 8 ++++++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/core/txpool/blobpool/blobpool.go b/core/txpool/blobpool/blobpool.go index 9370fc0f8f..a2230c9d49 100644 --- a/core/txpool/blobpool/blobpool.go +++ b/core/txpool/blobpool/blobpool.go @@ -1822,7 +1822,7 @@ func (p *BlobPool) GetBlobHashes(txHash common.Hash) []common.Hash { return vhashes } -// GetBlobCells returns cells for the given versioned blob hashes. Nil entires +// GetBlobCells returns cells for the given versioned blob hashes. Nil entries // mean that the cell was not available. func (p *BlobPool) GetBlobCells(vhashes []common.Hash, mask types.CustodyBitmap) ([][]*kzg4844.Cell, [][]*kzg4844.Proof, error) { var ( diff --git a/core/txpool/blobpool/cache.go b/core/txpool/blobpool/cache.go index 4cb1238d74..4dedda4170 100644 --- a/core/txpool/blobpool/cache.go +++ b/core/txpool/blobpool/cache.go @@ -247,7 +247,7 @@ func (c *Cache) GetBlobs(ctx context.Context, vhashes []common.Hash, version byt } // GetCells returns cells for the given versioned blob hashes, filtered -// by the requested cell indices(mask). Each entry in the result +// by the requested cell indices (mask). Each entry in the result // corresponds to one vhash. Nil entries mean the cell was not available. // If the cell is not available in cache, it falls back to the blobpool. func (c *Cache) GetCells(vhashes []common.Hash, mask types.CustodyBitmap) ([][]*kzg4844.Cell, [][]*kzg4844.Proof, error) { diff --git a/eth/fetcher/tx_fetcher.go b/eth/fetcher/tx_fetcher.go index 55eef46e0c..faec919367 100644 --- a/eth/fetcher/tx_fetcher.go +++ b/eth/fetcher/tx_fetcher.go @@ -238,7 +238,7 @@ func NewTxFetcherForTests( } // Notify announces the fetcher of the potential availability of a new batch of -// transactions in the network. +// transactions in the network. It returns array of hashes decided to be fetched. func (f *TxFetcher) Notify(peer string, kinds []byte, sizes []uint32, hashes []common.Hash) ([]common.Hash, error) { // Keep track of all the announced transactions txAnnounceInMeter.Mark(int64(len(hashes))) diff --git a/eth/protocols/eth/broadcast.go b/eth/protocols/eth/broadcast.go index c8069b2552..1a934b067b 100644 --- a/eth/protocols/eth/broadcast.go +++ b/eth/protocols/eth/broadcast.go @@ -121,12 +121,16 @@ func (p *Peer) announceTransactions() { if meta := p.txpool.GetMetadata(queue[count]); meta != nil { custody := p.blobpool.GetCustody(queue[count]) if custody != nil { - // blob tx + // Blob txs should be batched into the same announcement + // if they share the same custody. if mask.OneCount() == 0 { + // This is the first blob tx in this batch, so use its + // custody as a mask in this batch. mask = *custody } else { if mask != *custody { - // group by mask + // Leave this in the queue so that it can be included + // in a later announcement. continue } }