In #9946 (moved) I added a new argument "for_discovery" to add_an_entry_guard(). Nick prefers "provisional" or "probationary".
In parallel, I think we should probably rename the made_contact field in entry guard t, to be why we're remembering that we've made contact, rather than simply that we have.
And lastly, we should do something about the godawful number of int arguments that add_an_entry_guard() now takes.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
edit: why not put the changes in here as well: I append seperate patches for the 3 sub-issues mentioned. They apply seperately to the current tree, so a maintainer can
quickly pick one of them up, if happy with it.
There shouldn't be a conflict in 1 and 2 but I could append a patchset anyway.
sub-issue 3 is only a call for advice and will be written on top of
the other ones, after discussion.
1* rename entry_guard_t's made_contact to used_so_save_if_down
I think that's readable. Is that about what arma had in mind?
2* rename for_discovery argument of add_an_entry_guard().
I like probationary more than provisional. Those 2 are suggested in issue 9971.
I chose forced_probationary because isn't it strictly a suboptimal situation
in terms of desired 'grade of anonymity'. What do you think?
3* NEEDS REVIEW FIRST: regarding the int arguments of add_an_entry_guard(). I look at:
node_t *chosen is a node to add.
prepend is set if the guard should become first in the list?
for_discovery is set if the guard is to be added because no guard in the list is running.
there are 2 users of add_an_entry_guard() that pass it a chosen node. One is
a bridge (prepend) and the other one is a user-defined node (!prepend), so:
Given the fact that the list is not supposed to be long and the two 'users'
are somewhat similar, why not prepend the node if explicitly given?
rename the int argument for_discovery of add_an_entry_guard() to forced_probationary. It resembles a, in some sense, not optimal (forced) situation regarding a desired 'level of anonymity'.
node_t *chosen is a node to add prepend is set if the guard should become first in the list there are 2 users of add_an_entry_guard() that pass it a chosen node. One is a bridge (prepend) and the other one is a user-defined node (!prepend), so: Given the fact that the list is not supposed to be long and the two 'users' are somewhat similar, prepend the node if explicitly given.
asn, does this conflict with the guard refactoring stuff you're doing? If so, couple you please incorporate the first two as feasible? These patches seem like reasonably good ideas to me.
The third one makes me nervous: we should still probably be appending the stuff in EntryNodes, right? Otherwise I worry we'll change our guards too fast.
Good. The third one should make you nervous and I don't sign off on it at all. It doesn't even apply to the current tree (the other two still do). You can either close this ticket ignoring the many-function-arguments-problem, spend some time on it considering the recent development in Guard-management or wait quite some time for me to be able to look at it.
asn, does this conflict with the guard refactoring stuff you're doing? If so, couple you please incorporate the first two as feasible? These patches seem like reasonably good ideas to me.
FWIW, the guard refactoring stuff I was doing have been merged (#12207 (moved) and #12202 (moved)). The next guard refactoring that needs to happen is #12595 (moved) but this is more long term and I haven't started coding it yet.
I'm not sure if I like this change. While I agree that made_contact is not the best name, I'm not sure if used_so_save_if_down is more appropriate.
IIUC, that variable is used in other places too, not just for "saving it down". For example, it's used during the network down event recognition in entry_guard_register_connect_status(), and also in populate_live_entry_guards() as part of:
{{{
/* Always start with the first not-yet-contacted entry
* guard. Otherwise we might add several new ones, pick
* the second new one, and now we've expanded our entry
* guard list without needing to. */
}}}
I don't really understand the for_discovery feature, so I can't comment on whether forced_probationary is a better name. Judging by the comment in add_an_entry_guard() it seems that this feature is some kind of kludge, and just the variable name change doesn't make it much easier to understand (especially, if we change made_contact to used_so_save_if_down then the comment doesn't even make sense).
In any case, if you understand this feature better, and you think that force_probationary is a better name, feel free to merge it.
Also, the patch misses a space in the comment of add_an_entry_guard().
I'm going to call this 'wontfix', since we have other work ongoing (see eg #17261 (moved), #17262 (moved)) to replace the guard selection code entirely. That makes it less critical for the current code to have well-named arguments.
Trac: Severity: N/Ato Normal Status: needs_revision to closed Resolution: N/Ato wontfix