Skip to content

Instantly share code, notes, and snippets.

@Isaac-DeFrain
Created May 14, 2021 20:17
Show Gist options
  • Save Isaac-DeFrain/a4d359c969868ef82e6f6af4b9e70f8c to your computer and use it in GitHub Desktop.
Save Isaac-DeFrain/a4d359c969868ef82e6f6af4b9e70f8c to your computer and use it in GitHub Desktop.
Bootstrapping improvement ideas

Ideas

  • add variables:
    • chain_lengths : GOOD_BOOTSTRAPPING -> Nodes -> Levels \cup {0}
    • merkle_roots : GOOD_BOOTSTRAPPING -> Nodes -> Levels \cup {0} -> Hashes
  • collecting data:
    • query all peers for current chain_length
    • decide what is the longest_majority_chain_length
    • collect the merkle_root for longest_majority_chain_length prefix from all peers
  • if majority agree on merkle_root of this prefix, then we're safe and can start requesting all merkle hashes and ultimately headers and ops
  • if majority does not agree on level longest_majority_chain_length, request the merkle_root of level longest_majority_chain_length - 1 from all peers
    • eventually, at a sufficiently low level, a majority will agree on the merkle_root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment