summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr
Commit message (Collapse)AuthorAgeFilesLines
* Bump all the unstable tor- and arti- crates to 0.40.0.Gabriela Moldovan2026-03-021-26/+26
| | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.40.0 done
* Bump the versions of the non-{arti-,tor-} cratesGabriela Moldovan2026-03-021-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 futures-copy ``` Because this release bumps the MSRV, I am bumping the minor version of all of them. MINOR=" oneshot-fused-workaround slotmap-careful test-temp-dir fslock-guard hashx equix caret fs-mistrust safelog retry-error futures-copy " for crate in $MINOR; do cargo set-version --bump minor -p $crate; done ```
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* Bump MSRV from 1.86 to 1.89Gabriela Moldovan2026-02-161-1/+1
| | | | | | | As agreed at our last team meeting. See https://gitlab.torproject.org/tpo/core/arti/#minimum-supported-rust-version
* relay: Add a TLS acceptor in the ChanBuilderDavid Goulet2026-02-092-8/+12
| | | | | | | | | | | | | | | 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]>
* release: Bump `arti-*` and `tor-*` crates to 0.39.0Wesley Aptekar-Cassels2026-02-021-26/+26
| | | | | | | | | | Done via: ``` for crate in $(./maint/list-crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.39.0 done ```
* circmgr: Make test helper non-async (fmt)Gabriela Moldovan2026-01-281-5/+1
|
* circmgr: Make test helper non-asyncGabriela Moldovan2026-01-281-9/+9
|
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* test: Remove unused importDavid Goulet2026-01-131-1/+0
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Introduce a ChanMgrConfig structDavid Goulet2026-01-132-2/+2
| | | | | | | | | | | | 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-132-2/+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]>
* cargo: Bump all non arti/tor cratesClara Engler2026-01-121-1/+1
| | | | | | | | | | | | | | | This only includes retry-error which had a few functional additions in December, thereby rasing the minor version as new features were added to the public API. Done using the following: * Find all non arti, non tor crates. * `ls -1 crates/ | grep -v "^tor-\|^arti"` * Exclude the ones without changes. * `maint/changed_crates -v "arti-v$LAST_VERSION" 2>&1 >/dev/null | grep -i "no change"` * Look into each with changes. * In this case only retry-error. * Bump the minor because it had non-trivial changes.
* cargo: Update `arti-*` and `tor-*` to `0.38.0`Clara Engler2026-01-121-26/+26
| | | | | | | | | Done using the following: ```bash for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.38.0 done ```
* fix: preserve timestamps when flattening RetryErrorsNihal2025-12-171-7/+1
|
* fix: use wallclock timestamps in all push_timed callsNihal2025-12-172-22/+27
|
* fix: semver labels and extend() with push_timed loopNihal2025-12-171-3/+6
|
* refactor: convert Extend to inherent method, forbid push/extend, fix ↵Nihal2025-12-172-0/+10
| | | | rend_handshake time
* refactor: clean codeNihal2025-12-171-4/+4
|
* feat(retry-error): add timestamps to retry errorsNihal2025-12-171-7/+26
|
* Demonstration: convert tor-circmgr to use derive_deftly(TorConfig)Nick Mathewson2025-12-091-98/+32
| | | | | (We could tighten this up even more by inlining some of the default values.)
* Remove unnecessary `doc(cfg(...))` attributesNeel Chauhan2025-12-043-5/+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]>
* Merge branch 'deftly-1.6.0' into 'main'Ian Jackson2025-12-041-1/+1
|\ | | | | | | | | Update to derive-deftly 1.6.0 See merge request tpo/core/arti!3525
| * Pin our derive-deftly version to ~1.6.0 everywhereIan Jackson2025-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | We are supposed to pin whenever we enable the `beta` cargo feature, see https://docs.rs/derive-deftly/latest/derive_deftly/doc_changelog/index.html#beta-features Empirically, we somehow failed to do that in tor-circmgr. In practice not pinning makes little difference since cargo wants to pick the same version everywhere, but we should be correct. But it is more maintainable to pin everywhere.
| * Update to derive-deftly 1.6.0Ian Jackson2025-12-031-1/+1
| | | | | | | | | | | | | | | | | | This has: * Fixes to hygiene spans from the new modules feature, needed for my WIP netdoc encoder derive. * A substantially richer `${error }` construct.
* | tor-circmgr: small comment fixSteven Engler2025-12-031-1/+1
| |
* | tor-circmgr: reduce level of info reactor tracing msgSteven Engler2025-12-031-1/+1
|/ | | | | Since "info" is the default level, we don't want to log by default each time a circuit reactor is created.
* Remove semver.md files post-releaseGabriela Moldovan2025-12-021-4/+0
|
* Bump all the unstable tor- and arti- crates to 0.37.0.Gabriela Moldovan2025-12-021-26/+26
| | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.37.0 done
* circmgr: Add missing docs for RestrictionFailedGabriela Moldovan2025-12-011-0/+1
|
* circmgr: allow unstable_name_collisions lint for exactly_one()Gabriela Moldovan2025-12-011-0/+4
| | | | This silences a new nightly warning.
* tor-circmgr: simplify `CircMgrConfig`Steven Engler2025-11-262-9/+3
| | | | | | | Now that `vanguard_config()` is no longer conditional, we can handle `vanguard_config` just like other accessors. This is a breaking change, but I think we may as well make this change while we've already made another breaking change in the previous commit.
* tor-circmgr,arti-client: `CircMgrConfig::vanguard_config` is always builtSteven Engler2025-11-262-4/+3
|
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-2410-5/+72
| | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* tor-circmgr: fix incorrect match on `HsOnly`Steven Engler2025-11-191-0/+1
| | | | | | | | | | | | | | | | | | | Rust was treating this as a wildcard match if the `hs-common` feature wasn't enabled. This shouldn't have caused any bugs since the other match arms were already exhaustive, but this could have lead to a bug if new enum variants were added to `SupportedTunnelUsage`. ```text warning: variable `HsOnly` should have a snake case name --> crates/tor-circmgr/src/usage.rs:600:13 | 600 | HsOnly => { | ^^^^^^ help: convert the identifier to snake case: `hs_only` | = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default warning: `tor-circmgr` (lib) generated 1 warning ```
* RelayFlags: Use RelayFlag enum variant names everywhereIan Jackson2025-11-182-7/+7
| | | | | | | 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-182-9/+9
| | | | | | | | | | | | | | 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-182-2/+3
| | | | 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 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.