Commit Graph

5090 Commits

Author SHA1 Message Date
Nick Mathewson 66f34ee774 Merge branch 'guards_as_bridges_part3' into 'main'
GuardMgr: decouple NetDir from guards and sample code.

See merge request tpo/core/arti!815
2022-11-02 12:41:03 +00:00
Nick Mathewson c2ed381c99 Refactor CandidateStatus API to simplify code in descs.
This removes some duplication.
2022-11-02 08:07:32 -04:00
Nick Mathewson fc0c12510a GuardMgr: Fix and improve comments based on review. 2022-11-02 08:07:32 -04:00
Nick Mathewson 6828178dec guardmgr: fix rustdoc references. 2022-11-02 08:07:32 -04:00
Nick Mathewson 08473872ab guardmgr: Refactor candidate info; add `full_dir_info`
Previously we always set `dir_info_missing` to `false` for new
guards, since new guards could only be taken from ones that were
present in the NetDir.  But for bridges, we don't download their
info until _after_ we have chosen them as guards.
2022-11-02 08:07:11 -04:00
Nick Mathewson 5867318a35 guardmgr: Implement Universe for bridges.
Now we can use a group of bridges as the basis for a sample of
guards.
2022-11-02 08:06:43 -04:00
Nick Mathewson 79dade342a guardmgr: Universe API should look up by ChanTarget
This will be necessary for bridges.
2022-11-02 08:06:43 -04:00
Nick Mathewson 82e9a57012 guardmgr: take sampled guards from Universe.
This is a trickier case, since we have to deal with weights.
2022-11-02 08:06:43 -04:00
Nick Mathewson 7733146c8c guardmgr: Continue porting porting code to use Universe.
Two more simple cases that can use Universe instead of Netdir.
2022-11-02 08:06:20 -04:00
Nick Mathewson fbcacea993 guardmgr: Begin to decouple guards from NetDir.
In this and the upcoming commits I'll be changing how guards related
to `NetDir` and to `Relay`.  Previously, a guard could only come
from (or be updated from) a `Relay` in a `NetDir`.  Soon it will be
able to be built from a bridge as well.

To do this, I'm defining a `Universe` trait (name negotiable) that
represents a set of things that may be guards.  I'm going to
continue extending its functionality until there are no more
methods in guard.rs or sample.rs that take `NetDir`.

This commit removes most of the usage of `NetDir` and `Relay` in
`guard.rs`.
2022-11-02 08:05:51 -04:00
Nick Mathewson b5f498021d guardmgr: Rename microdescriptor_missing to dir_info_missing 2022-11-02 07:59:56 -04:00
Nick Mathewson 39ea0518ee guardmgr: Allow guards to be constructed from any ChanTarget. 2022-11-02 07:59:56 -04:00
Nick Mathewson 1cb6ea1e77 guardmgr: Include PtTarget in guards.
Use a vector, since we may (someday) want to allow a Guard to have
multiple PtTargets.
2022-11-02 07:59:56 -04:00
Ian Jackson 0489d2d4be Merge branch 'notify' into 'main'
refactor config reload triggering

Closes #562

See merge request tpo/core/arti!819
2022-11-01 13:31:17 +00:00
trinity-1686a c487de6c46 debounce reload cfg events 2022-11-01 13:42:05 +01:00
Ian Jackson 0a60e9e7cc Merge branch 'remove-deps' into 'main'
remove unused dependancies

See merge request tpo/core/arti!817
2022-11-01 11:07:03 +00:00
trinity-1686a d29f38603d set all crate edition to 2021 2022-11-01 00:17:33 +01:00
trinity-1686a ce886e209f rename unused field 2022-10-30 12:36:13 +01:00
trinity-1686a 5cf2933d33 update some strings 2022-10-30 12:31:07 +01:00
trinity-1686a 5abddfb579 use iife so we can try! instead of custom error handling 2022-10-30 12:31:07 +01:00
trinity-1686a 66c08c967e refactor so events always indicate reload 2022-10-30 12:31:07 +01:00
trinity-1686a 749746a609 depends less on notify types 2022-10-30 12:31:07 +01:00
trinity-1686a e6e064ac8a remove unused dependancies 2022-10-29 13:29:55 +02:00
Nick Mathewson a962683222 Merge branch 'upgrade_20221028' into 'main'
Upgrade and update dependencies

See merge request tpo/core/arti!816
2022-10-28 19:22:26 +00:00
Nick Mathewson 0c7cdae8f9 Upgrade dependencies in preparation for upcoming release(s) 2022-10-28 14:51:01 -04:00
Nick Mathewson 0b167f1b1c update to latest arti-corpora 2022-10-28 09:30:16 -04:00
Nick Mathewson 29c46d08b5 Merge branch 'guards_as_bridges_part2' into 'main'
Use ByRelayIds to hold guards in GuardSet

See merge request tpo/core/arti!808
2022-10-27 21:09:47 +00:00
Nick Mathewson 557a07677e guardmgr: Rename and clarify of non-persistent-state copy fns
These will need a bigger overhaul: see #612 and #611.
2022-10-27 16:40:35 -04:00
Ian Jackson 4f171acaf7 Clarify fix_consistency 2022-10-27 16:40:35 -04:00
Ian Jackson 7180079112 Clarify what it means to be "an identity" for a primary guard. 2022-10-27 16:40:35 -04:00
Ian Jackson 15d464a929 tor-guardmgr: Add big doc comment about guard id handling 2022-10-27 16:40:35 -04:00
Ian Jackson fdbd213a6d Merge branch 'bridge-api-yaks' into 'main'
Misc minor changes to BridgeDescProvider APIs

See merge request tpo/core/arti!812
2022-10-27 15:37:17 +00:00
Ian Jackson 4a59d384b6 tor-dirmgr: impl Default for FlagPublisher 2022-10-27 15:57:57 +01:00
Ian Jackson 94325cd456 tor-dirmgr: impl FlagEvent for BridgeDescEvent 2022-10-27 15:57:57 +01:00
Ian Jackson 26a7aa9aa6 BridgeDescProvider: Make BridgeDescEvent repr(u16) and derive traits
This will enable us to impl FlagEvent for it.
2022-10-27 15:57:54 +01:00
Ian Jackson a56efbfdf0 impl Hash for BridgeConfig and various PT information
The bridge descriptor manager wants to index data structures by the
BridgeConfig.
2022-10-27 15:57:54 +01:00
Ian Jackson a89daba1c8 tor-guardmgr: bridges: export BridgeDescError at toplevel 2022-10-27 15:57:54 +01:00
eta 84a2624401 Merge branch 'fuzz_ptmgr_ipc' into 'main'
ptmgr: Add a fuzzer for ptmessage.

See merge request tpo/core/arti!814
2022-10-27 14:51:35 +00:00
eta b3d8f3b5ee Merge branch 'simpler_quote_skipping' into 'main'
ptmgr::ipc: Try an alternate approach to initial quotes.

See merge request tpo/core/arti!813
2022-10-27 14:50:56 +00:00
Ian Jackson 38a940d5a9 Merge branch 'misc-yaks' into 'main'
Two misc minor changes, for descriptor downloading

See merge request tpo/core/arti!811
2022-10-27 10:16:59 +00:00
Ian Jackson 9796d615f8 tor-basic-utils: Provide an implementation of BinaryHeap::retain
This is currently nightly-only and is blocked on an unresolved API
question:
  https://github.com/rust-lang/rust/issues/71503
2022-10-27 10:46:03 +01:00
Ian Jackson a59fef00e9 tor-checkable: Make TimerangeBound::dangerously* non-experimental
I want one of these for the bridge descriptor downloader, and they
seem reasonable to me.
2022-10-27 10:46:03 +01:00
Nick Mathewson 9f73ddd440 Merge branch 'assert_maxlen' into 'main'
tor-cell: Assert data length in Data cells

See merge request tpo/core/arti!800
2022-10-27 01:46:21 +00:00
Nick Mathewson 42fefe021d ptmgr: Add a fuzzer for ptmessage. 2022-10-26 16:59:48 -04:00
Nick Mathewson cb7eb3b00d ptmgr::ipc: Try an alternate approach to initial quotes.
This lets us use `chars()` rather than `char_indices()`.
2022-10-26 14:49:24 -04:00
Nick Mathewson a8b96534be Merge branch 'dirclient-yaks' into 'main'
Misc minor changes to tor-dirclient, for descriptor downloading

See merge request tpo/core/arti!810
2022-10-26 18:43:15 +00:00
eta 1ffb2856d9 Merge branch 'pt-ipc-v1' into 'main'
tor-ptmgr/ipc: First cut of pluggable transport spawning

Closes #394

See merge request tpo/core/arti!779
2022-10-26 15:31:59 +00:00
eta a118a639ed tor-ptmgr/ipc: First cut of pluggable transport spawning
The new `ipc` module inside `tor-ptmgr` implements the Pluggable
Transport Specification version 1 (`pt-spec.txt`,
https://gitlab.torproject.org/tpo/core/torspec/-/blob/main/pt-spec.txt).

This enables module users to spawn pluggable transport binaries inside a
child process asynchronously, and receive structured information about
how to connect to the transports provided by said binaries.

Internally, this is structured as a pure set of serialisers and
deserialisers for the protocol in the specification (in the form of
environment variables, and the PT's stdout), a wrapper to run the PT
binary and enable accessing its output asynchronously, and a user-facing
wrapper that handles ensuring all the requested transports launched
properly.

The included `run-pt` example is an exceedingly minimal wrapper program
that was useful in testing. More tests can and should be added in a
further MR.

closes arti#394; part of arti#69
2022-10-26 16:07:30 +01:00
Ian Jackson d0492ba189 Merge branch 'redundant_allocation' into 'main'
tor-bytes: Avoid redundant allocation

See merge request tpo/core/arti!806
2022-10-26 09:43:13 +00:00
Nick Mathewson a9e74aa72a Merge branch 's101-metrics-october-2022' into 'main'
Update heap and download size metrics for October

See merge request tpo/core/arti!809
2022-10-25 20:25:34 +00:00