summaryrefslogtreecommitdiff
path: root/crates/tor-netdir/src
Commit message (Collapse)AuthorAgeFilesLines
* relay: Crypto task now listens for new consensusDavid Goulet2026-05-261-0/+9
| | | | Signed-off-by: David Goulet <[email protected]>
* netdir: Add a debug_assert to ensure the voting interval is non-zeroGabriela Moldovan2026-05-211-0/+44
| | | | | This also adds a test, just make sure creating a `Lifetime` with voting interval = 0 is actually impossible (and stays that way).
* netdir: Add a test for start_of_sr_protocol_run()Gabriela Moldovan2026-05-211-0/+77
|
* netdir: Make start_of_sr_round() fallibleGabriela Moldovan2026-05-211-10/+12
| | | | | It's better to return a `Bug` than to panic if the consensus valid-after is invalid.
* netdir: Remove a no longer needed constantGabriela Moldovan2026-05-211-3/+0
|
* netdir: Remove start_of_day_containing()Gabriela Moldovan2026-05-211-29/+0
| | | | This is no longer used.
* netdir: Fix SRV lifetime calculation for non-standard voting periodsGabriela Moldovan2026-05-211-3/+25
| | | | | | | | | | | | | | Fixes Arti's SRV lifetime calculation for the case where the voting interval != 1h, and the consensus doesn't have explicit timestamps for the SRVs. Credit goes to dgoulet for this fix! See also [this thread], and #2458 for the broader context. Closes #2522 [this thread]: https://gitlab.torproject.org/tpo/core/arti/-/work_items/2458#note_3401343
* Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-122-12/+12
| | | | | | | | | | | When the circ-padding feature is enabled, we use maybenot, which does not yet support rand 0.10. In the meantime, enabling this feature pulls in rand 0.9. This is not ideal, but should be okay as a temporary situation. This also replaces the use of ReseedingRng (which was removed in 0.10) with the reseeding_rng crate. This is somewhat less performant, but it should be okay.
* geoip: Make asn data conditional.Nick Mathewson2026-04-151-1/+1
| | | | | | | | | | | | This abolishes the NetDefn type, and turns DenseRangeDb into a map to one or (optionally!) two types. For the DBs we ship, which don't have asn information, this saves about 2.5 MiB. (It also probably saves a bit more, since the niche optimization didn't apply to NetDefn as it existed before, since it tried to distinguish Some(None,None) from None.)
* geoip: Migrate code to DenseRangeMap.Nick Mathewson2026-04-151-1/+1
| | | | | This required correcting some errors in our previous ersatz geoip databases.
* NetDir::pick_relay: add a little more info to error reportsJim Newsome2026-04-021-1/+6
| | | | In particular to help debug arti#1907
* NetDir::pick_relay: add some trace loggingJim Newsome2026-04-021-1/+6
|
* hsdir_params: add debug log when we fall back to disaster paramsJim Newsome2026-04-021-2/+4
|
* tor-netdir: port to web-time-compat.Nick Mathewson2026-03-262-3/+4
|
* Fix grammar typosTobias Stoeckmann2026-03-151-1/+1
|
* Fix word duplicate typosTobias Stoeckmann2026-03-152-3/+3
|
* Merge branch 'flags-url' into 'main'Clara Engler2026-03-121-0/+3
|\ | | | | | | | | tor-netdir: Add spec link to flag descriptions See merge request tpo/core/arti!3768
| * tor-netdir: Add spec link to flag descriptionsIan Jackson2026-03-111-0/+3
| |
* | tor-netdir: Simply exit documentationClara Engler2026-03-091-7/+0
| | | | | | | | No need to over-engineer this, let's keep it simple.
* | tor-netdir: Add is_flagged_exit() to RelayDetailsClara Engler2026-03-051-0/+11
|/ | | | | | | | | | | This commit adds a method called `is_flagged_exit` to `RelayDetails` in order to check whether the node is considered to be usable as an exit or not. In the Tor VPN app, we need this feature for generating a list of exit relays (per country). Right now, we do this in an incorrect way by only checking on whether port 443 is in the exit policy, which is not a sufficient criteria.
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* Merge branch 'ticket1223' into 'main'Nick Mathewson2025-12-042-1/+74
|\ | | | | | | | | | | | | Refactor common code that builds circtargets for HS. Closes #1223 See merge request tpo/core/arti!3530
| * Refactor common code that builds circtargets for HS.Nick Mathewson2025-12-042-1/+74
| | | | | | | | | | | | | | | | | | This code was duplicated across hsclient and hsservice. Logically, it belongs in netdir, since that's where we have the latest required-protocol information, and the ability to look up relays by IDs. Closes #1223
* | Remove unnecessary `doc(cfg(...))` attributesNeel Chauhan2025-12-042-4/+0
|/ | | | | | | | | Fixes part of #2193. (Edits from nickm: I selected the cases here that I could verify were correct from immediate context.) Edited-by: Nick Mathewson <[email protected]>
* RelayFlags: Use RelayFlag enum variant names everywhereIan Jackson2025-11-183-17/+17
| | | | | | | Abolish the constants with the transitional names. This also abolishes the controversial name `H_S_DIR`, which Rust case transformation rules generated from `HSDir`.
* RelayFlags: Use the singular RelayFlag for naming individual flagsIan Jackson2025-11-183-20/+20
| | | | | | | | | | | | | | We're going to separate RelayFlag from RelayFlags. We could continue to provide a bunch of constant values for RelayFlags, for each individual type, but that would involve an ad-hoc derive, and would still be a bit of an unusual API. Instead, we're going to make ``RelayFlag` a normal enum. In this commit, we change everyone to refer to it by its singular name. Hopefully separating out this bulk change makes both this, and the core commit, easier to review.
* tor-netdoc: Remove the RelayFlags type alias in netstatusIan Jackson2025-11-183-4/+5
| | | | I would do `#[deprecated]` but empirically that has no effect...
* tor-netdoc: Rename RelayFlags elements for regularity vs specIan Jackson2025-11-182-4/+4
| | | | | Add underscores so that the spec keywords and the flag constants correspond (according to `paste`'s case-changing rules).
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-066-7/+7
| | | | Run maint/add_warning
* tor-netdoc: RouterStatus: unify `orport_addrs` and `addrs` methodsIan Jackson2025-10-061-2/+2
| | | | | | | We had two functions with different return types but identical semantics. Replace them with one function returning `impl Iterator`. Make it return owned addresses. These are small.
* tor-linkspec: Change HasAddrs::addrs to return an IteratorIan Jackson2025-10-061-4/+3
| | | | | | | | This will let us model the actual structure of routerstatus entries in netdocs more closely. They don't have the addresses in a single list. When this code was written this would have been much more awkward, but now we have RPITIT.
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* Merge branch 'xon-xoff-checker' into 'main'David Goulet2025-09-151-0/+33
|\ | | | | | | | | tor-proto,tor-netdir: add flow control consensus parameters See merge request tpo/core/arti!3249
| * tor-netdir: add flow control parameters to `NetParameters`Steven Engler2025-09-101-0/+33
| |
* | tor-netdir: change default `cc_alg` from 0 to 2Steven Engler2025-09-101-5/+1
|/ | | | | | | | This is fine because we still default to non-cc circuits unless the "flowctl-cc" feature is enabled. See `exit_circparams_from_netparams` and `onion_circparams_from_netparams` from `tor_circmgr::build`, where both will only call `build_cc_vegas()` if `cfg(feature = "flowctl-cc")`, and otherwise call `build_cc_fixedwindow()`.
* tor-netdir: Removed dependency on `static_assertions`hashcatHitman2025-09-011-2/+1
| | | | | | | | Replaced use of [`static_assertions::const_assert`] with the newly available "assert in const" pattern. This completely removes the dependency on `static_assertions` for `tor-netdir`. Signed-off-by: hashcatHitman <[email protected]>
* tor-netdoc: Apply much rustfmt churnIan Jackson2025-08-263-10/+5
|
* tor-netdoc: Combine ConsensusRouterStatus and GenericRouterStatusIan Jackson2025-08-263-14/+14
| | | | Now we only need one type.
* tor-netdoc: Abolish RouterStatus trait in favour of generic methodsIan Jackson2025-08-261-2/+2
| | | | | Our approach to sharing code between md and plain consensuses is now the new "variety" system, not generics.
* tor-netdoc: Remove generics from Consensus and its contentsIan Jackson2025-08-263-12/+12
|
* tor-netdoc: netstatus: Move everything variety-specificIan Jackson2025-08-263-14/+14
| | | | | | | | | This is much code motion. This splits many types into two. For example, `Conensus` is now`plain::Consensus<RS>` and `md::Consensus<RS>`. We're going to get rid of the generics later in this branch.
* clippy: fix `clippy::duplicated_attributes` warningsSteven Engler2025-08-111-1/+0
| | | | | | | | | | ```text warning: duplicated attribute --> crates/tor-hsservice/src/timeout_track.rs:630:14 | 630 | #![allow(clippy::needless_pass_by_value)] // TODO hoist into standard lint block | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ```
* Fix warnings and errors from edition 2024.Nick Mathewson2025-08-071-28/+20
| | | | | | | | | | The two main causes of errors were: - Since some of the lifetime rules have changed, we no longer need to do as many "bind a variable and immediately return it" patterns, and so clippy now warns about them. - We needed to adjust the explicit captures (`use<...>`) in a couple of our RPIT instances.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-074-29/+30
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* tor-hsservice: Time out RendRequests in PoW queue.Wesley Aptekar-Cassels2025-08-051-1/+0
|
* tor-hsservice: Add consensus params for Prop 362.Wesley Aptekar-Cassels2025-08-051-0/+25
| | | | | | | | | | | This adds the three new parameters specified in Prop 362 [0]. Two of these replace hardcoded defaults in the code. The third, HiddenServiceProofOfWorkV1ServiceIntroTimeoutSeconds, is not implemented yet, but will be in a future commit. [0]: https://spec.torproject.org/proposals/362-update-pow-control-loop.html
* Fix errors from rustdoc nightly.Nick Mathewson2025-08-051-1/+1
|
* Merge branch 'prop360-combined' into 'main'Nick Mathewson2025-07-101-0/+10
|\ | | | | | | | | | | | | Implement proposal 360 (limit HsDesc inflation opportunities) Closes #2046 See merge request tpo/core/arti!3070
| * Suggestions from @gabi-250 on prop360 implementation.Nick Mathewson2025-07-101-1/+1
| |