summaryrefslogtreecommitdiff
path: root/crates/tor-netdir/src
Commit message (Collapse)AuthorAgeFilesLines
* 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-291-2/+13
| | | | | | | 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.
* lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|
* 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).
* netdir, netdoc: Add accessors for protocol version status.Nick Mathewson2023-06-061-0/+19
| | | | | | | | | | | 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.
* guardmgr, netdir: fix some needless-mut warningsNick Mathewson2023-05-181-2/+2
| | | | Found by clippy nightly
* netdir: New function to check consistency of a HasRelayIdsNick Mathewson2023-05-161-0/+142
| | | | | | | | | | | 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.
* tor-netdir: Shuffle the list of HS dirs used for downloading descriptors.Gabriela Moldovan2023-05-041-10/+22
| | | | | | | | 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]>
* tor-netdir: Update tests to parse the descriptor, make test consensus ↵Gabriela Moldovan2023-05-032-16/+28
| | | | | | lifetime configurable. Signed-off-by: Gabriela Moldovan <[email protected]>
* Use bool::then_some() as appropriateNick Mathewson2023-04-111-1/+1
| | | | | | Now that we require a version of Rust that allows `b.then_some(v)`, clippy complains about our use of `b.then(|| v)`.
* Merge branch 'hs' into 'main'Ian Jackson2023-04-112-8/+30
|\ | | | | | | | | Download HS descriptors See merge request tpo/core/arti!1118
| * hs dirs: Note a thing we don't implement yetIan Jackson2023-04-111-0/+11
| | | | | | | | We'll add this later, about here.
| * hs dirs: Implement spread_fetch (fmt)Ian Jackson2023-04-111-1/+4
| |
| * hs dirs: Implement spread_fetchIan Jackson2023-04-112-4/+10
| |
| * hs dirs: Fix wrong ignored variable nameIan Jackson2023-04-111-1/+1
| | | | | | | | This is the HsDirIndex, not the Hs[Blind]Id.
| * hs dirs: Replicas are 1-indexedIan Jackson2023-04-111-2/+2
| |
| * tor-netdir: Make an import more preciseIan Jackson2023-04-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | With this cargo +stable clippy --locked --offline -p tor-netdir --features=hs-client --all-targets I got this: 64 | use {hsdir_params::HsDirParams, hsdir_ring::HsDirRing, itertools::chain, std::iter}; | ^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
* | tor-netdir: Fix capitalisation of a doc linkIan Jackson2023-04-111-1/+1
| | | | | | | | Fixes a rustdoc warning.
* | tor-netdir: Fix link to hs_time_period functionIan Jackson2023-04-111-1/+1
|/ | | | Fixes a rustdoc warning.
* tor-netdir: testnet: Make all non-guard non-exits be hsdirsIan Jackson2023-04-051-1/+1
|
* Merge branch 'debug-hex' into 'main'Nick Mathewson2023-04-031-1/+5
|\ | | | | | | | | Debug two types as compact hex strings See merge request tpo/core/arti!1104
| * Debug as hex strings for HsBlindId and HsDirIndexIan Jackson2023-03-311-1/+5
| |
* | Merge branch 'netdir' into 'main'Ian Jackson2023-03-312-29/+90
|\ \ | |/ |/| | | | | tor-netdir: API changes to support hsconn hsdir fetch See merge request tpo/core/arti!1094
| * tor-netdir: iter_filter_secondary: Make it less of a messIan Jackson2023-03-301-13/+10
| | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1094#note_2891857
| * tor-netdir: Expand on comment for HsRingRings::itergabi-2502023-03-301-1/+1
| |
| * tor-netdir: Minor docs fixesgabi-2502023-03-301-2/+3
| |
| * tor-netdir: Provide accessor for params field of HsDirParamsIan Jackson2023-03-301-0/+5
| |
| * tor-netdir: Implement hs_dirs accessorIan Jackson2023-03-301-2/+16
| |
| * tor-netdir: hs_dirs accessor: change semantics, type, and nameIan Jackson2023-03-301-7/+9
| | | | | | | | | | Don't have it take the TP, so that the caller must call it multiple times. Instead, have it return all the relevant relays.
| * tor-netdir: Provide hs_all_time_periods instead of ..._secondary_...Ian Jackson2023-03-301-5/+8
| | | | | | | | | | | | | | | | I don't think the server-side support will want to explicitly call current and then secondary. Rather, it will want to iterate over all the relevant ones. And fix the name, and add another comment about whether we need this.
| * tor-netdir: Rename hs_time_periodIan Jackson2023-03-301-3/+5
| | | | | | | | | | | | | | | | Change its name to hs_* like we do with things at this layer. But, it turns out, that at least for hs client connections to fetch the descriptor, I don't seem to need to call it yet ? Maybe it's not needed.
| * tor-netdir: Sort out HsDirOpIan Jackson2023-03-301-2/+3
| | | | | | | | | | * Change its name to Hs* like we do with things at this layer * Make the Upload variant cfg-conditional
| * tor-netdir: Reorganise iteration over hsdir ringsIan Jackson2023-03-301-4/+24
| | | | | | | | | | Provide iter_for_op, by changing iter into iter_filter_secondary and having a new entrypoint iter.
| * tor-netdir: Provide relay_by_rs_idxIan Jackson2023-03-301-0/+16
| |
* | tor-netdir: Implmeent HsDirRing::find_posIan Jackson2023-03-301-2/+3
| |
* | tor-netdir: Make the hsdir ring be a TiVecIan Jackson2023-03-301-5/+14
|/ | | | This eliminates an untyped `usize` index.
* tor-netdir: Use `pos` not `idx` in test network constructorsIan Jackson2023-03-271-14/+14
| | | | | | | | | There are too many things called "index" here. `idx` could be read to mean the table index `RouterStatusIdx`, the hsdir hash `HsDirIndex`, or an entry in some other one of these tables. Here's, it's just the sequence number of the index in the test netdir. Use `pos` for that. (`seq` would have been another possibility.)
* tor-netdir: Use `hsdir_index` for hidden service directory hashval (fmt)Ian Jackson2023-03-271-1/+4
|
* tor-netdir: Use `hsdir_index` for hidden service directory hashvalIan Jackson2023-03-271-11/+11
| | | | | | | | | | | | | | The hidden services directory hashring is a ring of hsdir relays, sorted by a hash that the spec calls the "index". That's `HsDirIndex`. This was a bad idea because the word "index" is seriously overused, but in Arti we must use the same terminology. At least, qualify it everywhere. Now one of these hsdir sort position hashes is always, in our code, an `hsdir_index`. I think this is necessary even inside modules called `hsdir_*`, because those can deal with other kind of "index" too.