8000 Full State Snapshots · Issue #4 · holochain-open-dev/y-holochain · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Full State Snapshots #4
Open
Open
@mattyg

Description

@mattyg

Store full state snapshots in DHT to reduce the workload for a new peer to get up-to-date.

struct Snapshot {
  data: Vec<u8>,
  hashes: Vec<ActionHash> // hashes of all update statevectors included
}
  • On regular interval

    • Check if my agent pub key is closest to assigned key based on my timestamp (to reduce redundant snapshots)
      • get all agents associated with document, order ascending
      • get timestamp
      • calculate timestamp % number of agents
      • pick the agent at that index
      • if the agent is me, continue
    • get last snapshot + all updates since last snapshot, merge into single statevector
    • publish statevector as snapshot, specify hash of all updates included within it
  • When new agent joins

    • fetch latest snapshot
    • fetch all statevectors not included in latest snapshot
    • merge latest snapsho with statevectors
    • apply to ydoc

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0