Skip to content

Conversation

@GalRogozinski
Copy link
Contributor

Implements ssvlabs/SIPs#37

Changes logic to all duties but proposer

@GalRogozinski GalRogozinski marked this pull request as ready for review January 21, 2024 13:21
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

different than impl

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)
Copy link
Contributor Author

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...

Copy link
Contributor

@MatheusFranco99 MatheusFranco99 left a 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
Copy link
Contributor

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.

Copy link
Contributor Author

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

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)
Copy link
Contributor

@moshe-blox moshe-blox Mar 25, 2024

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?

Copy link
Contributor Author

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]>
@github-actions
Copy link

This pull request has been marked as stale due to 60 days of inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants