summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr
Commit message (Collapse)AuthorAgeFilesLines
* Add more information to failed-to-select fallback errors.Nick Mathewson2022-07-071-1/+1
| | | | Also re-order the filters to be a little more logical.
* Bump crate and dependency versions.Nick Mathewson2022-06-241-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These were done with the following commands: ``` cargo set-version -p tor-basic-utils --bump patch cargo set-version -p fs-mistrust --bump minor cargo set-version -p tor-error --bump patch cargo set-version -p tor-config --bump patch cargo set-version -p tor-units --bump patch cargo set-version -p tor-rtcompat --bump minor cargo set-version -p tor-llcrypto --bump patch cargo set-version -p tor-bytes --bump minor cargo set-version -p tor-socksproto --bump minor cargo set-version -p tor-cert --bump minor cargo set-version -p tor-cell --bump minor cargo set-version -p tor-proto --bump minor cargo set-version -p tor-netdoc --bump patch cargo set-version -p tor-netdir --bump minor cargo set-version -p tor-persist --bump patch cargo set-version -p tor-chanmgr --bump minor cargo set-version -p tor-guardmgr --bump minor cargo set-version -p tor-circmgr --bump patch cargo set-version -p tor-dirclient --bump patch cargo set-version -p tor-dirmgr --bump minor cargo set-version -p arti-client --bump patch cargo set-version -p arti --bump minor cargo set-version -p arti-bench --bump minor cargo set-version -p arti-testing --bump minor ```
* clippy: Consolidate many lints in maint/add_warningIan Jackson2022-06-241-1/+8
| | | | | | Found these by disabling the nightly dbg macro special case. Now, we have a mechanism for globally adding suppressions to tests, we can use that instead.
* Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | Update all lint blocks
* Do not include error source() in display() format.Nick Mathewson2022-06-211-5/+5
| | | | | | | | | According to doc/Errors.md, and in keeping with current best practices, we should not include display an error's `source()` as part of that error's display method. Instead, we should let the caller decide to call source() and display that error in turn. Part of #323.
* CircMgr: Enable reachable_addrs filter.Nick Mathewson2022-06-172-1/+21
|
* Add a configuration option for reachable_addrsNick Mathewson2022-06-171-0/+28
| | | | (This doesn't do anything yet.)
* Merge branch 'high-level-features' into 'main'Nick Mathewson2022-06-161-0/+2
|\ | | | | | | | | | | | | Add "full" and "experimental" features to arti, arti-client, and below. Closes #499 See merge request tpo/core/arti!584
| * Add "full" and "experimental" features to arti-client and below.Nick Mathewson2022-06-101-0/+2
| | | | | | | | | | | | | | | | | | The "full" feature is a catch-all for all features, _except_: * Those that select a particular implementation (like tor-llcrypto/with-openssl) or build flag (like "static") * Those that are experimental or unstable (like "experimental-api") * Those that are testing-only.
* | tor-netdir: testnet: Make construct_netdir infallible (rustfmt)Ian Jackson2022-06-134-21/+7
| | | | | | | | | | Run rustfmt. Separate commit to make review of the substantive commit easier.
* | tor-netdir: testnet: Make construct_netdir infallibleIan Jackson2022-06-134-7/+0
|/ | | | | This is a *lot* of unwraps. The function takes no parameters and is used only for testing. It ought to be infallible.
* Merge branch 'use-testing-rng'Nick Mathewson2022-06-074-11/+15
|\
| * Use testing_rng() in tests throughout our crates.Nick Mathewson2022-06-024-11/+15
| | | | | | | | | | | | This only affects uses of thread_rng(), and affects them all more or less indiscriminately. One test does not work with ARTI_TEST_PRNG=deterministic; the next commit will fix it.
* | Move responsibility for GuardMgr NetDir updates to GuardMgr.Nick Mathewson2022-06-071-32/+24
| | | | | | | | | | | | | | | | | | | | | | Previously it was the job of a task in CircMgr to do this; but we're going to want to give GuardMgr full access to the latest NetDir for this, and for other code-simplification reasons. With this change I'm deprecating a couple of functions in tor-circmgr. It's no longer necessary for us to have an artificial external way for you to feed new NetDirs to a circmgr. (I could just remove them, but I want practice deprecating.)
* | Remove now-redundant Send+Sync constraints alongside NetDirProviderNick Mathewson2022-06-071-4/+4
| |
* | lints: Add let_unit_value allow to all cratesIan Jackson2022-05-311-0/+1
| | | | | | | | | | From running add_warning, with manual picking of the right hunks/lines.
* | lints: Add lint block delimiters to every crateIan Jackson2022-05-311-0/+2
|/ | | | | | This was the result of: maint/add_warning crates/*/src/{lib,main}.rs and then manually curating the results.
* Lexically sort Cargo.toml dependenciesOrhun Parmaksız2022-05-281-17/+16
| | | | | | Utilize cargo-sort: https://github.com/DevinR528/cargo-sort Signed-off-by: Orhun Parmaksız <[email protected]>
* Regenerate version bump from previous commit.arti-v0.4.0Nick Mathewson2022-05-271-10/+10
| | | | | | | This commit was made by reverting the previous commit, then re-running the script I used to generate it. In theory there should be no semantic changes: only changes due to improved formatting from cargo edit.
* Semantic version changes for Arti 0.4.0 releaseNick Mathewson2022-05-271-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | I followed the following procedure to make these changes: * I used maint/changed_crates to find out which crates had changed since 0.3.0. * I used grep and maint/list_crates to sort those crates in topological (dependency) order. * I looked through semver_status to find which crates were listed as having semver-relevant changes (new APIs and breaking changes). * I scanned through the git logs of the crates with no semver-relevant changes listed to confirm that, indeed, they had no changes. For those crates, I incremented their patch-level version _without_ changing the version that other crates depend on. * I scanned through the git logs of the crates with no semver-relevant changes listed to confirm that, indeed, they had no obvious breaking changes. * I treated all crates that depend on `arti` and/or `arti-client` as having breaking changes. * I identified crates that depend on crates that have changed, even if they have not changed themselves, and identified them as having a non-breaking change. * For all of the crates, I used `cargo set-version -p $CRATE --bump $STATUS` (where `STATUS` is `patch` or `minor`) to update the versions, and the depended-upon versions.
* Resolve the new `derive_partial_eq_without_eq` lint.Nick Mathewson2022-05-233-5/+5
| | | | It's a little overzealous sometimes, but it's mostly to the good.
* impl_standard_builder: Have it generate FooConfig::builderIan Jackson2022-05-121-18/+0
| | | | | This deletes many handcoded impls. It also generates lots of impls that we previously didn't have.
* Merge branch 'builder-default-bis' into 'main'eta2022-05-121-26/+4
|\ | | | | | | | | impl_standard_builder followup See merge request tpo/core/arti!505
| * Rename impl_standard_builder from impl_default_via_builderIan Jackson2022-05-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | I have Plans for this macro. In particular: * I have a wip branch which tests that the Builder can be deserialised from an empty config (ie, that config reading of a config with a blank section for this item works). * I think we should autogenerate $Config::builder(), and promote that, rather than $ConfigBuilder::default(). This macro could do that.
| * config: Replace more handwritten impl DefaultIan Jackson2022-05-121-26/+4
| |
* | Merge branch 'ticket_412_467' into 'main'Nick Mathewson2022-05-121-0/+6
|\ \ | |/ |/| | | | | | | | | Teach DirMgr to use slightly untimely directories Closes #467 and #412 See merge request tpo/core/arti!500
| * Note a TODO in exitpath construction.Nick Mathewson2022-05-111-0/+6
| |
* | Add correct serde(default) attrs for humantime_serde::optionIan Jackson2022-05-121-4/+4
|/ | | | | | | | | Discovered by a test case in my local tree. The test case was macro-generated by an extension of impl_standard_builder (which macro istself currently awaiting review, arti!499) Have also sent an MR to update the upstream docs https://github.com/jean-airoldie/humantime-serde/pull/8
* Bump the version of every* crate to 0.3.0Nick Mathewson2022-05-061-19/+19
| | | | * Except for safelog and fs-mistrust, which are new.
* Change safelog version to 0.1.0.Nick Mathewson2022-05-061-1/+1
| | | | | (This is okay because we haven't published it yet, or any crate that uses it.)
* Merge branch 'derive-builder-fork' into 'main'Nick Mathewson2022-05-061-1/+1
|\ | | | | | | | | | | | | Switch to derive_builder_arti_fork Closes #446 See merge request tpo/core/arti!490
| * Switch to derive_builder_arti_forkIan Jackson2022-05-061-1/+1
| | | | | | | | | | | | | | | | | | For reference, the git source for this crate (and the others in its workspace) currently lives in my personal github account (ijackson). If this fork turns out to be long-lived and gains features and/or users, it would be good to move it to a gitlab somewhere. I have granted Nick crate ownership on the crates.io system.
* | Apply `sensitive` in some info-level log messages.Nick Mathewson2022-05-061-0/+1
|/ | | | | This specifically applies the `sensitive` wrapper in the places where we're logging target addresses at level "info" or higher.
* config derive attrs: Make builders serde, and validated structs notIan Jackson2022-05-051-19/+7
| | | | | | | | | | | | | | | * Builders additionally derive: Debug, Serialize, Deserialize. * Validated structs no longer derive: Serialize, Deserialize and all related attributes deleted. * As a consequence, all the `#[serde(deny_unknown_fields)]` are gone. That means that right now unknown fields are totally ignored. This is good for compatibility but poor for useability. Doing something better here is arti#417, in progress. * As a consequence, delete tor_dirmgr::retry::default_parallelism. (The default value was already duplicated into a builder attr.)
* Merge branch 'socket-addr-list-builder' into 'main'Ian Jackson2022-05-041-12/+16
|\ | | | | | | | | FallbackDir: orports: Introduce and use VecBuilder See merge request tpo/core/arti!474
| * FallbackDir: Use VecBuilder for orportsIan Jackson2022-05-041-12/+16
| | | | | | | | | | | | | | And drop the ad-hoc orport() method. This brings FallbackDir's orports field in line with our list builder API. The general semver note in "configuation" seems to cover most of this.
* | GuardUsage: restrictions: Use list builderIan Jackson2022-05-041-1/+2
|/ | | | | | | | | | | | | | Although these do not appear in the config, it does have a builder. It seems sensible to get rid of this ad-hoc list manipulation site, and replace it with our standard list builder API. define_list_builder_helper requires that the builder element type be Deserialize. Currently GuardUsageRestriction is a transparent, public enum, so we aren't really exposing anything. We could introduce GuardUsageRestrictionBuilder now, but since it's not in the config and thereofore only in the public API of the lower crates, we can definitely put that off.
* Change builder list APIIan Jackson2022-05-042-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | The new API is (roughly) as discussed in https://gitlab.torproject.org/tpo/core/arti/-/issues/451 This is quite a large commit and it is not convenient to split it up. It contains the following changes: * Redo the list builder and accessor macros implemnetation, including docs and tests. * Change uses of define_list_config_builder. In each case: - Move the docs about the default value to the containing field. - Remove the other docs (which were just recapitulations, and are now not needed since the ListBuilder is no longer public). - Rewmove or replace `pub` in the define_list_builder_helper call, so that the builder is no longer public. - Change the main macro call site to use define_list_builder_helper. - Add a call to define_list_builder_accessors. * Make the module `list_builder` pub so that we have somewhere to put the overview documentation. * Consequential changes: - Change `outer.inner().replace(X)` to `outer.set_inner(X)` - Consequential changes to imports (`use` statements).
* Merge branch 'derive-builder-git-fixup' into 'main'eta2022-04-271-1/+1
|\ | | | | | | | | derive_builder: Use git dep everywhere, rather than cargo patch See merge request tpo/core/arti!477
| * derive_builder: Use git dep everywhere, rather than cargo patchIan Jackson2022-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `[patch]` approach causes the tree not to build when used as a dependency, unless the `[patch]` is replicated into the depending project. Instead, replace our `derive_builer =` dependencies with a reference to a specific git commit: perl -i~ -pe 'next unless m/^derive_builder/; s#"(0\.11\.2)"#{ version = "$1", git = "https://github.com/ijackson/rust-derive-builder", rev = "ba0c1a5311bd9f93ddf5f5b8ec2a5f6f03b22fbe" }#' crates/*/Cargo.toml Note that the commitid has changed. This is because derive_builder is in fact a workspace of 4 crates. 3 of them are of interest to arti itself (the 4th exists only for testing). So the same "add git revision" treatment had to be done to the `derive_builder` and `derive_builder_macro` crates. Each dependency edge involves a new commit in the derive_builder workspace, since we can't create a git commit containing its own commitid. (We want to use commits, rather than a branch, so that what we are depending on is actually properly defined, and not subject to the whims of my personal github namespace.) There are no actual code changes in derive_builder.
* | Fix grammar and typosSamanta Navarro2022-04-272-2/+2
|/
* Merge branch 'main' into 'msrv_1_56'Nick Mathewson2022-04-262-29/+34
|\ | | | | | | | | | | # Conflicts: # crates/tor-config/Cargo.toml # crates/tor-dirmgr/src/state.rs # doc/semver_status.md
| * Document defaults for all the config listsIan Jackson2022-04-251-1/+3
| | | | | | | | | | | | | | And add an imprecation in define_list_config_builder's doc comment do do so in future for other invocations of the macro. Add add the missing full stops.
| * Rename ThingListBuilder::replace (from set)Ian Jackson2022-04-251-4/+4
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798024
| * Use better syntax for doc comment attributeIan Jackson2022-04-251-3/+1
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798020
| * Introduce PredictedPortsListBuilderIan Jackson2022-04-252-29/+34
| | | | | | | | | | | | This means that `NetworkConfig::initial_predicted_ports` is now like the other list-like things, returning `&mut list_builder` with the same `set()` and `append()` methods.
* | squash! Bump every crate's edition to 2021.Nick Mathewson2022-04-259-11/+0
| | | | | | | | | | Remove all `use` statements for `TryFrom` and `TryInto`. These are now redundant in Rust 2021.
* | Bump every crate's edition to 2021.Nick Mathewson2022-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | This is an automated change made with a perl one-liner and verified with grep -L and grep -l. Some warnings are introduced with this change; they will be removed in subsequent commits. See arti#208 for older discussion on this issue.
* | Add 'rust-version = "1.56"' to every Cargo.toml file.Nick Mathewson2022-04-251-0/+1
| | | | | | | | | | | | | | This change was made automatically with a perl one-liner, and confirmed with `grep -L`. The `rust-version` field itself was introduced in 1.56.0.
* | Reformat all not-yet-reformatted Cargo.toml files.Nick Mathewson2022-04-251-13/+13
|/ | | | | There are no semantic changes here; only formatting. This is in preparation for other changes (wrt MSRV and edition)