Commit Graph

4338 Commits

Author SHA1 Message Date
Nick Mathewson bf15abbb97 Avoid matching crate names by prefix. 2022-06-17 08:41:38 -04:00
Nick Mathewson 5509bd0269 Merge branch 'config-fix2' into 'main'
Use impl_standard_builder more and remove manual Default/builder impls

See merge request tpo/core/arti!594
2022-06-16 20:30:34 +00:00
Nick Mathewson 677f1b8af0 Update check_tree to better detect errors in cargo-tree. 2022-06-16 16:13:11 -04:00
Nick Mathewson 349f9d5000 Don't install cargo-tree: It's built-in. 2022-06-16 15:54:21 -04:00
Ian Jackson 44659ebb8b tor-proto: channel: Tell clippy it's ok to print in tests 2022-06-16 19:33:32 +01:00
Ian Jackson 61bd8b810a Merge branch 'upgrade_float_eq' into 'main'
Upgrade to float_eq 1.0.0

See merge request tpo/core/arti!591
2022-06-16 17:26:04 +00:00
Ian Jackson db51bdcbc1 Merge branch 'config-fix' into 'main'
Config handling and logging fixes

Closes #480

See merge request tpo/core/arti!589
2022-06-16 15:46:18 +00:00
Ian Jackson ed62a575d3 arti: cfg: Remove another needless borrow 2022-06-16 16:08:10 +01:00
Ian Jackson 2ca2c03059 impl_standard_builder: Use for tor_dirmgr::Authority 2022-06-16 15:42:06 +01:00
Ian Jackson e004316942 impl_standard_builder: Use for tor_guardmgr::FallbackDir 2022-06-16 15:42:06 +01:00
Ian Jackson 17caebd284 impl_standard_builder: Use for tor_dirmgr::DownloadSchedule 2022-06-16 15:42:06 +01:00
Ian Jackson c466f13ce3 impl_standard_builder: Use for arti::logging::LogfileConfig 2022-06-16 15:42:06 +01:00
Ian Jackson 90ba8b15de impl_standard_builder: Allow for !Default 2022-06-16 15:42:06 +01:00
Ian Jackson c5bbaf470a arti: logging config: Replace a manual Debug impl 2022-06-16 15:27:00 +01:00
Ian Jackson 8b724d40f8 impl_standard_builder: Use for tor_dirmgr::DownloadScheduleConfig 2022-06-16 15:27:00 +01:00
Ian Jackson 2ab5c0861e impl_standard_builder: Use for tor_dirmgr::NetworkConfig 2022-06-16 15:27:00 +01:00
Ian Jackson e32210a398 impl_standard_builder: Use for tor_dirmgr::DirSkewTolerance 2022-06-16 15:27:00 +01:00
Ian Jackson c895057cb9 tor-config: impl_standard_builder: handle contexts with local Result 2022-06-16 15:27:00 +01:00
Nick Mathewson e1fc59ba5f Merge branch 'accel-features' into 'main'
Top-level (arti and arti-client) features to enable crypto acceleration

Closes #441

See merge request tpo/core/arti!590
2022-06-16 14:19:32 +00:00
Nick Mathewson 60eaabfb37 gitlab-ci: Use lowercase tpa tag.
Our gitlab admins are standardizing on this variant.
2022-06-16 10:01:07 -04:00
Ian Jackson fc3f36e9c9 arti cfg tests: Remove a redundant line that shadows an earlier binding
Prompted by review
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/589#note_2813596
2022-06-16 14:34:43 +01:00
eta ed3baea683 Fix grammar error 2022-06-16 14:34:43 +01:00
Ian Jackson a0935ca6ee arti: Enable some pre-config logging 2022-06-16 14:34:43 +01:00
Ian Jackson d57fc34841 arti: Introduce closure which will be used for pre-config logging
Right now this is an IEFI and therefore a no-op.
2022-06-16 14:34:43 +01:00
Ian Jackson 1332e02b61 arti cfg tests: Test that example config works as-is
It contains only sections, but we want to detect when that is a problem!
2022-06-16 14:34:43 +01:00
Ian Jackson 0ab60d832a arti: cfg tests: Refactor to prepare for new test
We're going to call this new closure another time.
2022-06-16 14:34:43 +01:00
Nick Mathewson c4a9c8a1c4 Merge branch 'main' into 'accel-features'
# Conflicts:
#   crates/arti-client/Cargo.toml
2022-06-16 13:24:46 +00:00
Nick Mathewson c16b32f1d4 Add script and CI to make sure `ring` doesn't show up in arti/full
See arti#493.
2022-06-16 09:00:59 -04:00
Nick Mathewson 19679a6f13 Remove rustls from tor-rtcompat/full
This is another consequence of the `ring` license issue; see #493.
2022-06-16 08:45:10 -04:00
Nick Mathewson 519f7dfa88 Upgrade to float_eq 1.0.0 2022-06-16 08:39:03 -04:00
Nick Mathewson 0223c91b26 Merge branch 'high-level-features' into 'main'
Add "full" and "experimental" features to arti, arti-client, and below.

Closes #499

See merge request tpo/core/arti!584
2022-06-16 12:24:47 +00:00
Ian Jackson 4c65e9994d Add some missing `serde(default)` to uses of humantime_serde::option
Without this, if the substructure is provided, these fields are
mandatory within it.
2022-06-16 11:08:16 +01:00
Nick Mathewson 28a23e96bd Remove "rustls" from "full", for license reasons.
Rustls uses ring, which uses code from BoringSSL, which derived from
OpenSSL before OpenSSL changed their license.  So ring is currently
under 3BSD/SSLEay licenses, which aren't GPL-compatible, which may
be a problem for some people.

See #493.
2022-06-15 13:45:38 -04:00
Nick Mathewson 5e05573ec9 Merge branch 'clippy_20220614' into 'main'
Fix several clippy issues, most with nightly

See merge request tpo/core/arti!588
2022-06-15 17:34:53 +00:00
Nick Mathewson bd9bd39ef3 Add one more "allow" to tor_netdoc::parse::macros.
Without this, clippy is error-free, but `cargo test` somehow gives a
warning.
2022-06-15 11:52:30 -04:00
Nick Mathewson 2f0bef64a3 Permit eprintln in channel-padding test.
There is not, apparently, an eprintln equivalent for
allow-dbg-in-tests.
2022-06-15 11:52:30 -04:00
Nick Mathewson 647d4410bb Fix clippy::significant_drop_in_scrutinee warnings
This is apparently a new warning from clippy nightly, documented in
https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_in_scrutinee .

I'm not in love with the temporary variables that this warning wants
me to introduce, but it does seem like a decent way to avoid some
kinds of deadlock.
2022-06-15 11:52:30 -04:00
Nick Mathewson 425af9db91 Work around an erroneous warning from nightly clippy 2022-06-15 11:52:30 -04:00
Nick Mathewson 331578d19c Make display formats work with older derive_more. 2022-06-14 14:10:18 -04:00
Nick Mathewson c74c268c8b tor-dirmgr: Make DirStatus non-public.
I believe this type was made public in error: No other crate uses it,
and no API exposes it.
2022-06-14 11:02:29 -04:00
Nick Mathewson bdcbf1982a Report directory blockage problems from arti-client.
Closes #468.
2022-06-14 10:51:04 -04:00
Nick Mathewson e3dced360b Add a blockage-reporting mechanism to tor-dirmgr.
The `DirBootstrapStatus` type now exposes a blockage() method to
return an `Option<DirBlockage>`.

The blockage types reported are more low-level than I'd like, but
they are IMO good enough for now: we'll want to get experience with
actual vs hypothetical problems before we refine them.
2022-06-14 10:42:18 -04:00
Nick Mathewson 25bbdd5f25 Add a couple of TODO items. 2022-06-14 10:05:27 -04:00
Nick Mathewson 660b3104a9 Do not update_progress on load if nothing happened.
If there was no partial information, then calling update_progress
will now report a stall in this case, which is not what we want.
2022-06-14 09:58:58 -04:00
Nick Mathewson 13c152d2ac DirMgr: Track errors, stalls, and resets as part of status.
A "reset" happens whenever we have to start a download attempt over
-- either because we ran out of retries, or we found something wrong
with the consensus after fetching certificates.

An "error" happens when we have a recoverable error from one or more
directory sources.

A "stall" happens whenever a round of downloads or cache loads leads
to no change in the status.

We don't yet use this as part of our status reporting.
2022-06-13 13:58:31 -04:00
Nick Mathewson 2a2afaa7c2 Refactor our logic for distinguishing download attempts
Previously we used the "if-modified-since" time associated with the
consensus download, and/or the "valid-after" time in the consensus
attempt, to put multiple attempts into sequence, and to tell one
from another.  But that approach was always a kludge, and will soon
get more unreliable as the DirStatus logic gets a bit more complex.

With this commit, we change separate download attempts to be
identified with an AttemptId that increments whenever we decide to
get a different directory from the one we have.  IMO this new code
is _much_ cleaner.
2022-06-13 13:21:09 -04:00
Nick Mathewson 68ea880b84 Refactor most DirStatus users to use DirProgress.
This is all crate-internal APIs, fortunately.
2022-06-13 12:22:04 -04:00
Nick Mathewson 238f2b5637 Move `at_least_as_new_as` to DirProgress. 2022-06-13 12:02:30 -04:00
Nick Mathewson 6c9d30681f Turn the DirProgress in DirStatus into a named field. 2022-06-13 10:53:46 -04:00
Nick Mathewson f581feb0ac Rename DirStatusInner to DirProgress.
This is about to become only a _part_ of what defines a DirStatus: a
DirStatus will also include a reset count, and some kind of info
about how long we've gone without progress.
2022-06-13 10:49:09 -04:00