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

Forbid putting blocks over 2MiB in the blockstore #7021

Open
Stebalien opened this issue Mar 20, 2020 · 3 comments
Open

Forbid putting blocks over 2MiB in the blockstore #7021

Stebalien opened this issue Mar 20, 2020 · 3 comments
Labels
kind/enhancement A net-new feature or improvement to an existing feature

Comments

@Stebalien
Copy link
Member

Stebalien commented Mar 20, 2020

While potentially useful, our transports won't accept blocks of this size. If we allow users to add them to their datastore, they'll run into hard to debug issues where we won't actually transfer the files.

I believe I was thinking about banning this in the go-ipfs block API (and the add options) instead of at the blockstore level itself. This limitation is a side effect of the IPFS protocol as it exists today, not necessarily IPLD itself.

While I'd prefer not to add this blanket restriction to the default blockstore, it might make sense to implement it as a wrapper. That would make it easy for applications to specify a size policy without enforcing a default policy (alternatively, it can just be added as an optional/configurable limit to the default blockstore.

@Stebalien Stebalien added the kind/enhancement A net-new feature or improvement to an existing feature label Mar 20, 2020
@Stebalien
Copy link
Member Author

Note: We can lift this restriction later if/when we add transports that can transfer larger blocks. This is a restriction on what we allow now for current protocols and use-cases.

@aschmahmann
Copy link
Contributor

aschmahmann commented Jan 17, 2022

@gammazero @Stebalien was the reason why ipfs/go-ipfs-blockstore#61 wasn't accepted because we wanted it to be configurable/not in the default blockstore?

While I'd prefer not to add this blanket restriction to the default blockstore, it might make sense to implement it as a wrapper. That would make it easy for applications to specify a size policy without enforcing a default policy (alternatively, it can just be added as an optional/configurable limit to the default blockstore.

Are we good with just having a blockstore wrapper in go-ipfs that errors on Put or PutMany if the block size exceeds 2MiB?

@ribasushi
Copy link
Contributor

Are we good with just having a blockstore wrapper in go-ipfs that errors on Put or PutMany if the block size exceeds 2MiB?

I am totally good with that.

I objected to adding it to the core interface, as limiting the IPLD world by libp2p limitations is not the right way forward. I should be able to put together an http-speaking app, and use go-ipfs-blockstore to keep track of 1TiB "blocks".

Having a limitation in a libp2p-speaking app ( go-ipfs ) is totally fair game, an expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants