Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor conditions to add a contact to the routing table #1211

Merged
merged 79 commits into from
Jun 7, 2018

Conversation

jackrobison
Copy link
Member

@jackrobison jackrobison commented May 21, 2018

  • changed the bucket splitting condition in the dht routing table to be more aggressive (https://stackoverflow.com/a/32187456)

  • ping dht nodes who have stored to us periodically to determine whether we should include them as an active peer for the hash when we are queried. Nodes that are known to be not reachable by the node storing the record are no longer returned as peers by the storing node.

  • temporarily disabled data price negotiation, treat all data as free

  • changed dht bootstrap join process to better populate the routing table initially

  • cache dht node tokens used during announcement to minimize the number of requests that are needed

  • implement BEP0005 dht rules to classify nodes as good, bad, or unknown and for when to add them to the routing table (http://www.bittorrent.org/beps/bep_0005.html)

  • refactored internal dht contact class to track failure counts/times, the time the contact last replied to us, and the time the node last requested something fom us

  • refactored dht iterativeFind

  • sort dht contacts returned by findCloseNodes in the routing table

  • disabled Cryptonator price feed

  • added functional tests for bootstrapping the dht, announcing and expiring hashes, finding and pinging nodes, protocol version 0/1 backwards/forwards compatibility, and rejoining the network

  • added protocol version to dht requests and to the response from findValue

  • added port field to contacts returned by routing_table_get

@jackrobison jackrobison force-pushed the fix-dht-contact branch 2 times, most recently from 9dbe19a to 05c96e4 Compare May 23, 2018 22:40
@tzarebczan
Copy link
Contributor

@jackrobison you are reviewing this with @lyoshenka correct?

@lbry-bot lbry-bot assigned shyba, eukreign and lyoshenka and unassigned jackrobison May 29, 2018
@jackrobison jackrobison changed the title Refactor conditions to add a contact to the routing table (WIP) Refactor conditions to add a contact to the routing table May 29, 2018
@jackrobison jackrobison force-pushed the fix-dht-contact branch 4 times, most recently from f0f3958 to 745631c Compare June 4, 2018 12:30
@jackrobison jackrobison force-pushed the fix-dht-contact branch 3 times, most recently from c7c8af7 to e3c14d4 Compare June 7, 2018 18:31
-add cached `token` to Contact objects to minimize findValue requests
-remove self_store, always store to remote contacts even if we're the closest known node to the hash
-move the store call and error handling from announceHaveBlob to a smaller function of its own
-lower rpc timeout to what it originally was
-fire the first iteration right away
this fixes an incorrectly raised mapping conflict error which the router raises when there is a redirect for the same internal port and a different lan address.
@jackrobison jackrobison merged commit 665c73c into master Jun 7, 2018
@lyoshenka lyoshenka deleted the fix-dht-contact branch June 18, 2018 13:40
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.

5 participants