hs_service: don't force high intro point rotation for TestingTorNetwork

This was previously added to facilitate testing intro point rotation
with chutney. However, the implementation is problematic since it forces
excessive rotation whenever TestingTorNetwork is enabled, and can't be
adjusted or disabled.

Alternatives for testing intro point rotation include:
 * Using shadow to "fast forward" time
 * Overriding the consensus parameters hs_intro_min_lifetime and
   hs_intro_max_lifetime.

Fixes #40922
This commit is contained in:
Jim Newsome 2024-03-12 09:16:47 -05:00
parent d1e8c7a603
commit d224961609
2 changed files with 5 additions and 17 deletions

5
changes/bug40922 Normal file
View File

@ -0,0 +1,5 @@
o Minor bugfixes (testing):
- Enabling TestingTorNetwork no longer forces fast hidden service
intro point rotation. This reduces noise and errors when
using hidden services with TestingTorNetwork enabled.
Fixes bug 40922; bugfix on 0.3.2.1-alpha.

View File

@ -410,11 +410,6 @@ get_intro_point_max_introduce2(void)
static int32_t
get_intro_point_min_lifetime(void)
{
#define MIN_INTRO_POINT_LIFETIME_TESTING 10
if (get_options()->TestingTorNetwork) {
return MIN_INTRO_POINT_LIFETIME_TESTING;
}
/* The [0, 2147483647] range is quite large to accommodate anything we decide
* in the future. */
return networkstatus_get_param(NULL, "hs_intro_min_lifetime",
@ -427,11 +422,6 @@ get_intro_point_min_lifetime(void)
static int32_t
get_intro_point_max_lifetime(void)
{
#define MAX_INTRO_POINT_LIFETIME_TESTING 30
if (get_options()->TestingTorNetwork) {
return MAX_INTRO_POINT_LIFETIME_TESTING;
}
/* The [0, 2147483647] range is quite large to accommodate anything we decide
* in the future. */
return networkstatus_get_param(NULL, "hs_intro_max_lifetime",
@ -3039,13 +3029,6 @@ get_max_intro_circ_per_period(const hs_service_t *service)
tor_assert(service->config.num_intro_points <=
HS_CONFIG_V3_MAX_INTRO_POINTS);
/** For a testing network, allow to do it for the maximum amount so circuit
* creation and rotation and so on can actually be tested without limit. */
#define MAX_INTRO_POINT_CIRCUIT_RETRIES_TESTING -1
if (get_options()->TestingTorNetwork) {
return MAX_INTRO_POINT_CIRCUIT_RETRIES_TESTING;
}
num_wanted_ip = service->config.num_intro_points;
/* The calculation is as follow. We have a number of intro points that we