bosnet / sebak

SEBAK, the next BOScoin Blockchain
https://devteam.blockchainos.org
GNU General Public License v3.0
44 stars 15 forks source link

How to handle the stopped consensus for a long time #900

Closed Charleslee522 closed 5 years ago

Charleslee522 commented 5 years ago

Background

In #879, consensus stuck for a short time will be resolved but, if consensus of nodes is stuck for a long time, then it is different issue. If newly connected node gets ballots which is made 5 minutes ago, it will be ignored because of the time filtering.

Solution

Every node resends all the messages sent at this height every 10 seconds. All messages contents are same except created ballot time. And this ballots should be integrated by one message.

Charleslee522 commented 5 years ago

@spikeekips @Geod24 Is this reasonable? Sending integrated ballots message periodically could be a little bit burden, but this situation rarely happens.

spikeekips commented 5 years ago

@Charleslee522 The most terrible thing will be our friend, always :) It was already happended. :) This may be the best solution, but we need this patch, I think.

Charleslee522 commented 5 years ago

I've missed something. In ballot validation, there are two features to verify it. One is confirmed time and another is proposedConfirmed time. A node can modify confirmed time by itself, but it cannot modify proposedConfirmed time because it is needed signatures from proposer and source. Therefore it is not easy to renew an old ballot. And it seems odd to recreate a ballot that has been created for more than one minute to make it valid.

So I've almost implemented the design above, but I want to suggest another way. If consensus has been stuck for over a minute, I suggest to make new voting in the next round.

Charleslee522 commented 5 years ago

@spikeekips I have another opinion so please check this and give me a sharp criticism :)

Charleslee522 commented 5 years ago

@spikeekips I think another solution :) Let me explain it to you. After stuck, when a node receives old ballot(1 minute before), how about sending expired ballots for the answer? Then all nodes will proceed to the next round. But nodes cannot know it was stuck or not. They should always broadcast exp ballots when they receive old ballot.

spikeekips commented 5 years ago

@Charleslee522 It makes sense.