Commit Graph

8064 Commits

Author SHA1 Message Date
Kunal Mehta 7acd7de369 Update documentation regarding the `onion-service-client` feature
It is no longer experimental, but still not rated for security-sensitive
usage per <https://blog.torproject.org/arti_116_released/>.
2023-07-07 22:01:51 -04:00
Ian Jackson 77b0dc2edc Merge branch 'raw_event_report' into 'main'
Fix warn_report and error_report macros.

See merge request tpo/core/arti!1390
2023-07-07 20:07:45 +00:00
Nick Mathewson 53c599d50f Fix warn_report and error_report macros.
Originally they didn't check err.kind(), since err.kind() can never
increase their severity.  We lost that behavior with !1386, and we
became dependent on it with arti!1383.  Since they both merged at
the same time, CI broke.

This patch restores their original behavior.
2023-07-07 15:46:41 -04:00
Nick Mathewson ba3876b22a Merge branch 'feat' into 'main'
arti: Build with HS client support by default

Closes #948

See merge request tpo/core/arti!1382
2023-07-07 19:28:05 +00:00
Nick Mathewson b6b7edad59 Merge branch 'event_report_everywhere' into 'main'
Throughout: Use event_report!() macros for reporting Errors.

Closes #949

See merge request tpo/core/arti!1383
2023-07-07 19:27:20 +00:00
Nick Mathewson b251784041 Merge branch 'fix-os-onionbalance' into 'main'
be more lenient while parsing inner hs desc

Closes #952

See merge request tpo/core/arti!1389
2023-07-07 19:26:27 +00:00
trinity-1686a 2d170425c0 be more lenient while parsing inner hs desc 2023-07-07 21:06:05 +02:00
Ian Jackson 778244c3af Merge branch 'report' into 'main'
tor-error: tracing module: Use macro to generate macros

See merge request tpo/core/arti!1386
2023-07-07 18:09:46 +00:00
Ian Jackson 08632739eb Document (retrospectively) the behaviour of 1.1.6 re HS client 2023-07-07 19:04:16 +01:00
Ian Jackson 696adc3c94 tor-error: tracing module: Use macro to generate macros
This abolishes some quintuplication.

The output is identical except that:
 * The syntax display in the rustdoc output for the resulting macros
   seems to have somewhat less whitepsace.
 * The whimsical error messages in the examples are all identical.
   Ah well.
2023-07-07 18:38:24 +01:00
Nick Mathewson 7d1c8dfde0 Merge branch 'inclusive' into 'main'
rng ranges: Use inclusive Duration ranges in several places

See merge request tpo/core/arti!1385
2023-07-07 17:07:58 +00:00
Nick Mathewson 25c6fe61e4 Throughout: Use *_report!() macros for reporting Errors.
I identified the cases to replace by searching for the string
`.report()`.  There are a few that I didn't change:

  * A couple of cases that used anyhow::Error,
  * One case that reported two Errors.
  * Two cases in `tor_hsclient::err` that just did
    `error!("Bug: {}")`.

I have also not audited the cases in `tor-hsclient` where we're using
`tor_error::Report` manually.

Nonetheless, closes #949.
2023-07-07 13:00:21 -04:00
Ian Jackson 220900a852 tor-error: tracing module: Fix link to tracing macro 2023-07-07 17:48:05 +01:00
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 6187b6d5ca geoip: Enable the niche optimization for CountryCode.
Since we're going to be using `Option<CountryCode>` all over, let's
save the extra byte.

Sadly this required std::mem::transmute(), which is unsafe, so maybe
we should think twice.
2023-07-07 10:33:33 -04: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 7e2fa11065 add_warning: Tolerate clippy::missing_panics_doc
As of current nightly, this lint now includes expect()s,
which makes it trigger way more than we'd like.

See discussion on #950.
2023-07-06 14:29:40 -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
gabi-250 34b7699fff Merge branch 'task5' into 'main'
tor-rtmock: Minor followups for impl_runtime

See merge request tpo/core/arti!1378
2023-07-06 16:05:30 +00: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