Tezos_context_brassaia.Tezos_contextinclude module type of struct include Tezos_context_brassaia_disk.Tezos_context_disk endmodule Tezos_context_encoding =
Tezos_context_brassaia_disk.Tezos_context_disk.Tezos_context_encodingContext 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.
module type TEZOS_CONTEXT_UNIX =
Tezos_context_brassaia_disk.Tezos_context_disk.TEZOS_CONTEXT_UNIXmodule Context_binary =
Tezos_context_brassaia_disk.Tezos_context_disk.Context_binarymodule Context = Tezos_context_brassaia_disk.Tezos_context_disk.ContextThe context of a tezos node. Persisted to disk.