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

Test: QBFT messages out of order #336

Closed
wants to merge 2 commits into from
Closed

Conversation

MatheusFranco99
Copy link
Contributor

  • 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",
Copy link
Contributor

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?

@moshe-blox @MatheusFranco99

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 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).

Copy link
Contributor

Choose a reason for hiding this comment

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

@moshe-blox or @y0sher

just curious if you ever saw duties fail/delay due to out of order messages

Copy link
Contributor

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?

Copy link
Contributor Author

@MatheusFranco99 MatheusFranco99 Jan 10, 2024

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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)

Copy link
Contributor Author

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 {
Copy link
Contributor

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

@GalRogozinski
Copy link
Contributor

@MatheusFranco99 do we have a github issue for this (no need to open one)?

@MatheusFranco99
Copy link
Contributor Author

@GalRogozinski
I didn't find any.

@GalRogozinski
Copy link
Contributor

Closing since we don't want to enforce this

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.

3 participants