Expand description
Validator blockchain sync protocol
Structsยง
- Fork
Header Hash Request - Structure represening a request to ask a node a fork header for the requested height. The fork is identified by the provided header hash.
- Fork
Header Hash Response - Structure representing the response to
ForkHeaderHashRequest
, containing the requested fork header hash, if it was found. - Fork
Headers Request - Structure represening a request to ask a node for up to
BATCH
fork headers for provided header hashes. The fork is identified by the provided header hash. - Fork
Headers Response - Structure representing the response to
ForkHeadersRequest
, containing up toBATCH
fork headers. - Fork
Proposals Request - Structure represening a request to ask a node for up to
BATCH
fork proposals for provided header hashes. The fork is identified by the provided header hash. - Fork
Proposals Response - Structure representing the response to
ForkProposalsRequest
, containing up toBATCH
fork headers. - Fork
Sync Request - Structure represening a request to ask a node a fork sequence. If we include a specific fork tip, they have to return its sequence, otherwise they respond with their best fork sequence. We also include our own canonical(confirmed) tip, so they can verify we follow the same sequence.
- Fork
Sync Response - Structure representing the response to
ForkSyncRequest
, containing the requested fork sequence, up toBATCH
proposals. - Header
Sync Request - Structure represening a request to ask a node for up to
BATCH
headers before the provided header height. - Header
Sync Response - Structure representing the response to
HeaderSyncRequest
, containing up toBATCH
headers before the requested block height. - Protocol
Sync Handler - Handler managing all
ProtocolSync
messages, over generic P2P protocols. - Sync
Request - Structure represening a request to ask a node for up to
BATCH
blocks of provided headers. - Sync
Response - Structure representing the response to
SyncRequest
, containing up toBATCH
blocks after the requested block height. - TipRequest
- Structure represening a request to ask a node for their current canonical(confirmed) tip block hash, if they are synced. We also include our own tip, so they can verify we follow the same sequence.
- TipResponse
- Structure representing the response to
TipRequest
, containing a boolean flag to indicate if we are synced, and our canonical(confirmed) tip block height and hash.
Constantsยง
Functionsยง
- handle_
receive_ ๐fork_ header_ hash_ request - Background handler function for ProtocolSyncForkHeaderHash.
- handle_
receive_ ๐fork_ headers_ request - Background handler function for ProtocolSyncForkHeaders.
- handle_
receive_ ๐fork_ proposals_ request - Background handler function for ProtocolSyncForkProposals.
- handle_
receive_ ๐fork_ request - Background handler function for ProtocolSyncFork.
- handle_
receive_ ๐header_ request - Background handler function for ProtocolSyncHeader.
- handle_
receive_ ๐request - Background handler function for ProtocolSync.
- handle_
receive_ ๐tip_ request - Background handler function for ProtocolSyncTip.
Type Aliasesยง
- Protocol
Sync Handler Ptr - Atomic pointer to the
ProtocolSync
handler.