mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
improve comments
This commit is contained in:
parent
b394cfffe3
commit
ea7deacb76
4 changed files with 9 additions and 5 deletions
|
|
@ -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 (
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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)))
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue