aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/hspool.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-151-1/+0
|
* Removed unnecessary lintpryty262026-07-151-1/+0
| | | | Removed unnecessary lint
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* circmgr: Port to web-time-compat.Nick Mathewson2026-03-261-3/+3
|
* relay: Add a TLS acceptor in the ChanBuilderDavid Goulet2026-02-091-1/+2
| | | | | | | | | | | | | | | This requires the `TlsKeyAndCert` so be passed on the TLS acceptor settings. We assume that `RelayIdentities` has this information. The ChanBuilder::new() was getting a bit too convoluted and feature gated to instead we introduce new_client() and new_relay() and remove the need for `with_identities()`. Because of this, the ChanMgr::new() now returns a `Result<>`. Related to #1597 Signed-off-by: David Goulet <[email protected]>
* chanmgr: Introduce a ChanMgrConfig structDavid Goulet2026-01-131-1/+1
| | | | | | | | | | | | This struct is used to pass configuration parameters to the ChanMgr when building it. At the moment, it holds the ChannelConfig and RelayIdentities (feature gated) which will be used in subsequent commits. Note that relays do require RelayIdentities to build channels. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Remove KeyMgr from constructorDavid Goulet2026-01-131-1/+0
| | | | | | | We'll rely on a RelayIdentities to pass in the right keys to the ChanMgr instead of the entire KeyMgr. Signed-off-by: David Goulet <[email protected]>
* fix: use wallclock timestamps in all push_timed callsNihal2025-12-171-0/+5
|
* refactor: convert Extend to inherent method, forbid push/extend, fix ↵Nihal2025-12-171-0/+8
| | | | rend_handshake time
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-241-1/+12
| | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-041-2/+2
|
* Merge branch 'the-bell-tolls-for-once_cell' into 'main'wesleyac2025-09-031-7/+1
|\ | | | | | | | | various crates: Updated MSRV TODOs for `once_cell` removal See merge request tpo/core/arti!2953
| * tor-circmgr: Modified MSRV TODOs for `once_cell` removalhashcatHitman2025-08-201-7/+1
| | | | | | | | | | | | | | | | | | - Shortened the TODO added in e9ef7bea96c2860fa81d03e8d8da2605d0661425 in the style of [this maintainer request] for consistency. [this maintainer request]: https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2953#note_3197719 Signed-off-by: hashcatHitman <[email protected]>
* | proto: Add a circuit module shared between client and relay impls.Gabriela Moldovan2025-08-281-1/+1
|/ | | | | | | 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.
* chanmgr: Add KeyMgr to channel builderDavid Goulet2025-08-201-0/+1
| | | | | | | 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]>
* Fix warnings and errors from edition 2024.Nick Mathewson2025-08-071-4/+2
| | | | | | | | | | 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-071-7/+8
| | | | | | | | | | | | | | 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.
* Do not fully-qualify Sync.Gabriela Moldovan2025-08-051-13/+13
| | | | It's necessary and more verbose (and it's rather uncommon).
* conflux: Adjust docs and fix doc links.Gabriela Moldovan2025-08-051-1/+2
|
* proto: abolish path_ref() in favor of all_paths().Gabriela Moldovan2025-08-051-10/+13
| | | | | | | | | | | | | 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: Add back cognitive_complexity allows.Gabriela Moldovan2025-08-051-0/+1
| | | | | These were removed somewhere along the way (which is now causing the clippy checks to fail).
* hs: Use the new Tunnel interface for onion serviceDavid Goulet2025-08-051-9/+87
|
* tunnel: Implement Buildable for ClientTunnelDavid Goulet2025-08-051-16/+16
| | | | | | | | | | | | 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]>
* circmgr: Major rename for the new Tunnel namespaceDavid Goulet2025-08-051-29/+28
| | | | | | | | | | | | 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]>
* circmgr: Apply incoming cell limits to hsdir connectionsNick Mathewson2025-07-101-1/+12
|
* *: suppress cognitive_complexity warnings from nightlyNick Mathewson2025-05-291-0/+1
| | | | | | | | | | | | | 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.
* hspool: Explain _why_ ClientRend is Guarded.Nick Mathewson2025-05-221-4/+12
| | | | (text from Gabi)
* hspool: ClientRend first should be GuardedNick Mathewson2025-05-221-4/+5
| | | | On !3007, @gabi-250 says that it was a mistake to have it be Naive.
* Apply 1 suggestion(s) to 1 file(s)Nick Mathewson2025-05-221-1/+1
| | | Co-authored-by: gabi-250 <[email protected]>
* circmgr: Apply last-hop-in-stem usage when retrieving a stem circ.Nick Mathewson2025-05-201-20/+85
| | | | Closes #1911.
* circmgr: when building client rend stems, make sure last hop has new_rend usage.Nick Mathewson2025-05-201-12/+29
|
* guardmgr, circmgr: Make vanguard selection take a RelaySelector.Nick Mathewson2025-05-201-6/+8
| | | | | | 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-2/+2
| | | | | | 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: Change get_or_launch_stem to take a HsCircKindNick Mathewson2025-05-201-13/+22
| | | | | | We're going to be looking at this a little more closely in order to decide whether the last hop of a stem can be used as a rendezvous point.
* circmgr: rename ensure_circuit_{compatible_with => can_extend_to}_targetNick Mathewson2025-05-201-6/+3
| | | | | There are two other functions called "compatible_with_target" that check a different property, so this one was confusing.
* tor-proto: Future-proof some comments about path_ref() errors.Gabriela Moldovan2025-05-151-2/+2
| | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2996#note_3199590
* tor-proto: Return Error::Protocol if ClientCirc accessors return an error.Gabriela Moldovan2025-05-151-32/+40
| | | | | | | | | | The `ClientCirc` accessors will only return an error if the underlying circuit is closed, so it doesn't make sense to map these errors to `Bug`. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2996#note_3199072 and https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2996#note_3199073
* tor-proto: Update the TunnelMutableState when a circuit is removed.Gabriela Moldovan2025-05-151-7/+25
| | | | | | | | This is messy, because `ClientCirc::{path_ref, n_hops, ..}` become fallible (we can't unwrap the result, because when a circuit is closed, its state gets removed from the `TunnelSharedState`, but its `ClientCirc` handle continues to exist, so any attempt to retrieve the state will result in an `Err`).
* circmgr: Rename AbstractCirc::{extend_ntor => extend}Nick Mathewson2025-04-281-1/+1
| | | | | We don't want to be thinking about ntor vs ntor3 in circmgr.
* circ: Remove CircParameters reference in call stackDavid Goulet2025-04-231-1/+1
| | | | | | | | | | | This avoids cloning the object and instead allows us to have a CircParameters per hop on the circuit path. This will come handy with congestion control where each hop might have different congestion control parameters. Part of #1817 Signed-off-by: David Goulet <[email protected]>
* tor-circmgr: Added TODO about replacing OnceCellhashcatHitman2025-04-171-0/+8
| | | | | - [`once_cell::sync::OnceCell`] should be replaced by [`std::sync::OnceLock`] once the blocking methods are stabilized and within our MSRV.
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-2/+2
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* 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