summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/hspool.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-circmgr: Exclude the target when extending SHORT stubs.Gabriela Moldovan2024-06-041-4/+18
| | | | | When extending SHORT circuit stubs, the last hop shouldn't be the same as the circuit target.
* tor-circmgr: Apply deferred fmt.Gabriela Moldovan2024-06-041-1/+3
|
* tor-circmgr: Add TODOs about improving circuit length checks.Gabriela Moldovan2024-06-041-0/+2
|
* tor-circmgr: Remove HsPool::vanguards_enabled() (fmt).Gabriela Moldovan2024-06-041-2/+10
|
* tor-circmgr: Remove HsPool::vanguards_enabled().Gabriela Moldovan2024-06-041-24/+33
| | | | | | | | | Previously, the HsCircPool had a bug that caused SHORT lite-vanguards circuits to be incorrectly extended by one hop when being repurposed as EXTENDED circuits (EXTENDED circuits only need to be extended by extra hop if full vanguards are in use). Closes #1456 and #1458
* tor-circmgr: Validate the circuit stub length before returning it.Gabriela Moldovan2024-06-041-8/+68
|
* tor-circmgr: Display the offending hop if the circuit is not compatible with ↵Gabriela Moldovan2024-06-031-4/+5
| | | | target.
* tor-circmgr: Use has_any_relay_id_from to check for relay equality.Gabriela Moldovan2024-06-031-2/+2
| | | | | | | When checking for relay equality, we are happy to accept some false positives (which result in building/selecting a different circuit). We want to be less tolerant of false negatives, to avoid accidentally using a circuit that doesn't have the properties we need.
* tor-circmgr: Ensure circuit stubs are compatible with the target.Gabriela Moldovan2024-06-031-1/+39
| | | | | | This is a follow-up from !2167. It should prevent issues like #1417 from going unnoticed.
* tor-circmgr: Make retire_all_circuits unconditional.Gabi Moldovan2024-06-031-1/+0
| | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2168?commit_id=3c67fa55c7c5b0c4f30c1d57e8e67fe541d9c99e#note_3033368
* tor-circmgr: Log the kind of HS circuit stub we are selecting.Gabriela Moldovan2024-06-031-1/+7
|
* tor-circmgr: Remove VanguardMode from Pool (fmt).Gabriela Moldovan2024-06-031-3/+1
|
* tor-circmgr: Remove VanguardMode from Pool.Gabriela Moldovan2024-06-031-6/+6
| | | | | | | | | Storing the VanguardMode in multiple places (in the VanguardMgr *and* the HS circ Pool) is dangerous and can lead to split brain situations where different parts of the code think they are running in different VanguardModes. See #1424
* tor-circmgr: Remove dangerous vanguards_enabled() function.Gabriela Moldovan2024-06-031-4/+9
| | | | | | | `VanguardMgr` should be the source of truth for obtaining the current `VanguardMode`. Closes #1424
* tor-circmgr: Add a test to check that the pool uses the right VanguardMode.Gabriela Moldovan2024-06-031-0/+86
| | | | See arti#1424
* tor-circmgr: Ensure we don't select an incompatible circuit stub.Gabriela Moldovan2024-06-031-3/+19
| | | | | | | | | | | Previously, HS stub circuit selection (with vanguards enabled) was buggy: when selecting a circuit stub from the circ pool, we failed to ensure its last hop was different from the circuit target. So in some cases, arti would attempt to extend a stub circuit of the form G -> L2 [-> L3] -> T to T, which can't work, because a relay won't extend a circuit to itself (or to its predecessor, for that matter). Closes #1417
* tor-circmgr: Move vanguard circuit validation to a separate function.Gabriela Moldovan2024-06-031-1/+20
| | | | This will soon grow more complex.
* tor-circmgr: Downgrade a HS-VANGUARDS TODO.Gabriela Moldovan2024-06-031-1/+1
|
* tor-circmgr: Fix a broken doc link.Gabriela Moldovan2024-05-161-1/+1
|
* tor-circmgr: Replace STUB/STUB+ terminology with SHORT/EXTENDED.Gabriela Moldovan2024-05-161-8/+8
| | | | | | | The previous STUB/STUB+ terminology was confusing, because STUB and STUB+ are both "circuit stubs" (but STUB is shorter than STUB+). Closes #1339
* tor-circmgr: Rename HsCircStubKind::Stub to HsCircStubKind::Short.Gabriela Moldovan2024-05-161-22/+28
| | | | Part of #1339
* tor-circmgr: Reword a somewhat inaccurate comment about vanguards.Nick Mathewson2024-05-141-1/+1
|
* tor-circmgr: If necessary, extend the circuit to become STUB+.Gabriela Moldovan2024-05-131-8/+42
| | | | Closes #1400
* tor-circmgr: Add a helper for extending HsCircStubs by one hop.Gabriela Moldovan2024-05-131-2/+15
| | | | | | We're about to use this in `maybe_extend_stub_circuit` too. Part of #1400
* tor-circmgr: Don't log unless we are launching some circuits.Gabriela Moldovan2024-04-291-5/+7
| | | | Otherwise we end up logging that we're launching 0 circuits.
* tor-circmgr: Remove no-longer-relevant TODO.Gabriela Moldovan2024-04-291-1/+1
| | | | The wanted_kind _does_ matter.
* tor-circmgr: The circuit must still be usable, even if vanguards are enabled.Gabriela Moldovan2024-04-291-3/+1
|
* tor-circmgr: Prefer STUB+ where possible.Gabriela Moldovan2024-04-291-6/+26
| | | | Closes #1385
* tor-circmgr: Add a TODO about launching HS circuits in parallel.Gabriela Moldovan2024-04-291-0/+1
| | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2102#note_3024370
* tor-circmgr: Remove an addressed TODO.Gabriela Moldovan2024-04-291-13/+0
|
* tor-circmgr: Log the kinds of circuits we're about to launch (fmt).Gabriela Moldovan2024-04-291-4/+1
|
* tor-circmgr: Log the kinds of circuits we're about to launch.Gabriela Moldovan2024-04-291-3/+14
|
* tor-circmgr: Remove no-longer-needed dead code allows.Gabriela Moldovan2024-04-291-2/+0
|
* tor-circmgr: Make a fraction of preemptive HS circuits be STUB+.Gabriela Moldovan2024-04-291-7/+8
| | | | Closes #1353
* tor-circmgr: Loop until we run out of circuits to launch.Gabriela Moldovan2024-04-251-1/+1
| | | | | Previously this would only loop `n_to_launch - 1` times, so the pool was always 1 circuit short of the `n_to_launch` target.
* tor-circmgr: Cross-reference the hspath docs in the HsCircStubKind docs.Gabriela Moldovan2024-03-201-1/+3
|
* tor-circmgr: Remove unnecessary Result wrapping.Gabriela Moldovan2024-03-201-7/+7
|
* tor-circmgr: Add an explanation and a couple of TODOs.Gabriela Moldovan2024-03-201-0/+8
|
* tor-circmgr: Clarify the TODO in launch_hs_circuits_as_needed.Gabriela Moldovan2024-03-201-2/+12
|
* tor-circmgr: s/can_build/can_become.Gabriela Moldovan2024-03-201-2/+2
|
* tor-circmgr: Move match block to a separate function.Gabriela Moldovan2024-03-201-15/+20
|
* tor-circmgr: Tell HsPathBuilder what kind of circuit stub is needed.Gabriela Moldovan2024-03-201-2/+6
|
* tor-circmgr: Handle the take_or_launch_stub_circuit result.Gabriela Moldovan2024-03-201-0/+13
|
* tor-circmgr: Make take_or_launch_stub_circuit vanguard-aware.Gabriela Moldovan2024-03-201-8/+59
|
* tor-circmgr: Add functions for checking if vanguards are enabled.Gabriela Moldovan2024-03-201-0/+12
|
* tor-circmgr: For each HS ClientCirc, note whether it's STUB or STUB+.Gabriela Moldovan2024-03-201-19/+95
| | | | Closes #1276
* Annotate usage of low_level_predicate_permits_relayNick Mathewson2024-03-121-0/+8
|
* Rename the RelayPredicate trait to discourage its being used directly.Nick Mathewson2024-03-121-2/+4
| | | | Everybody who can, should instead use a RelaySelector.
* Add comments about "unaccompanied" use of Relay{Usage,Exclusion}Nick Mathewson2024-03-121-0/+2
| | | | | | When used outside of RelaySelector, these two types don't enforce one another's presence, and as such have a bit more risk of negligent use.
* hspool: Replace TargetInfo with a RelayExclusion.Nick Mathewson2024-03-121-53/+17
|