summaryrefslogtreecommitdiff
path: root/crates/tor-netdir/src
Commit message (Collapse)AuthorAgeFilesLines
* 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
| |
| * netdir: new parameters from prop360.Nick Mathewson2025-07-101-0/+10
| | | | | | | | (maxima are as amended in torspec!411)
* | Typo fixes (automatic and hand-verified)Nick Mathewson2025-07-092-2/+2
|/ | | | Made with https://crates.io/crates/typos-cli
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* NetParameters::saturating_update: log when a value is out of rangeJim Newsome2025-06-231-1/+71
| | | | | | | On one hand, this can be quite noisy when something *is* out of range. On the other hand, a clamped value shouldn't normally happen, and is likely to result in surprising and otherwise difficult-to-debug behavior.
* Log unrecognized net paramsJim Newsome2025-06-231-1/+4
|
* Merge branch 'hs-interval-min' into 'main'Nick Mathewson2025-06-101-1/+1
|\ | | | | | | | | tor-netdir: decrease minimum hsdir_interval from 30 to 5 See merge request tpo/core/arti!3042
| * tor-netdir: decrease minimum hsdir_interval from 30 to 5Jim Newsome2025-06-101-1/+1
| | | | | | | | | | | | | | | | This matches the spec change: <https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/406> Progress on: <https://gitlab.torproject.org/tpo/core/chutney/-/issues/40038>
* | proto: Move NegotiatedHopSettings to a higher levelNick Mathewson2025-06-101-0/+10
|/ | | | | | We will construct this object based on the circuit parameters _and_ on the target's supported protocol versions, so we need to do so when we have both pieces of info.
* NetDir::pick_n_relays: avoid some unwarranted warningsJim Newsome2025-06-051-3/+4
| | | | | | | | | | | | | | | | Previously we logged a warning whenever `choose_multiple_weighted` returns `Ok(iter)`, whenever `iter` contains fewer relays than requested. However, this is expected behavior of `choose_multiple_weighted` if the filtered list of relays doesn't have the requested number of relays, in which case it should return all of the relays in the filtered list. In particular, this condition occurs regularly in test networks when looking for candidate relays to add to the potential guard set while excluding those already in the potential guard set. We still warn if the returned list is fewer than requested, *and* fewer than available in the filtered list.
* netdir, relay-selection: require Fast and Stable for rendpoints.Nick Mathewson2025-05-201-1/+3
| | | | | | 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-202-6/+10
| | | | | | > 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: fix warning about an opportunity to use saturating_subNick Mathewson2025-05-151-5/+1
|
* tor-netdir: Warn on one more case of insufficient itemsNick Mathewson2025-04-291-1/+12
| | | | | | Now that choose_multiple_weighted can once more return fewer items than requested, we should warn when it does so, to be consistent with our other cases of warning about #1907.
* tor-netdir: test for rand 0.9.1 behavior instead of 0.9.0Nick Mathewson2025-04-291-3/+9
| | | | | | | | Rand 0.9.1 reverted the changes that caused #1903, in https://github.com/rust-random/rand/pull/1623. This broke our test that made sure that rand wasn't going to change their behavior _again_ :)
* Merge branch 'todos-msrv' into 'main'Jim Newsome2025-04-241-3/+0
|\ | | | | | | | | various crates: MSRV TODO standardization and cleanup of an old TODO See merge request tpo/core/arti!2945
| * tor-netdir: remove lint allow as per TODOhashcatHitman2025-04-161-3/+0
| | | | | | | | | | - https://github.com/rust-lang/rust-clippy/issues/11764 was fixed upstream, so this is no longer needed.
* | Rename recommended_protocols to protocol_statuses.Nick Mathewson2025-04-162-4/+4
| | | | | | | | | | This name reflects its purpose better than the original one, since it includes required protocols as well as recommended ones.
* | netdir: Add a recommended_protocols() to NetDirProviderNick Mathewson2025-04-162-0/+19
| |
* | dirmgr, netdir: Store protocol requirments as soon as they are validated.Nick Mathewson2025-04-161-0/+4
| |
* | Fix another miscapitalized "MicroDesc"Nick Mathewson2025-04-161-1/+1
|/
* netdir: Add a (hopefully) temporary workaroundNick Mathewson2025-03-251-3/+27
| | | | | Instead of doing the more sensible thing when every relay has weight 0, give a warning message.
* netdir: Add a note about using f64Nick Mathewson2025-03-251-0/+8
|
* netdir: Another test for choose_multiple_weighted.Nick Mathewson2025-03-251-0/+17
| | | | | | Here we test the (arguably inconsistent behavior) where can we return fewer items than requested if no item had zero weight. (If this ever becomes an error, we need to modify the calling code.)
* netdir: Warn on unexpected WeightedErrorsNick Mathewson2025-03-251-5/+13
| | | | | | WeightedError::InsufficientNonzero is expected under some circumstances, but the other instances would mean that we have a bug.
* netdir: add a test to verify weighted samplingNick Mathewson2025-03-251-3/+37
| | | | | We want to make sure that behavior for 0-weighted elements is consistent for choose_multiple_weighted and choose_weighted.
* tor-netdir: Handle InsufficientNonZero error.Nick Mathewson2025-03-201-0/+8
| | | | Possible fix for #1902.
* Merge branch 'named_protovers' into 'main'David Goulet2025-03-201-2/+2
|\ | | | | | | | | | | | | protover: Add support for subprotocol version mnemonics. Closes #1891 See merge request tpo/core/arti!2854
| * Use named subprotocol versions throughout arti.Nick Mathewson2025-03-121-2/+2
| |
* | squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-2/+2
| | | | | | | | - The Rng::gen() functions have been renamed to Rng::random().
* | squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | | | | | - Several methods have been moved out of SliceRandom.
* | squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
|/ | | | - The rand::distributions module has been renamed to rand::distr
* netdir: Consider RelayFamilyIds based on family rulesNick Mathewson2025-02-252-12/+28
| | | | | | | 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-251-0/+63
| | | | | | | | | | | | 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.
* netdir: Add client params related to happy families (prop321)Nick Mathewson2025-02-251-0/+10
|
* fix: fix typosDimitris Apostolou2025-01-301-1/+1
|
* netdir: Add congestion control consensus parametersDavid Goulet2025-01-161-22/+101
| | | | | | Related #534 Signed-off-by: David Goulet <[email protected]>
* tor-netdir: Add KIST consensus params.Gabriela Moldovan2025-01-151-0/+26
| | | | | | These are tentative, so I haven't added them to param-spec yet. Part of #1729
* 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
* Resolve clippy::empty_line_after_doc_comments warnings.Nick Mathewson2024-12-032-2/+1
| | | | These are new in Rust 1.83.
* 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: 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