aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/build.rs
Commit message (Collapse)AuthorAgeFilesLines
* proto: Do not automatically disable CC with hsv3.Nick Mathewson2026-07-021-15/+12
| | | | | | | We _already_ do not include FLOWCTRL_CC as a listed protocol among the capabilities we provide, when we make a virtual hop. This branch will make that behavior even more certain, by not looking at required-client-protocols any longer.
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | 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.
* circmgr: simplify a loop counter.Nick Mathewson2026-04-211-3/+1
|
* circmgr: Port to web-time-compat.Nick Mathewson2026-03-261-1/+1
|
* relay: Add a TLS acceptor in the ChanBuilderDavid Goulet2026-02-091-7/+10
| | | | | | | | | | | | | | | This requires the `TlsKeyAndCert` so be passed on the TLS acceptor settings. We assume that `RelayIdentities` has this information. The ChanBuilder::new() was getting a bit too convoluted and feature gated to instead we introduce new_client() and new_relay() and remove the need for `with_identities()`. Because of this, the ChanMgr::new() now returns a `Result<>`. Related to #1597 Signed-off-by: David Goulet <[email protected]>
* test: Remove unused importDavid Goulet2026-01-131-1/+0
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Introduce a ChanMgrConfig structDavid Goulet2026-01-131-1/+1
| | | | | | | | | | | | This struct is used to pass configuration parameters to the ChanMgr when building it. At the moment, it holds the ChannelConfig and RelayIdentities (feature gated) which will be used in subsequent commits. Note that relays do require RelayIdentities to build channels. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Remove KeyMgr from constructorDavid Goulet2026-01-131-1/+0
| | | | | | | We'll rely on a RelayIdentities to pass in the right keys to the ChanMgr instead of the entire KeyMgr. Signed-off-by: David Goulet <[email protected]>
* tor-circmgr: small comment fixSteven Engler2025-12-031-1/+1
|
* tor-circmgr: reduce level of info reactor tracing msgSteven Engler2025-12-031-1/+1
| | | | | Since "info" is the default level, we don't want to log by default each time a circuit reactor is created.
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-241-0/+12
| | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* all: run cargo fmtSteven Engler2025-11-041-1/+1
|
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-041-1/+1
|
* Merge branch 'expire-halfstream-cbt' into 'main'gabi-2502025-09-241-12/+26
|\ | | | | | | | | | | | | proto: Remove half-streams when they expire. Closes #264 See merge request tpo/core/arti!3267
| * circmgr: Pass the timeout estimator to circuit constructor (fmt).Gabriela Moldovan2025-09-161-8/+13
| |
| * circmgr: Pass the timeout estimator to circuit constructor.Gabriela Moldovan2025-09-161-7/+16
| | | | | | | | | | This enables us to read the CBT estimates from the circuit reactor (we need these to compute the half-stream timeouts for #264).
* | tor-proto: use `CellCount` in `FlowCtrlParameters`Steven Engler2025-09-161-4/+4
|/
* tor-proto: add `FlowCtrlParameters` to `CircParameters` and `HopSettings`Steven Engler2025-09-111-1/+9
|
* proto: Add a circuit module shared between client and relay impls.Gabriela Moldovan2025-08-281-1/+1
| | | | | | | This is just code motion (I suggest reviewing with `--color-moved`). This also moves the implementation-agnostic parts from `tor_proto::client::circuit` to a new `tor_proto::circuit` module.
* chanmgr: Add KeyMgr to channel builderDavid Goulet2025-08-201-0/+1
| | | | | | | This is so a relay can build authenticated channels. Several keys/cert are required for this that are within the key manager. Signed-off-by: David Goulet <[email protected]>
* circmgr: Move the body of get_channel_to_guard into its only caller.Nick Mathewson2025-08-071-33/+23
|
* circmgr: Don't count channel negotiation towards circuit built time.Nick Mathewson2025-08-071-53/+68
| | | | | | | | | | This is important, since some circuits require us to negotiate a new channel, and some don't: by adding this variability, we can easily learn a timeout based on pre-existing channels to our guards, but then later time out if it takes a while to open a TLS connection. This is a possible solution to part of #2079, a bug where we "learn" a circuit timeout that is too low for us to satisfy.
* cirmgr: extract code that opens a channel.Nick Mathewson2025-08-071-14/+26
|
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-5/+5
| | | | | | | | | | | | | | 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.
* Merge branch 'use-cc' into 'main'Nick Mathewson2025-08-051-39/+24
|\ | | | | | | | | Use congestion control when "flowctl-cc" is enabled See merge request tpo/core/arti!3118
| * tor-proto: use congestion control when "flowctl-cc" is enabledSteven Engler2025-08-041-39/+24
| |
* | hs: Use the new Tunnel interface for onion serviceDavid Goulet2025-08-051-1/+1
| |
* | tunnel: Implement Buildable for ClientTunnelDavid Goulet2025-08-051-33/+39
| | | | | | | | | | | | | | | | | | | | | | | | In order to pull this off, the Arc requirement needs to go away because the Arc<ClientCirc> is now within the ClientTunnel. This commit also has a rename of the CircuitBuilder to TunnelBuilder in order to reflect the change that it now builds a ClientTunnel. There is a slight rename in tor-proto as well just for accuracy. Signed-off-by: David Goulet <[email protected]>
* | proto: Change PendingClientCirc to yield back a ClientTunnelDavid Goulet2025-08-051-3/+3
|/ | | | | | And rename it in the process to "PendingClientTunnel". Signed-off-by: David Goulet <[email protected]>
* proto: Refactor cc fallback.Nick Mathewson2025-06-101-9/+13
| | | | | The fallback CC algorithm is _always_ fixed-window, and we should only use it when the selected CC algorithm is not supported.
* Move responsibility for choosing extensions into tor-protoNick Mathewson2025-06-101-19/+3
| | | | | | | | | 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.
* proto: Provide and use a create_firsthop() wrapper too.Nick Mathewson2025-04-281-7/+2
|
* tor-proto: New extend() to pick between ntor and ntor3Nick Mathewson2025-04-281-6/+2
| | | | | | | | | In the future, when we add more circuit handshakes (PQ anyone?) we'll want to have the logic for choosing which to use be unified. Almost nobody calling tor-proto should need to care which circuit handshake is going to be used. Closes #1970.
* tor-circmgr: put vegas cc in `CircParameters` behind `if false`Steven Engler2025-04-231-22/+42
| | | | | This means that even with the "flowctl-cc" feature enabled, we shouldn't try to negotiate congestion control.
* tor-circmgr: only use congestion control if "flowctl-cc" feature is enabledSteven Engler2025-04-231-2/+5
|
* tor-circmgr: switch from `supports_{known,named}_subver()`Steven Engler2025-04-231-3/+3
|
* circ: Don't pin CC algorithm to FixedWindow anymoreDavid Goulet2025-04-231-4/+1
| | | | | | | | | | | Circuit handshake negotiation for congestion control has been added in previous commit so stop pinning the algorithm. This commit marks the start of congestion control usage by arti client. Closes #1817 Signed-off-by: David Goulet <[email protected]>
* circ: Apply possible subprotocol changes to circ paramsDavid Goulet2025-04-231-5/+20
| | | | | | | | | | | | | 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]>
* circ: Remove CircParameters reference in call stackDavid Goulet2025-04-231-13/+12
| | | | | | | | | | | This avoids cloning the object and instead allows us to have a CircParameters per hop on the circuit path. This will come handy with congestion control where each hop might have different congestion control parameters. Part of #1817 Signed-off-by: David Goulet <[email protected]>
* congestion: Setup a fallback algorithm in the paramsDavid Goulet2025-04-231-0/+1
| | | | | | | | | | | | | | | | 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]>
* tor-circmgr: clean up after "ntor_v3" feature flag removalSteven Engler2025-04-011-21/+13
|
* tor-circmgr: removed "ntor_v3" feature flagSteven Engler2025-04-011-11/+0
| | | | ntor v3 is now always enabled.
* Use named subprotocol versions throughout arti.Nick Mathewson2025-03-121-7/+7
|
* tor-rtmock: allow-Decorate every use of MockSleepProviderIan Jackson2025-03-061-0/+3
| | | | | | | MockSleepProvider and MockSleepRuntime have been declared deprecated by the docs for some time. We're about to mark them `#[deprecated]`. This commit has been split out for clarity of review.
* congestion: Don't use Vegas just yetDavid Goulet2025-01-161-1/+4
| | | | | | | | | | 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]>
* Make cargo clippy happyDavid Goulet2025-01-161-4/+4
| | | | Signed-off-by: David Goulet <[email protected]>
* circmgr: Remove the CircParameters build .expect()David Goulet2025-01-161-44/+19
| | | | | | Instead, return an error and make all call site handle it. Signed-off-by: David Goulet <[email protected]>
* circ: Specialize the circparams from netparams functionDavid Goulet2025-01-161-49/+82
| | | | | | | | | | | | | | | 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]>
* congestion: Remove Default from every parametersDavid Goulet2025-01-161-0/+2
| | | | | | | Important to enforce that every field is explicitely set so we avoid forgetting fields. Signed-off-by: David Goulet <[email protected]>