summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | 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.
* | | | | | Merge branch 'channel_retries' into 'main'Nick Mathewson2022-03-2116-227/+583
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change rules for retrying guards (and marking them broken) See merge request tpo/core/arti!426
| * | | | | | Expand some comments based on review from @diziet.Nick Mathewson2022-03-213-1/+14
| | | | | | |
| * | | | | | circmgr: When planning, only keep one error; log them all.Nick Mathewson2022-03-211-3/+6
| | | | | | |
| * | | | | | Fix build with Rust 1.53.Nick Mathewson2022-03-211-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Pattern bindings after `@` weren't stabilized then :/
| * | | | | | dirmgr: Note errors and inform the circmgr about them.Nick Mathewson2022-03-214-7/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | | GuardMgr:: generalize GuardId::from_relay.Nick Mathewson2022-03-213-6/+10
| | | | | | |
| * | | | | | GuardMgr: new API to record guard problems from outside the crate.Nick Mathewson2022-03-212-11/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We'll need this so that we can say "This guard behaved bogusly as a directory cache; try somebody else."
| * | | | | | dirclient: Collect and expose peer information from errors.Nick Mathewson2022-03-214-58/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit refactors the dirclient error type into two cases: errors when constructing a circuit, and errors that occur once we already have a one-hop circuit. The latter can usually be attributed to the specific cache we're talking to. This commit also adds a function to expose the information about which directory gave us the info.
| * | | | | | 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.
| * | | | | | dirclient: Remember the source of each resposne we receive.Nick Mathewson2022-03-213-7/+17
| | | | | | |
| * | | | | | Reformat tor-dirclient Cargo.tomlNick Mathewson2022-03-211-13/+15
| | | | | | |
| * | | | | | circmgr: Change API for using FallbackDirsNick Mathewson2022-03-214-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | | GuardMgr: revise handling of "all guards are down".Nick Mathewson2022-03-213-21/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When all guards are down, we would previously mark them all as up, and retry aggressively. But that's far too aggressive: if there's something wrong with our ability to connect to guards, it makes us hammer the network over and over, ignoring all the guard retry timeouts in practice. Instead, * We now allow the `pick_guard()` function to fail without automatically retrying. * We give different errors in the cases when all our guards are down, and when all of the guards selected by our active usage are down. * Our "guards are down" error includes the time at which a guard will next be retriable. This is part of #407.
| * | | | | | GuardMgr: use decorrelated-jitter backoff for retrying guards.Nick Mathewson2022-03-211-80/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C tor used one schedule, and guard-spec specified another. But in reality we should probably use a randomized schedule to retry guards, for the reasons explained in the documentation for RetrySchedule. I've chosen the minima to be not too far from our previous minima for primary and non-primary guards. This is part of #407.
* | | | | | | Adjust a commentIan Jackson2022-03-211-1/+1
| |_|/ / / / |/| | | | | | | | | | | | | | | | | Noticed this while reviewing !426
* | | | | | Merge branch 'move-more-config' into 'main'Nick Mathewson2022-03-215-89/+64
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | Move almost all of the rest of options.rs to arti crate See merge request tpo/core/arti!425
| * | | | | Run rustfmt to tidy up importsIan Jackson2022-03-212-2/+5
| | | | | |
| * | | | | ApplicationConfig: abolish accessorIan Jackson2022-03-213-10/+3
| | | | | |
| * | | | | Move ApplicationConfig to arti crateIan Jackson2022-03-214-32/+27
| | | | | | | | | | | | | | | | | | | | | | | | Code motion and import fixups.
| * | | | | socks: abolish config accessorsIan Jackson2022-03-212-19/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Making these fields pub(crate) is quite reasonable and does away with the need for accessors.
| * | | | | Move ProxyConfig to arti crateIan Jackson2022-03-214-53/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We put this in cfg.rs, rather than (say) socks.rs, because it has config relating to both socks.rs and dns.rs. Code motion and import fixups.
* | | | | | Merge branch 'udp-cleanup-410' into 'main'Ian Jackson2022-03-213-47/+10
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | UdpSocket: remove support for connect(). Closes #410 See merge request tpo/core/arti!424
| * | | | | UdpSocket: remove support for connect().Nick Mathewson2022-03-183-47/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, Arti doesn't need this. But once it does, it will be way better to have a separate type for connected sockets, rather than having to error-check every time somebody gives us a socket. Part of #410
* | | | | | Tidy up filt_from_opt_strIan Jackson2022-03-211-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | This was clumsy. Now it is brought together it can be simplified.
* | | | | | Abolish logging filter option accessorsIan Jackson2022-03-211-19/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This de-duplicates the code that was in those accessors, and is now in filt_from_opt_str. Code motion and direct field access.
* | | | | | Abolish easy accessors for logging configIan Jackson2022-03-211-26/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are no longer needed, because the code that uses this configuration now lives in the same module as the configuration itself.
* | | | | | Move logging configuration from arti_config::options to arti::loggingIan Jackson2022-03-216-132/+134
| | | | | | | | | | | | | | | | | | | | | | | | Code motion and import fixups.
* | | | | | Rename arti::trace module to arti::loggingIan Jackson2022-03-212-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are going to move LoggingConfig here. We should follow the already-public name IMO.
* | | | | | Move ArtiConfig to new arti::cfg moduleIan Jackson2022-03-2110-266/+286
| | | | | | | | | | | | | | | | | | | | | | | | Code motion and import fixups.
* | | | | | Merge branch 'accessors' into 'main'Nick Mathewson2022-03-183-44/+26
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | Abolish some accessors in drmgr See merge request tpo/core/arti!423
| * | | | | dirmgr: Authority: Abolish v3ident accessorIan Jackson2022-03-182-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes this information crate-private. The crate can reasonably just access it.
| * | | | | dirmgr: Authority: Move a method used only for testingIan Jackson2022-03-181-6/+9
| | | | | |
| * | | | | dirmgr: Authority: Abolish two unused accessorsIan Jackson2022-03-181-9/+1
| | | | | |
| * | | | | dirmgr: NetworkConfig: Abolish accessorsIan Jackson2022-03-181-16/+8
| | | | | | | | | | | | | | | | | | | | | | | | Using accessors for crate-only fields is otiose.
| * | | | | dirmgr: NetworkConfig: Rename fallbacks struct fieldIan Jackson2022-03-181-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename this to be named the same as its accessor, and use the rename feature of builder and serde. (The shorter name is nicer in the code IMO.)
* | | | | | Actually throw an anyhowIan Jackson2022-03-181-1/+1
|/ / / / / | | | | | | | | | | | | | | | Prompted by a compiler warning which I weirdly can't seem to reproduce?
* | | | | Merge branch 'circ_path_api' into 'main'Ian Jackson2022-03-186-40/+133
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | ClientCirc: add functions to return the circuit's actual path Closes #415 See merge request tpo/core/arti!419
| * | | | Define accessors for circuit hops.Nick Mathewson2022-03-172-0/+39
| | | | | | | | | | | | | | | | | | | | Closes #415
| * | | | tor-proto: Remember peer information in circuit and channelNick Mathewson2022-03-176-36/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each channel now remembers an OwnedChanTarget. Each circuit now remembers a vector of OwnedChanTarget to represent the path that it was constructed for. Part of #415.
| * | | | ClientCirc: Move n_hops into a new Path type.Nick Mathewson2022-03-173-14/+36
| | | | | | | | | | | | | | | | | | | | This will help with #415
* | | | | Merge branch 'md_allocation' into 'main'Nick Mathewson2022-03-172-126/+116
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use less space in hashtables for microdescriptors Closes #386 See merge request tpo/core/arti!415
| * | | | | Run rustfmtIan Jackson2022-03-171-5/+6
| | | | | |
| * | | | | GetMicrodescsState: Abolish separate n_missing field inIan Jackson2022-03-171-12/+12
| | | | | |
| * | | | | GetMicrodescsState: Break out with_mdreceiver_for_missingIan Jackson2022-03-171-13/+23
| | | | | |
| * | | | | GetMicrodescsState: Dedupe slightlyIan Jackson2022-03-171-8/+9
| | | | | |
| * | | | | netdir: Use an even smaller rep for list of microdescsNick Mathewson2022-03-161-55/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Every time we want a microdescriptor, we know the index of that microdesc's corresponding routerstatus within the consensus. Therefore, we can use that index to store `Arc<Microdesc>`s in a dense array, and not have to use a HashSet here at all.
| * | | | | tor-dirmgr: Remove redundant hashtable.Nick Mathewson2022-03-162-22/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were using a hashtable to keep track of missing microdescriptor digests. But this information is redundant with the NetDir state, and there's now no longer any performance benefit to keeping a separate copy. Part of #386.
| * | | | | NetDir: Use less space in hash tablesNick Mathewson2022-03-161-61/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We previously kept missing-MD entries and present-MD entries all in the same HashSet, which resulted in using more slack space than we need. Now we use separate tables, so we can drop missing-MD entries as we move forward. Also, when constructing a NetDir, set its hash tables to their final capacities. This also lets us simplify some of our missing-md-listing code a lot.