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

Issue A - Missing Check on Quorum for the RoundChange Justification #207

Merged
merged 19 commits into from
May 24, 2023

Conversation

GalRogozinski
Copy link
Contributor

Synopsis

The function getRoundChangeJustification in the qbft/prepare.go file does not check that the
set of constructed Prepare messages is of size quorum. This is a deviation from the QBFT formal
verification code
.

Impact

The function returns a set of valid Prepare messages that is attached to a RoundChange message to
justify the round change by the operator. As specified in the QBFT code, the operator needs to check here
the size of the set. Not checking this can lead to sending around a RoundChange message that is not
accepted by the other operators. This in turn can lead to liveness issues, i.e. the honest operators send
around invalid RoundChange messages that are not accepted by other honest operators. Since the
proposer for a higher round requires quorum-many valid RoundChange messages, this can lead to a
state in which the operators do not find consensus and liveness is not reached.

Fix

Add missing check and spectest

@GalRogozinski GalRogozinski requested review from y0sher and alonmuroch May 1, 2023 15:21
Comment on lines 21 to 23
//TODO rename to root
Value [32]byte
//TODO rename to value
Copy link
Contributor Author

@GalRogozinski GalRogozinski May 1, 2023

Choose a reason for hiding this comment

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

The rename affects other tests
after the PR is accepted I will open issues for the rename and remove the TODO comment

if err != nil && len(test.ExpectedError) != 0 {
require.EqualError(t, err, test.ExpectedError)
return
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

not important but else isn't required since you return anyawy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@GalRogozinski GalRogozinski marked this pull request as draft May 2, 2023 13:56
@GalRogozinski
Copy link
Contributor Author

State Comparison will be added here after a seperate PR will add this ability to create_message_spectest.go

@GalRogozinski GalRogozinski marked this pull request as ready for review May 2, 2023 15:55
@GalRogozinski GalRogozinski changed the title Missing Check on Quorum for the RoundChange Justification Issue A - Missing Check on Quorum for the RoundChange Justification May 3, 2023
@alonmuroch
Copy link
Contributor

@GalRogozinski we have some real world scenario to test this out with? That will be valuable.

It seems to me that LastPreparedValue is only set when received a quorum of prepare messages so in fact there won't be a situation in which we don't have the full quorum. Right?

@GalRogozinski
Copy link
Contributor Author

@alonmuroch

we have some real world scenario to test this out with?
you mean doing tests on a testnet?

And yes I agree with you. Only if we allow nil proposal values (I don't think we do) maybe then the new check can somehow be important.

But better to be danfy-spec compliant and defensive.

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.

4 participants