aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdir/src/hsdir_ring.rs
Commit message (Collapse)AuthorAgeFilesLines
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* hsservice: Make HsDirParams include the SRV lifespan.Nick Mathewson2024-01-231-0/+1
| | | | This is part of #1254.
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* 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: Make ring_items_at() filter the items before returning.Gabriela Moldovan2023-08-161-1/+4
| | | | | | | | | 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
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* netdir: Downgrade/remove/defer some TODO hs entries.Nick Mathewson2023-06-291-1/+1
|
* netdir: remove some now-needless warning suppressions.Nick Mathewson2023-06-291-2/+0
|
* hs dirs: Implement spread_fetch (fmt)Ian Jackson2023-04-111-1/+4
|
* hs dirs: Implement spread_fetchIan Jackson2023-04-111-3/+8
|
* 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-311-0/+5
|\ \ | |/ |/| | | | | tor-netdir: API changes to support hsconn hsdir fetch See merge request tpo/core/arti!1094
| * tor-netdir: Provide accessor for params field of HsDirParamsIan Jackson2023-03-301-0/+5
| |
* | 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 `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.
* tor-netdir: Use `rsidx` consistent for `RouterStatusIdx`Ian Jackson2023-03-271-6/+6
| | | | | | | | | This is an `IndexVec` key type. Some places used `idx`, some `rsi`, some `rs_idx`. Use `rsidx` for it everywhere, including in locals, function names, and fields. `rsidx` is a compromise. `rsi` might be a bit opaque, but we want a one-"word" name since it appears inside other names.
* Clarify which netdir index is meantNick Mathewson2023-02-091-1/+2
|
* hsdir: rustfmtIan Jackson2023-02-091-4/+1
| | | | | Deferred formatting changes which would have obscured the commits they were prompted by.
* hsdir: Actually compute the hash ringIan Jackson2023-02-091-4/+58
|
* hsdir: Ring calculation plumbingIan Jackson2023-02-091-1/+22
| | | | | | | | | | | * Implement Netdir::compute_rings in terms of a new HsDirRing::compute, that currently does nothing. * Actually call Netdir::compute_rings (since now it doesn't panic). * Make Netdir::compute_rings not be pub. We do this unconditionally, rather than exposing the distinction between a netdir-without-hsdir and a netdir-with-hsdir.
* hsdir: Implement HS hash ring index calculationsIan Jackson2023-02-091-6/+80
|
* hsdir: Make HsDirIndex be AsRef<[u8; ]>Ian Jackson2023-02-091-2/+4
|
* hsdir: Rename HsRingParams to HsDirParamsIan Jackson2023-02-091-5/+5
| | | | | | | | | The file which contains this type is called hsdir_params.rs. We have a general problem with slight confusion about when to includen "dir" and when to include "ring". Resolve this in favour of the rule now added to the module-level doc comment.
* hsdir: Replace open-coded params fields and args with HsRingParamsIan Jackson2023-02-091-14/+7
| | | | | | This will enable us to pass these around more conveniently. And make empty_from_params take an owned params, which it would like.
* tor-netdir: Use typed-index-collections for router index (fix hsdir)Ian Jackson2023-02-091-2/+3
| | | | | This was omitted in !1004. (Because this code isn't actually wired up yet, it typechecked anyway. But we need to fix it.)
* tor-hscrypto: Rename key types to correspond to new spec names.Nick Mathewson2023-02-081-2/+2
|
* netdir: Implement ring-param constructors and time period accessorsNick Mathewson2023-01-281-0/+16
| | | | | | | | | | | | | | This logic is a bit tricky, so I've tried to document it and add fairly good tests. The silver lining is that the external API for all of this logic will make it invisible and hidden. There are some cases where I added functions that I think might eventually get lowered into MdConsensus: But I don't want to lower too much right now, since the convention for our netdoc accessors is that they are fairly unsophisticated, and they show you the document as it is. Closes #686
* Adjust onion service ring APIs in light of prop#342Nick Mathewson2023-01-111-1/+1
| | | | | | | | | | * It is the NetDir's responsibility to tell the caller what the time period is. * There can be up to two secondary time periods. * Each time period has a single SRV. * Secondary time periods only apply for onion services, when they publish. * When publishing, the correct input is a time period.
* Sketch APIs for the onion service directory ring.Nick Mathewson2023-01-111-0/+116
These are a bit complex internally, but the API they present is pretty simple. I've left some discussion of points where the design isn't totally fleshed out, and where we need to look harder at the spec. Part of #716.