Commit Graph

2810 Commits

Author SHA1 Message Date
eta c98d9dc5fe Implement a basic form of RFC 8305 ("happy eyeballs") for channels
This makes Arti usable in IPv6-only environments (arti#92) by letting us
attempt multiple connections to a given relay using all of its
addresses instead of just using the first (probably IPv4) one, using the
strategy from RFC 8305 § 5.

This isn't a complete implementation of Happy Eyeballs; ideally, we'd
sort the address list before doing concurrent connections. However, it
works (and has been tested inside an IPv6-only container inside eta's
network :p)
2022-03-07 14:56:51 +00:00
Nick Mathewson cc6ba72dc3 Merge branch 'bench_multicirc' into 'main'
arti-bench: support multiple streams per circuit, multiple circuits per sample.

Closes #380

See merge request tpo/core/arti!384
2022-03-07 14:11:53 +00:00
Nick Mathewson 49216a5202 arti-bench: documentation fixes 2022-03-07 08:42:20 -05:00
Nick Mathewson 22ee7671f8 arti-bench: record streams_per_circ and circs_per_sample. 2022-03-07 08:38:02 -05:00
Ian Jackson 6193c9d974 humantime_serde_option: New module in tor-basic-utils
This will be used to allow our config *builder* structs to be
Deserialize.
2022-03-07 12:38:30 +00:00
Lennart Kloock 15cfce6939
Add more explaining text 2022-03-05 12:23:46 +01:00
Lennart Kloock c92e2b6b6e
Add link to shellcheck installation guide 2022-03-05 12:10:43 +01:00
Lennart Kloock 1af47fbbf4
Add required dependencies to compile `arti` and run git hooks to CONTRIBUTING.md 2022-03-05 12:06:37 +01:00
Michael 206714f2e4 Test shell variable expansion on windows 2022-03-05 01:40:42 +00:00
Steven Murdoch b041bebe9d Add instructions for hooking up Tor Browser to arti on Windows 2022-03-04 22:56:55 +00:00
Nick Mathewson 8231e70288 Merge branch 'todos' into 'main'
Add config paths table in arti docs

See merge request tpo/core/arti!386
2022-03-04 22:19:44 +00:00
Lennart Kloock ef21559df1
Add config paths table in `arti` docs 2022-03-04 22:43:14 +01:00
Nick Mathewson 64fa8ea77d Omit arti-testing from coverage. 2022-03-04 15:24:38 -05:00
Nick Mathewson cb846de367 Merge branch 'reproducible-build-fix-summary-git' into 'main'
fix reproducible build summary giving invalid branch and commit id

Closes #378

See merge request tpo/core/arti!383
2022-03-04 19:52:19 +00:00
Nick Mathewson 994a8f7cfa Merge branch 'errors-for-dirprovider' into 'main'
Errors for dirprovider

Closes #370

See merge request tpo/core/arti!385
2022-03-04 19:51:23 +00:00
trinity-1686a 5e5864802d fix reproducible build summary giving invalid branch and commit id
fix #378
also fix unrelated error in nightly rustdoc CI
2022-03-04 19:25:40 +01:00
Ian Jackson b095265257 Merge branch 'educe-traits' into 'main'
Replace many manual trait impls with use of educe

See merge request tpo/core/arti!375
2022-03-04 18:00:17 +00:00
Nick Mathewson e4ed8241ba Fix an unwrap() error. 2022-03-04 12:37:22 -05:00
Ian Jackson 055b7399f2 Provide ErrorKind::Other 2022-03-04 17:35:34 +00:00
Ian Jackson 4bff33c397 Provide an error variant for external directory providers 2022-03-04 17:35:34 +00:00
Ian Jackson 952aef1be3 Merge branch 'hex_decode' into 'main'
Speed up RsaIdentity decoding

Closes #377

See merge request tpo/core/arti!381
2022-03-04 17:22:52 +00:00
Nick Mathewson 8c34896651 arti-bench: use isolation to support multiple circuits per run. 2022-03-04 12:22:43 -05:00
Ian Jackson 0cfb6a0e0f tor-basic-utils: copy the README into lib.rs
The doc include rune does not work with our MSRV; it needs 1.54.

The alternative would be some kind of cfg() but that would
  - not provide the crate-level doc on Rust 1.53
  - involve the use of cfg_attr

Instead, just do it the old way.
2022-03-04 16:54:54 +00:00
Nick Mathewson 42245de9f5 arti-bench: simplify future-creation code slightly 2022-03-04 11:45:45 -05:00
Nick Mathewson c978a0d78b arti-bench: refactor stream construction to connect in parallel
Previously we tried to do each connection in a run, and only then did we
start transferring data over them.  Now we collect a bunch of the
futures that return an open stream, and run them all in parallel
with using them.  This change includes connect-time in our
benchmarks, and allows us to test contention in our connect code.

Instead of using a Stream, I've changed the connection-generation
code to call a future-returning function directly, so we have a way
to explicitly pass which run we're in.
2022-03-04 11:41:51 -05:00
eta 8d26726fdf Merge branch 'arti-testing-part1' into 'main'
arti-testing: Initial implementation

See merge request tpo/core/arti!378
2022-03-04 16:29:41 +00:00
eta 049d304e73 Merge branch 'upgrade_repro_rust' into 'main'
docker_reproducible_build: Bump to Rust 1.59

Closes #376

See merge request tpo/core/arti!380
2022-03-04 15:34:54 +00:00
Nick Mathewson e15c47f762 Reproducible build: Bump to Rust 1.59 and Alpine 3.15
The Rust upgrade is necessary since our Cargo.lock file now requires
`ed25519` 1.4.0, which requires edition2021, which requires Rust
1.56 or later.

The Alpine upgrade is opportunistic: we might as well.

I've also added comments to remind us to keep the .gitlab-ci.yml
and docker_reproducible_build files in sync, since my first version
of this commit messed that up.

Closes #376.
2022-03-04 10:09:31 -05:00
Nick Mathewson c23dad8c2d Use RsaIdentity::from_hex() and hex::decode_to_slice in more places
These aren't critical-path, but they do make the code a little nicer.
2022-03-04 09:23:26 -05:00
Nick Mathewson caf372ac0f tor-netdoc: Use RsaIdentity::from_hex() in critical path.
This commit changes the main parsing code for RsaIdentity in
tor-netdoc, and .

Previously, parse_hex_ident was something like 10% of our startup
CPU time; now it's only like ~2%.  (Still not perfect, but way
better.)

Closes #377.
2022-03-04 09:05:04 -05:00
Nick Mathewson b6452b4812 Add a from_hex method for RsaIdentity.
We perform this operation in a bunch of places, and most of them
use hex::decode().  That's not great, since hex::decode() has to do
heap allocation.  This implementation uses hex::decode_to_slice(),
which should be faster.

(In the future we might choose to use one of the faster hex
implementations, but I'm hoping that this change will be sufficient
to get hex decoding out of our profiles.)

Part of #377.
2022-03-04 08:55:34 -05:00
Ian Jackson 6e1da0145b Remove now-obsolete note about location of skip_fmt
Now the diff from the merge base does not contain any hits for ^\+.*bytes
2022-03-04 11:45:24 +00:00
Ian Jackson ebfd734956 Move skip_fmt into tor-basic-utils
Code motion and the minimal mechanical changes.

As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/375#note_2783078
2022-03-04 11:45:24 +00:00
Ian Jackson aba68088d1 Introduce tor-basic-utils
Empty crate right now
2022-03-04 11:45:24 +00:00
Ian Jackson eb66d0af6f Merge branch 'derive-traits' into 'main'
Tidy up many open-coded trait impls

See merge request tpo/core/arti!374
2022-03-04 11:25:57 +00:00
Ian Jackson 64cc5b8537 Move educe to dev-dependencies of tor-bytes
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/375#note_2783080

This is going to move to a new crate, but doing this now makes
things slightly clearer for me.
2022-03-04 11:03:04 +00:00
eta e9f8ddfb9c Fix introduced junk in doc comment. 2022-03-04 10:56:40 +00:00
Ian Jackson 2a7915e6f6 Merge branch 'return_ref_arc' into 'main'
arti-client: Make dirmgr() and circmgr() return &Arc<..>

Closes #369

See merge request tpo/core/arti!379
2022-03-04 10:55:21 +00:00
Nick Mathewson a4914b990b arti-client: Make dirmgr() and circmgr() return &Arc<..>
Previously they returned an Arc, which wasn't necessary unless the
client actually _wanted_ a new Arc.

This would be an API break, except that these functions are marked
'experimental-api', so semver does not apply; nonetheless I've noted
the break in semver_status.md, just in case we care.

Closes #369
2022-03-03 14:08:27 -05:00
Nick Mathewson 06f0339b97 Allow println in arti-testing. 2022-03-03 14:01:44 -05:00
Nick Mathewson 9329c7b878 arti-testing: Initial implementation
This commit adds a new program to try to implement the ideas behind
experimentation in arti#329.  In particular, it tries to implement
basic client "can I bootstrap and connect" functionality testing,
with a lot of instrumentation, and support for breaking things.

So far, the instrumentation is limited to counting TCP bytes and
connections, and counting events.  Still, this is enough to measure
behavior on some of the incorrect-clock tests.

NOTE:

For now, you are _required_ to pass in an explicit configuration, in
hopes that this will lead you to override your storage directories
for doing specific experiments.
2022-03-03 13:05:30 -05:00
eta 64c8ee0d1f Merge branch 'shellexpand' into 'main'
Switch to shellexpand-fork version of shellexpand

See merge request tpo/core/arti!373
2022-03-03 14:31:52 +00:00
Ian Jackson b27ffe14fb Merge branch 'dir-provider-redux' into 'main'
Alternative DirProvider setup

See merge request tpo/core/arti!347
2022-03-02 18:41:50 +00:00
Ian Jackson daa44df221 Replace manual Default impls with educe in tor-guardmgr 2022-03-02 18:06:37 +00:00
Ian Jackson 738f7efa3d Replace manual Default impl with educe in tor-dirmgr 2022-03-02 18:06:37 +00:00
Ian Jackson 4fbb088907 Replace manual Default impl with educe+std in tor-dirmgr 2022-03-02 18:06:37 +00:00
Ian Jackson bb1d59e073 Replace manual Default impl with educe in tor-cell 2022-03-02 18:06:37 +00:00
Ian Jackson ac0ed6ab65 Replace manual Default impls on enums with educe in arti-client 2022-03-02 18:06:37 +00:00
Ian Jackson 2a782a71c0 Refrain from replacing manual with educe Debug impl in caret
Instead, leave a comment saying we have left it this way deliberately.
2022-03-02 18:06:37 +00:00
Ian Jackson 1b8a8f933a Replace manual Debug impl with educe in arti-client 2022-03-02 18:06:37 +00:00