summaryrefslogtreecommitdiff
path: root/crates/tor-netdir
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
|
* netdir: remove the vestigial smallvec implementation I addedNick Mathewson2023-01-282-3/+2
| | | | | It's cute, but I don't think it will help performance, and I'm undecided about whether the semantic implications are true.
* Turn compute_ring_params into a method.Nick Mathewson2023-01-282-55/+61
|
* Several suggestions on gitlab.Ian Jackson2023-01-281-0/+2
|
* netdir: Implement ring-param constructors and time period accessorsNick Mathewson2023-01-285-19/+526
| | | | | | | | | | | | | | 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
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-274-0/+4
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Elide a bunch of lifetimes.Nick Mathewson2023-01-271-3/+3
| | | | | Clippy now warns about these; I'm not sure how these warnings snuck up on us.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-271-0/+1
| | | | | | | | 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.
* Merge branch 'onion-netdir-apis' into 'main'Nick Mathewson2023-01-114-1/+294
|\ | | | | | | | | Add onion service APIs to tor-netdir See merge request tpo/core/arti!966
| * Adjust onion service ring APIs in light of prop#342Nick Mathewson2023-01-114-38/+99
| | | | | | | | | | | | | | | | | | | | * 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-113-0/+232
| | | | | | | | | | | | | | | | | | 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.
* | netdir: add network parameters related to onion servicesNick Mathewson2023-01-111-1/+80
|/ | | | | | | These are available unconditionally, since they represent comparatively little storage and processing effort. See param-spec.txt section 8 for the original information here.
* test lint blocks: Add many many automaticallyIan Jackson2022-12-123-0/+26
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* test lint blocks: Do some semi-manuallyIan Jackson2022-12-121-0/+8
| | | | | | | This is the hunks from running the rune in maint/adhoc-add-lint-blocks but which require some subsequent manual fixup: usually, deleting now-superfluous outer allows, but in some cases manually putting back lints that the adhoc script deleted.
* Remove semver.md files now that 1.1.0 is released.Nick Mathewson2022-11-301-2/+0
|
* Bump the minor version of every crate.Nick Mathewson2022-11-301-11/+11
| | | | | We made this job easy this time around: by incrementing our MSRV, we have forced ourselves to do at least a minor bump everywhere.
* bump rust-version to 1.60 in every crate.Nick Mathewson2022-11-101-1/+1
|
* Mock implementation of a NetDirProvider for testing.Nick Mathewson2022-11-082-0/+61
| | | | | I'm about to remove the old testing APIs from GurdMgr that took in a NetDir in each function: adding this will make that possible.
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* Require derive_more 0.99.3Ian Jackson2022-11-031-1/+1
| | | | | | | | 0.99.[012] have a bug https://github.com/JelteF/derive_more/issues/114 which makes the Deref derive for bridgedesc::StateGuard not work and therefore breaks minimal-versions CI. It seems simpler to require the newer version everywhere.
* remove unused dependanciestrinity-1686a2022-10-291-3/+1
|
* FlagEvent trait: Implement using macrosIan Jackson2022-10-253-2/+9
| | | | | | | | | | | The explicit list of variant names, that needs to be kept in sync, and is a test failure semver break hazard, is now gone. All the necessary code is now generated automatically, and cannot be wrong. I want this because I find myself wanting to add a second implementation of FlagEvent, for another type.
* netdir: Expose addrs-in-same-subnets calculation from SubnetConfigNick Mathewson2022-10-242-8/+20
| | | | | Previously this was a private method only visible from Relay, but now we can use it on any two HasAddrs objects.
* cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-26/+1
| | | | | | | | The feature we want is `#[doc = include_str!("README.md")]`, which is stable since 1.54 and our MSRV is now 1.56. This commit is precisely the result of the following Perl rune: perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
* tor-linkspec: Remove the old OwnedFoo::new() functionsNick Mathewson2022-10-061-3/+15
| | | | These are now builders.
* Begin revising HasAddr and its relationship to ChanTargetNick Mathewson2022-10-061-1/+4
| | | | | | | | | | | | | | | | | | | HasAddr used to mean "Here are addresses that I have, at which I can be contacted." But "Where (and how) can I be contacted?" is now a question for HasChannelMethod to answer. (We still need to have "HasAddr", though, so we can answer things like "what country is this relay in" and "are these relays in the same /8?") So this commit introduces: * A new trait for adding an implementation of HasChannelMethod in terms of HasAddr. * A requirement on ChanTarget that it needs to implement HasChannelMethod. There is some temporary breakage here, marked with "TODO pt-client", that I'll fix later in this branch.
* Bump crates that have had backward compatible API changes.Nick Mathewson2022-10-031-4/+4
|
* Bump crates that have had no API changes.Nick Mathewson2022-10-031-1/+1
|
* fix clippy::needless_borrowtrinity-1686a2022-09-101-1/+1
|
* Remove semver.md from arti-1.0.0Nick Mathewson2022-09-071-4/+0
|