package tezos-context
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=7062cd57addd452852598a2214ade393130efa087b99068d53713bdf912b3680
sha512=08e4091144a03ce3c107fb91a66501bd8b65ca3278917c455a2eaac6df3e108ade63f6ab8340a4bb152d60f404326e464d0ec95d26cafe8e82f870465d24a5fc
doc/tezos-context.disk/Tezos_context_disk/index.html
Module Tezos_context_disk
Source
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:
Context
uses a branching factor of 32;Context_binary
uses 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.