aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr
Commit message (Collapse)AuthorAgeFilesLines
...
| * Do not include error source() in display() format.Nick Mathewson2022-06-211-2/+2
| | | | | | | | | | | | | | | | | | According to doc/Errors.md, and in keeping with current best practices, we should not include display an error's `source()` as part of that error's display method. Instead, we should let the caller decide to call source() and display that error in turn. Part of #323.
* | tor-chanmgr: Change to use unwrap_voidIan Jackson2022-06-212-8/+5
| | | | | | | | | | As per discussion in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2813573
* | channel padding: Rename ChannelsParams from ChannelsConfigIan Jackson2022-06-213-39/+39
| | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2814276 Change names and comments and docs everywhere.
* | channel padding: chanmgr: Clarify a commentIan Jackson2022-06-211-3/+3
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/586#note_2813574
* | channel padding: Use IntegerMilliseconds in netdirIan Jackson2022-06-211-12/+10
| |
* | channel padding: Use IntegerMilliseconds in padding::ParametersIan Jackson2022-06-212-10/+16
| |
* | channel padding parameters update: Drop a redundant cloneIan Jackson2022-06-211-1/+1
| |
* | Fix typoseta2022-06-211-2/+2
| |
* | channel padding: Test timeout updatesIan Jackson2022-06-212-1/+50
| |
* | tor-chanmgr tests: Add config_update tracking to FakeChannelIan Jackson2022-06-211-1/+7
| |
* | channel padding: Honour NetDir for timeoutsIan Jackson2022-06-211-3/+47
| | | | | | | | But padding is still not enabled by default.
* | channel padding: Plumb settings from chanmgrIan Jackson2022-06-215-14/+186
| |
* | chanmgr: inner (map): Reorganise to prepare for having more stateIan Jackson2022-06-211-14/+27
| | | | | | | | | | | | The main copy of the (global) configuration for the client's channels is going to have to live here, inside this mutex. So this really needs to become a struct with names fields.
* | tor-chanmgr: tests: Have unwrap_open return a (mut) referenceIan Jackson2022-06-211-2/+2
|/ | | | | This avoids confusing bugs where you try to modify the result and nothing happens!
* tor-proto: channel: Provide padding::TimerIan Jackson2022-06-081-0/+1
|
* Merge branch 'sleep' into 'main'Ian Jackson2022-06-081-1/+4
|\ | | | | | | | | Plumb a SleepProvider (now Clone + ....) into Channel See merge request tpo/core/arti!569
| * Plumb a SleepProvider into the channel reactorIan Jackson2022-06-081-1/+4
| | | | | | | | | | The channel reactor is going to want to be able to sleep so that it can do padding, so it needs a SleepProvider.
* | Upgrade float_eq dev-dependency to 1.0.0Nick Mathewson2022-06-071-1/+1
|/
* lints: Add let_unit_value allow to all cratesIan Jackson2022-05-311-0/+1
| | | | | From running add_warning, with manual picking of the right hunks/lines.
* lints: Add lint block delimiters to every crateIan Jackson2022-05-311-0/+2
| | | | | | This was the result of: maint/add_warning crates/*/src/{lib,main}.rs and then manually curating the results.
* Lexically sort Cargo.toml dependenciesOrhun Parmaksız2022-05-281-9/+8
| | | | | | Utilize cargo-sort: https://github.com/DevinR528/cargo-sort Signed-off-by: Orhun Parmaksız <[email protected]>
* Regenerate version bump from previous commit.arti-v0.4.0Nick Mathewson2022-05-271-5/+5
| | | | | | | This commit was made by reverting the previous commit, then re-running the script I used to generate it. In theory there should be no semantic changes: only changes due to improved formatting from cargo edit.
* Semantic version changes for Arti 0.4.0 releaseNick Mathewson2022-05-271-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | I followed the following procedure to make these changes: * I used maint/changed_crates to find out which crates had changed since 0.3.0. * I used grep and maint/list_crates to sort those crates in topological (dependency) order. * I looked through semver_status to find which crates were listed as having semver-relevant changes (new APIs and breaking changes). * I scanned through the git logs of the crates with no semver-relevant changes listed to confirm that, indeed, they had no changes. For those crates, I incremented their patch-level version _without_ changing the version that other crates depend on. * I scanned through the git logs of the crates with no semver-relevant changes listed to confirm that, indeed, they had no obvious breaking changes. * I treated all crates that depend on `arti` and/or `arti-client` as having breaking changes. * I identified crates that depend on crates that have changed, even if they have not changed themselves, and identified them as having a non-breaking change. * For all of the crates, I used `cargo set-version -p $CRATE --bump $STATUS` (where `STATUS` is `patch` or `minor`) to update the versions, and the depended-upon versions.
* Bump the version of every* crate to 0.3.0Nick Mathewson2022-05-061-9/+9
| | | | * Except for safelog and fs-mistrust, which are new.
* Upgrade to Postage 0.5.0Nick Mathewson2022-04-261-1/+1
|
* Bump every crate's edition to 2021.Nick Mathewson2022-04-251-1/+1
| | | | | | | | | | This is an automated change made with a perl one-liner and verified with grep -L and grep -l. Some warnings are introduced with this change; they will be removed in subsequent commits. See arti#208 for older discussion on this issue.
* Add 'rust-version = "1.56"' to every Cargo.toml file.Nick Mathewson2022-04-251-0/+1
| | | | | | | This change was made automatically with a perl one-liner, and confirmed with `grep -L`. The `rust-version` field itself was introduced in 1.56.0.
* Reformat all not-yet-reformatted Cargo.toml files.Nick Mathewson2022-04-251-11/+11
| | | | | There are no semantic changes here; only formatting. This is in preparation for other changes (wrt MSRV and edition)
* chanmgr: expose whether we are failing because of expired certs.Nick Mathewson2022-04-122-20/+87
|
* ChanMgr: Return provenance information from get_or_launchNick Mathewson2022-04-072-14/+31
| | | | | | 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.
* chanmgr: bubble ClockSkew up through the Error object.Nick Mathewson2022-04-073-9/+58
| | | | | | | | 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.
* Merge branch 'main' into 'retriable'Nick Mathewson2022-04-052-3/+98
|\ | | | | | | # Conflicts: # doc/semver_status.md
| * chanmgr: tests for ConnStatus::usableNick Mathewson2022-04-021-0/+5
| |
| * chanmgr: add a test for AbstractChannel::duration_unusedNick Mathewson2022-04-021-1/+9
| |
| * chanmgr: add tests for connect_one.Nick Mathewson2022-04-021-2/+84
| |
* | chanmgr: implement HasRetryTime.Nick Mathewson2022-04-041-0/+31
|/
* Bump all arti*, tor* crates to 0.2.0Nick Mathewson2022-04-011-9/+9
| | | | | | | | Not all of these strictly need to be bumped to 0.2.0; many could go to 0.1.1 instead. But since everything at the tor-rtcompat and higher layers has had breaking API changes, it seems not so useful to distinguish. (It seems unlikely that anybody at this stage is depending on e.g. tor-protover but not arti-client.)
* Make daemon tasks self-contained; introduce NetDirProvidereta2022-03-301-0/+41
| | | | | | | | | | | | | | | 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.
* tor-proto: add a backend to detect reported clock skew.Nick Mathewson2022-03-231-1/+4
| | | | | | | | | | | | | | | | 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.
* Merge branch 'ticket_383' into 'main'Ian Jackson2022-03-091-5/+5
|\ | | | | | | | | | | | | tor-chanmgr: Do not allocate an Internal error unless we mean it. Closes #383 See merge request tpo/core/arti!394
| * tor-chanmgr: Do not allocate an Internal error unless we mean it.Nick Mathewson2022-03-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'moderately-enthused-eyeballs' into 'main'eta2022-03-072-21/+84
|\ \ | |/ |/| | | | | Implement a basic form of RFC 8305 ("happy eyeballs") for channels See merge request tpo/core/arti!382
| * Implement a basic form of RFC 8305 ("happy eyeballs") for channelseta2022-03-072-21/+84
| | | | | | | | | | | | | | | | | | | | | | | | 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)
* | Move skip_fmt into tor-basic-utilsIan Jackson2022-03-042-2/+2
| | | | | | | | | | | | | | Code motion and the minimal mechanical changes. As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/375#note_2783078
* | Replace manual Debug impl with educe in tor-chanmgrIan Jackson2022-03-022-7/+7
|/
* Merge branch 'clippy-allow-arc-clone' into 'main'Nick Mathewson2022-03-011-1/+0
|\ | | | | | | | | Disable clippy::clone_on_ref_ptr See merge request tpo/core/arti!352
| * Disable clippy::clone_on_ref_ptrIan Jackson2022-02-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lint is IMO inherently ill-conceived. I have looked for the reasons why this might be thought to be a good idea and there were basically two (and they are sort of contradictory): I. "Calling ‘.clone()` on an Rc, Arc, or Weak can obscure the fact that only the pointer is being cloned, not the underlying data." This is the wording from https://rust-lang.github.io/rust-clippy/v0.0.212/#clone_on_ref_ptr It is a bit terse; we are left to infer why it is a bad idea to obscure this fact. It seems to me that if it is bad to obscure some fact, that must be because the fact is a hazard. But why would it be a hazard to not copy the underlying data ? In other languages, faliing to copy the underlying data is a serious correctness hazard. There is a whose class of bugs where things were not copied, and then mutated and/or reused in multiple places in ways that were not what the programmer intended. In my experience, this is a very common bug when writing Python and Javascript. I'm told it's common in golang too. But in Rust this bug is much much harder to write. The data inside an Arc is immutable. To have this bug you'd have use interior mutability - ie mess around with Mutex or RefCell. That provides a good barrier to these kind of accidents. II. "The reason for writing Rc::clone and Arc::clone [is] to make it clear that only the pointer is being cloned, as opposed to the underlying data. The former is always fast, while the latter can be very expensive depending on what is being cloned." This is the reasoning found here https://github.com/rust-lang/rust-clippy/issues/2048 This is saying that *not* using Arc::clone is hazardous. Specifically, that a deep clone is a performance hazard. But for this argument, the lint is precisely backwards. It's linting the "good" case and asking for it to be written in a more explicit way; while the supposedly bad case can be written conveniently. Also, many objects (in our codebase, and in all the libraries we use) that are Clone are in fact simply handles. They contain Arc(s) (or similar) and are cheap to clone. Indeed, that is the usual case. It does not make sense to distinguish in the syntax we use to clone such a handle, whether the handle is a transparent Arc, or an opaque struct containing one or more other handles. Forcing Arc::clone to be written as such makes for code churn when a type is changed from Arc<Something> to Something: Clone, or vice versa.
* | Bump all crates to 0.1.0arti-v0.1.0Nick Mathewson2022-03-011-8/+8
| |
* | tor-proto: Split IoErr based on when it occursNick Mathewson2022-02-231-1/+1
|/ | | | | | | We want to distinguish handshake failures from errors later on in the channel's lifetime. Closes #359.
* Rename TorConnectionFailed to TorAccessFailedNick Mathewson2022-02-221-2/+2
|