summaryrefslogtreecommitdiff
path: root/crates/tor-guardmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* tor-guardmgr: Add more tracing to update_guardset_internal.Wesley Aptekar-Cassels2025-10-221-3/+7
| | | | This would have been useful in looking into #2224.
* tor-guardmgr: Ignore cognitive_complexity lint.Wesley Aptekar-Cassels2025-10-161-0/+1
| | | | | While this is fairly nested, it's short, and most of the complexity is just in the logging code.
* tor-guardmgr: Use humantime for some logging.Wesley Aptekar-Cassels2025-10-162-2/+2
|
* tor-guardmgr: Add retry time to guard failure warning.Wesley Aptekar-Cassels2025-10-161-7/+14
| | | | | The "Next retry time unknown" message can't be hit right now, but could be if the code changes in the future.
* tor-guardmgr: Include retry time in AllGuardsDown error message.Wesley Aptekar-Cassels2025-10-161-1/+6
| | | | | I don't love shoving such a complicated expression in thiserror, but it seems nicer than writing the implementation by hand...
* tor-linkspec: Change HasAddrs::addrs to return an Iterator (fmt)Ian Jackson2025-10-061-1/+4
|
* tor-linkspec: Change HasAddrs::addrs to return an IteratorIan Jackson2025-10-064-17/+17
| | | | | | | | 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.
* opentelemetry: Add some instrument macros.Wesley Aptekar-Cassels2025-09-242-1/+7
| | | | | I've added these in places that are useful for the debugging that I've been doing.
* Move `FallbackDir` into `tor-dircommon`Clara Engler2025-09-115-577/+402
|
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-0711-98/+126
| | | | | | | | | | | | | | 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.
* Typo fixes (automatic and hand-verified)Nick Mathewson2025-07-092-2/+2
| | | | Made with https://crates.io/crates/typos-cli
* tor-dirmgr, tor-guardmgr: Use std::slice::from_ref as suggested by clippy.Gabriela Moldovan2025-07-071-2/+2
|
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* guardmgr, circmgr: Make vanguard selection take a RelaySelector.Nick Mathewson2025-05-202-20/+26
| | | | | | This is the preferred type for choosing a relay, since unlike a RelayExclusion, it lets us add multiple restrictions, and a relay usage.
* guardmgr: Fix clippy warning about needlessly owned cow.Nick Mathewson2025-05-151-1/+1
|
* Resolve clippy warnings from 1.83Nick Mathewson2025-05-131-1/+1
| | | | | Now that our MSRV is 1.83, clippy is happy to make more recommendations for us.
* Run cargo fmtNick Mathewson2025-03-181-11/+3
|
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-3/+3
| | | | - The Rng::gen() functions have been renamed to Rng::random().
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-182-2/+2
| | | | - Several methods have been moved out of SliceRandom.
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-187-9/+9
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* guardmgr: flag to indicate whether a FirstHop is a BridgeNick Mathewson2025-02-251-0/+9
| | | | | This will affect some details of path selection as we provide more info about families.
* 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.
* Disable a lot of dead code warningsIan Jackson2024-10-171-0/+3
| | | | | | | Now cargo check --workspace --no-default-features --all-targets cargo build -p arti --no-default-features --features=memquota,tokio,native-tls are both clean.
* Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-252-6/+6
| | | | | | The `derive_more` crate broke backward compatibility with this version, so this change involved quite a few manual fixups. With luck, they'll keep compatibility for some while in the future.
* tor-guardmgr: Convert a TODO into a NOTE.Gabriela Moldovan2024-09-101-1/+2
| | | | | | | | | This behavior is OK, so this doesn't need to be a TODO. See the discussion at https://gitlab.torproject.org/tpo/core/arti/-/issues/1352#note_3015217 Closes #1352
* tor-netdir: Allow access to the `ConsensusBuilder` when building test netdirs.Gabriela Moldovan2024-09-093-8/+8
| | | | | 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 typosDimitris Apostolou2024-09-033-3/+3
|
* extract tor_async_utils::oneshot into ::oneshot-fused-workaroundJim Newsome2024-08-283-3/+3
| | | | | | | | | | | | | | Having this in the `tor-async-utils` crate prevents us from doing both of the following without introducing a circular dependency: * using it in `tor-rtmock` (which we currently do, particularly in tests). * using `tor-rtmock` to test things in `tor-async-utils`. We don't do this yet, but it is generally sensible to do so. In particular we want to move the `stream_peak` module there, which is currently tested with `tor-rtmock`. Moving this into its own crate avoids this circular dependency.
* tor-guardmgr: Make some vanguard test helpers public (fmt).Gabriela Moldovan2024-06-201-10/+5
|
* tor-guardmgr: Make some vanguard test helpers public.Gabriela Moldovan2024-06-201-50/+67
| | | | | | We will soon need these helpers outside of `tor-guardmgr` too. This commit is mainly code motion.
* tor-guardmgr: Add test for vanguards state file deserialization.Gabriela Moldovan2024-06-031-2/+104
| | | | This checks that we can read `vanguards.json` state files.
* tor-config: Apply deferred cargo fmt.Gabriela Moldovan2024-06-031-1/+1
|
* tor-config: Add macro for implementing NotAutoValue.Gabriela Moldovan2024-06-031-2/+2
|
* tor-config: Add NotAutoValue trait bound to ExplicitOrAuto inner type.Gabriela Moldovan2024-06-031-1/+3
| | | | | | | This is a safeguard to prevent users from using ExplicitOrAuto with types that serialize to the same value as ExplicitOrAuto::Auto. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2146#note_3030692
* tor-guardmgr: Replace From impl with VanguardConfig::mode accessor.Gabriela Moldovan2024-06-032-10/+11
|
* tor-guardmgr: Fix broken doc link.Gabriela Moldovan2024-06-031-1/+1
|
* tor-guardmgr: Use ExplicitOrAuto in the VanguardConfig (fmt).Gabriela Moldovan2024-06-031-2/+8
|
* tor-guardmgr: Use ExplicitOrAuto in the VanguardConfigGabriela Moldovan2024-06-032-7/+18
|
* tor-guardmgr: Unconditionally define VanguardConfig.Gabriela Moldovan2024-06-033-17/+17
| | | | | | | | | We want to export the `VanguardConfig` even if the `vanguards` feature is disabled (we will need to unconditionally include it in the arti config). Note that if `vanguards` are disabled, the `VanguardMode` from the `VanguardConfig` can only be `Dsiabled`.
* tor-guardmgr: Map NoSuitableRelay errors to ErrorKind::NoPath.Gabriela Moldovan2024-05-091-2/+1
|
* tor-guardmgr: Add an error variant for when the vanguard mode is unsuitable.Gabriela Moldovan2024-05-092-8/+25
|
* tor-guardmgr: Return a BootstrapRequired error if all the sets are empty (fmt).Gabriela Moldovan2024-05-091-1/+6
|
* tor-guardmgr: Return a BootstrapRequired error if all the sets are empty.Gabriela Moldovan2024-05-092-14/+27
| | | | | | | | | Previously, `select_vanguard` returned a `NoSuitableRelay` error if it was unable to select a relay to use as a vanguard. We now distunguish the "there are no suitable relays in the vanguard sets" (`NoSuitableRelays`) error case from the "our vanguard sets are empty" (`BootstrapRequired`) one.
* tor-guardmgr: Fix typo in documentation.Gabriela Moldovan2024-05-091-1/+1
|
* tor-guardmgr: Add a BootstrapRequired error for VanguardMgr.Gabriela Moldovan2024-05-091-0/+9
|
* tor-guardmgr: Move VanguardMgrError to a separate module.Gabriela Moldovan2024-05-092-40/+50
| | | | | This is about to grow another variant, so I'm moving it to a dedicated `err` module.
* tor-guardmgr: Remove a nonsensical TODO.Gabriela Moldovan2024-05-091-1/+0
| | | | | | The `match` below it is fine, there's no need to rewrite it. (I think this TODO is actually dupe of the the TODO above it).
* tor-guardmgr: Remove TODO about removing Vanguard abstraction.Gabriela Moldovan2024-05-091-3/+0
| | | | | I think it's alright to keep it: it gives us the flexibility to extend it later on, if needed.