Skip to content

Correct behavior when too many relay weights are zero

Our current bw-related behavior is:

  • when any relay has measured bw, we treat all unmeasured bw as 0.
  • otherwise, we use unmeasured bw...
  • Unless the is no unmeasured bw, in which case we treat all relays as having bw=1.

Additionally, we use bandwidth-weights values to weight relays' bw depending on their roles, sometimes reducing their weights to 0.

But there interesting corner cases here:

First: If all relays' weighted bandwidth is zero, should we pick a relay at random, or should we treat all relays as unusable?

Second: If we need N relays (say, for picking a set of vanguards), and we only have M<N relays with nonzero weighted bandwidth, should we pick only M (van)guards, or should we fill up to N relays by picking N-M relays with zero weighted bandwidth?

Third: If in one of the above cases we decide to try relays with zero weighted bandwidth, do we treat them all equally? Or do we try un-weighting first?

Provoked by arti!2880 (merged) and arti#1907.

Needs discussion.

cc @jnewsome

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information