-
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
Flatten memberships into a single type #3867
Conversation
0d9e849
to
859aa47
Compare
859aa47
to
c67fb3a
Compare
dbd49cf
to
d4815f9
Compare
d4815f9
to
572e6a2
Compare
Delete Memberships and replace functionality. Add some methods to `Membership` trait to deal w/ collapsing into one type both kinds of memberships (stake and DA). * avoid passing membership into `is_valid_cert * for DA, avoid proxying threshold through `Threshold` trait * remove `Topic` param from `Membership::new * Split cert impls by marker (#3891) * add membership methods to Cert trait * remove non-existent tests from justfile
0e1c8e9
to
3483bfd
Compare
We can keep the old name where we only have one membership type to keep the diff smaller.
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.
left some comments, but couldn't find the issue. I'll check a few more things
Always use quorum for leader selection
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.
approving, but I think we should follow-up on some of the changes here (left some comments on Zulip)
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.
oops, forgot one thing -- I think da_membership
is the wrong name here
Needed for #3726
This PR:
Removes
Memberships
struct and updatesMembership
trait to support DA and Quorum w/ a single interface. Essentially, instead of havingqourom_membership
andcommittee_membership
(DA) fields in most places we now have a singlemembership
field. In some places, where only one of the membership types was previously used, the previous name is preserved. To obtain the correct data, we now have to call the correct method:membership.leader()
for quorummembership.da_leader()
for da.This PR does not:
Shouldn't change behavior. It is only preparation for EspressoSystems/espresso-sequencer#2237
Key places to review:
The trait is used extensively and there are changes across many files.
crates/types/src/traits/election.rs
SimpleCert
impls incrates/types/src/simple_certificate.rs