GuardMgr: Inform the BridgeDescProvider which desciptors we need.
I had a good discussion with @Diziet about this on IRC, and I want to get my thoughts down while I can. (@Diziet, please don't worry that this isn't quite the same as what we discussed; it will have the same result and be far easier to implement. Also there are some phrases here like "are succeeding" that will need more rigorous definitions, since what I'm writing isn't precisely what the code provides.)
It is sufficient to maintain the property:
- "Whatever we would next return from
GuardSet::pick_guard_id()
should be labeled as having a desired descriptor."
This can be accomplished as follows:
- Any guard to which we successfully build a circuit should be labeled as "descriptor desired".
- In bridge mode, our circuit predictor should try to maintain a single one-hop directory circuit to "some bridge with a known descriptor".
Additionally, these rules will keep us from running away with ourself:
- If any primary primary guards are succeeding, we don't desire any descriptor from any non-primary guards.
- We never desire more than some N descriptors, preferring to get them in guard preference order.