feat(tvix/store): validate blob size in NARRenderer

Make sure the blob size in the current proto node matches what we get
back from the blob backend.

Change-Id: I939fa18f37c7bc86ada8a495c7be622e69ec47f8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8129
Tested-by: BuildkiteCI
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
This commit is contained in:
Florian Klink 2023-02-16 17:11:09 +01:00 committed by flokli
parent bc3f71838f
commit ab02fc668c
3 changed files with 115 additions and 0 deletions

View file

@ -17,6 +17,9 @@ pub enum RenderError {
#[error("unable to find blob {}, referred from {}", BASE64.encode(.0), .1)]
BlobNotFound(Vec<u8>, String),
#[error("unexpected size in metadata for blob {}, referred from {} returned, expected {}, got {}", BASE64.encode(.0), .1, .2, .3)]
UnexpectedBlobMeta(Vec<u8>, String, u32, u32),
#[error("failure using the NAR writer: {0}")]
NARWriterError(std::io::Error),
}