Ian Jackson
bcc3e6fef8
rng ranges: Use inclusive Duration ranges in several places
...
Many of these call sites would panic if, somehow, the upper bound was
zero. In most cases it is very complicated to see if whether this
could happen.
However, there is a better answer:
Durations are (conceptually) dense, so picking the closed set (which
includes its boundary) rather than the open one (which doesn't) will
make little practical difference.
So change four call sites to use `..=` instead of just `..`.
2023-07-07 16:13:52 +01:00
Nick Mathewson
70f0fe634f
Merge branch 'report-bugs-v2' into 'main'
...
Optional tracing support in tor-error for error reporting
See merge request tpo/core/arti!1379
2023-07-07 13:49:59 +00:00
Nick Mathewson
023d288ba2
event_report: assert correctness of format ending
...
(Also, document that this static assertion is the reason why you are
seeing a confusing error message.)
2023-07-07 09:00:31 -04:00
Nick Mathewson
a441b4e9d3
circmgr: Use event_report!() and similar macros
...
This simplifies our logging a little, and implements part of
2023-07-07 09:00:31 -04:00
Nick Mathewson
7168feefdd
tor-error: Add optional tracing support
...
The main contribution here is a set of convenience macros for
logging error `Report`s. Notably, this macros always logs
`Internal` and `BadAspiUsage` errors at `WARN`, unless they
are already at `ERROR` or more.
This is a little tricky because `tracing::event!()` requires
its Level argument to be a constant.
2023-07-07 09:00:31 -04:00
Ian Jackson
80f397fb0b
Merge branch 'allow_missing_panics' into 'main'
...
add_warning: Tolerate clippy::missing_panics_doc
Closes #950
See merge request tpo/core/arti!1380
2023-07-07 12:53:46 +00:00
Saksham Mittal
9de4f38b38
Make CompoundFactory private for external code
2023-07-07 18:18:44 +05:30
Nick Mathewson
2b3d4150e3
Merge branch 'clippy-nightly-20230703' into 'main'
...
Fix various warnings from clippy nightly
Closes #943
See merge request tpo/core/arti!1369
2023-07-07 12:26:45 +00:00
Ian Jackson
4c0935e13a
arti: Build with HS client support by default
...
Fixes #948
2023-07-07 12:54:08 +01:00
Ian Jackson
61344f68a5
arti Cargo.tomL: wrap default features list
2023-07-07 12:52:05 +01:00
Ian Jackson
6e495d8400
tor-rtmock: Use derive-adhoc for composite runtimes
2023-07-07 10:26:44 +01:00
Nick Mathewson
4caf86349c
Remove explicit allows for missing_panics_docs.
...
These are no longer needed.
2023-07-06 14:36:13 -04:00
Nick Mathewson
03f9f9987a
Run add_warning to remove `missing_panics_doc` deny.
...
Closes #950 .
2023-07-06 14:32:23 -04:00
Nick Mathewson
07b4b11d7a
Avoid matches!(x, None), matches!(x, Ok(_))
...
This appeases clippy-nightly.
2023-07-06 14:26:48 -04:00
Nick Mathewson
486b6b8c82
tor-rtcompat: Simplify trivial all() expressions.
...
Clippy nightly doesn't like `#[cfg(all(...))]` with only a single
expression inside the `all(...)`.
This requires an adjustment in check_doc_features.
2023-07-06 14:26:43 -04:00
Ian Jackson
de97288c53
tor-rtmock: statically assert that the macro makes a Runtime impl
2023-07-06 15:58:42 +01:00
Ian Jackson
f0168b5220
tor-rtmock: Use the same specified field for BlockOn and Spawn
...
These are always the same and probably always will be.
2023-07-06 15:58:42 +01:00
Ian Jackson
1ec339daf4
Merge branch 'task4' into 'main'
...
Introduce a MockExecutor for fully-isolated test cases
See merge request tpo/core/arti!1375
2023-07-06 14:41:04 +00:00
Nick Mathewson
36a92e44d9
Merge branch 'log_precision' into 'main'
...
arti: Add a `logging.time_granularity` option with 1s default.
Closes #551
See merge request tpo/core/arti!1376
2023-07-06 14:37:49 +00:00
Saksham Mittal
c238434194
Mark builder() as experimental
2023-07-06 19:49:37 +05:30
Saksham Mittal
175b2911da
Import ChannelFactory instead of CompoundFactory
2023-07-06 19:48:28 +05:30
Saksham Mittal
008a9b7bc5
Rename get_channelbuilder() to builder()
2023-07-06 19:46:39 +05:30
Saksham Mittal
be6b72f946
Conditionally make CompoundFactory public
2023-07-06 19:45:34 +05:30
Ian Jackson
0b8b965cf7
tor-rtmock: Add semver.md
2023-07-06 15:14:41 +01:00
Ian Jackson
6ed8e0b669
tor-rtmock: task: Fix a typo
...
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1375#note_2919976
2023-07-06 15:14:41 +01:00
Ian Jackson
7e7428611e
tor-rtmock: task: clarify progress_until_stalled a little
2023-07-06 15:14:41 +01:00
Ian Jackson
6aff623c08
tor-rtmock: Runtime: Expand on "allowed" documentation
2023-07-06 15:14:41 +01:00
Ian Jackson
02293bd42d
tor-rtmock: task: Remove a () assignment
...
Discussion:
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1375#note_2919928
2023-07-06 15:14:41 +01:00
Ian Jackson
89994142d3
tor-rtmock: task: Abolish TaskFutureInfo alias (fmt)
2023-07-06 15:14:41 +01:00
Ian Jackson
78071c30ef
tor-rtmock: task: Abolish TaskFutureInfo alias
...
Requested by:
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1375#note_2919926
2023-07-06 15:14:41 +01:00
Ian Jackson
55329fe85b
tor-rtmock: Net: Make UDP sockets un-constructable
...
This will hopefully mean anyone trying to use this will notice that
it's not implemented.
Prompted by:
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1375#note_2919925
2023-07-06 15:14:41 +01:00
Ian Jackson
5a05960958
tor-rtmock: Add a cross-reference from MockSleepRuntime::wait_for
2023-07-06 15:14:41 +01:00
Ian Jackson
1f41281cfd
tor-dirmgr: bridge descriptor tests: Add a missing #[traced_test]
...
This seems to have been overlooked.
2023-07-06 15:14:41 +01:00
Ian Jackson
a4bb2a8b57
tor-dirmgr: bridge descriptor tests: Use MockRuntime (drop Tokio dep)
...
This isn't used any more.
2023-07-06 15:14:40 +01:00
Ian Jackson
25e51f212a
tor-dirmgr: bridge descriptor tests: Use MockRuntime (fmt)
...
Run rustfmt.
2023-07-06 15:14:40 +01:00
Ian Jackson
5eb066acf9
tor-dirmgr: bridge descriptor tests: Use MockRuntime
...
This abolishes a bodge sleep. It should make the tests deterministic.
2023-07-06 15:14:40 +01:00
Ian Jackson
473fd23f8b
tor-dirmgr: bridge descriptor tests: Fix a v. low prob. race
...
Drain a number of events, not just one. The stream might yield many
events, as explained in this new comment.
This fails every time with MockExecutor::try_test_with_various().
I think it might fail with the tokio exeuctor too, but evidently not
with high probability or we would have noticed.
2023-07-06 15:14:40 +01:00
Ian Jackson
bc63fdb34c
tor-hsclient: Abolish ad-hoc real-world-time sleeps
...
Now we can reliably wait precisely for the tasks to be all waiting.
This test case no longer involves any real executor.
2023-07-06 15:14:40 +01:00
Ian Jackson
dc28b320f4
tor-rtmock: MockRuntime: provide test_with_various
...
In both fallible and infallible variants, for convenience.
2023-07-06 15:14:40 +01:00
Ian Jackson
e23b1e00b5
tor-rtmock: MockExecutor: Configurable scheduling policy
2023-07-06 15:14:40 +01:00
Ian Jackson
be632ba0f9
tor-rtmock: Provide MockRuntime
2023-07-06 15:14:40 +01:00
Ian Jackson
67941488ab
tor-rtmock: Unit tests for MockExecutor
2023-07-06 15:14:40 +01:00
Ian Jackson
d82ed8d793
tor-rtmock: Provide MockExecutor
2023-07-06 15:14:40 +01:00
Ian Jackson
70fdd92030
tor-rtmock: impl Default for MockNetProvider
2023-07-06 15:14:40 +01:00
Ian Jackson
24da490ef5
tor-rtmock: impl Default for MockNetProvider (prep)
...
We want MockNetProvider to be Default.
In this commit: impl Default for MockNetwork and use it in new().
2023-07-06 15:14:40 +01:00
Ian Jackson
29cc83b35e
tor-rtmock: impl Default for MockSleepProvider
...
Pick an arbitrary start time roughly now. This will do for many
tests.
2023-07-06 15:14:40 +01:00
Ian Jackson
395a616c9f
tor-rtmock: net: "Provide" a UDP "implementation" which doesn't work
...
Nothing in our tree actually *uses* the UDP in tests.
We want a mock UDP provider that isn't part of a real runtime, so that
we can make a totally-mock runtime for properly controlled testing.
It seems best to make this part of MockNetProvider rather than a
separate type.
2023-07-06 15:14:40 +01:00
Ian Jackson
070a934451
tor-rtmock: Introduce impl_runtime_prelude (fmt)
2023-07-06 15:14:40 +01:00
Ian Jackson
492699d522
tor-rtmock: Introduce impl_runtime_prelude
...
This deduplicates some imports, which would otherwise be about to
become triplicated.
2023-07-06 15:14:40 +01:00
Ian Jackson
97e817b330
tor-rtmock: Introduce impl_runtime! macro
...
This deduplicates some trait delegation.
We want this now because we're about to introduce a third mock
runtime, so this would become triplication otherwise.
2023-07-06 15:14:40 +01:00
Nick Mathewson
5a46dfef8f
arti: comments about catch_unwind
2023-07-06 09:44:51 -04:00
Nick Mathewson
6b6b3d9e53
time_granularity: Make sure formatter can't panic
...
I was unable to assure myself that tracing_subscriber could
withstand a panicking Timer, so instead I'm trying to make sure
our own LogTimer can't panic.
2023-07-06 09:44:50 -04:00
Nick Mathewson
512064cc19
arti: Add a `logging.time_granularity` option with 1s default.
...
This lets us provide less information in our logs: in particular, it
lets us avoid logging with microsecond precision.
Closes #551 .
2023-07-06 09:44:09 -04:00
Nick Mathewson
5f896aa504
Merge branch 'tracing-panic' into 'main'
...
arti: Install a panic hook that sends messages to `tracing`
Closes #921
See merge request tpo/core/arti!1377
2023-07-06 13:09:54 +00:00
Nick Mathewson
d2b6fee3f9
arti: Note possibility for future use of other tracing panic provider
2023-07-06 08:50:53 -04:00
Nick Mathewson
01f1192b20
arti: On panic, avoid allocation even more.
...
The original version of our panic handler would allocate a string
for the panic `Location`. But if we're panicking we'd like to keep
allocations to a minimum: so instead format the `Location`
conditionally.
This also drops a useless `std::borrow::Cow`. (The possibility of a
"Don't have a `Cow`" commit message was considered and rejected.)
2023-07-06 08:45:34 -04:00
Gabriela Moldovan
258dd195e0
keymgr: Explain why the TODO regarding EncodableKey can't be addressed.
2023-07-05 22:21:47 +01:00
Nick Mathewson
afa51fd5ca
Add TODO comments about possibly migrating away from the backtrace crate.
2023-07-05 16:39:11 -04:00
Nick Mathewson
9c4de185e9
arti: Install a panic hook that sends messages to `tracing`
...
(Also leaves installed the default handler that sends messages to
stderr.)
Closes #921 .
2023-07-05 16:37:10 -04:00
Ian Jackson
0003a632de
Merge branch 'unpublishing' into 'main'
...
Mark several crates with `publish=false`.
Closes #944
See merge request tpo/core/arti!1371
2023-07-05 16:49:41 +00:00
Saksham Mittal
c94b1b6574
Remove now unnecessary lines for import
2023-07-05 19:03:53 +05:30
Saksham Mittal
68948e9677
Import CompoundFactory regardless of feature level
2023-07-05 18:59:54 +05:30
Saksham Mittal
58df83dcde
Create new method to expose CompoundFactory
2023-07-05 18:53:22 +05:30
Saksham Mittal
7600200f15
Expose CompoundFactory for later exposure in API
2023-07-05 18:39:44 +05:30
Nick Mathewson
517bf1cf03
Mark arti-bench with "publish = false"
...
This crate is only useful for development; earlier we published it,
but I believe that was in error.
2023-07-03 13:52:20 -04:00
Nick Mathewson
2c5b81e872
Mark vestigial crates as "publish=false"
...
These crates were started, but they aren't integrated into
Arti (yet?). As such it doesn't make sense to keep publishing
updated versions of them every time we tweak our standard
lints.
2023-07-03 13:49:51 -04:00
Nick Mathewson
19b1d3bba5
Additional documentation around bridges/PT configuration
...
This tries to flesh out some of the details for users who may be new
to bridges and PTs.
Closes #706 .
2023-07-03 13:00:25 -04:00
Nick Mathewson
f626bcd7f1
Finish a sentence in the documentation for TorClient::netdir()
2023-07-03 12:35:31 -04:00
Nick Mathewson
1f49be1a77
tor-config: Use next_back() instead of rev().next()
...
This is a new warning^Wsuggestion from clippy nightly.
2023-07-03 08:34:54 -04:00
Ian Jackson
27ad9ca249
tor-proto: run rustfmt
2023-06-30 18:43:20 +01:00
Ian Jackson
a97cb2af6a
tor-proto conversations: semver
2023-06-30 18:43:20 +01:00
Ian Jackson
2a67468d27
tor-proto conversations: Update a TODO
...
The feature name is wrong now.
2023-06-30 18:43:20 +01:00
Ian Jackson
78e4f9e86b
tor-proto conversations: Drop a TODO
...
I think this name is fine.
2023-06-30 18:43:20 +01:00
Ian Jackson
226bca984b
tor-proto conversation API: Provide ConversationInHandler
2023-06-30 18:43:20 +01:00
Ian Jackson
800f390a9d
tor-proto circuit: Plumb async Context through
...
handle_msg is going to want this in a moment.
2023-06-30 18:28:41 +01:00
Ian Jackson
c599258b85
tor-proto conversation API: Soften a warning
...
If the circuit is just being used by us (which is likely, if we're
using this API) then the only reactor we're blocking is our own.
2023-06-30 18:28:41 +01:00
Ian Jackson
287c458731
tor-proto conversation API: Implement Conversation
...
Now, after you call start_conversation_last_hop, you can send more
messages if you like.
2023-06-30 18:28:41 +01:00
Ian Jackson
77903a295f
tor-proto: Make the handler in SendMsgAndInstallHandler optional
...
We're going to want to do almost-the-same thing but without installing
a new handler.
2023-06-30 18:14:34 +01:00
Ian Jackson
20f1e065b3
tor-proto conversation API: Return a Conversation
...
This is just a placeholder for now, but it'll be a thing you can send
more messages with.
2023-06-30 18:03:17 +01:00
Ian Jackson
2882e3a93e
tor-proto conversation API: Rename to start_conversation_last_hop
...
Was send_control_message.
2023-06-30 18:02:56 +01:00
Ian Jackson
3812e3ccdd
tor-proto conversation API: Make starting message optional
...
We're going to let people start a conversation and either expect to
receive first, or send messages ad-hoc later.
2023-06-30 18:02:15 +01:00
Ian Jackson
b162d005a7
tor-proto conversation API: Rename to ConversationFinished
...
Was UninstallHandler. We are going to talk more about conversations
and less about handlers (although, the fact of there being a handler
will still be visible).
2023-06-30 18:02:04 +01:00
Ian Jackson
408c8f30ad
tor-proto circuit: Make reactor::run_once modulae-private
...
Nothing else wants this and having it pub(super) is confusing.
2023-06-30 17:34:50 +01:00
Ian Jackson
21c564fa01
tor-hsclient: Mock traits: Work around an async boobytrap
2023-06-30 17:34:01 +01:00
Nick Mathewson
27bd990a79
Remove semver.md files for 1.1.6
2023-06-30 10:28:53 -04:00
Gabriela Moldovan
3afe810a3b
keymgr: Fix broken doc link.
2023-06-30 14:41:33 +01:00
Nick Mathewson
de13a7319b
Bump patchlevel versions on crates with smaller changes
...
Done with the commands below.
The following crates have had various changes, and should get a
patchlevel bump. Since they are pre-1.0, we do not need to
distinguish new APIs from other changes.
```
cargo set-version --bump patch -p arti-client
cargo set-version --bump patch -p safelog
cargo set-version --bump patch -p tor-bytes
cargo set-version --bump patch -p tor-cert
cargo set-version --bump patch -p tor-circmgr
cargo set-version --bump patch -p tor-config
cargo set-version --bump patch -p tor-consdiff
cargo set-version --bump patch -p tor-dirclient
cargo set-version --bump patch -p tor-dirmgr
cargo set-version --bump patch -p tor-error
cargo set-version --bump patch -p tor-hsservice
cargo set-version --bump patch -p tor-linkspec
cargo set-version --bump patch -p tor-llcrypto
cargo set-version --bump patch -p tor-netdir
cargo set-version --bump patch -p tor-netdoc
cargo set-version --bump patch -p tor-proto
cargo set-version --bump patch -p tor-rpcbase
cargo set-version --bump patch -p tor-socksproto
```
This crate has new features, but no new non-experimental Rust APIs.
So even though it is post-1.0, it gets a patchlevel bump.
```
cargo set-version --bump patch -p arti
```
2023-06-30 08:42:21 -04:00
Nick Mathewson
65e81bf0ca
Bump minor versions on crates with breaking changes
...
Done with:
```
cargo set-version --bump minor -p tor-hsclient
cargo set-version --bump minor -p arti-rpcserver
cargo set-version --bump minor -p tor-hscrypto
cargo set-version --bump minor -p tor-cell
```
2023-06-30 08:38:16 -04:00
Nick Mathewson
40768a9f61
Bump versions on crates with nonfunctional changes
...
These crates have had nonfunctional changes only, mostly due to !1271 ,
or ac90cb7500
, or documentation changes: crates that depend on
them do not require a version bump.
```
arti-bench
arti-config
arti-hyper
arti-testing
caret
fs-mistrust
retry-error
tor-async-utils
tor-basic-utils
tor-chanmgr
tor-checkable
tor-congestion
tor-consdiff
tor-events
tor-guardmgr
tor-persist
tor-protover
tor-ptmgr
tor-rtcompat
tor-rtmock
tor-units
```
2023-06-30 08:30:55 -04:00
gabi-250
8c1e96a22c
Merge branch 'arti-path-bug' into 'main'
...
keymgr: Allow periods in ArtiPath and ArtiPathComponent.
See merge request tpo/core/arti!1358
2023-06-30 11:30:45 +00:00
Gabriela Moldovan
a61071f7b6
keystore: Change the dummy HsClientSpecifier to "default".
2023-06-30 11:49:07 +01:00
Gabriela Moldovan
35e063702f
keymgr: Update ArtiPath and ArtiPathComponent docs.
...
The docs were lying, we actually support UTF-8 paths (though we might
later decide to restrict the charset further).
2023-06-30 11:49:05 +01:00
Gabriela Moldovan
474f273b6c
keymgr: Allow periods in ArtiPath and ArtiPathComponent.
...
The `ArtiPath` of a client auth key contains the `HsId` of the onion
Since the `HsId` contains a `.onion` component, let's allow `.` for now.
In the future, we may want to update the code (and keystore structure)
to strip away the `.onion` part before building the `ArtiPath`.
2023-06-30 11:48:27 +01:00
Ian Jackson
5d99725c65
Merge branch 'keymgr-docs' into 'main'
...
keymgr: Downgrade "TODO hs" to "TODO HSS"
See merge request tpo/core/arti!1360
2023-06-30 10:48:25 +00:00
Ian Jackson
88527d14c8
Merge branch 'fix-unfortunate-merge-outcome' into 'main'
...
arti-client: Rename KeyStore to Keystore.
See merge request tpo/core/arti!1359
2023-06-30 10:41:58 +00:00
Ian Jackson
a7334f86ae
Merge branch 'docsrs-fix' into 'main'
...
Add a missing "experimental-api" rustdoc notation
See merge request tpo/core/arti!1353
2023-06-30 10:41:12 +00:00
Ian Jackson
f177a5bde4
Merge branch 'fixup-features' into 'main'
...
Run fixup-features on current `main`
See merge request tpo/core/arti!1352
2023-06-30 10:38:53 +00:00
Gabriela Moldovan
90183368a2
keymgr: Downgrade "TODO hs" to "TODO HSS"
...
This TODO doesn't need to block the release.
2023-06-30 11:16:28 +01:00
Gabriela Moldovan
e899c41135
arti-client: Rename KeyStore to Keystore.
...
`KeyStore` was renamed to `Keystore` globally in !1355 . This fixes a
compile error caused an unfortunate series of non-conflicting (from
git's POV) but incompatible merges:
* !1356 added a line threferencing an error variant that capitalizes the
"s" in "KeyStore" (`ErrorDetail::KeyStore`)
* !1356 landed just before !1355 (the global renaming). Since there was
no conflict between the 2, we're now in a state where the code added
in !1356 is referencing an `ErrorDetail` variant that no longer
exists.
2023-06-30 11:01:58 +01:00
Alexander Færøy
60f6fe7460
Merge branch 'keymgr-naming' into 'main'
...
keymgr: Rename KeyStore to Keystore globally.
See merge request tpo/core/arti!1355
2023-06-30 00:11:17 +00:00