summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/hspool.rs
Commit message (Collapse)AuthorAgeFilesLines
* circmgr: Remove the CircParameters build .expect()David Goulet2025-01-161-4/+2
| | | | | | Instead, return an error and make all call site handle it. Signed-off-by: David Goulet <[email protected]>
* circ: Specialize the circparams from netparams functionDavid Goulet2025-01-161-5/+3
| | | | | | | | | | | | | | | Congestion control parameters have specific values depending on the circuit type. Instead of using a CircuitType, which is removed in this commit, specialize the function in this case onion and exit. This allows us to get rid of CircuitType and solely use TargetCircUsage instead. At this commit, we use .expect() on the Builder. Future commit will remove this to return a Result in case of failure. Worth noting that we don't expect one. Signed-off-by: David Goulet <[email protected]>
* circmgr: Modify CircParameters for congestion controlDavid Goulet2025-01-161-4/+9
| | | | | | | | | | | | | | The congestion control parameters are created from the consensus parameters (netparams) and then put into the CircParameters object that is then passed down the tor-proto crate. Because different parameters are selected depending on the circuit type (onion vs exit vs sbws), a CircuitType enum is introduced for the sole purpose of being used to select the right parameters. Related #534 Signed-off-by: David Goulet <[email protected]>
* tor-circmgr: Rename Short/Extended to Naive/Guarded.Gabriela Moldovan2024-10-241-15/+15
|
* tor-circmgr: Post-renaming documentation fixes.Gabriela Moldovan2024-10-241-4/+4
|
* tor-circmgr: s/stub/stem throughout.Gabriela Moldovan2024-10-241-23/+23
|
* tor-circmgr: s/HsCircStubKind/HsCircStemKind.Gabriela Moldovan2024-10-241-21/+21
| | | | As per #1479
* tor-circmgr: s/HsCircStubKind/HsCircStemKind.Gabriela Moldovan2024-10-241-25/+25
| | | | As per #1479
* tor-circmgr: Use the new vanguards terminology throughout.Gabriela Moldovan2024-10-241-19/+19
| | | | | | | | This is the first step towards clarifying the questions from !2230. Corresponding torspec changes: https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/282 Part of #1479
* memquota: Change ToplevelAccount to be an alias for Arc<MemoryQuotaTracker>Ian Jackson2024-10-151-1/+2
| | | | Fixes a TODO.
* memquota: Add a toplevel account in tor-chanmgrIan Jackson2024-10-031-0/+2
| | | | | | | | | Plumb through a top-level account. This doesn't have any channel-specific, circuit-specific or stream-specific accounts yet. tor-circmgr's and tor-hsclient's *tests* need fake account. In arti-relay, use a dummy account for now.
* CircMgr: Start writing tests.Wesley Aptekar-Cassels2024-10-031-1/+1
|
* Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-251-2/+2
| | | | | | The `derive_more` crate broke backward compatibility with this version, so this change involved quite a few manual fixups. With luck, they'll keep compatibility for some while in the future.
* CircMgr: Make CircMgr and HsCircPool generic over builder type.Wesley Aptekar-Cassels2024-09-241-91/+161
| | | | | | | | | | This will allow for testing, as the CircuitBuilder can be replaced with a mocked version. This did require moving some of what was in the CircuitBuilder impl into the AbstractCircuitBuilder type, since Drop implementations can't be specialized, but that's fine, as we'll probably be doing more of that in the future anyways.
* tor-circmgr: Make client rendezvous circuits EXTENDED instead of SHORT.Gabriela Moldovan2024-06-251-3/+3
| | | | | | | | This updates the code to match the spec. This fixes TROVE-2024-008. Closes #1474
* tor-circmgr: Remove duplicated path building logic from HS pool.Gabriela Moldovan2024-06-201-30/+19
|
* tor-circmgr: Fix clippy warning.Gabriela Moldovan2024-06-201-1/+1
|
* tor-circmgr: Gate vanguard-specific code behind vanguards feature.Gabriela Moldovan2024-06-201-0/+15
| | | | | | | This is just code motion: moving the vanguard-specific parts of `maybe_extend_stub_circuit()` behind the `vanguards` feature will enable us to refactor it to use `select_middle_for_vanguard_circuit()`, which is only available if the `vanguards` feature is enabled.
* tor-circmgr: Rename HsCircStubKind::len to HsCircStubKind::num_hops.Gabriela Moldovan2024-06-201-3/+3
|
* tor-circmgr: Note which test prevents TROVE-2024-005.Gabriela Moldovan2024-06-201-0/+1
| | | | | | This test is not new (it was added in !2168), but I think it's a good idea to annotate the tests preventing security issues with the TROVE number and/or arti ticket they pertain to.
* tor-circmgr: Refactor duplicated circuit stub length calculation.Gabriela Moldovan2024-06-201-13/+25
| | | | Part of #1459
* 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