mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 14:52:17 +00:00
Fix spec (#2736)
This commit is contained in:
parent
c5905900eb
commit
a83c268d7f
@ -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 {
|
type NewValidBlockMessage struct {
|
||||||
Height int64
|
Height int64
|
||||||
Round int
|
Round int
|
||||||
|
@ -133,9 +133,12 @@ handleMessage(msg):
|
|||||||
|
|
||||||
```
|
```
|
||||||
handleMessage(msg):
|
handleMessage(msg):
|
||||||
if prs.Height == msg.Height && prs.Round == msg.Round then
|
if prs.Height != msg.Height then return
|
||||||
prs.ProposalBlockPartsHeader = msg.BlockPartsHeader
|
|
||||||
prs.ProposalBlockParts = msg.BlockParts
|
if prs.Round != msg.Round && !msg.IsCommit then return
|
||||||
|
|
||||||
|
prs.ProposalBlockPartsHeader = msg.BlockPartsHeader
|
||||||
|
prs.ProposalBlockParts = msg.BlockParts
|
||||||
```
|
```
|
||||||
|
|
||||||
### HasVoteMessage handler
|
### HasVoteMessage handler
|
||||||
|
@ -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
|
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
|
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
|
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`,
|
also messages that inform peers what votes the process has seen (`HasVoteMessage`,
|
||||||
`VoteSetMaj23Message` and `VoteSetBitsMessage`). These messages are then used in the gossiping
|
`VoteSetMaj23Message` and `VoteSetBitsMessage`). These messages are then used in the gossiping
|
||||||
protocol to determine what messages a process should send to its peers.
|
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
|
NewValidBlockMessage is sent when a validator observes a valid block B in some round r,
|
||||||
agreement is reached, block parts header that describes the decided block and is used to obtain all
|
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
|
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.
|
parts it is missing so they can send them.
|
||||||
|
In case the block is also committed, then IsCommit flag is set to true.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
type CommitStepMessage struct {
|
type NewValidBlockMessage struct {
|
||||||
Height int64
|
Height int64
|
||||||
BlockID BlockID
|
Round int
|
||||||
|
BlockPartsHeader PartSetHeader
|
||||||
BlockParts BitArray
|
BlockParts BitArray
|
||||||
|
IsCommit bool
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
TODO: We use BlockID instead of BlockPartsHeader (in current implementation) for symmetry.
|
|
||||||
|
|
||||||
## ProposalPOLMessage
|
## ProposalPOLMessage
|
||||||
|
|
||||||
ProposalPOLMessage is sent when a previous block is re-proposed.
|
ProposalPOLMessage is sent when a previous block is re-proposed.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user