SebastianElvis / ebft

ISC License
2 stars 0 forks source link

Spec of Sync ORazor #2

Open SebastianElvis opened 2 years ago

SebastianElvis commented 2 years ago

Problem

We need to implement Sync ORazor.

Description

Roughly speaking, from a miner's perspective, Sync ORazor works as follows.

Upon a new block after the longest certified chain:
    If the node produced x of the traling y blocks in the chain, then it becomes a voter with x votes.
    Set a local timer of 3\Delta, and broadcast its vote on the new block to other voters.
    When receiving 2f+1 votes, certify the block.
    When the timer expires, if the block is certified, then finalise the block, otherwise discard/cache the block.

For details see the paper.

Alternatives

Additional context

jianyu-niu commented 2 years ago

Upon a new block after the longest certified chain: If the node produced one of the traling x blocks in the chain, then it becomes a voter. (Realized in a function, the input parameter is the block, the output is true/false for choosen.) Set a local timer of 3\Delta, and broadcast its vote on the new block to other voters. When receiving f+1 votes, certify the block. (It should be 2f+1) When the timer expires, if the block is certified, then finalise the block, otherwise discard the block. (It is better to cache the block)

SebastianElvis commented 2 years ago

Upon a new block after the longest certified chain: If the node produced one of the traling x blocks in the chain, then it becomes a voter. (Realized in a function, the input parameter is the block, the output is true/false for choosen.)

As the voting is weighted, I implemented the committee as a map (i.e., hashmap in Golang), where key is the address and value is the number of votes.

When receiving f+1 votes, certify the block. (It should be 2f+1) When the timer expires, if the block is certified, then finalise the block, otherwise discard the block. (It is better to cache the block)

Have updated the spec accordingly. Thanks for pointing out.

jianyu-niu commented 2 years ago

Upon a new block after the longest certified chain: If the node produced one of the traling x blocks in the chain, then it becomes a voter. (Realized in a function, the input parameter is the block, the output is true/false for chosen.)

As the voting is weighted, I implemented the committee as a map (i.e., hashmap in Golang), where key is the address and value is the number of votes.

There are some missing details that we can discuss later.