hoprnet / hopr-core

Main repository of HOPR - this is all you need to run a node on the HOPR network!
https://hoprnet.org
GNU General Public License v3.0
14 stars 5 forks source link

Reconnecting a node using the same identity but a different IP will make operations throw multiple errors. #104

Closed 0xjjpa closed 4 years ago

0xjjpa commented 4 years ago

Describe the bug In short, whenever we change networks (e.g. from wifi -A- to mobile hotspot -B-) and we reuse the same identity (i.e. we rerun our application with the same database), we broadcast the same identity but over a different IP, making the bootstrap route the connection to a node that is no longer available (i.e. A is dead, as now we are B). This will cause,

To Reproduce Steps to reproduce the behavior:

  1. Make sure you have the system on a development setup enabled (i.e. yarn and yarn build inside the chat folder already ran).
  2. Run yarn start:alice under chat on a computer using wifi A (let's call this combination alice-A), crawl and send messages.
  3. Reconnect with alice (same db, do not delete), but now on a new wifi or mobile hot spot B
  4. When alice-B connects and tries to send messages, those messages will fail and pollute the network.

Expected behavior alice-A is now dropped from the DHT and alice-B is readded. alice-B can execute normal operations without failure nor network pollution (i.e. error messages show up in other nodes’ console).

Screenshots What alice-B sees: image.png

What other nodes might see: image.png

Environment (please complete the following information):

Both alice-B and other Nodes

Chat Version: 1.0.1-refactor.974dafd
Core Version: 0.6.11-dev.4f49324
Core Ethereum Version: 0.0.12-refactor.473415f
Utils Version: 0.1.6-refactor.61df948
Connector Version: 1.2.10-98e08f8

Bootstrap Servers: /ip4/34.65.177.154/tcp/9091/p2p/16Uiu2HAmBJKpxH5ahxA2HqpbjG2tVb3vf2UospNyPYoYHCdXc6Tv