Performance & Storage
How Local Protocol keeps consensus-critical state small while storing the full graph in large epochal snapshot artifacts.
Local Protocol is graph-heavy, but its consensus-critical state stays small and bounded per transaction. The system splits “graph state” into two layers:
- Consensus state (small, frequently updated): canonical ledger facts and compact indices.
- Snapshot artifacts (large, epochal blobs): the full adjacency + sampling structures used for diffusion claims and audits (see Optimistic Diffusion Claims and Validator Audits & Penalties).
See: Graph Commitments & Epoch Snapshots.
This matches the broader “data-availability–first” pattern: the chain orders data and commits to it, while verifiers fetch only what they need (e.g., LazyLedger).
1) What lives in consensus state (small, bounded writes)
Consensus state includes:
- Ledger facts: balances, escrow/dispute state, finalized service outcomes
- Edge delta log (append-only): compact per-transaction deltas like
(src, dst, marketId, Δweight, flags)plus proof/dispute references - Compact per-node accumulators: e.g.
outWeightSum[u] += Δand small penalty/strike counters updated by finalized audits - Claim metadata + bonds:
commitHash,transcriptRoot,bond, and claim status (pending/valid/invalid)
2) What lives in the epoch snapshot artifact (large, blob-backed)
The epoch snapshot artifact SnapshotBlob_t contains the full data needed to replay diffusion walk steps and verify sampling:
NodeRecordtable (includingmarketOutIndexRootandnodeAttrRoot)- full adjacency lists as
EdgeRecordarrays (Merkleized per node) - per-market per-node alias tables (via each node’s
OutIndex(m).aliasRoot, or an equivalent O(1) sampling structure) - per-market teleport seed tables
(or equivalent structures to sample from them, optionally via per-market seed alias tables) - epoch parameters needed for deterministic replay (e.g., claim/audit params, caps)
- the canonical MarketRegistry table for epoch
: marketContext → (marketId, vault, feeRouter, flags)(so auditors can validatemarketIdderivation and market membership rules against snapshot commitments)
The chain commits to the snapshot artifact via:
(Merkle commitment to graph records) (Merkle commitment to per-market teleport seed roots) SnapshotBlobHash_t(content hash of the blob serialization)(an identifier binding the above)
3) How auditors fetch data without downloading the whole graph
Auditors verifying a claim typically fetch only:
- a small number of opened walk steps
- the corresponding
NodeRecordand a fewEdgeRecordopenings - alias-table openings (or equivalent) to prove correct neighbor sampling
- Merkle proofs against
/ - the referenced snapshot blob bytes for those openings
This is the “download small pieces, verify against commitments” model used by authenticated data structures (Merkle trees: Merkle, 1987).
4) Data availability requirements
Audits depend on snapshot bytes being retrievable. Availability is therefore part of epoch finalization:
- a snapshot finalizes only when
SnapshotBlob_tis available in the data layer - nodes can check availability probabilistically with Data Availability Sampling (DAS) (e.g., LazyLedger)
5) Snapshot construction and correctness
The snapshot artifact must correspond to the fact-layer deltas finalized during the epoch.
A concrete pattern:
- Deterministic build rule: given the finalized edge delta log for epoch
and the prior snapshot artifact, build the new SnapshotBlob_tby applying deltas in canonical order, then deriveNodeRecord, adjacency structures, and alias tables deterministically. - Builder/serving role: anyone can build and serve
SnapshotBlob_t(content-addressed bySnapshotBlobHash_t), while validators finalizeas the epoch’s canonical artifact identifier. - Sampled verification: a protocol-chosen sample of nodes/edges is checked each epoch by opening:
- a few
NodeRecord/ adjacency roots from the blob - corresponding Merkle proofs against
- and spot-checking that opened adjacency entries reflect finalized deltas.
- a few
If a sampled check fails, validators reject finalization of the artifact identifier and/or slash the responsible publisher(s) under policy.
6) Practical guidance (implementers and simulators)
- Keep consensus state writes small and append-only for graph deltas
- Model
SnapshotBlob_tas an external blob store keyed bySnapshotBlobHash_t - Ensure auditors can request and obtain Merkle openings into the snapshot blob
- Prefer keeping full adjacency/sampling structures in the snapshot artifact layer, not in authenticated VM state