Commit 377ef773 authored by juga's avatar juga
Browse files

fix: relaylist: Stop measuring relays not in the consenus

as this might cause many circuit errors.
They're already added to the generator.
Also adapt the number in test_init_relays.

Closes: #40037.

Happy solstice! :)
parent 713d4004
Pipeline #2047 failed with stage
in 29 minutes and 55 seconds
......@@ -417,11 +417,10 @@ class RelayList:
# already added to the new list.
new_relays_dict.pop(fp)
# If the relay is not in the current consensus but is not "old"
# yet, add it to the new list of relays too, though its timestamp,
# router status and descriptor can't be updated.
elif not r.is_old():
new_relays.append(r)
# In #30727, the relay that is not in the current conensus but is
# not "old", was added to the new list of relays too.
# In #40037 we think it should not be measured, as it might cause
# many circuit errors. It's already added to the generator.
# Otherwise, don't add it to the new list of relays.
# For debugging, count the old relays that will be discarded.
else:
......
......@@ -51,7 +51,7 @@ def test_init_relays(
assert 6505 == 6433 + len(added_fps)
# The calculated min bw for the second hop
assert 2120000 == relay_list._exit_min_bw
assert 200000 == relay_list._non_exit_min_bw
assert 210000 == relay_list._non_exit_min_bw
# Five days later plus 1 second.
# The first consensus timestamp will get removed.
......@@ -69,10 +69,10 @@ def test_init_relays(
removed_fps = fps.difference(fps_5days_later)
# The number of relays will be the number of relays in the cosensus plus
# the added ones minus the removed ones.
assert 6925 == 6505 + len(added_fps) - len(removed_fps)
assert 6596 == 6505 + len(added_fps) - len(removed_fps)
# The calculated min bw for the second hop
assert 2790000 == relay_list._exit_min_bw
assert 110000 == relay_list._non_exit_min_bw
assert 2800000 == relay_list._exit_min_bw
assert 150000 == relay_list._non_exit_min_bw
def test_increment_recent_measurement_attempt(args, conf, controller):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment