webtessera/api/layout
Contains routines for specifying the path layout of Tessera logs, which is really to say that it provides functions to calculate paths used by the tlog-tiles API.
It ports the Go package tessera/api/layout.
Its source is src/api/layout/index.ts.
Functions
entriesPath- EntriesPath returns the local path for the nth entry bundle. p denotes the partial tile size, or 0 if the tile is complete.
entriesPathForLogIndex- EntriesPathForLogIndex builds the local path at which the leaf with the given index lives in.
nodeCoordsToTileAddress- NodeCoordsToTileAddress returns the (TileLevel, TileIndex) in tile-space, and the (NodeLevel, NodeIndex) address within that tile of the specified tree node co-ordinates.
nWithSuffix- NWithSuffix returns a tiles-spec "N" path, with a partial suffix if p > 0.
parseTileIndexPartial- ParseTileIndexPartial takes index in string, validates and returns the index and width in uint64.
parseTileLevel- ParseTileLevel takes level in string, validates and returns the level in uint64.
parseTileLevelIndexPartial- ParseTileLevelIndexPartial takes level and index in string, validates and returns the level, index and width in uint64.
partialTileSize- PartialTileSize returns the expected number of leaves in a tile at the given tile level and index within a tree of the specified logSize, or 0 if the tile is expected to be fully populated.
range- Range returns an iterator over a list of RangeInfo structs which describe the bundles/tiles necessary to cover the specified range of individual entries/hashes
from, min(from+N, treeSize) ). tilePath- TilePath builds the path to the subtree tile with the given level and index in tile space.
Interfaces
RangeInfo- RangeInfo describes a specific range of elements within a particular bundle/tile.
TileAddress- TileAddress is the address of a tree node in tile space.
TileIndexPartial- TileIndexPartial is what ParseTileIndexPartial returns.
TileLevelIndexPartial- TileLevelIndexPartial is what ParseTileLevelIndexPartial returns.
Constants and variables
CheckpointPath- CheckpointPath is the location of the file containing the log checkpoint.
EntryBundleWidth- EntryBundleWidth is the maximum number of entries which can be present in an EntryBundle.
TileHeight- TileHeight is the maximum number of levels Merkle tree levels a tile represents.
TileWidth- TileWidth is the maximum number of hashes which can be present in the bottom row of a tile.