From 0d70f495a06bbcf4f1da60309930634b69ffc445 Mon Sep 17 00:00:00 2001 From: rayoo Date: Fri, 22 May 2026 11:03:50 +0800 Subject: [PATCH] eth/catalyst: count actually-available blobs in getBlobs After AvailableBlobs was changed to return []bool, the caller used len() on the result, which always equals len(hashes). The available metric over-reports and the v2 short-circuit before the expensive disk read is dead. Count the true entries instead. --- eth/catalyst/api.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go index a1f9673de8..507f33ab5d 100644 --- a/eth/catalyst/api.go +++ b/eth/catalyst/api.go @@ -630,7 +630,12 @@ func (api *ConsensusAPI) getBlobs(hashes []common.Hash, v2 bool) (engine.BlobAnd if len(hashes) > 128 { 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))) getBlobsAvailableCounter.Inc(int64(available))