-
Notifications
You must be signed in to change notification settings - Fork 525
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
Discussion: MaxFaultyNodes
and NumValid
wrong math?
#236
Comments
MaxFaultyNodes
wrong math?MaxFaultyNodes
and NumValid
wrong math?
Hey @mrwillis, As always, thank you for reaching out and for opening up a discussion on this topic. I've went through the code and concluded that the implementation that we currently have in The node that sends out messages to other nodes (gossips them) will also have the same messages in its own msg queue. I've updated the in-code documentation on the PR #238 to reflect these changes. |
Additionally, I've looked into the math behind |
Awesome thanks @zivkovicmilos |
MaxFaultyNodes
andNumValid
wrong math?Description
If I'm reading the spec correctly from ethereum/EIPs#650, the system can tolerate AT MOST F faulty nodes in a N validator nodes network, where
N = 3F + 1
impliesF = (N - 1)/3
.The function looks like this
Shouldn't this be
I am not sure if this should be a
math.Ceil
ormath.Floor
. I think intuitively it should be a ceiling.Moreover this function
https://github.com/0xPolygon/polygon-sdk/blob/7f2e61d19b63bde38f52925dee4eefc47e03ddf5/consensus/ibft/state.go#L101
is
2F
, but according to the spec it should be2F + 1
. Eventhough this looks wrong, it ends up being okay here because of the greater than https://github.com/0xPolygon/polygon-sdk/blob/7f2e61d19b63bde38f52925dee4eefc47e03ddf5/consensus/ibft/ibft.go#L627 and here https://github.com/0xPolygon/polygon-sdk/blob/7f2e61d19b63bde38f52925dee4eefc47e03ddf5/consensus/ibft/ibft.go#L632but it looks incorrect here.
https://github.com/0xPolygon/polygon-sdk/blob/7f2e61d19b63bde38f52925dee4eefc47e03ddf5/consensus/ibft/ibft.go#L784
Believe it should be greater than, or just change the
NumValid
to be consistent with the spec.Your environment
develop
Steps to reproduce
The text was updated successfully, but these errors were encountered: