-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add epoch parameter in Membership
trait's methods
#3751
base: main
Are you sure you want to change the base?
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.
left some comments. I think I looked at all the files that had meaningful changes, and looks good overall
type ViewTime: ConsensusTime + Display; | ||
/// Same as above but for epoch. | ||
type EpochTime: ConsensusTime + Display; |
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.
not a big deal, but could we call this just View
and Epoch
? I think the Time
part is a bit redundant
@@ -244,7 +246,7 @@ pub trait NodeType: | |||
type InstanceState: InstanceState; | |||
|
|||
/// The validated state type that this hotshot setup is using. | |||
type ValidatedState: ValidatedState<Self, Instance = Self::InstanceState, Time = Self::Time>; | |||
type ValidatedState: ValidatedState<Self, Instance = Self::InstanceState, Time = Self::ViewTime>; |
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.
will ValidatedState
require an epoch too?
(I guess this is fine to leave as-is for now even if it will)
/// Get all participants in the committee (including their stake) for a specific epoch | ||
fn stake_table( | ||
&self, | ||
epoch: TYPES::EpochTime, |
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 guess all of these functions will now have to return a Result
, because we may not have the stake table for a given (future) epoch?
(since this was quite an involved change, I can do it in #3738 after merging this -- just asking for clarification)
@@ -232,6 +232,8 @@ pub struct HotShotConfig<KEY: SignatureKey> { | |||
pub start_voting_time: u64, | |||
/// Unix time in seconds at which we stop voting on an upgrade. To prevent voting on an upgrade, set stop_voting_time <= start_voting_time. | |||
pub stop_voting_time: u64, | |||
/// Number of blocks in an epoch, zero means there are no epochs | |||
pub epoch_height: u64, |
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 might be personal preference, but I feel like this is a protocol-level constant and might be better as an associated constant in the NodeType
trait (rather than a configuration value)
Closes #<ISSUE_NUMBER>
This PR:
This PR does not:
Key places to review: