-
Notifications
You must be signed in to change notification settings - Fork 39
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
made bft actor send LeaderPrepare messages asynchronously (BFT-400) #52
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.
Can't say I'm a particularly good reviewer for consensus logic, but overall the changes look solid.
else { | ||
return Ok(()); | ||
}; | ||
debug_assert!(replica_messages.len() == self.inner.threshold()); |
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 to understand: Is strict equality instead of >=
intended here? The find
predicate above implies >=
. If the strict equality is intended, you can use debug_assert_eq
; it'll provide more informative panic message.
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.
we want ==, to make sure that we don't wait for too many signatures.
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.
this is a debug_assert, because it would be technically correct to include more signatures.
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 satisfied with this design. It's a bit of a quick fix, I think it does decrease the readability of the code.
Also, looking at the future here, besides wanting to send LeaderPrepare messages asynchronously, we probably want to send asynchronously ReplicaCommit messages (because we need to verify the proposals and that might block) and ReplicaPrepare (when we implement the consensus oracle we will need to fetch external information, again might block). The only that doesn't need to be asynchronous is LeaderCommit.
I would prefer then that each of these messages are handled by a separate background task, and ideally without separating the message processing.
@moshababo Take a look. You're a code owner for this actor now too. |
Co-authored-by: Bruno França <[email protected]>
What ❔
Made bft actor send LeaderPrepare messages asynchronously.
Why ❔
PayloadSource.propose() may be blocking (when no payload can be proposed at a time) but it shouldn't block message processing: