Sort validator set in public key order#388
Merged
majecty merged 3 commits intoCodeChain-io:masterfrom May 20, 2020
Merged
Conversation
cef6fa7 to
4c5e0f4
Compare
sgkim126
requested changes
May 15, 2020
2de4a4c to
7b2a2c4
Compare
Author
|
@sgkim126 I fixed them. |
5d4efbb to
c8e7110
Compare
Author
|
Failed tests succeed in my local MacOS and Linux machines except discovery 5 test. |
sgkim126
previously approved these changes
May 19, 2020
Contributor
sgkim126
left a comment
There was a problem hiding this comment.
LGTM for change. But please merge the commits that change the test into the commit that changes the implementation.
fb25657 to
383e09d
Compare
Author
|
I merged the commits that change the test into the commit that changes the implementation! |
Author
|
It seems that this PR makes tests to use more time. I'll dig into it. |
HoOngEe
added a commit
to HoOngEe/foundry
that referenced
this pull request
May 19, 2020
It applies the changes in CodeChain-io#388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
HoOngEe
added a commit
to HoOngEe/foundry
that referenced
this pull request
May 19, 2020
It applies the changes in CodeChain-io#388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
HoOngEe
added a commit
that referenced
this pull request
May 19, 2020
It applies the changes in #388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
added 2 commits
May 20, 2020 14:54
If two validators have the same delegation and deposit, the one who became the candidate first will be validator first. We didn't change the rule in this commit. Previously we kept the order of Candidates and Validators to remember who became the candidate first. Now we are saving nomination_starts_at variable to remember it. By saving the nomination_starts_at, we can sort validators using public keys. Sorting validators using public key makes validator set hash consistent.
69f2f79 to
50570e1
Compare
By sorting the validator set using public keys, we can make validator set hash consistent.
50570e1 to
ccf8b4b
Compare
sgkim126
approved these changes
May 20, 2020
sgkim126
pushed a commit
to sgkim126/foundry
that referenced
this pull request
May 23, 2020
It applies the changes in CodeChain-io#388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
sgkim126
pushed a commit
to sgkim126/foundry
that referenced
this pull request
May 23, 2020
It applies the changes in CodeChain-io#388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
sgkim126
pushed a commit
to sgkim126/foundry
that referenced
this pull request
May 23, 2020
It applies the changes in CodeChain-io#388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
sgkim126
pushed a commit
to sgkim126/foundry
that referenced
this pull request
May 23, 2020
It applies the changes in CodeChain-io#388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
sgkim126
pushed a commit
to sgkim126/foundry
that referenced
this pull request
May 24, 2020
It applies the changes in CodeChain-io#388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
sgkim126
pushed a commit
to sgkim126/foundry
that referenced
this pull request
May 24, 2020
It applies the changes in CodeChain-io#388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
sgkim126
pushed a commit
to sgkim126/foundry
that referenced
this pull request
May 24, 2020
It applies the changes in CodeChain-io#388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
sgkim126
pushed a commit
to sgkim126/foundry
that referenced
this pull request
May 24, 2020
It applies the changes in CodeChain-io#388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
sgkim126
pushed a commit
to sgkim126/foundry
that referenced
this pull request
May 24, 2020
It applies the changes in CodeChain-io#388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
sgkim126
pushed a commit
to sgkim126/foundry
that referenced
this pull request
May 24, 2020
It applies the changes in CodeChain-io#388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
sgkim126
pushed a commit
to sgkim126/foundry
that referenced
this pull request
May 30, 2020
It applies the changes in CodeChain-io#388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
sgkim126
pushed a commit
to sgkim126/foundry
that referenced
this pull request
Jun 4, 2020
It applies the changes in CodeChain-io#388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
sgkim126
pushed a commit
to sgkim126/foundry
that referenced
this pull request
Jun 6, 2020
It applies the changes in CodeChain-io#388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
sgkim126
pushed a commit
to sgkim126/foundry
that referenced
this pull request
Jun 6, 2020
It applies the changes in CodeChain-io#388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
majecty
pushed a commit
that referenced
this pull request
Jun 10, 2020
It applies the changes in #388. NextValidators and CurrentValidators are sorted by public key. As a tiebreaker Candidate and Validator utilize the nomination start block number and transaction index.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By sorting the validator set using public keys, we can make validator set hash consistent. We can use this property to omit the validator set hash in Header Sync.
If two validators have the same delegation and deposit, the one who became the candidate first will be validator first. We didn't change the rule in this commit. Previously we kept the order of Candidates and Validators to remember who became the candidate first. Now we are saving nomination_starts_at variable to remember it.