aboutsummaryrefslogtreecommitdiff
path: root/src/feature/nodelist
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2022-10-20 20:56:33 -0400
committerRoger Dingledine <arma@torproject.org>2022-10-24 04:34:49 -0400
commitbab8375ef5e4a917f9512e4250c52a45d33fb9ba (patch)
treef8b237be29a67ed8ff1146218874c88f77779fb3 /src/feature/nodelist
parentea2ba4f5a89e60ef1b9d589b8a9013ba9cd87e77 (diff)
downloadtor-bab8375ef5e4a917f9512e4250c52a45d33fb9ba.tar.gz
tor-bab8375ef5e4a917f9512e4250c52a45d33fb9ba.zip
dir auths now omit Measured= if rs->is_authority
Directory authorities stop voting a consensus "Measured" weight for relays with the Authority flag. Now these relays will be considered unmeasured, which should reserve their bandwidth for their dir auth role and minimize distractions from other roles. In place of the "Measured" weight, they now include a "MeasuredButAuthority" weight (not used by anything) so the bandwidth authority's opinion on this relay can be recorded for posterity. Resolves ticket 40698.
Diffstat (limited to 'src/feature/nodelist')
-rw-r--r--src/feature/nodelist/fmt_routerstatus.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/feature/nodelist/fmt_routerstatus.c b/src/feature/nodelist/fmt_routerstatus.c
index 95379a7721..8c02a302af 100644
--- a/src/feature/nodelist/fmt_routerstatus.c
+++ b/src/feature/nodelist/fmt_routerstatus.c
@@ -169,9 +169,20 @@ routerstatus_format_entry(const routerstatus_t *rs, const char *version,
smartlist_add_asprintf(chunks,
"w Bandwidth=%d", bw_kb);
+ /* Include the bandwidth weight from our external bandwidth
+ * authority, if we have one. */
if (format == NS_V3_VOTE && vrs && vrs->has_measured_bw) {
- smartlist_add_asprintf(chunks,
- " Measured=%d", vrs->measured_bw_kb);
+ if (!rs->is_authority) { /* normal case */
+ smartlist_add_asprintf(chunks,
+ " Measured=%d", vrs->measured_bw_kb);
+ } else {
+ /* dir auth special case: don't give it a Measured line, so we
+ * can reserve its attention for authority-specific activities.
+ * But do include the bwauth's opinion so it can be recorded for
+ * posterity. See #40698 for details. */
+ smartlist_add_asprintf(chunks,
+ " MeasuredButAuthority=%d", vrs->measured_bw_kb);
+ }
}
/* Write down guardfraction information if we have it. */
if (format == NS_V3_VOTE && vrs && vrs->status.has_guardfraction) {