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

Predict peers most likely to have blocks #14

Closed
eingenito opened this issue Oct 16, 2018 · 4 comments
Closed

Predict peers most likely to have blocks #14

eingenito opened this issue Oct 16, 2018 · 4 comments
Assignees
Labels
kind/enhancement A net-new feature or improvement to an existing feature

Comments

@eingenito
Copy link

eingenito commented Oct 16, 2018

Problem
Right now we don't make the best use of information we have about our historical bitswap interactions with peers when devising a set of peers to ask for blocks.

PR #8 has some important background information particularly this comment.

Proposal
Add behavior to bitswap that tracks received blocks and the peers they came from, which can subsequently be queried for an (ordered?) set of peers deemed the best candidates to ask for a given block.

@eingenito eingenito added kind/enhancement A net-new feature or improvement to an existing feature needs refinement labels Oct 17, 2018
@eingenito
Copy link
Author

eingenito commented Oct 22, 2018

A more concrete implementation plan for this feature emerged from conversations at the go-ipfs hack week in London.

There's already some acceptance of this concept as a predictor service, driven by bitswap. Now there's a proposal that switches that relationship and places this logic between the DagService and bitswap (or other protocols, such as graphsync).

The new interface would be a peer of the SessionExchange, but for graphs. Both would roughly expose ask for x or []x where 'x' is currently CID for SessionExchange and would be a simplified set of graphsync expressions in the case of the new DagExchange (or GraphExchange?). They would drive fetchers which currently would just be bitswap and which would conceptually expose ask peer x for y[].

Here is a diagram from our discussion:

img_20181017_1402387

Our initial work would focus on first splitting bitswap so that it could be driven by different 'exchanges', and then implementing the new DAG oriented exchange on top of that lowest layer of bitswap that just fetches data.

@hannahhoward
Copy link
Contributor

hannahhoward commented Apr 30, 2019

@eingenito my feeling is this plan has been superceded by the ongoing work to improve sessions, and the emergence of Graphsync + go-ipld-prime as protocols. IOW, I think rather than try to build dag smarts into bitswap, we should just continue optimizing it as a block exchange protocol, and then utilize graphsync as it continues to evolve as the ideal dag exchange protocol. I am inclined to close this issue unless you think otherwise.

@ghost ghost removed the needs refinement label Apr 30, 2019
@eingenito
Copy link
Author

eingenito commented Apr 30, 2019

Agreed.

@Stebalien
Copy link
Member

Stebalien commented May 1, 2019

👍 This may be what you're saying but we could even have graphsync drive bitswap directly in the future (i.e., we ask for some subdag, a peer gives us most of it but tells us it doesn't have some set of nodes).

@momack2 momack2 added this to Done in ipfs/go-ipfs May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature
Projects
No open projects
Development

No branches or pull requests

3 participants