Skip to main content

Module layout

Module layout 

Source
Expand description

Tile coordinates, store paths and the widths a tree size gives each level, as C2SP tlog-tiles (https://c2sp.org/tlog-tiles) fixes them.

A tile at level l holds up to 256 hashes; hash i of tile n is the RFC 9162 root over leaves [(n * 256 + i) * 256^l, (n * 256 + i + 1) * 256^l). Level 0 holds leaf hashes. A full tile has 256 hashes; a partial tile has 1 to 255 and is never hashed into the level above.

Structs§

Layout
The tiles a tree of one size is stored as.
Tile
One tile: its level, its index within the level and how many hashes it holds. width is 256 for a full tile and 1 to 255 for a partial one.

Constants§

CHECKPOINT
Store path of the signed checkpoint.
HASH_SIZE
Bytes per hash.
MANIFEST
Store path of the manifest over the sealed bundles.
MAX_ENTRY_LEN
The longest entry a bundle can length-prefix.
PUBLISH_LOCK
Store path of the checkpoint lock.
TILE_HEIGHT
log2(TILE_WIDTH): the tree height one tile level covers.
TILE_WIDTH
Hashes per full tile, and entries per full bundle.
TREE_STATE
Store path of the mutable tree state (size and root), written last.
TREE_STATE_LOCK
Store path of the writer lock.

Functions§

entries_path
tile/entries/<N> for a full bundle, tile/entries/<N>.p/<W> for the partial one.
index_path
tile/index/<N>, the key sidecar of sealed bundle N.
parse_entries_path
The (bundle index, width) an entries path names.
parse_index_path
The bundle index a sidecar path names.
parse_path_elements
The index path_elements wrote, or nothing when the text is not that.
path_elements
<N> as zero-padded 3-digit elements, all but the last prefixed x: 1234067 is x001/x234/067.