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

pin remote add: improve Peer hints in Pin.origins #7915

Closed
lidel opened this issue Feb 16, 2021 · 2 comments · Fixed by #8143
Closed

pin remote add: improve Peer hints in Pin.origins #7915

lidel opened this issue Feb 16, 2021 · 2 comments · Fixed by #8143
Labels
effort/hours Estimated to take one or several hours exp/novice Someone with a little familiarity can pick up good first issue Good issue for new contributors help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked topic/pinning Topic Pinning (local and remote)

Comments

@lidel
Copy link
Member

lidel commented Feb 16, 2021

go-ipfs 0.8.0-rc2 adds pin remote commands (details in #7559).

When a new remote pin is added via pin remote add Pin.origins array is populated with all multiaddrs of the local node.

Problem

This is a bit naive, because:

  • local node may not have the data
  • most of multiaddrs are LAN ones and not diallable from the outside (and if service is in LAN, then it does not need them, mdns/land DHT will do just fine)

Proposed improvements

  1. Check if pinned root CID is in local blockstore. If it is not, then send empty Pin.origins = []
    (local node is not origin, we are pinning some external CID, eg. when DAG is too big to fit on local laptop)
    CLI prior art:
    $ ipfs block stat --offline $cid
    Error: blockservice: key not found
  2. Filter out IP multiaddrs from loopback addres (https://golang.org/pkg/net/#IP.IsLoopback) and maybe networks designated as local/LAN/private: https://en.wikipedia.org/wiki/Private_network
@lidel lidel added kind/enhancement A net-new feature or improvement to an existing feature help wanted Seeking public contribution on this issue exp/novice Someone with a little familiarity can pick up status/ready Ready to be worked P2 Medium: Good to have, but can wait until someone steps up good first issue Good issue for new contributors effort/hours Estimated to take one or several hours topic/pinning Topic Pinning (local and remote) labels Feb 16, 2021
@bisakhmondal
Copy link

Hey @lidel, I want to give it a try, can I?
I suppose from a top-level look,
https://github.com/ipfs/go-ipfs/blob/cd72589cfd41a5397bb8fc9765392bca904b596a/core/commands/pin/remotepin.go#L176-L179
this need to be updated.
Thanks :)

@lidel
Copy link
Member Author

lidel commented May 5, 2021

@bisakhmondal yes, sounds about right.

I believe we should:

  • filter out loopback addres via IP.IsLoopback
  • filter out addrs that match denylist defined in config under NoAnnounce

This way people who want to use private networks, still can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/hours Estimated to take one or several hours exp/novice Someone with a little familiarity can pick up good first issue Good issue for new contributors help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked topic/pinning Topic Pinning (local and remote)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants