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

fix: address book guarantees no replicated entries are added #927

Conversation

vasco-santos
Copy link
Member

@vasco-santos vasco-santos commented Apr 26, 2021

Sometimes delegate nodes return replicated addresses and then we will try to dial repeated addresses.

cc @aschmahmann (this happened while finding closest peers to QmQ73f8hbM4hKwRYBqeUsPtiwfE2x6WPv9WnzaYt4nYcXf). Not sure if an old node, or wether go DHT guarantees no replicated addresses are returned.

@vasco-santos
Copy link
Member Author

vasco-santos commented Apr 26, 2021

Ok, this might be a consequence of same results in multiple delegates

@vasco-santos vasco-santos removed the request for review from achingbrain April 26, 2021 13:54
@vasco-santos
Copy link
Member Author

After further analysis, this is definitely the answer from the delegate nodes with replicated content. Take a few results:

QmQpqAyvhBwjQ9UfRi2Y9EcmaEDXwCCcWG52k3sXw7ZNPK 18 [
  '/ip6/::1/udp/4001/quic',
  '/ip4/151.248.220.127/tcp/7838',
  '/ip4/127.0.0.1/tcp/4001',
  '/ip4/127.0.0.1/udp/4001/quic',
  '/ip4/192.168.2.8/udp/4001/quic',
  '/ip4/151.248.220.127/tcp/4001',
  '/ip4/151.248.220.127/udp/1056/quic',
  '/ip4/192.168.2.8/tcp/4001',
  '/ip6/::1/tcp/4001',
  '/ip4/192.168.2.8/tcp/4001',
  '/ip4/127.0.0.1/udp/4001/quic',
  '/ip6/::1/tcp/4001',
  '/ip4/127.0.0.1/tcp/4001',
  '/ip6/::1/udp/4001/quic',
  '/ip4/151.248.220.127/tcp/7838',
  '/ip4/151.248.220.127/udp/1056/quic',
  '/ip4/192.168.2.8/udp/4001/quic',
  '/ip4/151.248.220.127/tcp/4001'
]

12D3KooWFhLvi1mVMj4psPUCK975wKu8RobFwqkw6T1dVFzSvGHo 12 [
  '/ip4/127.0.0.1/udp/4001/quic',
  '/ip6/::1/udp/4001/quic',
  '/ip4/114.111.0.37/tcp/4001',
  '/ip4/127.0.0.1/tcp/4001',
  '/ip6/::1/tcp/4001',
  '/ip4/114.111.0.37/udp/4001/quic',
  '/ip6/::1/udp/4001/quic',
  '/ip4/114.111.0.37/tcp/4001',
  '/ip4/127.0.0.1/tcp/4001',
  '/ip6/::1/tcp/4001',
  '/ip4/114.111.0.37/udp/4001/quic',
  '/ip4/127.0.0.1/udp/4001/quic'
]

12D3KooWR8rS8Nwyce7jBSZUwXqihZzbf1dsy5RMhmYyktcLCddm 8 [
  '/ip4/95.217.104.25/udp/4001/quic',
  '/ip4/95.217.104.25/tcp/4001',
  '/ip4/127.0.0.1/udp/4001/quic',
  '/ip4/127.0.0.1/tcp/4001',
  '/ip4/127.0.0.1/tcp/4001',
  '/ip4/127.0.0.1/udp/4001/quic',
  '/ip4/95.217.104.25/udp/4001/quic',
  '/ip4/95.217.104.25/tcp/4001'
]

The DHT queries return several replicated addresses using the HTTP endpoint. cc @aschmahmann

@vasco-santos
Copy link
Member Author

vasco-santos commented Apr 26, 2021

@achingbrain

Our solution for this at this point is to have the AddressBook API to validate there are no replicated addresses added. We previously only verified if we already had some of the given new addresses and only added the new ones. But, if the same .add / .set added the same addresses, they would both be stored and further on the dial flow attempted to be dialled. This solution also guarantees other discovery modules or human intervention does not lead to the same issue

@vasco-santos vasco-santos merged commit ac370fc into master Apr 27, 2021
@vasco-santos vasco-santos deleted the fix/address-book-guarantees-no-replicated-entries-are-added branch April 27, 2021 15:14
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