Skip to main content

Module versioned

Module versioned 

Source
Expand description

Git-model versioned storage: branches, commits, merge, and history.

Git-model versioned storage built on the persistent B+ tree.

§Concepts

Gitvsdb
tree objectNodeId (root of a B+ tree)
commitCommit
ref/branchBranchId → mutable pointer
working diruncommitted writes on a branch
git gcVerMap::gc

A version is a complete, self-contained snapshot (a B+ tree root). Branches are lightweight pointers. Structural sharing keeps storage costs proportional to the number of changes, not the dataset size.

§Workflow

new()  ──►  insert / remove  ──►  commit()
                 ▲                    │
                 │                    ▼
             discard()         create_branch()
                 ▲                    │
                 │                    ▼
           rollback_to()    insert / remove / commit
                                      │
                                      ▼
                                  merge()  ──►  delete_branch()
                                                   (ref-count GC)
                                                      │
                                                  gc() (B+ tree nodes)

§Merkle proofs

VerMapWithProof wraps a VerMap<K, V> with an MptCalc (or SmtCalc) to provide a 32-byte Merkle root commitment over the versioned state. See the trie module for details.

Modules§

map
VerMap — a typed, versioned key-value map with branch / commit / merge support, modelled after Git semantics.

Structs§

BranchId
Identifies a branch.
Commit
An immutable snapshot in the version history.
CommitId
Identifies a commit in the history DAG.
Snapshot
A read-only view of one immutable map state: a historical commit (VerMap::at) or a branch’s working state as of when the view was taken (VerMap::snapshot).

Enums§

DiffEntry
A single difference between two map states, decoded.