eth/catalyst: fix getBlobsV3 partial/complete metrics (#34666)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run

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 <bsbs8645@snu.ac.kr>
This commit is contained in:
Lessa 2026-05-12 06:16:44 -04:00 committed by GitHub
parent d446676fc4
commit ab28bda83e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)