Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: fix the way candidates are sorted #2017

Merged
merged 1 commit into from
Jun 16, 2021
Merged

Conversation

AnnaShaleva
Copy link
Member

@AnnaShaleva AnnaShaleva commented Jun 16, 2021

Problem

State diff at block 151376 due to invalid order of candidates returned from native NEO getCandidates call.

Solution

(*NEO).GetCandidates along with getCandidatesCall use candidates sorted
by serialized ECPoint bytes. See ref. GetCandidates and Seek.

(*NEO).computeCommitteeMembers use candidates sorted by votes, and then
by deserialized ECPoint, i.e. using default ECPoint comparator. See ref. ComputeCommetteeMembers and CompareTo.

This issue was partially fixed in #1639.

Closes #2015. Makes us compatible up to 156K of the RC3 testnet.

(*NEO).GetCandidates along with getCandidatesCall use candidates sorted
by serialized ECPoint bytes.

(*NEO).computeCommitteeMembers use candidates sorted by votes, and then
by deserialized ECPoint, i.e. using default ECPoint comparator.
@roman-khimov roman-khimov merged commit 880843b into master Jun 16, 2021
@roman-khimov roman-khimov deleted the fix-diff-151376 branch June 16, 2021 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

State mismatch at RC3 testnet 151376
2 participants