You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As we look ahead to integrating bitswap as a transport protocol in Filecoin, we often encounter situations where we want to direct wants from a certain set of requests to a specific blockstore other than the default (for example, if we're working with a DAG store, we're writing seperate CAR files for different DAGs).
We might also encounter a situation where we want to put blocks into a temporary store for a given session if we haven't yet verified them as part of a DAG the end user actually requested. (see protocol/beyond-bitswap#25 for example)
I think the solution here is to allow us to optionally specify a different destination blockstore when we create a session.
Suggested Implementation
My read of the code is that the SessionInterestManager makes it relatively easily to determine what sessions requested which blocks.
My suggestion is when a block is received, we determine what sessions wanted it, and what custom blockstores (if any) it goes into, and write it once to each of these. We write to the default once for all sessions that don't specify a custom blockstore.
Moreover, I further suggest at least for the first version that we avoid both making the block available to for Bitswap wants and announcing it over the DHT UNLESS it's in the default store. (responding to wants over multiple blockstores seems complicated)
The text was updated successfully, but these errors were encountered:
Goals
As we look ahead to integrating bitswap as a transport protocol in Filecoin, we often encounter situations where we want to direct wants from a certain set of requests to a specific blockstore other than the default (for example, if we're working with a DAG store, we're writing seperate CAR files for different DAGs).
We might also encounter a situation where we want to put blocks into a temporary store for a given session if we haven't yet verified them as part of a DAG the end user actually requested. (see protocol/beyond-bitswap#25 for example)
I think the solution here is to allow us to optionally specify a different destination blockstore when we create a session.
Suggested Implementation
My read of the code is that the SessionInterestManager makes it relatively easily to determine what sessions requested which blocks.
Blocks are received here: https://github.com/ipfs/go-bitswap/blob/44495c489844359d0eaef6d37ca620bff0341ab9/bitswap.go#L469)
My suggestion is when a block is received, we determine what sessions wanted it, and what custom blockstores (if any) it goes into, and write it once to each of these. We write to the default once for all sessions that don't specify a custom blockstore.
Moreover, I further suggest at least for the first version that we avoid both making the block available to for Bitswap wants and announcing it over the DHT UNLESS it's in the default store. (responding to wants over multiple blockstores seems complicated)
The text was updated successfully, but these errors were encountered: