Commit Graph

221 Commits

Author SHA1 Message Date
Ian Jackson 31ce7f4bc0 semver note about serde attribute changes 2022-05-05 10:35:52 +01:00
Ian Jackson a334f17262 Merge branch 'socket-addr-list-builder' into 'main'
FallbackDir: orports: Introduce and use VecBuilder

See merge request tpo/core/arti!474
2022-05-04 18:13:45 +00:00
Ian Jackson 4ad4cae418 FallbackDir: Use VecBuilder for orports
And drop the ad-hoc orport() method.  This brings FallbackDir's
orports field in line with our list builder API.

The general semver note in "configuation" seems to cover most of this.
2022-05-04 17:18:55 +01:00
Ian Jackson 4262a440b5 list_builder: Update semver note 2022-05-04 17:18:55 +01:00
Ian Jackson c84d60910d GuardUsage: restrictions Add semver note 2022-05-04 16:19:09 +01:00
Samanta Navarro 1d62d92fb9 Fix spacing 2022-04-27 13:52:43 +01:00
Samanta Navarro c53818d496 Fix grammar and typos 2022-04-27 13:52:13 +01:00
eta 8509dbc920 Merge branch 'upgrade_dependencies' into 'main'
Upgrade various dependencies, now that we are MSRV 1.56

Closes #313 and #334

See merge request tpo/core/arti!476
2022-04-27 12:27:28 +00:00
Nick Mathewson 5484bcc21f Merge branch 'download-schedule' into 'main'
DownloadSchedule: Introduce Builder

See merge request tpo/core/arti!473
2022-04-26 18:47:08 +00:00
Nick Mathewson aaab6f3812 Upgrade to AES 0.8
Now that we require Rust 1.56, we can upgrade to AES 0.8.  This
forces us to have some slight API changes.

We require cipher 0.4.1, not cipher 0.4.0, since 0.4.0 has
compatibility issues with Rust 1.56.
2022-04-26 12:16:22 -04:00
Ian Jackson 20d61dd4d4 DirMgrConfig: Rename two fields that contained a _config
This entire struct is config.  This is otiose.
2022-04-26 15:29:33 +01:00
Ian Jackson d2cc0aa50a Document breaking changes to DownloadSchedule etc. 2022-04-26 15:19:52 +01:00
Nick Mathewson c1ea419477 Merge branch 'main' into 'msrv_1_56'
# Conflicts:
#   crates/tor-config/Cargo.toml
#   crates/tor-dirmgr/src/state.rs
#   doc/semver_status.md
2022-04-26 12:45:16 +00:00
Nick Mathewson d1fcd3eeae Update semver_status to note that all crates have had a breaking change. 2022-04-25 13:31:06 -04:00
Ian Jackson 3f44078227 Add semver note about added macros in tor-condfig 2022-04-25 18:19:03 +01:00
Ian Jackson f6506721ab Add semver notes for AuthorityListBuilder, PredictedPortsListBuilder
These were omitted in the earlier commits.
2022-04-25 18:15:25 +01:00
Ian Jackson 166af2c3f6 Fix error return type of AuthorityBuilder 2022-04-25 12:41:39 +01:00
Ian Jackson 79decd4ac8 logfiles: Introduce LogfileListConfigBuilder
In
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/462#note_2797697
we decided not to do this.

However, having looked again at the way the FallbackList works, I
think there is a lot of value in making these two things (and anything
else like them[1]) as similar as possible.

[1] At least PreemptiveCircuitConfig.initial_predicted_ports and
NetworkConfig.authorities need the same treatment, and perhaps also
GuardUsage.restrictions (although there is no
GuardRestrictionBuilder).

In the irc discussion I imagined `LogfilesConfigBuilder` as opposed to
`LogfileConfigBuilder` (differing only in the `s`) which would be bad,
but we can use `List` instead.

We do *not* need to abstract away the validated version of the config.
Providing a type alias helps the derive_builder sub_builder DTRT
without needing special overrides.

I have split this commit so that we can drop it, if we conclude it's
not wanted.
2022-04-22 17:48:03 +01:00
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
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 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 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 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 142e28cd96 Merge branch 'main' into 'separate_dir_status'
# Conflicts:
#   doc/semver_status.md
2022-04-06 13:33:01 +00:00
Nick Mathewson 2c51316604 Merge branch 'main' into 'retriable'
# Conflicts:
#   doc/semver_status.md
2022-04-05 14:48:51 +00:00
Nick Mathewson 57608f9609 Add RetrySchedule::reset()
Previously the code would do stuff like

```
    schedule = RetrySchedule::new(INITIAL_DELAY);
```

which is needlessly verbose, since the schedule already keeps track
of its initial delay.
2022-04-04 12:32:18 -04:00
Nick Mathewson 86c59dd1f3 circmgr: Avoid a race condition in circuit usage restriction
We were treating restrict_mut() failures as internal errors, and
using internal errors to represent them.  But in fact, these
failures are entirely possible based on timing.  Here's how it
happens:

* Two different circuit requests arrive at the same time, and both
  notice a pending circuit that they could use.
* The pending circuit completes; both pending requests are notified.
* The first request calls restrict_mut(), and restricts the request
  in such a way that the second couldn't use it.
* The second request calls restrict_mut(), and gets a failure.

Because of this issue, we treat these errors as transient failures
and just wait for another circuit.

Closes #427.

(This is not a breaking API change, since `AbstractSpec` is a
crate-private trait.)
2022-04-04 11:14:52 -04:00
Nick Mathewson 58a1e89c8d rtmock: add the ability to make a connection time out. 2022-04-02 15:48:41 -04:00
Nick Mathewson 3103549cba socksproto: remove some unused accessors. 2022-04-02 12:01:20 -04:00
Nick Mathewson 4a3df6a26f Clean out semver_status.md 2022-04-01 11:18:35 -04:00
Nick Mathewson ea520898fd Implement Ord for Ed25519Identity. 2022-03-30 10:39:09 -04:00
Nick Mathewson b28863f03d Update semver_status from recent round of movement. 2022-03-30 10:39:09 -04:00
Nick Mathewson 80b65c3a4d Move fallback.rs into guardmgr.
This is the logical place for it, I think: the GuardMgr's job is to
pick the first hop for a circuit depending on remembered status for
possible first hops.  Making this change will let us streamline the
code that interacts with these objects.
2022-03-30 10:34:48 -04:00
eta ac64bdea27 Make daemon tasks self-contained; introduce NetDirProvider
The various background daemon tasks that `arti-client` used to spawn are
now handled inside their respective crates instead, with functions
provided to spawn them that return `TaskHandle`s.

This required introducing a new trait, `NetDirProvider`, which steals
some functionality from the `DirProvider` trait to enable `tor-circmgr`
to depend on it (`tor-circmgr` is a dependency of `tor-dirmgr`, so it
can't depend on `DirProvider` directly).

While we're at it, we also make some of the tasks wait for events from
the `NetDirProvider` instead of sleeping, slightly increasing
efficiency.
2022-03-30 14:26:43 +01:00
Nick Mathewson 791394cd2b Merge branch 'netinfo-clock-skew' into 'main'
tor-proto: add the ability to learn clock skew from NETINFO cells

See merge request tpo/core/arti!410
2022-03-23 12:49:36 +00:00
Nick Mathewson 0b2cf533ee tor-proto: better errors when handshake fails due to untimely certs
We now check the handshake certificates unconditionally, and only
report them as _expired_ as a last resort.

(Rationale: if somebody is presenting the wrong identity from a year
ago, it is more interesting that they are presenting the wrong ID
than it is that they are doing so with an expired cert.

We also now report a different error if the certificate is expired,
but its expiration is within the range of reported clock skew.

(Rationale: it's helpful to distinguish this case, so that we can
blame the failure on possible clock skew rather than definitely
attributing it to a misbehaving relay.)

Part of #405.
2022-03-23 08:24:36 -04:00
Nick Mathewson 3885a2c05b tor-proto: add a backend to detect reported clock skew.
NETINFO cells, which are sent in every handshake, may contain
timestamps.  This patch adds an accessor for the timestamp in the
Netinfo messages, and teaches the tor-proto code how to compute the
minimum clock skew in the code.

The computation isn't terribly precise, but it doesn't need to be:
Tor should work fine if your clock is accurate to within a few
hours.

This patch also notes a Y2038 problem in the protocol: see
torspec#80.

Part of #405.
2022-03-23 08:24:36 -04:00
Nick Mathewson acfa0f7770 dirclient: Collect and expose peer information from errors.
This commit refactors the dirclient error type into two cases:
errors when constructing a circuit, and errors that occur once we
already have a one-hop circuit.  The latter can usually be
attributed to the specific cache we're talking to.

This commit also adds a function to expose the information about
which directory gave us the info.
2022-03-21 09:06:32 -04:00
Nick Mathewson d38aafa054 Expose more peer information from circuit build failures
We already have the ability to get peer information from ChanMgr
errors, and therefore from any RetryErrors that contain ChanMgr
errors.

This commit adds optional peer information to tor-proto errors, and
a function to expose whatever peer information is available.
2022-03-21 09:06:32 -04:00
Nick Mathewson d778a92225 circmgr: Change API for using FallbackDirs
It'll soon more convenient to pass in FallbackDirs as a slice of
references, rather than just a slice of FallbackDirs: I'm going to
be changing how we handle these in tor-dirmgr.
2022-03-21 09:06:32 -04:00
Ian Jackson 25dab822f1 Add semver note 2022-03-18 16:49:25 -04:00
Nick Mathewson d39557b851 Define accessors for circuit hops.
Closes #415
2022-03-17 12:36:57 -04:00
Nick Mathewson 2c5d985227 Update semver_status.md for isolation changes 2022-03-17 08:50:30 -04:00
Ian Jackson a5ea3533c5 semver notes. 2022-03-16 19:38:12 +00:00
trinity-1686a b7daa9ff12 add integration test and fill semver_status 2022-03-14 21:19:19 +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 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
Ian Jackson dbd7388991 humantime_serde_option: Add note about semver 2022-03-14 10:34:28 +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
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 b40e06c64a Add a missing newline. 2022-03-11 14:03:29 -05:00
Nick Mathewson e7c584f1b3 netdoc: Make versions smaller in GenericRouterStatus
When the version is a Tor version, we can just parse it; otherwise,
we can intern it.  This shrinks GenericRouterStatus and avoids a lot
of extra help allocations.
2022-03-11 14:03:29 -05:00
Ian Jackson e40bf8dfbf Add note about semver. 2022-03-11 18:28:37 +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 837c7d717b Follow-up from arti!318
Make update_config only conditionally exported; add semver-status update.
2022-03-11 11:34:51 -05: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
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
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
Ian Jackson 4fa78e3f44 arti-hyper: Upgrade from an example to an "adaptation layer" 2022-03-01 11:53:15 +00:00
Nick Mathewson fbd1cf01c4 Add new crates to doc/Architecture.md 2022-02-28 14:24:53 -05:00
Nick Mathewson c3e02fd05b Update FAQs about status and plans. 2022-02-28 14:22:54 -05:00
Ian Jackson 1c301230e4 rename *.py scripts to bare name
Update all references.  There are three remaining hits for
  git-grep '\.py\b'
all of which are scripts in "little-t-tor", not here in arti.
2022-02-18 11:46:06 +00:00
Ian Jackson 9aefbf4227 rename *.sh scripts to bare name
As per #309

Update all references.  There is one remaining hit for
  git-grep '\.sh\b'
namely "build.sh" in maint/reproducible_build, which I think is
the build script for osxcross - ie, an external project.
2022-02-18 11:46:06 +00:00
Dimitris Apostolou 1690e877ed
Fix typos 2022-02-10 14:25:56 +02:00
Ian Jackson 235cd254ca docs/Errors.md: Say where error type is printed 2022-02-04 14:33:09 +00:00
Ian Jackson 06ce4bba1e docs/Errors.md: Say put context in caller's error (not calllee's) 2022-02-04 14:33:09 +00:00
Dimitris Apostolou 6526321851
Fix typos 2022-02-02 20:18:22 +02:00
Nick Mathewson a7df9ca0a5 Tweak release instructions based on 0.0.4 experience 2022-01-31 11:35:40 -05:00
eta ecb63bafa5 doc/Release.md: add note to check feature combinations
This is a nice reminder to have before we solve arti#303 for good.
2022-01-27 15:53:46 +00:00
eta 4aa442de1d Merge branch 'config' into 'main'
doc/CONFIG-NOTES.md: config proposal

See merge request tpo/core/arti!248
2022-01-26 17:00:23 +00:00
eta b893f88c70 Merge branch 'ticket_277' into 'main'
More documentation about refining build process and getting help

Closes #277

See merge request tpo/core/arti!259
2022-01-24 14:15:00 +00:00
eta 87326afe75 Error plan: typos/fixes 2022-01-21 17:00:49 +00:00
Nick Mathewson 33e70eec3d TROUBLESHOOTING.md: More information+links about build process.
Part of #277
2022-01-21 10:59:14 -05:00
Ian Jackson f0f296450a Errors: fold in people's views so is mostly unattributed now 2022-01-20 18:28:06 +00:00
Ian Jackson e762679a06 Errors: sort out markdown formatting 2022-01-20 18:27:52 +00:00
Ian Jackson 446d72329b Errors: c&p raw text of consensus conclusions from pad to git 2022-01-20 18:27:31 +00:00
Ian Jackson 85ed27f621 CONFIG-NOTES: finish a sentence 2022-01-20 17:28:23 +00:00
eta 6ba3686a59 CONFIG-NOTES: Suggestions from MR review 2022-01-20 17:02:35 +00:00
Ian Jackson ebda5a0aca doc/CONFIG-NOTES.md: config proposal 2022-01-19 15:04:20 +00:00
Nick Mathewson 839d2400ed Add a needs-more-testers note to Android and iOS guides. 2022-01-18 13:49:31 -05:00
Trinity Pointard 703682a41c add iOS documentation 2022-01-17 00:42:46 +01:00
Nick Mathewson 0003b706ba Release.md: Small fixes 2022-01-11 09:42:52 -05:00
Nick Mathewson e11871a134 Clear semver_status.md entries for 0.0.2 2022-01-11 09:25:53 -05:00
Nick Mathewson 9c3aa00030 Update semver_status.md with recent changes. 2021-12-08 10:08:14 -05:00
Nick Mathewson e25c2d991e Start a TROUBLESHOOTING.md with known compilation issues. 2021-12-06 09:35:06 -05:00
Nick Mathewson 66d5f73b9c tor-linkspec: Remove redundant method; add more tests.
The redundant method was a `to_owned` that probably shouldn't have
been called that.  It was only used in one place.

The tests should get tor-linkspec's line coverage up above 90%.
2021-12-04 15:42:53 -05:00
Nick Mathewson 214c251e41 Remove the unused "Error" type from caret.
This was a relic of the old, now-unused "caret_enum!" macro.
Removing it gets caret's coverage to 100%.

Yes, technically this is a semver breaker on caret.
2021-12-04 15:13:43 -05:00
Nick Mathewson 47614ee737 Implement Eq,PartialEq for BoundedInt32. 2021-12-02 16:40:22 -05:00
Nick Mathewson c2804419ab Add constructor for TorAddr, to enforce port != 0
This makes sure that we're checking for a nonzero port in all cases.
2021-11-30 15:41:19 -05:00
Nick Mathewson e2a7289aa7 Add comments about the absence of tap_key in microdesc. 2021-11-30 14:05:13 -05:00
Nick Mathewson d4ebda8e2a Note non-breaking API change in tor-proto. 2021-11-30 14:00:00 -05:00
Nick Mathewson bafd56c461 Clear semver_status log now that 0.0.2 is out. 2021-11-30 12:58:29 -05:00
Nick Mathewson 5184f5ba84 Move top-level configuration downwards from `arti` to `arti-config`.
To do this at all neatly, I had to split out `tor-config` from
`arti-config` again, and putting the lower level stuff (paths,
builder errors) into tor-config.  I also changed our use of
derive_builder to always use a common error type, to avoid
error type proliferation.
2021-11-18 11:37:48 -05:00
Nick Mathewson 2439129899 tor-dirclient: Put routerdesc download behind a feature.
Part of #125
2021-11-12 13:38:02 -05:00
Nick Mathewson e9ea7515bc tor-dirmgr: put routerdesc storage behind a feature.
(We keep routerdescs in the schema, since we don't want _that_ to
fragment.)

Part of #125.
2021-11-12 12:15:48 -05:00
Nick Mathewson 7b12b54d40 tor-netdoc: Put the "routerdesc" document type behind a feature.
Nothing in arti currently uses this document type.  Eventually it
will be useful for relays and for bridge clients.

I've left the "SHA1 digest of a router descriptor" type available
unconditinoally, however, since it does get used in a few places.

Part of #125.
2021-11-12 12:15:30 -05:00
Nick Mathewson fb591c51b4 tor-llcrypto: Put currently unused functions behind features.
We don't currently need a couple of the key manipulation features
that we have, since we aren't yet doing relays or onion service
clients.

Part of #125
2021-11-12 11:56:05 -05:00
Nick Mathewson b7b9aa854e Add a file to track per-crate semver status. 2021-11-11 10:35:38 -05:00
Nick Mathewson 156ffae727 Add our release instructions to version control. 2021-10-29 12:05:40 -04:00
Nick Mathewson 9304d5d6b7 Add removed paragraphs to Architecture.md 2021-10-28 19:59:05 -04:00
Nick Mathewson 3c82666d39 Small FAQ update. 2021-10-27 15:07:49 -04:00
Nick Mathewson 01894dcd68 Add missing entries to Architecture.md 2021-10-27 15:05:00 -04:00
Dimitris Apostolou c26dc07fbb
Fix typos and cleanup 2021-10-25 19:58:42 +03:00
Nick Mathewson 7c7a388e28 Rename tor_client/arti_tor_client to arti_client.
Solves a name conflict with the existing tor_client create.

Closes #130.
2021-10-21 14:22:11 -04:00
Nick Mathewson 6230e1e2a6 Small edits on Android.md 2021-10-08 09:50:02 -04:00
Nick Mathewson 4a7c563b79 Fix some typos (via the "typos" tool) 2021-10-08 09:42:54 -04:00
Nick Mathewson 0779923d64 Initial backend implementation for guard node manager.
There are some missing parts here (like persistence and tests)
and some incorrect parts (I am 90% sure that the "exploratory
circuit" flag is bogus).  Also it is not integrated with the circuit
manager code.
2021-10-07 10:45:42 -04:00
Trinity Pointard 954395573a update fslock to compile android 2021-09-25 12:01:45 +02:00
Nick Mathewson 95343a25e3 Add small qualifiers on android.md 2021-09-16 08:35:02 -04:00
Trinity Pointard 1d006684c9 fix typo and change upstream link 2021-09-15 11:59:28 +02:00
Trinity Pointard 285b3126f7 document android building 2021-09-14 19:59:23 +02:00
rls 51d91508f7 Fix typos and other spelling mistakes 2021-07-31 18:02:35 +02:00
Nick Mathewson 99a19ea0ba Revise repository-level documentation 2021-06-17 12:18:28 -04:00