aboutsummaryrefslogtreecommitdiff
path: root/crates/arti-relay/src
Commit message (Collapse)AuthorAgeFilesLines
* Stub out opentelemetry config when feature is disabled.Wesley Aptekar-Cassels9 days1-2/+5
|
* Fix many review comments.Wesley Aptekar-Cassels9 days1-2/+2
| | | | Mostly relating to typos and dependencies.
* Fix clippy lints.Wesley Aptekar-Cassels2026-08-111-2/+0
|
* Fix cyclic dependency issues.Wesley Aptekar-Cassels2026-08-101-4/+5
|
* tor-config-shared: Stop using Option<Duration>.Wesley Aptekar-Cassels2026-08-101-2/+6
|
* Add new tor-conig-shared crate.Wesley Aptekar-Cassels2026-08-101-4/+6
| | | | | This contains configuration types that are shared between arti and arti-rely.
* relay: Keep desc publisher idle until encoding is implementedDavid Goulet2026-07-281-1/+2
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Make build_descriptor() return Arc<str>David Goulet2026-07-281-9/+2
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Add needeed changes to dirmirror todo commentDavid Goulet2026-07-281-1/+2
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Get rid of our custom relay desc uploaderDavid Goulet2026-07-281-51/+20
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Use mpsc_channel_no_memquota for tasks' queueDavid Goulet2026-07-282-4/+5
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Move authorities ownership to TorRelayDavid Goulet2026-07-282-20/+12
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Adjust the try_send() error messageDavid Goulet2026-07-282-3/+6
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Use warn_report on crypto task command failureDavid Goulet2026-07-281-1/+2
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Use DirectHttpUploader for the desc taskDavid Goulet2026-07-281-31/+12
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Return bug error if dir authority has no address(es)David Goulet2026-07-281-3/+4
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Make compute_targets() not return an OptionDavid Goulet2026-07-281-10/+10
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Remove runtime from desc task structDavid Goulet2026-07-282-13/+6
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Add crypto task command channelDavid Goulet2026-07-283-12/+95
| | | | | | | | | Give a tx to the descriptor task so it can request the keys when building a new descriptor. Implement the crypto task handling of that command channel. Signed-off-by: David Goulet <[email protected]>
* relay: Pass the desc task TX to the crypto taskDavid Goulet2026-07-284-6/+28
| | | | | | | | The crypto task can now signal the descriptor task that the keys have changed related to the relay descriptor (signing key and ntor keys) so a new descriptor can be built and uploaded. Signed-off-by: David Goulet <[email protected]>
* relay: Implement descriptor upload in desc taskDavid Goulet2026-07-281-10/+29
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Pass the dirauth list to the desc taskDavid Goulet2026-07-283-11/+53
| | | | | | | Config reload is not fully supported just yet but when that comes, we'll need to make a task command for new targets. Signed-off-by: David Goulet <[email protected]>
* relay: Initial skeleton of the descriptor upload taskDavid Goulet2026-07-283-0/+277
| | | | | | | | | This is the basics, with many TODO(relay), for a relay descriptor upload task which uses tor-dirpublish::Publisher. Future commits will implement the several todo!(). Signed-off-by: David Goulet <[email protected]>
* tor-proto: remove `CircNetParameters::extend_by_ed25519_id`Steven Engler2026-07-271-4/+1
| | | | | We never used this, it was just needed because we used to convert to a `CircParameters` which required this.
* arti-relay: Add back allow(clippy::unused_async)Gabriela Moldovan2026-07-272-0/+2
| | | | | | The clippy CI job that uses RECENT_RUST_IMAGE fails without the `allow` (RECENT_RUST_IMAGE uses Rust 1.96, where the `unused_async` false-positive still appears to trigger).
* arti-relay: Remove unused_async clippy escape hatchGabriela Moldovan2026-07-272-2/+0
| | | | | | | | | | | | | This was needed to work around two `unused_async` false-positives that would trigger on older Rust versions. This was fixed in https://github.com/rust-lang/rust-clippy/issues/15305 and released in 1.90, according to the [changelog]. Since these no longer trigger on 1.97.1, they are now causing the `expect(clippy::unused_async)` to fail. Removing the `expect`s seems like the most sensible fix. [changelog]: https://github.com/rust-lang/rust-clippy/issues/15305
* arti-relay: Turn a TODO(relay-tuning) into TODO DIRMIRRORGabriela Moldovan2026-07-221-1/+1
| | | | | Context: https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4222#note_3437336
* arti-relay: Add a TODO from @oparaGabriela Moldovan2026-07-221-0/+5
|
* arti-relay: s/stream/tor_stream for clarityGabriela Moldovan2026-07-221-5/+5
|
* arti-relay: Warn if incoming stream handler task can't be launchedGabriela Moldovan2026-07-221-2/+4
|
* arti-relay: Handle directory streamsGabriela Moldovan2026-07-221-1/+11
| | | | | | Directory streams are accepted and turned into `DataStreams` by an `arti-relay` task. The `DataStream`s are then passed to the `DirMirror` for handling.
* arti-relay: Spawn a DirMirror::serve() taskGabriela Moldovan2026-07-221-2/+6
|
* arti-relay: Store a DirMirror in TorRelayGabriela Moldovan2026-07-221-0/+15
| | | | | | | | | This will be used shortly, as we need to spawn a `DirMirror::serve()` task from `TorRelay::run()` for handling the incoming directory stream requests. The `DirMirror` is currently built from dummy data because there is no config for it yet.
* arti-relay: Add a task for handling incoming streamsGabriela Moldovan2026-07-225-1/+116
| | | | | This is just the skeleton of the task. The implementation will follow later.
* proto: Return the incoming streams from the create handlerGabriela Moldovan2026-07-221-2/+11
| | | | | | | | | | | We need to return the "futures::Stream of Tor streams" from the CREATE handler, because these need to be handled from `arti-relay`, as per `doc/dev/notes/relay-streams.md` This commit is intentionally (slightly) misformatted to make reviewing a bit easier (the next commit will rustfmt everything). Part of #2612
* arti-relay: simplify tests by removing some `Arc`sSteven Engler2026-07-203-14/+10
|
* arti-relay: remove `Arc` from around `KeyMgr`Steven Engler2026-07-202-17/+12
| | | | Fixes a TODO.
* arti-relay: make `FullKeyView` generic over a `Borrow<KeyMgr>`Steven Engler2026-07-203-8/+19
| | | | Now it can be used with `KeyMgr` and `&KeyMgr`, not only `Arc<KeyMgr>`.
* Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-151-1/+0
|
* add_warning: add reference to arti#2556Jim Newsome2026-07-151-1/+1
|
* Removed unnecessary lintpryty262026-07-151-1/+1
| | | | Removed unnecessary lint
* proto: Pass the allowed incoming commands to CreateRequestHandlerGabriela Moldovan2026-06-301-0/+6
| | | | | | | | | | | This enables us to make these configurable: any relays that are not configured to be an exit will exclude BEGIN and RESOLVE from their list of allowed commands, causing exit and DNS streams to be rejected as soon as the BEGIN/RESOLVE cell is received in the circuit reactor. Context: https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4145#note_3430345 Part of #2606
* arti-relay: Link IncomingStreamRequestFilter in RequestFilterGabriela Moldovan2026-06-291-1/+2
| | | | | Suggested by opara in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4145#note_3430815
* proto: Pass an IncomingStreamRequestFilter factory to the create handlerGabriela Moldovan2026-06-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements what we discussed in `doc/dev/notes/relay-streams.md` (lines 218-234): > Currently, to allow incoming stream requests on a circuit, > you first need to call `RelayCirc::allow_stream_requests()` > to install a `CmdChecker` and `IncomingStreamRequestFilter`. > This is not ideal, because `allow_stream_requests()` will need to be > called unconditionally, on each `RelayCirc`, > right after it's created in the `CreateHandler` impl > (which in turn, would mean making `handle_create()` async too, > because `allow_stream_requests()` is async, which wouldn't be great). > > So, the first step here is to rework the `RelayCirc` API to make relay circuits > be constructable with a list of allowed `RelayCmd`s and `IncomingStreamRequestFilter` > from the get-go ([#2582]), and to get rid of `allow_stream_requests()`, > which will enable the `CREATE*` handler to remain non-`async`. > > In any case, the `CREATE*` handler will still require some changes, > because it needs to be initialized with an `IncomingStreamRequestFilter`, I am not sure using an `IncomingStreamRequestFilter` "factory" is necessarily the right approach here, but the circuit `Reactor`'s constructor needs to take an `IncomingStreamRequestFilter`, and `IncomingStreamRequestFilter` is not `Clone` (and FWIW, I think it's better if we don't make it `Clone`). One obvious limitation is that the `IncomingStreamRequestFilter` of the circuit reactor is fixed for the entire lifetime of the circuit. In practice, I don't think this is going to be a problem, because the arti-relay `IncomingStreamRequestFilter` is only going be used for * preventing single-hop exit streams * per-circuit rate-limiting. Both of these checks will require the filter to have access to a recent `NetDir`, which is straightforward if the filter has an Arc<dyn NetDirProvider> (as mentioned in doc/dev/notes/relay-streams.md, `NetDirProvider` has a handy non-async `timely_netdir()` function we can use). And since these checks are based on consensus params, we don't really need to ever update an already-built circuit with a new `IncomingStreamRequestFilter` (because all `IncomingStreamRequestFilter` will have the ability to obtain a fresh `NetDir` as needed). Nevertheless, I left a TODO about this, because I expect this type to change once we figure out all the other pieces needed for #1448.
* arti-relay: Add an unimplemented stream request filterGabriela Moldovan2026-06-292-0/+24
| | | | | | This is currently just a placeholder that accepts all stream requests. It will be fleshed out later, as part of #1448
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-097-0/+7
| | | | | | | | | | | | 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.
* relay: Remove docs type link that are outside scopeDavid Goulet2026-05-281-5/+5
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Recompute valid_until cache in view constructorDavid Goulet2026-05-283-15/+17
| | | | | | | | | | | | | The recompute of the valid_until cache is done now in the constructor of FullKeyView so the view is directly usable once built. Else, the caller always need to call the recompute function which is error prone especially when used as a throwaway view. Also, without this change, building the view and then attempting to log the public keys would fail. Signed-off-by: David Goulet <[email protected]>
* relay: Introduce src/task/crypto/keys.rsDavid Goulet2026-05-283-694/+745
| | | | | | | | | | | Move all key related action function to keys.rs in order to alleviate crypto.rs. The Reactor will get more functionnalities soon so cleanup. No behavior change, just code movement. Related to #2548
* relay: Rename try_rotate_keys_no_lock()David Goulet2026-05-281-11/+14
| | | | | | Remove the _no_lock() since no more locks now. Signed-off-by: David Goulet <[email protected]>