From ab28bda83ecb1e73cd2549b08edfb8f3c683ea13 Mon Sep 17 00:00:00 2001 From: Lessa <230214854+adblesss@users.noreply.github.com> Date: Tue, 12 May 2026 06:16:44 -0400 Subject: [PATCH] eth/catalyst: fix getBlobsV3 partial/complete metrics (#34666) In b2843a11d, metrics check len(res) == len(hashes) but res is pre-allocated with make(), so length is always equal. Partial hit metric never fires. Count non-nil elements instead. --------- Co-authored-by: Bosul Mun --- eth/catalyst/api.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go index b81ed57a2c..1def169ae0 100644 --- a/eth/catalyst/api.go +++ b/eth/catalyst/api.go @@ -646,6 +646,7 @@ func (api *ConsensusAPI) getBlobs(hashes []common.Hash, v2 bool) ([]*engine.Blob return nil, engine.InvalidParams.With(err) } // Validate the blobs from the pool and assemble the response + filled := 0 res := make([]*engine.BlobAndProofV2, len(hashes)) for i := range blobs { // The blob has been evicted since the last AvailableBlobs call. @@ -666,10 +667,11 @@ func (api *ConsensusAPI) getBlobs(hashes []common.Hash, v2 bool) ([]*engine.Blob Blob: blobs[i][:], CellProofs: cellProofs, } + filled++ } - if len(res) == len(hashes) { + if filled == len(hashes) { getBlobsRequestCompleteHit.Inc(1) - } else if len(res) > 0 { + } else if filled > 0 { getBlobsRequestPartialHit.Inc(1) } else { getBlobsRequestMiss.Inc(1)