-
Notifications
You must be signed in to change notification settings - Fork 12
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
Qbft tests #94
Qbft tests #94
Conversation
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.
nice catch zac -- good extension to tests as well
|
||
// Remove round change messages that would be for previous rounds | ||
self.round_change_messages | ||
.retain(|&round, _value| round >= self.current_round); | ||
|
||
// We are waiting for consensus on a round change, do not start the round yet | ||
if matches!(self.state, InstanceState::SentRoundChange) { |
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.
What happens to the caller(s) in this case?
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.
If we hit this state, that means that we have received some round change messages but have not received a quorum yet, so nothing happens until the node reaches a round change quorum and can start the next 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.
I guess I'm just wondering about the API. In this case, we call start_round
but nothing happens and it's not communicated to the caller.
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.
Ahh got it good point. I dont think it really matters. The caller can assume that when it makes some call to qbft, if there is a message that has to be sent it will receive it. In this case, we have no message to send since there is no progress to be made. here it just spins. I will think more on 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.
It somehow feels strange to call start_round
, nothing happens, and there's no error. Does the caller find out about it in another way? Does it call it again later?
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.
Yep I get what you are saying. Calling start_round
makes it seem like the round will start. Maybe try_start_round
is better? Im hesitant to call this an error because it is functioning correctly, it just cant make any progress. Maybe it is better try to put this logic into the proposal code.
The caller will keep calling it until there is a quorum of round change messages and it can make progress, or right away when it is round 0. There should be errors added so that the caller can handle clear errors such as incorrect messages, but in this case there is really nothing for the caller to do. All that can be done is to wait for more round change messages to reach quorum.
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.
great work mate
Issue Addressed
#36
Proposed Changes
Few changes here
Update
Todo