summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/path
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary `doc(cfg(...))` attributesNeel Chauhan2025-12-041-1/+0
| | | | | | | | | Fixes part of #2193. (Edits from nickm: I selected the cases here that I could verify were correct from immediate context.) Edited-by: Nick Mathewson <[email protected]>
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-243-0/+8
| | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* RelayFlags: Use RelayFlag enum variant names everywhereIan Jackson2025-11-181-6/+6
| | | | | | | Abolish the constants with the transitional names. This also abolishes the controversial name `H_S_DIR`, which Rust case transformation rules generated from `HSDir`.
* RelayFlags: Use the singular RelayFlag for naming individual flagsIan Jackson2025-11-181-7/+7
| | | | | | | | | | | | | | We're going to separate RelayFlag from RelayFlags. We could continue to provide a bunch of constant values for RelayFlags, for each individual type, but that would involve an ad-hoc derive, and would still be a bit of an unusual API. Instead, we're going to make ``RelayFlag` a normal enum. In this commit, we change everyone to refer to it by its singular name. Hopefully separating out this bulk change makes both this, and the core commit, easier to review.
* tor-netdoc: Remove the RelayFlags type alias in netstatusIan Jackson2025-11-181-1/+2
| | | | I would do `#[deprecated]` but empirically that has no effect...
* tor-netdoc: Rename RelayFlags elements for regularity vs specIan Jackson2025-11-181-1/+1
| | | | | Add underscores so that the spec keywords and the flag constants correspond (according to `paste`'s case-changing rules).
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-063-3/+3
| | | | Run maint/add_warning
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-073-10/+10
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Improve descriptions of rejected relays: omit "rejected 0/X"Nick Mathewson2025-06-251-3/+3
| | | | | | | | Now instead of saying "rejected 0/40 as not usable as middle relay; 28/40 as in same family as already selected", we say "rejected 28/40 as in same family as already selected". Closes #2006.
* hspool: refactor path match to be exhaustive.Nick Mathewson2025-05-221-7/+11
|
* circmgr: when building client rend stems, make sure last hop has new_rend usage.Nick Mathewson2025-05-201-16/+43
|
* guardmgr, circmgr: Make vanguard selection take a RelaySelector.Nick Mathewson2025-05-202-26/+54
| | | | | | This is the preferred type for choosing a relay, since unlike a RelayExclusion, it lets us add multiple restrictions, and a relay usage.
* circmgr: Propagate Option<HsCircKind> down to path selection functionsNick Mathewson2025-05-201-35/+80
| | | | | | We'll need this in order to build paths that are specifically for client rend circuits. I thought of using a boolean here, but that had potential to get ugly in the future.
* relay-selection: tweak messages about rejection reasonsNick Mathewson2025-05-201-3/+3
| | | | | | "Useless as xyz" implies that the relay wouldn't work at all as a middle relay, but that's not true: it _would_ work somewhat, but be can't use it for some other reason.
* relay-selection: Add FamilyRules to exclude_relays_in_same_family.Nick Mathewson2025-02-251-10/+18
| | | | | | | | | | | | When we're trying to exclude relays by family, we need to know which lists to look at. This information ultimately comes from the network parameters. We could avoid this change if we just told clients "look at all family information all the time", but that's not what the proposal says. This is a breaking change.
* tor-circmgr: Clarify that using guarded for client rend is an exception.Gabriela Moldovan2024-10-241-1/+14
|
* tor-circmgr: Rename Short/Extended to Naive/Guarded.Gabriela Moldovan2024-10-241-12/+12
|
* tor-circmgr: Try to clarify what a "circuit stem" is.Gabriela Moldovan2024-10-241-2/+3
|
* tor-circmgr: Post-renaming documentation fixes.Gabriela Moldovan2024-10-242-9/+9
|
* tor-circmgr: s/stub/stem throughout.Gabriela Moldovan2024-10-241-37/+37
|
* tor-circmgr: s/HsCircStubKind/HsCircStemKind.Gabriela Moldovan2024-10-241-18/+18
| | | | As per #1479
* tor-circmgr: Use the new vanguards terminology throughout.Gabriela Moldovan2024-10-241-16/+16
| | | | | | | | 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
* tor-netdir: Allow access to the `ConsensusBuilder` when building test netdirs.Gabriela Moldovan2024-09-092-2/+2
| | | | | This allows us to set SRVs for example (needed because by default, the test `NetDir` is built from a consensus that doesn't contain any SRVs).
* tor-circmgr: removed unused 'skip_guard_subnet_check' workaround in testsSteven Engler2024-08-151-18/+5
|
* tor-circmgr: removed unused "chosen exit" functionalitySteven Engler2024-08-152-116/+12
|
* tor-circmgr: fix flaky `path::exitpath::test::by_ports` testSteven Engler2024-08-131-7/+20
| | | | | | | | | | | | | | | | The `path::exitpath::test::by_ports` test sometimes failed now that the test is using a `GuardMgr` since `select_guard`, when given a chosen exit, only ensures that the guard and chosen exit are not in the same family. It does not ensure that the guard and exit do not share an extended family. This commit relaxes an assertion in the test. ```text thread 'path::exitpath::test::by_ports' panicked at crates/tor-circmgr/src/path/exitpath.rs:295:9: assertion failed: r1.can_share_circuit(r3, subnet_config) ``` This "chosen exit" functionality isn't actually being used anywhere (`ExitPathBuilderInner::ChosenExit` is only ever constructed in tests).
* tor-circmgr: assert in test that exit path begins with guardSteven Engler2024-08-121-2/+4
|
* tor-circmgr: make `GuardMgr` mandatorySteven Engler2024-08-123-184/+57
| | | | | | | Functions that took `Option<&GuardMgr>` now take only `&GuardMgr`. Three unit tests were removed that covered behaviour when no guard manager was set.
* tor-circmg: prepare tests for runtime requirementSteven Engler2024-08-121-88/+94
| | | | | | This wraps some unit tests with `tor_rtcompat::test_with_all_runtimes!`. This is its own commit to get the indentation changes out of the way and declutter the following commit.
* tor-circmgr: Clarify the update_last_hop_kind documentation.Gabriela Moldovan2024-06-201-2/+10
|
* tor-circmgr: Rename VanguardPath to PathBuilder.Gabriela Moldovan2024-06-202-13/+12
|
* tor-circmgr: Break VanguardHsPathBuilder::pick_path into smaller parts (fmt).Gabriela Moldovan2024-06-201-5/+2
|
* tor-circmgr: Break VanguardHsPathBuilder::pick_path into smaller parts.Gabriela Moldovan2024-06-202-118/+259
| | | | | | This is a follow up from https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2186#note_3035525 Closes #1459
* tor-circmgr: Remove unnecessary TODO.Gabriela Moldovan2024-06-201-1/+0
| | | | There's not much to refactor about this line.
* tor-circmgr: Rename HsCircStubKind::len to HsCircStubKind::num_hops.Gabriela Moldovan2024-06-201-2/+2
|
* tor-circmgr: Write tests for the HsPathBuilder.Gabriela Moldovan2024-06-201-0/+463
| | | | | | | These tests should give us *some* assurance that the upcoming `HsVanguardPathBuilder` refactoring doesn't break anything. Part of #1459
* tor-circmgr: Refactor duplicated circuit stub length calculation.Gabriela Moldovan2024-06-201-14/+1
| | | | Part of #1459
* tor-circmgr: Explicitly handle all VanguardMode variants.Gabriela Moldovan2024-06-051-1/+10
| | | | This is less error-prone than the alternative.
* tor-circmgr: Reference a ticket number in a refactoring TODO.Gabriela Moldovan2024-06-051-1/+1
|
* tor-circmgr: Note that guard_and_target exclusion sometimes doesn't exclude ↵Gabriela Moldovan2024-06-051-0/+3
| | | | target.
* tor-circmgr: Exclude the target relay when building vanguards circuits.Gabriela Moldovan2024-06-041-13/+71
| | | | | | Otherwise, some of the circuits will fail (because if the target is selected as one of the L2, L3, or M hops, it won't be able to extend the circuit to itself).
* tor-circmgr: Return an error if HS circ has an invalid length.Gabriela Moldovan2024-06-031-4/+15
| | | | | | | | | | | | Previously, we'd `debug_assert` that the length of the path is valid. However, `debug_` asserts are compiled out for release builds, which means that if we have some code path that triggers the assertion failure, it will go unnoticed unless our tests happen to exercise it. It's safer to return an internal error, because we definitely don't want to proceed if the path is too short (see arti#1400 and arti#1409). Addresses https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2154#note_3030820
* tor-circmgr: Clarify module-level docs.Gabriela Moldovan2024-05-161-0/+6
|
* tor-circmgr: Replace STUB/STUB+ terminology with SHORT/EXTENDED.Gabriela Moldovan2024-05-161-17/+15
| | | | | | | 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-1/+1
| | | | Part of #1339
* tor-circmgr: Fix path not being extended if lite vanguards are enabled.Gabriela Moldovan2024-05-141-1/+10
|
* tor-circmgr: Assign error-handling closure to variable.Gabriela Moldovan2024-05-141-7/+10
| | | | We will soon need to reuse this.
* tor-circmgr: Rename neighbor_exclusion variables for clarity.Gabriela Moldovan2024-05-141-4/+4
| | | | | | I am about to reuse one of these on the "lite" vanguards branch. I am renaming them to make it easier to see which one of the two I will be using.
* tor-circmgr: After building the HS path, assert the length is correct.Gabriela Moldovan2024-05-141-1/+18
| | | | | | One of these assertions currently fails, because we have a bug in the vanguard path builder: if lite vanguards are enabled, we only build 2-hop circuits instead of 3.
* tor-circmgr: Remove TODO expressing doubt about VanguardHsPathBuilder.Gabriela Moldovan2024-05-091-2/+0
| | | | | I don't think it's all wrong, this was left over from the first draft implementation.