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

Implement Bitswap Transport #311

Open
hannahhoward opened this issue Mar 25, 2022 · 0 comments
Open

Implement Bitswap Transport #311

hannahhoward opened this issue Mar 25, 2022 · 0 comments

Comments

@hannahhoward
Copy link
Collaborator

Goals

When #310 is complete, and we've implemented bitswap auth (ipfs/specs#270) & associated tickets, it's time to ship a go-bitswap transport for real (i.e. the working version of #284)

Basic strategy

  • go-data-transfer requests happen at the per peer DAG level (i.e. not block)
  • dag traversal is executed independently on the client -- - under the hood, the DAG is traversed by either go-merkledag or go-fetcher
    • most likely these libraries open a data-transfer per-peer
  • Bitswap itself should just send around a channel ID + data transfer codec
  • Actual messages are sent directly of the data transfer libp2p protocol
  • provider side - when incoming bitswap requests are received with a data transfer token, check for a channel existing, and accept or reject the request based on whether the channel exists and is valid + not passed it's data limit (just call OnDataQueued hook -- a response of Pause and/or error means don't send)
  • client side - when a bitswap block comes, record who it's from and call OnDataReceived.
  • probably need a new request message type for the bitswap client to signal "that's it, I'm not requesting any more for this data transfer" cause currently Graphsync is able to just tell data transfer this on the responder side as it understand the high level semantics of the request.
  • IMPORTANTLY: though the request happens at a DAG level, a data transfer for bitswap for a single peer will likely not account for all of the dag, as requests are split up over multiple peers. You pay for what actually gets sent.

Lots more to work out, but these are the outlines

@hannahhoward hannahhoward changed the title Support Multiple Transports, allows choosing per transfer Implement Bitswap Transport Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Icebox
Development

No branches or pull requests

1 participant