snarkOS icon indicating copy to clipboard operation
snarkOS copied to clipboard

Implement fast-sync and syncing for Validator nodes

Open raychu86 opened this issue 3 years ago • 0 comments

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:

  • BlockRequest and BlockResponse support multiple blocks (currently limited to 10).
  • Ping messages now have an optional block_height variable.
    • Beacon and Validator nodes now have a custom handler to send their block heights.

raychu86 avatar Nov 11 '22 07:11 raychu86