diff --git a/disperser/apiserver/server.go b/disperser/apiserver/server.go index eda0553389..4dbf48de20 100644 --- a/disperser/apiserver/server.go +++ b/disperser/apiserver/server.go @@ -727,6 +727,12 @@ func (s *DispersalServer) RetrieveBlob(ctx context.Context, req *pb.RetrieveBlob return nil, api.NewInternalError("failed to get blob metadata, please retry") } + if blobMetadata.Expiry < uint64(time.Now().Unix()) { + s.metrics.HandleNotFoundRpcRequest("RetrieveBlob") + s.metrics.HandleNotFoundRequest("RetrieveBlob") + return nil, api.NewNotFoundError("no metadata found for the given batch header hash and blob index") + } + // Check throughout rate limit blobSize := encoding.GetBlobSize(blobMetadata.ConfirmationInfo.BlobCommitment.Length)