Skip to content

Instantly share code, notes, and snippets.

@majecty
Last active January 23, 2020 05:13
Show Gist options
  • Save majecty/770c4ab12c8e654b17aaff60e1f0d095 to your computer and use it in GitHub Desktop.
Save majecty/770c4ab12c8e654b17aaff60e1f0d095 to your computer and use it in GitHub Desktop.
// This is pseudo-code of downloading a snapshot.
roots <- set { state_root }
while let Some(root) = roots.pop_any() {
c = download_chunk(root);
assert root == merklize(c)
store(c)
roots.insert(all children of terminal Branches in c)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment