hotstuff_rs::block_sync

Module server

source
Expand description

Implements the BlockSyncServer for the block sync protocol, which helps the replicas lagging behind catch up with the head of the blockchain in a safe and live manner.

A replica might be lagging behind for various reasons, such as network outage, downtime, or deliberate action by Byzantine leaders.

The server’s responsibility as part of the protocol is to:

  1. Respond to block sync requests (“block sync process” part of the protocol).
  2. Periodically broadcast advertisements which serve to notify other replicas about the server’s availability and view of the blockchain (“block sync trigger” and “block sync server selection”).

§Block sync process

As part of the sync process, the server responds to any received sync requests with blocks starting from a given start height. The number of blocks sent back in a response is limited by a configurable limit.

The client side of this protocol is explained here.

§Block sync trigger and block sync server selection

Maintaining a sync server that periodically notifies other replicas about its state of the block tree and its availability plays an important role in ensuring that lagging replicas try to sync when there is evidence that they are lagging behind, and that they sync with a peer who is ahead of them.

A block sync server notifies others about its availability and state of the block tree by broadcasting BlockSyncAdvertiseMessages.

Structs§