| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The pseudocode says:
```text
if next_cc_event:
next_cc_event--
if next_cwnd_event:
next_cwnd_event--
if clock_stalled_or_jumped:
inflight -= 'cc_sendme_inc'
return
```
but we were previously decrementing these after the return rather than
before.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
We can't access `NetParameters` in this crate to build from consensus
default value so instead add a `defaults_for_tests()` gated function for
each parameters object which puts in the defaults from the spec.
We'll need CircNetParameters in order to build create request handler
for unit tests hence why it is in src/circuit.rs.
|
| | |
|
| | |
|
| |
|
|
|
| |
The `test_util` modules is already gated behind
`#[cfg(any(test, feature = "testing"))]`.
|
| | |
|
| | |
|
| |
|
|
| |
Run maint/add_warning
|
| |
|
|
| |
We will need this to calculate the END ack timeout.
|
| |
|
|
|
|
|
| |
We no longer need to clone `CongestionWindowParams` now that it
implements `Copy`.
Resolves a clippy warning.
|
| |
|
|
|
| |
These will likely always just be a collection of integers (lightweight
to copy).
|
| |
|
|
|
|
|
|
|
|
| |
```text
warning: duplicated attribute
--> crates/tor-hsservice/src/timeout_track.rs:630:14
|
630 | #![allow(clippy::needless_pass_by_value)] // TODO hoist into standard lint block
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
Instead call it compatible_with_cgo, which is what we actually
care about in this context.
|
| |
|
|
| |
Let's see if it works!
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
A `None` value signals to the conflux code to know to fall back on the
initial RTT of the circuit.
Without this change, the conflux switching logic is broken as we end up
staying on the leg with the best initial RTT forever (the other leg is
never picked, because its `ewma_rtt()` is stuck on `u32::MAX`, and never
updated as we never send on it).
|
| |
|
|
|
|
|
| |
The expanded expression makes it easier to see that
`can_crosscheck_with_current_estimate()` can never return `true` if
`self.ewma_rtt` is `None`, and that the `expect()` from
`is_clock_stalled()` cannot panic.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
The `RttEstimator` now uses `None` to represent not-yet-measured RTTs.
Previously, all the measured RTTs defaulted to 0, in contradiction with
the `RttEstimator::{min,ewma}_rtt_usec()` docs, which state that both
functions are supposed to return `u32::MAX` if there is no estimate.
Closes #2049
|
| |
|
|
|
|
| |
Conflux is only supported when prop324 congestion control is enabled, so
we need an accessor for the cc algorithm of a given circuit hop in order
for the conflux code to be able to check *which* cc algorithm is in use.
|
| |
|
|
|
|
| |
This doesn't really change anything, but removing the `.clone()` makes
it a bit more obvious that copying the `*Params` is a lightweight
operation.
|
| | |
|
| | |
|
| |
|
|
|
| |
The fallback CC algorithm is _always_ fixed-window, and we should only
use it when the selected CC algorithm is not supported.
|
| |
|
|
|
|
|
|
|
| |
Now tor-circmgr no longer needs to check which Protover capabilities
are enabled, or construct a separate CircParameters for each hop.
Instead, tor-proto decides whether to use the fallback CC mode,
based on whether the target supports FLOWCTRL_CC.
Closes #1967.
|
| |
|
|
|
|
|
|
|
|
|
| |
One type will now represent _the kind of hop we are asking
tor-proto to negotiate_; the other will represent
_the state of such negotiation_.
This doesn't simplify the code much yet, but it will be helpful
as we add more and more negotiable settings.
Part of #1967
|
| | |
|
| |
|
|
|
| |
This doesn't make much change yet, but does save us an allocation
when handling SENDMEs.
|
| | |
|
| | |
|
| |
|
|
|
| |
We use this method to decide whether to allow receiving stream SENDMEs,
and also whether we should send stream SENDMEs.
|
| |
|
|
|
|
|
|
| |
Also add one for the sendme_inc validity function.
Part of #1817
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a new function to the CongestionControl object that returns
true or false on if stream level SENDMEs are allowed by the underlying
algorithm.
Congestion control Vegas doesn't allow them as in it retires them and so
we avoid sending them for that algorithm.
Part of #1817
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Congestion control can change the circuit parameters if the relay we are
negotiating with doesn't support FlowCtrl=2.
This commit adds a function in the circuit builder that will apply any
changes to the circuit parameters of the hop based on the hop protocol
values. For now, only congestion control applies.
Part of #1817
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CircParameters is built before path selection and thus once we start
building the hops, we can't access the consensus values that were used
to build it in the first place.
For congestion control, we require a fallback algorithm in case the hop
doesn't support FlowCtrl=2.
This commit adds a "fallback_alg" to the CC parameters which will be
used for this exact case.
Part of #1817
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
When receiving the congestion control response extension, evaluate our
state and set the sendme_inc if valid in our circuit parameters.
For this, a series of helper functions is needed.
Part of #1817
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
This will let us actually _send_ messages in the right format.
This approach is not ideal for packed/fragmented messages;
they will need a separate RelayCellEncoder.
part of #1944.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Allows us to remove the pub.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
| |
Important to enforce that every field is explicitely set so we avoid
forgetting fields.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|