Opened 10 years ago

Last modified 7 years ago

#1324 closed defect (Fixed)

Dir mirrors pull from v2 authorities, not v3 authorities

Reported by: Sebastian Owned by:
Priority: High Milestone: 0.2.2.x-final
Component: Core Tor/Tor Version: 0.2.1.24
Severity: Keywords:
Cc: Sebastian, ilter, nickm, arma Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

When running a private Tor network, one needs to provide at least one v2 authority
so that the network can successfully bootstrap. Otherwise, what happens is this:

The authorities make a consensus correctly and bootstrap successfully afterwards.
All relays (including directory mirrors) try to fetch descriptors from directory
mirrors, never asking any of the v3 authorities for them. This obviously fails,
as nobody has any descriptors. Let's hope dizum and tor26 don't fail ;)

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (14)

comment:1 Changed 10 years ago by nickm

Proposal 147 would fix this.

comment:2 Changed 10 years ago by Sebastian

hrm, I don't see how? Authorities are working fine and produce valid
consensuses, after all

comment:3 Changed 10 years ago by nickm

Oops. Proposal 147 would fix a completely different problem with running a network without a v2 authority.

The problem here is that mirrors don't ask authorities for descriptors unless those authorities are v2 authorities?
If so, that's a big problem; we should fix that.

comment:4 Changed 10 years ago by Sebastian

Indeed, hence I opened the bugreport ;)

comment:5 Changed 10 years ago by Sebastian

So we seem to end up calling directory_get_from_dirserver() from
initiate_descriptor_downloads() with a source of null, called from
launch_router_descriptor_downloads(). This one gets called from
update_consensus_router_descriptor_downloads(), which we
call in update_router_descriptor_downloads(). There, if
directory_fetches_dir_info_early() is true, we call
update_router_descriptor_cache_downloads_v2. If we have no v2
stuff at all, nothing happens.

comment:6 Changed 9 years ago by arma

Here's the problem:

@@ -311,12 +313,12 @@ directory_get_from_dirserver(uint8_t dir_purpose, uint8_t

case DIR_PURPOSE_FETCH_EXTRAINFO:

type = EXTRAINFO_CACHE |

(router_purpose == ROUTER_PURPOSE_BRIDGE ? BRIDGE_AUTHORITY :

  • V2_AUTHORITY);

+ V3_AUTHORITY);

break;

case DIR_PURPOSE_FETCH_V2_NETWORKSTATUS:
case DIR_PURPOSE_FETCH_SERVERDESC:

type = (router_purpose == ROUTER_PURPOSE_BRIDGE ? BRIDGE_AUTHORITY :

  • V2_AUTHORITY);

+ V3_AUTHORITY);

break;

case DIR_PURPOSE_FETCH_RENDDESC:

type = HIDSERV_AUTHORITY;

comment:7 Changed 9 years ago by nickm

Looks correct to me.

comment:8 Changed 9 years ago by nickm

(That is, your patch looks correct to me. It should go into maint-0.2.1, I think?)

comment:9 Changed 9 years ago by arma

Here it is, in its full glory, about to go into maint-0.2.1:

diff --git a/ChangeLog b/ChangeLog
index ec7d920..d6a5f15 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Changes in version 0.2.1.26 - 2010-0?-??
+ o Major bugfixes:
+ - Directory mirrors were fetching relay descriptors only from v2
+ directory authorities, rather than v3 authorities like they should.
+ Only 2 v2 authorities remain (compared to 7 v3 authorities), leading
+ to a serious bottleneck. Bugfix on 0.2.0.9-alpha. Discovered by
+ ilter. Fixes bug 1324.
+
+

Changes in version 0.2.1.25 - 2010-03-16

Tor 0.2.1.25 fixes a regression introduced in 0.2.1.23 that could
prevent relays from guessing their IP address correctly. It also fixes

diff --git a/src/or/directory.c b/src/or/directory.c
index 4153bca..7ec97d4 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -128,6 +128,8 @@ authority_type_to_string(authority_type_t auth)

smartlist_add(lst, (void*)"V1");

if (auth & V2_AUTHORITY)

smartlist_add(lst, (void*)"V2");

+ if (auth & V3_AUTHORITY)
+ smartlist_add(lst, (void*)"V3");

if (auth & BRIDGE_AUTHORITY)

smartlist_add(lst, (void*)"Bridge");

if (auth & HIDSERV_AUTHORITY)

@@ -309,12 +311,14 @@ directory_get_from_dirserver(uint8_t dir_purpose, uint8_t

case DIR_PURPOSE_FETCH_EXTRAINFO:

type = EXTRAINFO_CACHE |

(router_purpose == ROUTER_PURPOSE_BRIDGE ? BRIDGE_AUTHORITY :

  • V2_AUTHORITY);

+ V3_AUTHORITY);

break;

case DIR_PURPOSE_FETCH_V2_NETWORKSTATUS:

+ type = V2_AUTHORITY;
+ break;

case DIR_PURPOSE_FETCH_SERVERDESC:

type = (router_purpose == ROUTER_PURPOSE_BRIDGE ? BRIDGE_AUTHORITY :

  • V2_AUTHORITY);

+ V3_AUTHORITY);

break;

case DIR_PURPOSE_FETCH_RENDDESC:

type = HIDSERV_AUTHORITY;

comment:10 Changed 9 years ago by nickm

changes, not changelog.

Or else when we merge it into master, there will be conflict fun.

comment:11 Changed 9 years ago by ilter

Sebastian, Roger and Nick,thanks so much for your effort to file and to fix it. And additionally thanks so much to Sebastian for his script which for establishing private Tor network. You're so kind to make me feel proud but it's so much for me. Sebastian did everything. I only tested it with him. I think that changelog should be as below;

+ - Directory mirrors were fetching relay descriptors only from v2
+ directory authorities, rather than v3 authorities like they should.
+ Only 2 v2 authorities remain (compared to 7 v3 authorities), leading
+ to a serious bottleneck. Bugfix on 0.2.0.9-alpha. Discovered by
+ Sebastian. Fixes bug 1324.

comment:12 Changed 9 years ago by arma

Fix is in 0.2.2.11-alpha, will be in 0.2.1.x one day too.

comment:13 Changed 9 years ago by arma

flyspray2trac: bug closed.

comment:14 Changed 7 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.