summaryrefslogtreecommitdiff
path: root/crates/tor-netdir
Commit message (Collapse)AuthorAgeFilesLines
* Two more patchlevel bumpsNick Mathewson2023-12-041-1/+1
| | | | | | | | | These crates both depend on tor-error. Since tor-error got a patchlevel bump, they now depend on the new version, which means by our rules that _they_ get a patchlevel bump themselves. tor-geoip tor-rpcbase
* Bump minor versions in preparation for releaseNick Mathewson2023-12-041-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This crate is new, and gets a bump to 0.1.0. tor-log-ratelim This crate had a breaking change: tor-persist tor-llcrypto had a breaking change. These crates _are_ tor-llcrypto, or (transitively) depend on it. I am assuming that they all re-expose something from it in a way that matters: tor-llcrypto tor-bytes tor-hscrypto tor-socksproto tor-checkable tor-cert tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy arti-client arti-rpcserver arti-hyper
* Bump patchlevel versions in preparation for releaseNick Mathewson2023-12-041-2/+2
| | | | | | | | | | | | | | | These crates had backward-compatible changes, and get a patchlevel bump only: fs-mistrust tor-error tor-config tor-rtcompat tor-rtmock This crate exposes no non-CLI APIs, and gets a patchlevel bump only: arti
* In every crate, change rust-version to 1.70.Nick Mathewson2023-11-281-1/+1
|
* Improve documentation in/around DosParams extensionNick Mathewson2023-11-201-6/+13
| | | | | | It does not help that C tor has a set of parameters and a set of configuration options with exactly the same names which configure the same thing in two slightly different ways.
* Upgrade to itertools 0.12.0Nick Mathewson2023-11-151-1/+1
|
* Patch version bumps in crates without breaking changesNick Mathewson2023-10-311-5/+5
| | | | | | | | | | | | | | | | | | ``` These crates have new APIs: tor-async-utils ADDED tor-config ADDED tor-hscrypto ADDED tor-netdoc ADDED, plus BREAKING-experimental. These crates have patch-level changes only: tor-netdir (bugfix only). (re-exposes netdoc) arti-rpcserver (tweaks only, uses nothing that broke.) arti 1.1.10, no stable public APIs. ```
* Minor version bumps in crates with breaking changes.Nick Mathewson2023-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | ``` tor-basic-utils BREAKING tor-rtmock BREAKING. tor-cert BREAKING tor-cell BREAKING tor-proto BREAKING: re-exposes cell. (Also BREAKING-experimental) tor-chanmgr BREAKING: Re-exposes proto. tor-ptmgr BREAKING: re-exposes tor-chanmgr tor-guardmgr BREAKING: re-exposes proto. (Only for ClockSkew I think?) tor-circmgr BREAKING: re-exposes proto tor-dirclient BREAKING tor-hsclient BREAKING, re-exposes proto. tor-hsservice BREAKING, re-exposes proto. tor-hsrproxy BREAKING arti-client BREAKING: re-exposes proto. arti-hyper: BREAKING, re-exposes arti-client. tor-dirmgr Let's assume BREAKING, very high-level. tor-keymgr BREAKING, but experimental. ```
* tor-hsservice: Rewrite map() as a for-loop (fmt).Gabriela Moldovan2023-10-031-1/+2
|
* tor-netdir: Fix broken condition.Gabriela Moldovan2023-10-031-4/+5
| | | | | | | | | | | | | The statement ``` if hsids.all(|(_hsid, period)| rings.any(|(_, _, tp)| tp == period)) { ``` had 2 bugs: * the condition is reversed (it should be negated: we need to bail if one of the specified `hsids` cannot be found on any of our rings) * `rings.any()` mutates the `rings` iterator, causing `hs_dirs_upload` to return fewer HSDirs than expected
* Patchlevel bumps to crates whose dependencies just changed.Nick Mathewson2023-10-021-1/+1
| | | | (The only change in these crates is that their dependencies changed.)
* Minor-version bumps, for crates with breaking changes.Nick Mathewson2023-10-021-2/+2
|
* Patchlevel bumps, with dependents affected.Nick Mathewson2023-10-021-3/+3
|
* Trivial version bumps: patchlevel only.Nick Mathewson2023-10-021-1/+1
| | | | | These crates have had changes that do not require their dependents to require a later version.
* arti-client: add exit selection with GeoIP country codeseta2023-09-181-0/+2
| | | | | | | | | | | | | | | | | | | | This threads the country codes work through the rest of the codebase: - `tor-dirmgr` will now enable GeoIP with the embedded database when the `geoip` future is enabled - This can be extended later using the `DirMgrConfig` to allow specifying a custom database; this is not done here, though - `tor-circmgr`'s `SupportedCircUsage` and `TargetCircUsage` fields gain new `country_code` members to allow filtering circuits by country - These are `()` in builds where the `geoip` feature is not enabled -- doing it this way means we don't have to copy and paste huge swathes of code, since we can't use `#[cfg]` in patterns - `ExitPathBuilder` gains (hacked-in) support for choosing a relay with the correct country code - Due to the lack of conjuction, we just copy and paste a small bit, pending further refactoring - `StreamPrefs` now lets you specify a country code, letting embedders make use of the feature
* Remove semver.md now that 1.1.8 is out.Nick Mathewson2023-09-051-2/+0
|
* Update patchlevel for crates with nontrivial changes.Nick Mathewson2023-09-051-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are: ``` hashx equix tor-async-utils tor-error tor-config tor-rtmock tor-llcrypto tor-bytes tor-hscrypto tor-hspow tor-cert tor-linkspec tor-cell tor-proto tor-netdoc tor-netdir tor-chanmgr tor-guardmgr tor-dirmgr tor-keymgr tor-hsclient tor-hsservice arti-client arti ```
* Upgrade to visibility 0.1.0Nick Mathewson2023-09-051-1/+1
|
* hs: Intro point selection: TODO re checking the stable flag (fmt)Ian Jackson2023-08-291-1/+1
| | | | Apply erroneous formatting as demanded by rustfmt.
* hs: Intro point selection: TODO re checking the stable flagIan Jackson2023-08-291-0/+1
|
* hs: Intro point selection: Actually call is_hs_intro_point()Ian Jackson2023-08-291-2/+6
| | | | | | | | Call site as per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1550#note_2936401 Plus a TODO comment with an opinion from me about this API. (Note not a TODO HSS so this is on the back burner.)
* tor-netdir: Add TODO about WeightRole::HsRendIan Jackson2023-08-291-0/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1550#note_2936400
* tor-netdir: Support for seleting HS intro pointsIan Jackson2023-08-292-0/+10
| | | | | | I'm quite unsure about this. Hence the TODOs. I think the API is right, though.
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-236-0/+6
|
* 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
|