aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src
Commit message (Collapse)AuthorAgeFilesLines
...
* 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 another doc link.Nick Mathewson2025-11-131-1/+1
|
* Fix compilation without all-features.Nick Mathewson2025-11-121-7/+8
|
* circmgr: report errors from update_long_lived_tunnel_last_usedNick Mathewson2025-11-121-21/+54
| | | | | (The only error possible is an internal error from calling it with a non-long-lived tunnel.)
* circmgr: In expiration task, try again if we are not yet ready to expire.Nick Mathewson2025-11-121-21/+31
|
* circmgr: Add a timeout setting for long-lived circuits.Nick Mathewson2025-11-122-1/+20
|
* circmgr: Implement expiration for long-lived tunnels.Nick Mathewson2025-11-124-22/+228
| | | | | | | | | | | | | | | | | This code uses the algorithm of prop368: When a tunnel is sufficiently isolated, we want to expire it after it has been disused for a certain amount of time. The implementation is a little tricky, since we need to call an async function on ClientTunnel to look up the disused_since() check. We don't want to call async functions while holding locks, so we need to drop the TunnelList lock before we do the disused_since() calls, and the grab it again. As part of this change, I've had made expiration functions return the earliest time at which any tunnel might expire. We can use this in the future to spawn fewer expiration tasks, and scan the list of tunnels less often.
* circmgr: Add a notion of long-lived tunnels.Nick Mathewson2025-11-122-8/+77
|
* circmgr: Refactor should_expire()Nick Mathewson2025-11-121-24/+40
| | | | | Instead of a series of cutoffs, take an object with a set of lifetimes.
* circmgr: make expiration functions asyncNick Mathewson2025-11-122-31/+29
| | | | We'll need them to be async so they can call disused_since() on tunnels.
* circmgr: rename expire_tunnel to consider_expiring_tunnelNick Mathewson2025-11-121-3/+7
|
* Add a notion of isolation strong enough to enable long-lived circuits.Nick Mathewson2025-11-121-0/+38
| | | | Part of prop368.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-0614-15/+15
| | | | Run maint/add_warning
* all: run cargo fmtSteven Engler2025-11-043-3/+3
|
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-044-5/+5
|
* tor-linkspec: Change HasAddrs::addrs to return an IteratorIan Jackson2025-10-061-3/+4
| | | | | | | | This will let us model the actual structure of routerstatus entries in netdocs more closely. They don't have the addresses in a single list. When this code was written this would have been much more awkward, but now we have RPITIT.
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* opentelemetry: Add some instrument macros.Wesley Aptekar-Cassels2025-09-241-0/+2
| | | | | I've added these in places that are useful for the debugging that I've been doing.
* Merge branch 'expire-halfstream-cbt' into 'main'gabi-2502025-09-242-12/+38
|\ | | | | | | | | | | | | proto: Remove half-streams when they expire. Closes #264 See merge request tpo/core/arti!3267
| * proto: Use the circuit build timeout instead of the abandon timeout.Gabriela Moldovan2025-09-221-2/+2
| | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3267#note_3259820
| * circmgr: Pass the timeout estimator to circuit constructor (fmt).Gabriela Moldovan2025-09-161-8/+13
| |
| * circmgr: Pass the timeout estimator to circuit constructor.Gabriela Moldovan2025-09-161-7/+16
| | | | | | | | | | This enables us to read the CBT estimates from the circuit reactor (we need these to compute the half-stream timeouts for #264).
| * circmgr: Implement TimeoutEstimator for Estimator.Gabriela Moldovan2025-09-161-0/+12
| | | | | | | | | | This will enable us to pass the timeout estimator to the circuit reactor in tor-proto.
* | circmgr: Replace BoundedVecDeque with a much smaller wrapperNick Mathewson2025-09-171-10/+79
| | | | | | | | Closes #2174. See that ticket for rationale.
* | tor-proto: use `CellCount` in `FlowCtrlParameters`Steven Engler2025-09-161-4/+4
|/
* Merge branch 'xon-xoff-checker' into 'main'David Goulet2025-09-151-1/+9
|\ | | | | | | | | tor-proto,tor-netdir: add flow control consensus parameters See merge request tpo/core/arti!3249
| * tor-proto: add `FlowCtrlParameters` to `CircParameters` and `HopSettings`Steven Engler2025-09-111-1/+9
| |
* | Move `FallbackDir` into `tor-dircommon`Clara Engler2025-09-113-3/+3
|/
* 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]>
* | tor-circmgr: Removed dependency on `static_assertions`hashcatHitman2025-09-011-3/+2
| | | | | | | | | | | | | | | | Replaced use of [`static_assertions::const_assert`] with the newly available "assert in const" pattern. This completely removes the dependency on `static_assertions` for `tor-circmgr`. Signed-off-by: hashcatHitman <[email protected]>
* | 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-0721-85/+90
| | | | | | | | | | | | | | 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.
* 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-052-5/+13
| | | | | | | | 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).