Commit Graph

316 Commits

Author SHA1 Message Date
Ian Jackson de995c1164 Expand docs for NetDirProvider
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).
2023-06-08 10:47:29 +01:00
Nick Mathewson 205b6d176c netdir, netdoc: Add accessors for protocol version status.
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.
2023-06-06 09:06:01 -04:00
Nick Mathewson daf5ecc153 Bump crate versions in preparation for v1.1.5 release.
Generated with the following commands:

```
cargo set-version --bump minor -p tor-cell
cargo set-version --bump minor -p tor-linkspec
cargo set-version --bump minor -p tor-proto
cargo set-version --bump minor -p tor-netdoc
cargo set-version --bump minor -p tor-circmgr

cargo set-version --bump patch -p tor-cert
cargo set-version --bump patch -p tor-basic-utils
cargo set-version --bump patch -p tor-rpcbase
cargo set-version --bump patch -p tor-llcrypto
cargo set-version --bump patch -p tor-hscrypto
cargo set-version --bump patch -p tor-checkable
cargo set-version --bump patch -p tor-async-utils
cargo set-version --bump patch -p caret
cargo set-version --bump patch -p fs-mistrust
cargo set-version --bump patch -p safelog
cargo set-version --bump patch -p retry-error
cargo set-version --bump patch -p tor-error
cargo set-version --bump patch -p tor-config
cargo set-version --bump patch -p tor-events
cargo set-version --bump patch -p tor-units
cargo set-version --bump patch -p tor-rtcompat
cargo set-version --bump patch -p tor-rtmock
cargo set-version --bump patch -p tor-protover
cargo set-version --bump patch -p tor-bytes
cargo set-version --bump patch -p tor-socksproto
cargo set-version --bump patch -p tor-consdiff
cargo set-version --bump patch -p tor-netdir
cargo set-version --bump patch -p tor-congestion
cargo set-version --bump patch -p tor-persist
cargo set-version --bump patch -p tor-chanmgr
cargo set-version --bump patch -p tor-ptmgr
cargo set-version --bump patch -p tor-guardmgr
cargo set-version --bump patch -p tor-dirclient
cargo set-version --bump patch -p tor-dirmgr
cargo set-version --bump patch -p tor-hsclient
cargo set-version --bump patch -p tor-hsservice
cargo set-version --bump patch -p arti-client
cargo set-version --bump patch -p arti-rpcserver
cargo set-version --bump patch -p arti-config
cargo set-version --bump patch -p arti-hyper
cargo set-version --bump patch -p arti
cargo set-version --bump patch -p arti-bench
cargo set-version --bump patch -p arti-testing
```
2023-06-01 10:03:05 -04:00
Nick Mathewson 41863bd622 guardmgr, netdir: fix some needless-mut warnings
Found by clippy nightly
2023-05-18 12:54:55 -04:00
Nick Mathewson dfa19998e2 Merge branch 'resolve_relay' into 'main'
netdir: New function to check consistency of a HasRelayIds

Closes #855

See merge request tpo/core/arti!1186
2023-05-16 22:12:29 +00:00
Nick Mathewson 4a779807e8 netdir: New function to check consistency of a HasRelayIds
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.
2023-05-16 17:45:21 -04:00
Nick Mathewson 6fa821238d Revise all XXXXs from fixup-features 2023-05-15 11:00:28 -04:00
Nick Mathewson 4b08ef76a0 Run fixup-features _with_ annotations.
This litters our Cargo.toml files with "XXX" entries that we should
fix.
2023-05-15 10:41:32 -04:00
Nick Mathewson e2e125fef7 Reformat Cargo.toml files. 2023-05-15 09:09:43 -04:00
Nick Mathewson 7a5373c110 Run fixup-features --no-annotate for initial Cargo.toml fixes.
This does the following:
  - Gives every crate a `full`.
  - Cause every `full` to depend on `full` from the lower-level
    crates.
  - Makes every feature listed _directly_ in `experimental` depend
    on `__is_experimental`.
2023-05-15 09:07:21 -04:00
Gabriela Moldovan 6b9e37e07c
tor-netdir: Shuffle the list of HS dirs used for downloading descriptors.
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 <gabi@torproject.org>
2023-05-04 17:53:58 +01:00
Gabriela Moldovan 30983c764f
tor-netdir: Update tests to parse the descriptor, make test consensus lifetime configurable.
Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-05-03 17:25:25 +01:00
Nick Mathewson e845a553f3 Upgrade tracing to 0.1.36.
This is the first version to impl Value for String.

With luck, this will get minimal_versions CI passing.
2023-05-03 11:09:21 -04:00
Nick Mathewson 1904cfc8b9 Increment crate versions.
Because of the errorkind bumps, we're calling this a breaking change
in everything lower-level than `arti`.

Generated with:
```
cargo set-version -p tor-basic-utils --bump minor
cargo set-version -p tor-async-utils --bump minor
cargo set-version -p caret --bump minor
cargo set-version -p fs-mistrust --bump minor
cargo set-version -p safelog --bump minor
cargo set-version -p retry-error --bump minor
cargo set-version -p tor-error --bump minor
cargo set-version -p tor-config --bump minor
cargo set-version -p tor-events --bump minor
cargo set-version -p tor-units --bump minor
cargo set-version -p tor-rtcompat --bump minor
cargo set-version -p tor-rtmock --bump minor
cargo set-version -p tor-rpcbase --bump minor
cargo set-version -p tor-llcrypto --bump minor
cargo set-version -p tor-protover --bump minor
cargo set-version -p tor-bytes --bump minor
cargo set-version -p tor-hscrypto --bump minor
cargo set-version -p tor-socksproto --bump minor
cargo set-version -p tor-checkable --bump minor
cargo set-version -p tor-cert --bump minor
cargo set-version -p tor-linkspec --bump minor
cargo set-version -p tor-cell --bump minor
cargo set-version -p tor-proto --bump minor
cargo set-version -p tor-netdoc --bump minor
cargo set-version -p tor-consdiff --bump minor
cargo set-version -p tor-netdir --bump minor
cargo set-version -p tor-congestion --bump minor
cargo set-version -p tor-persist --bump minor
cargo set-version -p tor-chanmgr --bump minor
cargo set-version -p tor-ptmgr --bump minor
cargo set-version -p tor-guardmgr --bump minor
cargo set-version -p tor-circmgr --bump minor
cargo set-version -p tor-dirclient --bump minor
cargo set-version -p tor-dirmgr --bump minor
cargo set-version -p tor-hsclient --bump minor
cargo set-version -p tor-hsservice --bump minor
cargo set-version -p arti-client --bump minor
cargo set-version -p arti-rpcserver --bump minor
cargo set-version -p arti-config --bump minor
cargo set-version -p arti-hyper --bump minor

cargo set-version -p arti --bump patch
cargo set-version -p arti-bench --bump patch
cargo set-version -p arti-testing --bump patch
```
2023-05-03 08:31:11 -04:00
Nick Mathewson 4efb423947 Upgrade our hex-literal dependency 2023-04-13 07:51:26 -04:00
Nick Mathewson 50d95964d1 Upgrade our num_enum dependency. 2023-04-13 07:50:11 -04:00
Nick Mathewson e26445b1b0 Use bool::then_some() as appropriate
Now that we require a version of Rust that allows
`b.then_some(v)`, clippy complains about our use of
`b.then(|| v)`.
2023-04-11 15:32:32 -04:00
Nick Mathewson 104d64589d Increment MSRV to 1.65 in every crate. 2023-04-11 15:31:12 -04:00
Ian Jackson b8b02b38f1 Merge branch 'hs' into 'main'
Download HS descriptors

See merge request tpo/core/arti!1118
2023-04-11 19:19:48 +00:00
Ian Jackson 23c56db111 tor-netdir: Fix capitalisation of a doc link
Fixes a rustdoc warning.
2023-04-11 19:31:10 +01:00
Ian Jackson df3e8242ea tor-netdir: Fix link to hs_time_period function
Fixes a rustdoc warning.
2023-04-11 19:31:10 +01:00
Ian Jackson 565b063a52 hs dirs: Note a thing we don't implement yet
We'll add this later, about here.
2023-04-11 19:14:01 +01:00
Ian Jackson d8ed32b321 hs dirs: Implement spread_fetch (fmt) 2023-04-11 19:14:01 +01:00
Ian Jackson 95125d9e72 hs dirs: Implement spread_fetch 2023-04-11 19:14:01 +01:00
Ian Jackson 3ea8f3b7e0 hs dirs: Fix wrong ignored variable name
This is the HsDirIndex, not the Hs[Blind]Id.
2023-04-11 19:14:01 +01:00
Ian Jackson a3945ad3c6 hs dirs: Replicas are 1-indexed 2023-04-11 19:14:01 +01:00
Ian Jackson a1241bca43 tor-netdir: Make an import more precise
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
2023-04-11 19:14:01 +01:00
Ian Jackson dfceb50f69 tor-netdir: testnet: Make all non-guard non-exits be hsdirs 2023-04-05 15:10:07 +01:00
Nick Mathewson 289007ef96 Merge branch 'debug-hex' into 'main'
Debug two types as compact hex strings

See merge request tpo/core/arti!1104
2023-04-03 12:31:27 +00:00
Ian Jackson aafdf755c0 Debug as hex strings for HsBlindId and HsDirIndex 2023-03-31 19:10:17 +01:00
Ian Jackson 8a045af479 Merge branch 'netdir' into 'main'
tor-netdir: API changes to support hsconn hsdir fetch

See merge request tpo/core/arti!1094
2023-03-31 17:12:42 +00:00
Nick Mathewson 9ef115a7fb Patchlevel bumps for crates whose dependencies just changed.
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
```
2023-03-31 08:30:14 -04:00
Nick Mathewson e208fb15ad Bump crate versions that have breaking changes
These crates have had breaking changes.  They are pre-1.0, so they get
a minor bump.

```
tor-basic-utils
tor-config
```
2023-03-31 08:28:06 -04:00
Nick Mathewson a81ab391ae Bump patchlevel on crates with non-breaking changes
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
```
2023-03-31 08:24:39 -04:00
Nick Mathewson 622c79aaa6 Bump patchlevel on crates with semver-irrelevant changes.
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
```
2023-03-31 08:20:58 -04:00
Ian Jackson 2eed641fb6 tor-netdir: iter_filter_secondary: Make it less of a mess
Prompted by
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1094#note_2891857
2023-03-30 17:02:47 +01:00
gabi-250 c7f924ff35 tor-netdir: Expand on comment for HsRingRings::iter 2023-03-30 16:02:27 +00:00
gabi-250 e7e305f9cd tor-netdir: Minor docs fixes 2023-03-30 15:37:07 +00:00
Ian Jackson 577940853f tor-netdir: Implmeent HsDirRing::find_pos 2023-03-30 15:53:51 +01:00
Ian Jackson 9b831933ef tor-netdir: Provide accessor for params field of HsDirParams 2023-03-30 15:47:06 +01:00
Ian Jackson 544d0e6d18 tor-netdir: Implement hs_dirs accessor 2023-03-30 15:47:06 +01:00
Ian Jackson 3c39c2f544 tor-netdir: hs_dirs accessor: change semantics, type, and name
Don't have it take the TP, so that the caller must call it multiple
times.  Instead, have it return all the relevant relays.
2023-03-30 15:47:06 +01:00
Ian Jackson e15f3c5348 tor-netdir: Provide hs_all_time_periods instead of ..._secondary_...
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.
2023-03-30 15:47:06 +01:00
Ian Jackson 4cf3cd00ef tor-netdir: Rename hs_time_period
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.
2023-03-30 15:47:06 +01:00
Ian Jackson db028a6d34 tor-netdir: Sort out HsDirOp
* Change its name to Hs* like we do with things at this layer
* Make the Upload variant cfg-conditional
2023-03-30 15:47:06 +01:00
Ian Jackson 4d3d79a511 tor-netdir: Reorganise iteration over hsdir rings
Provide iter_for_op, by changing iter into iter_filter_secondary and
having a new entrypoint iter.
2023-03-30 15:47:06 +01:00
Ian Jackson 7924e995f1 tor-netdir: Provide relay_by_rs_idx 2023-03-30 15:47:06 +01:00
Ian Jackson db968033cf tor-netdir: Make the hsdir ring be a TiVec
This eliminates an untyped `usize` index.
2023-03-30 15:43:48 +01:00
Ian Jackson 9940bd1eb4 tor-netdir: Use `pos` not `idx` in test network constructors
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.)
2023-03-27 17:32:16 +01:00
Ian Jackson 4da12a26a9 tor-netdir: Use `hsdir_index` for hidden service directory hashval (fmt) 2023-03-27 17:32:16 +01:00
Ian Jackson 325526a903 tor-netdir: Use `hsdir_index` for hidden service directory hashval
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.
2023-03-27 17:31:23 +01:00
Ian Jackson a746e17c8e tor-netdir: eliminate ref to abolished MdEntry
This was removed in c3e74973b4
  netdir: Use an even smaller rep for list of microdescs
2023-03-27 17:26:51 +01:00
Ian Jackson 99ffb89b48 tor-netdir: Use `rsidx` consistent for `RouterStatusIdx`
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.
2023-03-27 17:25:52 +01:00
Nick Mathewson d6bb8fee0b Upgrade to bitflags 2.0
This version of bitflags now requires us to explicitly list the
traits that we want to derive for our bit-flags structs.
2023-03-13 08:47:14 -04:00
Nick Mathewson 886faa96b3 Remove semver.md files now that 1.1.2 is out. 2023-02-28 10:06:41 -05:00
Nick Mathewson f41449d0bd Patchlevel bumps for remaining changed crates.
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
2023-02-28 07:13:27 -05:00
Nick Mathewson 3e1ae65212 Bump tor-units version for breaking change.
(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
2023-02-28 07:10:00 -05:00
Nick Mathewson 4479d52a88 Bump patch-versions for breaking changes in tor-hs{crypto,client}
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.
2023-02-28 07:06:15 -05:00
Nick Mathewson 3e257a7cb5 Bump minor versions for significant breaking changes.
This includes tor-cell, tor-proto, and tor-netdir.
2023-02-28 07:05:15 -05:00
Ian Jackson f63c7c48af Rename onion-* cargo features to hs-* in tor-* crates
Fixes #756
2023-02-28 11:10:17 +00:00
Ian Jackson 3d6e6fcf0d Fix minimal-versions (.then_some is too new) 2023-02-09 16:07:16 +00:00
Ian Jackson 4b7f2e84bf tor-netdir: Make is_hsdir_for_ring crate-local
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1012#note_2876824
2023-02-09 16:07:16 +00:00
Ian Jackson 4ca661a4dc tor-netdir: Document fill_from_previous_netdir semver 2023-02-09 14:57:29 +00:00
Nick Mathewson 8cda5a1a3e Clarify which netdir index is meant 2023-02-09 14:56:30 +00:00
Nick Mathewson 33b8ebd67e Fix typos 2023-02-09 14:48:56 +00:00
Ian Jackson 1f3f659536 Fix compilation with various feature combinations 2023-02-09 14:35:57 +00:00
Ian Jackson 335043658e hsdir: rustfmt
Deferred formatting changes which would have obscured the commits they
were prompted by.
2023-02-09 13:01:37 +00:00
Ian Jackson 3dd0d381d0 hsdir: Actually compute the hash ring 2023-02-09 13:01:37 +00:00
Ian Jackson f5c3c1f277 hsdir: Be able to enumerate the hidden service directories
* 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
2023-02-09 13:01:37 +00:00
Ian Jackson f12277141b hsdir: Ring calculation plumbing
* 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.
2023-02-09 13:01:37 +00:00
Ian Jackson fe1113bd6b hsdir representation: Introduce HsDirs generic type
This already allows us to get rid of some duplication, and will be
useful more widely in a moment.
2023-02-09 13:01:37 +00:00
Ian Jackson d63c44f96d hsdir: Implement HS hash ring index calculations 2023-02-09 13:01:37 +00:00
Ian Jackson a12df180b5 hsdir: Make HsDirIndex be AsRef<[u8; ]> 2023-02-09 12:56:47 +00:00
Ian Jackson 3f04e7f43e hsdir: impl Eq for HsDirParams
This will allow us to tell if we can reuse parts of a ring.
2023-02-09 12:56:18 +00:00
Ian Jackson 5fcae642d6 hsdir: Rename HsRingParams to HsDirParams
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.
2023-02-09 12:56:18 +00:00
Ian Jackson 962c879005 hsdir_params: Rename some variables for consistency
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.
2023-02-09 12:56:18 +00:00
Ian Jackson 5f52015239 hsdir: Replace open-coded params fields and args with HsRingParams
This will enable us to pass these around more conveniently.

And make empty_from_params take an owned params, which it would like.
2023-02-09 12:56:18 +00:00
Ian Jackson 8d4552de8b hsdir: Remove a done TODO - this *is* now a TiSlice 2023-02-09 12:56:18 +00:00
Ian Jackson cd0c38ae6c tor-netdir: Provide Netdir::md_by_idx
We'll need this shortly.
2023-02-09 12:56:18 +00:00
Ian Jackson 6acf9cf5e8 tor-netdir: Store previous netdir (if required by features) 2023-02-09 12:56:18 +00:00
Ian Jackson f69d7f96ac tor-netdoc: Change fill_from_previous_netdir
* 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.)
2023-02-09 12:56:18 +00:00
Ian Jackson 1e3d20bdba tor-netdir: Use typed-index-collections for router index (fix hsdir)
This was omitted in !1004.  (Because this code isn't actually wired up
yet, it typechecked anyway.  But we need to fix it.)
2023-02-09 12:56:18 +00:00
Ian Jackson 4626ccfcaa hs time handling: Make TimePeriod contain length as IntegerMinutes
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.
2023-02-09 12:56:18 +00:00
Nick Mathewson 99ec1c9818 tor-hscrypto: Rename key types to correspond to new spec names. 2023-02-08 12:27:36 -05:00
Ian Jackson d469aef72a Tidy up docs about RouterStatusIdx
Always use "index" and not "position".

Remove wording which is otiose given the type name.
2023-02-01 19:40:17 +00:00
Ian Jackson 2dbffa1208 tor-netdir: Use typed-index-collections for router status index 2023-02-01 19:40:17 +00:00
Ian Jackson b7e41c3981 tor-netdir: Provide ConsensusRelays extension trait (fmt) 2023-02-01 19:39:14 +00:00
Ian Jackson 4eee59ddb7 tor-netdir: Provide ConsensusRelays extension trait
Call it everywhere instead of the inherent method on MdConsensus.
(Verified by ad-hoc temporarily renaming MdConsensus::relays().)
2023-02-01 19:39:09 +00:00
Ian Jackson 155b9ed581 Change two in-code references to the wrong feature name
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.
2023-02-01 18:46:54 +00:00
Nick Mathewson 7c1b6a5a81 Bump the patch version of every crate that had API additions
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.
2023-02-01 10:36:29 -05:00
Nick Mathewson 66f594a4b6 Bump the patch-level version of crates with _minor_ changes.
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.)
2023-02-01 10:23:58 -05:00
Nick Mathewson f6cbd180a1 netdir: remove duplicate code in param calculation 2023-01-28 12:43:08 -05:00
Nick Mathewson 4e7a552171 netdir: remove the vestigial smallvec implementation I added
It's cute, but I don't think it will help performance, and I'm
undecided about whether the semantic implications are true.
2023-01-28 12:43:08 -05:00
Nick Mathewson 268a723e49 Turn compute_ring_params into a method. 2023-01-28 12:43:08 -05:00
Ian Jackson a51c76178e Several suggestions on gitlab. 2023-01-28 12:43:08 -05:00
Nick Mathewson 5236c5cf88 netdir: Implement ring-param constructors and time period accessors
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
2023-01-28 12:43:08 -05:00
Nick Mathewson a6dd92843e Allow clippy::unchecked_duration_subtraction in tests
This panics on error, and we're fine with a panic on misbehavior in
tests.
2023-01-27 08:28:02 -05:00
Nick Mathewson ed74c62931 Elide a bunch of lifetimes.
Clippy now warns about these; I'm not sure how these warnings snuck
up on us.
2023-01-27 08:28:02 -05:00
Nick Mathewson bf04641c68 Disable clippy::unlinlined-format-args
This warning kind of snuck up on us! (See #748)  For now, let's
disable it.  (I've cleaned it up in a couple of examples, since
those are meant to be more idiomatic and user-facing.)

Closes #748.
2023-01-27 08:27:47 -05:00
Nick Mathewson 7030cbe460 Merge branch 'onion-netdir-apis' into 'main'
Add onion service APIs to tor-netdir

See merge request tpo/core/arti!966
2023-01-11 16:08:18 +00:00