mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
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.
This commit is contained in:
parent
4daaaadfc4
commit
0d70f495a0
1 changed files with 6 additions and 1 deletions
|
|
@ -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))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue