Avoid building exit circuits unless we have a consensus that can build exit paths
Split from #13718 (moved):
teor:
I also wonder about the impact of changing the invocation of circuit_build_needed_circs() so that it runs when we know we have internal circuits, rather than waiting for exit circuits. Should we split it into internal and exit versions? If so, which types of circuits go in each category?
nickm: That's an interesting question, but it sounds like a separate ticket. Generally, anything that is a predicted circuit, or anything that might carry user traffic, is an exit circuit. Anything else is an internal circuit.
Notes:
Exit Circuits:
- Predicted Circuits
- User Traffic Circuits
- Others (TBC)
Internal Circuits:
- Hidden Service -> Introduction Point Circuits (TBC)
- All Other Circuits
The behaviour as of 2.6.0-alpha was to build all these circuits only when we had enough descriptors to build exit circuits. This is perhaps more conservative than required.
arma in #13718 (moved):
So there's still value imo in waiting for circuit-building until we have all the network info that we need for a variety of actions. The bug here is that we have the wrong definition of "all the network info that we need" when the network has no exits. So we should be fixing that definition.