netdir: Match C Tor's behavior for corner cases of onion service upload locations
From rend-spec-v3
2.2.3:
... If any of those
nodes have already been selected for a lower-numbered replica of the
service, any nodes already chosen are disregarded (i.e. skipped over)
when choosing a replica's hsdir_spread_store nodes.
We have a TODO for this in our tor_netdir::NetDir::hs_dirs()
function, and it's not something we can ignore. (If we ignore it, then C tor clients will occasionally expect to find hsdescs at a place where we haven't uploaded them.)
While working on this it might be convenient to also address the second TODO HSS
in the function, which has to do with the interaction between time periods, KP_blind_id, rings, and where to upload what.
See section 2.2 in rend-spec-v3
more generally for an overview of what's going on here.
Edited by Nick Mathewson