summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
* Bump all arti*, tor* crates to 0.2.0Nick Mathewson2022-04-0131-175/+175
| | | | | | | | Not all of these strictly need to be bumped to 0.2.0; many could go to 0.1.1 instead. But since everything at the tor-rtcompat and higher layers has had breaking API changes, it seems not so useful to distinguish. (It seems unlikely that anybody at this stage is depending on e.g. tor-protover but not arti-client.)
* Bump caret, retry-error to 0.1.1Nick Mathewson2022-04-012-2/+2
| | | | | | | | | | | | Unlike the rest of the crates, these don't have a "tor-" or "arti-" prefix, and are potentially used by code outside arti. With that in mind, it's probably for the best not to bump them to 0.2.0 along with the rest of our crates. They have had no changes since 0.1.0 other than refactoring and changing of clippy lints. Therefore, I'm not bumping the dependencies from other crates onto these: it's fine whether our other crates use caret/retry-error 0.1.0 or 0.1.1.
* Merge branch 'upgrade_pre_020' into 'main'Nick Mathewson2022-04-013-3/+3
|\ | | | | | | | | Run cargo upgrade/update in preparation for 0.2.0 See merge request tpo/core/arti!444
| * Upgrade async-broadcast => 0.4.0Nick Mathewson2022-04-011-1/+1
| |
| * Upgrade rlimit -> 0.8.0Nick Mathewson2022-04-012-2/+2
| |
* | Merge branch 'dir-munger-v2' into 'main'Nick Mathewson2022-03-3113-8/+364
|\ \ | |/ |/| | | | | | | | | Implement a directory munger to simulate pathological cases in arti-testing (v2) Closes #397 See merge request tpo/core/arti!442
| * Re-order attributes so that we can build with Rust 1.53.Nick Mathewson2022-03-315-15/+15
| |
| * Typo fix.Ian Jackson2022-03-311-1/+1
| |
| * Directory filtering in arti-testing.Nick Mathewson2022-03-314-1/+225
| | | | | | | | | | | | | | | | | | This feature allows us to detect different failing cases for arti#329 that would otherwise be hard to induce. It works by filtering consensus directory objects and/or microdescriptor objects before introducing them to the directory manager. Closes #397.
| * tor-netdoc: Conditionally expose document fields.Nick Mathewson2022-03-317-0/+96
| | | | | | | | | | | | | | | | This commit uses the `visibility` and `visible` crates to conditionally make certain structs and their fields public (respectively). This is incredibly dangerous to use for anything besides testing, and I've tried to write the documentation for the feature accordingly.
| * tor-checkable: add experimental api for exposing wrapped objects.Nick Mathewson2022-03-312-0/+38
| |
| * Reformat tor-checkable/Cargo.tomlNick Mathewson2022-03-311-6/+4
| |
* | dirmgr: Use a different idiom in retry loopNick Mathewson2022-03-311-3/+2
| | | | | | | | | | Replace the next delay field immediately rather than taking it and _then_ setting it. This way, it's never in an incorrect state.
* | Use a lower default for max_retries.Nick Mathewson2022-03-302-2/+2
| | | | | | | | | | | | | | | | | | | | The older default seems (experimentally) to be ridiculously high. Generally, if we can't build a circuit within a handful attempts, that circuit has already timed out... unless there is a fast-failure condition, in which case we're just hammering the network (or our view of it.) Found with `arti-testing` for #329.
* | circmgr: limit circuit attempts when launch_parallelism > 1.Nick Mathewson2022-03-301-1/+21
| | | | | | | | | | | | | | | | | | | | | | Previously, if we had launch_parallelism > 1, and we were willing to retry building a circuit max_retries times, then we'd launch up to max_retries * launch_parallelism circuits before giving up. Ouch! With this patch, we try to keep the total number of circuits planned and attempted to the actual max_retries limit. Part of #329; found with arti-testing.
* | dirmgr: fix bugs in algorithm for retrying downloadsNick Mathewson2022-03-301-13/+22
|/ | | | | | | | | | The previous algorithm had two flaws: * It would wait even after the final attempt, when there were no more retries to do. * It would fail to wait between attempts if an error occurred. This refactoring fixes both of these issues, and adds some comments.
* README.md for arti-testing.Nick Mathewson2022-03-301-0/+53
|
* Run cargo fmt one more time for good measure.Nick Mathewson2022-03-301-2/+2
|
* Use derive_more to derive AsRef.Nick Mathewson2022-03-302-12/+4
|
* Reformat tor-guardmgr/Cargo.toml.Nick Mathewson2022-03-301-18/+18
|
* Reformat several Cargo.toml files with 100-char-wide lines.Nick Mathewson2022-03-303-27/+8
|
* Fix some Rustdoc links.Nick Mathewson2022-03-304-5/+5
|
* Refactor FirstHopId into type-differentiated formNick Mathewson2022-03-309-185/+348
| | | | | | | | | | | The FirstHopId type now records an enum that stores whether the hop is a guard or a fallback. This change addresses concerns about remembering to check the type or source of an Id before passing it down to the FallbackState or GuardSet. Making this change required an API change, so that dirmgr can report success/failure status without actually knowing whether it's using a fallback or a guard.
* Rename Guard=>FirstHop, GuardId=>FirstHopIdNick Mathewson2022-03-308-77/+91
| | | | | This is preparation for having separate GuardId and FirstHopId types that distinguish which back-end they index.
* FallbackState: Use itertools::merge_join_by.Nick Mathewson2022-03-301-100/+8
| | | | | This replaces a hand-coded replacement that was probably a little less efficient.
* Fold fallback::Status::reset() into its (only) caller.Nick Mathewson2022-03-301-7/+2
|
* Rename FallbackState::lookup_mut => get_mut.Nick Mathewson2022-03-301-12/+12
|
* Rename FallbackSet => FallbackState.Nick Mathewson2022-03-303-15/+15
|
* DirPathBuilder::pick_path: re-order match cases for clarity.Nick Mathewson2022-03-301-16/+18
|
* Refactor select_guard_with_expand to use match and log errors.Nick Mathewson2022-03-301-10/+13
|
* ListKind: Use an exhaustive match to future-proof.Nick Mathewson2022-03-301-1/+4
|
* Clarify documentation about GuardUsable constructorsNick Mathewson2022-03-301-4/+10
|
* Add a TODO about an unslightly type.Nick Mathewson2022-03-301-0/+2
|
* Clean up a rustdoc linkIan Jackson2022-03-301-1/+1
|
* guardmgr::fallback::set: basic unit tests.Nick Mathewson2022-03-301-10/+190
|
* Rename ExternalFailure => ExternalActivity.Nick Mathewson2022-03-304-18/+17
|
* Replace the fallback directories when they change in the config.Nick Mathewson2022-03-303-0/+127
| | | | | | The code here uses a new iterator type, since I couldn't find one of these on crates.io. I tried writing the code without it, but it was harder to follow and test.
* Add status tracking to FallbackDir.Nick Mathewson2022-03-308-25/+286
| | | | | | | | | | | We do this by creating a new FallbackSet type that includes status information, and updating the GuardMgr APIs to record success and failure about it when appropriate. We can use this to mark FallbackDirs retriable (or not). With this change, FallbackDir is now stored internally as a Guard in the GuardMgr crate. That's fine: the FallbackDir type really only matters for configuration.
* Implement Ord for Ed25519Identity.Nick Mathewson2022-03-301-1/+1
|
* dirmgr: do not pass fallbacks to the CircMgr.Nick Mathewson2022-03-301-6/+1
| | | | | | | This is the final step in allowing the CircMgr to use the GuardMgr's view of the fallbacks. Compilation is restored and tests pass.
* circmgr: Use guard-manager's view of the fallbacks when possible.Nick Mathewson2022-03-304-14/+49
| | | | | | | | | | | | | | | | | | 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.
* GuardMgr: Return fallback directories when appropriate.Nick Mathewson2022-03-301-26/+67
| | | | | | | | | | | We only do this when we fail to get a regular guard (e.g., because they're all down), and when we have been asked for a guard for a one-hop directory. Most of the change in this commit is plumbing to make all of the types match up. As before, compilation may still be broken.
* Fix typos in guardmgr/lib.rsNick Mathewson2022-03-301-2/+2
|
* GuardMgr: some prep work for returning fallbacks as guards.Nick Mathewson2022-03-303-4/+40
| | | | | | | | | We need to extend our notion of "the origin of a guard" to include "somewhere outside the guard list"; we need the ability to return a FallbackDir as a Guard; and we need to remember a few more pieces of information in each pending request. As before, this commit may break compilation; it will be restored soon.
* Turn FallbackList into a real type, and store one in GuardMgr.Nick Mathewson2022-03-3013-37/+140
| | | | | | | | | | | | | | 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.
* Reformat tor-circmgr/Cargo.tomlNick Mathewson2022-03-301-21/+30
|
* guardmgr: move error types into new err.rs module.Nick Mathewson2022-03-303-73/+79
| | | | This is more in keeping with the rest of our code.
* Move fallback.rs into guardmgr.Nick Mathewson2022-03-3010-8/+11
| | | | | | | This is the logical place for it, I think: the GuardMgr's job is to pick the first hop for a circuit depending on remembered status for possible first hops. Making this change will let us streamline the code that interacts with these objects.
* Merge branch 'disallowed_lint' into 'main'eta2022-03-3021-45/+1
|\ | | | | | | | | Remove allow(clippy::disallowed_methods) lint flag. See merge request tpo/core/arti!437
| * Fix a let_and_return lint violation that had somehow slipped in.Nick Mathewson2022-03-301-3/+1
| |