Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Blocks used internally by pinner are provided to network by bitswap #2179

Closed
dirkmc opened this issue Jun 13, 2019 · 6 comments
Closed

Blocks used internally by pinner are provided to network by bitswap #2179

dirkmc opened this issue Jun 13, 2019 · 6 comments
Assignees
Labels
exp/expert Having worked on the specific codebase is important kind/bug A bug in existing code (including security flaws) kind/wontfix-migration-available status/in-progress In progress

Comments

@dirkmc
Copy link
Contributor

dirkmc commented Jun 13, 2019

Problem

The pinner uses the BlockStore to store the sets of direct and recursive pins.
At the moment any block put to the BlockStore is sent to Bitswap, so these internal blocks are being unnecessarily provided to the network.

In the code we

Solution

I suggest we

  • create an offline IPLD instance, which only talks to the local BlockService (not to Bitswap)
  • create an offline dag component, which uses the offline IPLD instance
  • in the pinner use the offline dag component
@dirkmc
Copy link
Contributor Author

dirkmc commented Jun 13, 2019

@vasco-santos @alanshaw please let me know your thoughts about this approach

@vasco-santos
Copy link
Member

Hey @dirkmc

I have been thinking after our conversation today, and despite not liking the solution of having 2 instances of ipld, I am not seeing a nice design for this, as ipld should be agnostic from the network perspective, and an option for not providing is odd. In this way, I would go with that proposal for now

@dirkmc
Copy link
Contributor Author

dirkmc commented Jun 14, 2019

Thanks @vasco-santos

The go implementation creates the second instance of ipld in a context where it can only be used by the pinner, so maybe it would make sense for us to do the same thing.

@dirkmc
Copy link
Contributor Author

dirkmc commented Jun 24, 2019

Just making a note here that @alanshaw suggested we should make sure there aren't any issues with locking or memory usage. In particular check that when IPLD lazy loads formats, it doesn't unnecessarily load formats twice.

@alanshaw alanshaw added kind/bug A bug in existing code (including security flaws) exp/expert Having worked on the specific codebase is important status/ready Ready to be worked labels Jul 11, 2019
@alanshaw alanshaw added status/in-progress In progress and removed status/ready Ready to be worked labels Jul 11, 2019
@dirkmc
Copy link
Contributor Author

dirkmc commented Jul 11, 2019

Fixed by #2196

@SgtPooki
Copy link
Member

js-ipfs is being deprecated in favor of Helia. You can learn more about this deprecation and read the migration guide.

Please feel to reopen with any comments by 2023-06-02. We will do a final pass on reopened issues afterwards (see #4336).

This issue is most likely resolved in Helia, please try it out!

@github-project-automation github-project-automation bot moved this from 🥞 Todo to ✅ Done in js-ipfs deprecation May 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important kind/bug A bug in existing code (including security flaws) kind/wontfix-migration-available status/in-progress In progress
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants