summaryrefslogtreecommitdiff
path: root/crates/tor-netdir
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-netdir: Use an owned HsBlindId instead of a reference.Gabriela Moldovan2023-08-221-4/+4
| | | | `HsBlindId` is `Copy`.
* tor-netdir: Replace flat_map() with cartesian_product().Gabriela Moldovan2023-08-221-7/+2
|
* tor-netdir: Make `hs_dirs_upload` take an iterator instead of a slice (fmt).Gabriela Moldovan2023-08-221-4/+6
|
* tor-netdir: Make `hs_dirs_upload` take an iterator instead of a slice.Gabriela Moldovan2023-08-221-7/+10
|
* tor-netdir: Add TODO about making HsDirOp private.Gabriela Moldovan2023-08-221-0/+3
| | | | When `hs_dirs` is removed this won't n't need to be public anymore.
* tor-hsclient: Use hs_dirs_download instead of the deprecated hs_dirs.Gabriela Moldovan2023-08-221-1/+1
|
* tor-netdir: Deprecate hs_dirs().Gabriela Moldovan2023-08-222-0/+3
|
* tor-netdir: Add separate functions for computing hsdirs for upload/download.Gabriela Moldovan2023-08-222-0/+103
| | | | | | | | | | The hsdir selection algorithm for uploads and downloads is different enough to justify splitting `hs_dirs` into 2 different functions. More specifically, when selecting the relays to upload a service's descriptors to, the service's `hsids` need to be matched up with the correct `ring` (using the time period) before applying `select_nodes` to pick the replicas. This is not the case when downloading, because for downloads select relays from the current ring.
* tor-netdir: Add private helpers for selecting hsdirs.Gabriela Moldovan2023-08-221-0/+72
| | | | | | These will become useful when we split `hs_dirs()` into 2 separate functions (one for uploading/services, and another for downloading/clients).
* Upgrade num_enum dependency to 0.7Nick Mathewson2023-08-211-1/+1
|
* tor-netdir: Replace somewhat niche scan() usage with flat_map().Gabriela Moldovan2023-08-161-9/+7
|
* tor-netdir: Rework the logic for checking if a node has already been selected.Gabriela Moldovan2023-08-161-3/+1
| | | | | This just simplifies the expression a little bit. It still has the same behaviour.
* tor-netdir: Store the hsdir indices in a HashSet instead of a BTreeSet.Gabriela Moldovan2023-08-161-4/+4
|
* tor-netdir: Derive Hash for HsDirIndex.Gabriela Moldovan2023-08-161-1/+1
| | | | This will become useful later when we build a `HashSet` of `HsDirIndex`.
* tor-netdir: Explain what the ring_items_at filter is for.Gabriela Moldovan2023-08-161-0/+5
|
* tor-netdir: Only select nodes that haven't been used for lower-numbered ↵Gabriela Moldovan2023-08-161-15/+96
| | | | | | | | | | | | | | replicas. This implements the part of the spec that says a node that has already been selected for a lowered-numbered replica, shouldn't be considered when choosing `spread` nodes for any other higher-numbered replicas. Note: previously, the test added in this commit wouldn't have passed (because `NetDir::hs_dirs` used to return duplicate relays under some circumstances). Part of #960
* tor-netdir: Make ring_items_at() filter the items before returning.Gabriela Moldovan2023-08-162-2/+5
| | | | | | | | | This makes `ring_items_at()` take an extra parameter which specifies whether an item is acceptable or not. The newly added filtering capabilities will be used to implement the part of the spec that says that if a node was selected for a replica, then it shouldn't be considered when choosing `spread` nodes for any other higher-numbered replicas.
* tor-netdir: Update ring_items_at() docs.Gabriela Moldovan2023-08-161-4/+3
| | | | | This updates the docs to reference the `spread` parameter (rather than `spread_fetch`).
* tor-netdir: Remove extraneous whitespace.Gabriela Moldovan2023-08-161-1/+1
|
* tor-netdir: Use hsdir_spread_store if we're uploading.Gabriela Moldovan2023-08-161-4/+9
| | | | | | The spread should be either `hsdir_spread_store` or `hsdir_spread_fetch`, depending on whether we're uploading or downloading descriptors.
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Merge branch 'bump_versions_117' into 'main'arti-v1.1.7Nick Mathewson2023-08-011-9/+9
|\ | | | | | | | | Vesion bumps for 1.1.7. See merge request tpo/core/arti!1458
| * Increment patchlevel versions of crates with minor changesNick Mathewson2023-08-011-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates are at version 0.x.y, so we don't need to distinguish new-feature changes from other changes: ``` tor-basic-utils fs-mistrust tor-error tor-geoip tor-checkable tor-linkspec tor-netdoc tor-netdir tor-persist tor-ptmgr tor-hsservice ``` This crate has a breaking change, but only when the semver-breaking feature `experimental-api` is enabled: ``` tor-config ``` This crate is at version 1.x.y, but has no new public APIs, and therefore does not need a minor version bump: ``` arti ```
* | Run "fixup features" in preparation for a release.Nick Mathewson2023-08-011-2/+2
|/
* Add country codes to relays inside a NetDireta2023-07-133-4/+177
| | | | | | | | | | | | - When the `geoip` feature flag of `tor-netdir` is enabled, perform GeoIP lookups for all relays added to the directory and add the resulting country code to the `Relay` struct. - The GeoIP database is provided in a new `PartialNetDir::new_with_geoip` constructor. - A new trait was also added to `tor-linkspec`, `HasCountryCode`, to enable getting this data out from other crates. Part of onionmasq#47.
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-106-0/+7
|
* Remove explicit allows for missing_panics_docs.Nick Mathewson2023-07-062-5/+0
| | | | These are no longer needed.
* Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| | | | Closes #950.
* Remove semver.md files for 1.1.6Nick Mathewson2023-06-301-2/+0
|
* Bump patchlevel versions on crates with smaller changesNick Mathewson2023-06-301-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Done with the commands below. The following crates have had various changes, and should get a patchlevel bump. Since they are pre-1.0, we do not need to distinguish new APIs from other changes. ``` cargo set-version --bump patch -p arti-client cargo set-version --bump patch -p safelog cargo set-version --bump patch -p tor-bytes cargo set-version --bump patch -p tor-cert cargo set-version --bump patch -p tor-circmgr cargo set-version --bump patch -p tor-config cargo set-version --bump patch -p tor-consdiff cargo set-version --bump patch -p tor-dirclient cargo set-version --bump patch -p tor-dirmgr cargo set-version --bump patch -p tor-error cargo set-version --bump patch -p tor-hsservice cargo set-version --bump patch -p tor-linkspec cargo set-version --bump patch -p tor-llcrypto cargo set-version --bump patch -p tor-netdir cargo set-version --bump patch -p tor-netdoc cargo set-version --bump patch -p tor-proto cargo set-version --bump patch -p tor-rpcbase cargo set-version --bump patch -p tor-socksproto ``` This crate has new features, but no new non-experimental Rust APIs. So even though it is post-1.0, it gets a patchlevel bump. ``` cargo set-version --bump patch -p arti ```
* Bump minor versions on crates with breaking changesNick Mathewson2023-06-301-1/+1
| | | | | | | | | | Done with: ``` cargo set-version --bump minor -p tor-hsclient cargo set-version --bump minor -p arti-rpcserver cargo set-version --bump minor -p tor-hscrypto cargo set-version --bump minor -p tor-cell ```
* Mark all {hs,onion-serivce}-client features as non-experimental.Nick Mathewson2023-06-291-2/+3
|
* netdir: add crosslinks to our definition of "usable".Nick Mathewson2023-06-291-13/+13
|
* netdir: document what we mean by a "usable" relay.Nick Mathewson2023-06-291-0/+8
|
* netdir: Conditionally expose some by_rsa APIs as experimental.Nick Mathewson2023-06-292-3/+15
| | | | | | | Network-health wants these to see whether a given relay is listed in the consensus. cc @juga
* netdir: Remove a TODO HSNick Mathewson2023-06-291-4/+0
| | | | The function this comment is asking us to write is `circtarget_from_pieces`.
* Downgrade TODO HS on HsDirParams::compute().expect()Nick Mathewson2023-06-292-4/+21
| | | | | | (Adding comments explaining that these errors are really unlikely to occur, unless there is a bug in our code or in Rust's time handling.)
* netdir: Defer a TODO HS but add a commentNick Mathewson2023-06-291-1/+12
| | | | | | This issue with walking over the ring is an issue we really must solve on the services timeframe, as is the one about looking only at the rings for which a blinded ID is germane.
* netdir: take n_replicas and spread_fetch from consensus parametersNick Mathewson2023-06-291-2/+12
| | | | | This makes them configurable, since we allow the user to override any consensus parameter.
* netdir: Downgrade/remove/defer some TODO hs entries.Nick Mathewson2023-06-292-7/+5
|
* netdir: remove some now-needless warning suppressions.Nick Mathewson2023-06-292-3/+0
|
* netdir: remove unnecessary wraps from srv_interval, extract_srvsNick Mathewson2023-06-291-13/+12
|
* netdir: Move voting_period() to netdoc::LifetimeNick Mathewson2023-06-291-14/+7
| | | | | I was going to add a comment about "doing this if we need the voting period anywhere else" but it turns out that we also use it in dirmgr.
* Upgrade to itertools 0.11.0Nick Mathewson2023-06-261-1/+1
| | | | The breaking changes here do not seem to affect us.
* Merge branch 'stderr' into 'main'Alexander Færøy2023-06-211-0/+2
|\ | | | | | | | | lints: Promote clippy::print_stderr and clippy::print_stdout See merge request tpo/core/arti!1271
| * lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
| |
* | Upgrade to strum 0.25.Nick Mathewson2023-06-211-1/+1
|/
* hscrypto: fix TODOs in time-period code.Nick Mathewson2023-06-131-7/+9
| | | | | | * Return a more informative error type (instead of Option) * Check that time periods are an integer number of seconds * Decide not to change the semantics of an argument.
* netdir: Wrap HsDir an Arc<>Nick Mathewson2023-06-091-5/+7
| | | | | | | | This change reduces the cost of cloning a `NetDir`. It's fine since–although we replace the HsDir once–we never modify it once it exists. Closes #883.
* Expand docs for NetDirProviderIan Jackson2023-06-081-0/+7
| | | | | | | | Apropos a question that arose on IRC, to which I felt the answer wasn't 100% unambiguous. Also, reference the usual implementation (it can't be a link because it's an upward reference).