summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary <982483+gmalouf@users.noreply.github.com>2023-12-07 12:51:14 -0500
committerGitHub <noreply@github.com>2023-12-07 12:51:14 -0500
commite63b634ac43ddc2af9ed1faffbd6f761e713ed52 (patch)
treeff8e94084420fd6911914ae74a2970d71f5990c5
parent4291e536b0aa94d6452f0d16e93395187d328e1f (diff)
Round Times: Set minimum dynamic filter timeout to 2500ms. (#5853)
-rw-r--r--agreement/dynamicFilterTimeoutParams.go2
-rw-r--r--agreement/router.go9
2 files changed, 10 insertions, 1 deletions
diff --git a/agreement/dynamicFilterTimeoutParams.go b/agreement/dynamicFilterTimeoutParams.go
index 36348615b..8b02bf082 100644
--- a/agreement/dynamicFilterTimeoutParams.go
+++ b/agreement/dynamicFilterTimeoutParams.go
@@ -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
diff --git a/agreement/router.go b/agreement/router.go
index 6ab144470..86b9a1877 100644
--- a/agreement/router.go
+++ b/agreement/router.go
@@ -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++
}