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:

  1. Consensus state (small, frequently updated): canonical ledger facts and compact indices.
  2. 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:

  • NodeRecord table (including marketOutIndexRoot and nodeAttrRoot)
  • full adjacency lists as EdgeRecord arrays (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 validate marketId derivation 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 NodeRecord and a few EdgeRecord openings
  • 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_t is 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_t by applying deltas in canonical order, then derive NodeRecord, adjacency structures, and alias tables deterministically.
  • Builder/serving role: anyone can build and serve SnapshotBlob_t (content-addressed by SnapshotBlobHash_t), while validators finalize as 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.

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_t as an external blob store keyed by SnapshotBlobHash_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