-
Notifications
You must be signed in to change notification settings - Fork 97
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] Proposal: Streaming GetBlocks #121
Comments
Two other variations on the streaming proposal above Per Block errorsReturn Streaming sessions-like requestsA more complex, but more featureful version would be if we could add/remove requests from the channel so that we don't have to spin up one goroutine per block-get (or batch of gets). Could be something like
I wrote some code for this in this experiment It was useful to me in being able to limit the number of goroutines in use while still being able to control fetching of data based on when new data is returned. The use case was incrementally verifiable downloading of large SHA2-256 blocks of data via Bitswap + manifests where the graph is effectively linear (i.e. miserably slow to download with Bitswap) but the manifest, despite being untrusted, could allow for much faster downloads by growing trust in it as it was proven to be correct as more data was downloaded and validated. While I hadn't utilized it for the associated demo, the |
At the moment, it's a bit tricky to continuously prefetch blocks as one needs to launch a goroutine per batch.
Proposal: Change the signature of
GetBlocks
to take an input channel and return an output channel:Additional elements:
go-blockservice.BlockGetter
interface should be replaced with theFetcher
interface.The output channel should have the same buffer as the input channel (I think?).error
return type is for indicating that the request couldn't even be started (e.g., closed service). This interface doesn't really have a way to report runtime errors (and there's almost always nothing we can do about them anyways).This will require changes to go-ipfs-exchange-interface, go-blockservice, and go-bitswap.
The text was updated successfully, but these errors were encountered: