aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-dirmgr
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge branch 'no-system-time' into 'main'eta2022-03-304-21/+27
|\ | | | | | | | | | | | | Don't use SystemTime::now() Closes #306 See merge request tpo/core/arti!365
| * use wallclock where possible in teststrinity-1686a2022-02-263-14/+17
| |
| * remove most usage of SystemTime::nowtrinity-1686a2022-02-252-7/+10
| |
* | Upgrade to rusqlite 0.27.0Nick Mathewson2022-03-291-1/+1
| |
* | DirFilter: Move nil default impls to trait default methodsIan Jackson2022-03-251-10/+7
| | | | | | | | | | | | | | This means you can write a DirFilter and only write code to mess with the bits you want to. Also, it is less code here.
* | Abolish filter::DynFilter in favour of transparent DirFilterIan Jackson2022-03-254-52/+13
| | | | | | | | | | | | | | | | | | | | | | | | There are two reasons why the DynFilter newtype might be needed: 1. To impl Default. But we don't need it to impl Default since we can have an accessor which does the defaulting. 2. To hide the API. But this is usrely an unstable API. Just writing Arc<dyn> gets rid of a lot of unnecessary boilerplate and conversion code.
* | Make DirFilter be Debug + Send + SyncIan Jackson2022-03-251-8/+4
| | | | | | | | | | Abolish the handwritten Debug impl for DynFilter, which is no longer needed.
* | dirmgr: Initial DirFilter code.Nick Mathewson2022-03-245-0/+140
| | | | | | | | | | | | This code sits behind a feature flag, and can be used to modify directories before storing them. This is part of the implementation for #397.
* | Reformat {arti-client,tor-dirmgr}/Cargo.tomlNick Mathewson2022-03-241-13/+16
| |
* | Expand some comments based on review from @diziet.Nick Mathewson2022-03-212-0/+10
| |
* | 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-213-7/+115
| | | | | | | | | | | | 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.
* | circmgr: Change API for using FallbackDirsNick Mathewson2022-03-211-1/+5
| | | | | | | | | | | | 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.
* | 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.)
* | Merge branch 'md_allocation' into 'main'Nick Mathewson2022-03-171-20/+54
|\ \ | | | | | | | | | | | | | | | | | | 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
| | |
| * | tor-dirmgr: Remove redundant hashtable.Nick Mathewson2022-03-161-22/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge branch 'config-partials-transparent' into 'main'Ian Jackson2022-03-173-67/+43
|\ \ \ | | | | | | | | | | | | | | | | Absolish builders for CircMgrConfig and DirMgrConfig See merge request tpo/core/arti!417
| * | | DirMgrConfig: abolish builder; make it transparent and exhaustiveIan Jackson2022-03-163-67/+43
| | | | | | | | | | | | | | | | See rationale in the comment.
* | | | Merge branch 'always-ims' into 'main'eta2022-03-161-10/+49
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dirmgr: Always send if-modified-since on consensus documents. Closes #403 See merge request tpo/core/arti!412
| * | | | dirmgr: Always send if-modified-since on consensus documents.Nick Mathewson2022-03-161-10/+49
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We never want a consensus document that's super-old, since we would reject it immediately for being too old. Also, never send an if-modified-since that's so old that we'd reject the response. Closes #403
* | | | Merge branch 'derive-builder' into 'main'Ian Jackson2022-03-161-1/+1
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | derive_builder: Switch to upstream 0.11 See merge request tpo/core/arti!414
| * | | derive_builder: Switch to upstream 0.11Ian Jackson2022-03-161-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | RetryDelay: remove accessors.Nick Mathewson2022-03-161-7/+9
| | | | | | | | | | | | Instead, check initial_delay in dirmgr directly.
* | | Remove re-export of retry-schedule in tor-dirmgr.Nick Mathewson2022-03-161-1/+1
| | | | | | | | | | | | It wasn't necessary.
* | | Fix up documentation on RetryDelay.Nick Mathewson2022-03-161-6/+3
| | | | | | | | | | | | | | | It's no longer about downloads; it's about whatever you need to retry.
* | | Move RetryDelay from dirmgr to basic-utils.Nick Mathewson2022-03-161-155/+1
| | | | | | | | | | | | | | | This (almost) a pure code-movement commit: it also makes one public function private in order to suppress a warning.
* | | RetryDelay: add accessors for stateNick Mathewson2022-03-161-5/+22
|/ / | | | | | | | | We'll need these for our unit tests in tor-dirmgr once we move RetryDelay into tor-basic-utils.
* | Merge branch 'missing_shrink_to_fit' into 'main'eta2022-03-141-0/+7
|\ \ | | | | | | | | | | | | | | | | | | dirmgr: Call shrink_to_fit on missing-microdesc hashtable Closes #388 See merge request tpo/core/arti!399
| * | dirmgr: Call shrink_to_fit on missing-microdesc hashtableNick Mathewson2022-03-101-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This hashtable starts out pretty large, but it can spend most of our runtime (when we aren't downloading) being small. To avoid doing too much work, I've made it so we only call shrink_to_fit twice per consensus: once when we're no longer pending, and once when we're complete. Closes #388.
* | | 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.
* | | Follow-up from arti!318Nick Mathewson2022-03-112-2/+11
| | | | | | | | | | | | Make update_config only conditionally exported; add semver-status update.
* | | Merge branch 'add-flatfile-dirmgr' into 'main'Nick Mathewson2022-03-114-12/+23
|\ \ \ | | | | | | | | | | | | | | | | Add flatfile DirMgr See merge request tpo/core/arti!318
| * | | Expose APIs for external DirProviderChristian Grigis2022-03-114-12/+23
| |/ /
* | | Drop remaining conversion from FooConfig to FooConfigBuilderIan Jackson2022-03-071-22/+0
| | |
* | | Derive Deserialize for derive-builder-generated config buildersIan Jackson2022-03-072-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Use git source for derive_builder for now, for attrs featureIan Jackson2022-03-071-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | We are going to want to specify custom attributes on fields of the builder struct. This feature was missing from derive_builder. This commitid is the current head of my MR branch https://github.com/colin-kiegel/rust-derive-builder/pull/237 https://github.com/ijackson/rust-derive-builder/tree/builder-field-attrs Using the commitid prevents surprises if that branch is updated. We will require this newer version of derive_builder. The version will need to be bumped again later, assuming the upstream MR is merged and upstream do a release containing the needed changes.
* | Merge branch 'errors-for-dirprovider' into 'main'Nick Mathewson2022-03-041-0/+12
|\ \ | | | | | | | | | | | | | | | | | | Errors for dirprovider Closes #370 See merge request tpo/core/arti!385
| * | Provide an error variant for external directory providersIan Jackson2022-03-041-0/+12
| | |
* | | Merge branch 'educe-traits' into 'main'Ian Jackson2022-03-043-26/+16
|\ \ \ | |/ / |/| | | | | | | | Replace many manual trait impls with use of educe See merge request tpo/core/arti!375
| * | Move skip_fmt into tor-basic-utilsIan Jackson2022-03-042-2/+2
| | | | | | | | | | | | | | | | | | | | | Code motion and the minimal mechanical changes. As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/375#note_2783078
| * | Replace manual Default impl with educe in tor-dirmgrIan Jackson2022-03-021-10/+5
| | |
| * | Replace manual Default impl with educe+std in tor-dirmgrIan Jackson2022-03-021-8/+4
| | |