snarkOS
snarkOS copied to clipboard
Implement fast-sync and syncing for Validator nodes
Motivation
This PR implements fast sync and standard (naive) syncs.
A validator node will first attempt to fast-sync the node (for non-development nodes only). Once the fast sync is completed, the node will attempt to sync to any node that has a larger block height.
Currently each peer's block height is found from Ping and CoinbasePuzzle messages. Additionally, UnconfirmedBlock messages are now processed by the validator before attempting to broadcast.
Notable changes:
BlockRequestandBlockResponsesupport multiple blocks (currently limited to 10).Pingmessages now have an optionalblock_heightvariable.- Beacon and Validator nodes now have a custom handler to send their block heights.