aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr/src/mgr
Commit message (Collapse)AuthorAgeFilesLines
* multiple crates: Fix clippy warningshjrgrn2026-07-101-3/+3
|
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-093-0/+3
| | | | | | | | | | | | 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.
* tor-chanmgr: add support for a `CreateRequestHandler`Steven Engler2026-04-081-0/+3
|
* chanmgr: Add a comment/TODO about channel expiryDavid Goulet2026-03-181-0/+16
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Support reconfigure of unauthenticated channelsDavid Goulet2026-03-181-5/+8
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Use the unauth_channels listDavid Goulet2026-03-181-7/+12
| | | | | | Put channel without relay identities in the unauth_channels list. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Add a list of unauthenticated channelsDavid Goulet2026-03-181-0/+13
| | | | | | | | | | | Needed to handle client/bridge -> relay channels which are not authenticated meaning they don't have a RelayIds so they can't be put in the ListByRelayIds<>. Feature gate it to "relay" as a client will never have those kind of channels. Signed-off-by: David Goulet <[email protected]>
* rtmock, chanmgr: Allow use of deprecated try_next() in testsGabriela Moldovan2026-03-031-0/+1
| | | | | | | | futures 0.3.32 has deprecated UnboundedReceiver::try_next() in favor of UnboundedReceiver::try_recv(), but try_recv() was only introduced in 0.3.32, so using it would cause our minimal versions checks to fail (rightfully so, because our code wouldn't build with futures 0.3.x for x < 32).
* tor-proto: change channel selection fns to take `HasChanMethod`Steven Engler2026-02-251-8/+9
|
* chanmgr: Responder relay channel now use the builder my_addrsDavid Goulet2026-02-242-5/+3
| | | | | | No need to pass from the arti relay binary our addresses when handling an incoming channel, use the one in the channel builder that an initiator channel uses.
* chanmgr: Add a set_relay_identities() to update the RelayIdentitiesDavid Goulet2026-02-241-1/+1
| | | | | | | | | | The arti-relay crate rotates the keys at regular interval which we need to give to the ChanMgr to update its builder. This function boldly replace the default factory with the new identities including the TLS acceptor can pick up the new key. Signed-off-by: David Goulet <[email protected]>
* Merge branch 'channel-canonical' into 'main'David Goulet2026-02-122-3/+33
|\ | | | | | | | | Implement channel canonicity See merge request tpo/core/arti!3668
| * chan: Use Canonicity when choosing a channelDavid Goulet2026-02-122-3/+33
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | tor-chanmgr: update comment in `open_channel_is_allowed()`Steven Engler2026-02-111-2/+10
| |
* | tor-chanmgr: channel selection functions take a `HasAddrs`Steven Engler2026-02-111-18/+28
| | | | | | | | | | | | | | We will want our channel selection functions (`open_channel_is_allowed`, `pending_channel_maybe_allowed`, and `choose_best_channel`) to inspect the requested target addresses in the future (see their TODOs), so these functions need to take a `HasAddrs` to get those addresses.
* | tor-chanmgr: add `HasAddrs` bound to `AbstractChannelFactory::BuildSpec`Steven Engler2026-02-111-3/+3
|/ | | | | This will be needed later so that our channel selection functions can take a `HasAddrs`.
* chanmgr: Gate relay only functionDavid Goulet2026-02-091-0/+1
| | | | | | | | | Also, allow the `ChanMgr::runtime` to be unused as client don't use it yet but might one day. Simpler this way than feature gating it for relay only. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Add inbound open channel to our listDavid Goulet2026-02-091-5/+22
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Make a padding test function non-asyncGabriela Moldovan2026-01-271-3/+2
|
* relay: Pass advertised addresses to the channel handlerDavid Goulet2026-01-222-3/+5
| | | | | | | | | | | We need the advertised addresses for the NETINFO cell when opening a relay channel. Keep them in the TorRelay object so we can pass them to the ChanMgr channel handler. This will also help with config reload where only the local values in TorRelay will need to be updated. 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]>
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-241-1/+2
| | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* Merge branch 'relay-bin-4' into 'main'opara2025-11-112-2/+6
|\ | | | | | | | | arti-relay: Add OR port listener task See merge request tpo/core/arti!3396
| * tor-chanmgr: wrap the peer address in `Sensitive`Steven Engler2025-11-052-2/+6
| | | | | | | | | | For incoming connections, wrap the peer address in `Sensitive` as it could be a client.
* | Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-063-3/+3
|/ | | | Run maint/add_warning
* proto: Propagate PaddingCtrl into ChannelSender.Nick Mathewson2025-10-011-7/+37
| | | | We'll need it to tell the channel padder when padding is queued.
* proto: Add ChannelType enumDavid Goulet2025-08-201-1/+1
| | | | | | | | | | | | | | | | The ChannelType indicates the type of channel in order to dictate which message is allowed on it. The value use the Initiator and Responder terminology from tor-spec documents. At this commit, we only have client channel meaning the "ClientInitiator" type. In future commits, the channel type will be used by the channel reactor to restrict which message is allowed or not. Part of #1597 Signed-off-by: David Goulet <[email protected]>
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-073-10/+10
| | | | | | | | | | | | | | 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.
* Add a missing backtick.Nick Mathewson2025-07-091-1/+1
|
* Typo fixes (automatic and hand-verified)Nick Mathewson2025-07-091-1/+1
| | | | Made with https://crates.io/crates/typos-cli
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* tor-chanmgr: Update NetParamsExtract docs (fmt).Gabriela Moldovan2025-01-151-1/+2
|
* tor-chanmgr: Update NetParamsExtract docs.Gabriela Moldovan2025-01-151-4/+1
| | | | | This also removes the TODO that was addressed by adding the kist params to this type.
* tor-chanmgr: Move KIST and padding params to ChannelParams.Gabriela Moldovan2025-01-151-11/+22
|
* tor-proto: Remove dependency on tor-netdir.Gabriela Moldovan2025-01-151-5/+41
| | | | | | | | This moves the `NetParameters -> KistParams` conversion to `tor-chanmgr`. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2706#note_3147557
* tor-chanmgr: Add a TODO about a possible renaming.Gabriela Moldovan2025-01-151-0/+3
|
* tor-changmgr: Update the KIST params whenever the consensus/config changes.Gabriela Moldovan2025-01-151-8/+34
| | | | Closes #1730, #1728
* tor-chanmgr: Add reparameterize_kist to AbstractChannel trait.Gabriela Moldovan2025-01-152-0/+7
| | | | | Needed for the chanmgr to be able to update existing channels with new KIST settings read from the consensus.
* fix: fix typosDimitris Apostolou2025-01-061-1/+1
|
* tor-chanmgr: remove panics in debug buildsSteven Engler2024-11-111-3/+0
| | | | | | These were supposed to fail loudly in debug builds by panicking, but panics are mostly useless for debugging in async applications that use a runtime which catches panics. So we'll just log the error instead.
* tor-chanmgr: rename `replace_pending_channel` to ↵Steven Engler2024-10-241-4/+5
| | | | `upgrade_pending_channel_to_open`
* tor-chanmgr: `remove_pending` now takes a `PendingChannelHandle`Steven Engler2024-10-241-18/+8
|
* tor-chanmgr: improve cleanup procedure of pending channelsSteven Engler2024-10-241-17/+44
| | | | | | | | | | An attempt to make sure that there are no code paths which forget to remove a pending channel from the channel map. This also adds error-level log messages and panics during debug builds if a `PendingChannelHandle` is dropped without properly passing it to `MgrState::remove_pending_channel` or `MgrState::replace_pending_channel`.
* Revert "tor-chanmgr: `PendingChannelHandle` removes the channel when dropped"Steven Engler2024-10-211-54/+21
| | | | | | | | This reverts commit f85bc3cf849109aaa2c4da9fc8c06e7173a0543f. There were some small conflcits in `AbstractChanMgr::get_or_launch_internal`, so this wasn't a clean revert.
* Merge branch 'chanmgr-select-docs' into 'main'David Goulet2024-10-171-0/+25
|\ | | | | | | | | tor-chanmgr: update comments about selecting pending channels See merge request tpo/core/arti!2544
| * tor-chanmgr: update comments about selecting pending channelsSteven Engler2024-10-161-0/+25
| |
* | tor-chanmgr: `PendingChannelHandle` removes the channel when droppedSteven Engler2024-10-151-21/+54
| |
* | tor-chanmgr: added `PendingChannelHandle`Steven Engler2024-10-151-18/+52
| | | | | | | | | | This handle contains all of the details required to remove or replace a pending channel entry from the channel map.
* | tor-chanmgr: refactor so we don't need `with_channels{,_and_params}`Steven Engler2024-10-151-25/+71
| | | | | | | | | | | | These methods on `MgrState` acquire a lock, and it's easy for calling code to also try to acquire the same lock within the closure, causing a deadlock. It's better to not expose these methods.
* | tor-chanmgr: fix some incorrect commentsSteven Engler2024-10-151-1/+1
| |