Skip to content

Store validator list in the states#1592

Merged
sgkim126 merged 3 commits intoCodeChain-io:masterfrom
sgkim126:val-spec
Jun 5, 2019
Merged

Store validator list in the states#1592
sgkim126 merged 3 commits intoCodeChain-io:masterfrom
sgkim126:val-spec

Conversation

@sgkim126
Copy link
Contributor

@sgkim126 sgkim126 commented Jun 2, 2019

And changes the way to calculate the order of the block proposer.

@sgkim126
Copy link
Contributor Author

sgkim126 commented Jun 3, 2019

Hi @majecty, @foriequal0 and @kseo,
Let me propose the method to decide the order of block proposer.
The previous way has two problems.

The first is the block generation should wait a long time if the validator who has been delegated lot's of stake has stopped.
It's because one node can be a generator in consecutive rounds.

The second problem is that it's not easy to calculate the block author.
Our implementation doesn't know the consensus view when closing the block.
It's because CodeChain supports PoW as well as Tendermint; the view is in the seal, but the seal is attached to the block after closing.

The new way has a simpler approach to decide the proposer but it has better property.

Briefly speaking, the order of validators is determined in the same height by considering delegation, generated blocks and round.
The validator is round-robin when the view increased.
It makes there are no stall even the node which has been delegated lots of stakes has stopped; still, the strong validator has more chance to generate the block.
Moreover, it's very easy to implement in our implementation because they are easily calculated from the states of the parent block and the block author.

@sgkim126 sgkim126 requested a review from kseo June 3, 2019 02:58
foriequal0
foriequal0 previously approved these changes Jun 3, 2019
majecty
majecty previously approved these changes Jun 4, 2019
Copy link

@majecty majecty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

And changes the way to calculate the order of the block proposer.
@sgkim126 sgkim126 dismissed stale reviews from majecty and foriequal0 via ed2e292 June 4, 2019 02:56
@sgkim126
Copy link
Contributor Author

sgkim126 commented Jun 4, 2019

I resolved the conflicts with #1597

@sgkim126 sgkim126 requested review from foriequal0 and majecty and removed request for majecty June 4, 2019 02:58
@sgkim126
Copy link
Contributor Author

sgkim126 commented Jun 5, 2019

@foriequal0 The only change after you approved is resolving conflicts. I'll merge it.

@sgkim126 sgkim126 merged commit a059ad2 into CodeChain-io:master Jun 5, 2019
@sgkim126 sgkim126 deleted the val-spec branch June 5, 2019 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants