| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
| |
| |
| |
| |
| | |
Instead of duplicating the logic about which guard sample uses which
universe, we explicitly ask it, and then use that universe. This
will avoid trouble if/when we introduce more samples.
|
| | |
| |
| |
| | |
descriptors updated as appropriate.
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
This can probably be done in a simpler way, but for the moment I
would prefer to try to minimize the amount of code I'm changing
here.
|
| | |
| |
| |
| |
| |
| |
| | |
This will match our needs better and help avoid some `Arc<>`s.
It will be especially helpful for avoiding `Arc`s we don't
actually have.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I'm using an Arc<[]> here though I think that there's a chance
that a simple Vec<> would suffice. Since it's an internal type,
nothing will break if we change it later.
Also, we now switch into and out of the Bridges guard sample
as needed. However, that selection is not (yet) built from the
list of bridges. That will come soon.
|
| | | |
|
| | |
| |
| |
| | |
Also fix its behavior when using bridges.
|
| | |
| |
| |
| |
| |
| | |
The first part changes which guard set is active based on based on
the parameters, which always come from a NetDir; the second changes
the contents of the active guard set, based on a Universe.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
These arguments were used only for legacy (testing) purposes; the
tests now use `TestNetDirProvider`. This lets us simplify our
internal logic for passing a `NetDir` to our samples, and prepare
for having a `BridgeSet` to pass there instead.
This is a breaking change to `guardmgr` and `circmgr`.
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
We require these for NetDirProvider, so this shouldn't be a big reach.
|
| | |
| |
| |
| |
| | |
This allows the use of Box<dyn BridgeDescProvider> in callers,
since Box<dyn BridgeDescProvider> is now Clone.
|
| |/ |
|
| |\
| |
| |
| |
| | |
tor-guardmgr: use imported WeightThreshold in one place
See merge request tpo/core/arti!825
|
| | |
| |
| |
| |
| | |
Without this, an unused import warning is generated when building
without features.
|
| | | |
|
| | |
| |
| |
| |
| | |
This will avoid having to make bridge-related trait features in
GuardMgr conditional, which would be non-additive.
|
| | |
| |
| |
| |
| | |
It doesn't seem to me like it makes sense to provide the backward
compatibility here.
|
| |/
|
|
|
| |
This does involve additional cloning. However, soon it will mean that
we can pass the whole `TorClientConfig` by reference.
|
| | |
|
| |
|
|
|
|
|
|
| |
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.
|
| |\
| |
| |
| |
| | |
GuardMgr: decouple NetDir from guards and sample code.
See merge request tpo/core/arti!815
|
| | |
| |
| |
| | |
This removes some duplication.
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| | |
Now we can use a group of bridges as the basis for a sample of
guards.
|
| | |
| |
| |
| | |
This will be necessary for bridges.
|
| | |
| |
| |
| | |
This is a trickier case, since we have to deal with weights.
|
| | |
| |
| |
| | |
Two more simple cases that can use Universe instead of 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`.
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
Use a vector, since we may (someday) want to allow a Guard to have
multiple PtTargets.
|
| |/ |
|
| |\
| |
| |
| |
| | |
Use ByRelayIds to hold guards in GuardSet
See merge request tpo/core/arti!808
|
| | |
| |
| |
| | |
These will need a bigger overhaul: see #612 and #611.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
This has subtleties; the comments try to explain them.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
This is necessary for the (somewhat undesirable) lookup_ids function
to return an ID that the dirmgr can actually use to report successes
and failures.
As noted, lookup_ids will create problems down the road when we
implement relays. We should refactor it out before then.
|
| | |
| |
| |
| |
| |
| | |
To see if we can add a relay as a guard, we need a conservative
test: any IDs in common with the given relay prevent us from adding
it.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This required a number of changes, which I've tried to document.
I've taken a conservative approach to modification, and I'm not
using any of the by_*_mut() functions (yet). For cases which
potentially modify the whole set, I'm using into_values() and
collect() to ensure that it's re-indexed correctly, even though the
identities don't change.
I introduce some "TODO pt-client" comments here which I will resolve
in the next commit(s).
|
| | | |
|
| | |
| |
| |
| | |
This will enable us to impl FlagEvent for it.
|
| | |
| |
| |
| |
| | |
The bridge descriptor manager wants to index data structures by the
BridgeConfig.
|
| | | |
|