summaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-244-1/+11
| | | | | 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-116-11/+23
|\ | | | | | | | | 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-056-11/+23
| | | | | | | | | | 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-0610-10/+10
|/ | | | Run maint/add_warning
* all: run cargo fmtSteven Engler2025-11-041-1/+1
|
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-042-2/+2
|
* Use random_hostname() to pick an (E)SNINeel Chauhan2025-10-201-2/+4
| | | | | | Closes #2210. Edited-by: Nick Mathewson <[email protected]>
* proto: Propagate PaddingCtrl into ChannelSender.Nick Mathewson2025-10-011-7/+37
| | | | We'll need it to tell the channel padder when padding is queued.
* 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-244-2/+15
| | | | | I've added these in places that are useful for the debugging that I've been doing.
* 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]>
* chan: Rename channel launch to launch_clientDavid Goulet2025-08-201-1/+1
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Add KeyMgr to channel builderDavid Goulet2025-08-202-4/+14
| | | | | | | 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]>
* clippy: fix `clippy::duplicated_attributes` warningsSteven Engler2025-08-111-1/+1
| | | | | | | | | | ```text warning: duplicated attribute --> crates/tor-hsservice/src/timeout_track.rs:630:14 | 630 | #![allow(clippy::needless_pass_by_value)] // TODO hoist into standard lint block | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ```
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-0711-38/+39
| | | | | | | | | | | | | | 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-071-1/+1
| | | | | | | | | | | | | | | | | | 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.
* 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
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* 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-rtmock: allow-Decorate every use of MockSleepProviderIan Jackson2025-03-061-1/+5
| | | | | | | MockSleepProvider and MockSleepRuntime have been declared deprecated by the docs for some time. We're about to mark them `#[deprecated]`. This commit has been split out for clarity of review.
* 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-154-0/+21
| | | | | Needed for the chanmgr to be able to update existing channels with new KIST settings read from the consensus.
* tor-rtcompat: Big invasive change adding StreamOps bound everywhere.Gabriela Moldovan2025-01-151-1/+2
| | | | | | This is unfortunately necessary, because after the channel handshake, we need to give the channel reactor a `StreamOps` handle to the underlying stream.
* Merge branch 'mod-module-files' into 'main'Nick Mathewson2025-01-071-0/+1
|\ | | | | | | | | clippy: deny `mod_module_files` See merge request tpo/core/arti!2689
| * clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | | | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* | fix: fix typosDimitris Apostolou2025-01-061-1/+1
|/
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* tor-chanmgr: remove immediately awaited async block expressionSteven Engler2024-11-271-23/+15
| | | | This shouldn't be needed anymore now that we use a `Defer`.
* tor-chanmgr: use `Defer` in `AbstractChanMgr` to handle cancellationsSteven Engler2024-11-271-18/+23
|
* tor-chanmgr: add `util::defer` moduleSteven Engler2024-11-273-0/+79
| | | | | This contains the `Defer` type, which can be used to defer a closure until the `Defer` is dropped.
* tor-chanmgr: change `RequestCancelled` retry from `Never` to `Immediate`Steven Engler2024-11-211-1/+1
| | | | | | | If the channel request was cancelled, we should be able to retry immediately. Additionally, the `kind()` of `RequestCancelled` is `TransientFailure`, and I don't think it make sense for a transient error to return a `retry_time()` of `Never`.
* tor-chanmgr: fix reconfigure bug when given `CheckAllOrNothing`Steven Engler2024-11-121-2/+9
| | | | We shouldn't actually reconfigure anything if given `CheckAllOrNothing`.
* tor-chanmgr: remove panics in debug buildsSteven Engler2024-11-112-7/+1
| | | | | | 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-242-9/+10
| | | | `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-242-47/+92
| | | | | | | | | | 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-212-56/+34
| | | | | | | | 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: remove `handle_build_outcome`Steven Engler2024-10-151-28/+19
| |
* | tor-chanmgr: `PendingChannelHandle` removes the channel when droppedSteven Engler2024-10-152-27/+56
| |
* | tor-chanmgr: added `PendingChannelHandle`Steven Engler2024-10-152-36/+64
| | | | | | | | | | 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-152-78/+76
| | | | | | | | | | | | 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-152-5/+3
| |