-
Notifications
You must be signed in to change notification settings - Fork 53
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
Create new Certificate and Vote types and use them for Quorum #1967
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.
This really is SO much cleaner than what we had before!
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.
Thanks for making these changes!
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.
LGTM!
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.
Sorry to be a nit, but a minor change request.
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.
LGTM
I created mainly 2 new structures:
SimpleCertificate
andSimpleVote
. These implement the most basic vote and certificate pattern.SimpleVote
is some voteable (something we can vote on) data, a signature and a view. It's really important to note that the voteable data is very similar to the oldVoteData
type except it is no longer an enum. Basically thedata
member ofSimpleVote
is the thing that the vote actually votes on (e.g. it is a leaf commitment for the quorum vote) and an implementation of commit. All the voteable implementations of commit add in a tag which commits to which type of vote it is. This prevents forming a QC with different vote types over the same data. (one example would be if we had no votes, both a yes and no vote would be over the same leaf commitment, but the votes would commit to different values).SimpleCertificate
is the basic implementation of a certificate. LikeSimpleVote
we should be able to use it for all our certificate types (threshould()
is the only thing that differs). A certificate is over some voteable data, and commitment to that data.For votes I created type alias for all the vote types so other code doesn't need to specify the correct
Voteable
type everywhere in the code.For certificates I only created the Quorum type because not all the types will use the implementation of
threshold
inSimpleCertificate
I want to follow up to make this function more generic to prevent copypasta of the rest of theCertificate1
trait impl.I also only implemented the
genesis
function for the Quorum certificate.Closes #1965