From 6edc2182d113f325d6990684b750707e60123e58 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 3 Apr 2023 22:36:03 +0200 Subject: docs(tvix/store): update comment regarding reachability check This might be more understandable. Change-Id: I91371d304a9a316a2934ce41929998eaef67e11c Reviewed-on: https://cl.tvl.fyi/c/depot/+/8416 Autosubmit: flokli Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/store/src/proto/grpc_directoryservice_wrapper.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'tvix/store/src/proto') diff --git a/tvix/store/src/proto/grpc_directoryservice_wrapper.rs b/tvix/store/src/proto/grpc_directoryservice_wrapper.rs index 73036229208c..35af132215e9 100644 --- a/tvix/store/src/proto/grpc_directoryservice_wrapper.rs +++ b/tvix/store/src/proto/grpc_directoryservice_wrapper.rs @@ -146,15 +146,12 @@ impl } } - // TODO: We don't validate the currently received directory refers - // to at least one child we already received. - // This means, we thoeretically allow uploading multiple disconnected graphs, - // and the digest of the last element in the stream becomes the root node. - // For example, you can upload a leaf directory A, a leaf directory - // B, and then as last element a directory C that only refers to A, - // leaving B disconnected. - // At some point, we might want to populate a datastructure that - // does a reachability check. + // NOTE: We can't know if a directory we're receiving actually is + // part of the closure, because we receive directories from the leaf nodes up to + // the root. + // The only thing we could to would be doing a final check when the + // last Directory was received, that all Directories received so far are + // reachable from that (root) node. let dgst = directory.digest(); seen_directories_sizes.insert(dgst, directory.size()); -- cgit 1.4.1