| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
Apply erroneous formatting as demanded by rustfmt.
|
| | |
|
| |
|
|
|
|
|
|
| |
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.)
|
| |
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1550#note_2936400
|
| |
|
|
|
|
| |
I'm quite unsure about this. Hence the TODOs.
I think the API is right, though.
|
| | |
|
| |
|
|
| |
`HsBlindId` is `Copy`.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
When `hs_dirs` is removed this won't n't need to be public anymore.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
These will become useful when we split `hs_dirs()` into 2 separate
functions (one for uploading/services, and another for
downloading/clients).
|
| | |
|
| |
|
|
|
| |
This just simplifies the expression a little bit. It still has the same
behaviour.
|
| | |
|
| |
|
|
| |
This will become useful later when we build a `HashSet` of `HsDirIndex`.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
This updates the docs to reference the `spread` parameter (rather than
`spread_fetch`).
|
| | |
|
| |
|
|
|
|
| |
The spread should be either `hsdir_spread_store` or
`hsdir_spread_fetch`, depending on whether we're uploading or
downloading descriptors.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| | |
|
| |
|
|
| |
These are no longer needed.
|
| |
|
|
| |
Closes #950.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Network-health wants these to see whether a given relay is listed in
the consensus.
cc @juga
|
| |
|
|
| |
The function this comment is asking us to write is `circtarget_from_pieces`.
|
| |
|
|
|
|
| |
(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.)
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
| |
This makes them configurable, since we allow the user to override
any consensus parameter.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
|
|
| |
The consensus includes a listing for clients and for relays,
saying which protocol versions are _required_ for participation on
the network, and which versions are _recommended_. We have been
parsing this, but not yet exposing it.
This commit adds accessors to expose it, since we'll need that in
order to create CircTargets for introduction points and rendezvous
points.
|
| |
|
|
| |
Found by clippy nightly
|
| |
|
|
|
|
|
|
|
|
|
| |
This function will be used to look up a relay by a set of LinkSpecs
given from an incoming HsDesc or INTRODUCE2 message. It differs
from other "lookup relay by IDs" functions in that it needs to be
able to return "here's a relay", "couldn't found a relay", or
"learned that this relay is impossible."
Closes #855: This is the only new API needed for ChanTarget
validation, I think.
|
| |
|
|
|
|
|
|
| |
We'll probably need the hsdir list to be shuffled deterministically for
testing purposes (this might be desirable, for example, when we write a
test for HS descriptor download retries).
Signed-off-by: Gabriela Moldovan <[email protected]>
|