From ac2a6b22183989d81a4a60ca766efeacf14711e0 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Wed, 3 Sep 2025 12:28:16 +0200 Subject: [PATCH] eth/catalyst: enforce all blobs or nil on getBlobsV2 Signed-off-by: Csaba Kiraly --- eth/catalyst/api.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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