Skip to content

Implement Bitswap Transport #311

@hannahhoward

Description

@hannahhoward

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Icebox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions