There's a serious bug in #28563 (moved): sbws is not reporting any relays until MIN_REPORT has been reached.
But we want sbws to always report every relay for diagnostics. If the bandwidth file doesn't have minimum_number_eligible_relays, they should all be marked as "under_min_report=1 vote=0".
LGTM. Before merging, a question: -- the last time that we marked anything as vote=0, we also marked it as unmeasued=1, bw=1. Do we need to do that in this case?
LGTM. Before merging, a question: -- the last time that we marked anything as vote=0, we also marked it as unmeasued=1, bw=1. Do we need to do that in this case?
But the relays are measured. There just aren't enough of them to have a reasonable set of weighted bandwidths across the network.
But we might want legacy authorities to vote bandwidth=(the measured bandwidth) or bandwidth=(the reported bandwidth) for these relays.
If 3 or more bandwidth authorities are already voting measured bandwidths for most relays, it doesn't matter what we choose. Even if we choose bw=1, the unmeasured relays just have a slightly lower median in their vote.
But if we're just re-starting the bandwidth authorities after many of them have failed, here's what happens when we vote bw=
1: measured relays get a consensus weight of 1 once 3 authorities know about them
then there is a big change in weight once 2 authorities have measured 60% of relays, and start voting measured bandwidths
the reported bandwidth: measured relays get a consensus weight of their reported bandwidth once 3 authorities have measured them
then there is a smaller change to the measured weight once 2 authorities have measured 60% of relays, and start voting measured bandwidths
relays can lie about their bandwidth more easily
the measured bandwidth:measured relays get a consensus weight of their measured bandwidth once 3 authorities have measured them
there is no change once 2 authorities have measured 60% of relays, and start voting measured bandwidths
So I think we should put measured bandwidths in the bandwidth file in this case.
(And we don't need real_bw.)
I'll do a draft spec update,
What do you think, juga, nickm?
So I think we should put measured bandwidths in the bandwidth file in this case.
(And we don't need real_bw.)
I'll do a draft spec update,
What do you think, juga, nickm?
Yeah, i think it's makes more sense to start voting with the actual measured (and filtered and scaled) bandwidth.
I don't understand why the changes here didn't cause/require changes in the test files?
Yeah, sorry, this code is quite confusing, it really needs refactor/renaming and better comments.
So, we have the following cases:
case 0: the number of eligible relays is over the 60% of the consensus, nothing is set.
case 1: after filtering, there are not eligible relays, they will be set "vote=0 under_min_report = 1" and they will also have "unmeasured=1 bw=1" because they are not eligible.
case 2: after scaling, the number of relays is less than 60% in the consensus, they will be set "vote=0 under_min_report =1", the won't have "unmeasured=1", but some of them may have "bw=1" just because that's the bandwdith after scaling
I added a test to check the 3 cases.
The changes in this branch, did require changes in other tests, in concrete:
test_torflow_scale:
i mocked consensus to pretend the network has only 1 relay so that the filtered relays are over the 60% and the scaling expected results continue working. Nothing regarding under_min_report changes here.
test_from_results_read
i hardcoded under_min_report because update_progress would be None and if not min_perc will set under_min_report