You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

149 lines
9.5 KiB

  1. ---
  2. order: 7
  3. ---
  4. # Consensus
  5. ## Channel
  6. Consensus has four separate channels. The channel identifiers are listed below.
  7. | Name | Number |
  8. |--------------------|--------|
  9. | StateChannel | 32 |
  10. | DataChannel | 33 |
  11. | VoteChannel | 34 |
  12. | VoteSetBitsChannel | 35 |
  13. ## Message Types
  14. ### Proposal
  15. Proposal is sent when a new block is proposed. It is a suggestion of what the
  16. next block in the blockchain should be.
  17. | Name | Type | Description | Field Number |
  18. |----------|----------------------------------------------------|----------------------------------------|--------------|
  19. | proposal | [Proposal](../../core/data_structures.md#proposal) | Proposed Block to come to consensus on | 1 |
  20. ### Vote
  21. Vote is sent to vote for some block (or to inform others that a process does not vote in the
  22. current round). Vote is defined in the
  23. [Blockchain](https://github.com/tendermint/spec/blob/master/spec/core/data_structures.md#blockidd)
  24. section and contains validator's
  25. information (validator address and index), height and round for which the vote is sent, vote type,
  26. blockID if process vote for some block (`nil` otherwise) and a timestamp when the vote is sent. The
  27. message is signed by the validator private key.
  28. | Name | Type | Description | Field Number |
  29. |------|--------------------------------------------|---------------------------|--------------|
  30. | vote | [Vote](../../core/data_structures.md#vote) | Vote for a proposed Block | 1 |
  31. ### BlockPart
  32. BlockPart is sent when gossiping a piece of the proposed block. It contains height, round
  33. and the block part.
  34. | Name | Type | Description | Field Number |
  35. |--------|--------------------------------------------|----------------------------------------|--------------|
  36. | height | int64 | Height of corresponding block. | 1 |
  37. | round | int32 | Round of voting to finalize the block. | 2 |
  38. | part | [Part](../../core/data_structures.md#part) | A part of the block. | 3 |
  39. ### NewRoundStep
  40. NewRoundStep is sent for every step transition during the core consensus algorithm execution.
  41. It is used in the gossip part of the Tendermint protocol to inform peers about a current
  42. height/round/step a process is in.
  43. | Name | Type | Description | Field Number |
  44. |--------------------------|--------|----------------------------------------|--------------|
  45. | height | int64 | Height of corresponding block | 1 |
  46. | round | int32 | Round of voting to finalize the block. | 2 |
  47. | step | uint32 | | 3 |
  48. | seconds_since_start_time | int64 | | 4 |
  49. | last_commit_round | int32 | | 5 |
  50. ### NewValidBlock
  51. NewValidBlock is sent when a validator observes a valid block B in some round r,
  52. i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r.
  53. It contains height and round in which valid block is observed, block parts header that describes
  54. the valid block and is used to obtain all
  55. block parts, and a bit array of the block parts a process currently has, so its peers can know what
  56. parts it is missing so they can send them.
  57. In case the block is also committed, then IsCommit flag is set to true.
  58. | Name | Type | Description | Field Number |
  59. |-----------------------|--------------------------------------------------------------|----------------------------------------|--------------|
  60. | height | int64 | Height of corresponding block | 1 |
  61. | round | int32 | Round of voting to finalize the block. | 2 |
  62. | block_part_set_header | [PartSetHeader](../../core/data_structures.md#partsetheader) | | 3 |
  63. | block_parts | int32 | | 4 |
  64. | is_commit | bool | | 5 |
  65. ### ProposalPOL
  66. ProposalPOL is sent when a previous block is re-proposed.
  67. It is used to inform peers in what round the process learned for this block (ProposalPOLRound),
  68. and what prevotes for the re-proposed block the process has.
  69. | Name | Type | Description | Field Number |
  70. |--------------------|----------|-------------------------------|--------------|
  71. | height | int64 | Height of corresponding block | 1 |
  72. | proposal_pol_round | int32 | | 2 |
  73. | proposal_pol | bitarray | | 3 |
  74. ### HasVote
  75. HasVote is sent to indicate that a particular vote has been received. It contains height,
  76. round, vote type and the index of the validator that is the originator of the corresponding vote.
  77. | Name | Type | Description | Field Number |
  78. |--------|------------------------------------------------------------------|----------------------------------------|--------------|
  79. | height | int64 | Height of corresponding block | 1 |
  80. | round | int32 | Round of voting to finalize the block. | 2 |
  81. | type | [SignedMessageType](../../core/data_structures.md#signedmsgtype) | | 3 |
  82. | index | int32 | | 4 |
  83. ### VoteSetMaj23
  84. VoteSetMaj23 is sent to indicate that a process has seen +2/3 votes for some BlockID.
  85. It contains height, round, vote type and the BlockID.
  86. | Name | Type | Description | Field Number |
  87. |--------|------------------------------------------------------------------|----------------------------------------|--------------|
  88. | height | int64 | Height of corresponding block | 1 |
  89. | round | int32 | Round of voting to finalize the block. | 2 |
  90. | type | [SignedMessageType](../../core/data_structures.md#signedmsgtype) | | 3 |
  91. ### VoteSetBits
  92. VoteSetBits is sent to communicate the bit-array of votes a process has seen for a given
  93. BlockID. It contains height, round, vote type, BlockID and a bit array of
  94. the votes a process has.
  95. | Name | Type | Description | Field Number |
  96. |----------|------------------------------------------------------------------|----------------------------------------|--------------|
  97. | height | int64 | Height of corresponding block | 1 |
  98. | round | int32 | Round of voting to finalize the block. | 2 |
  99. | type | [SignedMessageType](../../core/data_structures.md#signedmsgtype) | | 3 |
  100. | block_id | [BlockID](../../core/data_structures.md#blockid) | | 4 |
  101. | votes | BitArray | Round of voting to finalize the block. | 5 |
  102. ### Message
  103. Message is a [`oneof` protobuf type](https://developers.google.com/protocol-buffers/docs/proto#oneof).
  104. | Name | Type | Description | Field Number |
  105. |-----------------|---------------------------------|----------------------------------------|--------------|
  106. | new_round_step | [NewRoundStep](#newroundstep) | Height of corresponding block | 1 |
  107. | new_valid_block | [NewValidBlock](#newvalidblock) | Round of voting to finalize the block. | 2 |
  108. | proposal | [Proposal](#proposal) | | 3 |
  109. | proposal_pol | [ProposalPOL](#proposalpol) | | 4 |
  110. | block_part | [BlockPart](#blockpart) | | 5 |
  111. | vote | [Vote](#vote) | | 6 |
  112. | has_vote | [HasVote](#hasvote) | | 7 |
  113. | vote_set_maj23 | [VoteSetMaj23](#votesetmaj23) | | 8 |
  114. | vote_set_bits | [VoteSetBits](#votesetbits) | | 9 |