Round change according to duty start time#352
Open
GalRogozinski wants to merge 30 commits intossvlabs:mainfrom
Open
Round change according to duty start time#352GalRogozinski wants to merge 30 commits intossvlabs:mainfrom
GalRogozinski wants to merge 30 commits intossvlabs:mainfrom
Conversation
GalRogozinski
commented
Jan 21, 2024
| 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 |
Contributor
Author
There was a problem hiding this comment.
different than impl
GalRogozinski
commented
Jan 21, 2024
Comment on lines
+33
to
+36
| 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) |
Contributor
Author
There was a problem hiding this comment.
different than impl
not sure if this can happen even if the system clock is bad...
moshe-blox
suggested changes
Mar 25, 2024
| // network is the beacon network | ||
| Network types.BeaconNetwork | ||
| //current unix epoch time in seconds | ||
| CurrentTime int64 |
Contributor
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
I intentionally don't want the spec to rely on go standard lib
| slowTimeout int64 = 120 // 2 minutes | ||
| // 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) |
Contributor
There was a problem hiding this comment.
Should we make the variable cutoff change we discussed here or it wouldn't fit this PR?
Contributor
Author
There was a problem hiding this comment.
Remind me please
Co-authored-by: moshe-blox <89339422+moshe-blox@users.noreply.github.com>
13 tasks
|
This pull request has been marked as stale due to 60 days of inactivity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements ssvlabs/SIPs#37
Changes logic to all duties but proposer