github.com/aakash4dev/cometbft@v0.38.2/spec/p2p/legacy-docs/messages/block-sync.md (about)

     1  ---
     2  order: 2
     3  ---
     4  
     5  # Block Sync
     6  
     7  ## Channel
     8  
     9  Block sync has one channel.
    10  
    11  | Name              | Number |
    12  |-------------------|--------|
    13  | BlocksyncChannel  | 64     |
    14  
    15  ## Message Types
    16  
    17  There are multiple message types for Block Sync
    18  
    19  ### BlockRequest
    20  
    21  BlockRequest asks a peer for a block at the height specified.
    22  
    23  | Name   | Type  | Description               | Field Number |
    24  |--------|-------|---------------------------|--------------|
    25  | Height | int64 | Height of requested block | 1            |
    26  
    27  ### NoBlockResponse
    28  
    29  NoBlockResponse notifies the peer requesting a block that the node does not contain it.
    30  
    31  | Name   | Type  | Description               | Field Number |
    32  |--------|-------|---------------------------|--------------|
    33  | Height | int64 | Height of requested block | 1            |
    34  
    35  ### BlockResponse
    36  
    37  BlockResponse contains the block requested.
    38  It also contains an extended commit _iff_ vote extensions are enabled at the block's height.
    39  
    40  | Name      | Type                                                           | Description                     | Field Number |
    41  |-----------|----------------------------------------------------------------|---------------------------------|--------------|
    42  | Block     | [Block](../../../core/data_structures.md#block)                   | Requested Block                 | 1            |
    43  | ExtCommit | [ExtendedCommit](../../../core/data_structures.md#extendedcommit) | Sender's LastCommit information | 2            |
    44  
    45  ### StatusRequest
    46  
    47  StatusRequest is an empty message that notifies the peer to respond with the highest and lowest blocks it has stored.
    48  
    49  > Empty message.
    50  
    51  ### StatusResponse
    52  
    53  StatusResponse responds to a peer with the highest and lowest heights of any block it has in its blockstore.
    54  
    55  | Name   | Type  | Description                                                       | Field Number |
    56  |--------|-------|-------------------------------------------------------------------|--------------|
    57  | Height | int64 | Current Height of a node                                          | 1            |
    58  | Base   | int64 | First known block, if pruning is enabled it will be higher than 1 | 2            |
    59  
    60  ### Message
    61  
    62  Message is a [`oneof` protobuf type](https://developers.google.com/protocol-buffers/docs/proto#oneof). The `oneof` consists of five messages.
    63  
    64  | Name              | Type                                | Description                                                  | Field Number |
    65  |-------------------|-------------------------------------|--------------------------------------------------------------|--------------|
    66  | block_request     | [BlockRequest](#blockrequest)       | Request a block from a peer                                  | 1            |
    67  | no_block_response | [NoBlockResponse](#noblockresponse) | Response saying it doe snot have the requested block         | 2            |
    68  | block_response    | [BlockResponse](#blockresponse)     | Response with requested block + (optionally) vote extensions | 3            |
    69  | status_request    | [StatusRequest](#statusrequest)     | Request the highest and lowest block numbers from a peer     | 4            |
    70  | status_response   | [StatusResponse](#statusresponse)   | Response with the highest and lowest block numbers the store | 5            |