|
@@ -37,10 +37,8 @@ Target: 0.2.2.x
|
|
|
the number of authorities we have.
|
|
|
|
|
|
The better fix is to allow certain authorities to specify that they are
|
|
|
- voting on bandwidth "offsets": how much they think the weight should
|
|
|
- be changed for the relay in question. We should put the offset vote in
|
|
|
- the stanza for the relay in question, so a given authority can choose
|
|
|
- which relays to express preferences for and which not.
|
|
|
+ voting on bandwidth measurements: more accurate bandwidth values that
|
|
|
+ have actually been evaluated. In this way, authorities
|
|
|
|
|
|
3. Security implications
|
|
|
|
|
@@ -64,15 +62,41 @@ Target: 0.2.2.x
|
|
|
|
|
|
First, we need a new consensus method to support this new calculation.
|
|
|
|
|
|
- Now v3 votes can have a new weight on the "w" line:
|
|
|
- "Bandwidth_Offset=" INT.
|
|
|
+ Now v3 votes can have an additional value on the "w" line:
|
|
|
+ "w Bandwidth=X Measured=" INT.
|
|
|
+
|
|
|
Once we're using the new consensus method, the new way to compute the
|
|
|
- Bandwidth weight is by taking the old vote (explained in proposal 141:
|
|
|
- median, then choose the lower number in the case of ties), and adding
|
|
|
- or subtracting the median offset (using the offset closer to 0 in the
|
|
|
- case of ties, and with a sum of 0 if the sum is negative).
|
|
|
+ Bandwidth weight is by checking if there are at least 3 "Measured"
|
|
|
+ votes. If so, the median of these is taken. Otherwise, the median
|
|
|
+ of the "Bandwidth=" values are taken, as described in Proposal 141.
|
|
|
|
|
|
Then the actual consensus looks just the same as it did before,
|
|
|
so clients never have to know that this additional calculation is
|
|
|
happening.
|
|
|
|
|
|
+5. Implementation
|
|
|
+
|
|
|
+ The Measured values will be read from a file provided by the scanners
|
|
|
+ described in proposal 161. Files with a timestamp older than 3 days
|
|
|
+ will be ignored.
|
|
|
+
|
|
|
+ The file will be read in from dirserv_generate_networkstatus_vote_obj()
|
|
|
+ in a location specified by a new config option "V3MeasuredBandwidths".
|
|
|
+ A helper function will be called to populate new 'measured' and
|
|
|
+ 'has_measured' fields of the routerstatus_t 'routerstatuses' list with
|
|
|
+ values read from this file.
|
|
|
+
|
|
|
+ An additional for_vote flag will be passed to
|
|
|
+ routerstatus_format_entry() from format_networkstatus_vote(), which will
|
|
|
+ indicate that the "Measured=" string should be appended to the "w Bandwith="
|
|
|
+ line with the measured value in the struct.
|
|
|
+
|
|
|
+ routerstatus_parse_entry_from_string() will be modified to parse the
|
|
|
+ "Measured=" lines into routerstatus_t struct fields.
|
|
|
+
|
|
|
+ Finally, networkstatus_compute_consensus() will set rs_out.bandwidth
|
|
|
+ to the median of the measured values if there are more than 3, otherwise
|
|
|
+ it will use the bandwidth value median as normal.
|
|
|
+
|
|
|
+
|
|
|
+
|