summaryrefslogtreecommitdiff
path: root/crates/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
...
| * proto: Move StreamComponents to top-level stream modGabriela Moldovan2025-11-243-22/+24
| |
| * proto: Move raw under top-level stream modGabriela Moldovan2025-11-243-7/+3
| |
| * proto: Move StreamTarget to stream moduleGabriela Moldovan2025-11-244-163/+177
| |
| * proto: Make StreamTarget take a generic TunnelGabriela Moldovan2025-11-241-42/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed because we want to reuse `StreamTarget` and `DataStream` on the relay side too, but to do that, we need to abstract away the tunnel/circuit type (prior to this MR, `StreamTarget` was was client-specific, as it used to wrap a client tunnel). Note that `StreamTarget` needs a handle to the client/relay circuit reactor because it needs to be able to shut down the circuit if a protocol error occurs (cells carrying stream data are parsed late, *outside* of the reactor, so if e.g. a cell fails to parse, the `DataReaderImpl` needs to be able to shut it down), and because it needs to be able to inform the reactor of flow control-related events (such as drain rate update).
| * proto: Make the hop in StreamTarget optionalGabriela Moldovan2025-11-241-6/+6
| | | | | | | | For relays, the hop of the StreamTarget will be set to `None`.
| * proto: Add an IncomingStreamConfig to pass to the reactorGabriela Moldovan2025-11-241-2/+12
| |
| * proto: Rework relay reactor error handlingGabriela Moldovan2025-11-241-8/+15
| | | | | | | | | | | | | | I've made `run()` more similar to its client circuit reactor counterpart (I think the error reporting will be better, and if we ever need to make the reactor public, it will be easier this way because now `run()` doesn't expose the crate-private `ReactorError` type).
| * proto: Rename RelayReactor to ReactorGabriela Moldovan2025-11-243-12/+12
| | | | | | | | | | This is already namespaced under the `relay` module so the `Relay` prefix is redundant.
| * proto: Give RelayCirc a DynTimeProviderGabriela Moldovan2025-11-242-1/+7
| | | | | | | | This will be needed soon.
| * proto: Move StreamReqInfo to stream moduleGabriela Moldovan2025-11-243-55/+60
| |
| * proto: Make the hop in StreamReqInfo optionalGabriela Moldovan2025-11-243-6/+3
| | | | | | | | We are about to use `StreamReqInfo` for exit streams too.
| * proto: Move IncomingStream* types to shared moduleGabriela Moldovan2025-11-243-305/+300
| |
| * proto: Make the forward -> backward reactor chan boundedGabriela Moldovan2025-11-243-5/+12
| | | | | | | | | | | | | | This MPSC channel now has zero buffering, because if the backward reactor can't send the cell, the forward reactor must immediately stop reading from its inputs (note that the backward reactor's Tor channel towards the client *does* have a buffering layer).
| * proto: Let cell_rx carry more than just stream dataGabriela Moldovan2025-11-242-21/+46
| | | | | | | | | | There are other types of messages (like circuit-level SENDMEs) that need to be handled in the backward reactor too.
| * proto: Give RelayReactor and BackwardReactor a RuntimeGabriela Moldovan2025-11-242-3/+17
| | | | | | | | | | We will soon need a handle to the runtime in BackwardReactor (we need a time provider to call `note_sendme_received()`).
| * proto: Don't poll PollAll unless we can write to chanGabriela Moldovan2025-11-241-14/+9
| | | | | | | | | | We need to avoid reading from all of these if the chan_sender isn't ready, because otherwise we can't provide backpressure.
| * proto: Use CircuitCellSender in the backward reactorGabriela Moldovan2025-11-241-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | The backward reactor needs this for handling padding (because it may need to e.g. put the chan sender in a blocked state). Note that `CircuitCellSender` has an underlying `SometimesUnboundedSink`, so from now on we must be very careful and avoid writing to the `chan_sender` if it's not ready (because otherwise we can end up buffering unboundedly). The next commit will add some extra checks against reading from futures::Streams that might cause us to write to the `chan_sender` sink (futures::Sink).
| * proto: Return early if the cell is unrecognizedGabriela Moldovan2025-11-241-11/+11
| | | | | | | | | | | | Rewriting the code this way reduces the indentation level for the "recognized cell" case (which is not yet implemented, but will be very soon), thereby making it more readable.
* | Remove semver.md files post-releaseGabriela Moldovan2025-12-021-4/+0
| |
* | Bump all the unstable tor- and arti- crates to 0.37.0.Gabriela Moldovan2025-12-021-20/+20
| | | | | | | | | | | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.37.0 done
* | proto: Add docs for ExcessPaddingGabriela Moldovan2025-12-011-0/+1
| |
* | proto: Allow unstable_name_collisions in several placesGabriela Moldovan2025-12-012-0/+10
| |
* | proto: Remove extra slashes in doc commentsGabriela Moldovan2025-12-011-2/+2
| |
* | opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-248-5/+40
|/ | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* proto: Add a semver entry for ClientInitiatorHandshakeDavid Goulet2025-11-191-0/+2
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Remove unused code from testDavid Goulet2025-11-191-1/+0
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Move comment in relay handshake.rsDavid Goulet2025-11-191-1/+1
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Remove unused function from ClientChannelBuilderDavid Goulet2025-11-191-7/+0
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Add a TODO relay for ChannelBuilderDavid Goulet2025-11-191-0/+2
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Remove a .expect() of a digest array conversionDavid Goulet2025-11-191-17/+15
| | | | | | | We know from the start that this is 32 bytes so no reason to hard fail if not, just propagate the right type from the start. Signed-off-by: David Goulet <[email protected]>
* proto: Update generic channel commentsDavid Goulet2025-11-191-9/+12
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Make cargo doc happyDavid Goulet2025-11-192-3/+3
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Implement part of UnverifiedRelayChannel::finish()David Goulet2025-11-191-10/+37
| | | | | | | | | | The UnverifiedChannel::finish() was split in previous commit so this adds the support for sending the right NETINFO cell instead of the client specific one. Added more TODOs for followup commits. Signed-off-by: David Goulet <[email protected]>
* proto: Split VerifiedChannel::finish()David Goulet2025-11-192-25/+20
| | | | | | | | | | Move the client specific code into VerifiedClientChannel as in sending the NETINFO cell. The rest is pretty much boiler plate to build a channel reactor. The relay finish() code is coming in a followup commit. Signed-off-by: David Goulet <[email protected]>
* proto: Use the new client specific channelsDavid Goulet2025-11-192-28/+26
| | | | | | | | | By changing the connect() returned object we therefore officially make VerifiedChannel and UnverifiedChannel crate only objects. Thus, this commit changes visibility on most things. Signed-off-by: David Goulet <[email protected]>
* proto: Add client specific handshake channel structsDavid Goulet2025-11-193-7/+91
| | | | | | | | | | | | | | This adds the UnverifiedClientChannel and VerifiedClientChannel mirroring the relay API for channels. It plainly uses the generic object underneath as for now those objects are client only. Followup commits will make things more client specific. No behavior change. Signed-off-by: David Goulet <[email protected]>
* proto: Move client handshake into client channel moduleDavid Goulet2025-11-195-129/+222
| | | | | | | | | | | | | This only moves code from src/channel to src/client/channel. It introduces a ClientChanBuilder that is used to launch client specific channel by the public ChanBuilder. The followup commits will add a VerifiedClientChannel and UnverifiedClientChannel in order to again decouple client and relay code from the generic objects. Signed-off-by: David Goulet <[email protected]>
* proto: Add VerifiedRelayChannel implementationDavid Goulet2025-11-192-2/+33
| | | | | | | | Add the finish() function that for now simply calls the generic finish(). There is a bunch of TODO in the code in this commit explaining why we haven't made the implementation relay specific just yet. Signed-off-by: David Goulet <[email protected]>
* proto: Add UnverifiedRelayChannel implementationDavid Goulet2025-11-194-125/+122
| | | | | | | | | | | | | | This commits takes out the relay specific code out of UnverifiedChannel and puts it in UnverifiedRelayChannel. In order to pull this off, we added some fiels to the VerifiedChannel struct so the relay code get back generated data from the UnverifiedChannel::check() in order to do its validation work and yield a VerifiedRelayChannel. This also lead to a cleanup of expect() and ChannelType::is_initiator(). Signed-off-by: David Goulet <[email protected]>
* proto: Introduce relay specific channel structsDavid Goulet2025-11-191-2/+38
| | | | | | | | | | The new UnverifiedRelayChannel and VerifiedRelayChannel struct are added to decouple the client code and put the relay component in its module. Both objects hold the to become generic object that both client and relay will use to create a channel. Signed-off-by: David Goulet <[email protected]>
* proto: Fix up doc links post-refactoringGabriela Moldovan2025-11-172-9/+9
|
* proto: Temporarily silence a few warningsGabriela Moldovan2025-11-171-0/+3
|
* proto: Use CircHopInbound in the ForwardReactor (fmt)Gabriela Moldovan2025-11-173-6/+4
|
* proto: Use CircHopInbound in the ForwardReactorGabriela Moldovan2025-11-172-19/+15
|
* proto: Use CircHopOutbound in BackwardReactorGabriela Moldovan2025-11-172-34/+24
|
* proto: Make cc state shared between CircHop{Inbound,Outbound}Gabriela Moldovan2025-11-173-27/+30
| | | | | | | | | | | | | The relay reactor needs the cc state to be shared between the inbound and outbound components (i.e. the forward and backward reactors), so we need to put the cc state behind a mutex. There will never be any contention on this mutex in the client impl, because the client reactor doesn't split the `CircHop` into `CircHopInbound` and `CircHopOutbound`. In the future, we should work on trying to reduce the number of locks in the `CircHop` states.
* proto: Make CongestionWindow CopyGabriela Moldovan2025-11-173-8/+8
|
* proto: Move CircHop{Inbound,Outbound} out of the client module.Gabriela Moldovan2025-11-172-575/+599
| | | | These will be soon used by relays too.
* proto: Add constructors for CircHop{Inbound,Outbound}Gabriela Moldovan2025-11-171-19/+46
|
* proto: Move some of CircHop's impl to CircHop{Inbound,Outbound}Gabriela Moldovan2025-11-171-141/+340
| | | | | The Inbound/Outbound CircHop states will be used in the relay reactor, so it's helpful to move some of the `CircHop` impl there.