TorTestingNetwork vs. GETINFO config-text
So,
if one has a Tor instance running with TorTestingNetwork set to 1, and sends it a GETINFO config-text on the control port, tor will assert(0).
| Dec 05 00:34:26.000 [err] config_dump(): Bug: validate_fn said: TestingV3AuthInitialVotingInterval may only be changed in testing Tor networks!
| Dec 05 00:34:26.000 [err] config_dump(): Bug: Failed to validate default config.
| Dec 05 00:34:26.000 [err] config_dump(): Bug: config.c:2750: config_dump: Assertion 0 failed; aborting.
[the first log line is mine.]
The problem results from several things, as always.
When TorTestingNetwork is set, Tor overwrites some of the default values, that is it directly modifies the initval attributes of the _option_vars elements in the global options_format. It does this in options_init_from_string() around line 4230. One of those options that are changed is TestingV3AuthInitialVotingInterval.
Also, in options_validate() we verify that TestingV3AuthInitialVotingInterval is 30*60 (the non-testing default).
Now, GETINFO config-text causes config_dump() to be called. That function wants to get a list of default values, so it can ignore them later on. For that it first gets a list of all the default values. It does that by getting a fresh config and initialising it with the (modified) defaults. Then it goes to check if Tor likes the default config.
Unfortunately we don't like the default config we just created - the default is TorTestingNetwork 0 and TestingV3AuthInitialVotingInterval not 30*60 (because we changed initval before) so we blow up (the check is around line 3690).
Note that just setting TestingTorNetwork in the config to be checked (so that we like the new non-default values) is not sufficient - the next obstacle is that TestingTorNetwork only is allowed with non-default directory authorities.
Cheers, weasel
Not enough. and would also require special handling in config_dump())
| static config_var_t testing_tor_network_defaults[] = {
| V(ServerDNSAllowBrokenConfig, BOOL, "1"),
| + V(TestingTorNetwork, BOOL, "1"),
| V(DirAllowPrivateAddresses, BOOL, "1"),