Skip to content

Implement DagStore trait and storage node for history/archival #27

@intendednull

Description

@intendednull

Context

The DAG model needs persistent storage for per-author chains. The old EventStore trait is replaced by a new DagStore trait. Storage nodes serve as the archival tier with full DAG persistence and paginated history.

DagStore trait

pub trait DagStore {
    fn append(&mut self, event: &Event);
    fn author_events_since(&self, author: &EndpointId, after_seq: u64) -> Vec<Event>;
    fn latest_seq(&self, author: &EndpointId) -> u64;
    fn heads(&self) -> HeadsSummary;
    fn load_dag(&self) -> EventDag;
    fn save_snapshot(&mut self, snapshot: &Snapshot);
    fn load_latest_snapshot(&self) -> Option<Snapshot>;
}

Implementations needed

  • SQLite backend (native)
  • LocalStorage backend (WASM)

Storage node role

  • Ingest all events into persistent DagStore
  • Never evict events (archival)
  • Serve HistoryRequest with paginated results using HeadsSummary-based cursors
  • Serve sync with full DAG coverage
  • Provide full-replay verification for peers that don't trust snapshots

References

  • Spec: docs/specs/2026-04-01-per-author-merkle-dag-state-design.md (Section 9)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions