Skip to content

feat: Design and implement a new sync model that doesn't rely on full block history #510

@sanjayprabhu

Description

@sanjayprabhu

Snapchain currently syncs in two ways:

  • Snapshot sync which syncs block state and account state at the same time by downloading a copy of the db
  • block sync which syncs and replays blocks to regenerate current account state from historical transactions

Because snapchain design intends to throw away vast majority of historical blocks, we need an additional sync mechansim that's decentralized and works with nodes that don't have full block history.

Ideally, it would work like this:

  1. When you start a brand new node, it fetches the latest block.
  2. For all accounts in that block, atomically fetch the account state as of that block via a new API
  3. Persist account state, verify the merkle roots match for the account and proceed to the next block and repeat the process.
  4. Deal with complications like rapidly changing accounts, byzantine peers, etc

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions