Skip to content

Conversation

@teor2345
Copy link
Owner

No description provided.

teor2345 added 14 commits May 18, 2020 21:53
Check for single-hop exits in router_add_running_nodes_to_smartlist(),
rather than router_choose_random_node().

Part of 34200.
And delete a loop that is now empty. This change should improve tor's
performance, because we no longer iterate through the nodelist twice for
every node in every circuit path.

Part of 34200.
Move node flag checks to router_add_running_nodes_to_smartlist(), where
they are actually used.

Part of 34200.
Re-order the flags in a logical order, and re-number them.
Add missing comments, fix comment typos.

Part of 34200.
Instead, call out to a helper function, repeating the call if needed.

Avoids duplicating exclusions for:
  * the current relay's family, and
  * any exclusions specified by the caller.

Part of 34200.
Make some interfaces and implementations consistent by replacing int
with bool.

Part of 34200.
Split the node choosing checks into their own function, so we can call
it independently of iterating through the nodelist.

Part of 34200.
And check that the correct flags are passed when choosing exits.

Adds the following checks for exits:
* must support EXTEND2 cells,
* must have an ntor circuit crypto key,
* can't require the guard flag,
* can't be a direct connection.

All these checks are already implied by other code.

Part of 34200.
Use the node check function to check that there are enough nodes to
select a circuit path.

Adds these checks, which are implied by other code:
* supports EXTEND2 cells,
* does not allow single-hop exits,

Adds these extra checks:
* has a general-purpose routerinfo,
* if it is a direct connection, check reachable addresses.
These checks reduce the node count, but they will never under-count
nodes.

Bridge nodes aren't handled correctly, we'll fix that in the next
commit.

Part of 34200.
When counting and choosing nodes on a client that uses bridges, only
choose bridges for direct connections.

Part of 34200.
Accept extra lines in nodelist and routerlist due to extra features, and
due to refactors that simplify some functions.

Most of the refactor eliminated duplicate code in smaller functions, so
there's only one large function that got smaller.

Part of 34200.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1434

  • 57 of 61 (93.44%) changed or added relevant lines in 4 files are covered.
  • 5 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.01%) to 64.333%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/feature/nodelist/node_select.c 18 20 90.0%
src/feature/nodelist/routerlist.c 27 29 93.1%
Files with Coverage Reduction New Missed Lines %
src/feature/nodelist/nodelist.c 2 70.73%
src/core/or/circuitbuild.c 3 53.63%
Totals Coverage Status
Change from base Build 1430: 0.01%
Covered Lines: 51062
Relevant Lines: 79371

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants