Commit Graph

2617 Commits

Author SHA1 Message Date
Nick Mathewson 132416275d Merge branch '010_docs' 2022-03-01 08:08:56 -05:00
Ian Jackson 73b0bf2c57 Merge branch 'eta/326' into 'main'
Refactor multiple runtime support in order to clean up documentation

Closes #326

See merge request tpo/core/arti!364
2022-03-01 11:25:03 +00:00
Ian Jackson 66f53b6a9a Merge branch 'main' into 364
Conflicts:
	crates/arti-hyper/examples/hyper.rs

Trivially resolved.  Hyper example still works.
2022-03-01 10:36:02 +00:00
Ian Jackson bda9f82c55 Merge branch 'main'
Fixed conflict in crates/arti-client/src/lib.rs as per tree
from
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/364/#note_2782166
ie 13e55b8d7c22c26e55ba75823409b477f1bce66b
2022-03-01 10:28:06 +00:00
Nick Mathewson 7d826e6da1 Merge branch 'tls' into 'main'
Implement TLS in arti-hyper

See merge request tpo/core/arti!355
2022-02-28 20:02:41 +00:00
Nick Mathewson d2eb2ede81 Merge branch 'retry-err-circmgr' into 'main'
add some error to retry_error instead of dropping it

See merge request tpo/core/arti!368
2022-02-28 19:47:01 +00:00
Nick Mathewson 9bf69f551e Update our stability warning on arti-client. 2022-02-28 14:29:50 -05:00
Nick Mathewson dd8cd08691 Add warnings about configuration stability. 2022-02-28 14:25:24 -05:00
Nick Mathewson 49a219bc4b Update README in preparation for 0.1.0 release. 2022-02-28 14:25:08 -05:00
Nick Mathewson fbd1cf01c4 Add new crates to doc/Architecture.md 2022-02-28 14:24:53 -05:00
Nick Mathewson c3e02fd05b Update FAQs about status and plans. 2022-02-28 14:22:54 -05:00
trinity-1686a 0fc7f40575 resolve comment 2022-02-28 20:05:17 +01:00
trinity-1686a 2d430ea69e add some error to retry_error instead of dropping it 2022-02-28 19:30:40 +01:00
Nick Mathewson c646d3adca Add nix exception to downgrade_dependencies. 2022-02-28 13:25:14 -05:00
Nick Mathewson c022155d95 Merge branch 'fix/368' into 'main'
remove usage of dbg!(..)

Closes #368

See merge request tpo/core/arti!367
2022-02-28 18:18:01 +00:00
trinity-1686a 55a1433499 remove usage of dbg!(..)
it's making rust-nightly job fail
2022-02-28 18:20:34 +01:00
Nick Mathewson 9321d7bdd4 Start our 0.1.0 changelog. 2022-02-28 12:13:42 -05:00
Ian Jackson 9618f85237 maint/downgrade_dependencies: Upgrade zeroize_derive, env_logger
The *earlier* versions of these crates pull in *dependencies* that
violate our MSRV policy by requiring a *later* version of Rust.

Empirically, env_logger 0.5.4 would be enough, but practice here seems
to be to just say "cargo update".
2022-02-28 17:11:59 +00:00
eta 13ba0ea005 arti-client: use PreferredRuntime by default, doc cleanups
This makes using the `PreferredRuntime` the first-class option inside
`arti-client`, freeing users who don't want to think about runtimes from
having to do so.

`TorClient::create_unbootstrapped` and `builder` now automatically
use this runtime, leaving only `builder_custom` for users who wish to
manually specify a runtime.

This lets us clean up the docs a lot: mentions of using custom runtimes
are now relegated to nearer the end of the crate-level documentation,
and we mostly just link to `tor_rtcompat`'s docs to explain more there.
Instead, we take some more time to explain how you use the builder API
to create clients synchronously.

Other doc cleanups included getting rid of the explanation of `TorAddr`
in the main crate-level doc; this is already well-documented elsewhere,
and is something users should discover organically later.

fixes arti#326
2022-02-28 16:41:13 +00:00
Nick Mathewson be288399ec Merge branch 'teardown' into 'main'
tor-circmgr: take_action: Handle Cancelled from the oneshot

Closes #365

See merge request tpo/core/arti!363
2022-02-28 15:16:03 +00:00
Nick Mathewson ec25f68b9b Fix typo in message 2022-02-28 14:47:25 +00:00
Ian Jackson cdbb904664 arti-hyper: Add vacuous doc comments as required by clippy 2022-02-28 14:39:43 +00:00
eta 8511469009 Merge branch 'faster-ci' into 'main'
attempt at making CI faster

See merge request tpo/core/arti!361
2022-02-28 14:02:15 +00:00
Nick Mathewson cb6cd4aa5c Update to new arti-corpora 2022-02-28 08:44:55 -05:00
eta d3d34c6c2e Merge branch 'split-static' into 'main'
Split "static" into sqlite and native-tls features.

Closes #302

See merge request tpo/core/arti!362
2022-02-28 13:41:27 +00:00
eta 1276f71e9a Merge branch 'always-coarsetime' into 'main'
Make coarsetime dependency and traffic-timestamping non-optional.

See merge request tpo/core/arti!358
2022-02-28 13:39:10 +00:00
Ian Jackson 8898bbb421 EK::RemoteProtocolFailed replaces OtherRemote
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/355#note_2781816
2022-02-28 13:27:44 +00:00
Ian Jackson 4425171245 Fix rustfmt
I disagree with all these.  Whatever.
2022-02-28 13:17:41 +00:00
Nick Mathewson 12a83e9661 Merge branch 'fix/210' into 'main'
don't return already errored pending circuit when searching new circuit matching spec

Closes #210

See merge request tpo/core/arti!366
2022-02-28 13:16:31 +00:00
Ian Jackson 551bc69045 arti-hyper: Abolish a bool in favour of a custom private enum
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/355#note_2781820
2022-02-28 13:16:25 +00:00
Ian Jackson adfabe6cd1 arti-hyper: Box the http variant (bare DataStream)
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/355#note_2781819
2022-02-28 13:12:20 +00:00
Ian Jackson 4705234a49 arti-hyper: Fix duplicative doc comment not to be wrong 2022-02-28 13:07:44 +00:00
Ian Jackson 85e7d4b088 arti-hyper: Drop description of nonexistent error-detail feature 2022-02-28 13:07:44 +00:00
Ian Jackson 51c9cec1f1 arti-hyper: Clarify what the TLS features do. 2022-02-28 13:07:44 +00:00
Ian Jackson c24c3af81b arti-hyper: Actually support TLS 2022-02-28 13:07:44 +00:00
Ian Jackson c397c772e6 arti-hyper: Provide TLS connector and make space for TLS stream
Add tls_conn field to ArtiHttpConnector (and argument to constructor).
Introduce MaybeHttpsStream and use it in ArtiHttpConnection.
Have the example program pass the native TLS connector.

Currently the TLS connector and the HTTPS variant are not used, but
this commit is very noisy and fomrulaic, so I have split out the code
to use them into a separate commit for easier preparation and review.
2022-02-28 13:07:44 +00:00
Ian Jackson 148cd61f2b Manually implement Clone for ArtiHttpConnector
This will be needed in a moment and doing it now makes the next patch
smaller and hence easier to read.
2022-02-28 13:07:44 +00:00
Ian Jackson c08a317093 Introduce ErrorKind::OtherRemote
arti-hyper wants to be able to have a kind for TLS failure.

Given that arti-hyper is above arti-client, this shows that callers
above arti-client might need to invent kinds for their own errors.

Possibly this means we need other Other errors for other locations.
If we have pluggable components we might even want OtherTorError.
2022-02-28 13:07:44 +00:00
Ian Jackson 9a729aa2f8 arti-hyper: Disable clippy::clone_on_ref_ptr
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/355#note_2781816
disable this here for now, pending a decision on !352
2022-02-28 13:07:08 +00:00
Ian Jackson 23f8d33d4d Add a debug! log message for source cancellation 2022-02-28 12:52:38 +00:00
Ian Jackson 6d01c60925 Fix rustfmt 2022-02-28 12:36:48 +00:00
Ian Jackson 3e7c113233 Merge branch 'more-debug' into 'main'
impl Debug for various internal types

See merge request tpo/core/arti!360
2022-02-28 11:41:07 +00:00
Nick Mathewson 76d8338640 Fix two typos 2022-02-28 11:21:52 +00:00
trinity-1686a 5323825964 don't return already errored pending circuit when searching new circuit matching spec 2022-02-27 13:16:03 +01:00
Ian Jackson dbf019e426 tor-circmgr: take_action: Handle Cancelled from the oneshot
Fixes #365

Inspection of the code and logs shows that:
 * One of the plan futures' oneshots must be returning Cancelled
 * This means that the corresponding sender must have been dropped
 * The sender is owned by the task spawned by spawn_launch
Presumably that entire task gets dropped as part of executor shutdown,
or something.

The correct response in this situation is to declare that we are
shutting down, and stop trying to do stuff.

Unfortunately, despite trying quite hard by putting sleeps in various
strategic places, I have not been able to reproduce the problem.  So I
can't be 100% sure that the new behaviour is correct.

But I am reasonably confident that this ought not to be able to occur
unless either 1. the task from spawn_launch is dropped, or 2. that
task somehow panics despite its attempts to trap panics and report
them as errors through the oneshot.

So this "burn it all down" action ought only to occur in actually
serious situations.

I observe that
  3ff9b187ea
  Handle panics from circuit construction.
changed the EK for PendingCanceled to EK::ReactorShuttingDown,
and there's From impl.  I think, therefore, that it is right
to reuse this Error variant.

I don't quite understand why when take_action gets an actual error it
doesn't push it, but just logs it.  But I am not changing that for
now.

Arguably the two instances of retry_error.push are a sign of an
inferior flow control pattern - maybe the loop body including the code
I am adding ought to be an IEFE returning
`Result<Option<circ>, crate::Error>`.
2022-02-25 18:10:36 +00:00
Nick Mathewson 489da37fe4 Split "static" into sqlite and native-tls features.
Otherwise, it's impossible to get a static sqlite linkage without
also getting native-tls, even if you wanted rustls.

Closes #302.
2022-02-25 13:05:25 -05:00
Ian Jackson 6b615b4766 impl Debug for various internal types
I wanted this while debugging something.

The ad-hoc impl Debug with f.debug_struct is getting repetitive
and I've already perpetrated one copy-paste mistake.
We should consider using something like the `educe` crate's Clone.
2022-02-25 17:37:10 +00:00
eta 387ebda740 tor-rtcompat: refactor PreferredRuntime, clean up docs
`PreferredRuntime` is now an opaque wrapper struct that contains the
"actual" preferred runtime as a type alias. The `current_user_runtime`
and `create_runtime` functions become `PreferredRuntime::current` and
`PreferredRuntime::create`, respectively.

This removes the dependence on `impl Trait`, meaning we can now name the
returned runtime (yay!).

In addition, the documentation was cleaned up a bit to make it
(hopefully) flow better. Items that don't make sense to publicize, like
testing implementation details, have been marked #[doc(hidden)] and
semver warnings added.
2022-02-25 17:34:05 +00:00
trinity-1686a ee4ea74698 attempt at making CI faster
Move rust-nightly to stage test so it runs in parallel with coverage,
which are the two longest jobs, and currently run in sequence.
Don't document dependancies, should make the step about 50% faster
Use about 12M of cache to not recompile grcov each time
Don't compile grcov with coverage, we don't need it, it's probably
slower both to compile and execute
2022-02-25 18:08:14 +01:00
Nick Mathewson c98a2f6f62 Merge branch 'cargo_upgrade' into 'main'
Run "cargo upgrade" in preparation for 0.1.0.

See merge request tpo/core/arti!359
2022-02-25 17:02:09 +00:00