-
Notifications
You must be signed in to change notification settings - Fork 24
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
Test: QBFT messages out of order #336
Conversation
MatheusFranco99
commented
Jan 2, 2024
- QBFT Messages received out of order. Test case: one prepare and one commit are received before the proposal causing the instance not to decide.
ControllerPostState: sc.ExpectedState, | ||
}, | ||
}, | ||
ExpectedError: "could not process msg: invalid signed message: did not receive proposal for this round", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know, until this day this behavior in spec confuses me...
Technically, messages on a real network may get delayed and come out of order.
Also looking again at the IBFT paper it seems that out of order messages are allowed to my understanding...
To my understanding the implementation uses the assumption that messages come in order to increase performance. This may be fine and maybe we adjusted the spec to work this way.
But it is kind of weird that we restrict out of order messages... maybe it is best to not have a test for it so that implementation can choose their behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it's a confusing behaviour.
IBFT totally allows it while QBFT implementation doesn't, as it seems to me.
In my opinion this could change. We could store messages that seems valid and only process the IBFT rule when something triggers it (e.g. storing all prepares and, once a proposal is received, we check the IBFT rule for that proposal).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious if you ever saw duties fail/delay due to out of order messages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently I don't think we should merge this because why enforce this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I currently don't really see the point of this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, we are talking about processing messages the way you said, we did see sometimes where we get a prepare before propose and then fail to process the propose. we want to create a structure like you mentioned where we store valid looking messages that arrive and process them in the appropriate time instead of just crashing because of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not reviewing this (although it looks fine) for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if eventually you will do this @y0sher
not sure this test should be merged because I am unsure if we should force implementation to accept out of order messages (even though theoretically we should)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree
} | ||
} | ||
|
||
func OutOfOrderFlowStateComparison(msgs []*qbft.SignedMessage) *qbftcomparable.StateComparison { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we added the json feature we only do this for "core tests" so we pay more attention to the tests
@MatheusFranco99 do we have a github issue for this (no need to open one)? |
@GalRogozinski |
Closing since we don't want to enforce this |