summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* Turn FallbackList into a real type, and store one in GuardMgr.Nick Mathewson2022-03-306-23/+31
| | | | | | | | | | | | | | 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
|
* Move fallback.rs into guardmgr.Nick Mathewson2022-03-304-4/+6
| | | | | | | 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-302-5/+0
|\ | | | | | | | | Remove allow(clippy::disallowed_methods) lint flag. See merge request tpo/core/arti!437
| * Remove allow(clippy::disallowed_methods) lint.Nick Mathewson2022-03-302-5/+0
| |
* | Make daemon tasks self-contained; introduce NetDirProvidereta2022-03-301-3/+251
|/ | | | | | | | | | | | | | | The various background daemon tasks that `arti-client` used to spawn are now handled inside their respective crates instead, with functions provided to spawn them that return `TaskHandle`s. This required introducing a new trait, `NetDirProvider`, which steals some functionality from the `DirProvider` trait to enable `tor-circmgr` to depend on it (`tor-circmgr` is a dependency of `tor-dirmgr`, so it can't depend on `DirProvider` directly). While we're at it, we also make some of the tasks wait for events from the `NetDirProvider` instead of sleeping, slightly increasing efficiency.
* Merge branch 'no-system-time' into 'main'eta2022-03-304-18/+44
|\ | | | | | | | | | | | | Don't use SystemTime::now() Closes #306 See merge request tpo/core/arti!365
| * typotrinity-1686a2022-02-281-1/+1
| |
| * use wallclock where possible in teststrinity-1686a2022-02-262-0/+5
| |
| * fix teststrinity-1686a2022-02-252-14/+21
| |
| * remove most usage of SystemTime::nowtrinity-1686a2022-02-254-4/+18
| |
* | Remove a now-irrelevant commentNick Mathewson2022-03-281-2/+0
| |
* | remove usage of 'token' where it's no longer a tokentrinity-1686a2022-03-272-13/+16
| |
* | implement IsolationHelper for StreamIsolationtrinity-1686a2022-03-252-14/+12
| | | | | | | | but don't use it in a dyn Isolation context
* | move StreamIsolation to isolation moduletrinity-1686a2022-03-243-108/+107
| |
* | implement IsolationHelper for tuple of IsolationHelpertrinity-1686a2022-03-241-0/+159
| |
* | move isolation in separate moduletrinity-1686a2022-03-245-330/+336
| |
* | seal trait Isolationtrinity-1686a2022-03-241-1/+11
| |
* | rename *_isolation_group to *_isolationtrinity-1686a2022-03-242-8/+8
| |
* | Merge branch 'more_iso_docs' into 'main'eta2022-03-231-7/+63
|\ \ | | | | | | | | | | | | Expand documentation for isolation traits See merge request tpo/core/arti!420
| * | Expand documentation for isolation traitsNick Mathewson2022-03-171-7/+63
| | | | | | | | | | | | | | | | | | | | | These aren't complete yet; I'm just making this commit to capture the notes we took on a pad when we were discussing these APIs. Part of #414.
* | | Expand some comments based on review from @diziet.Nick Mathewson2022-03-211-1/+4
| | |
* | | circmgr: When planning, only keep one error; log them all.Nick Mathewson2022-03-211-3/+6
| | |
* | | dirmgr: Note errors and inform the circmgr about them.Nick Mathewson2022-03-211-0/+11
| | | | | | | | | | | | | | | | | | Some error types indicate that the guard has failed as a dircache. We should treat these errors as signs to close the circuit, and to mark the guard as having failed.
* | | Expose more peer information from circuit build failuresNick Mathewson2022-03-212-9/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | We already have the ability to get peer information from ChanMgr errors, and therefore from any RetryErrors that contain ChanMgr errors. This commit adds optional peer information to tor-proto errors, and a function to expose whatever peer information is available.
* | | circmgr: Change API for using FallbackDirsNick Mathewson2022-03-213-6/+7
| | | | | | | | | | | | | | | | | | It'll soon more convenient to pass in FallbackDirs as a slice of references, rather than just a slice of FallbackDirs: I'm going to be changing how we handle these in tor-dirmgr.
* | | circmgr: use AllGuardsDown to retry betterNick Mathewson2022-03-212-8/+36
|/ / | | | | | | | | | | | | | | | | | | | | | | | | If all guards are down and they won't be retriable for a while, try waiting that long to get whichever guard _is_ retriable. Additionally, if we are making multiple circuit plans in parallel, only report our planning as having failed if we failed at making _all_ the plans. Previously we treated any failure as fatal for the other plans, which could lead to trouble in the case when guards were all down or pending. Part of #407.
* | Alternative API for set_isolation_group().Nick Mathewson2022-03-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Instead of requiring a `Box<dyn Isolation>`, it now takes either a `Box<dyn Isolation>`, or an arbitrary `T` that implements `Isolation`. This API still allows the user to pass in a `Box<dyn Isolation>` if that's what they have, but it doesn't require them to Box the isolation on their own. Part of #414.
* | Merge branch 'test-isolation' into 'main'Nick Mathewson2022-03-175-86/+372
|\ \ | | | | | | | | | | | | new api for isolation See merge request tpo/core/arti!377
| * | replace TODOs with documentationtrinity-1686a2022-03-161-1/+1
| | |
| * | add trait to help test isolation related codetrinity-1686a2022-03-163-49/+182
| | |
| * | add tests on Isolation and fix conditional compilation issuestrinity-1686a2022-03-161-0/+58
| | | | | | | | | | | | | | | | | | it seems I added conditional compilation without noticing it?? and there was some errors when choosing a prefered runtime depending on feature flags
| * | refactor restrict_muttrinity-1686a2022-03-161-14/+15
| | |
| * | replace Arc with Box and use dyn-clonetrinity-1686a2022-03-162-43/+25
| | | | | | | | | | | | this also removes JoinResult
| * | add some documentation for new traitstrinity-1686a2022-03-161-12/+18
| | |
| * | replace isolated with compatibletrinity-1686a2022-03-161-13/+13
| | | | | | | | | | | | the inverted logic was too easy to mess up
| * | use downcast-rs instead of our own AsAnytrinity-1686a2022-03-162-15/+4
| | |
| * | fix existing teststrinity-1686a2022-03-162-68/+62
| | |
| * | add a join() on Isolationtrinity-1686a2022-03-161-4/+65
| | |
| * | testing new api for isolationTrinity Pointard2022-03-162-9/+71
| | |
* | | Merge branch 'config-partials-transparent' into 'main'Ian Jackson2022-03-172-51/+48
|\ \ \ | |/ / |/| | | | | | | | Absolish builders for CircMgrConfig and DirMgrConfig See merge request tpo/core/arti!417
| * | Add rationale for CircMgrConfig transparency and traitIan Jackson2022-03-161-1/+22
| | |
| * | Provide define_accessor_trait and use it to generate CircMgrConfigIan Jackson2022-03-161-20/+12
| | |
| * | Make CircMgrConfig transparent (and make it a trait)Ian Jackson2022-03-162-49/+33
| | | | | | | | | | | | See commentary for the rationale.
* | | derive_builder: Switch to upstream 0.11Ian Jackson2022-03-162-5/+5
|/ / | | | | | | | | | | | | | | | | This has the different syntax for builder field attributes than what I originally proposed in my MR, and which therefore is in the pinned branch. My upstream MR for the field attributes feature was morged: https://github.com/colin-kiegel/rust-derive-builder/issues/239
* | Use new upstream humantime_serde_option featureIan Jackson2022-03-141-5/+4
| | | | | | | | Replace all uses of our copy of this code.
* | humantime: Update to humantime-serde 1.1.1Ian Jackson2022-03-141-1/+1
| | | | | | | | | | | | | | | | This has the humantime_serde::option module, which we have upstreamed and are about to switch to. The remaining dependency with version = "1" is going to be removed in a moment.
* | Drop remaining conversion from FooConfig to FooConfigBuilderIan Jackson2022-03-071-34/+0
| |
* | Derive Deserialize for derive-builder-generated config buildersIan Jackson2022-03-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | I used git-grep -P '\#\[serde\((?!default|deny_unknown)' to find places where I needed to add additional attributes on the builder method fields. This is currently a bit duplicative, but when #371 is completely done, the validated (non-builder) configs won't need to be Deserialize any more. This is part of #371 and #372.