Module protocol_sync

Source
Expand description

Validator blockchain sync protocol

Structsยง

ForkHeaderHashRequest
Structure represening a request to ask a node a fork header for the requested height. The fork is identified by the provided header hash.
ForkHeaderHashResponse
Structure representing the response to ForkHeaderHashRequest, containing the requested fork header hash, if it was found.
ForkHeadersRequest
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.
ForkHeadersResponse
Structure representing the response to ForkHeadersRequest, containing up to BATCH fork headers.
ForkProposalsRequest
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.
ForkProposalsResponse
Structure representing the response to ForkProposalsRequest, containing up to BATCH fork headers.
ForkSyncRequest
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.
ForkSyncResponse
Structure representing the response to ForkSyncRequest, containing the requested fork sequence, up to BATCH proposals.
HeaderSyncRequest
Structure represening a request to ask a node for up to BATCH headers before the provided header height.
HeaderSyncResponse
Structure representing the response to HeaderSyncRequest, containing up to BATCH headers before the requested block height.
ProtocolSyncHandler
Handler managing all ProtocolSync messages, over generic P2P protocols.
SyncRequest
Structure represening a request to ask a node for up toBATCH blocks of provided headers.
SyncResponse
Structure representing the response to SyncRequest, containing up to BATCH 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ยง

BATCH
PROTOCOL_SYNC_METERING_CONFIGURATION ๐Ÿ”’

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ยง

ProtocolSyncHandlerPtr
Atomic pointer to the ProtocolSync handler.