aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/config.rs
Commit message (Collapse)AuthorAgeFilesLines
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* circmgr,hsclient: s/requery_period/requery_intervalGabriela Moldovan2026-05-071-3/+3
| | | | C Tor calls this a "period", but "interval" is more accurate.
* circmgr: Add config option for the HsDir requery periodGabriela Moldovan2026-05-071-0/+16
|
* Demonstration: convert tor-circmgr to use derive_deftly(TorConfig)Nick Mathewson2025-12-091-98/+32
| | | | | (We could tighten this up even more by inlining some of the default values.)
* tor-circmgr: simplify `CircMgrConfig`Steven Engler2025-11-261-9/+2
| | | | | | | Now that `vanguard_config()` is no longer conditional, we can handle `vanguard_config` just like other accessors. This is a breaking change, but I think we may as well make this change while we've already made another breaking change in the previous commit.
* tor-circmgr,arti-client: `CircMgrConfig::vanguard_config` is always builtSteven Engler2025-11-261-4/+0
|
* circmgr: Add a timeout setting for long-lived circuits.Nick Mathewson2025-11-121-0/+18
|
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-2/+2
| | | | | | | | | | | | | | 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.
* CircMgr: Start writing tests.Wesley Aptekar-Cassels2024-10-031-1/+1
|
* tor-guardmgr: Unconditionally define VanguardConfig.Gabriela Moldovan2024-06-031-3/+3
| | | | | | | | | 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-circmgr: Downgrade some TODO HS-VANGUARDs.Gabriela Moldovan2024-05-091-1/+1
|
* Resolve some clippy warnings about empty rustdoc.Nick Mathewson2024-05-051-5/+1
| | | | | (In most cases, by writing the documentation; in tests, by permitting the documentation to be missing.)
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* circmgr: Begin porting path selection to tor-relay-selectionNick Mathewson2024-03-121-0/+10
| | | | | This covers the easy cases, where we are selecting relays at random based on a selector.
* tor-circmgr: Explain why vanguards_config is defined as an "other" accessor.Gabriela Moldovan2024-03-111-0/+5
|
* tor-hsclient: Do not enable vanguards feature in dev-dependency.Gabriela Moldovan2024-03-111-0/+2
|
* arti-client: Add vanguard_config() to CircMgrConfig.Gabriela Moldovan2024-03-111-0/+11
|
* PathConfigBuilder: Actually provide the long_lived_ports settersIan Jackson2024-02-201-0/+6
|
* Use list_builder and sub-builder pattern for long_lived_ports.Nick Mathewson2024-02-201-6/+18
|
* Add a configuration option for long_lived_ports.Nick Mathewson2024-02-201-0/+13
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* HS configuration: Add retry parameters to configurationIan Jackson2023-06-281-0/+36
| | | | | | | I think these should go in `[circuit_timing]`. That section already has some retry parameters, so is not strictly *timing*. This is not honoured yet.
* Fix an unrelated missing cfg_attr.Nick Mathewson2023-03-081-0/+1
|
* Apply rustfmtIan Jackson2023-03-011-5/+10
|
* tor-circmgr: Provide testing feature and TestConfigIan Jackson2023-03-011-0/+43
| | | | Like the similar thing in tor-guardmgr.
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+8
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* guardmgr config: Introduce and require new GuardMgrConfig traitIan Jackson2022-11-031-4/+2
| | | | | It doesn't seem to me like it makes sense to provide the backward compatibility here.
* CircMgr: Enable reachable_addrs filter.Nick Mathewson2022-06-171-1/+14
|
* Add a configuration option for reachable_addrsNick Mathewson2022-06-171-0/+28
| | | | (This doesn't do anything yet.)
* 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.
* 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
|
* 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
* 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.)
* Change builder list APIIan Jackson2022-05-041-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* 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.
* 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-251-4/+18
| | | | | | 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.
* Use a lower default for max_retries.Nick Mathewson2022-03-301-1/+1
| | | | | | | | | | The older default seems (experimentally) to be ridiculously high. Generally, if we can't build a circuit within a handful attempts, that circuit has already timed out... unless there is a fast-failure condition, in which case we're just hammering the network (or our view of it.) Found with `arti-testing` for #329.
* Turn FallbackList into a real type, and store one in GuardMgr.Nick Mathewson2022-03-301-0/+2
| | | | | | | | | | | | | | The guard manager is responsible for handing out the first hops of tor circuits, keeping track of their successes and failures, and remembering their states. Given that, it makes sense to store this information here. It is not yet used; I'll be fixing that in upcoming commits. Arguably, this information no longer belongs in the directory manager: I've added a todo about moving it. This commit will break compilation on its own in a couple of places; subsequent commits will fix it up.
* Merge branch 'config-partials-transparent' into 'main'Ian Jackson2022-03-171-31/+33
|\ | | | | | | | | Absolish builders for CircMgrConfig and DirMgrConfig See merge request tpo/core/arti!417
| * Add rationale for CircMgrConfig transparency and traitIan Jackson2022-03-161-1/+22
| |
| * Provide define_accessor_trait and use it to generate CircMgrConfigIan Jackson2022-03-161-20/+12
| |
| * Make CircMgrConfig transparent (and make it a trait)Ian Jackson2022-03-161-29/+18
| | | | | | | | See commentary for the rationale.
* | derive_builder: Switch to upstream 0.11Ian Jackson2022-03-161-4/+4
|/ | | | | | | | | This has the different syntax for builder field attributes than what I originally proposed in my MR, and which therefore is in the pinned branch. My upstream MR for the field attributes feature was morged: https://github.com/colin-kiegel/rust-derive-builder/issues/239
* Use new upstream humantime_serde_option featureIan Jackson2022-03-141-5/+4
| | | | Replace all uses of our copy of this code.
* Drop remaining conversion from FooConfig to FooConfigBuilderIan Jackson2022-03-071-34/+0
|