summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr
Commit message (Collapse)AuthorAgeFilesLines
* Bump patchlevel versions on crates with smaller changesNick Mathewson2023-06-301-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Done with the commands below. The following crates have had various changes, and should get a patchlevel bump. Since they are pre-1.0, we do not need to distinguish new APIs from other changes. ``` cargo set-version --bump patch -p arti-client cargo set-version --bump patch -p safelog cargo set-version --bump patch -p tor-bytes cargo set-version --bump patch -p tor-cert cargo set-version --bump patch -p tor-circmgr cargo set-version --bump patch -p tor-config cargo set-version --bump patch -p tor-consdiff cargo set-version --bump patch -p tor-dirclient cargo set-version --bump patch -p tor-dirmgr cargo set-version --bump patch -p tor-error cargo set-version --bump patch -p tor-hsservice cargo set-version --bump patch -p tor-linkspec cargo set-version --bump patch -p tor-llcrypto cargo set-version --bump patch -p tor-netdir cargo set-version --bump patch -p tor-netdoc cargo set-version --bump patch -p tor-proto cargo set-version --bump patch -p tor-rpcbase cargo set-version --bump patch -p tor-socksproto ``` This crate has new features, but no new non-experimental Rust APIs. So even though it is post-1.0, it gets a patchlevel bump. ``` cargo set-version --bump patch -p arti ```
* Bump minor versions on crates with breaking changesNick Mathewson2023-06-301-1/+1
| | | | | | | | | | Done with: ``` cargo set-version --bump minor -p tor-hsclient cargo set-version --bump minor -p arti-rpcserver cargo set-version --bump minor -p tor-hscrypto cargo set-version --bump minor -p tor-cell ```
* Merge branch 'stabilize-hs-client' into 'main'Nick Mathewson2023-06-291-2/+3
|\ | | | | | | | | | | | | Mark all {hs,onion-serivce}-client features as non-experimental. Closes #896 See merge request tpo/core/arti!1347
| * Mark all {hs,onion-serivce}-client features as non-experimental.Nick Mathewson2023-06-291-2/+3
| |
* | tor-circmgr: Provide estimate_timeout as a method on HsCircPoolIan Jackson2023-06-291-1/+21
|/
* Merge branch 'circparams' into 'main'Ian Jackson2023-06-292-15/+18
|\ | | | | | | | | | | | | tor-hsclient: Use proper CircParameters Closes #935 See merge request tpo/core/arti!1340
| * tor-circmgr: Expose CircParameters from NetParameters constructionIan Jackson2023-06-292-15/+18
| | | | | | | | | | | | | | | | As per #935. I called this "circparameters_from_netparameters" not "circparameters_from_netparams" because the type is "NetParameters" not "NetParams".
* | circmgr: Refactor duplicate logic.Nick Mathewson2023-06-281-27/+21
| | | | | | | | | | These two functions are only slightly different, and benefit from taking a Fn.
* | circmgr: Remove a "TODO HS" about path restrictions.Nick Mathewson2023-06-281-3/+0
| | | | | | | | | | I looked through the C tor source code and couldn't find any additional path restrictions.
* | circmgr: Defer two "TODO HS" in hspoolNick Mathewson2023-06-281-2/+2
|/ | | | One of these is test-related; one is vanguards-related.
* HS configuration: Add retry parameters to configurationIan Jackson2023-06-282-0/+37
| | | | | | | I think these should go in `[circuit_timing]`. That section already has some retry parameters, so is not strictly *timing*. This is not honoured yet.
* Upgrade to itertools 0.11.0Nick Mathewson2023-06-261-1/+1
| | | | The breaking changes here do not seem to affect us.
* 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
|
* Merge branch 'idx' into 'main'Ian Jackson2023-06-231-0/+10
|\ | | | | | | | | | | | | tor-circmgr: Fix random_idx_where with empty slice Closes #918 See merge request tpo/core/arti!1296
| * 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.
* | Merge branch 'circmgr-timeout-est' into 'main'Nick Mathewson2023-06-224-7/+35
|\ \ | | | | | | | | | | | | circmgr: New API to expose estimate-based timeouts. See merge request tpo/core/arti!1281
| * | circmgr: Now that Action is public, clean it up a little.Nick Mathewson2023-06-221-3/+2
| | |
| * | circmgr: New API to expose estimate-based timeouts.Nick Mathewson2023-06-224-4/+33
| | | | | | | | | | | | | | | This will help create good timeout values for various onion-service operations.
* | | hspool: Use let-else pattern; our MSRV permits it.Nick Mathewson2023-06-221-6/+2
| | |
* | | circmgr: Use path_ref() instead of path().Nick Mathewson2023-06-221-24/+45
| |/ |/|
* | lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|/
* 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-162-28/+108
| | | | | | | | | | | | | | 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-162-35/+53
| | | | This will be helpful as we complexify the pool behavior a bit.
* circmgr: Remove TODOS about retrying.Nick Mathewson2023-06-161-5/+0
| | | | | | These functions' documentation already says that they don't retry, and hsclient appears to be where we are concentrating our retry efforts.
* cirmgr: remove a dead-code exception.Nick Mathewson2023-06-161-1/+0
|
* Upgrade async-trait requirement to 1.54Nick Mathewson2023-06-121-1/+1
| | | | | | | | We need the fix from [82d69902], which first appeared in async-trait version 1.54. (Technically we only need this fix in tor-hsclient, but we may as well update our minimal async-trait version everywhere.) [82d69902]: https://github.com/dtolnay/async-trait/commit/82d69902535f5cb7f5d9e1ea4168c64abd496389
* Remove semver.md files from 1.1.5Nick Mathewson2023-06-011-3/+0
|
* Bump crate versions in preparation for v1.1.5 release.Nick Mathewson2023-06-011-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generated with the following commands: ``` cargo set-version --bump minor -p tor-cell cargo set-version --bump minor -p tor-linkspec cargo set-version --bump minor -p tor-proto cargo set-version --bump minor -p tor-netdoc cargo set-version --bump minor -p tor-circmgr cargo set-version --bump patch -p tor-cert cargo set-version --bump patch -p tor-basic-utils cargo set-version --bump patch -p tor-rpcbase cargo set-version --bump patch -p tor-llcrypto cargo set-version --bump patch -p tor-hscrypto cargo set-version --bump patch -p tor-checkable cargo set-version --bump patch -p tor-async-utils cargo set-version --bump patch -p caret cargo set-version --bump patch -p fs-mistrust cargo set-version --bump patch -p safelog cargo set-version --bump patch -p retry-error cargo set-version --bump patch -p tor-error cargo set-version --bump patch -p tor-config cargo set-version --bump patch -p tor-events cargo set-version --bump patch -p tor-units cargo set-version --bump patch -p tor-rtcompat cargo set-version --bump patch -p tor-rtmock cargo set-version --bump patch -p tor-protover cargo set-version --bump patch -p tor-bytes cargo set-version --bump patch -p tor-socksproto cargo set-version --bump patch -p tor-consdiff cargo set-version --bump patch -p tor-netdir cargo set-version --bump patch -p tor-congestion cargo set-version --bump patch -p tor-persist cargo set-version --bump patch -p tor-chanmgr cargo set-version --bump patch -p tor-ptmgr cargo set-version --bump patch -p tor-guardmgr cargo set-version --bump patch -p tor-dirclient cargo set-version --bump patch -p tor-dirmgr cargo set-version --bump patch -p tor-hsclient cargo set-version --bump patch -p tor-hsservice cargo set-version --bump patch -p arti-client cargo set-version --bump patch -p arti-rpcserver cargo set-version --bump patch -p arti-config cargo set-version --bump patch -p arti-hyper cargo set-version --bump patch -p arti cargo set-version --bump patch -p arti-bench cargo set-version --bump patch -p arti-testing ```
* Merge branch 'info-to-warn' into 'main'gabi-2502023-05-171-5/+8
|\ | | | | | | | | | | | | Change log levels of messages from INFO to others Closes #854 See merge request tpo/core/arti!1172
| * Change log level to debug and warn for certain appropriate situationsSaksham Mittal2023-05-171-5/+8
| | | | | | | | | | | | This commit changes certain log messages to debug for recoverable errors and a warn if all such attempts fail, in order to not clutter up the info messages that end users get to see.
* | Refactor ClientCirc APIs to use Arc<ClientCirc>.Nick Mathewson2023-05-167-39/+40
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Revise all XXXXs from fixup-featuresNick Mathewson2023-05-151-4/+2
| |
* | Run fixup-features _with_ annotations.Nick Mathewson2023-05-151-0/+2
| | | | | | | | | | This litters our Cargo.toml files with "XXX" entries that we should fix.
* | Reformat Cargo.toml files.Nick Mathewson2023-05-151-14/+21
| |
* | Run fixup-features --no-annotate for initial Cargo.toml fixes.Nick Mathewson2023-05-151-4/+5
|/ | | | | | | | | This does the following: - Gives every crate a `full`. - Cause every `full` to depend on `full` from the lower-level crates. - Makes every feature listed _directly_ in `experimental` depend on `__is_experimental`.
* hspool: Accept any T:CircTarget.Nick Mathewson2023-05-102-9/+28
| | | | | | Previously, we only accepted an OwnedCircTarget, which would have kept us from getting a circuit that was aimed at a specialized CircTarget that gave us LinkSpecs in a raw order.
* Upgrade tracing to 0.1.36.Nick Mathewson2023-05-031-1/+1
| | | | | | This is the first version to impl Value for String. With luck, this will get minimal_versions CI passing.
* Increment crate versions.Nick Mathewson2023-05-031-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because of the errorkind bumps, we're calling this a breaking change in everything lower-level than `arti`. Generated with: ``` cargo set-version -p tor-basic-utils --bump minor cargo set-version -p tor-async-utils --bump minor cargo set-version -p caret --bump minor cargo set-version -p fs-mistrust --bump minor cargo set-version -p safelog --bump minor cargo set-version -p retry-error --bump minor cargo set-version -p tor-error --bump minor cargo set-version -p tor-config --bump minor cargo set-version -p tor-events --bump minor cargo set-version -p tor-units --bump minor cargo set-version -p tor-rtcompat --bump minor cargo set-version -p tor-rtmock --bump minor cargo set-version -p tor-rpcbase --bump minor cargo set-version -p tor-llcrypto --bump minor cargo set-version -p tor-protover --bump minor cargo set-version -p tor-bytes --bump minor cargo set-version -p tor-hscrypto --bump minor cargo set-version -p tor-socksproto --bump minor cargo set-version -p tor-checkable --bump minor cargo set-version -p tor-cert --bump minor cargo set-version -p tor-linkspec --bump minor cargo set-version -p tor-cell --bump minor cargo set-version -p tor-proto --bump minor cargo set-version -p tor-netdoc --bump minor cargo set-version -p tor-consdiff --bump minor cargo set-version -p tor-netdir --bump minor cargo set-version -p tor-congestion --bump minor cargo set-version -p tor-persist --bump minor cargo set-version -p tor-chanmgr --bump minor cargo set-version -p tor-ptmgr --bump minor cargo set-version -p tor-guardmgr --bump minor cargo set-version -p tor-circmgr --bump minor cargo set-version -p tor-dirclient --bump minor cargo set-version -p tor-dirmgr --bump minor cargo set-version -p tor-hsclient --bump minor cargo set-version -p tor-hsservice --bump minor cargo set-version -p arti-client --bump minor cargo set-version -p arti-rpcserver --bump minor cargo set-version -p arti-config --bump minor cargo set-version -p arti-hyper --bump minor cargo set-version -p arti --bump patch cargo set-version -p arti-bench --bump patch cargo set-version -p arti-testing --bump patch ```
* ExitPath: Add an explanation of WeightRole::Exit on non-exit circsNick Mathewson2023-04-121-0/+7
| | | | | | | | | In one case, we use WeightRole::Exit on circuits that can't actually be used to exit. This commit adds a comment to explain why, so that we don't wonder about it in the future, and we have some indication of whether it's still appropriate. Closes #785
* Increment MSRV to 1.65 in every crate.Nick Mathewson2023-04-111-1/+1
|
* circmgr: make "testing" depend on guardmgr/testingNick Mathewson2023-04-061-1/+1
|
* circmgr: Mark a number of internal APIs as hs-only.Nick Mathewson2023-04-063-0/+8
| | | | | | This resolves a few dead-code warnings. Closes #801.
* circmgr: Expand an incomplete comment in exitpath.rsNick Mathewson2023-04-061-2/+6
|
* tor-circmgr: HsCircKind: derive EqIan Jackson2023-04-051-1/+1
|
* Patchlevel bumps for crates whose dependencies just changed.Nick Mathewson2023-03-311-2/+2
| | | | | | | | | | | | | | | | These crates had no changes until just a moment ago. But since we updated the versions on some of their dependents, they have now changed themselves. Thus they get patchlevel bumps. ``` tor-rtmock tor-protover tor-socksproto tor-consdiff tor-chanmgr tor-dirclient tor-hsservice ```
* Bump crate versions that have breaking changesNick Mathewson2023-03-311-2/+2
| | | | | | | | | | These crates have had breaking changes. They are pre-1.0, so they get a minor bump. ``` tor-basic-utils tor-config ```