Measure exits in non-exit positions?
If we look at sbws we have
def use_relay_as_entry(relay, rl, dest):
"""Return whether to use the relay as entry or not.
:rtype: bool
"""
log.debug("Deciding whether to use the relay as entry or not.")
relay_as_entry = True
if rl.is_consensus_cc_alg_2:
log.debug("Congestion control enabled.")
if rl.is_consensus_bwscanner_cc_gte_1:
log.debug("Use congestion control.")
if (
relay.is_exit_not_bad_allowing_port(dest.port)
and relay.has_2_in_flowctrl
):
log.debug("Relay to measure is exit.")
log.debug("Exit has 2 in FlowCtrl.")
log.debug("Use relay as exit. Choose non-exits.")
relay_as_entry = False
and
def select_helper_candidates(relay, rl, dest, relay_as_entry=True):
"""Return helper candidates list.
:rtype: list
"""
if rl.is_consensus_cc_alg_2:
log.debug("Congestion control enabled.")
if rl.is_consensus_bwscanner_cc_gte_1:
log.debug("Use congestion control.")
if (
relay.is_exit_not_bad_allowing_port(dest.port)
and relay.has_2_in_flowctrl
and not relay_as_entry
):
log.debug("Relay to measure is exit.")
log.debug("Exit has 2 in FlowCtrl.")
log.debug("Use relay as exit. Choose non-exits.")
candidates = rl.non_exits
which means we measure all exit relays per default in an exit position (assuming their exit policy allows reaching the used web server and they did not fail to be measured in the exit position) picking a non-exit as the first hop. I wonder, though, whether we should have some way at least to measure them in a non-exit position by default (however, then issues like #40029 (closed) might bite us).
The reason for thinking about this is that we might want to avoid exit measurements being impacted by DoS on the network involving non-exits (e.g. due to heavy onion services related traffic). That could be important not just for the overall weight of exits but might be helpful if we start sorting through our data for bandwidth inflation detection (e.g. by graphing ratios per flag).