chore(tvix/proto/castore.proto) rename *Node.{ref->digest}

As per the discussion in
https://cl.tvl.fyi/c/depot/+/7128/2..5/tvix/proto/castore.proto#b39, ref
sounds more like an external, stateful ID. Call this `digest`, to make
clear it's precisely this.

Change-Id: I81dd3769e2ce017de470ae92f72a38fb72015f10
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7134
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Reviewed-by: Adam Joseph <adam@westernsemico.com>
This commit is contained in:
Florian Klink 2022-10-30 11:32:22 +01:00 committed by flokli
parent 5731fbbee3
commit 41883b6c08

View file

@ -24,13 +24,17 @@ message DirectoryNode {
// The (base)name of the directory
string name = 1;
// The blake3 hash of a Directory message, serialized in protobuf canonical form.
bytes ref = 2;
// Number of child elements in the Directory referred to by ref.
// Calculated by summing up the numbers of `directories`, `files` and `symlinks`,
// and for each directory, its size field. Used for inode number calculation
// TODO(flokli): These numbers can't really be verified until you know the whole graph.
// Is this a problem? Should we instead only have this field
// in our local representation?
bytes digest = 2;
// Number of child elements in the Directory referred to by `digest`.
// Calculated by summing up the numbers of `directories`, `files` and
// `symlinks`, and for each directory, its size field. Used for inode
// number calculation.
// This field is precisely as verifiable as any other Merkle tree edge.
// Resolve `digest`, and you can compute it incrementally. Resolve the
// entire tree, and you can fully compute it from scratch.
// A credulous implementation won't reject an excessive size, but this is
// harmless: you'll have some ordinals without nodes. Undersizing is
// obvious and easy to reject: you won't have an ordinal for some nodes.
uint32 size = 3;
}
@ -38,8 +42,8 @@ message DirectoryNode {
message FileNode {
// The (base)name of the file
string name = 1;
// The blake3 hash of the file contents
bytes ref = 2;
// The blake3 digest of the file contents
bytes digest = 2;
// The file content size
uint32 size = 3;
// Whether the file is executable