Commit Graph

331 Commits

Author SHA1 Message Date
Nick Mathewson e845a553f3 Upgrade tracing to 0.1.36.
This is the first version to impl Value for String.

With luck, this will get minimal_versions CI passing.
2023-05-03 11:09:21 -04:00
Nick Mathewson 1904cfc8b9 Increment crate versions.
Because of the errorkind bumps, we're calling this a breaking change
in everything lower-level than `arti`.

Generated with:
```
cargo set-version -p tor-basic-utils --bump minor
cargo set-version -p tor-async-utils --bump minor
cargo set-version -p caret --bump minor
cargo set-version -p fs-mistrust --bump minor
cargo set-version -p safelog --bump minor
cargo set-version -p retry-error --bump minor
cargo set-version -p tor-error --bump minor
cargo set-version -p tor-config --bump minor
cargo set-version -p tor-events --bump minor
cargo set-version -p tor-units --bump minor
cargo set-version -p tor-rtcompat --bump minor
cargo set-version -p tor-rtmock --bump minor
cargo set-version -p tor-rpcbase --bump minor
cargo set-version -p tor-llcrypto --bump minor
cargo set-version -p tor-protover --bump minor
cargo set-version -p tor-bytes --bump minor
cargo set-version -p tor-hscrypto --bump minor
cargo set-version -p tor-socksproto --bump minor
cargo set-version -p tor-checkable --bump minor
cargo set-version -p tor-cert --bump minor
cargo set-version -p tor-linkspec --bump minor
cargo set-version -p tor-cell --bump minor
cargo set-version -p tor-proto --bump minor
cargo set-version -p tor-netdoc --bump minor
cargo set-version -p tor-consdiff --bump minor
cargo set-version -p tor-netdir --bump minor
cargo set-version -p tor-congestion --bump minor
cargo set-version -p tor-persist --bump minor
cargo set-version -p tor-chanmgr --bump minor
cargo set-version -p tor-ptmgr --bump minor
cargo set-version -p tor-guardmgr --bump minor
cargo set-version -p tor-circmgr --bump minor
cargo set-version -p tor-dirclient --bump minor
cargo set-version -p tor-dirmgr --bump minor
cargo set-version -p tor-hsclient --bump minor
cargo set-version -p tor-hsservice --bump minor
cargo set-version -p arti-client --bump minor
cargo set-version -p arti-rpcserver --bump minor
cargo set-version -p arti-config --bump minor
cargo set-version -p arti-hyper --bump minor

cargo set-version -p arti --bump patch
cargo set-version -p arti-bench --bump patch
cargo set-version -p arti-testing --bump patch
```
2023-05-03 08:31:11 -04:00
Nick Mathewson 4efb423947 Upgrade our hex-literal dependency 2023-04-13 07:51:26 -04:00
Ian Jackson b6533b31aa Merge branch 'msrv-1.65' into 'main'
Increase Arti MSRV to 1.65

Closes #815

See merge request tpo/core/arti!1131
2023-04-12 09:34:05 +00:00
Nick Mathewson 104d64589d Increment MSRV to 1.65 in every crate. 2023-04-11 15:31:12 -04:00
Neel Chauhan 5d61ff04d1 s/ProtocolFailed/ProtocolViolation/g where possible 2023-04-08 07:47:28 -07:00
Nick Mathewson 9ef115a7fb Patchlevel bumps for crates whose dependencies just changed.
These crates had no changes until just a moment ago. But since
we updated the versions on some of their dependents, they have now
changed themselves.  Thus they get patchlevel bumps.

```
tor-rtmock
tor-protover
tor-socksproto
tor-consdiff
tor-chanmgr
tor-dirclient
tor-hsservice
```
2023-03-31 08:30:14 -04:00
Nick Mathewson e208fb15ad Bump crate versions that have breaking changes
These crates have had breaking changes.  They are pre-1.0, so they get
a minor bump.

```
tor-basic-utils
tor-config
```
2023-03-31 08:28:06 -04:00
Nick Mathewson a81ab391ae Bump patchlevel on crates with non-breaking changes
For these crates, the changes are nontrivial, so we
_do_ bump the versions on which their dependent crates depend.

Fortunately, since they are all pre-1.0, we don't need to
distinguish semver-additions from other changes.  (Except for arti,
which _is_ post-1.0, but gets a patchlevel bump anyway.)

These are unstable crates with breaking changes:

```
tor-hscrypto
tor-hsclient
```

These have new or extended APIs:

```
safelog
tor-bytes
tor-cell
tor-linkspec
tor-llcrypto
tor-proto
tor-cert
arti-client
```

These have new unstable APIs or features:
```
tor-netdoc
tor-circmgr (also broke some unstable APIs)
arti (is post-1.0)
```

These have bugfixes only:
```
caret
tor-dirmgr
```
2023-03-31 08:24:39 -04:00
Nick Mathewson f41449d0bd Patchlevel bumps for remaining changed crates.
These crates have had small code changes, but no API additions:

tor-config
tor-socksproto
tor-cert
tor-chanmgr
tor-ptmgr
tor-guardmgr
tor-circmgr
tor-dirclient
tor-dirmgr
arti
tor-hsservice
tor-congestion

These crates have had API extensions:

fs-mistrust
tor-llcrypto
tor-bytes
tor-checkable
tor-linkspec
tor-netdoc
tor-persist
arti-client
2023-02-28 07:13:27 -05:00
Nick Mathewson 3e1ae65212 Bump tor-units version for breaking change.
(The breaking change was removing `as_days()` from IntegerMinutes.)

We are _not_ calling this a downstream-api breaking change, per
discussion at
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1012?commit_id=bb2ab7c2a3e0994bb438188511688b5b039cae29#note_2876819
2023-02-28 07:10:00 -05:00
Nick Mathewson 3e257a7cb5 Bump minor versions for significant breaking changes.
This includes tor-cell, tor-proto, and tor-netdir.
2023-02-28 07:05:15 -05:00
Nick Mathewson 8ee04ac203 Merge branch 'logs' into 'main'
Report causes of errors

Closes #680

See merge request tpo/core/arti!997
2023-02-01 18:19:33 +00:00
Nick Mathewson a2b1f20216 Bump minor version of tor-cell.
In !948 we renamed a couple of accessor functions, which is a
breaking change in `tor-cell`'s API.

In retrospect, perhaps we should have deprecated the old names and
added the new ones, so we wouldn't have to break the API.  (This is
the only API break AFAICT since 1.1.0.)
2023-02-01 10:42:58 -05:00
Nick Mathewson 7c1b6a5a81 Bump the patch version of every crate that had API additions
These crates had API or behavior changes that may affect downstream
crates. Fortunately, they're all version 0.x, and don't need minor
bumps for this.
2023-02-01 10:36:29 -05:00
Nick Mathewson 66f594a4b6 Bump the patch-level version of crates with _minor_ changes.
These changes influence behavior, but not effect compatibility.
(If I messed up, and any crate except for `arti` has non-breaking
API changes, that's still fine, since they are all version
0.x.)
2023-02-01 10:23:58 -05:00
Ian Jackson 8c1830090c Use ErrorReport for errors in error! in tor-chanmgr 2023-01-30 18:52:32 +00:00
Ian Jackson 410fdc9f32 Use ErrorReport for errors in warn! in tor-chanmgr 2023-01-30 18:52:32 +00:00
Ian Jackson c2e4b8b7f9 Errors: Mark the type of an error, for clarity
We want to call ErrorReport::report() on Errors, but this isn't an
Error but only a string.
2023-01-30 17:52:02 +00:00
Nick Mathewson a6dd92843e Allow clippy::unchecked_duration_subtraction in tests
This panics on error, and we're fine with a panic on misbehavior in
tests.
2023-01-27 08:28:02 -05:00
Nick Mathewson bf04641c68 Disable clippy::unlinlined-format-args
This warning kind of snuck up on us! (See #748)  For now, let's
disable it.  (I've cleaned it up in a couple of examples, since
those are meant to be more idiomatic and user-facing.)

Closes #748.
2023-01-27 08:27:47 -05:00
Nick Mathewson 1e25a962a7 chanmgr: trace-level logs when launching connections.
Based on more temporary debugging code. Yet another part of #677.
2023-01-06 17:19:00 +00:00
eta 118050e54c Merge branch 'test-lints' into 'main'
Add test lint blocks to all "mod test"

See merge request tpo/core/arti!937
2023-01-06 17:16:09 +00:00
Emil Engler 8579bc66a8
doc: consistent summary line for the READMEs
This commit introduces a consistency to the summary line of all
README.md files in each and every crate.
2022-12-20 14:31:47 +01:00
Ian Jackson 125a455bdc test lint blocks: Add many many automatically
This is precisely the result of running the rune in
maint/adhoc-add-lint-blocks.
2022-12-12 18:00:30 +00:00
Nick Mathewson e0aeda3071 Remove semver.md files now that 1.1.0 is released. 2022-11-30 17:10:29 -05:00
Nick Mathewson 38bef96b99 Bump the minor version of every crate.
We made this job easy this time around: by incrementing our MSRV, we
have forced ourselves to do at least a minor bump everywhere.
2022-11-30 15:10:16 -05:00
Nick Mathewson 903571353b Merge branch 'renaming' into 'main'
Renaming a couple of items for arti 1.1.0

Closes #623

See merge request tpo/core/arti!916
2022-11-30 18:58:37 +00:00
Nick Mathewson 6bd0f92c15 Downgrade a "TODO pt-client" comment 2022-11-30 13:22:54 -05:00
Nick Mathewson acc2de7b31 Rename TransportHelper => TransportImplHelper. 2022-11-30 13:05:46 -05:00
Nick Mathewson a0e1b3d651 Merge branch 'bridge-addr-2' into 'main'
Separate BridgeAddr and PtTargetAddr

See merge request tpo/core/arti!904
2022-11-30 17:36:50 +00:00
eta 5c2847e1d0 Merge branch 'fix_pt_protocol' into 'main'
Resolve two bugs in our pt-socks implementation

Closes #676

See merge request tpo/core/arti!913
2022-11-30 17:25:31 +00:00
Nick Mathewson e835bd4c4c PT protocol: pt-spec conformance with password field
pt-spec says:
```
      If the encoded argument list is less than 255 bytes in
      length, the "PLEN" field must be set to "1" and the "PASSWD"
      field must contain a single NUL character.
```

This is a very silly thing to say, but some PTs enforce it.

Fixes #676.
2022-11-30 11:53:38 -05:00
Nick Mathewson 475d9af34a connect_via_proxy: Actually send initial handshake.
Our previous code would make a TCP connection to the proxy, then
wait forever for it to say something. Whoops!

Part of a fix for #676.
2022-11-30 11:53:27 -05:00
Ian Jackson 4afe128189 PT SOCKS tests: add a few more tests 2022-11-30 16:35:04 +00:00
Ian Jackson 596e67f588 PT SOCKS tests: test name that only fits in V4 2022-11-30 16:35:04 +00:00
Ian Jackson ab74506dc9 Abolish ChanMgr::set_default_transport
The comment says
  // TODO pt-client: It's not clear to me that we really need this method.
and empirically, deleting it, and its callee, is fine.
2022-11-30 16:00:31 +00:00
Ian Jackson 199a6e0754 Separate BridgeAddr and PtTargetAddr
As per
  https://gitlab.torproject.org/tpo/core/arti/-/issues/668#note_2858220

This commit is difficult to split up.

The innards of BridgeAddr and PtTargetAddr are still a bit entangled.
2022-11-30 15:49:34 +00:00
Nick Mathewson 7ef9dde99c Merge branch 'todos-chanmgr' into 'main'
chanmgr: resolve several remaining "TODO pt-client" issues

See merge request tpo/core/arti!897
2022-11-29 19:31:48 +00:00
Nick Mathewson 8cc09c2728 chanmgr: Distinguish failure to connect to proxy from other IO failures 2022-11-29 13:41:35 -05:00
Nick Mathewson c6aa587dc8 chanmgr: remove a now-stale TODO. 2022-11-29 11:15:36 -05:00
Nick Mathewson 4fff9f9dda chanmgr: Report Pt errors correctly.
We were panicking if the PtMgr gave us an error, which isn't so
good.
2022-11-29 11:10:26 -05:00
Nick Mathewson 69744ef8f3 Remove deprecated aliases in tor-linkspec. 2022-11-29 10:56:59 -05:00
Nick Mathewson 3db0e05b39 Fix ChanMgr APIs for setting PtMgr etc to match what TorClient wants. 2022-11-28 17:29:23 -05:00
eta a3c9fc5b1a tor-chanmgr: Introduce the BootstrapReporter API, publicize ChanBuilder
This commit makes the `ChanBuilder` type in `tor-chanmgr` usable by
consumers outside of that crate, like the doc comment for
`ChannelFactory` says you need to be able to do in order to turn your
`TransportHelper` into something useful.

As part of doing this, the `event_sender` its constructor takes needed
to be dealt with, since it was a crate-internal type that came from
inside the `ChanMgr`.

Enter `BootstrapReporter`: an opaque wrapper around that sender, now
provided as an additional argument to
`ChannelFactory::connect_via_transport`. You can now construct a
`ChanBuilder` outside this crate, and it'll still be able to report its
bootstrap status by unwrapping this new type that's threaded through
from the `ChanMgr`. (This was a fair deal of manually threading the type
through all the layers in this crate!)

Note that you cannot implement bootstrap updating using something that
isn't `ChanBuilder` yet due to the type being entirely opaque (but, of
course, we can figure out exactly what API the reporter should have
later, and add that capability in).
2022-11-28 13:52:21 -05:00
eta 3b41c78d6f Draft: Pluggable transport manager
This commit implements `PtMgr`, a pluggable transport manager
responsible for keeping track of spawned PTs and spawning them to
satisfy client requests on demand.

It does this in two parts: the `PtMgr` type exported to the rest of the
code, and the background `PtReactor` that actually does the spawning;
this design ensures that only one attempt to spawn a PT is active at a
time, and will prove useful later for implementing e.g. timeouts.

A few changes were necessary to the rest of the code in order to make
this all work out. Namely:
- `TransportRegistry`'s API didn't make any sense for two reasons:
  - It wasn't feasible for implementors to implement `ChannelFactory`,
    since that'd require constructing a `ChanBuilder` (which requires a
    bootstrap reporting event sender).
  - Treating the PT manager as a registry is over-general; it's only
    necessary for it to spawn pluggable transports, so saddling it with
    other concerns didn't make any sense.
  - (It's possible to get extensibility for arbitrary user customization
    by just letting the user swap in a new `ChannelFactory`, anyway.)
- Therefore, the `PtMgr` implements the new `AbstractPtMgr` trait, which
  is far more narrowly focused; this only exists to solve a dependency
  loop, and is documented as such.
  - This provides a `TransportHelper` instead of a `ChannelFactory`.
2022-11-28 13:52:21 -05:00
Ian Jackson 1a39a0c7e9 Make ChannelMethod non-exhaustive
Enums with variants conditional on cargo features must be
non-exhaustive, because cargo features are supposed to be additive,
meaning that enabling a feature (which might happen due to some random
distant thing) ought not to break things using that enum.

There were surprisingly few places to fix this.
2022-11-24 17:17:36 +00:00
Ian Jackson e635383dfb tor-chanmgr: Invent [Box]ChanSensitive for two error payloads
This
 1. Makes the errors smaller (in the case of Io's PtTargetAddr;
    ChannelBuild's addresses are already indirected in a Vec).
 2. Redacts (currently, scrubs) the PtTargetAddr and SocketAddr
    when safe logging is enabled

These are the remaining error variants in tor-chanmgr that contain
information that should become sensitive as part of bridge support.
2022-11-23 18:28:38 +00:00
Ian Jackson 32357b3de7 tor-chanmgr: Replace OwnedChanTarget with LoggedChanTarget in errors
This
 1. Makes the errors smaller
 2. Redacts (currently, scrubs) the chantarget when safe logging is enabled

This commit doesn't treat other should-be-sensitive inforemation in
errors just yet.  That will come in a moment.
2022-11-23 18:28:38 +00:00
Nick Mathewson 3f5699b95a ChanMgr: Another attempt to build on CI. 2022-11-23 11:25:15 -05:00
Nick Mathewson 74ebc904e3 ChanMgr: Rename Factory -> CompoundFactory 2022-11-23 11:10:34 -05:00
Nick Mathewson 1249bedbb0 ChanMgr: Fix a few more conditional-compilation issues 2022-11-23 11:10:34 -05:00
Nick Mathewson 2fb36f5585 ChanMgr: Remove Arc aliases. 2022-11-23 11:10:34 -05:00
Nick Mathewson f8e103bb94 Mark set-default-factory API as experimental. 2022-11-23 11:10:34 -05:00
Nick Mathewson c04aa9baed Make ChannelFactory and AbstractPtMgr require Send+Sync 2022-11-23 11:10:34 -05:00
Nick Mathewson bc1de60d6d ChanMgr: Implement functions that replace channel factories.
This commit makes it possible to replace the default channel factory
(used when there is no PtMgr), and to replace the PtMgr.

This is part of #659.
2022-11-23 11:10:34 -05:00
Nick Mathewson a688e4afc9 ChanMgr: move the AbstractChanFactory into MgrState.
We will want the freedom to replace this, so it needs to go behind a
lock. We need to be able to Clone it cheaply now, so we're using an
Arc instead of a Box.
2022-11-22 14:41:44 -05:00
Nick Mathewson 09092394a8 Merge branch 'main' into 'abstract-pt-mgr'
# Conflicts:
#   crates/tor-chanmgr/src/factory.rs
2022-11-22 18:12:25 +00:00
eta 2f75702cec Replace TransportRegistry with AbstractPtMgr
It doesn't make much sense to have the pluggable transport manager be a
registry, so replace its interface with a more narrowly defined, less generic
version.

Other changes:
- instead of returning a &-reference, it returns an owned Arc, which
  should make the ptmgr easier to implement while allowing efficient
  reuse
- provision for error handling is added, but will probably be revised in
  a future commit pending discussion
- tor-ptmgr code that would generate warnings as a result of this change
  is temporarily removed

This is a split out version of arti!886, intended so work on arti#659
can proceed.
2022-11-22 18:09:06 +00:00
Nick Mathewson c666133be4 Merge branch 'mark-bridges-not-experimental' into 'main'
Mark bridge and PT-related APIs as non-experimental.

Closes #643

See merge request tpo/core/arti!865
2022-11-18 14:22:31 +00:00
Nick Mathewson b5a9e0b475 chanmgr: Make "pt-client" non-experimental. 2022-11-18 08:53:47 -05:00
Nick Mathewson effd53510d ChanMgr: Log every conection attempt at debug. 2022-11-17 12:01:57 -05:00
Nick Mathewson 7d4691e402 chanmgr: rename new_test_channel_map to new_test_state. 2022-11-16 12:07:47 -05:00
Nick Mathewson b466e24235 chanmgr::mgr::*: misc spelling fixes and normali[sz]ations 2022-11-16 12:05:20 -05:00
Nick Mathewson 53c401af65 Fix up documentation that referred to a ChannelMap. 2022-11-16 12:02:02 -05:00
Nick Mathewson 5804f0f350 ChanMgr: Rename map.rs to state.rs
This is another pure renaming.
2022-11-16 11:46:11 -05:00
Nick Mathewson 8271037d37 ChanMgr: Rename ChannelMap to MgrState
We're doing this because the type now holds "all the mutable state
in a ChanMgr", not just the map.

This is a pure renaming; no documentation has been updated.

Part of #606.
2022-11-16 11:32:49 -05:00
Nick Mathewson 936920b26e bump rust-version to 1.60 in every crate. 2022-11-10 10:57:33 -05:00
Nick Mathewson c99976fabc ChanMgr: downgrade and remove a few TODO-ptclient comments
renamings are now #623.  Code movement can happen later.
2022-11-08 08:27:19 -05:00
Nick Mathewson 1179c39859 Suppress two clippy::large_enum_variant warnings
These are newly present on 1.65.  We can address them later.
2022-11-03 11:09:51 -04:00
Nick Mathewson 932fe48eaf Run add_warnings. 2022-11-03 11:06:02 -04:00
Ian Jackson 48f48841e1 Require derive_more 0.99.3
0.99.[012] have a bug https://github.com/JelteF/derive_more/issues/114
which makes the Deref derive for bridgedesc::StateGuard not work
and therefore breaks minimal-versions CI.

It seems simpler to require the newer version everywhere.
2022-11-03 11:37:23 +00:00
Nick Mathewson 40ec12b0cb Merge branch 'guards_as_bridges_part1' into 'main'
Allow GuardMgr to expose bridges as guards (part 1)

See merge request tpo/core/arti!785
2022-10-24 13:30:02 +00:00
Nick Mathewson bb117a4bd4 guardmgr: Refactor the interior of FirstHop.
Now it contains either an `OwnedChanTarget` or an `OwnedCircTarget`,
which will let `GuardMgr` return bridges that can be used to make
circuits.

As part of this change, it was necessary to revise some
address-modification functions that applied to filters and
`OwnedChanTarget`.  Now they do the smart thing, and remove only the
address that are in the `ChanMethod`.  This means that the addresses
from HasAddrs are still accurate about which addresses the relay
"has".
2022-10-24 08:59:12 -04:00
Ian Jackson 2ccf8a1b5b tor-chanmgr: Suppress an unused imports warning for `use super::*`
If pt-client is disabled, there are in fact no tests, so the module is
empty.  But we would always want `use super::*` here.
2022-10-21 15:19:05 +01:00
Nick Mathewson 1e4b1f6433 Oops: Mark some imports as pt-client only.
This causes CI problems, and is entirely my fault.
2022-10-21 08:32:02 -04:00
Nick Mathewson 05913f9720 transport: Escape = signs in keys only.
This is a compromise between C tor (never escapes = signs) and the
spec (calls for escaping all = signs).  In C tor there is no way to
actually construct a key with an = sign in it, so this difference
should be undetectable.
2022-10-20 08:11:05 -04:00
Nick Mathewson 40b9b57884 Clarify comment on ExternalProxyPlugin. 2022-10-20 08:11:05 -04:00
Nick Mathewson 27f53f241d transport: rename "ExtraneousData" to "UnexpectedData" 2022-10-20 08:11:05 -04:00
Nick Mathewson f39157f8c3 chanmgr: Add the code necessary to use SOCKS PTs via a TransportHelper
This is mostly a matter of encoding parameters in the format used
for socks authentication.
2022-10-20 08:11:00 -04:00
Nick Mathewson 50b65b217d chanmgr: Begin a socks-client implementation.
This code is _not_ conditional, since we want to support running
with a proxy even if we don't support pluggable transports.

We may eventually want to refactor this into a new create.
2022-10-20 08:09:18 -04:00
Nick Mathewson 5786637b4f Fix various typos (using typos tool and hand-inspection) 2022-10-18 15:39:33 -04:00
Nick Mathewson 06132d9f35 chanmgr: Add an error case if a final_attempt neither succeeds or fails
This can happen in weird corner cases, so it's probably best to
report it rather than having an "internal error."
2022-10-18 11:49:21 -04:00
Nick Mathewson 4b0c28014d Refactor flow control in get_or_launch.
Now, instead of duplicate checks in various cases, we simply go
through the loop one last time.

This allows us to simplify some of our other logic around here.
2022-10-18 11:49:21 -04:00
Nick Mathewson e0bd6111a8 chanmgr: Split get_or_launch into sub-functions.
This function had grown huge and hard to reason about.  Before I
make it even worse, let's split it up.
2022-10-18 11:49:21 -04:00
Nick Mathewson 710be8d4c6 chanmgr: Refactor choose_action code into its own function. 2022-10-18 11:49:21 -04:00
Nick Mathewson 8f4ff7014a Clarify a comment about the desired structure of ChanMgr 2022-10-18 11:49:21 -04:00
Nick Mathewson c0bca7213c Comments to explain effects of return in closure. 2022-10-18 11:49:21 -04:00
Nick Mathewson c802d39b80 chanmgr: Remove "Ident" from AbstractChannel
Thanks to our previous changes, we no longer need this type, or the
methods that access it.
2022-10-18 11:49:21 -04:00
Nick Mathewson c78bacce86 chanmgr: replace the HashMap<> with a ByRelayIds.
This is necessary so that we can look up channels (open and pending)
by all of the Ids that we know about them.

The operations needed here are pretty complex: to get them right,
I've replaced most of the accessors on the inner `ChannelMap` with a
function that holds the lock while another `FnOnce` is called.  This
still gets us the invariant that we can't accidentally await while
holding the lock on the `ChannelMap`.

I've removed the tests for the accessors that are no longer there.

There are some subtleties here.  Now that we have more than one kind
of Id, it's possible to have a partial match.  I've tried to explain
all these cases in the comments.
}
2022-10-18 11:49:21 -04:00
Nick Mathewson 735100455d chanmgr: Add identities to pending state in map.
This will let us migrate from `HashMap<Ed25519Identity, Entry>` to
`ByRelayIds<Entry>`.
2022-10-18 11:49:21 -04:00
Nick Mathewson e51fdbfb1b chanmgr: Require HasRelayIds for AbstractChannel::BuildSpec
This is mostly a testing only change for now too, but soon I'll use
it to deal with the fact that we need to know the IDs to actually
build a channel at all.
2022-10-18 11:49:21 -04:00
Nick Mathewson 71db8ebc2e chanmgr: Require HasRelayIds for AbstractChannel.
This is mostly a testing-only change for now, but soon I'll use it
so we can have IdMap for our channel map.
2022-10-18 11:49:21 -04:00
Nick Mathewson e94cff26e2 chanmgr: Remove the Poisoned state from the map type.
The `ByRelayIds` type doesn't have a type equivalent to
`hash_map::Entry`, since it's a set type rather than a map
type. Therefore, the only plausible way to do entry mutation will
be to remove the old entry and insert a new one.  And so, we no
longer need a "poisoned" state.
2022-10-18 11:49:21 -04:00
Nick Mathewson 31528202c5 chanmgr: Edit comments, fix docs 2022-10-13 10:32:02 -04:00
Nick Mathewson 913d5b68ec chanmgr: Remove RegistryAsFactory.
Since there is no longer a blanket implementation of ChannelFactory
for TransportHelper, we no longer need a separate type here.
2022-10-13 10:15:05 -04:00
Nick Mathewson fe2d44d10a ChanMgr: Reorganize factory, builder, transport code.
There is no actual code change here: just movement.
2022-10-13 10:09:52 -04:00
Nick Mathewson 85284ef847 Merge branch 'factory_redux' into 'main'
chanmgr: Build and use chanmgr factory APIs

See merge request tpo/core/arti!769
2022-10-13 12:58:28 +00:00
Nick Mathewson 7b58126706 Flatten TimeoutChannelFactory into ChannelBuilder. 2022-10-13 08:36:05 -04:00
Nick Mathewson 69b64a2795 chanmgr: clean up some TODO pt-client items and documentation. 2022-10-13 08:36:05 -04:00