aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/build.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* congestion: Make the cc_alg values a caret_int for better code semanticDavid Goulet2025-01-161-4/+4
| | | | Signed-off-by: David Goulet <[email protected]>
* circmgr: Modify CircParameters for congestion controlDavid Goulet2025-01-161-9/+108
| | | | | | | | | | | | | | 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]>
* memquota: Change ToplevelAccount to be an alias for Arc<MemoryQuotaTracker>Ian Jackson2024-10-151-1/+2
| | | | Fixes a TODO.
* memquota: Add a toplevel account in tor-chanmgrIan Jackson2024-10-031-0/+2
| | | | | | | | | Plumb through a top-level account. This doesn't have any channel-specific, circuit-specific or stream-specific accounts yet. tor-circmgr's and tor-hsclient's *tests* need fake account. In arti-relay, use a dummy account for now.
* CircMgr: Start writing tests.Wesley Aptekar-Cassels2024-10-031-0/+1
|
* extract tor_async_utils::oneshot into ::oneshot-fused-workaroundJim Newsome2024-08-281-1/+1
| | | | | | | | | | | | | | Having this in the `tor-async-utils` crate prevents us from doing both of the following without introducing a circular dependency: * using it in `tor-rtmock` (which we currently do, particularly in tests). * using `tor-rtmock` to test things in `tor-async-utils`. We don't do this yet, but it is generally sensible to do so. In particular we want to move the `stream_peak` module there, which is currently tested with `tor-rtmock`. Moving this into its own crate avoids this circular dependency.
* tor-circmgr: Remove no-longer-needed dead_code allow.Gabriela Moldovan2024-04-291-1/+0
|
* tor-circmgr: Call VanguardMgr::launch_background_tasks.Gabriela Moldovan2024-04-051-1/+1
|
* tor-guardmgr: Give VanguardMgr a handle to the runtime.Gabriela Moldovan2024-04-051-3/+3
|
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* tor-circmgr: Give CircMgr a VanguardMgr.Gabriela Moldovan2024-03-111-0/+17
| | | | Closes #1277
* tor-circmgr: Add UniqId to Error::Protocol.Gabriela Moldovan2024-02-271-0/+6
| | | | Part of #1297
* tor-circmgr: Add UniqId to CircTimeout.Gabriela Moldovan2024-02-271-7/+9
| | | | Part of #1297
* circmgr:Resolve a warning when building without ntor-v3Nick Mathewson2023-12-131-2/+3
|
* Fix a clippy lintIan Jackson2023-12-121-1/+1
| | | | | | | | | | warning: consider adding a `;` to the last statement for consistent formatting --> crates/tor-circmgr/src/build.rs:162:13 | 162 | handshake_res = circ.create_firsthop_ntor(ct, params).await | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `handshake_res = circ.create_firsthop_ntor(ct, params).await;` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
* ClientCir: use ntor_v3 handshake when target supports itJim Newsome2023-12-071-18/+50
|
* tor-circmgr: panic instead in order to return ErrorSaksham Mittal2023-11-211-1/+1
|
* tor-circmgr: port run_builder_test() to use spawn_join()Saksham Mittal2023-11-211-10/+4
|
* tor-circmgr: partially port test_double_timeout() to MockRuntimeSaksham Mittal2023-11-141-6/+3
| | | | | | | | The tests still use MockSleepRuntime for the more complicated tests where we forcefully make one or both futures time out, but MockSleepRuntime wraps a MockRuntime instead of using test_with_all_runtimes!(), so the tests should be more deterministic
* tor-circmgr: fix build_*_timeout() for MockRuntime portSaksham Mittal2023-11-141-8/+5
| | | | | The funky thing was getting rid of the Canceled error from the channel and returning the actual error from build_owned() properly
* tor-circmgr: have FakeCirc derive DebugSaksham Mittal2023-11-111-5/+2
|
* tor-circmgr: Port some build_* tests to MockRuntimeSaksham Mittal2023-11-111-15/+27
| | | | build_modest_timeout() and build_huge_timeout() don't pass yet
* Fix out of date commenthalcyon2023-10-201-2/+1
|
* oneshot: Apply deferred rustfmt churnIan Jackson2023-10-111-1/+1
| | | | cargo fmt, precisely.
* oneshot: Use veneer in tor-circmgrIan Jackson2023-10-111-2/+1
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* circmgr: Use event_report!() and similar macrosNick Mathewson2023-07-071-3/+2
| | | | This simplifies our logging a little, and implements part of
* tor-circmgr: Expose CircParameters from NetParameters constructionIan Jackson2023-06-291-0/+13
| | | | | | | | As per #935. I called this "circparameters_from_netparameters" not "circparameters_from_netparams" because the type is "NetParameters" not "NetParams".
* circmgr: New API to expose estimate-based timeouts.Nick Mathewson2023-06-221-2/+0
| | | | | This will help create good timeout values for various onion-service operations.
* Refactor ClientCirc APIs to use Arc<ClientCirc>.Nick Mathewson2023-05-161-12/+12
| | | | | | | | | | | | Now ClientCirc is no longer `Clone`, and the things that need it to be `Clone` instead return and use an Arc<ClientCirc> We're doing this so that ClientCirc can participate in the RPC system, and so that its semantics are more obvious. Closes #846. Thanks to the type system, this was a much simpler refactoring than I had feared it would be.
* circmgr: Mark a number of internal APIs as hs-only.Nick Mathewson2023-04-061-0/+2
| | | | | | This resolves a few dead-code warnings. Closes #801.
* circmgr: Begin an HS circuit pool structureNick Mathewson2023-03-221-0/+10
| | | | | This is now enough to launch circuits on demand. It still needs to pre-build the first three hops, and to retry on failure.
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+8
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* tor-cirmgr: Replace OwnedChanTarget with LoggedChanTarget in errorsIan Jackson2022-11-231-4/+4
| | | | | | | | | This 1. Makes the errors smaller 2. Redacts (currently, scrubs) the chantarget when safe logging is enabled The other error variants in tor-circmgr::Error don't seem to contain information that should become sensitive as part of bridge support.
* tor-linkspec: Remove the old OwnedFoo::new() functionsNick Mathewson2022-10-061-2/+15
| | | | These are now builders.
* channel usage: Rename CU::UserTraffic from CU::ExitIan Jackson2022-08-171-4/+4
| | | | | As suggested in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2827246
* Move ChannelUsage from tor_proto to tor_chanmgrIan Jackson2022-08-171-4/+3
| | | | | | | | | | | Replace Channel::note_usage with Channel::engage_padding_activities, which unconditionally causes the channel to (start to) do netflow padding things. The condition now lives in chanmgr. Addresses https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826094
* chanmgr: Use NetDirProvider::params and Arc<dyn..Netparameters>Ian Jackson2022-08-171-0/+1
| | | | | | | | | This gets rid of many Result(). Many parameters are renamed. Test cases of the now-impossible branch are removed. Deleting the match from padding_parameters will come in a moment. I've split off that commit since it has much whitespace noise. for now, change the error type to Void.
* Introduce ChannelConfigIan Jackson2022-08-161-1/+6
| | | | | This commit is just the necessary plumbing. The config is currently empty. We'll add something to it, for padding control, later.
* Provide ChannelUsage and plumb it all the way downIan Jackson2022-08-161-12/+43
| | | | | | | | | | | | | Channel padding depends on what the channel is being used for. We therefore need to let the channel code know this information. The implementation of the per-channel padding control logic will be in the new note_usage function, which for now is simply a stub. A future commit will introduce a `PaddingControlState` which lives in the channel frontend; consult the doc comment for that type to see why the plumbing through the channel manager terminates in the channel frontend.
* dormancy: Plumb through to chanmgr reconfigure_generalIan Jackson2022-08-161-1/+1
| | | | | | | | | | | | | | | The chanmgr remembers the last dormancy state it was told. We invent a chanmgr-specific Dormancy which the arti-client code knows how to convert from the richer top-level dormant status. This avoids having to have everyone know all the variants of the top-level state. To call reconfigure_general, we must also obtain and plumb through a netdir. Right now we must return an internal error if there is in fact no netdir, because reconfigure_general does not yet cope with a missing netdir. Nothing actually *uses* the dormancy yet.
* Use accessors in two places where tests look at specific keys.Nick Mathewson2022-08-101-7/+17
| | | | | | (It's safe to require these specific keys, since we constructed the objects for testing, and we know for certain that they contain given keys.)
* Introduce HasRelayIds::same_relay_ids.Nick Mathewson2022-08-021-7/+11
| | | | | This method tells if two HasRelayIds contain exactly the same set of Relay identities, and is generally useful for debugging.
* tor-linkspec: Refactor out traits to represent a relay's ID set.Nick Mathewson2022-08-021-0/+1
| | | | | | | | | | | | | | We want the set of identities supported by a relay to be extensible in the future with minimal fuss; we'd also like to make working with these ID sets more convenient. To handle that, this commit adds a new trait for "Something that has the same IDs as a relay" and a new object for "an owned representation of a relay's IDs." This commit introduces a similar trait for "Something with a list of SocketAddr, like a relay has." There's no owned equivelent for that, since Vec<SocketAddr> is already a thing. Closes #428.
* tor-circmgr: Clarify and improve Protocol error.Nick Mathewson2022-07-121-0/+4
|
* squash! Bump every crate's edition to 2021.Nick Mathewson2022-04-251-1/+0
| | | | | Remove all `use` statements for `TryFrom` and `TryInto`. These are now redundant in Rust 2021.
* Create and use API to report guard/fallback skew.Nick Mathewson2022-04-071-12/+39
| | | | (The information is not yet recorded.)
* ChanMgr: Return provenance information from get_or_launchNick Mathewson2022-04-071-7/+8
| | | | | | We need this since we want to report certain conditions only when they happen on a new channel, not if we observe them on a preexisting channel.