summaryrefslogtreecommitdiff
path: root/crates/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
* Version bumps for 2.5.0Nick Mathewson2026-06-301-28/+28
| | | | | | | | | | | | | Closes #2617. We've lucked out this time, and it turns out that every one of our published crates gets a minor bump. So this was generated with: ``` for cr in $(./maint/list-crates); do cargo set-version -p $cr --bump minor done ```
* proto: Remove confusing blurb about IncomingStream handlingGabriela Moldovan2026-06-291-3/+5
|
* proto: Clarify wording in relay reactor constructorGabriela Moldovan2026-06-291-1/+5
|
* proto: Say why INCOMING_BUFFER is set to STREAM_READER_BUFFERGabriela Moldovan2026-06-291-0/+5
|
* proto: Add expect(unused) where neededGabriela Moldovan2026-06-292-0/+3
| | | | | | | | | | | Now that relays no longer use `CtrlCmd::AwaitStreamRequests`, some of these fields are unused. I'm leaving them in for now, but we should remove them if they're still unused after we finish the circ reactor impl. I'm not removing `AwaitStreamRequests`, because it will be needed by onion services, when we replace the old client circuit reactor with the new one.
* proto: Remove RelayCirc::allow_stream_requests()Gabriela Moldovan2026-06-291-141/+3
| | | | | | | | | | | | | We don't need it anymore now that `RelayCirc`s always allow incoming stream requests. The previous design, where you could build a `RelayCirc` that didn't allow stream requests, was a leftover from the onion service `ClientCirc` implementation that this was inspired from (onion services *do* need the two to be decoupled, because incoming stream requests are only allowed on the virtual hop, after it's established). Closes #2582
* proto: Pass an IncomingStreamRequestFilter factory to the create handlerGabriela Moldovan2026-06-294-3/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* proto: Return IncomingStreams stream from relay reactor constructor (fmt)Gabriela Moldovan2026-06-291-4/+4
|
* proto: Return IncomingStreams stream from relay reactor constructorGabriela Moldovan2026-06-292-52/+122
| | | | Part of #2582
* proto: Support passing a stream request filter to the reactorGabriela Moldovan2026-06-293-4/+83
| | | | | | | | | Relay circuits always need a filter, so it's best to set it via the constructor. Part of #2582 Closes #2577
* tor-proto: add some comments about handshake server argumentsSteven Engler2026-06-251-0/+5
|
* tor-proto: implement the ntor (non-v3) handshakeSteven Engler2026-06-241-5/+65
|
* tor-proto: update a comment in `CreateRequestHandler`Steven Engler2026-06-241-4/+2
|
* tor-proto: move `RelayLayer` split into helperSteven Engler2026-06-241-4/+21
|
* tor-proto: prepare for ntor handshakesSteven Engler2026-06-241-9/+34
|
* tor-proto: pass correct chan msg cmd to `decrypt_outbound()`Steven Engler2026-06-242-5/+27
| | | | | | | | | | Instead of converting the `RelayEarly` message to a `Relay` message, we add a new `RelayMaybeEarlyChanMsg` restricted message set that can hold either. Previously we were passing the wrong channel message command to `decrypt_outbound()`, which would cause the decryption to fail for relay crypto algorithms that use the command.
* Merge branch 'incoming-reject' into 'main'gabi-2502026-06-248-85/+272
|\ | | | | | | | | | | | | proto: Add circ reactor scaffolding for rejecting pending streams Closes #2590 See merge request tpo/core/arti!4139
| * proto: Rename LocalApplicationStream for clarityGabriela Moldovan2026-06-231-4/+4
| | | | | | | | | | See https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4139#note_3429586
| * proto: Rework error handling in `HopMgr::get_or_spawn_reactor()`Gabriela Moldovan2026-06-232-13/+27
| | | | | | | | | | | | | | | | | | | | This reworks `get_or_spawn_reactor()` to return `Error` instead of `ReactorError`. The main change here is that we now have a dedicated `Error::Spawn` variant for `SpawnError`s, instead of mapping these to `ReactorError` (which actually triggers a clean shutdown, which is not quite what we want here).
| * proto: Simplify StreamEvent::LocalStreamClosed (fmt)Gabriela Moldovan2026-06-231-1/+6
| |
| * proto: Simplify StreamEvent::LocalStreamClosedGabriela Moldovan2026-06-231-15/+4
| | | | | | | | | | This doesn't need to contain the `CloseStreamBehavior` or `TerminateReason`, because we always use the same ones.
| * proto: Rename StreamEvent::Closed to LocalStreamClosedGabriela Moldovan2026-06-231-5/+5
| | | | | | | | | | | | | | I realized the previous naming was ambiguous. Hopefully this makes it clear that this `StreamEvent` triggers when the MPSC channel connecting the reactor to the local application stream (for example the local TCP connection of the stream, in the case of exit streams) is dropped.
| * proto: Remove unnecessary result mappingGabriela Moldovan2026-06-231-1/+1
| | | | | | | | This already returns `()` in the `Ok` case.
| * proto: Implement ClosePendingStream in the stream reactorGabriela Moldovan2026-06-233-5/+40
| | | | | | | | Closes #2590
| * proto: Add a helper function for handling closed streams (fmt)Gabriela Moldovan2026-06-231-10/+10
| |
| * proto: Add a helper function for handling closed streamsGabriela Moldovan2026-06-231-6/+22
| | | | | | | | This will soon be reused for implementing `CtrlMsg::ClosePendingStream`.
| * proto: Add a new StreamReactor control message for closing streamsGabriela Moldovan2026-06-231-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will be sent by the FWD reactor. Essentially, this going to be the final control message in the chain `IncomingStream::reject()` -> `RelayCirc::reject()` -> `forward::CtrlCmd::ClosePendingStream`-> `HopMgr::close_pending()` -> `stream::CtrlCmd::ClosePendingStream` -> stream gets removed from the stream map, END sent Part of #2590
| * proto: Update docs to clarify where the StreamReactor cell sender isGabriela Moldovan2026-06-231-1/+2
| |
| * proto: Implement RelayCirc::close_pending()Gabriela Moldovan2026-06-231-4/+17
| | | | | | | | Closes #2590
| * proto: Add a control message for closing pending streams (fmt)Gabriela Moldovan2026-06-231-3/+4
| |
| * proto: Add a control message for closing pending streamsGabriela Moldovan2026-06-232-1/+41
| |
| * proto: Replace StreamMsg with a new CtrlMsg typeGabriela Moldovan2026-06-234-26/+32
| | | | | | | | | | | | | | This replaces the `StreamMsg` `StreamReactor` sender with a new `CtrlMsg` type. This `CtrlMsg` currently only has a `DeliverStreamMsg` variant (which is the same as the old `StreamMsg` type), but will soon grow another variant, for terminating a stream.
| * proto: Make the new reject_stream() test check the END cell tooGabriela Moldovan2026-06-231-1/+5
| |
| * proto: Factor helper macro out of test functionGabriela Moldovan2026-06-231-17/+17
| | | | | | | | This is just code motion
| * proto: Refactor test macro to not rely on function contextGabriela Moldovan2026-06-231-6/+7
| | | | | | | | | | | | I am about to move this out of the `extend_and_forward()` test, because I want to reuse it in the new `reject_stream()` test for checking that the relay wrote an END cell to the stream.
| * proto: Add a test for rejecting an incoming stream in the relay reactorGabriela Moldovan2026-06-231-0/+40
| | | | | | | | | | | | | | | | This test currently fails, because `IncomingStream::reject()` calls `RelayCirc::close_pending()` under the hood, which isn't implemented yet. Part of #2590
* | proto: log hop settings at trace upon client circuit opening.Nick Mathewson2026-06-231-1/+2
|/
* Merge branch 'msrv-1.91' into 'main'gabi-2502026-06-181-1/+1
|\ | | | | | | | | Bump MSRV to 1.91 See merge request tpo/core/arti!4105
| * Bump MSRV to 1.91Clara Engler2026-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit bumps the MSRV to 1.91 which was released on 2025-10-30. The Cargo.toml files were updated as follows: ```sh git ls-files | \ grep ".*Cargo\.toml$" | \ xargs sed -i '' 's/^rust-version = "1\.89"$/rust-version = "1\.91"/g' ``` The following files were updated manually: ``` modified: .gitlab-ci.yml modified: README.md modified: flake.nix modified: maint/docker-android/Dockerfile ```
* | proto: Update tests to use the new stream exportsGabriela Moldovan2026-06-171-4/+4
| | | | | | | | The tests don't compile otherwise.
* | proto: Add crate-level exports for two extra stream types (fmt)Gabriela Moldovan2026-06-177-26/+10
| |
* | proto: Add crate-level exports for two extra stream typesGabriela Moldovan2026-06-171-0/+4
| | | | | | | | | | For convenience. This will soon replace a corresponding re-export from `tor_proto::client::stream`.
* | proto: Re-export StreamReceiver from tor_proto::streamGabriela Moldovan2026-06-171-1/+2
| | | | | | | | This will soon replace the re-export from `tor_proto::client::stream`.
* | proto: Re-export the Incoming* types from tor_proto::streamGabriela Moldovan2026-06-171-0/+6
| | | | | | | | | | | | | | | | | | | | These will replace the pub re-exports from `tor_proto::client::stream`. This reorg is needed because currently, the only public export of the incoming stream types is from `tor_proto::client::stream`, but these aren't actually client specific: relays will use them too, for implementing exit, DNS and directory streams. So it makes more sense to export them from the top-level stream module instead.
* | proto: Make the stream module pubGabriela Moldovan2026-06-171-1/+1
| |
* | Merge branch 'flowctrl-tests' into 'main'opara2026-06-162-14/+434
|\ \ | |/ |/| | | | | tor-proto: Add unit test for `XonXoffReader` See merge request tpo/core/arti!4093
| * tor-proto: add a unit test for `XonXoffReader`Steven Engler2026-06-162-1/+399
| | | | | | | | | | The 'futures' version bump is needed so that our test can use `UnboundedSender::try_recv()` in the minimal-versions CI test.
| * tor-proto: add `DrainRateNotifier` trait for `XonXoffReader`Steven Engler2026-06-101-13/+35
| | | | | | | | This will allow us to add a unit test for `XonXoffReader`.
* | Merge branch 'destroy' into 'main'opara2026-06-122-29/+5
|\ \ | | | | | | | | | | | | | | | | | | Always use destroy reason NONE in circuit handshake code Closes #2466 See merge request tpo/core/arti!4088
| * | tor-proto: circ handshake now always uses NONE destroy reasonSteven Engler2026-06-122-29/+5
| |/