diff options
author | Nick Mathewson <nickm@torproject.org> | 2024-03-12 08:34:48 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2024-03-12 09:43:14 -0400 |
commit | 50e1c6d494ed062dff60f3b5f05c12758207bda2 (patch) | |
tree | 96e769004e027dd12b88788139c053ca1152fc65 | |
parent | 125ea7b41b9e310f80fb66a8a52bcc3c05813a36 (diff) | |
download | arti-50e1c6d494ed062dff60f3b5f05c12758207bda2.tar.gz arti-50e1c6d494ed062dff60f3b5f05c12758207bda2.zip |
Annotate usage of low_level_predicate_permits_relay
-rw-r--r-- | crates/tor-circmgr/src/hspool.rs | 8 | ||||
-rw-r--r-- | crates/tor-guardmgr/src/filter.rs | 8 |
2 files changed, 15 insertions, 1 deletions
diff --git a/crates/tor-circmgr/src/hspool.rs b/crates/tor-circmgr/src/hspool.rs index a632ae933..a4b39c180 100644 --- a/crates/tor-circmgr/src/hspool.rs +++ b/crates/tor-circmgr/src/hspool.rs @@ -353,6 +353,14 @@ fn circuit_compatible_with_target( circ: &ClientCirc, exclude_target: &RelayExclusion, ) -> bool { + // NOTE, TODO #504: + // This uses a RelayExclusion directly, when we would be better off + // using a RelaySelector to make sure that we had checked every relevant + // property. + // + // The behavior is okay, since we already checked all the properties of the + // circuit's relays when we first constructed the circuit. Still, it would + // be better to use refactor and a RelaySelector instead. circuit_still_useable(netdir, circ, |relay| { exclude_target.low_level_predicate_permits_relay(relay) }) diff --git a/crates/tor-guardmgr/src/filter.rs b/crates/tor-guardmgr/src/filter.rs index 7c712355f..b6358aa15 100644 --- a/crates/tor-guardmgr/src/filter.rs +++ b/crates/tor-guardmgr/src/filter.rs @@ -82,7 +82,13 @@ impl GuardFilter { let mut guard_bw: RelayWeight = 0.into(); let mut permitted_bw: RelayWeight = 0.into(); // TODO #504: This is an unaccompanied RelayUsage, and is therefore a - // bit suspect. We should consider whether we like this behavior. + // bit suspect. We should consider whether we like this behavior, + // or whether we should convert it into a RelaySelector. + // + // It is not _too_ bad, however, since we're only looking at the + // fraction of the relays that might be guards; we won't use these + // relays without later choosing them via a RelaySelector. Nonetheless, + // it would be better to construct a RelaySelector. let usage = RelayUsage::new_guard(); // TODO: There is a case to be made for converting "permitted by this |