diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-01-13 12:05:08 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-01-16 14:50:13 -0500 |
commit | 125fba2e9988a7a31d5f6d45d897c3e8f1ca7480 (patch) | |
tree | 55ee3be3cbed4d11c453c5e05409dc562472f157 | |
parent | 1810db9bb32d2e9a1a1fe751368a98edc4524331 (diff) | |
download | tor-125fba2e9988a7a31d5f6d45d897c3e8f1ca7480.tar tor-125fba2e9988a7a31d5f6d45d897c3e8f1ca7480.tar.gz |
Provide consensus params to constrain the threshold for Fast
resolves ticket 3946
-rw-r--r-- | changes/fast_bw_param | 8 | ||||
-rw-r--r-- | src/or/dirserv.c | 12 |
2 files changed, 20 insertions, 0 deletions
diff --git a/changes/fast_bw_param b/changes/fast_bw_param new file mode 100644 index 000000000..abe630d8b --- /dev/null +++ b/changes/fast_bw_param @@ -0,0 +1,8 @@ + o Minor features (directory authority): + - Provide two consensus parameters (FastFlagMinThreshold and + FastFlagMaxThreshold) to control the range of allowable bandwidths for + the Fast directory flag. This allows authorities to run better + experiments on appropriate requirements for being a "Fast" node. + The AuthDirFastGuarantee flag still applies. + + diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 94a415fe2..e5995697d 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -1938,6 +1938,18 @@ dirserv_compute_performance_thresholds(routerlist_t *rl) if (guard_tk > TIME_KNOWN_TO_GUARANTEE_FAMILIAR) guard_tk = TIME_KNOWN_TO_GUARANTEE_FAMILIAR; + { + /* We can vote on a parameter for the minimum and maximum. */ + int32_t min_fast, max_fast; + min_fast = networkstatus_get_param(NULL, "FastFlagMinThreshold", + 0, 0, INT32_MAX); + max_fast = networkstatus_get_param(NULL, "FastFlagMaxThreshold", + INT32_MAX, min_fast, INT32_MAX); + if (fast_bandwidth < (uint32_t)min_fast) + fast_bandwidth = min_fast; + if (fast_bandwidth > (uint32_t)max_fast) + fast_bandwidth = max_fast; + } /* Protect sufficiently fast nodes from being pushed out of the set * of Fast nodes. */ if (options->AuthDirFastGuarantee && |