Skip to content
New issue

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

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

Already on GitHub? # to your account

How to cleanup ipfs dht findpeer QmBlah for my own node? #3561

Closed
wigy-opensource-developer opened this issue Jan 4, 2017 · 8 comments
Closed

Comments

@wigy-opensource-developer
Copy link

wigy-opensource-developer commented Jan 4, 2017

go-ipfs version: 0.4.5-dev-
Repo version: 4
System version: amd64/linux
Golang version: go1.7.3

Type:

Bug

Priority:

P2

Description:

I am using a laptop that moves between networks, so its public facing IPv4 address changes. Also, at least in Hungary, most of the ISPs ask extra money for static public IPv4 addresses, so even an always-on desktop is in a LAN that gets routed through different public IPv4 every day or week.

My IPFS node therefore gathered quite some addresses if you ask ipfs dht findpeer QmBlah or ipfs id QmBlah on another node (If you ask it on the same node, the first returns nothing after a loooong wait, the second returns the same data that ipfs id would, which excludes public IP addresses).

Is there a way to remove obsolete multiaddresses for a node from the DHT?

@Kubuxu
Copy link
Member

Kubuxu commented Jan 4, 2017

They will expire on their own. How many addresses you see there?

@wigy-opensource-developer
Copy link
Author

wigy-opensource-developer commented Jan 4, 2017

I see around 8-9 public IPv4 addresses. They seem to be causing delays in contents pinned only on this node. Also, I have the feeling that IPNS records that were published from this laptop are resolved slowly on other nodes.

How long are they on the DHT before they expire?

@Kubuxu
Copy link
Member

Kubuxu commented Jan 4, 2017

When all the nodes that have those peer infos will restart, we probably should have timeout on those.

@wigy-opensource-developer
Copy link
Author

So without any incentive system internal to IPFS for storing DHT records indefinitely, I see that reproviding content / republishing names / resharing peer infos every day makes complete sense (https://github.com/libp2p/go-libp2p-kad-dht/blob/master/records.go#L22).

I am still digging up the DHT code to find out where the stale addresses are reshared by the peers and will try to come up with a PR.

@Kubuxu
Copy link
Member

Kubuxu commented Jan 5, 2017

The peer info is a bit different form what I know, not sure though.

@whyrusleeping
Copy link
Member

The address factory work that @lgierth was doing should help with this.

@ghost
Copy link

ghost commented Sep 3, 2017

The work that'll actually fix this is properly signed peer routing records. Right now anyone can publish addresses for any peer. Instead, only the actual node should be able to publish addresses for itself, and it should attach a TTL.

I think that depends on IPRS?

The address factory work (Addresses.Announce and Addresses.NoAnnounce in go-ipfs config) won't solve the issue that all kinds of addresses for your node are floating across the network.

@Stebalien
Copy link
Member

This should actually be fixed now.

  1. We now push new addresses when they change.
  2. DHT nodes (once they upgrade to the next release) will replace their known addresses for a peer when receiving a new set instead of adding them.
  3. DHT queries only return information about directly connected peers (except for content routing but that information will expire pretty quickly).

All together, this should mostly fix this issue (although signed peer routing records are still something we need).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants