-
Notifications
You must be signed in to change notification settings - Fork 24
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
Round change according to duty start time #352
base: main
Are you sure you want to change the base?
Conversation
func RoundTimeout(round Round, height Height, baseDuration int64, network types.BeaconNetwork) int64 { | ||
// Calculate additional timeout in seconds based on round | ||
var additionalTimeout int64 | ||
additionalTimeout = int64(min(round, quickTimeoutThreshold)) * quickTimeout |
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.
different than impl
case types.BNRoleAttester, types.BNRoleSyncCommittee: | ||
return max(AttestationOrSyncCommitteeTimeout(round, t.Height, t.Network)-t.CurrentTime, 0) | ||
case types.BNRoleAggregator, types.BNRoleSyncCommitteeContribution: | ||
return max(AggregationOrContributionTimeout(round, t.Height, t.Network)-t.CurrentTime, 0) |
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.
different than impl
not sure if this can happen even if the system clock is bad...
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
// network is the beacon network | ||
Network types.BeaconNetwork | ||
//current unix epoch time in seconds | ||
CurrentTime int64 |
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 think we can use time.Time
and time.Duration
instead of integers, makes it a bit more friendly.
For tests, you can use time.Unix()
to create time.Time from an integer.
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 intentionally don't want the spec to rely on go standard lib
// CutoffRound which round the instance should stop its timer and progress no further | ||
CutoffRound = 15 // stop processing instances after 8*2+120*6 = 14.2 min (~ 2 epochs) | ||
CutoffRound = 14 // stop processing instances after 6*2+120*7 = 14.2 min (~ 2 epochs) |
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.
Should we make the variable cutoff change we discussed here or it wouldn't fit this PR?
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.
Remind me please
Co-authored-by: moshe-blox <[email protected]>
Implements ssvlabs/SIPs#37
Changes logic to all duties but proposer