通道

区块同步有一个通道。
名称编号
BlocksyncChannel64

消息类型

Block Sync 有多种消息类型。

BlockRequest

BlockRequest 用于向对等节点请求指定高度的区块。
名称类型说明字段编号
Heightint64所请求区块的高度1

NoBlockResponse

NoBlockResponse 用于通知请求区块的对等节点,当前节点不包含该区块。
名称类型说明字段编号
Heightint64所请求区块的高度1

BlockResponse

BlockResponse 包含所请求的区块。 如果该区块高度启用了投票扩展,它还会包含扩展提交。
名称类型说明字段编号
BlockBlock所请求的区块1
ExtCommitExtendedCommit发送方的 LastCommit 信息2

StatusRequest

StatusRequest 是一条空消息,用于通知对等节点返回其已存储的最高和最低区块。
空消息。

StatusResponse

StatusResponse 会向对等节点返回其区块存储中任意区块的最高和最低高度。
名称类型说明字段编号
Heightint64节点当前高度1
Baseint64已知的第一个区块;如果启用了裁剪,该值会大于 12

Message

Message 是一种 oneof protobuf 类型。该 oneof 由五种消息组成。
名称类型说明字段编号
block_requestBlockRequest向对等节点请求一个区块1
no_block_responseNoBlockResponse响应表示其没有所请求的区块2
block_responseBlockResponse返回所请求的区块,并可选包含投票扩展3
status_requestStatusRequest向对等节点请求最高和最低区块号4
status_responseStatusResponse返回存储中的最高和最低区块号5

Channel

Block sync has one channel.
NameNumber
BlocksyncChannel64

Message Types

There are multiple message types for Block Sync

BlockRequest

BlockRequest asks a peer for a block at the height specified.
NameTypeDescriptionField Number
Heightint64Height of requested block1

NoBlockResponse

NoBlockResponse notifies the peer requesting a block that the node does not contain it.
NameTypeDescriptionField Number
Heightint64Height of requested block1

BlockResponse

BlockResponse contains the block requested. It also contains an extended commit iff vote extensions are enabled at the block’s height.
NameTypeDescriptionField Number
BlockBlockRequested Block1
ExtCommitExtendedCommitSender’s LastCommit information2

StatusRequest

StatusRequest is an empty message that notifies the peer to respond with the highest and lowest blocks it has stored.
Empty message.

StatusResponse

StatusResponse responds to a peer with the highest and lowest heights of any block it has in its blockstore.
NameTypeDescriptionField Number
Heightint64Current Height of a node1
Baseint64First known block, if pruning is enabled it will be higher than 12

Message

Message is a oneof protobuf type. The oneof consists of five messages.
NameTypeDescriptionField Number
block_requestBlockRequestRequest a block from a peer1
no_block_responseNoBlockResponseResponse saying it doe snot have the requested block2
block_responseBlockResponseResponse with requested block + (optionally) vote extensions3
status_requestStatusRequestRequest the highest and lowest block numbers from a peer4
status_responseStatusResponseResponse with the highest and lowest block numbers the store5