package octez-libs
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=55ea1fb8bb3273a7fc270ca8f650d45c56449665619482aad9bc12f3ea736b7e
sha512=fec850fc2d17d7490bbabd5147d62aad13b3aaed8774270f8a38ab419670ed03e0fd30cf8642a97984eca5c2446726fe590ad99c015f7ec50919dc7652f25053
doc/tezos_context_disk/Tezos_context_disk/index.html
Module Tezos_context_diskSource
Context comes with two variants: Context and Context_binary with different tradeoffs.
Both have different Merkle tree representations (i.e. when presented the same data, they don't produce the same hashes).
lib_context represents directories as a structured tree of inodes, instead of a flat list of files, to get efficient copy-on-write and optimised read patterns.
The context variants differ by the branching factors used for these inode trees:
Contextuses a branching factor of 32;Context_binaryuses a branching factor of 2.
To represent a large directory, Context uses less but larger inodes than Context_binary.
As persisting inodes on disk have an overhead (i.e. the serialisation of an inode is prefixed by its 32 byte hash), Context is thus optimised for storing a large quantity of data on disk.
On the opposite, as the inodes in Merkle proofs contain the hashes of the shallow siblings, Context_binary is thus optimised for producing smaller Merkle proofs.