-
Notifications
You must be signed in to change notification settings - Fork 103
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
Use PeerConfig for stake table committees #2702
Conversation
33fa6b7
to
40b1d11
Compare
.into_iter() | ||
.map(|config| config.stake_table_entry) | ||
.collect::<Vec<_>>(); | ||
|
||
justify_qc | ||
.is_valid_cert( |
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.
might be better to change this function signature to pass PeerConfig instead of StakeTableEntry but I'll leave it for now
hotshot-types/src/traits/election.rs
Outdated
@@ -31,56 +29,64 @@ pub trait Membership<TYPES: NodeType>: Debug + Send + Sync { | |||
fn stake_table( | |||
&self, | |||
epoch: Option<TYPES::Epoch>, | |||
) -> Vec<<TYPES::SignatureKey as SignatureKey>::StakeTableEntry>; | |||
) -> Result<Vec<PeerConfig<TYPES::SignatureKey>>, Self::Error>; |
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.
Is it necessary to wrap these returns in Result
? All the impls seem infallible and the uses simply do something like unwrap_or_default()
.
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 was part of tech-debt that we discussed on zulip few weeks ago. Basically, we wanted this to return Option or Result. I agree that this doesn't do much because of unwrap_or_default() but that requires more work.
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
31a0980
to
799da25
Compare
This PR: