Commit Graph

3008 Commits

Author SHA1 Message Date
Ian Jackson 32fe5cdd5b arti: Make main module entrypoints pub
This does not constitute any kind of stable API promise.
But it might allow people to use our arti client code in novel ways.
2022-03-11 18:28:15 +00:00
Ian Jackson 4ae5f11c20 arti: Provide some rubric docs. 2022-03-11 18:28:15 +00:00
Ian Jackson e680960619 arti: Move all code from binary crate to library crate
This is just code motion and the minimal fixups.
2022-03-11 18:28:15 +00:00
Ian Jackson 9a7783a230 Remove a pointless slice
std::slice::from_ref exists.  Spotted while reviewing !400
2022-03-11 18:24:03 +00:00
Ian Jackson d320413912 Merge branch 'config-flatten' into 'main'
Make ArtiConfigBuilder contain a TorClientConfigBuilder

See merge request tpo/core/arti!401
2022-03-11 18:22:23 +00:00
Ian Jackson 3fa42f63d0 config work: Add semver note. 2022-03-11 17:34:15 +00:00
Nick Mathewson 6e5027f4be Merge branch 'mr318_followup' into 'main'
Follow-up from arti!318

See merge request tpo/core/arti!402
2022-03-11 17:28:37 +00:00
Ian Jackson f914eee6bc rustfmt 2022-03-11 16:41:59 +00:00
Nick Mathewson 837c7d717b Follow-up from arti!318
Make update_config only conditionally exported; add semver-status update.
2022-03-11 11:34:51 -05:00
Nick Mathewson d95dce7c70 Merge branch 'add-flatfile-dirmgr' into 'main'
Add flatfile DirMgr

See merge request tpo/core/arti!318
2022-03-11 16:34:26 +00:00
Ian Jackson 1d281abaf8 Make ArtiConfigBuilder contain a TorClientConfigBuilder
This is an API break: now one must use `.tor()` to access the Tor
configuration parts.

But it is not a config file format break, because `#[serde(flatten)]`.
2022-03-11 16:18:27 +00:00
Ian Jackson 0bbee1e477 Make TorClientConfigBuilder Deserialize
As per #371
2022-03-11 16:18:22 +00:00
Nick Mathewson 33514b11d6 Merge branch 'chutney-without-proxy' into 'main'
tests/chutney: Merge chutney-launching scripts

See merge request tpo/core/arti!396
2022-03-11 14:34:34 +00:00
Ian Jackson b7678582cd tests/chutney/setup: Transfer changes from just-deleted code
It turns out that the clone-and-hack in tests/chutney/arti-bench
was not identical to the original in tests/chutney/setup.

I diffed the two and preferred the version from arti-bench.
2022-03-11 14:08:02 +00:00
Christian Grigis 65486b185a
Expose APIs for external DirProvider 2022-03-11 13:44:48 +01:00
Nick Mathewson dcd74e7a64 tests/chutney: Merge chutney-launching scripts
Formerly, the "launch a chutney network" code was duplicated in
"setup" and "arti-bench", since "setup" always launched an arti
proxy, while "arti-bench" didn't want that functionality.

Now the "setup" script launches an arti proxy conditionally,
depending on whether the "proxy" argument is given.
2022-03-10 12:29:28 -05:00
Nick Mathewson d9c1555229 dirmgr: Call shrink_to_fit on missing-microdesc hashtable
This hashtable starts out pretty large, but it can spend most of our
runtime (when we aren't downloading) being small.  To avoid doing
too much work, I've made it so we only call shrink_to_fit twice per
consensus: once when we're no longer pending, and once when we're
complete.

Closes #388.
2022-03-10 11:48:58 -05:00
Ian Jackson 6761cf2b69 Merge branch 'config-no-retcon' into 'main'
Drop config back-conversion from FooConfig to FooConfigBuilder

See merge request tpo/core/arti!391
2022-03-10 14:47:01 +00:00
Nick Mathewson 98c5c5b824 Merge branch 'arti-testing-part2' into 'main'
arti-testing: support for simulated TCP breakage

See merge request tpo/core/arti!392
2022-03-10 14:08:44 +00:00
Nick Mathewson d1b151436e arti-testing: Make Action implement Copy 2022-03-10 08:45:56 -05:00
Christian Grigis 335af4ac30
Add methods to `UnverifiedConsensus` 2022-03-10 11:29:58 +01:00
eta 4f34f7cea8 Merge branch 'ticket_391' into 'main'
arti-bench: don't allocate a separate receive-buffer for each job

Closes #391

See merge request tpo/core/arti!395
2022-03-09 13:26:44 +00:00
Ian Jackson 3425a6cbcd Merge branch 'ticket_383' into 'main'
tor-chanmgr: Do not allocate an Internal error unless we mean it.

Closes #383

See merge request tpo/core/arti!394
2022-03-09 11:30:08 +00:00
Nick Mathewson 26bdbc4b61 arti-bench: don't allocate a separate receive-buffer for each job
This makes heap profiling more viable.

Closes #391.
2022-03-08 16:41:06 -05:00
Nick Mathewson a110755193 tor-chanmgr: Do not allocate an Internal error unless we mean it.
Previously we'd allocate an error as a place-holder here, but it's
not a great idea to do that with a `Bug`: each `Bug` stores a whole
stack trace, which uses a whole pile of allocations to construct.

Now we keep an `Option<Error>` instead.

Found while heap profiling.

Closes #383.
2022-03-08 14:04:25 -05:00
Nick Mathewson afa99cb1c8 Merge branch 'update-contrib-dependencies' into 'main'
Note the dependency on PCRE support in Git implied by the use of grep -P in the git hooks

See merge request tpo/core/arti!393
2022-03-08 14:57:51 +00:00
Steven Murdoch d75b46c3e3 Note the dependency on PCRE support in Git implied by the use of grep -P in the git hooks 2022-03-08 13:27:31 +00:00
Nick Mathewson a460de6e75 arti-testing: reverse two more attrs in attempt to fix min-versions 2022-03-07 15:29:44 -05:00
Nick Mathewson 84536a9c1e arti-testing: reverse two attrs in attempt to fix min-versions 2022-03-07 14:34:02 -05:00
Ian Jackson 9ee78ea4e0 Merge branch 'contributing-dependencies' into 'main'
Add missing dependencies to CONTRIBUTING.md

See merge request tpo/core/arti!389
2022-03-07 17:39:05 +00:00
Nick Mathewson de0cf90a32 arti-testing: todo comment cleanup 2022-03-07 11:47:25 -05:00
Nick Mathewson a86f00c222 arti-testing: support for conditional TCP failure. 2022-03-07 11:44:43 -05:00
Ian Jackson 56c2153b9e Merge branch 'fix-expand-tilde-on-windows' into 'main'
Fix expand tilde and invalid path chars on windows

See merge request tpo/core/arti!274
2022-03-07 16:35:15 +00:00
Nick Mathewson 3aed633559 arti-testing: add support for black-holing TCP connections. 2022-03-07 11:26:13 -05:00
Ian Jackson 801d5c8d00 Merge branch 'add-windows-instructions' into 'main'
Add instructions for hooking up Tor Browser to arti on Windows

See merge request tpo/core/arti!388
2022-03-07 16:16:50 +00:00
Ian Jackson 1b1ce8cc82 Drop remaining conversion from FooConfig to FooConfigBuilder 2022-03-07 15:58:53 +00:00
Ian Jackson 56cb1cef4e Have ArtiConfig contain a TorClientConfig, and drop builder retcon
Replace the recapitulation of TorClientConfig fields in ArtiConfig and
instead just have it contain one.  This is part of #374.

The conversions from ArtiConfig back to ArtiConfigBuilder and
TorClientConfigBuilder would need to change, but, since we don't want
them anyway,

No longer impl Deserialize for ArtiConfig.  (As per #371 this will
want to become a private type.)

No longer impl From<ArtiConfig> for ArtiConfigBuilder and
TorClientConfigBuilder.  And abolish tests of that code.

(This all has to be in one commit, because previously
ArtiConfig::tor_client_config used the validated-to-builder config
retcon.)
2022-03-07 15:58:53 +00:00
Ian Jackson 92d1855b0e Provide way to get TorConfigBuilder from ArtiConfigBuilder
This is needed according to #372, where we observe that builders ought
not to be generated from validated structs.  So we need this
conversion.
2022-03-07 15:58:53 +00:00
Ian Jackson 56bd15b671 Derive Deserialize for handwritten ArtiConfigBuilder 2022-03-07 15:58:53 +00:00
Ian Jackson 5203311a97 Derive Deserialize for derive-builder-generated config builders
I used
  git-grep -P '\#\[serde\((?!default|deny_unknown)'
to find places where I needed to add additional attributes on the
builder method fields.

This is currently a bit duplicative, but when #371 is completely done,
the validated (non-builder) configs won't need to be Deserialize any
more.

This is part of #371 and #372.
2022-03-07 15:58:53 +00:00
Ian Jackson 416b56d852 Use git source for derive_builder for now, for attrs feature
We are going to want to specify custom attributes on fields of the
builder struct.  This feature was missing from derive_builder.

This commitid is the current head of my MR branch
  https://github.com/colin-kiegel/rust-derive-builder/pull/237
  https://github.com/ijackson/rust-derive-builder/tree/builder-field-attrs
Using the commitid prevents surprises if that branch is updated.

We will require this newer version of derive_builder.  The version
will need to be bumped again later, assuming the upstream MR is merged
and upstream do a release containing the needed changes.
2022-03-07 15:56:57 +00:00
Nick Mathewson 5d91fa7f5a arti-testing: CLI for making TCP connections break. 2022-03-07 10:52:04 -05:00
eta c27dde59b6 Merge branch 'moderately-enthused-eyeballs' into 'main'
Implement a basic form of RFC 8305 ("happy eyeballs") for channels

See merge request tpo/core/arti!382
2022-03-07 15:26:37 +00:00
Nick Mathewson ca6070b962 arti-testing: Initial support for broken TCP.
This commit adds support for a BrokenTcp provider that can make
connection attempts fail or time out.  It doesn't yet have a way to
turn on the failure.
2022-03-07 10:12:48 -05:00
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