From af6da4b13aef49a3e0e5764aa05a8bf54995cf35 Mon Sep 17 00:00:00 2001 From: Bosul Mun Date: Mon, 11 May 2026 22:06:59 +0200 Subject: [PATCH] eth/catalyst: refactor --- eth/catalyst/api.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go index 2b212f4ac3..da686ff3ff 100644 --- a/eth/catalyst/api.go +++ b/eth/catalyst/api.go @@ -629,6 +629,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. @@ -649,17 +650,11 @@ func (api *ConsensusAPI) getBlobs(hashes []common.Hash, v2 bool) ([]*engine.Blob Blob: blobs[i][:], CellProofs: cellProofs, } + filled++ } - - nonNilCount := 0 - for _, r := range res { - if r != nil { - nonNilCount++ - } - } - if nonNilCount == len(hashes) { + if filled == len(hashes) { getBlobsRequestCompleteHit.Inc(1) - } else if nonNilCount > 0 { + } else if filled > 0 { getBlobsRequestPartialHit.Inc(1) } else { getBlobsRequestMiss.Inc(1)