Skip to content

Draft: chg: When an exit fail to exit, check CC

juga requested to merge juga/sbws:m15_issue40138 into m15

before selecting other exits as helpers. In #40136 (closed) we forgot to consider the corner case in #40041 (closed), discovered thanks to analysis#36 (closed). This was causing that sometimes a CC circuit was built when bwscanner_cc wasn't equal or greater than 1 or the other way around.

We didn't realize about this cause this part of the code is very confusing. To don't make it even more confusing, i've changed the internal API:

  • select_helper_candidates: split funtion into one to select the helper candidates, knowing whether to use the relay as exit or not and other function use_relay_as_entry to decide whether to use the relay as entry or not checking CC params. Also pass a new arg relay_as_entry.
  • create_path_relay: rewmove not used cb arg, add candidates arg to stop having to select them again later on. Move the no candidates condition here instead of checking it in pick_ideal_second_hop.
  • _pick_ideal_second_hope: remove unneded destandcont arguments, rename is_exit to helper_is_exit. Use the candidates instead of selecting them again.
  • measure_relay: in the case an exit fails to exit, select the candidates knowing that they have to be exits and checking CC.
  • only_relays_with_bandwidth: remove unneded arg controller so that there is no need to pass it through several functions.

Closes #40138 (closed)

Merge request reports

Loading