aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-dirmgr/src
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-dircommon: Make config non_exhaustiveClara Engler2025-09-091-4/+1
|
* Move `DirTolerance` into `tor-dircommon`Clara Engler2025-09-092-67/+4
| | | | | This commit moves the `DirTolerance` structure from `tor-dirmgr` into `tor-dircommon`.
* Move `DownloadSchedule` into `tor-dircommon`Clara Engler2025-09-085-281/+5
| | | | | This commit moves the `DowenloadSchedule` related types from `tor-dirmgr` into `tor-dircommon`.
* Move `NetworkStatus` to `tor-dircommon`Clara Engler2025-09-083-77/+9
| | | | | | This commit moves `NetworkStatus` from `tor-dirmgr::config` to `tor-dircommon::config` in order to start the work on a common place for configuration options shared by both directory implementations.
* tor-dircommon: Initial commitClara Engler2025-09-024-143/+4
| | | | | | | | | | | | | | This commit initializes the `tor-dircommon` crate: A crate serving the purpose to form an umbrella for the lowest common denominator primitives found across crates implementing (parts of) the directory specification. For now, the only such primitive is the found within the `authority` module, which has been refactored from `tor-dirmgr` into this crate, alongside additional getter functions due to the lack of `pub(crate)` in this context. In the future, we may move further primitives away from `tor-dirmgr` into `tor-dircommon`.
* misc: cleanup now that `_report!` macros support fieldsSteven Engler2025-08-181-2/+1
|
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-0713-76/+98
| | | | | | | | | | | | | | 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.
* Update code for Edition 2024Nick Mathewson2025-08-072-2/+2
| | | | | | | | | | | | | | | | | | 1. Run cargo fix --edition 2. Selectively revert the "if let"->"match" changes. These changes are meant to protect us from the lifetime changes for "if let" bindings in Rust 2024. But we're not actually relying on the old lifetime rules anywhere, and the match syntax here is quite ugly. 3. Automatically revert `$pat:expr_2021` to `$pat:expr`. (We don't actually want to restrict the expression syntax that our macros accept). Done with `git grep -l expr_2021 | xargs perl -i -pe 's/expr_2021/expr/g;'` 4. Run cargo fmt.
* dirmgr: Rename circuit to tunnelDavid Goulet2025-08-051-3/+3
| | | | Signed-off-by: David Goulet <[email protected]>
* config-path, dirmgr, general-addr: Remove unnecessary parentheses (fmt).Gabriela Moldovan2025-07-151-2/+1
|
* config-path, dirmgr, general-addr: Remove unnecessary parentheses.Gabriela Moldovan2025-07-151-1/+1
| | | | This resolves some nightly clippy warnings.
* tor-dirmgr, tor-guardmgr: Use std::slice::from_ref as suggested by clippy.Gabriela Moldovan2025-07-071-4/+4
|
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* tor-dirmgr: Removed dependency on `once_cell`hashcatHitman2025-06-142-6/+9
| | | | | | - Replaced `once_cell::sync::Lazy` with `std::sync::LazyLock`. Signed-off-by: hashcatHitman <[email protected]>
* *: suppress cognitive_complexity warnings from nightlyNick Mathewson2025-05-292-0/+7
| | | | | | | | | | | | | Apparently clippy nightly is better (or worse?) about detecting complex functions than before, so I'm suppressing these warnings where they occur. I have mixed feelings about these warnings: On the plus side, they really do help to detect functions that are twistier than they need to be. On the minus side, they get confused by tracing macros, and the "allows" do pile up. But on the plus side, those "allows" do provide a way to find functions that need to be refactored, and they are never uglier than the functions they decorate.
* Rename recommended_protocols to protocol_statuses.Nick Mathewson2025-04-162-9/+9
| | | | | This name reflects its purpose better than the original one, since it includes required protocols as well as recommended ones.
* protover, *: Add documentation about what "supported" means.Nick Mathewson2025-04-161-1/+2
|
* dirmgr: Always apply changes before advancing consensus.Nick Mathewson2025-04-161-6/+6
| | | | | | | | | | | In the directory code, we have functionality to advance the consensus download state whenever possible, even if there is more we could download in the current state. That's fine, but when we're in this position, we need to be sure that we're taking any action based on the current state (such as installing notably parameters or, notably, protocol recommendations) before we move on.
* Add warnings about removing supported protocols.Nick Mathewson2025-04-161-0/+2
|
* netdir: Add a recommended_protocols() to NetDirProviderNick Mathewson2025-04-161-0/+4
|
* dirmgr, netdir: Store protocol requirments as soon as they are validated.Nick Mathewson2025-04-164-5/+56
|
* dirmgr: Backend support for cacheing protocol status.Nick Mathewson2025-04-163-2/+137
| | | | | | | We want to store this separately from the consensus, because we want to access it very early in our load-from-cache process, without checking the consensus that contains it for timeliness.
* New functions to report supported subprotocolsNick Mathewson2025-04-161-0/+18
| | | | | | | | | | | | | | | Part of #1849. Note that these functions are distributed across crates, so that if (in the future) we stop doing API breaks with every release, we will get the right outputs. Note also that these functions build the list of protocols out of specific symbolic features, rather than numbers: this makes it easier to avoid errors about "which feature was Relay=4 again", and easier to avoid accidentally referring to a protocol that doesn't exist, like "Consensus" (should be "Cons") or "HsDir" (case is wrong).
* fix `clippy::doc_overindented_list_items`Steven Engler2025-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | Example: ```text warning: doc list item overindented --> crates/arti-rpc-client-core/src/conn/connimpl.rs:322:9 | 322 | /// indicates that no more messages will be received for this request. | ^^^ help: try using ` ` (2 spaces) | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items note: the lint level is defined here --> crates/arti-rpc-client-core/src/lib.rs:8:9 | 8 | #![warn(clippy::all)] | ^^^^^^^^^^^ = note: `#[warn(clippy::doc_overindented_list_items)]` implied by `#[warn(clippy::all)]` ```
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-182-6/+6
| | | | - The Rng::gen() functions have been renamed to Rng::random().
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-184-4/+4
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* netdoc: Make some parsing init functions fallible.Nick Mathewson2025-03-171-2/+7
| | | | | | | I'm about to make our parsers reject some strings at construction time, so it makes sense to have these functions become fallible. This is a breaking change.
* tor-rtmock: allow-Decorate every use of MockSleepProviderIan Jackson2025-03-061-0/+2
| | | | | | | MockSleepProvider and MockSleepRuntime have been declared deprecated by the docs for some time. We're about to mark them `#[deprecated]`. This commit has been split out for clarity of review.
* tor-dirmgr: remove `dbg!`Steven Engler2025-03-051-1/+0
|
* sqlite: Handle vanished blobs during consensus loadingNick Mathewson2025-03-051-16/+38
| | | | | | | | | Here we move the responsibility for removing ExtDoc entries for vanished blobs into the _caller_ of read_blob(): we want to tidy all such entries in one go. Unlike a (reverted) previous approach, this time we don't need a retry loop.
* sqlite: add a method to tidy extdocs for vanished blobsNick Mathewson2025-03-051-1/+93
|
* sqlite.rs: Let read_blob signal whether it cleaned up.Nick Mathewson2025-03-051-8/+28
| | | | We'll want to use this information to tell us whether to retry.
* sqlite: Extract body of latest_consensus into a new methodNick Mathewson2025-03-051-23/+33
| | | | I'm about to add a retry mechanism.
* sqlite: Stop ignoring any errors.Nick Mathewson2025-03-051-3/+22
| | | | | We've already stopped ignoring any DB errors, so we may as well make sure that any FS errors we encounter are also reported.
* sqlite: Add a comment about O(n) query.Nick Mathewson2025-03-051-0/+2
|
* sqlite.rs: Rustfmt.Nick Mathewson2025-03-051-86/+87
|
* sqlite.rs: Put SavedBlobHandle into its own moduleNick Mathewson2025-03-051-13/+30
| | | | | | | This will help us keep its members private from the rest of sqlite.rs, and ensure that things are kept consistent. (This violates rust formatting for clarity. I'll reindent after.)
* sqlite.rs: More comments about blob rollback.Nick Mathewson2025-03-051-1/+7
|
* sqlite.rs: Give SavedBlobHandle more methods.Nick Mathewson2025-03-051-24/+47
| | | | | This is in preparation for making it opaque from the rest of the code, so that we can more easily reason about it.
* sqlite.rs: add comments about consistencyNick Mathewson2025-03-051-2/+14
|
* sqlite.rs: Add a note on blob consistency (or lack thereof)Nick Mathewson2025-03-051-0/+77
|
* sqlite.rs: Rename dtype to digest_type to avoid further confusion.Nick Mathewson2025-03-051-6/+6
|
* dirmgr: Propagate row-conversion failure from expire_all.Nick Mathewson2025-03-051-5/+4
| | | | | This can only happen because of a bug or because of db corruption, and we probably shouldn't ignore it.
* dirmgr: When expiring a consensus, remove its blob.Nick Mathewson2025-03-051-2/+68
| | | | | | | Previously, we would leave the ExtDocs blob to expire on its own, and it would hang out for up to a week. Closes #1655.
* dirmgr: Store the correct value in ExtDocs.typeNick Mathewson2025-03-051-2/+5
| | | | | | | | | | | | | Also, document that old values will be kicking around for a little while. Fortunately: - Nothing actually looked at these values before. - All elements in this table have an expiration date, so once a new version of Arti has been running for a week or two, the old erroneous values will go away.
* 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.
* TimerangeBound: Stop using std::ops::Bound.Wesley Aptekar-Cassels2024-11-252-7/+5
| | | | Fixes: #1691
* tor-dirmgr: don't support changing `DirMgrConfig::cache_trust`Steven Engler2024-11-052-0/+5
| | | | | `DirMgrConfig::update_from_config` uses the old value and not the new value, so it should be reported using `Reconfigure::cannot_change`.
* Replace _ => panic!() elsewhereIan Jackson2024-10-151-1/+1
|