summaryrefslogtreecommitdiff
path: root/crates/tor-netdir/src
Commit message (Collapse)AuthorAgeFilesLines
* tor-netdir: Add timeliness param to wait_for_netdir_to_list.Wesley Aptekar-Cassels2024-11-251-1/+2
|
* Move helpers from tor-hsservice to tor-netdir.Wesley Aptekar-Cassels2024-11-251-1/+79
| | | | | These helpers seem potentially broadly useful, and only really discoverable if they're here.
* tor-netdir: Allow access to the `ConsensusBuilder` when building test ↵Gabriela Moldovan2024-09-091-1/+6
| | | | netdirs (fmt).
* tor-netdir: Allow access to the `ConsensusBuilder` when building test netdirs.Gabriela Moldovan2024-09-092-16/+16
| | | | | This allows us to set SRVs for example (needed because by default, the test `NetDir` is built from a consensus that doesn't contain any SRVs).
* Fix new "clippy::needless-maybe-sized" warning on nightlyNick Mathewson2024-07-281-1/+1
| | | | | This warning complains when we say `where T: SomeTrait + ?Sized` when `SomeTrait` is inherently Sized.
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* Use uXX::MAX in place of std::uXX::MAXNick Mathewson2024-04-221-3/+3
| | | | | | The old code produced a warning from clippy nightly; we may as well update to use the new associated consts. (They've been there since Rust 1.4x.)
* Merge branch 'vanguard-mgr-sets' into 'main'gabi-2502024-04-101-8/+52
|\ | | | | | | | | | | | | tor-guardmgr: Make lite vanguards work Closes #1275 and #1340 See merge request tpo/core/arti!2075
| * tor-netdir: Increase channel size to so set_netidr_and_notify doesn't block.Gabriela Moldovan2024-04-091-1/+1
| | | | | | | | | | `TestNetDirProvider::set_netidr_and_notify` blocks if the channel is full, so let's give it a non-zero size.
| * tor-netdir: Implement TestNetDirProvider::events().Gabriela Moldovan2024-04-051-8/+52
| |
* | Doc: tweak documentation on NetDir::id*listed functionsNick Mathewson2024-04-101-10/+9
| | | | | | | | | | Previously they were a bit confusing, and the public function explained its behavior in terms of the private one.
* | Doc: Add xref from NetDir::by_ids to ids_listed.Nick Mathewson2024-04-101-0/+7
|/ | | | | | | Explain that `by_ids` isn't what you want if you need to know whether a relay _definitely_ doesn't exist. Closes #1365
* Fix some rustdoc links and copypaste errors in tor-netdir.Nick Mathewson2024-04-042-5/+9
|
* tor-netdir: Abolish Relay::has_same_relay_idsIan Jackson2024-04-032-11/+5
| | | | This was an open-coded specialisation. Remove the one call site.
* Comment fixes in RelayDetails refactor.Ian Jackson2024-04-031-2/+4
|
* Move rs_is_dircache to details.rsNick Mathewson2024-03-282-9/+9
|
* Rename `Relay::same_relay` and make it private.Nick Mathewson2024-03-282-9/+7
| | | | | Everybody outside of tor-netdir should use HasRelayIds::same_relay_ids, whose intent is clearer.
* Remove all *Relay is_flagged_guard methods.Nick Mathewson2024-03-282-27/+3
| | | | These were only used for testing.
* Remove temporary functions in CheckedRelay.Nick Mathewson2024-03-281-169/+57
|
* Remove temporary functions in UncheckedRelay.Nick Mathewson2024-03-281-26/+6
|
* Move most functions from *Relay to *RelayDetailsNick Mathewson2024-03-282-22/+166
| | | | | | | | In *RelayDetails, this is just a matter of changing a bunch of `self`s to `self.0`. Additionally, I've added temporary stub functions to delegate to the new functions.
* Relocate declarations of *Relay methods to details.rsNick Mathewson2024-03-282-129/+141
| | | | This is 99% code movement.
* Add low_level_details to {Unchecked,}Relay.Nick Mathewson2024-03-272-0/+66
| | | | | | | | | | I'm going to use this wrapper type to hide checks that should mostly not be used without careful thinking. There are also comments here explaining when you'd want to use these types, and when you shouldn't. Part of #504.
* tor-netdir: Fix broken links in NetParameters docs.Gabriela Moldovan2024-03-261-3/+3
| | | | Spotted in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2053#note_3012632
* tor-netdir: Use IntegerSeconds for the vanguard lifetime params.Gabriela Moldovan2024-03-261-4/+4
|
* tor-netdir: Use consistent termninology in the vanguard param docs.Gabriela Moldovan2024-03-261-6/+6
|
* tor-netdir: Fix torspec links in vanguard param docs.Gabriela Moldovan2024-03-261-8/+8
|
* tor-netdir: Add the vanguard params to NetParameters.Gabriela Moldovan2024-03-261-0/+70
| | | | | | See also torspec!258 Part of #1272
* Run maint/add_warning.Nick Mathewson2024-03-136-0/+6
|
* netdir: Add additional functionality to SubnetConfigNick Mathewson2024-03-121-1/+62
| | | | We'll need this to implement restrictions more reasonably.
* Fix typos in doc commentsTobias Stoeckmann2024-03-061-1/+1
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* Note a calculation we can clean up after doing spec work.Nick Mathewson2024-02-201-1/+3
|
* Add caveats on is_flagged_guard, and note possible deprecationNick Mathewson2024-02-201-1/+15
|
* Add and use "UncheckedRelay::is_suitable_as_guard"Nick Mathewson2024-02-201-0/+5
|
* Only pick Fast relays as introduction points.Nick Mathewson2024-02-201-1/+1
| | | | This matches the behavior of C tor. Part of #1100.
* Require that guards are Fast and Stable.Nick Mathewson2024-02-201-0/+5
| | | | | | This matches the behavior of C tor. Part of #1100.
* netdir: Add Relay::is_flagged_{fast,stable} methods.Nick Mathewson2024-02-121-0/+14
|
* Rename parameters for intro-point lifetime to match the spec.Nick Mathewson2024-01-311-4/+4
| | | | | | | | | | (Also, correct the comments that describe them.) We may as well match the spec names when they aren't completely bogus. We are already renaming these parameters for this release, so it isn't an additional breaking change.
* Rename our aliases for hs_intro_*_lifetime.Nick Mathewson2024-01-251-2/+2
| | | | | | The old names were somewhat inaccurate. (I would have considered keeping and deprecating the old names, but we already have breaking changes in tor-netdir.)
* tor-netdir: Add a unit test for HsDirParams::offset_within_srv_period.Gabriela Moldovan2024-01-241-0/+37
|
* tor-hsservice: Make offset_within_srv_period() work with timestamps from ↵Gabriela Moldovan2024-01-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | newer periods. This fixes a bug where `offset_within_srv_period()` returns `None`, instead of the offset of `when` from the start of the SRV of the previous time period: ``` 2024-01-24T15:24:46Z ERROR tor_hsservice::svc::publish::reactor: descriptor upload failed for HS service allium-cepa2 and time period TimePeriod { interval_num: 19745, length: IntegerMinutes { value: 1440 }, epoch_offset_in_sec: 43200 }: error: Programming error: internal error (bug) at /../arti/crates/tor-hsservice/src/svc/publish/reactor.rs:218:13: current wallclock time not within SRV range?! (now=SystemTime { tv_sec: 1706109886, tv_nsec: 246572852 }, SRV_start=SystemTime { tv_sec: 1705968000, tv_nsec: 0 }) ``` We need to be able to calculate this offset even if `now` is not within the SRV range (because we upload the descriptor to the HsDirs of the *previous* time period too). Note a similar bug exited in `offset_within_period()` (which no longer exists) too! That one was fixed in !1744: ``` Hidden services can have multiple "active" time periods for which they generate descriptors. We need to be able to compute the offset of a timestamp from the start of a given time period, even if that timestamp falls within the "next" time period (for example, when publishing descriptors for the "previous" time period, the `when` timestamp will fall outside the `(start, end)` range of the "previous" time period). ```
* tor-netdir: Make hs_dirs_{upload, download} take separate args instead of tuple.Gabriela Moldovan2024-01-241-2/+4
| | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1904#note_2987777
* tor-netdir, tor-hscrypto: Add function for computing SRV period offset.Gabriela Moldovan2024-01-241-3/+22
| | | | Part of #1166
* tor-netdir: Simplify `hs_dirs_upload` by only returning the `Relay`.Gabriela Moldovan2024-01-241-20/+15
| | | | | | | | The publisher is the only user of `hs_dirs_upload`. It turns out it never actually uses the first element of the yielded `Item`s, so we can simplify `hs_dir_upload` to only return the HsDir `Relay`s. Part of #1166
* tor-netdir: Make hs_all_time_periods return HsDirParams.Gabriela Moldovan2024-01-241-3/+3
| | | | | | | | | The descriptor publisher uses this function to obtain the list of relevant time periods. It will soon also need to know the `srv_lifespan` associated with each time period, so we change this function to return `HsDirParams`. Part of #1166
* netdir: Make hs_dirs_upload() yield &HsDirParams.Nick Mathewson2024-01-231-2/+3
| | | | Closes #1254.
* Expose HsDirParams, and give it accessors.Nick Mathewson2024-01-232-2/+24
|
* hsservice: Make HsDirParams include the SRV lifespan.Nick Mathewson2024-01-232-11/+16
| | | | This is part of #1254.
* netdir: Only choose Stable relays as introduction points.Nick Mathewson2024-01-161-3/+1
| | | | | | This implements Relay::is_hs_intro_point. Close #1240.