summaryrefslogtreecommitdiff
path: root/crates/tor-relay-selection/src
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* RelayFlags: Use RelayFlag enum variant names everywhereIan Jackson2025-11-181-2/+2
| | | | | | | 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-181-3/+3
| | | | | | | | | | | | | | 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-181-1/+1
| | | | I would do `#[deprecated]` but empirically that has no effect...
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-064-5/+5
| | | | Run maint/add_warning
* tor-linkspec: Change HasAddrs::addrs to return an IteratorIan Jackson2025-10-061-5/+4
| | | | | | | | 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.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-072-6/+10
| | | | | | | | | | | | | | 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.
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* Improve descriptions of rejected relays: omit "rejected 0/X"Nick Mathewson2025-06-251-3/+5
| | | | | | | | Now instead of saying "rejected 0/40 as not usable as middle relay; 28/40 as in same family as already selected", we say "rejected 28/40 as in same family as already selected". Closes #2006.
* tor-relay-selection: Removed dependency on `once_cell`hashcatHitman2025-06-141-2/+2
| | | | | | - Replaced `once_cell::sync::Lazy` with `std::sync::LazyLock`. Signed-off-by: hashcatHitman <[email protected]>
* relay-selection: Rename RendPoint usage to NewRendPoint.Nick Mathewson2025-05-201-8/+10
| | | | | | | This mirrors NewIntroPoint, and helps us to remember that we only want to use this usage when we're a client that's picking a rendezvous point; we don't want to enforce it when we're a relay connecting to a client-selected rendezvous point.
* relay-selection: tweak messages about rejection reasonsNick Mathewson2025-05-202-5/+5
| | | | | | "Useless as xyz" implies that the relay wouldn't work at all as a middle relay, but that's not true: it _would_ work somewhat, but be can't use it for some other reason.
* netdir, relay-selection: require Fast and Stable for rendpoints.Nick Mathewson2025-05-201-1/+1
| | | | | | Since we don't know what kind of traffic we'll use a rendezvous point for, we don't want to use it if it isn't "Fast" (reasonably high bw) and "Stable" (unlikely to crash soon).
* hs: Prevent a client from using a `MiddleOnly` relay for onion servicesNeel Chauhan2025-05-201-0/+13
| | | | | | > The actual impact of this patch is to prevent usage of MiddleOnly > relays as Introduction Points. The Rendezvous Point logic isn't > hooked up yet - nick
* netdir: Consider RelayFamilyIds based on family rulesNick Mathewson2025-02-251-15/+45
| | | | | | | This implements the client side of proposal 321. It's a breaking change in netdir, since in_same_family now takes an extra argument.
* relay-selection: Add FamilyRules to exclude_relays_in_same_family.Nick Mathewson2025-02-252-6/+24
| | | | | | | | | | | | When we're trying to exclude relays by family, we need to know which lists to look at. This information ultimately comes from the network parameters. We could avoid this change if we just told clients "look at all family information all the time", but that's not what the proposal says. This is a breaking change.
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* tor-netdir: Allow access to the `ConsensusBuilder` when building test netdirs.Gabriela Moldovan2024-09-091-1/+1
| | | | | 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).
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* tor-relay-selection: Introduce RelayUsage::vanguard.Gabriela Moldovan2024-04-221-0/+22
| | | | | | | | | | | This adds a new `RelayUsage` for vanguards. As per the original [vanguards implementation], vanguards must: * have the Fast, Stable, and Valid flags * be selected using the `Middle` weight Part of #1364 [vanguards implementation]: https://github.com/mikeperry-tor/vanguards
* Rename `Relay::same_relay` and make it private.Nick Mathewson2024-03-281-1/+1
| | | | | 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-281-1/+4
| | | | These were only used for testing.
* Remove temporary functions in CheckedRelay.Nick Mathewson2024-03-283-15/+37
|
* Run maint/add_warning.Nick Mathewson2024-03-134-0/+4
|
* Fix some rustdoc warnings.Nick Mathewson2024-03-121-1/+1
| | | | | These are mostly about explicitly linking to things that were already in scope.
* tor-relay-selection: Use partition() in testing code.Nick Mathewson2024-03-121-9/+3
|
* Rename and clarify result_is_relaxed.Nick Mathewson2024-03-121-5/+5
|
* Refactor RelaySelector to make its invariants less subtle.Nick Mathewson2024-03-121-48/+61
|
* Add a comment about future extensions to RestrictionInner.Nick Mathewson2024-03-121-0/+6
|
* tor-relay-selector: Clarify "flexible" vs "relaxed" a little.Nick Mathewson2024-03-121-1/+2
|
* relay-selection: Remove the extension traits for Relay and NetDirNick Mathewson2024-03-122-64/+0
| | | | | | I thought we would need these, but after the latest refactoring they turned out not to have any users, and one of them had only deprecated methods. Best just to drop them.
* Rename the RelayPredicate trait to discourage its being used directly.Nick Mathewson2024-03-125-26/+42
| | | | Everybody who can, should instead use a RelaySelector.
* New crate to define a high-level API for relay selectionNick Mathewson2024-03-127-0/+1649
|
* Create a new empty tor-relay-selection crate.Nick Mathewson2024-03-121-0/+42