-
Notifications
You must be signed in to change notification settings - Fork 102
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
[ipfs/go-bitswap] Integration between Graphsync and IPFS #85
Comments
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
This statement doesn't make a lot of sense. I assume you're referring to some form of meta exchange that can use both the bitswap protocol and graphsync?
This could use a lot of motivation. I'd expect the flow to be:
Of course, I might want additional information before I bother to make a connection. For example:
But then I'd expect the record to look more like:
Eventually, "queries" could be extended to select things like "supports graphsync but charges less than X". |
This is how things work today. We'd like to generalize this significantly. A source for a CID's content need not be a peer at all. For instance, it could be a legacy FTP service at a given IP, or a Bittorrent link (which doesn't even refer to a specific host). A routing expression can describe any such method.
Since discoverable sources for a CID may be heterogenous (e.g. a peer using bitswap, filecoin miner using graphsync, github repo at a given commit, etc), each CID is associated with a list of routing expressions, each of which describes some individual source. This is in contrast to having a single CID record (as the one above) that tries to describe all sources. |
Ah, I see. Yeah, that makes a lot of sense. So we'd have an engine on-top-of-bitswap handling the generalized content routing records, passing information into each protocol.
Makes sense. |
My recommendation is to do ipfs/go-bitswap#512 to abstract the content routing source, add the ability to talk to indexers once they exist, and stop till we understand the direction we're heading. As I see it, there are two paths to Golden Path in IPFS:
So my take is: do the part that is needed for either approach and stop. There's no progress to be made for real until miner indexes actually exist anyway. Especially if we do the great Web3 future data transfer stack refactor, we need a wide set of folks working on it. If we want to do something further, I would allocate a team of folks with deep experience in our data transfer protocols and content routing to do planning for how to actually refactor our libraries top to bottom to deliver on the needs for mixing filecoin and IPFS. This would at least help us determine how much work we're actually talking about, and when we could realistically deliver it. |
Definitely one-of-a-kind, I found this blog to be extremely helpful. Continue your fantastic work. |
The goal is to enable bitswap to support different methods of fetching a block,
so that it can access non-bitswap sources like filecoin nodes which may use
graphsync (via https://github.com/filecoin-project/go-data-transfer) and eventually
other payment-based methods.
Fundamentally, Bitswap brokers information about which peers have a cid.
This is captured in the form (cid, peer_id). It is implied that the method of
fetching is the bitswap transfer protocol.
To generalize Bitswap, we need to change the information that is associated with a cid.
For each cid, we would like to keep track of multiple "routing expressions" each of which
describes a different method to fetch the block.
Routing expressions are expressions in the routing language syntax, which represent
valid descriptions of methods to fetch a block, according to the existing Routing Language Spec.
For instance,
or
In essence, the routing information brokered should be of the form (cid, list of routing expressions).
This entails changes to every part of bitswap that touches routing information (for cids):
The first (of two) entry points of new routing information is access to the DHT,
which is abstracted behind the interface ProviderFinder. This interface has to be
generalized accodingly, essentially to match the generic composable routing interface.
This interface should also be moved to go-composable-routing repo (it does not belong in bitswap).
as middleware between bitswap and making routing calls to the DHT, which
adds throttling, dedup, batching. ProviderQueryManager must be:
The second (of two) entrypoints of new routing information is reception of "have" messages
from the bitswap gossip protocol. On reception, the "have" information must be converted into
a routing expression, so that it can be treated in the same manner as other routing information
downstream.
The logic that reacts to new routing informatoin must also be updated.
At the moment the only routing information that enters bitswap is "have" information,
and it is acted on immediately by firing/queuing respective "want" requests.
Going forward, routing information that corresponds to "have" messages can be treated as before.
However, we need to decide how to schedule fetching from non-bitswap sources (like filecoin/graphsync)
and generally how to prioritize/parallelize fetching from different sources (bitswap and non-bitswap).
Remarks
This is an absolute minimum plan to enable the integration. Going forward, a lot of additions can be made to improve the scale and speed of the routing process in bitswap. E.g. the "have" messages can be generalized to communicate multiple sources for a block, so that peers can share with each other knowledge about where else the block can be downloaded. E.g. "I have the block, but I also know that this filecoin miner has the block you want too, and they also have the entire directory where the block lives."
Related
IPFS / Filecoin interop plan: https://hackmd.io/JoZiAAtnTpqAKuQaEUra4g
PRs comprising the resolution of this issue
Step 1: ipfs/go-bitswap#512
Follow-up tasks
After this issue is resolved, the following (smaller) issues must be addressed before IPFS is fully ready to talk to the Golden Path product: ipfs/go-bitswap#509, https://github.com/ipfs/go-bitswap/issues/510
The text was updated successfully, but these errors were encountered: