Skip to content
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 Times: Set minimum dynamic filter timeout to 2500ms. #5853

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion agreement/dynamicFilterTimeoutParams.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const dynamicFilterCredentialArrivalHistory int = 40

// DynamicFilterTimeoutLowerBound specifies a minimal duration that the
// filter timeout must meet.
const dynamicFilterTimeoutLowerBound time.Duration = 500 * time.Millisecond
const dynamicFilterTimeoutLowerBound time.Duration = 2500 * time.Millisecond

// DynamicFilterTimeoutCredentialArrivalHistoryIdx specified which sample to use
// out of a sorted DynamicFilterCredentialArrivalHistory-sized array of time
Expand Down
9 changes: 9 additions & 0 deletions agreement/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,16 @@ var credentialRoundLag round

func init() {
// credential arrival time should be at most 2*config.Protocol.SmallLambda after it was sent
// Note that the credentialRoundLag is inversely proportional to the dynamicFilterTimeoutLowerBound
// in the default formula. Since we are adjusting this lower bound over time,
// for consistency in analytics we are setting the minimum to be 8 rounds
// (equivalent to a dynamicFilterTimeoutLowerBound of 500 ms).
minCredentialRoundLag := round(8) // round 2*2000ms / 500ms
credentialRoundLag = round(2 * config.Protocol.SmallLambda / dynamicFilterTimeoutLowerBound)

if credentialRoundLag < minCredentialRoundLag {
credentialRoundLag = minCredentialRoundLag
}
if credentialRoundLag*round(dynamicFilterTimeoutLowerBound) < round(2*config.Protocol.SmallLambda) {
credentialRoundLag++
}
Expand Down