SebastianElvis / ebft

ISC License
2 stars 0 forks source link

server: function `OnVote` #11

Closed SebastianElvis closed 2 years ago

SebastianElvis commented 2 years ago

Problem

ORazor requires three additional function OnVote to handle message MsgVote. In SyncORazor, MsgVote is only for certifying a block. In PSyncORazor, MsgVote can be either for certifying a block or announcing a block is unique.

Description

We need to implement OnVote in https://github.com/SebastianElvis/orazor/blob/main/server.go, which defines the state machine.

In SyncORazor, upon a vote, if the block is invalid/timeout, discard the vote. If the block is valid and votes are enough, certify the block.

In PSyncORazor, upon a vote, if the blocks is invalid, discard the vote. If the block is valid and certify votes are enough, certify the block. If the block is certified and unique votes are enough, finalise all previous blocks.

Alternatives

Additional context

jianyu-niu commented 2 years ago

It is so nice to identify the place for our implementation. I will take a look later.

SebastianElvis commented 2 years ago