mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 16:59:26 +00:00
eth/catalyst: refactor
This commit is contained in:
parent
94ba237031
commit
af6da4b13a
1 changed files with 4 additions and 9 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue