Snapshot types
Tessellation defines two paired snapshot families — one for the global DAG and one for individual metagraphs — each with a full variant (genesis or migration) and an incremental variant (normal operation).GlobalSnapshot
The genesis snapshot type. Contains the complete ledger state: all balances, all blocks, all state-channel snapshots, and reward transactions. Used only at network initialisation via
GlobalSnapshot.mkGenesis.GlobalIncrementalSnapshot
The normal operating type. A delta relative to the previous snapshot — it carries only what changed, plus a
stateProof that commits to the full state via Merkle roots.CurrencySnapshot
Full snapshot for a single metagraph (currency L0). Used at metagraph genesis. Analogous to
GlobalSnapshot but scoped to one state channel.CurrencyIncrementalSnapshot
Delta snapshot for a metagraph. Submitted by
CurrencyL0 to GlobalL0 via POST /state-channels/{address}/snapshot.GlobalIncrementalSnapshot fields
Option[...] default to Some(SortedSet.empty) / Some(SortedMap.empty) when absent, preserving backward compatibility with GlobalIncrementalSnapshotV1.
The snapshot ordinal system
Every snapshot is identified by aSnapshotOrdinal, a refined non-negative Long:
Next[SnapshotOrdinal] instance always adds 1. The genesis snapshot starts at SnapshotOrdinal.MinValue (ordinal 0). Incremental snapshots begin at MinIncrementalValue (ordinal 1).
The ordinal is the primary key for snapshot queries and consensus round identification:
SnapshotOrdinal uses a refined type (NonNegLong) for compile-time validation — negative ordinals cannot be constructed.Snapshot creation flow
Events enqueued via L0Cell
Incoming L1 blocks and state-channel snapshots are processed by
L0Cell using a hylomorphism (unfold → fold). Events are enqueued and made available to the consensus daemon.Consensus daemon publishes to facilitators
The consensus daemon selects facilitators and distributes the pending events. Each facilitator independently builds a candidate
GlobalIncrementalSnapshot.Facilitators create proposal artifacts
A proposal includes the candidate snapshot, its hash, and the facilitator’s signature. Proposals are exchanged peer-to-peer during
CollectingProposals.Signatures collected, snapshot finalised
Majority and binary signatures are gathered (phases 3 and 4 of the FSM). The snapshot is considered final once
Finished is reached.State proofs: Merkle Patricia Trie roots
EachGlobalIncrementalSnapshot embeds a GlobalSnapshotStateProof that commits to the full current ledger state without repeating it:
State proofs are computed per snapshot, not per transaction. The Merkle Patricia Trie implementation lives in
shared/security/mpt/ and produces roots over sorted maps of state, enabling compact inclusion proofs.gsi.stateProof[F](ordinal) before the candidate snapshot is included in a proposal.
Storage and querying
Finished snapshots are persisted and exposed through the Global L0 HTTP API:stateProof and info fields.
