eth/catalyst: count actually-available blobs in getBlobs (#35028)

This commit is contained in:
rayoo 2026-05-22 13:58:31 +08:00 committed by GitHub
parent 12eabbd76d
commit a059a357d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -655,7 +655,12 @@ func (api *ConsensusAPI) getBlobs(ctx context.Context, hashes []common.Hash, v2
if len(hashes) > 128 { if len(hashes) > 128 {
return nil, engine.TooLargeRequest.With(fmt.Errorf("requested blob count too large: %v", len(hashes))) return nil, engine.TooLargeRequest.With(fmt.Errorf("requested blob count too large: %v", len(hashes)))
} }
available := len(api.eth.BlobTxPool().AvailableBlobs(hashes)) available := 0
for _, ok := range api.eth.BlobTxPool().AvailableBlobs(hashes) {
if ok {
available++
}
}
getBlobsRequestedCounter.Inc(int64(len(hashes))) getBlobsRequestedCounter.Inc(int64(len(hashes)))
getBlobsAvailableCounter.Inc(int64(available)) getBlobsAvailableCounter.Inc(int64(available))