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

[ipfs/go-bitswap] Per session blockstores for received blocks #76

Open
Tracked by #6
hannahhoward opened this issue Mar 29, 2022 · 0 comments
Open
Tracked by #6

[ipfs/go-bitswap] Per session blockstores for received blocks #76

hannahhoward opened this issue Mar 29, 2022 · 0 comments
Labels
need/triage Needs initial labeling and prioritization

Comments

@hannahhoward
Copy link
Contributor

hannahhoward commented Mar 29, 2022

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)

@hannahhoward hannahhoward added the need/triage Needs initial labeling and prioritization label Mar 29, 2022
@Jorropo Jorropo changed the title Per session blockstores for received blocks [ipfs/go-bitswap] Per session blockstores for received blocks Jan 27, 2023
@Jorropo Jorropo transferred this issue from ipfs/go-bitswap Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

1 participant