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
Nick Mathewson
2d39545f8d
Merge branch 'unwrap' into 'main'
...
tor-netdir: testnet: Make construct_netdir infallible
See merge request tpo/core/arti!585
2022-06-13 14:37:08 +00:00
Nick Mathewson
10b38a7d7c
Add "accel-*" features to arti-client and arti.
...
These need to be optional: they improve performance by shifting to
asm implementations, which may not be everybody's idea of good practice.
These are not 'pure' features, since they select one implementation
but disable another. Therefore they don't go in `full`.
Closes #441 .
2022-06-13 10:22:24 -04:00
Nick Mathewson
3673409735
Add a feature to tor-llcrypto to enable sha-1/asm.
...
SHA1 is a reasonably large part of our CPU usage (sigh), and this
implementation is 20-50% faster, depending on arch.
2022-06-13 10:13:13 -04:00
Nick Mathewson
d44dd6f44f
Merge branch 'dormant_directory' into 'main'
...
Use TaskSchedule to sleep in directory bootstrapping
Closes #497
See merge request tpo/core/arti!571
2022-06-13 13:59:26 +00:00
Ian Jackson
3e035927f2
tor-netdir: testnet: Make construct_netdir infallible (rustfmt)
...
Run rustfmt. Separate commit to make review of the substantive commit
easier.
2022-06-13 14:26:32 +01:00
Ian Jackson
7d223ac9e6
tor-netdir: testnet: Make construct_netdir infallible
...
This is a *lot* of unwraps. The function takes no parameters and
is used only for testing. It ought to be infallible.
2022-06-13 14:25:45 +01:00
Nick Mathewson
923a7c55e3
Document "full", "experimental" in toplevel crate documentation.
...
Also, unify the features documentation format for those two crates,
and document previously undocumented features there.
2022-06-13 09:04:02 -04:00
eta
f7a9274e57
Merge branch 'option' into 'main'
...
config: Be consistent about Option
Closes #488
See merge request tpo/core/arti!582
2022-06-13 12:30:03 +00:00
eta
ca38fbeaaf
Merge branch 'doc' into 'main'
...
tor-error: Fix a broken intra-doc link
See merge request tpo/core/arti!580
2022-06-13 12:29:29 +00:00
Nick Mathewson
2129aee6cd
DirMgr: Use scopeguard crate in place of ad hoc RAII substitutes
2022-06-13 08:28:41 -04:00
Nick Mathewson
a7b406e69f
Put the task schedule back when the dl task exits.
...
This will allow somebody else to call bootstrap() if bootstrap() fails
the first time.
2022-06-13 08:28:41 -04:00
Nick Mathewson
430f4ffb86
New API to expose and use TaskHandle from DirMgr.
...
This change also means that we need to create the handle and scheduler
earlier in the process of creating the DirMgr. If we don't, we won't
have a way to manage the task before bootstrap() returns.
2022-06-13 08:28:41 -04:00
Nick Mathewson
ef4364f465
Add "full" and "experimental" features to arti.
2022-06-10 15:35:00 -04:00
Nick Mathewson
8a586a40fa
Add "full" and "experimental" features to arti-client and below.
...
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.
2022-06-10 15:32:21 -04:00
Nick Mathewson
171b406b00
DirMgr: Refactor bootstrap to use a TaskSchedule for sleeping.
...
This change (not yet exposed as an API) will let the TorClient have
a `TaskHandle` corresponding to the directory task, letting it
make the directory task dormant as needed.
2022-06-10 13:59:30 -04:00
Nick Mathewson
947bbe6fe7
TaskSchedule: Add a sleep_until_wallclock method too.
2022-06-10 13:59:30 -04:00
Nick Mathewson
e7681ca135
Merge branch 'nested-read-write' into 'main'
...
tor-bytes: read_nested_*: Take a closure
Closes #498
See merge request tpo/core/arti!579
2022-06-10 14:27:08 +00:00
Nick Mathewson
4f6c4f91c9
Merge branch 'channel' into 'main'
...
Have channel reactor able to send channel padding
See merge request tpo/core/arti!574
2022-06-10 13:28:51 +00:00
Ian Jackson
d22f6007f0
config: document semver change
2022-06-10 14:28:36 +01:00
Ian Jackson
baca49e087
config: Suppose that we might extend resolve_option to non-T::Default
...
As per point 3 in
https://gitlab.torproject.org/tpo/core/arti/-/issues/488
2022-06-10 14:23:16 +01:00
Ian Jackson
77f33176c3
config: Do not strip_option for journald (and in future)
...
As per point 1 in
https://gitlab.torproject.org/tpo/core/arti/-/issues/488
2022-06-10 14:23:13 +01:00
Ian Jackson
abea103bb0
tor-error: Fix a broken intra-doc link
...
I didn't spot this in review amongst the other messages from Nightly.
2022-06-10 13:45:30 +01:00
Ian Jackson
03a19f3877
tor-bytes: read_nested_*: rustfmt
...
I disagree with almost all of these layout decisions...
2022-06-10 12:30:22 +01:00
Ian Jackson
8fe63b3192
tor-bytes: read_nested_*: Take a closure
...
This eliminates the possibility of writing the bug of failing to call
`should_be_exhausted`.
As per this discussion
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/572#note_2811464
Fixes #498
2022-06-10 12:27:00 +01:00
Ian Jackson
a38c86a020
Merge branch 'format-ids' into 'main'
...
Replace four very similar "ids in request"
See merge request tpo/core/arti!577
2022-06-10 11:21:15 +00:00
Ian Jackson
dc387e10a6
dirclient: Fix comments re conssensus request without authorities
2022-06-10 11:25:34 +01:00
Ian Jackson
605a988a60
Merge branch 'typos' into 'main'
...
Fix typos
See merge request tpo/core/arti!578
2022-06-10 10:19:37 +00:00
Dimitris Apostolou
9bbb0cf3dd
Fix typos
2022-06-10 07:03:50 +03:00