summaryrefslogtreecommitdiff
path: root/crates/tor-netdir
Commit message (Collapse)AuthorAgeFilesLines
* Patchlevel bumps for crates whose dependencies just changed.Nick Mathewson2023-03-311-1/+1
| | | | | | | | | | | | | | | | These crates had no changes until just a moment ago. But since we updated the versions on some of their dependents, they have now changed themselves. Thus they get patchlevel bumps. ``` tor-rtmock tor-protover tor-socksproto tor-consdiff tor-chanmgr tor-dirclient tor-hsservice ```
* Bump crate versions that have breaking changesNick Mathewson2023-03-311-2/+2
| | | | | | | | | | These crates have had breaking changes. They are pre-1.0, so they get a minor bump. ``` tor-basic-utils tor-config ```
* Bump patchlevel on crates with non-breaking changesNick Mathewson2023-03-311-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For these crates, the changes are nontrivial, so we _do_ bump the versions on which their dependent crates depend. Fortunately, since they are all pre-1.0, we don't need to distinguish semver-additions from other changes. (Except for arti, which _is_ post-1.0, but gets a patchlevel bump anyway.) These are unstable crates with breaking changes: ``` tor-hscrypto tor-hsclient ``` These have new or extended APIs: ``` safelog tor-bytes tor-cell tor-linkspec tor-llcrypto tor-proto tor-cert arti-client ``` These have new unstable APIs or features: ``` tor-netdoc tor-circmgr (also broke some unstable APIs) arti (is post-1.0) ``` These have bugfixes only: ``` caret tor-dirmgr ```
* Bump patchlevel on crates with semver-irrelevant changes.Nick Mathewson2023-03-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Their dependents are _not_ updated to a more recent version. These bumped the version of a dependency that they don't expose ``` tor-rtcompat fs-mistrust ``` This one had internal refactoring: ``` tor-netdir ``` These had trivial changes only: ``` tor-checkable tor-ptmgr tor-guardmgr arti-hyper arti-bench arti-testing ```
* 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.
* tor-netdir: eliminate ref to abolished MdEntryIan Jackson2023-03-271-2/+2
| | | | | This was removed in c3e74973b4201f71275d8cf4c0c954cfb8d0eba5 netdir: Use an even smaller rep for list of microdescs
* tor-netdir: Use `rsidx` consistent for `RouterStatusIdx`Ian Jackson2023-03-272-42/+42
| | | | | | | | | 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.
* Upgrade to bitflags 2.0Nick Mathewson2023-03-132-2/+3
| | | | | This version of bitflags now requires us to explicitly list the traits that we want to derive for our bit-flags structs.
* Remove semver.md files now that 1.1.2 is out.Nick Mathewson2023-02-281-1/+0
|
* Patchlevel bumps for remaining changed crates.Nick Mathewson2023-02-281-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates have had small code changes, but no API additions: tor-config tor-socksproto tor-cert tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr arti tor-hsservice tor-congestion These crates have had API extensions: fs-mistrust tor-llcrypto tor-bytes tor-checkable tor-linkspec tor-netdoc tor-persist arti-client
* Bump tor-units version for breaking change.Nick Mathewson2023-02-281-1/+1
| | | | | | | | (The breaking change was removing `as_days()` from IntegerMinutes.) We are _not_ calling this a downstream-api breaking change, per discussion at https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1012?commit_id=bb2ab7c2a3e0994bb438188511688b5b039cae29#note_2876819
* Bump patch-versions for breaking changes in tor-hs{crypto,client}Nick Mathewson2023-02-281-1/+1
| | | | | | These are API breaks, but the crates themselves are currently 100% experimental, so there's no need to bump the minor versions according to our semver rules.
* Bump minor versions for significant breaking changes.Nick Mathewson2023-02-281-1/+1
| | | | This includes tor-cell, tor-proto, and tor-netdir.
* Rename onion-* cargo features to hs-* in tor-* cratesIan Jackson2023-02-284-35/+35
| | | | Fixes #756
* Fix minimal-versions (.then_some is too new)Ian Jackson2023-02-091-1/+1
|
* tor-netdir: Make is_hsdir_for_ring crate-localIan Jackson2023-02-091-1/+2
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1012#note_2876824
* tor-netdir: Document fill_from_previous_netdir semverIan Jackson2023-02-091-0/+1
|
* Clarify which netdir index is meantNick Mathewson2023-02-091-1/+2
|
* Fix typosNick Mathewson2023-02-091-2/+2
|
* Fix compilation with various feature combinationsIan Jackson2023-02-092-6/+26
|
* hsdir: rustfmtIan Jackson2023-02-092-10/+6
| | | | | Deferred formatting changes which would have obscured the commits they were prompted by.
* hsdir: Actually compute the hash ringIan Jackson2023-02-092-8/+58
|
* hsdir: Be able to enumerate the hidden service directoriesIan Jackson2023-02-091-0/+25
| | | | | | * Provide an accessor for the HSDIR flag * Provide a function for testing a relay for hsdir inclusion * Provide an iterator on NetDir that returns the hsdirs
* hsdir: Ring calculation plumbingIan Jackson2023-02-092-17/+32
| | | | | | | | | | | * 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 representation: Introduce HsDirs generic typeIan Jackson2023-02-093-38/+62
| | | | | This already allows us to get rid of some duplication, and will be useful more widely in a moment.
* hsdir: Implement HS hash ring index calculationsIan Jackson2023-02-092-7/+80
|
* hsdir: Make HsDirIndex be AsRef<[u8; ]>Ian Jackson2023-02-091-2/+4
|
* hsdir: impl Eq for HsDirParamsIan Jackson2023-02-091-1/+1
| | | | This will allow us to tell if we can reuse parts of a ring.
* hsdir: Rename HsRingParams to HsDirParamsIan Jackson2023-02-093-17/+21
| | | | | | | | | 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_params: Rename some variables for consistencyIan Jackson2023-02-092-11/+11
| | | | | | | | | | These variables are going to be struct fields, which will sort of enforce consistent naming. The struct fields are going to appear in a moment. We'll call the fields "current" and "secondary" after the naming in the test cases. And import hsdir_params::HsRingParams, which we're going to make more references to.
* hsdir: Replace open-coded params fields and args with HsRingParamsIan Jackson2023-02-093-16/+10
| | | | | | This will enable us to pass these around more conveniently. And make empty_from_params take an owned params, which it would like.
* hsdir: Remove a done TODO - this *is* now a TiSliceIan Jackson2023-02-091-1/+0
|
* tor-netdir: Provide Netdir::md_by_idxIan Jackson2023-02-091-0/+6
| | | | We'll need this shortly.
* tor-netdir: Store previous netdir (if required by features)Ian Jackson2023-02-091-1/+15
|
* tor-netdoc: Change fill_from_previous_netdirIan Jackson2023-02-091-10/+7
| | | | | | | | | | | | | | | | * Remove the return value, which was not used anywhere. Also remove the code to calculate the return value. * Take an Arc<NetDir> rather than a reference. We are going to want this for HS support. This has no overall effect on the lifetime of the4 Arc, which was owned at the one call site and then imediately dropped. * Change the documentation to explain what the function's role is in the netdir API, rather than the fiddly details of what it actually does internally. Relegate the latter to a code comment. (When we have HS, this will do more, or, at least, make further arrangements.)
* 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.)
* hs time handling: Make TimePeriod contain length as IntegerMinutesIan Jackson2023-02-091-2/+2
| | | | | | Locally, the only functional effect is that now we refuse to handle non-whole-number-of-minutes lengths - but since the consensus parameter can't represent those, there's no overall functional change.
* tor-hscrypto: Rename key types to correspond to new spec names.Nick Mathewson2023-02-082-4/+4
|
* Tidy up docs about RouterStatusIdxIan Jackson2023-02-011-9/+6
| | | | | | Always use "index" and not "position". Remove wording which is otiose given the type name.
* tor-netdir: Use typed-index-collections for router status indexIan Jackson2023-02-012-16/+30
|
* tor-netdir: Provide ConsensusRelays extension trait (fmt)Ian Jackson2023-02-011-4/+1
|
* tor-netdir: Provide ConsensusRelays extension traitIan Jackson2023-02-012-14/+35
| | | | | Call it everywhere instead of the inherent method on MdConsensus. (Verified by ad-hoc temporarily renaming MdConsensus::relays().)
* Change two in-code references to the wrong feature nameIan Jackson2023-02-011-2/+2
| | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/issues/756 I think this is going in the wrong direction, but it is better to fix it so that the names agree for now, pending a decision on the naming.
* Bump the patch version of every crate that had API additionsNick Mathewson2023-02-011-6/+6
| | | | | | These crates had API or behavior changes that may affect downstream crates. Fortunately, they're all version 0.x, and don't need minor bumps for this.
* Bump the patch-level version of crates with _minor_ changes.Nick Mathewson2023-02-011-1/+1
| | | | | | | These changes influence behavior, but not effect compatibility. (If I messed up, and any crate except for `arti` has non-breaking API changes, that's still fine, since they are all version 0.x.)
* netdir: remove duplicate code in param calculationNick Mathewson2023-01-281-23/+31
|