Browse Source

Fix spec (#2736)

pull/2746/head
Zarko Milosevic 6 years ago
committed by Ethan Buchman
parent
commit
a83c268d7f
3 changed files with 20 additions and 12 deletions
  1. +3
    -1
      consensus/reactor.go
  2. +6
    -3
      docs/spec/reactors/consensus/consensus-reactor.md
  3. +11
    -8
      docs/spec/reactors/consensus/consensus.md

+ 3
- 1
consensus/reactor.go View File

@ -1393,7 +1393,9 @@ func (m *NewRoundStepMessage) String() string {
//-------------------------------------
// CommitStepMessage is sent when a block is committed.
// NewValidBlockMessage is sent when a validator observes a valid block B in some round r,
//i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r.
// In case the block is also committed, then IsCommit flag is set to true.
type NewValidBlockMessage struct {
Height int64
Round int


+ 6
- 3
docs/spec/reactors/consensus/consensus-reactor.md View File

@ -133,9 +133,12 @@ handleMessage(msg):
```
handleMessage(msg):
if prs.Height == msg.Height && prs.Round == msg.Round then
prs.ProposalBlockPartsHeader = msg.BlockPartsHeader
prs.ProposalBlockParts = msg.BlockParts
if prs.Height != msg.Height then return
if prs.Round != msg.Round && !msg.IsCommit then return
prs.ProposalBlockPartsHeader = msg.BlockPartsHeader
prs.ProposalBlockParts = msg.BlockParts
```
### HasVoteMessage handler


+ 11
- 8
docs/spec/reactors/consensus/consensus.md View File

@ -26,7 +26,7 @@ only to a subset of processes called peers. By the gossiping protocol, a validat
all needed information (`ProposalMessage`, `VoteMessage` and `BlockPartMessage`) so they can
reach agreement on some block, and also obtain the content of the chosen block (block parts). As
part of the gossiping protocol, processes also send auxiliary messages that inform peers about the
executed steps of the core consensus algorithm (`NewRoundStepMessage` and `CommitStepMessage`), and
executed steps of the core consensus algorithm (`NewRoundStepMessage` and `NewValidBlockMessage`), and
also messages that inform peers what votes the process has seen (`HasVoteMessage`,
`VoteSetMaj23Message` and `VoteSetBitsMessage`). These messages are then used in the gossiping
protocol to determine what messages a process should send to its peers.
@ -132,23 +132,26 @@ type NewRoundStepMessage struct {
}
```
## CommitStepMessage
## NewValidBlockMessage
CommitStepMessage is sent when an agreement on some block is reached. It contains height for which
agreement is reached, block parts header that describes the decided block and is used to obtain all
NewValidBlockMessage is sent when a validator observes a valid block B in some round r,
i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r.
It contains height and round in which valid block is observed, block parts header that describes
the valid block and is used to obtain all
block parts, and a bit array of the block parts a process currently has, so its peers can know what
parts it is missing so they can send them.
In case the block is also committed, then IsCommit flag is set to true.
```go
type CommitStepMessage struct {
type NewValidBlockMessage struct {
Height int64
BlockID BlockID
Round int
BlockPartsHeader PartSetHeader
BlockParts BitArray
IsCommit bool
}
```
TODO: We use BlockID instead of BlockPartsHeader (in current implementation) for symmetry.
## ProposalPOLMessage
ProposalPOLMessage is sent when a previous block is re-proposed.


Loading…
Cancel
Save