summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* *: suppress cognitive_complexity warnings from nightlyNick Mathewson2025-05-291-0/+2
| | | | | | | | | | | | | Apparently clippy nightly is better (or worse?) about detecting complex functions than before, so I'm suppressing these warnings where they occur. I have mixed feelings about these warnings: On the plus side, they really do help to detect functions that are twistier than they need to be. On the minus side, they get confused by tracing macros, and the "allows" do pile up. But on the plus side, those "allows" do provide a way to find functions that need to be refactored, and they are never uglier than the functions they decorate.
* circmgr: Propagate Option<HsCircKind> down to path selection functionsNick Mathewson2025-05-201-5/+12
| | | | | | 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.
* circmgr: Make path module public on "--features=experimental-api"Nick Mathewson2025-05-051-1/+9
| | | | | | | | | | | | Back in 4c1eb94173521bc5104449327650e20ffe32afa7, for sensible reasons, we made `tor_circmgr::path` a crate-private module. But when we did that, we lost the ability for callers to construct circuits with custom paths. This will make it possible for callers to build custom circuits again, without committing to a very-long-term API for that. Closes #1981.
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* circmgr: Remove the CircParameters build .expect()David Goulet2025-01-161-4/+4
| | | | | | 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-9/+16
| | | | | | | | | | | | | | | 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-13/+10
| | | | | | | | | | | | | | 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]>
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* tor-circmgr: Rename Short/Extended to Naive/Guarded.Gabriela Moldovan2024-10-241-1/+1
|
* tor-circmgr: s/HsCircStubKind/HsCircStemKind.Gabriela Moldovan2024-10-241-3/+3
| | | | As per #1479
* Disable a lot of dead code warningsIan Jackson2024-10-171-0/+3
| | | | | | | Now cargo check --workspace --no-default-features --all-targets cargo build -p arti --no-default-features --features=memquota,tokio,native-tls are both clean.
* CircMgr: Move note_external_{failure, success} methods to generic impl.Wesley Aptekar-Cassels2024-10-031-27/+27
|
* CircMgr: Move get_or_launch_dir_specific method to generic impl.Wesley Aptekar-Cassels2024-10-031-18/+18
|
* CircMgr: Move get_or_launch_exit method to generic impl.Wesley Aptekar-Cassels2024-10-031-45/+45
|
* CircMgr: Move get_or_launch_dir method to generic impl.Wesley Aptekar-Cassels2024-10-031-8/+8
|
* CircMgr: Move skew_events method to generic impl.Wesley Aptekar-Cassels2024-10-031-11/+11
|
* CircMgr: Move retire_circ method to generic impl.Wesley Aptekar-Cassels2024-10-031-6/+6
|
* CircMgr: Move reconfigure method to generic impl.Wesley Aptekar-Cassels2024-10-031-67/+67
|
* CircMgr: Move retire_all_circuits method to generic impl.Wesley Aptekar-Cassels2024-10-031-11/+11
|
* CircMgr: Start writing tests.Wesley Aptekar-Cassels2024-10-031-272/+331
|
* CircMgr: Make CircMgr and HsCircPool generic over builder type.Wesley Aptekar-Cassels2024-09-241-98/+263
| | | | | | | | | | 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.
* Fix typosDimitris Apostolou2024-09-031-1/+1
|
* tor-circmgr: make `GuardMgr` mandatorySteven Engler2024-08-121-4/+0
| | | | | | | Functions that took `Option<&GuardMgr>` now take only `&GuardMgr`. Three unit tests were removed that covered behaviour when no guard manager was set.
* tor-circmgr: Remove VanguardMode from Pool.Gabriela Moldovan2024-06-031-3/+7
| | | | | | | | | 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
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* tor-guardmgr: Temporarily reintroduce VanguardConfig.Gabriela Moldovan2024-04-291-1/+1
| | | | | | | | | | | | | | As discussed on #tor-dev, I'm reintroducing `VanguardConfig` for now. The `VanguardConfig` specifies what mode (full/lite/disabled) the `VanguardMgr` should run in. We currently don't have a separate modes for HS clients and HS services. We shouldn't actually *need* a `VanguardConfig` at all, so this is just a (hopefully!) short- or medium-term fix until we sort out #1382 (which might involve making breaking changes to our `reconfigure()` APIs). Closes #1272
* tor-guardmgr: Store whether we're running an onion svc (fmt).Gabriela Moldovan2024-04-111-1/+6
|
* tor-guardmgr: Store whether we're running an onion svc.Gabriela Moldovan2024-04-111-2/+8
| | | | | | The `VanguardMgr` needs to know whether arti is running as an onion service or not, in order to figure out which of the `vanguards_enabled` and `vanguards_hs_service` modes to use.
* tor-circmgr: Call VanguardMgr::launch_background_tasks.Gabriela Moldovan2024-04-051-0/+9
|
* tor-guardmgr: Give VanguardMgr a handle to the runtime (fmt).Gabriela Moldovan2024-04-051-1/+2
|
* tor-guardmgr: Give VanguardMgr a handle to the runtime.Gabriela Moldovan2024-04-051-3/+3
|
* tor-circmgr: Make the path module crate-private.Gabriela Moldovan2024-03-201-1/+1
| | | | | | | | | | | | | | We're not currently using any of the path builders outside of `tor-circmgr`, so let's make them crate-private for now. Care must be taken if/when we decide to make them public again. For instance, the `HsPathBuilder` exposes two path building functions, one that uses vanguards, and one that doesn't. We want to strongly encourage the use of the vanguards-aware version of the function whenever the `vanguards` feature is enabled, without breaking any of its existing non-vanguard uses. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2046#note_3010217
* tor-circmgr: Tell HsPathBuilder what kind of circuit stub is needed.Gabriela Moldovan2024-03-201-0/+4
|
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* tor-circmgr: Fix clippy warning.Gabriela Moldovan2024-03-111-1/+1
|
* tor-circmgr: Create the VanguardMgr in CircMgr::new.Gabriela Moldovan2024-03-111-2/+4
|
* tor-circmgr: Discard all circuits if VanguardMgr says so.Gabriela Moldovan2024-03-111-0/+11
|
* tor-circmgr: Give CircMgr a VanguardMgr.Gabriela Moldovan2024-03-111-0/+6
| | | | Closes #1277
* Fix typos in doc commentsTobias Stoeckmann2024-03-061-1/+1
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* Teach *CircUsage structs about stability.Nick Mathewson2024-02-201-1/+10
| | | | | | | | | | | This lets us check long_lived_ports only when we are constructing a TargetCircUsage, and lets us remember whether or not the circuit we've built is suitable for non-long-lived ports. It also lets us decide whether existing circuits are compatible with new requests. Closes #1100.
* Downgrade some messages to traceIan Jackson2023-11-291-1/+1
| | | | | These messages are very verbose and I doubt anyone will want them, usually, even when debugging.
* arti-client: add exit selection with GeoIP country codeseta2023-09-181-1/+12
| | | | | | | | | | | | | | | | | | | | This threads the country codes work through the rest of the codebase: - `tor-dirmgr` will now enable GeoIP with the embedded database when the `geoip` future is enabled - This can be extended later using the `DirMgrConfig` to allow specifying a custom database; this is not done here, though - `tor-circmgr`'s `SupportedCircUsage` and `TargetCircUsage` fields gain new `country_code` members to allow filtering circuits by country - These are `()` in builds where the `geoip` feature is not enabled -- doing it this way means we don't have to copy and paste huge swathes of code, since we can't use `#[cfg]` in patterns - `ExitPathBuilder` gains (hacked-in) support for choosing a relay with the correct country code - Due to the lack of conjuction, we just copy and paste a small bit, pending further refactoring - `StreamPrefs` now lets you specify a country code, letting embedders make use of the feature
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+2
|
* Merge branch 'report-bugs-v2' into 'main'Nick Mathewson2023-07-071-19/+9
|\ | | | | | | | | Optional tracing support in tor-error for error reporting See merge request tpo/core/arti!1379
| * circmgr: Use event_report!() and similar macrosNick Mathewson2023-07-071-19/+9
| | | | | | | | This simplifies our logging a little, and implements part of
* | Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
|/ | | | Closes #950.