Commit Graph

2966 Commits

Author SHA1 Message Date
trinity-1686a b3b27c9bd3 add a join() on Isolation 2022-03-16 19:23:21 +01:00
Trinity Pointard a1b8b4999f testing new api for isolation 2022-03-16 19:23:21 +01:00
Ian Jackson fb4111f524 Merge branch 'derive-builder' into 'main'
derive_builder: Switch to upstream 0.11

See merge request tpo/core/arti!414
2022-03-16 17:54:53 +00:00
Ian Jackson da787d074a derive_builder: Switch to upstream 0.11
This has the different syntax for builder field attributes than what I
originally proposed in my MR, and which therefore is in the pinned
branch.

My upstream MR for the field attributes feature was morged:
  https://github.com/colin-kiegel/rust-derive-builder/issues/239
2022-03-16 16:34:44 +00:00
Ian Jackson 8a5d98f716 downgrade_dependencies: Upgrade darling
The new version of derive_builder requires a newer darling.
Ooops.  Upstream MR here:
  https://github.com/colin-kiegel/rust-derive-builder/pull/242

For now, upgrade darling.  When there's a new upstream derive_builder,
we can use it and drop this.
2022-03-16 16:34:44 +00:00
Nick Mathewson c3e74973b4 netdir: Use an even smaller rep for list of microdescs
Every time we want a microdescriptor, we know the index of that
microdesc's corresponding routerstatus within the consensus.
Therefore, we can use that index to store `Arc<Microdesc>`s in a
dense array, and not have to use a HashSet here at all.
2022-03-16 11:52:47 -04:00
Ian Jackson 644f962cfd Merge branch 'move-retry-delay' into 'main'
Move RetryDelay into tor-basic-utils

See merge request tpo/core/arti!411
2022-03-16 15:37:44 +00:00
Nick Mathewson 76df9e4014 tor-dirmgr: Remove redundant hashtable.
We were using a hashtable to keep track of missing microdescriptor
digests.  But this information is redundant with the NetDir state,
and there's now no longer any performance benefit to keeping a
separate copy.

Part of #386.
2022-03-16 11:33:19 -04:00
Nick Mathewson 3e12cf2688 Merge branch 'clippy' into 'main'
Replace a match with some as_ref and as

See merge request tpo/core/arti!413
2022-03-16 15:16:42 +00:00
Nick Mathewson 233613cd79 NetDir: Use less space in hash tables
We previously kept missing-MD entries and present-MD entries all in
the same HashSet, which resulted in using more slack space than we
need.  Now we use separate tables, so we can drop missing-MD
entries as we move forward.

Also, when constructing a NetDir, set its hash tables to their final
capacities.

This also lets us simplify some of our missing-md-listing code a
lot.
2022-03-16 11:12:15 -04:00
Nick Mathewson 09f750c2c8 RetryDelay: remove accessors.
Instead, check initial_delay in dirmgr directly.
2022-03-16 10:50:13 -04:00
Ian Jackson 7564fabd68 Replace a match with some as_ref and as
The match was doing a deref coercion.

Found by current nightly's needless_match (whose suggestion doesn't
compile, https://github.com/rust-lang/rust-clippy/issues/8551 )
2022-03-16 14:41:04 +00:00
Nick Mathewson 4ccc3af423 dirmgr: Always send if-modified-since on consensus documents.
We never want a consensus document that's super-old, since we would
reject it immediately for being too old.

Also, never send an if-modified-since that's so old that we'd reject
the response.

Closes #403
2022-03-16 09:48:37 -04:00
Nick Mathewson 11883b9e8d Remove re-export of retry-schedule in tor-dirmgr.
It wasn't necessary.
2022-03-16 08:47:02 -04:00
Nick Mathewson 90c48dc1b0 Fix up documentation on RetryDelay.
It's no longer about downloads; it's about whatever you need to
retry.
2022-03-16 08:42:46 -04:00
Nick Mathewson 67645473d5 Move RetryDelay from dirmgr to basic-utils.
This (almost) a pure code-movement commit: it also makes one public
function private in order to suppress a warning.
2022-03-16 08:31:54 -04:00
Nick Mathewson ef619ba70a RetryDelay: add accessors for state
We'll need these for our unit tests in tor-dirmgr once we move
RetryDelay into tor-basic-utils.
2022-03-16 08:26:14 -04:00
Nick Mathewson e8c63fe3e8 tor-basic-utils/Cargo.toml: reformat.
This is a separate commit to avoid putting format changes in the
next commit.
2022-03-16 08:21:44 -04:00
Ian Jackson 9593cf637a Merge branch 'testing_dns_port' into 'main'
Use port 35353 for testing, not 5353.

See merge request tpo/core/arti!408
2022-03-16 10:32:04 +00:00
Nick Mathewson 00212ed025 Merge branch 'dns' into 'main'
fix rust-nightly CI job

See merge request tpo/core/arti!409
2022-03-15 14:12:52 +00:00
trinity-1686a 60431ade4f make run_dns_resolver public and fix typo 2022-03-15 14:11:42 +01:00
Nick Mathewson c16c4c3845 Use port 35353 for testing, not 5353.
Apparently 5353 is commonly used for mDNS, and so counts as "already in
use" on many consumer machines.
2022-03-15 08:26:45 -04:00
Nick Mathewson 841f813a7c Merge branch 'dns' into 'main'
Add DNS resolver support to arti

See merge request tpo/core/arti!390
2022-03-14 23:56:55 +00:00
trinity-1686a 3a6eac1367 comment AAAA test and explain why it's disabled 2022-03-14 21:19:20 +01:00
trinity-1686a f4581ffd04 add simple unit test on UDP 2022-03-14 21:19:20 +01:00
trinity-1686a b7daa9ff12 add integration test and fill semver_status 2022-03-14 21:19:19 +01:00
trinity-1686a fa29925689 fix typos and minor issues 2022-03-14 21:16:56 +01:00
trinity-1686a 604362bf80 actually add DNS support 2022-03-14 21:04:38 +01:00
trinity-1686a 9b3be0ad47 add skeleton for DNS handling 2022-03-14 20:59:35 +01:00
trinity-1686a 4a44ef56c0 add udp to runtime 2022-03-14 20:59:33 +01:00
Nick Mathewson f23fca5e93 Merge branch 'testing-docs' into 'main'
New documents to checkpoint my work on #329 and #87

See merge request tpo/core/arti!407
2022-03-14 17:27:42 +00:00
eta 331da62712 Apply 1 suggestion(s) to 1 file(s) 2022-03-14 17:11:49 +00:00
Nick Mathewson 6f9094e2d6 Merge branch 'intern-more' into 'main'
tor-netdoc: use InternCache to save memory for families and protover lists

Closes #384 and #385

See merge request tpo/core/arti!398
2022-03-14 15:03:39 +00:00
Nick Mathewson 8f430fd58d Merge branch 'main' into 'intern-more'
# Conflicts:
#   doc/semver_status.md
2022-03-14 14:19:44 +00:00
Nick Mathewson 34c209c20e New documents to checkpoint my work on #329 and #87
These documents explain how to profile arti for CPU and memory, and
how to simulate different kinds of breakage and misconfiguration.

They aren't at all in their final form, but I figure it's useful to
check them in so that more people can look at them, and make
suggestions.
2022-03-14 10:14:34 -04:00
eta c0baf86e52 Merge branch 'missing_shrink_to_fit' into 'main'
dirmgr: Call shrink_to_fit on missing-microdesc hashtable

Closes #388

See merge request tpo/core/arti!399
2022-03-14 13:20:57 +00:00
eta 258e42ad3e Merge branch 'slice-from-ref' into 'main'
Simpify tor-netdoc TokVal

See merge request tpo/core/arti!404
2022-03-14 13:14:05 +00:00
eta ff489ffde7 Merge branch 'humantime' into 'main'
Replace humantime_serde_option with upstream code

Closes #396

See merge request tpo/core/arti!406
2022-03-14 13:11:12 +00:00
Ian Jackson dbd7388991 humantime_serde_option: Add note about semver 2022-03-14 10:34:28 +00:00
Ian Jackson 8f5d089f53 Revert "humantime_serde_option: New module in tor-basic-utils"
We have upstreamed this code.

This reverts commit 6193c9d974.
2022-03-14 10:33:59 +00:00
Ian Jackson 409c5dd6d2 Use new upstream humantime_serde_option feature
Replace all uses of our copy of this code.
2022-03-14 10:33:59 +00:00
Ian Jackson 8b8c2a426e humantime: Update to humantime-serde 1.1.1
This has the humantime_serde::option module, which we have upstreamed
and are about to switch to.

The remaining dependency with  version = "1"  is going to be removed
in a moment.
2022-03-14 10:33:59 +00:00
Nick Mathewson a98ae2a1f0 Canonicalize and intern protover lines on descriptors
This should save around 1MB per consensus, since every relay has a
'protocols' lines, but there are only a few distinct possibilities
for such a line.

Closes #385.
2022-03-11 16:56:12 -05:00
Nick Mathewson 16f1bda324 Canonicalize and intern family representations to save memory.
This should save 1-3 MB of ram on each running arti client.

Closes #384. See also tor#27359 and proposal 298.
2022-03-11 16:54:33 -05:00
Ian Jackson 927594c3a6 Merge branch 'arti-lib' into 'main'
arti: Move all code from binary crate to library crate

See merge request tpo/core/arti!403
2022-03-11 19:57:53 +00:00
Nick Mathewson b835a48528 Merge branch 'smaller_routerstatus' into 'main'
tor-netdoc: Save allocation space in GenericRouterstatus

Closes #387

See merge request tpo/core/arti!400
2022-03-11 19:55:22 +00:00
Nick Mathewson 718a1ee340 Add a more generic implementation of intern-by-ref 2022-03-11 14:03:29 -05:00
Nick Mathewson b40e06c64a Add a missing newline. 2022-03-11 14:03:29 -05:00
Nick Mathewson 6f42c79654 netdoc: Call shrink_to_fit() when we're done parsing rs sections
(Once we're done parsing these, the vector will never get any
longer.)
2022-03-11 14:03:29 -05:00
Nick Mathewson 1c6c05fac3 netdoc: allocate no extra space for RouterStatus addresses.
This should save around 181K of heap on a current directory.
2022-03-11 14:03:29 -05:00