summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* tor-circmgr: Explicit type annotationClara Engler2025-03-261-1/+1
| | | | | | | This commit adds an explicit type annotation to the learning_timeouts() function, as leaving it out yielded an error while trying to compile tor-circmgr in a project that had this crate deep down in its supply chain.
* circmgr: test behavior of IteratorRandom::choose_multipleNick Mathewson2025-03-251-1/+15
|
* Merge branch 'named_protovers' into 'main'David Goulet2025-03-201-7/+7
|\ | | | | | | | | | | | | protover: Add support for subprotocol version mnemonics. Closes #1891 See merge request tpo/core/arti!2854
| * Use named subprotocol versions throughout arti.Nick Mathewson2025-03-121-7/+7
| |
* | Merge branch 'timeout_est_overflow' into 'main'Nick Mathewson2025-03-191-3/+11
|\ \ | | | | | | | | | | | | | | | | | | Impose a maximum on our fallback estimated timeout Closes #1693 See merge request tpo/core/arti!2842
| * | Impose a maximum on our fallback estimated timeoutNick Mathewson2025-03-061-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fallback timeout is the one that we use when we have insufficient data. We reset our observations, and maybe rebuild our circuits, when we find that too many circuits have failed recently. When we do so, we double our fallback timeout. Previously we had no limit, which could lead to overflow (#1693). In this commit we impose a maximum of 2 hours, which is ridiculously high. (C tor uses a maximum of INT32_MAX seconds, which is even more ridiculously high.) Closes #1693.
* | | squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | | | | | | | | | - Several methods have been moved out of SliceRandom.
* | | squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-185-8/+8
| |/ |/| | | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* | tor-rtmock: allow-Decorate every use of MockSleepProviderIan Jackson2025-03-062-1/+19
|/ | | | | | | 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.
* relay-selection: Add FamilyRules to exclude_relays_in_same_family.Nick Mathewson2025-02-252-12/+22
| | | | | | | | | | | | When we're trying to exclude relays by family, we need to know which lists to look at. This information ultimately comes from the network parameters. We could avoid this change if we just told clients "look at all family information all the time", but that's not what the proposal says. This is a breaking change.
* 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]>
* Add missing semver.md filesDavid Goulet2025-01-161-0/+2
| | | | | | Both in tor-proto and tor-circmgr. Signed-off-by: David Goulet <[email protected]>
* circmgr: Remove the CircParameters build .expect()David Goulet2025-01-164-53/+26
| | | | | | 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-164-64/+102
| | | | | | | | | | | | | | | 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]>
* 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-164-27/+128
| | | | | | | | | | | | | | 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]>
* tor-circmgr: Add trace log on circuit build timeout.Wesley Aptekar-Cassels2025-01-081-0/+2
| | | | This may help debugging #1792.
* 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
* Resolve clippy::empty_line_after_doc_comments warnings.Nick Mathewson2024-12-031-1/+2
| | | | These are new in Rust 1.83.
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* tor-circmgr: Clarify that using guarded for client rend is an exception.Gabriela Moldovan2024-10-241-1/+14
|
* tor-circmgr: Rename Short/Extended to Naive/Guarded.Gabriela Moldovan2024-10-244-32/+32
|
* tor-circmgr: Try to clarify what a "circuit stem" is.Gabriela Moldovan2024-10-241-2/+3
|
* tor-circmgr: Post-renaming documentation fixes.Gabriela Moldovan2024-10-244-14/+14
|
* tor-circmgr: s/stub/stem throughout.Gabriela Moldovan2024-10-244-100/+100
|
* tor-circmgr: s/HsCircStubKind/HsCircStemKind.Gabriela Moldovan2024-10-242-27/+27
| | | | As per #1479
* tor-circmgr: s/HsCircStubKind/HsCircStemKind.Gabriela Moldovan2024-10-245-60/+60
| | | | As per #1479
* tor-circmgr: Use the new vanguards terminology throughout.Gabriela Moldovan2024-10-243-75/+75
| | | | | | | | This is the first step towards clarifying the questions from !2230. Corresponding torspec changes: https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/282 Part of #1479
* Disable a lot of dead code warningsIan Jackson2024-10-171-0/+3
| | | | | | | Now cargo check --workspace --no-default-features --all-targets cargo build -p arti --no-default-features --features=memquota,tokio,native-tls are both clean.
* Merge branch 'mq-prevent' into 'main'Ian Jackson2024-10-151-1/+6
|\ | | | | | | | | | | | | Use clippy to prevent non-mq use of mpsc::channel Closes #1659 See merge request tpo/core/arti!2536
| * Introduce mpsc_channel_no_memquota and use it in the places it's wantedIan Jackson2024-10-151-1/+6
| | | | | | | | | | These are the call sites where using this fucntion is correct. (Outside tor-rtmock, which we'll do separately.)
* | memquota: Change ToplevelAccount to be an alias for Arc<MemoryQuotaTracker>Ian Jackson2024-10-152-2/+4
|/ | | | Fixes a TODO.
* Merge branch 'circmgr-code-motion-for-tests' into 'main'Ian Jackson2024-10-081-193/+193
|\ | | | | | | | | Circmgr code motion for tests See merge request tpo/core/arti!2513
| * CircMgr: Move note_external_{failure, success} methods to generic impl.Wesley Aptekar-Cassels2024-10-031-27/+27
| |
| * CircMgr: Move get_or_launch_dir_specific method to generic impl.Wesley Aptekar-Cassels2024-10-031-18/+18
| |
| * CircMgr: Move get_or_launch_exit method to generic impl.Wesley Aptekar-Cassels2024-10-031-45/+45
| |
| * CircMgr: Move get_or_launch_dir method to generic impl.Wesley Aptekar-Cassels2024-10-031-8/+8
| |
| * CircMgr: Move skew_events method to generic impl.Wesley Aptekar-Cassels2024-10-031-11/+11
| |
| * CircMgr: Move retire_circ method to generic impl.Wesley Aptekar-Cassels2024-10-031-6/+6
| |
| * CircMgr: Move reconfigure method to generic impl.Wesley Aptekar-Cassels2024-10-031-67/+67
| |
| * CircMgr: Move retire_all_circuits method to generic impl.Wesley Aptekar-Cassels2024-10-031-11/+11
| |
* | memquota: Add a toplevel account in tor-chanmgrIan Jackson2024-10-032-0/+4
|/ | | | | | | | | 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.
* Merge branch 'div_ceil' into 'main'Nick Mathewson2024-10-031-14/+1
|\ | | | | | | | | Use {u64,usize}::div_ceil See merge request tpo/core/arti!2473
| * Use {u64,usize}::div_ceilNick Mathewson2024-09-301-14/+1
| | | | | | | | | | Previously we had to avoid it, but now that our MSRV is above 1.73 we can use it with abandon.
* | CircMgr: Start writing tests.Wesley Aptekar-Cassels2024-10-037-289/+421
|/
* Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-251-2/+2
| | | | | | The `derive_more` crate broke backward compatibility with this version, so this change involved quite a few manual fixups. With luck, they'll keep compatibility for some while in the future.
* CircMgr: Make CircMgr and HsCircPool generic over builder type.Wesley Aptekar-Cassels2024-09-246-446/+852
| | | | | | | | | | This will allow for testing, as the CircuitBuilder can be replaced with a mocked version. This did require moving some of what was in the CircuitBuilder impl into the AbstractCircuitBuilder type, since Drop implementations can't be specialized, but that's fine, as we'll probably be doing more of that in the future anyways.
* Add test for CircList::find_open.Wesley Aptekar-Cassels2024-09-161-1/+55
| | | | | | | This tests that when requesting preemptive circuits, they are not given out when a insufficient number of circuits are in the CircList, but that they are given out once the required number of circuits has been reached.