aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/path/exitpath.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* circmgr: Use FilterCounts to explain why we couldn't find an exit.Nick Mathewson2022-07-121-9/+24
|
* tor-netdir: testnet: Make construct_netdir infallible (rustfmt)Ian Jackson2022-06-131-9/+3
| | | | | Run rustfmt. Separate commit to make review of the substantive commit easier.
* tor-netdir: testnet: Make construct_netdir infallibleIan Jackson2022-06-131-3/+0
| | | | | This is a *lot* of unwraps. The function takes no parameters and is used only for testing. It ought to be infallible.
* Use testing_rng() in tests throughout our crates.Nick Mathewson2022-06-021-4/+5
| | | | | | 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.
* Note a TODO in exitpath construction.Nick Mathewson2022-05-111-0/+6
|
* GuardUsage: restrictions: Use list builderIan Jackson2022-05-041-1/+2
| | | | | | | | | | | | | | Although these do not appear in the config, it does have a builder. It seems sensible to get rid of this ad-hoc list manipulation site, and replace it with our standard list builder API. define_list_builder_helper requires that the builder element type be Deserialize. Currently GuardUsageRestriction is a transparent, public enum, so we aren't really exposing anything. We could introduce GuardUsageRestrictionBuilder now, but since it's not in the config and thereofore only in the public API of the lower crates, we can definitely put that off.
* Fix grammar and typosSamanta Navarro2022-04-271-1/+1
|
* 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.
* circmgr: Use guard-manager's view of the fallbacks when possible.Nick Mathewson2022-03-301-3/+3
| | | | | | | | | | | | | | | | | | If we're building a path with the guard manager involved, we now ask the guard manager to pick our first hop no matter what. We only pick from the fallback list ourselves if we're using the API with no guard manager. This causes some follow-on changes where we have to remember an OwnedChanTarget object in a TorPath we've built, and where we gain the ability to say we're building a path "from nothing extra at all." Those are all internal to the crate, though. Closes #220, by making sure that we use our guards to get a fresh netdir (if we can) before falling back to any fallbacks, even if our consensus is old. Compilation should be fixed in the next commit.
* Turn FallbackList into a real type, and store one in GuardMgr.Nick Mathewson2022-03-301-1/+1
| | | | | | | | | | | | | | The guard manager is responsible for handing out the first hops of tor circuits, keeping track of their successes and failures, and remembering their states. Given that, it makes sense to store this information here. It is not yet used; I'll be fixing that in upcoming commits. Arguably, this information no longer belongs in the directory manager: I've added a todo about moving it. This commit will break compilation on its own in a couple of places; subsequent commits will fix it up.
* Remove allow(clippy::disallowed_methods) lint.Nick Mathewson2022-03-301-3/+0
|
* use wallclock where possible in teststrinity-1686a2022-02-261-0/+3
|
* fix teststrinity-1686a2022-02-251-10/+15
|
* remove most usage of SystemTime::nowtrinity-1686a2022-02-251-1/+2
|
* tor-circmgr: errors: Use autoconversion for BugIan Jackson2022-02-171-2/+2
|
* Add kinds for *most* circmgr errors.Nick Mathewson2022-02-161-9/+14
| | | | There are a couple of tricky ones I'll do separately.
* circmgr: Port InternalError to use Bug.Nick Mathewson2022-02-161-1/+5
|
* Don't create circuits if the consensus is stale by over 72 hoursNeel Chauhan2021-12-121-0/+7
|
* Merge branch 'bug183a_redux' into 'main'eta2021-12-071-6/+5
|\ | | | | | | | | | | | | Squash, refactor, and test !139 (Don't use same family as exit when picking a guard) Closes #183 See merge request tpo/core/arti!173
| * Move the "real families" code into tor-netdir.Nick Mathewson2021-12-061-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Just as `in_same_family` is a member of Relay, so the function for getting all the real family members of a relay should belong in the same crate. This change also removes the `family()` accessor: it gives the _claimed_ family rather than the _acknlowedged_ family, and is therefore a bit dangerous. There's still a hole in this logic; I've noted it in the Limitations section. If we get a microdescriptor for a relay in between creating and using the guard restriction, it might be omitted from the family list.
| * Use hashset _inside_ GuardRestriction.Nick Mathewson2021-12-061-6/+4
| | | | | | | | This approach saves us from a linear search when picking guards.
| * Change GuardUsage to have Vec of restrictions.Nick Mathewson2021-12-061-5/+4
| | | | | | | | | | | | | | | | There's not much reason to use a HashSet here, since we're just going over the whole list. This reverts commit 16e8489abbea1581b8e2 and does a little more refactoring.
| * Implement guard family restriction codeNeel Chauhan2021-12-061-4/+16
| |
* | Resolve roughly half of the XXXXs.Nick Mathewson2021-12-061-4/+0
|/ | | | | | | | We want to only use TODO in the codebase for non-blockers, and open tickets for anything that is a bigger blocker than a TODO. These XXXXs seem like definite non-blockers to me. Part of arti#231.
* add semicolons if nothing returnedDaniel Eades2021-11-251-1/+1
|
* Fix a few typos.Nick Mathewson2021-11-241-1/+1
| | | | Also fix some commonwealth spellings that had slipped in.
* Flatten enforce_distance into path_rules.Nick Mathewson2021-11-181-8/+8
| | | | Also use the path_rules name consistently throughout the code.
* Disable a check in exitpathNick Mathewson2021-11-021-1/+2
| | | | | This check relies on families being enforced correctly, which is not the case when specifying a fixed exit and using guards. (See #183)
* Allow clone-on-copy in tor-circmgr tests to fix a nightly-only clippy warning.Nick Mathewson2021-11-021-0/+1
|
* tor-circmgr: test ExitPathBuilder with guards.Nick Mathewson2021-11-021-0/+103
|
* tor-circmgr: tests for netwoks with no exitsNick Mathewson2021-11-021-0/+31
|
* Do not blame a guard for failures on non-random circuits.Nick Mathewson2021-10-261-1/+11
| | | | | | | | | We must not apply our new path-bias behavior (where we blame a guard if it gives us too many indeterminate circuit failures) if the path was not chosen at random. If too many random paths fail, we know that's suspicious, since the other relays are a random sample. But if a bunch of user-provided paths fail, that could simply be because the user's chosen exit is down.
* Run "cargo fix --edition-idioms=2018".Nick Mathewson2021-10-221-1/+1
|
* Implement guards for multihop paths.Nick Mathewson2021-10-131-21/+81
| | | | There are some limitations here, as noted in the comments.
* Pass the guard manager down to the path selection functions.Nick Mathewson2021-10-111-4/+8
|
* WIPNick Mathewson2021-10-111-2/+4
|
* fix/silence clippy lints in test modulesDaniel Eades2021-09-081-0/+1
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+252
This will cause some pain for now, but now is really the best time to do this kind of thing.