summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | tor-netdoc: Remove duplicate semver entryIan Jackson2026-05-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3985#note_3413184
| * | | | | tor-netdoc: Add some TODOsIan Jackson2026-05-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3985#note_3413183
| * | | | | tor-netdoc: Rename FixedString to ConstantStringIan Jackson2026-05-275-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3985#note_3413182 I left the word "fixed" in some of the docs and error messages, where it seemed to make sense.
| * | | | | tor-netdoc: Apply deferred rustfmt import churnIan Jackson2026-05-272-3/+5
| | | | | |
| * | | | | tor-netdoc: introduce VoteStatusConsensus and VoteStatusVoteIan Jackson2026-05-273-36/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replacing poc's. The new define_fixed_string macro is really helping here.
| * | | | | tor-netdoc: NetworkStatusVersionItem, replacing poc's tupleIan Jackson2026-05-273-7/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Defining a struct gives us a place to hang the documentation, and avoids an accidentally-exhaustive tuple.
| * | | | | tor-netdoc: VarietyKeyword, replacing poc's flavour typeIan Jackson2026-05-274-27/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is more code than the poc version but much of the extra is documentation, and it seems much less magical this way. We still need a handwritten parser for plain consensuses, sadly.
| * | | | | tor-netdoc: Promote/adjust poc's NetworkStatusSignaturesIan Jackson2026-05-272-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The order of arguments of poc's ns_type macro is different to that of the real code. This is very confusing! However, the type is correct, once we've added the singleton signature for votes.
| * | | | | tor-netdoc: Provide NoMoreArguments markerIan Jackson2026-05-273-2/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're going to need this for type-driven parsing of the necessarily-absent flavour argument in a vote's `network-status-version`.
| * | | | | tor-netdoc: use DirectorySignaturesHashesAccu in SignatureGroupIan Jackson2026-05-274-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will let us (re)use the existing signature checking code with the parse2 type, since we'll be able to make a SignatureGroup out of a parse2'd UnverifiedNetworkStatus.
| * | | | | tor-netdoc: Make fields of DirectorySignaturesHashesAccu publicIan Jackson2026-05-272-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow it to be a replacement inside `SignatureHashes`. Keeping the fields private seems to have been an oversight.
| * | | | | tor-netdoc: SignatureGroup: add some notes to the docsIan Jackson2026-05-271-0/+4
| | | | | |
| * | | | | tor-netdoc: Replace poc's NddDirectoryFooter with new FooterIan Jackson2026-05-274-10/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the whole of the footer section, with docs, appropriate derives, and so on.
| * | | | | tor-netdoc: ConsensusFooterFields: Constructor, parse, encodeIan Jackson2026-05-273-3/+14
| | | | | |
| * | | | | tor-netdoc: ConsensusFooterFields: Tidy docsIan Jackson2026-05-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add links to the spec, and delete explanatory text (that ought to be in the spec, not here).
| * | | | | tor-netdoc: ConsensusFooterFields: Rename weights field to bandwidth_weightsIan Jackson2026-05-274-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | This matches the spec.
| * | | | | tor-netdoc: Rename Footer to ConsensusFooterFieldsIan Jackson2026-05-275-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow us to include this, conditionally, in the new per-variety footer types for consensuses, without too much disruption to the existing code. We don't leave a compatibility alias because we're going to want a Footer in each_variety.rs which is the actual sub-document. This old struct isn't suitable because it doesn't have the intro item and is just for consensuses.
| * | | | | tor-netdoc: NetworkStatusVersion, replacing poc's with FixedStringIan Jackson2026-05-273-11/+15
| | | | | |
| * | | | | tor-netdoc: Provide FixedString and defined_fixed_stringIan Jackson2026-05-273-1/+146
| | | | | | | | | | | | | | | | | | | | | | | | We're going to want quite a lot of this for eg network-status-version.
* | | | | | Merge branch 'client_typestate' into 'main'Nick Mathewson2026-05-276-226/+478
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Client: Refactor most managers into a typestate, and construct it on bootstrap. See merge request tpo/core/arti!4011
| * | | | | | Apply 2 suggestion(s) to 1 file(s)Nick Mathewson2026-05-271-2/+2
| | | | | | | | | | | | | | | | | | | | | Co-authored-by: gabi-250 <[email protected]>
| * | | | | | client: Have launch_onion_service instantiate RunningInner as needed.Nick Mathewson2026-05-261-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we either lose the property that you can call launch_onion_service before bootstrapping has begun, or we have to make launch_onion_service async.
| * | | | | | client: RunningInner::reconfigure: refactor running → selfNick Mathewson2026-05-262-43/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (This is a separate commit in order make the code movement in the previous commit clearer.)
| * | | | | | client: Move dirmgr_store back into ClientShared.Nick Mathewson2026-05-261-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will ensure that the TorClient takes its file locks immediately on construction.
| * | | | | | client: Fold wait_for_bootstrap{,_running} into a single method.Nick Mathewson2026-05-261-20/+14
| | | | | | |
| * | | | | | client: change remaining wait_for_bootstrap user.Nick Mathewson2026-05-261-5/+6
| | | | | | |
| * | | | | | client: Defer creation of most structures until bootstrap.Nick Mathewson2026-05-262-127/+226
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will let us be more confident in the inertness of a not-bootstrapping TorClient, _and_ make it easier to reconfigure things before the client is started.
| * | | | | | client: Rename create_inner to create_implNick Mathewson2026-05-262-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have a type called "inner", and will soon have a function to create it, we really don't want to retain this name.
| * | | | | | client: move bootstrap lock to the head of bootstrap_inner.Nick Mathewson2026-05-261-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want this look to cover the whole function, to avoid weird duplicate behavior while creating our bridge desc manager.
| * | | | | | client: Factor out the "running a client" code into an inner typestateNick Mathewson2026-05-264-87/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We'll use this to distinguish "not running" from "running", in order to make it easier to be sure that non-bootstrapping clients will definitely not try to connect to the network.
| * | | | | | client: rename ClientInner → ClientShared.Nick Mathewson2026-05-261-5/+5
| | | | | | |
* | | | | | | Merge branch 'rpc_config_part1_v3' into 'main'Nick Mathewson2026-05-2715-65/+364
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | Implement configuration backend logic for RPC See merge request tpo/core/arti!4001
| * | | | | | config: Simplify ConfigurationTree::merge_from to take &mut self.Nick Mathewson2026-05-272-8/+9
| | | | | | |
| * | | | | | Apply 3 suggestion(s) to 2 file(s)Nick Mathewson2026-05-272-3/+3
| | | | | | | | | | | | | | | | | | | | | Co-authored-by: gabi-250 <[email protected]>
| * | | | | | config: Update doctests to use Deftly, and to passNick Mathewson2026-05-273-16/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the tests used derive(Builder), which is not current practice for our configuration. Additionally, they didn't implement the requisite ConfigBuilder logic to pass with the other changes in this branch.
| * | | | | | Give resolve_return_results options to control output_tree.Nick Mathewson2026-05-273-15/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've left the options here as booleans, but moved them into a struct. (IMO, booleans are at their riskiest when they are passed as function arguments, and much less risky when they are used as struct fields.)
| * | | | | | config: Add an `output_tree` to our resolver methods.Nick Mathewson2026-05-271-5/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This functionality exposes the part of the configuration tree that was actually used, along with any defaulted values. RPC will want this.
| * | | | | | config: Add a dd(TorConfig) attribute to override apply_defaults().Nick Mathewson2026-05-271-1/+36
| | | | | | |
| * | | | | | config: Add a method to fill in a builder with unset defaultsNick Mathewson2026-05-2711-1/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new method modifies a builder by replacing any unset values that have a default with that default. We're using this method so that we can re-serialize a builder into a `ConfigurationTree` with all of its default values included. In all cases, `b.apply_defaults()?; b.build()` should produce the same output as `b.build()`. The interesting parts of this commit are in tor_config::load and tor_config::derive. The rest of this commit just adds `apply_defaults` to other builders that _aren't_ made with `derive_deftly(TorConfig)`.
| * | | | | | tor-basic-utils: Add an if_empty helper macroNick Mathewson2026-05-271-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need this pattern in a lot of places; we might as well just define it once.
| * | | | | | config: Implement Builder for ListBuilders and MapBuilders.Nick Mathewson2026-05-272-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This isn't strictly necessary, but it helps for consistency.
| * | | | | | dd(TorConfig): change the order of default vs magicNick Mathewson2026-05-272-23/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This affects the automatic builder code made by our derive_deftly macro. It is only relevant (for now) in the case of the `NonZero<>` types and their special handling. Previously, when a builder contained Option<U>, and we wanted to generate a configuration holding T, we would _first_ apply a transformation from Option<U> to Option<T> and _second_ unwrap the result or apply a default. Now, we _first_ convert from Option<U> to U by applying a default, and only _then_ perform any necessary conversion from U and T. This is only relevant in the case where U and T are different. It simplifies writing the defaults for `NonZero` options, and will significantly simplify the logic for setting builder defaults.
| * | | | | | config: Fix documentation of ResolutionResultsNick Mathewson2026-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It previously referred to a function that didn't exist.
| * | | | | | tor-basic-utils: Correct documentation for macro_first_nonempty.Nick Mathewson2026-05-271-5/+5
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | It looks like we renamed this macro, but didn't rename it in its documentation.
* | | | | | Merge branch 'rd-bandwidth' into 'main'Ian Jackson2026-05-273-0/+29
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Bandwidth support to Router Descriptors See merge request tpo/core/arti!4005
| * | | | | | tor-netdoc: Add bandwidth field to RouterDescClara Engler2026-05-262-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds the bandwidth field to the RouterDesc struct as it is found within the spec. The legacy parser will not support it, hence why we do default values there.
| * | | | | | tor-netdoc: Add Bandwidth structClara Engler2026-05-262-0/+20
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | This commit adds the bandwidth struct for router descriptors which is present in the `bandwidth` item.
* | | | | | Merge branch 'relay-clippy' into 'main'Nick Mathewson2026-05-272-1/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix two unused warnings See merge request tpo/core/arti!4019
| * | | | | | tor-chanmgr: fix `unused_imports` warningSteven Engler2026-05-271-1/+3
| | | | | | |
| * | | | | | arti-relay: fix `unused_variables` warningSteven Engler2026-05-271-0/+1
| | | | | | |