Conversation
|
|
||
| ### Heartbeat | ||
| Heartbeat contains validator information (address and index), | ||
| height, round and sequence number (?). It is signed by the private key of the validator. |
There was a problem hiding this comment.
I was wondering what is the sequence field, but it's probably as it says sequence number :)
ebuchman
left a comment
There was a problem hiding this comment.
Great start! Thanks Zarko.
| executed steps of the core consensus algorithm (`NewRoundStepMessage` and `CommitStepMessage`), and | ||
| also messages that inform peers what votes the process has seen (`HasVoteMessage`, | ||
| `VoteSetMaj23Message` and `VoteSetBitsMessage`). | ||
|
|
There was a problem hiding this comment.
These opening paragraphs are wonderful <3
There was a problem hiding this comment.
Though I might add a note about only proposal/vote being signed, and about how the gossip msgs are used to determine how we send data to other peers
| next block in the blockchain should be. | ||
| ``` | ||
| type ProposalMessage struct { | ||
| Proposal *types.Proposal |
There was a problem hiding this comment.
let's drop all pointers and package names.
The goal with the spec is to lay out the data structures in a way that makes their encoding clear. We don't want the fact that it's a pointer to change the encoding, so it shouldn't be relevant (currently it does matter, but we plan to fix that!)
| type Proposal struct { | ||
| Height int64 | ||
| Round int | ||
| Timestamp time.Time |
There was a problem hiding this comment.
int64 (thats what its encoded as)
| BlockID BlockID | ||
| POLRound int | ||
| POLBlockID BlockID | ||
| Signature crypto.Signature |
There was a problem hiding this comment.
Let's drop the pkg name prefixes. This spec is defining the data structures, not referencing the code, and it all lives in one namespace. I defined Signature in blockchain.md
|
|
||
| NOTE: In the current version of the Tendermint, the consensus value in proposal is represented with | ||
| PartSetHeader, and with BlockID in vote message. It should be aligned as suggested in this spec as | ||
| BlockID contains PartSetHeader. |
|
|
||
| ``` | ||
| type Heartbeat struct { | ||
| ValidatorAddress data.Bytes |
| type NewRoundStepMessage struct { | ||
| Height int64 | ||
| Round int | ||
| Step cstypes.RoundStepType |
There was a problem hiding this comment.
lets be clear about the basic type here
There was a problem hiding this comment.
What do you mean? Should we define RoundStepType?It's somehow implementation detail and can change, so I am not sure if it should be part of spec.
There was a problem hiding this comment.
Let's just give a concrete type - int8
There was a problem hiding this comment.
You mean we shouldn't use int type? Because we use it in Vote so I thought that's fine.
| ``` | ||
| type CommitStepMessage struct { | ||
| Height int64 | ||
| BlockPartsHeader types.PartSetHeader |
| type CommitStepMessage struct { | ||
| Height int64 | ||
| BlockPartsHeader types.PartSetHeader | ||
| BlockParts *cmn.BitArray |
There was a problem hiding this comment.
Mmm - we need to define BitArray and how it's encoded!
| } | ||
| ``` | ||
|
|
||
| TODO: Maybe use BlockID instead of BlockPartsHeader for symmetry. |
f11f979 to
96e0e4a
Compare
Codecov Report
@@ Coverage Diff @@
## develop #1039 +/- ##
===========================================
+ Coverage 59.66% 59.75% +0.09%
===========================================
Files 116 116
Lines 10667 10667
===========================================
+ Hits 6364 6374 +10
+ Misses 3725 3719 -6
+ Partials 578 574 -4 |
| # Tendermint Consensus | ||
|
|
||
| Tendermint consensus is a distributed protocol executed by validator processes to agree on | ||
| the next block to be added to the Tendermint blockchain. The protocol proceeds in rounds, where |
There was a problem hiding this comment.
... to be added to a blockchain.
Theoretically it could be any blockchain. For example, Polkdadot might use Tendermint consensus.
Also, we should be consistent with naming and always call it Tendermint Consensus.
| the `ProposalMessage`. | ||
| The processes respond by voting for a block with `VoteMessage` (there are two kinds of vote messages, prevote | ||
| and precommit votes). Note that a proposal message is just a suggestion what the next block should be; a | ||
| validator might vote with a `VoteMessage` for a different block. If in some round, enough number |
There was a problem hiding this comment.
... in some round enough processes vote for the same block, ...
| and precommit votes). Note that a proposal message is just a suggestion what the next block should be; a | ||
| validator might vote with a `VoteMessage` for a different block. If in some round, enough number | ||
| of processes vote for the same block, then this block is committed and later added to the blockchain. | ||
| `ProposalMessage` and `VoteMessage` are signed by the private key of the validator. |
There was a problem hiding this comment.
... by the private key of each process. We haven't explained validator before.
No description provided.