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

Consensus: fix the quorum size #142

Merged
merged 4 commits into from
Mar 7, 2019
Merged

Conversation

semuxgo
Copy link
Contributor

@semuxgo semuxgo commented Mar 6, 2019

  • Quorum size q needs to be ceil of the 2 / 3 * n. Take the syncing for example, we're picking a target height such that at least q number of nodes have reached that height;
  • Revert the view check fix.

semux added 3 commits March 6, 2019 11:39
The pBFT consensus has a fault tolerance of n = 3f + 1; the quorum
size should be the ceil of n * 2 / 3.
@semuxgo semuxgo requested review from orogvany and cryptokat March 6, 2019 15:15
@@ -503,7 +502,7 @@ protected void onNewView(Proof p) {
logger.trace("On new_view: {}", p);

if (p.getHeight() == height // at same height
&& p.getView() == view + 1 && state != State.COMMIT && state != State.FINALIZE) {// larger view
&& p.getView() > view && state != State.COMMIT && state != State.FINALIZE) {// larger view
Copy link
Collaborator

Choose a reason for hiding this comment

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

The problem here was one validator proposing a view greater than current view with their validator was being taken over anothoher more valid block with lower view. I think some protection here is needed. But I have not personally tested through the logic, just saw testnet attacked in this way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe the check logic is here

Going to add some tests for it.

@semuxgo semuxgo merged commit 487297d into semuxproject:develop Mar 7, 2019
@semuxgo semuxgo mentioned this pull request Apr 21, 2019
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.

2 participants