Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Pin/Unpin peer addresses #117

Closed
wants to merge 2 commits into from
Closed

Conversation

aarshkshah1992
Copy link
Contributor

@raulk

For libp2p/go-libp2p-kad-dht#283.
See theaddress management section in this comment for the rationale.

Copy link
Member

@raulk raulk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are various complex concerns with this solution:

  • Peers don’t expire, individual addresses expire.
  • Address decay is how we maintain an ever-changing set of addresses for a peer.
  • Addresses not reported/observed recently will expire, while the recent ones will be bumped up.
  • Does pinning prevent all addresses from expiring? Then we could be left with stale addresses, as the above decay wouldn’t have had a chance to expire them.
  • If anything, this should be “best effort”. We can’t afford for buggy callers that do not call Unpin properly to cause garbage to accumulate.
  • Pin/Unpin would need to do reference counting. What if two components call Pin, and only one calls Unpin?

@aarshkshah1992
Copy link
Contributor Author

We have an issue open to rethink our peerstore design to solve nasty problems such as this one:

libp2p/specs#164

@jacobheun
Copy link

I'm going to close this since it's from February.

@jacobheun jacobheun closed this Nov 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants