Commit Graph

2355 Commits

Author SHA1 Message Date
eta 12045cb454 Merge branch 'exclude-arti-bench-coverage' into 'main'
Exclude arti-bench from coverage.

See merge request tpo/core/arti!210
2021-12-21 21:36:28 +00:00
eta 3054fc30f6 Merge branch 'ticket_256' into 'main'
Only count timeouts when we've seen net activity recently.

Closes #256

See merge request tpo/core/arti!207
2021-12-21 19:07:37 +00:00
eta 0be9558629 Merge branch 'arti-bench-usability' into 'main'
Usability improvements to arti-bench.sh script

See merge request tpo/core/arti!209
2021-12-21 18:16:37 +00:00
Nick Mathewson 3f85e69a76 Exclude arti-bench from coverage.
This program is itself for testing; we don't strongly care how much
coverage it has on its own.
2021-12-21 12:29:40 -05:00
Nick Mathewson 032b0d2575 arti-bench.sh: Handle the case where CHUTNEY_PATH is set.
Previously, this case would cause arti-bench to hang forever, trying
to bootstrap against one network while another network was running.
2021-12-21 09:54:16 -05:00
Nick Mathewson ba6828d9fe arti-bench.sh: set $RUST_LOG if it isn't set.
(An empty $RUST_LOG no output, and confuse the nickm^Wuser.)
2021-12-21 09:54:16 -05:00
Nick Mathewson 584e46d619 tests/chutney/setup.sh: Fix a shellcheck warning.
shellcheck doesn't like `export FOO="$(bar)"` as one line, since it
has the possibility of missing errors.
2021-12-21 09:54:16 -05:00
Nick Mathewson efe74e8c9b Only count timeouts when we've seen net activity.
This closes arti#256.  It makes our behavior match Tor's more closely,
though it has a simpler implementation than Tor. I think that the extra
complexity in Tor's logic is because we used to record timeouts in
the histogram as well as in the success/failure log.
2021-12-20 15:34:17 -05:00
Nick Mathewson 09d0c20c94 Merge branch 'eta/instant-checked-add' into 'main'
preemptive.rs: Use Instant::checked_add instead of raw subtraction

See merge request tpo/core/arti!206
2021-12-20 20:07:59 +00:00
eta 091065454e preemptive.rs: Use Instant::checked_add instead of raw subtraction
The implementations of `Add` / `Sub` (et al.) on `std::time::Instant`
can panic if the underlying OS structure can't represent the result
(like arti#266). Use Instant::checked_add and print a warning instead,
to prevent panicking.

Also, we now add instead of subtracting; I suspect it's reasonable that
you might not be able to go backward past the first `Instant` created on
some platforms, but going *forward* should probably work?
2021-12-20 19:27:55 +00:00
Nick Mathewson d82d70939e Update CONTRIBUTING to mention FIXME, not XXX. 2021-12-20 13:52:13 -05:00
eta 0cdf65c256 Merge branch 'refactor/must-use-self' into 'main'
address clippy's latest lint

See merge request tpo/core/arti!205
2021-12-20 18:38:18 +00:00
Nick Mathewson 6303a71d58 tor-proto: Replace XXXs with references to arti#269
These will require thought; should we ignore them, act on them, or
continue to  treat them as internal errors?
2021-12-20 10:56:24 -05:00
Nick Mathewson 26fc8073f2 Remove XXXs from tor-circmgr::mgr
IIUC, these anticipatd a need to store min_exit_circs_per_port in
CircMgr.  But the current design, where it goes into preemptive.rs and
thence to usage, seems to work fine.
2021-12-20 10:46:13 -05:00
Nick Mathewson f73f6a4e80 arti-client: Change an XXXX to a TODO.
We _do_ reject bad hostnames: just not where I once thought we might.
We need to decide if the current behavior is what we want (and I think
it is, probably?).
2021-12-20 10:02:24 -05:00
Nick Mathewson a2afb29806 Change an UTF-8 XXX to a TODO.
We're assuming that prop285 is accepted in some form.
2021-12-20 09:54:41 -05:00
Nick Mathewson 8cf143217e tor-netdoc: Change an XXX to a TODO.
Our behavior in handling not-yet-valid router descriptors doesn't match
the C Tor implementation, but it's not a big deal:
we don't currently use router descriptors at all.
2021-12-20 09:46:56 -05:00
Nick Mathewson 6299ca70b4 tor-netdoc: Use a more correct error type
If we fail to convert a curve25519 key to an ed25519 key for checking
the onion-key crosscert, don't call that an internal error: it means
that something is wrong with the provided ntor key.
2021-12-20 08:58:30 -05:00
Nick Mathewson 92e53bff62 Remove an XXXX about ed25519 signatures.
As of tor-spec commit 01122c5bd7d2f0f, the spec is no longer ambiguous
on this point.
2021-12-20 08:53:42 -05:00
Daniel Eades 9b51a52b53 address clippy's latest lint 2021-12-20 09:46:41 +00:00
eta 0577eac0bf Merge branch 'one_metahandler_at_a_time' into 'main'
tor-proto: Allow one meta-cell handler at a time.

See merge request tpo/core/arti!204
2021-12-16 21:43:33 +00:00
Nick Mathewson 64257a10fa tor-proto: Allow one meta-cell handler at a time.
Previously the code would let us try to install a meta-cell handler
before the old one was done, leading to possible confusion.
2021-12-16 16:01:50 -05:00
eta b01f695f53 Merge branch 'arti-bench' into 'main'
Introduce an experimental benchmarking utility for Arti

See merge request tpo/core/arti!195
2021-12-16 20:47:47 +00:00
eta 7921a88f8d Merge branch 'fallbackdirs-15-12-2021' into 'main'
fallbackdir: Update list generated on December 15, 2021

See merge request tpo/core/arti!202
2021-12-16 20:30:16 +00:00
eta 6a12f388f2 Merge branch 'ct_sendme_tags' into 'main'
tor-proto: use const-time eq on sendme tags.

See merge request tpo/core/arti!201
2021-12-16 20:29:01 +00:00
eta 53d084fdb6 Merge branch 'half_stream_connected_ok' into 'main'
tor-proto: set HalfStream::connected_ok right.

See merge request tpo/core/arti!203
2021-12-16 20:28:24 +00:00
Tor CI Release e17359bc18 fallbackdir: Update list generated on December 15, 2021
Signed-off-by: Tor CI Release <no-email@torproject.org>
2021-12-16 11:52:22 -05:00
Nick Mathewson 51c4ca73f2 tor-proto: set HalfStream::connected_ok right.
Previously we'd always set it to true, allowing one CONNECTED per
half-closed stream even if the stream had already received a
CONNECTED  cell.

This resolves an XXXX.
2021-12-16 11:48:39 -05:00
Nick Mathewson a09fbc9f27 tor-proto: replace a streammap XXXX with a ticket. 2021-12-16 11:33:50 -05:00
eta 06a94288ca Introduce an experimental benchmarking utility for Arti
The new `arti-bench` crate does a simple end-to-end benchmark test
embedding Arti: it generates some random data (of configurable amount,
depending on command-line parameters), and then sends said data back and
forth via Arti (which should be configured to use a local Chutney
network).

Additionally, the benchmark can also be run via a local SOCKS5 server
(in order to benchmark the performance via a local Chutney node, for
comparison).

The `tests/chutney/arti-bench.sh` sets up and tears down Chutney as
required to make this work.

This is very much a first cut; there are many things that should
eventually get added, such as support for multiple connections, JSON
output capabilities, running multiple tests, ...
2021-12-16 16:12:59 +00:00
Nick Mathewson d794355b07 tor-proto: use const-time eq on sendme tags.
There's no known attack here, but it's best practice to always compare
digests using a constant-time comparison operator.

This resolves an XXXX comment.
2021-12-16 11:06:30 -05:00
Nick Mathewson e2dd418c84 tor-proto: document an infelicitous behavior.
This was an XXXX before. Now it explains why the behavior is safe for
now, but maybe not forever.
2021-12-16 10:39:00 -05:00
Nick Mathewson de45ee41a4 tor-cell: replace an XXXX with a TODO.
The original comment was a gnomic question about what to box; the real
issue is that we want to avoid copying data in our critical path.
2021-12-16 10:29:30 -05:00
Nick Mathewson 9f6e09b4d1 tor-dirmgr: retain cache_usage on reset.
Previously we didn't retain the value of our cache_usage field when
calling reset() from GetMicrodescsState.

This resolves an XXXX comment.
2021-12-16 09:31:23 -05:00
eta 49be908feb Merge branch 'more_destroyreason' into 'main'
Extend trace messages for destroy/truncated reasons.

See merge request tpo/core/arti!200
2021-12-16 14:29:38 +00:00
eta e62212112c Merge branch 'flag-publish-2' into 'main'
Refactor directory events to use a new FlagPublisher mechanism.

See merge request tpo/core/arti!188
2021-12-16 14:28:51 +00:00
Nick Mathewson b5672cb2c7 tor-dirmgr: Warn on a bug case.
This warning occurs if we ask for microdescriptors from our local
cache, and our cache gives us something we didn't ask for.  It
shouldn't be possible, so let's warn when it occurs.

This patch resolves an XXXX.
2021-12-16 08:51:34 -05:00
Nick Mathewson a0870f8f79 Adjust comment to be accurate wrt #263. 2021-12-16 08:37:50 -05:00
Nick Mathewson d1d541142f Do not treat spawn failure as a fatal error. 2021-12-15 15:35:04 -05:00
Nick Mathewson 70dc6913e0 Expand some comments about circuit expiration.
Emphasize that circuit expiration functions _decide whether to
expire the circuit_, and don't expire it automatically.
2021-12-15 15:27:33 -05:00
Nick Mathewson 2fc6bc1fca Merge remote-tracking branch 'origin/mr/169' 2021-12-15 15:18:52 -05:00
Nick Mathewson f73840544c Extend trace messages for destroy/truncated reasons.
It makes sense to put the method for human-readable strings onto the
type itself, so that we can format these whenever they occur.

I'm choosing the "human_str" method name here, since caret-generated
types already have a to_str.  I was thinking about using Display,
but caret types already implement that.

I've also moved the message from "warn!" to "debug!", since these
aren't necessarily a problem condition.
2021-12-15 11:33:48 -05:00
Nick Mathewson 1cf0b87eb7 Merge remote-tracking branch 'origin/mr/191' 2021-12-15 10:46:58 -05:00
eta 2e0ff665bb Merge branch 'check_put_return' into 'main'
Always check whether stream-level SENDMEs are expected.

Closes #261

See merge request tpo/core/arti!192
2021-12-15 15:45:08 +00:00
eta 855b53762d Merge branch 'mfrw/proxy-flush-conns' into 'main'
proxy: introduce new functions to write_all & flush/close

Closes #262

See merge request tpo/core/arti!199
2021-12-15 14:27:12 +00:00
eta c9ec3cb324 Merge branch 'PendingRequest_remove_started_at' into 'main'
Remove unused started_at in PendingRequest

See merge request tpo/core/arti!196
2021-12-15 14:25:34 +00:00
Muhammad Falak R Wani e1452b4f21
proxy: introduce new functions to write_all & flush/close
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
2021-12-15 11:00:47 +05:30
Yuan Lyu a346893065 Add spawn_expiration_task function in circuit manager 2021-12-15 00:22:09 -05:00
Neel Chauhan 043b97fecf In reactor, use enums on whether to destroy circuits 2021-12-14 14:36:30 -08:00
Neel Chauhan b601d8b147 Methodize the destroy circuit reason 2021-12-14 14:26:45 -08:00