From 9504015031a7299f22a9827ff0eded74a95c66f8 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 31 Jan 2024 19:03:01 +0200 Subject: feat(tvix/castore/blobsvc): validate StatBlobResponse All chunks must have valid blake3 digests. It is allowed to send an empty list, if no more granular chunking is available. Change-Id: I7ecb53579cdf40fd938bb68a85685751b4d3626f Reviewed-on: https://cl.tvl.fyi/c/depot/+/10726 Tested-by: BuildkiteCI Reviewed-by: Connor Brewster Autosubmit: flokli --- tvix/castore/src/blobservice/grpc.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tvix/castore/src/blobservice') diff --git a/tvix/castore/src/blobservice/grpc.rs b/tvix/castore/src/blobservice/grpc.rs index acc0125c82ed..d98a9b517724 100644 --- a/tvix/castore/src/blobservice/grpc.rs +++ b/tvix/castore/src/blobservice/grpc.rs @@ -129,6 +129,10 @@ impl BlobService for GRPCBlobService { Err(e) => Err(io::Error::new(io::ErrorKind::Other, e)), Ok(resp) => { let resp = resp.into_inner(); + + resp.validate() + .map_err(|e| std::io::Error::new(io::ErrorKind::InvalidData, e))?; + if resp.chunks.is_empty() { warn!("chunk list is empty"); } -- cgit 1.4.1