Tor only updates guard state after a consensus if it has enough directory info
Steps to reproduce:
- Launch tor in a fresh data directory
export DATADIR=`mktemp -d`
src/or/tor DataDirectory "$DATADIR" StrictNodes 1 EntryNodes 1390DFDB5603AB5A16564505D7AE8647B1818A3C
- Delete its microdescriptors
rm -v "$DATADIR"/cached-microdescs*
- Repeat step 1
Expected behaviour:
Tor uses the selected EntryNode
Actual Behaviour:
Tor uses a fallback directory mirror
This happens because tor should update guard state after every consensus, but it only updates guard state when it has enough directory info.
It is pathological when combined with #23817 (moved), when tor gets in a state when it doesn't have enough directory info because its guards are broken, and never updates its guard state, so it can't get enough directory info.