summaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr/src/mgr
Commit message (Collapse)AuthorAgeFilesLines
* 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
| |
* | tor-chanmgr: removed use of `with_channels` within `request_channel`Steven Engler2024-10-151-61/+66
| | | | | | | | Best reviewed with the '-w' flag to hide whitespace changes.
* | tor-chanmgr: refactored `AbstractChanMgr::choose_action`Steven Engler2024-10-151-2/+118
|/ | | | | | | | This moves most of the channel map logic from `AbstractChanMgr::choose_action` to `MgrState::request_channel`. This is working towards being able to remove `MgrState::with_channels{,_and_params}`.
* memquota: Change ToplevelAccount to be an alias for Arc<MemoryQuotaTracker>Ian Jackson2024-10-151-1/+2
| | | | Fixes a TODO.
* tor-chanmgr: note API causes deadlocks under some conditionsSteven Engler2024-10-091-0/+12
|
* tor-chanmgr: Make a memquota::ChannelAcocunt per channelIan Jackson2024-10-032-1/+6
| | | | | This delivers a fresh account per channel to the places where channels are actually made, but doesn't pass them to tor-proto yet.
* memquota: Add a toplevel account in tor-chanmgrIan Jackson2024-10-031-0/+2
| | | | | | | | | Plumb through a top-level account. This doesn't have any channel-specific, circuit-specific or stream-specific accounts yet. tor-circmgr's and tor-hsclient's *tests* need fake account. In arti-relay, use a dummy account for now.
* tor-chanmgr: minor doc improvementsSteven Engler2024-10-011-3/+3
|
* tor-chanmgr: add unit testsSteven Engler2024-10-011-0/+416
|
* tor-chanmgr: change `choose_best_channel` to take `IntoIterator`Steven Engler2024-10-011-1/+3
|
* tor-chanmgr: don't allow pending channels with no relay idsSteven Engler2024-10-011-1/+7
|
* tor-chanmgr: move channel selection logic to a new moduleSteven Engler2024-10-011-0/+168
|
* tor-chanmgr: support multiple channels for a relay IDSteven Engler2024-09-301-22/+49
|
* tor-chanmgr: add experimental `ChanMgr::handle_incoming`Steven Engler2024-09-112-0/+21
| | | | | | | | | The channel manager in the future will need to be able to receive incoming streams. The type of the stream depends on an associated type within `ChannelFactory`, so this commit exposes this associated type through several other types, eventually to the `ChanMgr`. The new methods are behind the experimental "relay" feature flag.
* tor-netdir: Allow access to the `ConsensusBuilder` when building test netdirs.Gabriela Moldovan2024-09-091-2/+2
| | | | | This allows us to set SRVs for example (needed because by default, the test `NetDir` is built from a consensus that doesn't contain any SRVs).
* proto: Make Channel explicitly Arc<.>Nick Mathewson2024-05-162-9/+11
| | | | | | | | | | | | | | | | Previously, Channel was a type that you could Clone that implicitly its state. Now, Channel always appears as an Arc<Channel>. This change has several benefits: * It makes the relationship between Channel struct and the underlying channel more clear. * It enables Channel to participate in the RPC system, where everything has to be an Arc<.> * It enables us to have a Weak<Channel>, if we ever want to. * It will let us move various members out of ChannelDetails. We did this change a while ago with ClientCirc.
* Run maint/add_warning.Nick Mathewson2024-03-132-0/+2
|
* ChannelState::ready_to_expire: return true when rem time is zeroJim Newsome2023-12-131-0/+5
| | | | | | | | | | | This fixes a race condition that would normally be fairly benign - it would result in scheduling to check for expired channels again immediately, and assuming non-zero time passes would then remove the channel. In Shadow's default time model though, zero time passes in this case, so we just keep scheduling to check again immediately forever; i.e. deadlock.
* ChannelState::ready_to_expire: refactor using let-elseJim Newsome2023-12-131-18/+14
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-232-0/+2
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-102-0/+2
|
* Add exceptions for some cases of diverging_sub_expressionNick Mathewson2023-07-101-0/+2
| | | | | | | | See here for documentation on the lint: https://rust-lang.github.io/rust-clippy/master/index.html#/diverging_sub_expression The issue here, from what I can tell, is that the lint triggers whenever you use a diverging expression as a function body within an