Commit Graph

5120 Commits

Author SHA1 Message Date
Nick Mathewson e8701b1e9e gitlab-ci: Pin to nightly-2022-11-11
This is a workaround for #633.
2022-11-18 10:02:27 -05:00
Nick Mathewson ec148a63cb CircMgr: Refactor DirSpecificTarget constructor
This commit replaces the
`impl From<&T> for OwnedChanTarget where T:ChanTarget`
with a new `IntoOwnedChanTarget` trait. This lets us be explicit
that we're constructing an owned object, and not just converting
something.

No semver change needed, since these APIs haven't been released.

----------- (new description)
2022-11-18 09:55:46 -05: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 76e41b8bf6 circmgr: make some imports conditional
This resolves an "unused import" warning when bridges are not
enabled.
2022-11-18 08:53:47 -05:00
Nick Mathewson 2c366927cc arti-client: make bridge-client depend on dirmgr/bridge-client
This resolves some errors when building with `bridge-client` but not
with `--all-features`.
2022-11-18 08:53:47 -05:00
Nick Mathewson b0e337d22d arti: Mark bridge and pt support non-experimental, and on-by-default 2022-11-18 08:53:47 -05:00
Nick Mathewson 9229e1a59b arti: Split long lines in Cargo.toml
This will make the next commit easier to review.
2022-11-18 08:53:47 -05:00
Nick Mathewson f1f6005474 arti-client: Mark "bridge-client" and "pt-client" as non-experimental 2022-11-18 08:53:47 -05:00
Nick Mathewson 09591bcc5a arti-client: split long lines in Cargo.toml
Doing this separately to make the next commit easier to read.
2022-11-18 08:53:47 -05:00
Nick Mathewson 9f661e264f dirmgr: make "bridge-client" non-experimental. 2022-11-18 08:53:47 -05:00
Nick Mathewson 471cdc77f2 guardmgr: Make bridge-client and pt-client non-experimental 2022-11-18 08:53:47 -05:00
Nick Mathewson 1928fd0b72 circmgr: Make "specific-relay" non-experimental. 2022-11-18 08:53:47 -05:00
Nick Mathewson b5a9e0b475 chanmgr: Make "pt-client" non-experimental. 2022-11-18 08:53:47 -05:00
Nick Mathewson c441853cb8 Merge branch 'log_guard_status' into 'main'
GuardMgr: Log significant guard/bridge status changes at info/warn

Closes #627

See merge request tpo/core/arti!869
2022-11-18 13:51:42 +00:00
Ian Jackson c0fa78fd4d Merge branch 'display_chan_target' into 'main'
ChanTarget: Add a display function, with better output.

Closes #647

See merge request tpo/core/arti!868
2022-11-18 13:19:10 +00:00
Ian Jackson fc047b4b3c Merge branch 'inst_as_arg' into 'main'
GuardMgr: Resolve a `TODO pt-client` by having `update` take an `Instant`.

See merge request tpo/core/arti!863
2022-11-18 12:42:02 +00:00
Nick Mathewson 8dfbbca4e5 GuardMgr: Log when a guard status changes (significantly).
We previously had a trace message on _every_ change.  That's fine,
but we also want to log more important changes where the user
can see them.  Namely:

  * If we go from any other status to Reachable, we want to tell
    the user. (We don't want to spam them if it was already
    reachable.)
  * If we go from Untried or Reachable to Unreachable, we want to
    tell the user. (We don't tell them about changes from Retriable
    to Unreachable, since that just means that a retry attempt
    was not successful.)

Closes #627.
2022-11-17 12:32:57 -05:00
Nick Mathewson 6c5dd05698 GuardMgr: split Reachable::Unknown into Untried and Retriable
There are two cases here, and we will want to log them
differently.

(By removing the "Unknown" variant entirely, we ensure that we
didn't miss any code that formerly checked for Unknown.)
2022-11-17 12:21:06 -05:00
Nick Mathewson effd53510d ChanMgr: Log every conection attempt at debug. 2022-11-17 12:01:57 -05:00
Nick Mathewson 95081198e5 Remove impl Display for OwnedCircTarget
Nothing used this; if anything wants it, it would be better off
calling `.display_chan_target()`.
2022-11-17 09:12:57 -05:00
Nick Mathewson 25702ccd9e ChanTarget: Add a display function, with better output.
This change lets us display a ChanTarget's members without first
cloning them into an OwnedChanTarget.

It also resolves a reliability issue by outputting better info when
talking about connections via pluggable transports.

Closes #647
2022-11-17 09:06:08 -05:00
eta 7e886187a9 Merge branch 'channelmap_rename' into 'main'
ChanMgr: Rename ChannelMap to MgrState

Closes #606

See merge request tpo/core/arti!864
2022-11-17 11:52:45 +00:00
Nick Mathewson cf152c5ed6 linkspec: Make "pt-client" non-experimental. 2022-11-16 12:26:31 -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 76a89fb178 GuardMgr: Add Instant to update().
This lets us avoid calling `Instant::now()`, when `Runtime::now()`
is what we want.

Unfortunately, there are a bunch of functions that called `update()`
that needed to change.  Fortunately, none of the changes were very
complicated.

Fixes a `TODO pt-client` comment.
2022-11-16 09:56:51 -05:00
Nick Mathewson fd2253cd44 GuardMgr: Rename "now" arg in update() to "wallclock"
I'm about to add an `Instant` argument. By convention, when we have
both, we call the Instant "now".

This commit is a pure renaming.
2022-11-16 09:40:25 -05:00
Nick Mathewson 4a1b3d8954 guardmgr: Remove a now-unneeded "allow(dead_code)" 2022-11-16 09:22:23 -05:00
eta 09b918515c Merge branch 'ptmgr-config' into 'main'
tor-ptmgr: make configuration use builders, plumb into arti-client

See merge request tpo/core/arti!823
2022-11-16 12:12:35 +00:00
Ian Jackson b46d1600e7 Merge branch 'real_netdoc_pos' into 'main'
Replace `Option<Pos>` with `Pos` in `ParseError`.

Closes #640

See merge request tpo/core/arti!859
2022-11-16 11:50:20 +00:00
Ian Jackson d7dc02968f pt config, arti cfg test: Expect bridges.transports to be missing
As per
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/823#note_2854365
2022-11-16 11:39:25 +00:00
Ian Jackson 4fe5e8fcaa arti cfg test: Coalesce expect_missing
If there are subkeys which are covered by also expected_missing
superkeys, delete them, since we expect the superkey to be missing, so
the subkey won't show up.
2022-11-16 11:39:25 +00:00
eta 1c9f6fb179 tor-ptmgr: make configuration use builders, plumb into arti-client
This brings the draft configuration mechanisms in tor-ptmgr in line with
the config in other crates, using builders. It also plumbs the config
type through into the main `arti-client` config, and adds some example
lines to `arti-example-config.toml`.
2022-11-16 11:39:25 +00:00
Nick Mathewson 938bc06b52 Merge branch 'remove_netdoc_todo' into 'main'
Remove a `TODO pt-client` in netdoc.

See merge request tpo/core/arti!860
2022-11-15 22:40:31 +00:00
Nick Mathewson 7a42cb0e45 Remove a `TODO pt-client` in netdoc.
This issue is now torspec!94.
2022-11-15 17:19:26 -05:00
Nick Mathewson 39615516fd Replace `Option<Pos>` with `Pos` in `ParseError`.
We already have `Pos::Unknown` for an error at an unknown
location and `Pos::None` for an error where no location is
sensible. There's no reason to have an additional `Option` here.

Additionally, the use of `Option` gave us a bug where our old
`ParseError::at_pos()` method didn't actually set the position
unless the position was already set.  That's not what we want!

Fixes #640.

Finally, we have to fix a test that was a bit broken because it was
working around #640.
2022-11-15 16:58:23 -05:00
Nick Mathewson 0378a14014 Merge branch 'fix_bridgeconf_lookup' into 'main'
Allow a subset-only ChanMethod match when looking up a BridgeConfig

Closes #642

See merge request tpo/core/arti!858
2022-11-15 19:18:51 +00:00
Ian Jackson 86c7a2da7f Merge branch 'cfg-doc' into 'main'
arti cfg test: Add more documentation

See merge request tpo/core/arti!856
2022-11-15 19:05:12 +00:00
Nick Mathewson 2bd422663e Resolve a dead-code warning. 2022-11-15 13:53:14 -05:00
Nick Mathewson d78cde7dea Allow a subset-only ChanMethod match when looking up a BridgeConfig
If we have a bridge guard that is using Direct connection and it
knows multiple addresses, our code to match it with a BridgeConfig
is wrong, because the BridgeConfig has only one address, and our
code looks for an exact match.

Fixes #642.
2022-11-15 13:53:14 -05:00
Ian Jackson 67242a2986 arti cfg test: Document exhaustive_1 and comment exhaustive 2022-11-15 18:25:39 +00:00
Nick Mathewson db9440464b Remove a spurious log that I committed by mistake. Whoops. 2022-11-15 13:15:32 -05:00
eta 5eccaf008b Merge branch 'fix_parse' into 'main'
netdoc: Allow empty lines at the end of router descriptors

Closes #637

See merge request tpo/core/arti!857
2022-11-15 17:41:29 +00:00
Nick Mathewson d0f3f25483 Merge branch 'implement_usage' into 'main'
Implement more cases for `DirSpecificTarget`.

See merge request tpo/core/arti!855
2022-11-15 17:10:04 +00:00
Nick Mathewson 050eab9bba Implement more cases for `DirSpecificTarget`.
Without this fix, any attempt to actually use a circuit for a
`DirSpecificTarget` will fail, since supports() will say false, and
`restrict_mut()` will say `NotSupported`.
2022-11-15 11:42:54 -05:00
Nick Mathewson 89be046466 netdoc: Allow empty lines at the end of a router descriptor. 2022-11-15 11:27:43 -05:00
Nick Mathewson bc7780bffd tor-netdoc: Add a new ErrorKind for EmptyLine.
Empty lines were previously reported as BadKeyword, which is
confusing.
2022-11-15 11:27:43 -05:00