Expand description
Binary serialization for shard trees and checkpoints.
Shared between crate::kv_shard_store and any future persistence layer.
§Shard format
[version: u8 = 1]
[tree: node]
node :=
0x00 -- Nil
0x01 [hash: 32 bytes] [flags: u8] -- Leaf
0x02 [has_ann: u8] [hash: 32 bytes if has_ann=1] [left: node] [right: node] -- Parent§Checkpoint format
[has_position: u8] [position: u64 LE if has_position=1]
[marks_count: u32 LE] [mark_position: u64 LE] × marks_countFunctions§
- read_
checkpoint - Deserialize a checkpoint blob produced by
write_checkpoint. - read_
shard_ vote - Deserialize a shard blob produced by
write_shard_vote. - write_
checkpoint - Serialize a
Checkpointto bytes. - write_
shard_ vote - Serialize a
PrunableTree<MerkleHashVote>to a versioned blob.