Skip to content

Conversation

@charlescharles
Copy link

http://www.bittorrent.org/beps/bep_0042.html. this PR is just for review; it's definitely not complete.

some stuff to sort out:

  • setting the DHT node ID: it seems like socket.createSocket happens async and calling socket.address() in the constructor causes an exception. setting the node ID in socket.on 'listening' is problematic because other stuff like _debug also uses nodeId. is there another way to get the address?
  • what to do when we think our node ID may be incorrect -- e.g., you receive messages with ip field different from you think yours is -- libtorrent doesn't seem to do anything about this
  • what else to do if we see nodes with invalid node ids -- right now it just refrains from adding the node to the routing table.

@feross

/**
* Add a DHT node to the routing table.
* Add a DHT node to the routing table unless the nodeID doesn't match
* their address and we're enforcing nodeID security.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you read the enforcement section of BEP42 you will notice that it only mentions lookups, not routing table maintenance.

I.e. as written it does not to exclude nodes from the overlay itself, only ignores them as store-targets to avoid eclipse attacks.

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.

2 participants