storj-archived / core

Deprecated. Implementation of the Storj v2 protocol for Node.js.
https://storj.io
Other
395 stars 88 forks source link

Bridge contact list not updated #692

Closed littleskunk closed 7 years ago

littleskunk commented 7 years ago

Package Versions

Replace the values below using the output from npm list storj-bridge.

GUI 5.0.0
Daemon 2.5.2
Core 6.4.2
Protocol 1.1.0
info    
title   "Storj Bridge"
version "5.14.0"
description "Access the Storj network using a simple REST API."
x-protocol-version  "1.1.0"
x-core-version  "6.4.2"

Replace the values below using the output from node --version.

v6.10.2

Expected Behavior

Please describe the program's expected behavior. Include an example of your usage code in the back ticks below if applicable.

Farmer was connected with a tunnel connection. He fixed that problem and is now using UPnP. Farmer is online for more than one hour now. Port check shows an open port. Logfile shows communication with the bridge.

A few examples:

{"level":"warn","message":"you are not publicly reachable, trying traversal strategies...","timestamp":"2017-05-03T09:36:43.500Z"}
{"level":"info","message":"successfully traversed NAT via UPnP: 195.211.136.9:28268","timestamp":"2017-05-03T09:36:43.584Z"}
{"level":"info","message":"node bound and port mapped: 28268","timestamp":"2017-05-03T09:36:43.584Z"}
{"level":"info","message":"node created with nodeID 967e01f547a466bc1fb3d4f3ecb82f5548c7a0bf","timestamp":"2017-05-03T09:36:43.589Z"}
{"level":"info","message":"clock is synchronized with ntp, delta: 296 ms","timestamp":"2017-05-03T09:36:43.606Z"}
[...]
{"level":"info","message":"sending FIND_NODE message to {\"userAgent\":\"6.4.1\",\"protocol\":\"1.1.0\",\"hdKey\":\"xpub6AHweYHAxk1EhJSBctQD1nLWPog6Sy2eTpKQLExR1hfzTyyZQWvU4EYNXv1NJN7GpLYXnDLt4PzN874g6zSjAQdFCHZN7U7nbYKYVDUzD42\",\"hdIndex\":13316789,\"address\":\"104.196.51.2\",\"port\":8472,\"nodeID\":\"8e102ca4b55f1ff6e26dd9db2f65f45e39ee7043\",\"lastSeen\":1493803834217}","timestamp":"2017-05-03T09:37:13.547Z"}
{"level":"info","message":"received valid message from {\"userAgent\":\"6.4.1\",\"protocol\":\"1.1.0\",\"hdKey\":\"xpub6AHweYHAxk1EhJSBctQD1nLWPog6Sy2eTpKQLExR1hfzTyyZQWvU4EYNXv1NJN7GpLYXnDLt4PzN874g6zSjAQdFCHZN7U7nbYKYVDUzD42\",\"hdIndex\":13316789,\"address\":\"104.196.51.2\",\"port\":8472,\"nodeID\":\"8e102ca4b55f1ff6e26dd9db2f65f45e39ee7043\",\"lastSeen\":1493575472129}","timestamp":"2017-05-03T09:37:14.349Z"}
[...]
{"level":"info","message":"sending OFFER message to {\"userAgent\":\"6.4.1\",\"protocol\":\"1.1.0\",\"hdKey\":\"xpub6AHweYHAxk1EhJSBctQD1nLWPog6Sy2eTpKQLExR1hfzTyyZQWvU4EYNXv1NJN7GpLYXnDLt4PzN874g6zSjAQdFCHZN7U7nbYKYVDUzD42\",\"hdIndex\":14338782,\"address\":\"104.196.137.222\",\"port\":8470,\"nodeID\":\"9789965a1bd33f1f1d618d66ffb61b00bde0aad7\",\"lastSeen\":1493804234897}","timestamp":"2017-05-03T09:45:10.134Z"}
{"level":"info","message":"received valid message from {\"userAgent\":\"6.4.1\",\"protocol\":\"1.1.0\",\"hdKey\":\"xpub6AHweYHAxk1EhJSBctQD1nLWPog6Sy2eTpKQLExR1hfzTyyZQWvU4EYNXv1NJN7GpLYXnDLt4PzN874g6zSjAQdFCHZN7U7nbYKYVDUzD42\",\"hdIndex\":14338782,\"address\":\"104.196.137.222\",\"port\":8470,\"nodeID\":\"9789965a1bd33f1f1d618d66ffb61b00bde0aad7\",\"lastSeen\":1493439486145}","timestamp":"2017-05-03T09:45:10.548Z"}

Bridge should notice him as online farmer and list his new IP and port.

Actual Behavior

Please describe the program's actual behavior. Please include any stack traces or log output in the back ticks below.

The bridge doesn't update the information. He is listed as offline farmer.

lastSeen    "2017-05-03T07:39:42.547Z"
port    15084
address "client021.storj.dk"
userAgent   "6.3.2"
protocol    "1.1.0"
lastTimeout "2017-05-03T09:45:02.615Z"
responseTime    15946.088361004064
timeoutRate 0.04352332175925926
nodeID  "967e01f547a466bc1fb3d4f3ecb82f5548c7a0bf"

Steps to Reproduce

Please include the steps the reproduce the issue, numbered below. Include as much detail as possible.

  1. Setup new farmer and use a tunnel connect
  2. Restart farmer with UPnP or public IP
  3. Take a look at api.storj.io/contacts
littleskunk commented 7 years ago

It looks like we have a big problem here. Renter are not able to upload but the farmer repeats sending OFFER. I guess because the bridge is sending wrong contact information to the renter.

littleskunk commented 7 years ago

The contact list is only updated on responseTime update: https://github.com/Storj/complex/blob/8a5f8f7a2389f2828ea6c9c2041ee1e4471e9466/lib/landlord.js#L249

tacticalchihuahua commented 7 years ago

Nah, we update it every time a contact is added or shifted in the routing table too: https://github.com/Storj/complex/blob/8a5f8f7a2389f2828ea6c9c2041ee1e4471e9466/lib/renter.js#L300

tacticalchihuahua commented 7 years ago

In any case, this is specific to bridge/complex, so let's close it here.

littleskunk commented 7 years ago

The bridge issue was redirected to core and closed: https://github.com/Storj/bridge/issues/438 Last try: https://github.com/Storj/complex/issues/54

tacticalchihuahua commented 7 years ago

We will leave it there. There have been no changes to how this works in the version of kad that core is using.