| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
The end result should be:
1. outgoing streams - enable sidechannel mitigations
2. incoming hs streams - enable sidechannel mitigations
3. incoming exit streams - disable sidechannel mitigations
|
| | |
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
We have decided that instead of "uniq_id" in logging, we'll use the
"<domaine>-[<type>]-id" syntax to indicate who is that unique ID.
This commit only renames circuit's unique ID to "circ_uniq_id".
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
This commit only affects logging. Whenever possible, log both the UniqId
and CircId.
This also changes the log lines which is now "uniq_id=" and "circ_id="
as the UniqId is internal and circ_id (CircId) is protocol level.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A CircId is now a circ_id and a UniqId is a unique_id so we stop
confusing them in the code.
Furthermore, channel_id that are CircId are now circ_id. Channel IDs are
different and encoded internally into a UniqId.
This is the first step to clarify semantic before we change the logging
to log both unique ID and circ ID.
No behavior change.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This feature-gating has been a source of confusion, and it unnecessarily
complicates the stream message handling flow.
I've previously argued in favour of keeping it, in the spirit of a belt
and braces approach to message validation, but I've been convinced that
in this particular case, the feature-gate is more trouble than it's
worth.
What makes things worse is that the `CircHop::handle_msg()`
function was designed poorly (by yours truly). I plan on refactoring it
at some point, hopefully soon. There is a TODO about this below
its doc comment.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This better matches nearby code.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously when initializing a stream, we constructed most of the
stream-related queues outside of the reactor and passed the relevant
halves of the queues (senders or receivers) into the reactor.
A downside of the above approach is that the reactor may be better
informed about what queues to construct, and how to construct them. For
example the reactor knows what type of flow control that the hop is
using, so it knows whether we need queues for passing rate limits and
drain rates for XON/XOFF flow control.
This commit moves the construction of these queues into the reactor and
passes the relevant halves out of the reactor. In the future we can make
better decisions about which queues are needed depending on the flow
control method used instead of always constructing them (see arti#2068).
Reviewing with `--color-moved` might be helpful as a few lines have been
moved.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
The stream queue length (for messages incoming from the Tor network)
depends on the type of flow control we're using for the hop. Currently
we construct the stream queue outside of the circuit reactor, but we
don't have the flow control information here.
Instead of constructing the stream queue outside of the reactor and
passing the sender into the reactor, we construct the stream queue
inside of the reactor and pass the receiver out of the reactor.
|
| | |
|
| |
|
|
|
|
|
| |
I think it was written like this because earlier versions of rust didn't
allow references to temporaries like `&mut rand::rng()` and needed them
to be bound to a variable. But this isn't necessary anymore and so the
comment doesn't make sense.
|
| | |
|
| | |
|
| |
|
|
| |
And update the docs
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`IncomingStreamRequestFilter`s, and `CircSyncView`s, by extension, are used
both by old relay implementation and the new one for implementing an
out-of-reactor way of deciding how to handle an incoming stream.
In the new circuit reactor design, we have a separate stream reactor for
each hop. Upon receiving an incoming stream, the stream reactor will
need to build one of these `CircSyncView` objects, and then pass it to
an externally-provided `IncomingStreamRequestFilter`. Before this
change, `CircSyncView::n_open_streams()` returned the total number of
open streams, which wouldn't have worked with the new reactor design,
because the per-hop stream reactor doesn't have a global view of all the
hops, so its `CircSyncView` can't return the total number of streams (at
least not without message passing, or sharing state with the other
stream reactors).
|
| |
|
|
|
|
|
|
|
|
| |
Note: this commit only contains the removal of the old `CircSyncView`,
and it of course doens't compile. A future commit will replace the
removed file with the `syncview.rs` from the client module.
This change is split over two commits because it makes reviewing easier
(`git mv`ing the new file over the old results in a confusing diff,
because `git` refuses to show it as a move).
|
| |
|
|
|
| |
This will soon replace `CircSyncView` wholesale. The preliminary
renaming will make the future diffs easier to review.
|
| |
|
|
| |
These will be used by the relay code too (for circuit extension).
|
| | |
|
| |
|
|
| |
Relays will need to use it too.
|
| |
|
|
|
| |
This will be used in the stream reactor too (and the stream reactor will
eventually replace the corresponding client impl).
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit removes the CircuitRx* based solely on the client circuit
message and moves it into the top level of the crate so all reactors can
use them.
The client reactor then upon receiving the message, it converts the
AnyChanMsg into a ClientCircChanMsg. On error, this leads to a shutdown
of the entire reactor due to a fatal error.
In order to pull this off, we added a CircuitAction::Shutdown that is
handled as a priority.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
| |
Next commit will also move the Relay specific set into the relay module.
These two sets are becoming specific to the reactor as the circuit
reactor communication channel will use AnyChanMsg instead.
Signed-off-by: David Goulet <[email protected]>
|
| |\
| |
| |
| |
| | |
proto: Start handling incoming streams in the relay reactor
See merge request tpo/core/arti!3487
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Initially I wanted to turn `msg_streamid()` into a method on
`UnparsedRelayMsg`, but I ultimately decided against it, because it
feels like it doesn't belong there (even though intuitively, I would've
expected it to handle the mismatch between stream ID and cell command
internally). This is because all the `UnparsedRelayMsg` methods return
`tor_bytes::Result`, and do not actually do any validation beyond some
length checks on the various fields.
|
| | | |
|
| | |
| |
| |
| | |
We are about to use `StreamReqInfo` for exit streams too.
|
| |/
|
|
|
| |
These are all aimed at figuring out in more detail what's going on
in #2079 and related issues.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
| |
`CircHop::relay_format()` returned the same thing as
`CircHop::relay_cell_format()`.
|
| |\
| |
| |
| |
| | |
proto: Move cell_sender out of the client module
See merge request tpo/core/arti!3407
|
| | |
| |
| |
| |
| |
| |
| | |
Soon we'll use CircuitCellSender in the relay reactor too (we need to,
because it provides a useful abstraction for handling block/unblock
padding actions, and because it has some handy helper functions such as
`congestion_signals()`).
|
| |/ |
|
| | |
|
| |
|
|
| |
These will be shared with the relay code.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Closes #2067.
|
| |
|
|
|
|
| |
The previous "incoming" terminology was rather ambiguous.
Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3348#note_3275337
|