summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/hspool
Commit message (Collapse)AuthorAgeFilesLines
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | 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.
* circmgr: Major rename for the new Tunnel namespaceDavid Goulet2025-08-051-4/+4
| | | | | | | | | | | | The CircMgr will no longer yield circuits but tunnels (src/tunnel.rs). This is a first step to rename most circuit related objects to use "tunnel" instead. Some "circuit" names have been kept for more precise definitions. No behavior changes. Signed-off-by: David Goulet <[email protected]>
* tor-circmgr: Rename Short/Extended to Naive/Guarded.Gabriela Moldovan2024-10-241-4/+4
|
* tor-circmgr: s/stub/stem throughout.Gabriela Moldovan2024-10-241-39/+39
|
* tor-circmgr: s/HsCircStubKind/HsCircStemKind.Gabriela Moldovan2024-10-241-6/+6
| | | | As per #1479
* tor-circmgr: s/HsCircStubKind/HsCircStemKind.Gabriela Moldovan2024-10-241-12/+12
| | | | As per #1479
* tor-circmgr: Use the new vanguards terminology throughout.Gabriela Moldovan2024-10-241-40/+40
| | | | | | | | 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
* CircMgr: Make CircMgr and HsCircPool generic over builder type.Wesley Aptekar-Cassels2024-09-241-9/+12
| | | | | | | | | | 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.
* tor-circmgr: Make retire_all_circuits unconditional.Gabi Moldovan2024-06-031-1/+0
| | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2168?commit_id=3c67fa55c7c5b0c4f30c1d57e8e67fe541d9c99e#note_3033368
* tor-circmgr: Remove VanguardMode from Pool (fmt).Gabriela Moldovan2024-06-031-3/+1
|
* tor-circmgr: Remove VanguardMode from Pool.Gabriela Moldovan2024-06-031-25/+5
| | | | | | | | | Storing the VanguardMode in multiple places (in the VanguardMgr *and* the HS circ Pool) is dangerous and can lead to split brain situations where different parts of the code think they are running in different VanguardModes. See #1424
* tor-circmgr: Remove dangerous vanguards_enabled() function.Gabriela Moldovan2024-06-031-5/+0
| | | | | | | `VanguardMgr` should be the source of truth for obtaining the current `VanguardMode`. Closes #1424
* tor-guardmgr: Replace From impl with VanguardConfig::mode accessor.Gabriela Moldovan2024-06-031-1/+1
|
* tor-guardmgr: Use ExplicitOrAuto in the VanguardConfigGabriela Moldovan2024-06-031-1/+1
|
* tor-guardmgr: Unconditionally define VanguardConfig.Gabriela Moldovan2024-06-032-2/+2
| | | | | | | | | We want to export the `VanguardConfig` even if the `vanguards` feature is disabled (we will need to unconditionally include it in the arti config). Note that if `vanguards` are disabled, the `VanguardMode` from the `VanguardConfig` can only be `Dsiabled`.
* tor-circmgr: Replace STUB/STUB+ terminology with SHORT/EXTENDED (fmt).Gabriela Moldovan2024-05-161-1/+3
|
* tor-circmgr: Replace STUB/STUB+ terminology with SHORT/EXTENDED.Gabriela Moldovan2024-05-161-21/+21
| | | | | | | The previous STUB/STUB+ terminology was confusing, because STUB and STUB+ are both "circuit stubs" (but STUB is shorter than STUB+). Closes #1339
* tor-circmgr: Rename HsCircStubKind::Stub to HsCircStubKind::Short.Gabriela Moldovan2024-05-161-2/+2
| | | | Part of #1339
* tor-circmgr: Downgrade some TODO HS-VANGUARDs.Gabriela Moldovan2024-05-091-1/+1
|
* tor-circmgr: Prefer STUB+ where possible.Gabriela Moldovan2024-04-291-4/+35
| | | | Closes #1385
* tor-circmgr: Have separate targets for the STUB and STUB+ pools (fmt).Gabriela Moldovan2024-04-291-3/+3
|
* tor-circmgr: Have separate targets for the STUB and STUB+ pools.Gabriela Moldovan2024-04-291-32/+46
| | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2102#note_3024366
* tor-circmgr: Expand on the ForLaunch docs.Nick Mathewson2024-04-291-1/+2
|
* tor-circmgr: Log the kinds of circuits we're about to launch.Gabriela Moldovan2024-04-291-0/+10
|
* tor-circmgr: Make a fraction of preemptive HS circuits be STUB+.Gabriela Moldovan2024-04-291-4/+103
| | | | Closes #1353
* tor-circmgr: Remove unnecessary Result wrapping.Gabriela Moldovan2024-03-201-3/+2
|
* tor-circmgr: Unconditionally define VanguardMode.Gabriela Moldovan2024-03-201-15/+5
|
* tor-circmgr: Add functions for checking if vanguards are enabled.Gabriela Moldovan2024-03-201-0/+16
|
* tor-circmgr: For each HS ClientCirc, note whether it's STUB or STUB+.Gabriela Moldovan2024-03-201-10/+7
| | | | Closes #1276
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* tor-circmgr: Add HsCircPoolConfig, make HsCircPool::reconfigure general-purpose.Gabriela Moldovan2024-03-111-0/+25
|
* tor-circmgr: Rename Pool::reconfigure to Pool::reconfigure_vanguards.Gabriela Moldovan2024-03-111-1/+1
|
* tor-circmgr: Add functions for reconfiguring the HS circuit pool.Gabriela Moldovan2024-03-111-1/+24
| | | | | If the vanguard "mode" (full/lite/disabled) changes, we purge all the circuits from the HS circuit pool because they are no longer suitable.
* tor-circmgr: Store the VanguardMode in HsCircPool.Gabriela Moldovan2024-03-111-0/+11
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Merge branch 'clippy-allow' into 'main'Ian Jackson2023-07-111-0/+1
|\ | | | | | | | | clippy: Allow some of our existing code patterns See merge request tpo/core/arti!1396
| * Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
| |
* | rng ranges: Use gen_range_checked().expect() in obvious cases (fmt)Ian Jackson2023-07-101-1/+2
| |
* | rng ranges: Use gen_range_checked().expect() in obvious casesIan Jackson2023-07-101-1/+3
|/ | | | In each of these, it is locally obvious that the range is nonempty.
* random_idx_where: Ensure uniform distribution of choiceJim Newsome2023-06-231-22/+32
| | | | | Previously, this was more likely to select elements that occurred after other elements that didn't satisfy the predicate.
* Add more tests for random_idx_whereJim Newsome2023-06-231-0/+10
|
* tor-circmgr: Test random_idx_where with empty sliceIan Jackson2023-06-231-0/+7
| | | | | I have verified that this test fails, as expected, when applied without the corresponding bugfix.
* tor-circmgr: random_idx_where: Don't panic on empty rangeIan Jackson2023-06-231-0/+3
| | | | Fixes #918.
* Typo fixesgabi-2502023-06-201-2/+2
|
* circmgr: Use a slightly nicer way to pick a circuit from our pool.Nick Mathewson2023-06-161-13/+58
| | | | | | | | This algorithm only looks at circuits until it finds one that satisfies our needs. To get a random circuit, it just randomizes the starting point within the pool. This optimization may help if we let circuit pools grow large.
* circmgr: Make hspool size dynamicNick Mathewson2023-06-161-9/+98
| | | | | | | | | | | | | | Previously we'd always try to keep 8 circuits ready. That doesn't make sense if we are super-busy. Instead, if we run out of circuits, we double the amount that we try to keep ready, and if we never go under 80% of our target number, we half the number we try to keep ready. We limit the rate of change here, to make sure that we aren't flapping too much or shrinking too aggressively. This algorithm is still a mite arbitrary, and will need tuning in the future.
* circmgr::hspool: Move the Mutex into an intermediary Inner structNick Mathewson2023-06-161-11/+11
| | | | This will be helpful as we complexify the pool behavior a bit.
* Refactor ClientCirc APIs to use Arc<ClientCirc>.Nick Mathewson2023-05-161-6/+6
| | | | | | | | | | | | 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: Add an actual pool to HsCircPool.Nick Mathewson2023-03-221-0/+52
We now have support for a pool of pre-build circuits that we can use for HS-related purposes, and we take circuits from this pool as needed. Nothing populates or cleans the circuit pool yet.