-
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
Construct quorum certificate incrementally (BFT-386) #51
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.
Overall, looks good. A small nit, I don't see the need to have a separate Builder type. A QC is still a QC, even if it doesn't have enough signers.
# Conflicts: # node/actors/bft/src/leader/replica_commit.rs # node/actors/bft/src/leader/replica_prepare.rs # node/actors/bft/src/leader/state_machine.rs # node/libs/roles/src/validator/messages/consensus.rs
Agree, I added the higher-level structs due to having additional fields. But I ended up removing all of them, delegating responsibility for correctness to the caller. |
3107e95
to
7b14a56
Compare
7b14a56
to
a274fc5
Compare
Constructing quorum certificates from a batch of signed messages creates redundant error checks which are hard to reason about.
Since this operation's failure is unacceptable and can only occur as a result of a bug, it is preferred to construct incrementally upon receiving each message.
However, this refactoring ended up with no error checks during the incremental construction, delegating responsibility to the message processing.
Consequently, this change can be viewed merely as code cleanup which removes redundant error checks, and the incremental steps as a safer way to do that.
Notes
testonly
. They can be removed altogether if tests will construct incrementally as well.PrepareQC::from
CommitQC::from
(also seemed to had a duplicated error check which was removed)validator::AggregateSignature::aggregate
bn254::AggregateSignature::aggregate