| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Run maint/add_warning
|
| |
|
|
|
|
|
| |
This commit implements proposal 330 in the context of `tor-dircommon`,
by replacing the single `Authority` structure used in a list context by
a single structure called `AuthorityContacts` which contains all
v3idents, upload, download, and vote endpoints in one central place.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This commit moves the `DirTolerance` structure from `tor-dirmgr` into
`tor-dircommon`.
|
| |
|
|
|
| |
This commit moves the `DowenloadSchedule` related types from
`tor-dirmgr` into `tor-dircommon`.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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`.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
`DirMgrConfig::update_from_config` uses the old value and not the new
value, so it should be reported using `Reconfigure::cannot_change`.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
This commit makes the `dir_mgr_config` method of the `TorClientConfig`
struct public.
It might be questionable whether we should make this function public or
switch to a `TryInto` trait in general, which also seems like an even
Rustier solution Rustier solution.
Fixes #1175
|
| |
|
|
|
|
| |
This variable contains precisely the value of cache_dir from
arti_client::config::StorageConfig and it should therefore have the
same name.
|
| | |
|
| | |
|
| |
|
|
|
| |
This panics on error, and we're fine with a panic on misbehavior in
tests.
|
| |
|
|
|
|
|
| |
This is the hunks from running the rune in maint/adhoc-add-lint-blocks
but which require some subsequent manual fixup: usually, deleting
now-superfluous outer allows, but in some cases manually putting back
lints that the adhoc script deleted.
|
| | |
|
| |
|
|
|
|
| |
This name is more accurate because we aren't only dealing with
clock skew here: we're also trying to tolerate the case where the
authorities fail to reach consensus for a while.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Without this, if the substructure is provided, these fields are
mandatory within it.
|
| |
|
|
|
|
| |
This was upposed to be one day, I presume!
Also complete a truncated sentence in the docs.
|
| |
|
|
|
|
| |
In our status reporting code, we consider an
expired-but-still-usable directory still bootstrapped, but not 100%
bootstrapped.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This new section describes how much variance we accept when it comes
to expired and not-yet-valid directory documents. (Currently, the
only ones where this matters for are consensus documents and
authority certificates.) A document that is invalid by no more than
these tolerances is not _live_, but it can still be used.
These tolerances serve two purposes:
* First, they allow clients to run with a little more clock skew
than they would tolerate otherwise.
* Second, they allow clients to survive the situation where the
authorities are unable to reach a consensus for a day or two.
Compare with Tor's REASONABLY_LIVE_TIME and NETWORKSTATUS_ALLOW_SKEW
constants; also compare with proposal 212.
Closes #412.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.)
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
| |
Previously this field was differently named to its serde and to its
accessors. We are about to introduce a macro_rules macro which will
provide list accessors and we don't want that macro to have a field
renaming feature.
So stop renaming the field.
|
| |
|
|
|
|
|
| |
These fields are pub.
Retain two convenience accessor functions that access sub-fields of
network.
|
| |
|
|
| |
This entire struct is config. This is otiose.
|
| |
|
|
| |
We can just make the fields pub(crate).
|
| |
|
|
|
|
|
|
|
|
|
| |
Use sub_builder. We must do something special for defaults.
This involves moving the actual default values for retry_bootstrap and
retry_microdescs into config.rs, since they need to access the fields
of the un-built version of the structure. (An alternative would be to
generate "weak setters" which do not override previous settings, but
derive_builder does not offer to generate them and that seems
overkill.)
|
| |
|
|
|
|
|
|
|
|
| |
Instead, everyone should use DownloadScheduleBuilder.
The new() method would in any case be useless in a moment, since we're
going to embed DownloadScheduleBuilder in the NetworkConfig, not
DownloadSchedule.
The call sites in the tests are all about to change again.
|
| |
|
|
|
|
|
|
| |
The current behaviour is to treat 0 as indicating "use the default",
which is quite strange. We are going to get rid of that.
The new way will be to reject zero, during
DownloadScheduleBuilder::build, Add a test case for that.
|
| |
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798024
|
| |
|
|
|
|
|
|
|
| |
NetworkConfigBuilder needs to not contain any validated structs, so
that its serde does not expose the validated details.
AuthorityListBuilder is what ought to go here - and it contains
Vec<AuthorityBuilder>, not Vec<Authority>. As a consequence, many
places now deal with AuthorityBuilder, rather than Authority.
|
| |
|
|
|
|
|
|
|
| |
Now the network fallbacks configuration wants to Deserialize
a Vec<FallbackDirBuilder>, rather than validated Vec<FallbackDir>.
Methods on FallbackListBuilder are as per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/462#note_2797697
mutatis mutandi for the fact that this struct has only fallbacks in it.
|
| |
|
|
|
|
|
|
|
|
| |
This is where the FallbackList type is. We are going to want to
provide a builder too, which ought to impl Default.
This means that the default value for the type must be next to the
type. In any case, it was anomalous that it wasn't.
This commit is pure code motion.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
This is the logical place for it, I think: the GuardMgr's job is to
pick the first hop for a circuit depending on remembered status for
possible first hops. Making this change will let us streamline the
code that interacts with these objects.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
There are two reasons why the DynFilter newtype might be needed:
1. To impl Default. But we don't need it to impl Default since we can
have an accessor which does the defaulting.
2. To hide the API. But this is usrely an unstable API.
Just writing Arc<dyn> gets rid of a lot of unnecessary boilerplate and
conversion code.
|
| |
|
|
|
|
| |
This code sits behind a feature flag, and can be used to modify
directories before storing them. This is part of the implementation
for #397.
|
| |
|
|
| |
Using accessors for crate-only fields is otiose.
|
| |
|
|
|
|
| |
Rename this to be named the same as its accessor, and use the rename
feature of builder and serde. (The shorter name is nicer in the code
IMO.)
|