package irmin-pack
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=088741b619471c8198e74aaf9f4aeb4a9997abec8b9abcbfb3443fd27bfb433f
sha512=bbc03417d6eb87d99bee391c489d23a586b0a260e4c797f5e2465c3ab67cb627a9efa526097c1b89dd3339eafb8bad738c1cf0502e5c70355871ff7dbba324b9
doc/irmin-pack.layered/Irmin_pack_layered/Checks/Make/argument-2-Store/Tree/Proof/index.html
Module Tree.Proof
Proofs are compact representations of Irmin trees which can be shared between an Irmin node and a client.
The protocol is the following:
- The Irmin node runs a function
fover a treet. While performing this computation, the node records: the hash oft(calledbeforebelow), the hash off t(calledafterbelow) and a subset oftwhich is needed to replayfwithout any access to the node's storage. Once done, the node packs this into a proofpand sends this to the client.
- The client generates an initial tree
t'frompand computesf t'. Once done, it comparest''s hash andf t''s hash tobeforeandafter. If they match, they know that the result statef t'is a valid state of Irmin, without having to have access to the full node's storage.
The type for (internal) inode proofs.
These proofs encode large directories into a more efficient tree-like structure.
Invariant are dependent on the backend.
length is the total number of entries in the chidren of the inode. E.g. the size of the "flattened" version of that inode. This is used by some backend (like irmin-pack) to efficiently implements paginated lists and an optimized lenght function.
For irmin-pack: proofs have a length of at most Conf.entries entries. This list can be sparse so every proof is indexed by their position between 0 ... (Conf.entries-1). For binary trees, this boolean index is a step of the left-right sequence / decision proof corresponding to the path in that binary tree.
val inode_t : 'a Irmin__.Type.t -> 'a inode Irmin__.Type.tThe type for inode extenders.
val inode_extender_t : 'a Irmin__.Type.t -> 'a inode_extender Irmin__.Type.ttype tree = | Contents of contents * metadata| Blinded_contents of hash * metadata| Node of (step * tree) list| Blinded_node of hash| Inode of inode_tree inode| Extender of inode_tree inode_extender
The type for compressed and partial Merkle tree proofs.
Tree proofs do not provide any guarantee with the ordering of computations. For instance, if two effects commute, they won't be distinguishable by this kind of proofs.
Blinded_node h is a shallow pointer to a node having hash h.
Node ls is a "flat" node containing the list of files ls. The length of ls depends on the backend. For instance, it can be unbounded for most of the backends, while it is at most Conf.stable_hash entries for irmin-pack.
Inode i is an optimized representation of a node as a tree. Pointers in that trees would refer to blinded nodes, nodes or to other inodes. E.g. Blinded content nor contents is not expected to appear directly in an inodes.
Blinded_contents (h, m) is a shallow pointer to contents having hash h and metadata m.
Contents c is the contents c.
and inode_tree = | Blinded_inode of hash| Inode_values of (step * tree) list| Inode_tree of inode_tree inode| Inode_extender of inode_tree inode_extender
val tree_t : tree Irmin__.Type.tval inode_tree_t : inode_tree Irmin__.Type.tval kinded_hash_t : kinded_hash Irmin__.Type.ttype elt = | Contents of contents| Node of (step * kinded_hash) list| Inode of hash inode| Inode_extender of hash inode_extender
val elt_t : elt Irmin__.Type.tThe type for stream proofs. Stream poofs provides stronger ordering guarantees as the read effects have to happen in the exact same order and they are easier to verify.
val stream_t : stream Irmin__.Type.tval t : 'a Irmin__.Type.t -> 'a t Irmin__.Type.tval v : before:kinded_hash -> after:kinded_hash -> 'a -> 'a tv ~before ~after p proves that the state advanced from before to after. p's hash is before, and p contains the minimal information for the computation to reach after.
val before : 'a t -> kinded_hashbefore t it the state's hash at the beginning of the computation.
val after : 'a t -> kinded_hashafter t is the state's hash at the end of the computation.
val state : 'a t -> 'aproof t is a subset of the initial state needed to prove that the proven computation could run without performing any I/O.