summaryrefslogtreecommitdiff
path: root/crates/tor-guardmgr
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Introduce HasRelayIds::same_relay_ids.Nick Mathewson2022-08-021-5/+3
| | | | | | | | | | | | | | | This method tells if two HasRelayIds contain exactly the same set of Relay identities, and is generally useful for debugging.
* | | guardmgr: Change APIs that used to take IDs.Nick Mathewson2022-08-022-14/+11
| | | | | | | | | | | | These are the other inspiration for #428.
* | | guardmgr: Replace IdPair with RelayIdsNick Mathewson2022-08-024-30/+31
| | | | | | | | | | | | I believe that this was the original motivation behind #428.
* | | tor-linkspec: Refactor out traits to represent a relay's ID set.Nick Mathewson2022-08-024-8/+20
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Now that versions have bumped, remove semver.md files.Nick Mathewson2022-08-011-1/+0
| |
* | Bump patch versions on crates that have new APIs.Nick Mathewson2022-08-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Do _not_ bump the dependency versions on crates that have had no changes since arti 0.0.5, since those crates do not depend on the new APIs. ``` cargo set-version -p tor-basic-utils --bump patch cargo set-version -p tor-llcrypto --bump patch git restore crates/tor-checkable git restore crates/tor-consdiff git restore crates/tor-rtmock ```
* | Bump minor version on crates with deps with breaking changes.Nick Mathewson2022-08-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This performs the transitive closure of the last operation: everything that depends on a crate with a breaking change gets the version which it depends on bumped. ``` cargo set-version -p tor-proto --bump minor cargo set-version -p tor-netdoc --bump minor cargo set-version -p arti-hyper --bump minor cargo set-version -p arti-bench --bump minor cargo set-version -p arti-testing --bump minor cargo set-version -p tor-config --bump minor ```
* | Bump minor versions on all crates that have had breaking changes.Nick Mathewson2022-08-011-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Done with these commands: ``` cargo set-version -p fs-mistrust --bump minor cargo set-version -p tor-bytes --bump minor cargo set-version -p tor-socksproto --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-netdir --bump minor cargo set-version -p tor-persist --bump minor cargo set-version -p tor-chanmgr --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 arti-client --bump minor cargo set-version -p arti --bump minor ```
* | fix runtime issues on iostrinity-1686a2022-07-301-4/+4
|/
* GuardMgr: Update to use new NetDirProvider API.Nick Mathewson2022-07-262-4/+4
|
* Note semver break in tor-guardmgr::Error.Nick Mathewson2022-07-071-0/+1
|
* Remove now-unused NoGuardsUsable case.Nick Mathewson2022-07-071-8/+2
|
* Improve message for failure to select a guard.Nick Mathewson2022-07-072-19/+48
| | | | This uses similar techniques to the commit I just did for Fallbacks.
* Add more information to failed-to-select fallback errors.Nick Mathewson2022-07-072-5/+22
| | | | Also re-order the filters to be a little more logical.
* GuardMgr: tweak an error message.Nick Mathewson2022-07-061-1/+1
|
* Remove semver.md files now that 0.5.0 is outNick Mathewson2022-06-241-2/+0
|
* Bump crate and dependency versions.Nick Mathewson2022-06-241-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These were done with the following commands: ``` cargo set-version -p tor-basic-utils --bump patch cargo set-version -p fs-mistrust --bump minor cargo set-version -p tor-error --bump patch cargo set-version -p tor-config --bump patch cargo set-version -p tor-units --bump patch cargo set-version -p tor-rtcompat --bump minor cargo set-version -p tor-llcrypto --bump patch cargo set-version -p tor-bytes --bump minor cargo set-version -p tor-socksproto --bump minor cargo set-version -p tor-cert --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 patch cargo set-version -p tor-netdir --bump minor cargo set-version -p tor-persist --bump patch cargo set-version -p tor-chanmgr --bump minor cargo set-version -p tor-guardmgr --bump minor cargo set-version -p tor-circmgr --bump patch cargo set-version -p tor-dirclient --bump patch cargo set-version -p tor-dirmgr --bump minor cargo set-version -p arti-client --bump patch cargo set-version -p arti --bump minor cargo set-version -p arti-bench --bump minor cargo set-version -p arti-testing --bump minor ```
* Merge branch 'clippy' into 'main'Ian Jackson2022-06-242-0/+11
|\ | | | | | | | | Fix clippy nightly again See merge request tpo/core/arti!603
| * clippy: Consolidate many lints in maint/add_warningIan Jackson2022-06-241-0/+8
| | | | | | | | | | | | Found these by disabling the nightly dbg macro special case. Now, we have a mechanism for globally adding suppressions to tests, we can use that instead.
| * Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | | | | | Update all lint blocks
* | Update README.md files from rustdoc.Nick Mathewson2022-06-241-3/+0
|/
* Merge branch 'reachable_addrs_v2' into 'main'Nick Mathewson2022-06-177-147/+379
|\ | | | | | | | | | | | | Implement support for reachable_addrs Closes #491 and #93 See merge request tpo/core/arti!583
| * Rename guardset-selection function.Nick Mathewson2022-06-171-2/+7
| | | | | | | | Also, improve its documentation.
| * Rename pick_guard, pick_guard_ext.Nick Mathewson2022-06-172-17/+29
| | | | | | | | | | | | Now the primary exposed function is `pick_guard` again. This commit is just function renaming.
| * Refactor and document issues with modify_hop.Nick Mathewson2022-06-173-14/+41
| | | | | | | | | | | | | | | | | | | | | | | | At the site of modify_hop, we now have a comment explaining the internal-error issue. To make the internal error less likely, we lower the modify_hop call in lib.rs into GuardSet, where it can make sure it's looking at the same filter as was used to select the guard. The function name "pick_guard_ext" is not permanent; I'm going to rename it in the next commit.
| * API-fix for extend_sample_as_needed.Nick Mathewson2022-06-172-19/+20
| | | | | | | | | | | | | | | | | | Previously, the API said "you need to call this in a loop till it returns false". We did that in one place, but not another. With the introduction of filters, forgetting to loop here becomes a bug: so instead, change the behavior of extend_sample_as_needed so it handles looping itself.
| * Remove some outdated comments.Nick Mathewson2022-06-173-18/+0
| | | | | | | | | | These all say, in one form or another, "there is no guard filtering; there is only one selection". That's now false.
| * Tweak parameters in guardmgr tests to improve testnet behavior.Nick Mathewson2022-06-171-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The fake network we construct for these tests is small in ways that can sometimes cause weird behavior with guard filters. We fix this by adjusting the parameters of the guard selection algorithm accordingly in the tests. With these new parameters, #491 no longer occurs. This commit also adds comments to explain why the parameters are set as they are. Closes #491.
| * GuardMgr: Support for multiple guard setsNick Mathewson2022-06-172-33/+98
| | | | | | | | | | | | | | guard-spec.txt specifies that we have multiple separate samples of guards that we can use depending on whether the filter is restrictive or not. Here we implement the rules for switching between samples.
| * Move set_filter into GuardMgrInner.Nick Mathewson2022-06-173-41/+34
| | | | | | | | | | Convert its argument type to Option<&NetDir> to better match the rest of the API.
| * GuardMgr: Function to tell how permissive a filter is.Nick Mathewson2022-06-171-0/+50
| | | | | | | | | | | | | | | | | | When we're filtering guards, we have to check whether the filter is "restrictive": if it forbids most of the guards (by bandwidth), we keep its guards separated from the main set. If it is super-restrictive, we also warn. This functionality is specified in guard-spec.txt.
| * GuardMgr: Also apply filters to fallback directories.Nick Mathewson2022-06-172-7/+12
| |
| * GuardMgr: remove disallowed addresses from returned FirstHops.Nick Mathewson2022-06-174-2/+54
| | | | | | | | | | | | | | | | Since a guard can have a bunch of addresses, and the guard is permitted if any one of those addresses is permitted, then we might decide to use a guard with some non-permitted addresses. Thus, we need to filter those addresses before returning the view of the guard as a FirstHop.
| * GuardMgr: Remove old testing filter variant.Nick Mathewson2022-06-172-21/+9
| | | | | | | | | | We don't need to restrict based on bits in the key id any longer, since we have a real filter.
| * GuardMgr: Add a new filter type based on reachable addresses.Nick Mathewson2022-06-172-8/+24
| |
| * Guardmgr: Change the GuardFilter API.Nick Mathewson2022-06-173-19/+46
| | | | | | | | | | The guard filter is now a set of restrictions that can be placed on allowable guards.
* | Merge branch 'config-fix2' into 'main'Nick Mathewson2022-06-161-6/+3
|\ \ | |/ |/| | | | | Use impl_standard_builder more and remove manual Default/builder impls See merge request tpo/core/arti!594
| * impl_standard_builder: Use for tor_guardmgr::FallbackDirIan Jackson2022-06-161-6/+3
| |
* | Merge branch 'clippy_20220614' into 'main'Nick Mathewson2022-06-151-2/+2
|\ \ | |/ |/| | | | | Fix several clippy issues, most with nightly See merge request tpo/core/arti!588
| * Fix clippy::significant_drop_in_scrutinee warningsNick Mathewson2022-06-151-2/+2
| | | | | | | | | | | | | | | | | | This is apparently a new warning from clippy nightly, documented in https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_in_scrutinee . I'm not in love with the temporary variables that this warning wants me to introduce, but it does seem like a decent way to avoid some kinds of deadlock.
* | tor-netdir: testnet: Make construct_netdir infallible (rustfmt)Ian Jackson2022-06-132-9/+3
| | | | | | | | | | Run rustfmt. Separate commit to make review of the substantive commit easier.
* | tor-netdir: testnet: Make construct_netdir infallibleIan Jackson2022-06-132-3/+0
|/ | | | | This is a *lot* of unwraps. The function takes no parameters and is used only for testing. It ought to be infallible.
* Merge branch 'use-testing-rng'Nick Mathewson2022-06-072-12/+33
|\
| * Refactor fallback-set tests to work with deterministic PRNG.Nick Mathewson2022-06-021-10/+29
| | | | | | | | | | The trouble was that one of the helper functions they used did not take a PRNG as an argument.
| * Use testing_rng() in tests throughout our crates.Nick Mathewson2022-06-022-4/+6
| | | | | | | | | | | | This only affects uses of thread_rng(), and affects them all more or less indiscriminately. One test does not work with ARTI_TEST_PRNG=deterministic; the next commit will fix it.
* | Merge branch 'netdir_provider_in_guardmgr_v2' into 'main'Nick Mathewson2022-06-072-18/+129
|\ \ | | | | | | | | | | | | | | | | | | Use NetDirProvider in GuardMgr Closes #93 See merge request tpo/core/arti!568
| * | GuardMgr: Use installed netdir provider when we want a netdirNick Mathewson2022-06-071-20/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of our existing code optionally takes a netdir from the caller. When it doesn't give us one, use the netdir from the installed NetDirProvider. (Possibly someday we should remove the NetDir arguments entirely. I'm deferring that because there are only two APIs affected, and because making this change would force us to rewrite a pretty large mess of unit tests.)
| * | Move responsibility for GuardMgr NetDir updates to GuardMgr.Nick Mathewson2022-06-072-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously it was the job of a task in CircMgr to do this; but we're going to want to give GuardMgr full access to the latest NetDir for this, and for other code-simplification reasons. With this change I'm deprecating a couple of functions in tor-circmgr. It's no longer necessary for us to have an artificial external way for you to feed new NetDirs to a circmgr. (I could just remove them, but I want practice deprecating.)
* | | Upgrade float_eq dev-dependency to 1.0.0Nick Mathewson2022-06-071-1/+1
|/ /
* | lints: Add let_unit_value allow to all cratesIan Jackson2022-05-311-0/+1
| | | | | | | | | | From running add_warning, with manual picking of the right hunks/lines.