summaryrefslogtreecommitdiff
path: root/crates/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
...
* | tor-proto: Remove unnecessary fully qualified path.Gabriela Moldovan2025-01-161-1/+1
| | | | | | | | It's not needed because `CircHop` is defined in the same file.
* | tor-proto: Move outbound message sending out of circuit run_once() (fmt).Gabriela Moldovan2025-01-161-64/+64
| | | | | | | | No functional changes, just `cargo fmt`.
* | tor-proto: Move outbound message sending out of circuit run_once().Gabriela Moldovan2025-01-161-13/+23
|/ | | | | | | | | 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.
* Add missing semver.md filesDavid Goulet2025-01-161-0/+1
| | | | | | Both in tor-proto and tor-circmgr. Signed-off-by: David Goulet <[email protected]>
* congestion: Use getters for all parametersDavid Goulet2025-01-164-68/+94
| | | | | | Allows us to remove the pub. Signed-off-by: David Goulet <[email protected]>
* congestion: Remove Default from every parametersDavid Goulet2025-01-162-24/+6
| | | | | | | Important to enforce that every field is explicitely set so we avoid forgetting fields. Signed-off-by: David Goulet <[email protected]>
* congestion: Make the cc_alg values a caret_int for better code semanticDavid Goulet2025-01-162-0/+15
| | | | Signed-off-by: David Goulet <[email protected]>
* congestion: Move test code in test module for VegasDavid Goulet2025-01-161-16/+15
| | | | Signed-off-by: David Goulet <[email protected]>
* congestion: Remove duplicated commentsDavid Goulet2025-01-161-13/+0
| | | | | | No need to have these comments in the implementation of the Trait. Signed-off-by: David Goulet <[email protected]>
* congestion: Move code to test moduleDavid Goulet2025-01-161-10/+14
| | | | | | | Put code for test inside the test module instead of gated by a cfg(test). Signed-off-by: David Goulet <[email protected]>
* congestion: Remove FixedWindow start window default valueDavid Goulet2025-01-163-13/+18
| | | | | | | | 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]>
* congestion: Add standard clippy checks to testsDavid Goulet2025-01-163-0/+42
| | | | Signed-off-by: David Goulet <[email protected]>
* congestion: Some comments and mod syntax tweakingDavid Goulet2025-01-161-7/+1
| | | | | | | Don't put in the comments, let the top-level module comments do that job. Signed-off-by: David Goulet <[email protected]>
* congestion: Make a test_utils.rsDavid Goulet2025-01-164-45/+60
| | | | | | | | 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]>
* congestion: Remove duplicate RttParameters structDavid Goulet2025-01-161-39/+7
| | | | | | | Turns out that RoundTripEstimatorParams is the same exact thing so one less data structure. Signed-off-by: David Goulet <[email protected]>
* test: Fix circuit unit testsDavid Goulet2025-01-162-5/+9
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Remove unused circuit/sendme.rsDavid Goulet2025-01-162-459/+0
| | | | Signed-off-by: David Goulet <[email protected]>
* proto: Notify CC when a SENDME is receivedDavid Goulet2025-01-162-8/+27
| | | | | | | | | 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]>
* proto: Use congestion control in circuit reactorDavid Goulet2025-01-166-49/+48
| | | | | | | | | | 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]>
* circmgr: Modify CircParameters for congestion controlDavid Goulet2025-01-163-51/+23
| | | | | | | | | | | | | | 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]>
* proto: Add Vegas congestion control algorithmDavid Goulet2025-01-163-0/+599
| | | | | | | | | | | 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]>
* proto: New CongestionControl object and fixed window algorithmDavid Goulet2025-01-164-7/+745
| | | | | | | | | | | | | | | | | | | | | | | 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]>
* proto: Add generic objects for congestion controlDavid Goulet2025-01-164-0/+658
| | | | | | | | | | | | | | | | | | | | 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]>
* tor-proto: Remove dependency on tor-netdir.Gabriela Moldovan2025-01-152-41/+6
| | | | | | | | This moves the `NetParameters -> KistParams` conversion to `tor-chanmgr`. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2706#note_3147557
* tor-proto: Replace constants with caret_int.Gabriela Moldovan2025-01-152-3/+15
|
* tor-rtcompat: Rename UnsupportedStreamOps to NoOpStreamOpsHandle (fmt).Gabriela Moldovan2025-01-151-1/+1
|
* tor-rtcompat: Rename UnsupportedStreamOps to NoOpStreamOpsHandle.Gabriela Moldovan2025-01-151-2/+2
| | | | | This renames UnsupportedStreamOpsHandle to NoOpStreamOpsHandle for clarity (the old name kind of sounded like the name of an error type).
* tor-proto: Set kist params in channel reactor.Gabriela Moldovan2025-01-152-2/+33
|
* tor-proto: Add Channel::reparameterize_kist() API.Gabriela Moldovan2025-01-151-0/+9
| | | | | This will enable us to update the channel's KIST configuration whenever there is a change in the consensus or config.
* tor-proto: Add CtrlMsg for setting kist options (fmt).Gabriela Moldovan2025-01-151-1/+3
|
* tor-proto: Add CtrlMsg for setting kist options.Gabriela Moldovan2025-01-151-1/+8
|
* tor-proto: Pass a StreamOps handle to the channel reactor.Gabriela Moldovan2025-01-153-2/+16
|
* tor-rtcompat: Big invasive change adding StreamOps bound everywhere.Gabriela Moldovan2025-01-154-13/+23
| | | | | | This is unfortunately necessary, because after the channel handshake, we need to give the channel reactor a `StreamOps` handle to the underlying stream.
* tor-rtcompat: Add the ability to get a StreamOps handle.Gabriela Moldovan2025-01-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Needed for cases where we wrap an object that implements `StreamOps` in an external type, thereby losing access to the `StreamOps` functionality. For example, during the channel handshake, we `.split()` the stream that implements `StreamOps`, which leaves us with a `SplitSink` and a `SplitStream`, neither of which implement `StreamOps`. Getting a handle to the underlying object that implements `StreamOps` (for example, a file handle) *before* the stream is `.split()` enables us to use `StreamOps` to manipulate the underlying split stream. This commit also introduces a special `UnsupportedStreamOpsHandle`, which is a type that implements `StreamOps`, but always returns an error. This type is meant to simplify error handling and usage, and is meant to be used in cases where `StreamOps` is not supported. TODO: the name of this type is pretty confusing (it's very similar to `UnsupportedStreamOp`, which is an error type), and should probably be renamed to something else (`NoOpStreamOpsHandle`, `BrokenStreamOpsHandle`, `DummyStreamOpsHandle` come to mind...). Note: this changes the `StreamOps` trait to be slightly different from what I originally envisioned in !2660 and #1769
* tor-proto: Add KistParams type built from NetParameters.Gabriela Moldovan2025-01-153-0/+63
| | | | | | | | Note: this commit makes `tor-proto` depend on `tor-netdir` (because it adds a `KistParams` type that is buildable from `NetParameters`, which is defined in `tor-netdir`). Closes #1729
* tor-proto: Add traced_test to test casesIan Jackson2025-01-152-0/+22
| | | | (We don't add it to the handful of unit tests that don't use an executor.)
* tor-proto: fix bad indentationSteven Engler2025-01-091-3/+3
|
* tor-proto: test `Channel::wait_for_close`Steven Engler2025-01-091-5/+35
|
* tor-proto: make `Channel::wait_for_close` non-experimentalSteven Engler2025-01-091-1/+0
|
* tor-proto: `Channel::wait_for_close` return success statusSteven Engler2025-01-092-14/+42
| | | | | | This had a TODO about returning a "status indication instead of just ()" so this commit adds some status indication that we can expand later if needed.
* Bump versions of internal arti crates for Arti 1.3.2Nick Mathewson2025-01-071-18/+18
| | | | | | | | | | | | | The affected crates follow our regular versioning. They all get bumped to 0.26.0. Done with ``` for crate in $(./maint/list_crates |grep '^arti-\|tor-' ); do cargo set-version --bump minor -p $crate; done ```
* Merge branch 'mod-module-files' into 'main'Nick Mathewson2025-01-071-0/+1
|\ | | | | | | | | clippy: deny `mod_module_files` See merge request tpo/core/arti!2689
| * clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | | | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* | fix: fix typosDimitris Apostolou2025-01-061-1/+1
|/
* Merge branch 'upgrades' into 'main'Nick Mathewson2025-01-061-2/+2
|\ | | | | | | | | Simple dependency upgrades for upcoming release See merge request tpo/core/arti!2685
| * Upgrade to statrs 0.18.0Nick Mathewson2025-01-061-1/+1
| |
| * Upgrade to itertools 0.14.0Nick Mathewson2025-01-061-1/+1
| |
* | Run "fixup-features" in preparation for release.Nick Mathewson2025-01-061-1/+1
|/
* tor-proto: replaced error type of `Sender::send_and_wake`Steven Engler2024-12-101-6/+10
|
* tor-proto: add some (disabled) doc testsSteven Engler2024-12-101-0/+27
|