summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr
Commit message (Collapse)AuthorAgeFilesLines
* Bump the minor version of every published crate except for `arti`.Nick Mathewson2025-08-281-28/+28
| | | | | | | | Per policy, we bump the minor version of every tor-*, arti-* crate on each release. We have updated our MSRV, so we're treating this as a breaking change for our non-(arti/tor)-prefixed crates too.
* proto: Add a circuit module shared between client and relay impls.Gabriela Moldovan2025-08-287-8/+13
| | | | | | | This is just code motion (I suggest reviewing with `--color-moved`). This also moves the implementation-agnostic parts from `tor_proto::client::circuit` to a new `tor_proto::circuit` module.
* Merge branch 'circmgr-timeout-estimator-logging' into 'main'Nick Mathewson2025-08-271-0/+2
|\ | | | | | | | | tor-circmgr: Add more logging about timeout estimation. See merge request tpo/core/arti!3152
| * tor-circmgr: Make connection failure log at debug level.Wesley Aptekar-Cassels2025-08-131-1/+1
| |
| * tor-circmgr: Add more logging about timeout estimation.Wesley Aptekar-Cassels2025-08-121-0/+2
| | | | | | | | | | | | We're seeing the logic that resets the timeouts when 18/20 connections fail not triggering when we're expecting it to, this logging may help figure out what's going on there.
* | chanmgr: Add KeyMgr to channel builderDavid Goulet2025-08-202-0/+2
| | | | | | | | | | | | | | This is so a relay can build authenticated channels. Several keys/cert are required for this that are within the key manager. Signed-off-by: David Goulet <[email protected]>
* | proto: Move the `stream` module under `client` (fmt).Gabriela Moldovan2025-08-181-1/+3
| |
* | proto: Move the `stream` module under `client` (breaking).Gabriela Moldovan2025-08-181-3/+3
|/ | | | | | | | | | | | The `stream` module is client-specific, for the most part, so I am moving it under `client`. Later on, we will factor out the parts that can be shared with the relay implementation. Note: this is a breaking change as the deleted `stream` module was `pub`. We could've kept the module and reexported from it the public types from `tor_proto::client::stream`, but I think it's better to have this `client` namespacing, because it makes the separation between the client and relay parts clearer.
* circmgr: Move the body of get_channel_to_guard into its only caller.Nick Mathewson2025-08-071-33/+23
|
* circmgr: Don't count channel negotiation towards circuit built time.Nick Mathewson2025-08-072-53/+77
| | | | | | | | | | This is important, since some circuits require us to negotiate a new channel, and some don't: by adding this variability, we can easily learn a timeout based on pre-existing channels to our guards, but then later time out if it takes a while to open a TLS connection. This is a possible solution to part of #2079, a bug where we "learn" a circuit timeout that is too low for us to satisfy.
* cirmgr: extract code that opens a channel.Nick Mathewson2025-08-071-14/+26
|
* Fix warnings and errors from edition 2024.Nick Mathewson2025-08-072-8/+9
| | | | | | | | | | The two main causes of errors were: - Since some of the lifetime rules have changed, we no longer need to do as many "bind a variable and immediately return it" patterns, and so clippy now warns about them. - We needed to adjust the explicit captures (`use<...>`) in a couple of our RPIT instances.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-0722-86/+91
| | | | | | | | | | | | | | 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.
* Update code for Edition 2024Nick Mathewson2025-08-073-4/+3
| | | | | | | | | | | | | | | | | | 1. Run cargo fix --edition 2. Selectively revert the "if let"->"match" changes. These changes are meant to protect us from the lifetime changes for "if let" bindings in Rust 2024. But we're not actually relying on the old lifetime rules anywhere, and the match syntax here is quite ugly. 3. Automatically revert `$pat:expr_2021` to `$pat:expr`. (We don't actually want to restrict the expression syntax that our macros accept). Done with `git grep -l expr_2021 | xargs perl -i -pe 's/expr_2021/expr/g;'` 4. Run cargo fmt.
* Set MSRV to 1.85.Nick Mathewson2025-08-051-1/+1
|
* Merge branch 'use-cc' into 'main'Nick Mathewson2025-08-051-39/+24
|\ | | | | | | | | Use congestion control when "flowctl-cc" is enabled See merge request tpo/core/arti!3118
| * tor-proto: use congestion control when "flowctl-cc" is enabledSteven Engler2025-08-041-39/+24
| |
* | circmgr: Feature gate multi path tunnel with conflux flagDavid Goulet2025-08-053-6/+15
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | Revert "circmgr: Feature-gate all the onion service tunnel types."Gabriela Moldovan2025-08-052-22/+2
| | | | | | | | This reverts commit 9dca6010d17e2a4b9deee34c9bb66e523a6ac834.
* | circmgr: Feature-gate all the onion service tunnel types.Gabriela Moldovan2025-08-052-2/+22
| | | | | | | | | | We shouldn't be exposing these unless `hs-service`/`hs-client` is enabled.
* | Do not fully-qualify Sync.Gabriela Moldovan2025-08-053-15/+15
| | | | | | | | It's necessary and more verbose (and it's rather uncommon).
* | proto: Fix infinite recursion in ClientTunnel::extend().Gabriela Moldovan2025-08-051-2/+2
| | | | | | | | | | `AbstractTunnel::extend()` was calling itself endlessly because there was no `ClientTunnel::extend()` function to call.
* | conflux: Adjust docs and fix doc links.Gabriela Moldovan2025-08-053-15/+17
| |
* | circmgr: Fix hs-service feature gatingGabriela Moldovan2025-08-051-1/+1
| |
* | proto: abolish path_ref() in favor of all_paths().Gabriela Moldovan2025-08-055-32/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | Until now, we've been using `ClientCirc::path_ref()` to get the *only* path of a circuit. Now that `ClientCirc` is a handle to a tunnel reactor (which may or may not be multi-path), we need to decide for each call site of `path_ref()`, if we actually want *all* paths in the tunnel, or if we expect the tunnel to be single-path and thus want the *only* path in the tunnel. I've added two new APIs to address this: `all_paths()`, for getting all the paths in the tunnel, and `single_path()` for getting the only path in the tunnel, or an error if the tunnel is single-path.
* | circmgr: Feature-gate ServiceOnionServiceIntroTunnel to fix compile errors.Gabriela Moldovan2025-08-051-0/+1
| |
* | circmgr: Feature-gate send_raw_msg.Gabriela Moldovan2025-08-051-0/+1
| |
* | circmgr: Gate tor_proto::handshake usage behind hs-common.Gabriela Moldovan2025-08-051-1/+6
| |
* | proto, circmgr: Fix feature-gating.Gabriela Moldovan2025-08-052-2/+3
| |
* | circmgr: Fully-qualify types in macro.Gabriela Moldovan2025-08-051-4/+2
| |
* | circmgr: Add back cognitive_complexity allows.Gabriela Moldovan2025-08-052-0/+2
| | | | | | | | | | These were removed somewhere along the way (which is now causing the clippy checks to fail).
* | circmgr: Fix unit testsDavid Goulet2025-08-052-15/+15
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | tunnel: Implement start_conversation() for all tunnel typesDavid Goulet2025-08-052-9/+17
| | | | | | | | | | | | | | | | | | | | The BaseTunnel now has a start_conversation() which takes a TargetHop meaning it can be used with a multi path tunnel. The Conversation object has been moved into the tunnel namespace out of the circuit one. Signed-off-by: David Goulet <[email protected]>
* | hs: Use the new Tunnel interface for onion serviceDavid Goulet2025-08-054-12/+90
| |
* | circmgr: Return more type specific tunnelDavid Goulet2025-08-052-8/+12
| | | | | | | | | | | | | | | | | | | | This is the first step towards making the circmgr return high level tunnel types (wrappers around ClientTunnel). Future commits will then modify each subsystems to use those specific types. They are split in order to reduce complexity. Signed-off-by: David Goulet <[email protected]>
* | tunnel: Implement Buildable for ClientTunnelDavid Goulet2025-08-055-84/+88
| | | | | | | | | | | | | | | | | | | | | | | | In order to pull this off, the Arc requirement needs to go away because the Arc<ClientCirc> is now within the ClientTunnel. This commit also has a rename of the CircuitBuilder to TunnelBuilder in order to reflect the change that it now builds a ClientTunnel. There is a slight rename in tor-proto as well just for accuracy. Signed-off-by: David Goulet <[email protected]>
* | proto: Change PendingClientCirc to yield back a ClientTunnelDavid Goulet2025-08-051-3/+3
| | | | | | | | | | | | And rename it in the process to "PendingClientTunnel". Signed-off-by: David Goulet <[email protected]>
* | circmgr: Major rename for the new Tunnel namespaceDavid Goulet2025-08-058-625/+635
| | | | | | | | | | | | | | | | | | | | | | | | The CircMgr will no longer yield circuits but tunnels (src/tunnel.rs). This is a first step to rename most circuit related objects to use "tunnel" instead. Some "circuit" names have been kept for more precise definitions. No behavior changes. Signed-off-by: David Goulet <[email protected]>
* | proto: Add last_hop() to Tunnel interfaceDavid Goulet2025-08-051-0/+14
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | circmgr: New Tunnel object interfaceDavid Goulet2025-08-053-0/+492
| | | | | | | | | | | | | | | | | | | | Introduce the new Tunnel structs that is planned to expose publicly as a replacement to `ClientCirc`. Future commits will make those tunnel objects be used accross the code base up until tor-proto which than handles Circuit directly. Signed-off-by: David Goulet <[email protected]>
* | Bump version of tor-basic-utilsIan Jackson2025-08-051-1/+1
| | | | | | | | This was accidentally omitted from my version bump script.
* | Version bumps for 1.4.6Ian Jackson2025-08-051-24/+24
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made with the following shell script: export CARGO='nailing-cargo -Eu' # Non-functional changes only maint/bump_nodep hashx # Special $CARGO set-version -p arti 1.4.6 # Additional features, no breaking changes, depended on in tree $CARGO set-version -p safelog 0.4.8 # Unconditional bump to 0.33.0 xargs -I P <<END $CARGO set-version -p P 0.33.0 tor-error tor-general-addr tor-geoip tor-rtcompat tor-rtmock tor-async-utils tor-config tor-config-path tor-rpc-connect tor-log-ratelim tor-rpcbase tor-memquota tor-units tor-llcrypto tor-bytes tor-protover tor-checkable tor-cert tor-key-forge tor-hscrypto tor-socksproto tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-relay-selection tor-persist tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy tor-relay-crypto arti-client arti-relay arti-rpcserver arti-ureq arti-rpc-client-core END
* circmgr: Apply incoming cell limits to hsdir connectionsNick Mathewson2025-07-101-1/+12
|
* Bump all the unstable tor- and arti- crates to 0.32.0.Gabriela Moldovan2025-07-071-24/+24
| | | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.32.0 done ```
* Bump the versions of the non-{arti-,tor-} crates.Gabriela Moldovan2025-07-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The non-{arti-,tor-} crates are: ``` ./maint/list_crates | rg -v '^(tor|arti)' oneshot-fused-workaround slotmap-careful test-temp-dir fslock-guard hashx equix caret fs-mistrust safelog retry-error ``` We split them in the following categories: * crates with no changes (no version bumps): None ``` maint/changed_crates -v "arti-v$LAST_VERSION" 2>&1 >/dev/null | grep -i "no change" | grep -v '\(tor\|arti\)-' ``` * crates that only have non-functional changes (bump the patch version): - oneshot-fused-workaround - slotmap-careful - test-temp-dir - fslock-guard - hashx - equix - caret - safelog - retry-error * crates where APIs were broken (bump minor): - fs-mistrust (the implicit once_cell feature was removed) The bumps from this commit were created using this script: ``` PATCH=" oneshot-fused-workaround slotmap-careful test-temp-dir fslock-guard hashx equix caret safelog retry-error " for crate in $PATCH; do cargo set-version --bump patch -p $crate; done MINOR=" fs-mistrust " for crate in $MINOR; do cargo set-version --bump minor -p $crate; done ```
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* 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.
* tor-circmgr: Reduced dependency on `once_cell`hashcatHitman2025-06-141-2/+2
| | | | | | - Replaced `once_cell::sync::Lazy` with `std::sync::LazyLock`. Signed-off-by: hashcatHitman <[email protected]>
* proto: Refactor cc fallback.Nick Mathewson2025-06-101-9/+13
| | | | | The fallback CC algorithm is _always_ fixed-window, and we should only use it when the selected CC algorithm is not supported.
* Move responsibility for choosing extensions into tor-protoNick Mathewson2025-06-101-19/+3
| | | | | | | | | Now tor-circmgr no longer needs to check which Protover capabilities are enabled, or construct a separate CircParameters for each hop. Instead, tor-proto decides whether to use the fallback CC mode, based on whether the target supports FLOWCTRL_CC. Closes #1967.