| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Cancellation is now fallable, which allows us to detect attempts
to cancel which cannot work.
We now guarantee that when you try to cancel a `Cancel<F>` future,
either the cancel operation will succeed, or the future will return
(or will have already returned) Ok(), but not both, and not neither.
Closes #818.
|
| | |/
|/|
| |
| |
| |
| |
| |
| | |
Our now convention here in rpclib is that a struct holding a
request's parameters is called `FooParams`, and a struct holding
that request's reply is called `FooReply`.
Closes #1586
|
| |\ \
| | |
| | |
| | |
| | | |
tor-proto: Replace sleep() in test with advance_until_stalled().
See merge request tpo/core/arti!2721
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This test spuriously failed on my !2720 branch
(https://gitlab.torproject.org/gabi-250/arti/-/jobs/811495):
```
failures:
---- circuit::test::invalid_circ_sendme stdout ----
E tor_proto::channel::reactor: UniqId(71): Running reactor
E tor_proto::circuit::reactor: Circ 23.17: Running circuit reactor
E tor_proto::circuit::reactor: Circ 23.17: reactor received AddFakeHop { relay_cell_format: V0, fwd_lasthop: false, rev_lasthop: false, params: CircParameters { extend_by_ed25519_id: true, ccontrol: CongestionControlParams { alg: FixedWindow(FixedWindowParams { circ_window_start: 1000, circ_window_min: 100, circ_window_max: 1000 }), cwnd_params: CongestionWindowParams { cwnd_init: 124, cwnd_inc_pct_ss: Percentage { value: 100 }, cwnd_inc: 1, cwnd_inc_rate: 31, cwnd_min: 124, cwnd_max: 4294967295, sendme_inc: 31 }, rtt_params: RoundTripEstimatorParams { ewma_cwnd_pct: Percentage { value: 50 }, ewma_max: 10, ewma_ss_max: 2, rtt_reset_pct: Percentage { value: 100 } } } }, done: Sender { complete: false } }
E tor_proto::circuit::reactor: Circ 23.17: reactor received AddFakeHop { relay_cell_format: V0, fwd_lasthop: true, rev_lasthop: true, params: CircParameters { extend_by_ed25519_id: true, ccontrol: CongestionControlParams { alg: FixedWindow(FixedWindowParams { circ_window_start: 1000, circ_window_min: 100, circ_window_max: 1000 }), cwnd_params: CongestionWindowParams { cwnd_init: 124, cwnd_inc_pct_ss: Percentage { value: 100 }, cwnd_inc: 1, cwnd_inc_rate: 31, cwnd_min: 124, cwnd_max: 4294967295, sendme_inc: 31 }, rtt_params: RoundTripEstimatorParams { ewma_cwnd_pct: Percentage { value: 50 }, ewma_max: 10, ewma_ss_max: 2, rtt_reset_pct: Percentage { value: 100 } } } }, done: Sender { complete: false } }
E tor_proto::circuit::reactor: Circ 23.17: reactor received BeginStream { hop_num: HopNum(2), message: Begin(Begin { addr: [119, 119, 119, 46, 101, 120, 97, 109, 112, 108, 101, 46, 99, 111, 109], port: 443, flags: BeginFlags(IPV6_OKAY) }), sender: Sender { tx: Sender { closed: false }, mq: TypedParticipation(Participation(Noop)) }, rx: Receiver { inner: ReceiverInner { state: Mutex { data: Ok(ReceiverState { rx: StreamUnobtrusivePeeker { buffered: None, poll_waker: None, inner: Some(Receiver { closed: false }) }, mq: TypedParticipation(Participation(Noop)), collapse_callbacks: 0 }), poisoned: false, .. } } }, done: Sender { complete: false }, cmd_checker: DataCmdChecker { expecting_connected: true } }
Using RNG seed ARTI_TEST_PRNG=62d085c0fb1213c4f41d1a0a5c3f92dd10223a27c42bfda3caedfe60e011e95d
E tor_proto::circuit::reactor: Circ 23.17: handling cell: Relay(Relay { body: .. })
Using RNG seed ARTI_TEST_PRNG=fd2f2f045a7340f1189972b13645346943efa2c42f43afd2161420c692bb4ff0
E tor_proto::circuit::reactor: Circ 23.17: handling cell: Relay(Relay { body: .. })
E tor_proto::circuit::reactor: Circ 23.17: Circuit reactor stopped: Err(CircProto("Mismatched tag on circuit SENDME"))
E tor_proto::channel::reactor: UniqId(71): reactor received CloseCircuit(CircId(128))
E tor_proto::channel::reactor: UniqId(71): Circuit 128 is gone; sending DESTROY
thread 'circuit::test::invalid_circ_sendme' panicked at crates/tor-proto/src/circuit.rs:2262:21:
reactor continued running after invalid sendme
failures:
circuit::test::invalid_circ_sendme
test result: FAILED. 142 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out; finished in 4.93s
```
This is probably because of the `sleep()`-based check. This branch
changes the test to use `MockRuntime`, replacing the `sleep()` with
`advance_until_stalled()`.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
The more concise name makes the code a bit more readable, IMO (and it's
consistent with the `Result` type-aliasing style we've been using in the
rest of the codebase).
|
| | | |
| | |
| | |
| | | |
It's not needed because `CircHop` is defined in the same file.
|
| | | |
| | |
| | |
| | | |
No functional changes, just `cargo fmt`.
|
| | |/
|/|
| |
| |
| |
| |
| |
| |
| | |
This is mostly code motion in preparation for refactoring `run_once()`
to use `select!` instead of the hand-rolled `poll_fn` impl.
Note: the code here is intentionally mis-indented, to simplify diffing
(I recommend using `git diff --color-moved`). A future commit will fix
the indentation.
|
| |\ \
| |/
|/|
| |
| |
| |
| | |
arti: Add `restricted-discovery` to the list of experimental features.
Closes #1808
See merge request tpo/core/arti!2719
|
| | |
| |
| |
| |
| |
| |
| | |
Note: there are other experimental features we might want to document
here (possibly after we settle the discussion from #1706?)
Closes #1808
|
| |\ \
| | |
| | |
| | |
| | | |
Implement congestion control from prop324
See merge request tpo/core/arti!2675
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Without circuit negotiation and flow control (XON/XOFF), the Vegas
algorithm can not be used.
Temporarily, this commit pins the algorithm to fixed window until we
have the above.
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Both in tor-proto and tor-circmgr.
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Instead, return an error and make all call site handle it.
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Allows us to remove the pub.
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Congestion control parameters have specific values depending on the
circuit type. Instead of using a CircuitType, which is removed in this
commit, specialize the function in this case onion and exit.
This allows us to get rid of CircuitType and solely use TargetCircUsage
instead.
At this commit, we use .expect() on the Builder. Future commit will
remove this to return a Result in case of failure. Worth noting that we
don't expect one.
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]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add lower() and upper() so we can access the bounds of a BoundedInt32.
This is useful to get the min and max of a consensus parameter value
which are always the bounds of the parameters.
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | | |
No need to have these comments in the implementation of the Trait.
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Put code for test inside the test module instead of gated by a
cfg(test).
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In unit tests, we set a 1000 by default but else, we don't set a default
so our implementation doesn't forget to set the right value from the
consensus.
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Don't put in the comments, let the top-level module comments do that
job.
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Instead of having the congestion.rs test module public, make a
test_utils.rs file that contains code for other unit tests within the
congestion module.
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Turns out that RoundTripEstimatorParams is the same exact thing so one
less data structure.
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | | |
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We also pass along congestion signals that may or may not be used by our
congestion control algorithm.
Part of #534
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It is official, congestion control is now used at this commit by the
circuit reactor making circuit/sendme.rs unused. Will be removed with
another commit.
Related #534
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The congestion control parameters are created from the consensus
parameters (netparams) and then put into the CircParameters object that
is then passed down the tor-proto crate.
Because different parameters are selected depending on the circuit type
(onion vs exit vs sbws), a CircuitType enum is introduced for the sole
purpose of being used to select the right parameters.
Related #534
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The big one! This is the Vegas algorithm implementation that is hooked
to the CongestionControl object by implementing the algorithm trait.
Still, at this commit, nothing is being used by the circuit reactor yet.
Related #534
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add the top level CongestionControl object that will allow the circuit
reactor to use it in order to decide if a cell can be sent or not. In
order to be used, it is configured with an algorithm that implements the
CongestionControlAlgorithm trait.
The Fixed Window algorithm is also added which essentially implements
the SENDME logic as arti knows it today with a fixed window size.
The SENDME code has been refactor in two different logical steps in
order to accomodate the future Vegas algorithm for which the congestion
window logic and SENDME validity is seperated.
There is now a SENDME validator that takes care of tracking the tags
(authenticated SENDMEs) and validating them upon reception. Then, if
valid, the window management is passed down the congestion control
algorithm, at this commit, FixedWindow object.
Related #534
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit adds the congestion window object, a round trip estimator
(RTT) and a state enum. These 3 entities are used by congestion control
in a generic way that is they are passed and used by any algorithm.
At this commit, they are not used hence the allow deadcode attribute for
now in order to minimize the build warnings.
We also introduce the params.rs file containing the parameters, taken
from consensus, used to configure these objects. They will be exposed to
the tor-cirmgr crate to build the CircParameters. More will come.
This also introduces the congestion/ directory that will contain more
code in future commits.
Related #534
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Related #534
Signed-off-by: David Goulet <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Crate is unused and most of its code will be reworked and folded into
tor-proto in the future commit with the Congestion Control work.
Related #534
Signed-off-by: David Goulet <[email protected]>
|
| |\ \ \
| |_|/
|/| |
| | |
| | |
| | |
| | | |
rpc: Clarify and fix some issues surrounding relative paths.
Closes #1748 and #1749
See merge request tpo/core/arti!2712
|
| | | | |
|
| | | | |
|
| | |/
|/|
| |
| |
| |
| |
| |
| |
| | |
`std::os::unix::fs::MetadataExt` was indeed the right trait to
import, but it doesn't exist on non-unix platforms.
This is another bugfix on !2707. It should retain the fix of !2717.
I've confirmed that it builds on Windows and passes tests on Linux
and Mac.
|
| | | |
|
| |\ \
| | |
| | |
| | |
| | | |
rpclib: Clean up after performing cookie auth
See merge request tpo/core/arti!2716
|
| | | | |
|
| | | | |
|
| | | | |
|