Please sign in to comment.
feat\parsec: refactor tie-breaking rules when compute consensus
We spotted an issue within the current tie-breaking rules, with previously a routing test and now a new created test having nodes vote for the same payload in single consensus mode. We know that we want the following properties: * all nodes vote for payload X before any node votes for payload Y, X should be polled first * everything else being equal, we had rather have payloads that have earlier votes come out first * everything else being equal, we had rather have payloads that had more votes come out first To achieve above, the tie-breaking rules in pseudo-code shall be: - sort by smaller index of this content by this node - then with larger count - then with lexicographical order The commit also contains a new integration test which make nodes vote for the same payload in single mode. This test fails with the previous ordering rules, and will pass with this fix.
- Loading branch information...
Showing with 81 additions and 65 deletions.