/** Return true if we believe ourselves to be any kind of * authoritative directory beyond just a hidserv authority. */intauthdir_mode_any_nonhidserv(const or_options_t *options)
This phrase "hidserv authority" is from back in the days of v1 directory authorities, where there were 3 central authorities that collected and served all the hidden service descriptors.
Those days are gone, so references to a hidserv authority no longer make sense.
In particular, I think there are now only two types of directory authorities -- bridge authorities and main authorities. So this function could be replaced with just authdir_mode(). I'm marking it as 'easy' since it's a good one for a newbie to grab.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
Are you comfortable using git? If so, the best thing to do here would be to separate these into a series of commits, where each commit resolves one of the functions that doesn't need to exist anymore. That way we don't have a bigger diff where we're removing several functions at once and replacing several functions at once and it's harder to audit.
It's possible that none of these functions are interconnected, that is, you could remove them in any order. It's also possible that there are some orderings of removal that are cleaner to do and some that are messier.
I've also been looking through authdir_mode_publishes_statuses(), which looks like it doesn't have to exist anymore and could just be replaced with a call to authdir_mode()? It looks like there's an old comment in list_server_status_v1() about including v2 dir auths, which is not accurate anymore -- in fact, I just opened #22473 (moved) so we can get rid of that whole function, but that's not this ticket. :)
And the same with authdir_mode_tests_reachability() -- now that all types of auths test reachability, I don't think we need a separate wrapper function.
Tackling one function per commit will make auditing the commits much easier, and also it is the right sort of best practice for development. :)
(If you don't want to deal with this, that's fine too, let us know and we'll try to refactor things into separate commits.)
I've also been looking through authdir_mode_publishes_statuses(), which looks like it doesn't have to exist anymore and could just be replaced with a call to authdir_mode()?
As I understand, authdir_mode_publishes_statuses() cannot be replaced with authdir_mode() since it requires BridgeAuthoritativeDir == 0 && AuthoritativeDir != 0. Am I missing something?
And the same with authdir_mode_tests_reachability() -- now that all types of auths test reachability, I don't think we need a separate wrapper function.
Yes.
I separated the patch to a series of commits as your comment. Please let me know if I could do better :)
Thanks.
Thanks! I've pulled this into my public repository as bug22311. Here are the additional changes I suggest, which I've made on that branch:
I've made a fix to use authdir_mode_v3() instead of looking at V3AuthoritativeDir directly.
Since we no longer call authdir_mode_handles_descs() with purpose==-1, I am calling that behavior a bug.
I also think that we shouldn't take 99c49cae9f8a354660a53dc2744cd0cc14c2e5b6 ("Remove authdir_mode_tests_reachability()") -- at some point in the future, we are likely to severely change how reachability testing works, especially on the bridge authorities.
If this still looks okay, I'll rebase and squash and merge.