Commit Graph

3078 Commits

Author SHA1 Message Date
Ian Jackson 962b6c32e1 fallback list: Introduce and use FallbackListBuilder
Now the network fallbacks configuration wants to Deserialize
a Vec<FallbackDirBuilder>, rather than validated Vec<FallbackDir>.

Methods on FallbackListBuilder are as per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/462#note_2797697
mutatis mutandi for the fact that this struct has only fallbacks in it.
2022-04-22 17:48:03 +01:00
Ian Jackson 61425a96bd fallback list: Move default list into tor-guardmgr
This is where the FallbackList type is.  We are going to want to
provide a builder too, which ought to impl Default.

This means that the default value for the type must be next to the
type.  In any case, it was anomalous that it wasn't.

This commit is pure code motion.
2022-04-22 17:39:58 +01:00
Ian Jackson 91a8bc0c11 impl From<SubfieldBuildError> for ConfigBuildError
We are going to be using sub-field builders.
2022-04-22 16:46:32 +01:00
Ian Jackson 6da7a2e3e2 Use git source for derive_builder for now, for sub_builder feature
This commitid is the current head of my MR branch
  https://github.com/colin-kiegel/rust-derive-builder/pull/253
  https://github.com/ijackson/rust-derive-builder/tree/field-builder
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.

We will need the new version of not only `derive_builder_core` (the
main macro implementation) but also`derive_builder` for a new error
type.
2022-04-21 14:07:28 +01:00
eta 225accd67e Merge branch 'typos' into 'main'
Fix typos

See merge request tpo/core/arti!461
2022-04-20 15:37:33 +00:00
Samanta Navarro ee78bd7f84 Use https instead of http
Keep http in license text.
2022-04-20 11:48:55 +00:00
Samanta Navarro d3031b437b Fix wording in FAQ 2022-04-20 11:48:45 +00:00
Samanta Navarro 142e57b03a Fix typos
Typos found with codespell.
2022-04-20 11:48:43 +00:00
Nick Mathewson ac8d444aa3 Merge branch 'ticket_282' into 'main'
Remove obsolete files from our state directory.

Closes #282

See merge request tpo/core/arti!457
2022-04-14 12:18:30 +00:00
Nick Mathewson 2847a57a1e Fix build with Rust 1.53; we can't use map_while 2022-04-14 07:32:05 -04:00
Ian Jackson b1d375c785 tor-persist::fs::clean: Log warnings for directory read failures 2022-04-14 10:14:03 +01:00
Nick Mathewson 93cd0bc383 tor-persist::fs::clean: Tweaks based on review.
Rename "deletable" to "obsolete".

Simplify function structure.

Report errors from `metadata()` and `modified()`.

Don't claim that we're going to delete something unless we are.

Comment about making CUTOFF configurable.
2022-04-13 19:44:52 -04:00
eta 41dd682552 Merge branch 'report-skew' into 'main'
Report skew estimates from arti-client

See merge request tpo/core/arti!455
2022-04-13 12:51:23 +00:00
Nick Mathewson 64699a2b99 Remove obsolete files from our state directory.
This patch removes files created by older versions of arti, if they
are at least 4 weeks old.

Closes #282
2022-04-12 17:15:05 -04:00
Nick Mathewson 526b00c9b2 Re-indent tor-persist/Cargo.toml. 2022-04-12 13:39:32 -04:00
eta 9689468a3a Merge branch 'typo' into 'main'
Fix typos

See merge request tpo/core/arti!453
2022-04-12 17:34:10 +00:00
eta bd28cd5bb7 Merge branch 'backoff_on_preemptive_circs' into 'main'
circmgr: back off on preemptive circuits if they fail consistently

Closes #437

See merge request tpo/core/arti!456
2022-04-12 17:33:45 +00:00
Nick Mathewson 4582dddca8 circmgr: back off on preemptive circuits if they fail consistently
Rather than running preemptive circuit construction every 10
seconds, we change it to back off when it is "failing".  (We define
"failing" as creating no new circuits, and as giving at least one
error.)

This change means that we'll have one less reason to hammer the
network when our connectivity is failed for some reason.

Closes #437.
Part of #329.
2022-04-12 09:19:10 -04:00
Nick Mathewson 482c022e23 circmgr: Remove now-unused scheduled entry points.
Now that we have TaskSchedule, we don't need to expose these any
longer.
2022-04-12 09:04:10 -04:00
Nick Mathewson 3d5276a9cc circmgr: Report CircProvenance from AbstractCircMgr.
This feature is similar to ChanProvenance from ChanMgr, except that
we don't yet need to report it outside the crate.  I'm going to use
it to distinguish newly created circuits from existing circuits in
the preemptive circuit builder.
2022-04-12 08:41:32 -04:00
Nick Mathewson 11a9091602 arti-client: Report clock skew when it is noteworthy
(Also, blame clock skew when it is an explanation of why we cannot
finish a connection.)
2022-04-12 08:03:49 -04:00
Nick Mathewson 5f946b8d45 chanmgr: expose whether we are failing because of expired certs. 2022-04-12 08:03:49 -04:00
Nick Mathewson 72f00daf12 circmgr: re-export clock skew estimates. 2022-04-12 08:03:49 -04:00
Nick Mathewson 5f5cbdc08e GuardMgr: publish skew estimates.
Instead of just having a function that recalculates the latest clock
skew, instead recalculate the clock skew when it may have changed,
and notify other processes via a postage::watch.
2022-04-12 08:03:49 -04:00
eta 5c1e7db01e Merge branch 'guardmgr_test_fix' into 'main'
guardmgr: fix a unit test panic.

See merge request tpo/core/arti!454
2022-04-11 18:40:14 +00:00
Dimitris Apostolou ea283584f5
Fix typos 2022-04-11 21:21:17 +03:00
Nick Mathewson 61080dcaec guardmgr: fix a unit test panic.
Apparently on OSX you are not allowed to construct an Instant that is a
long time before the time when the test is running.

Also, fix the length of a year in this test.
2022-04-11 14:13:17 -04:00
Nick Mathewson 9f7a80b5f2 Merge branch 'record-skew-v3' into 'main'
Collect and analyze clock skew information

See merge request tpo/core/arti!450
2022-04-11 17:27:14 +00:00
Nick Mathewson 4efe45ce6e handshake.rs: Document the time for clock skew authentication. 2022-04-11 12:34:16 -04:00
Nick Mathewson c909926302 Fold FallbackStatus into Entry.
This simplifies the code a lot.
2022-04-11 12:34:16 -04:00
Nick Mathewson 452e1c0935 Add a couple of TODO items to clock-skew estimator. 2022-04-11 12:34:16 -04:00
Nick Mathewson cf362fac9f Implement a better clock skew estimator.
This time, our estimator discards outliers, takes the mean of what's
left, and uses the standard deviation to try to figure out how
seriously to take our report of skew/not-skew.

These estimates are still not actually used.
2022-04-11 12:34:16 -04:00
Nick Mathewson adb94f8047 Merge branch 'cargo-audit' into 'main'
fix maint/cargo_audit not propagating error and add temporary exceptions

See merge request tpo/core/arti!452
2022-04-08 15:55:05 +00:00
Nick Mathewson 0fb3728145 Merge branch 'stable-coverage' into 'main'
use rustc 1.60 for coverage

See merge request tpo/core/arti!451
2022-04-08 15:17:44 +00:00
trinity-1686a 777eb8a5fc fix maint/cargo_audit not propagating error and add temporary exceptions 2022-04-08 16:51:35 +02:00
trinity-1686a 7c4ad15fc3 use default toolchain from rustup instead of stable for coverage
using stable doesn't work for CI because a specific version like 1.60 is installed
2022-04-08 16:19:28 +02:00
trinity-1686a 98ed22ba55 bring back RUST_COVERAGE_TOOLCHAIN 2022-04-08 15:46:46 +02:00
trinity-1686a c113c607ac use rustc 1.60 (stable) for coverage 2022-04-07 23:04:10 +02:00
Nick Mathewson eedee51899 Initial functions to determine and expose a clock skew estimate.
(This is just a placeholder; I'm going to make the functions
smarter in the next commit.)
2022-04-07 16:01:46 -04:00
Nick Mathewson ae92f626fb Reformat tor-guardmgr/Cargo.toml 2022-04-07 12:11:09 -04:00
Nick Mathewson 99146da2c2 GuardMgr: record clock skew information.
(It is not yet actually used.)
2022-04-07 11:33:34 -04:00
Nick Mathewson c3c43b088e Create and use API to report guard/fallback skew.
(The information is not yet recorded.)
2022-04-07 10:47:45 -04:00
Nick Mathewson 0050045867 ChanMgr: Return provenance information from get_or_launch
We need this since we want to report certain conditions only when
they happen on a new channel, not if we observe them on a
preexisting channel.
2022-04-07 10:46:06 -04:00
Nick Mathewson 9160b55c57 chanmgr: bubble ClockSkew up through the Error object.
Fortunately, we don't need a separate type here: authenticated
clock skew can only come attached to a `tor_proto::Error`.

We also remove skew from `tor_proto::Error::HandshakeCertsExpired`,
since it would now be redundant.
2022-04-07 10:15:28 -04:00
Nick Mathewson 7656ab0931 Channel: Expose our view of whether the clock is skewed, and the age
of a channel.

At first I wanted to have this information not be a part of channels
at all, but it is a fairly tiny amount of data, and the alternatives
are pretty crufty.
2022-04-07 10:07:35 -04:00
Nick Mathewson d81de1580b Merge branch 'downgrade_rlimit' into 'main'
Downgrade `rlimit` to 0.7.

See merge request tpo/core/arti!449
2022-04-06 15:16:01 +00:00
Nick Mathewson 4acba0df9b Downgrade `rlimit` to 0.7.
Upstream 0.8.2 has broken compilation with Rust 1.53; versions
0.8.{0,1} have been yanked.

Possibly by the time the next arti version comes out, they'll have
fixed this situation, or we'll have upgraded our MSRV.

Upstream issue at https://github.com/Nugine/rlimit/issues/42 .
2022-04-06 10:21:33 -04:00
Nick Mathewson 142e28cd96 Merge branch 'main' into 'separate_dir_status'
# Conflicts:
#   doc/semver_status.md
2022-04-06 13:33:01 +00:00
eta 1cc7e48cff Merge branch 'untimely_dir_is_failed' into 'main'
Treat expired/not-yet-valid directory objects as Errors.

Closes #431

See merge request tpo/core/arti!448
2022-04-06 12:54:28 +00:00
Nick Mathewson d05022dea4 Treat expired/not-yet-valid directory objects as Errors.
Doing this will make us treat caches that send us these objects as
not-working, and close circuits to them instead of trying over and
over.

The case where we add a document from the cache requires special
handling: it isn't actually a error to find an expired document in
our cache (unless the passage of time itself is erroneous, which is
a debatable proposition at best).

Fixes #431.
2022-04-05 15:54:37 -04:00