diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go index 07ce523462..dca245ccf1 100644 --- a/eth/catalyst/api.go +++ b/eth/catalyst/api.go @@ -541,12 +541,21 @@ func (api *ConsensusAPI) GetBlobsV2(hashes []common.Hash) ([]*engine.BlobAndProo getBlobsV2RequestMiss.Inc(1) return nil, nil } - getBlobsV2RequestHit.Inc(1) blobs, _, proofs, err := api.eth.BlobTxPool().GetBlobs(hashes, types.BlobSidecarVersion1) if err != nil { return nil, engine.InvalidParams.With(err) } + + // To comply with API spec, check again that we really got all data needed + for _, blob := range blobs { + if blob == nil { + getBlobsV2RequestMiss.Inc(1) + return nil, nil + } + } + getBlobsV2RequestHit.Inc(1) + res := make([]*engine.BlobAndProofV2, len(hashes)) for i := 0; i < len(blobs); i++ { // the blob is missing, return null as response. It should