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

Nitpick: Maximum block size is poorly defined #4473

Open
icefoxen opened this issue Dec 8, 2017 · 2 comments
Open

Nitpick: Maximum block size is poorly defined #4473

icefoxen opened this issue Dec 8, 2017 · 2 comments

Comments

@icefoxen
Copy link

icefoxen commented Dec 8, 2017

Version information:

Git master as of commit 8b90b70

Type: Bug

Severity: medium/maybe low

Description: Maximum block size is platform dependent

As defined in the BlockStat struct, the size of a block is taken by the len() function, which returns an int. The size of this differs on different platforms; ie int32 on 32-bit machines, int64 on 64-bit machines. So, it's possible for a 64-bit machine to create a block that a 32-bit machine can't process.

@magik6k
Copy link
Member

magik6k commented Dec 8, 2017

For most purposes maximum block size will be 4MB - (size of bitswap header), this is due to message size limit in libp2p, which is there mostly for security reasons.

https://github.com/libp2p/go-libp2p-net/blob/master/interface.go#L20

But yeah, this info should be easier to find.

@Stebalien
Copy link
Member

Note: In theory, you can define arbitrarily large blocks. You just won't be able to bitswap them (and IPFS may fall over at some point).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants