Skip to content

Commit 9f2252f

Browse files
committed
fix: update soft block limit to 2MiB
This is needed because the 1MiB limit is the chunker limit, however the actual blocks can be wrapped in protobuf which adds a small ~10 byte overhead.
1 parent 53299e8 commit 9f2252f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/commands/cmdutils/utils.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
const (
1313
AllowBigBlockOptionName = "allow-big-block"
14-
SoftBlockLimit = 1024 * 1024 // https://github.com/ipfs/go-ipfs/issues/7421#issuecomment-910833499
14+
SoftBlockLimit = 1024 * 1024 * 2 // https://github.com/web3-storage/web3.storage/pull/1269#issuecomment-1108834504
1515
)
1616

1717
var AllowBigBlockOption cmds.Option
@@ -44,7 +44,7 @@ func CheckBlockSize(req *cmds.Request, size uint64) error {
4444
// when transmitting them over BitSwap. The 1 MiB constant is an
4545
// unenforced and undeclared rule of thumb hard-coded here.
4646
if size > SoftBlockLimit {
47-
return fmt.Errorf("produced block is over 1MiB: big blocks can't be exchanged with other peers. consider using UnixFS for automatic chunking of bigger files, or pass --allow-big-block to override")
47+
return fmt.Errorf("produced block is over 2MiB: big blocks can't be exchanged with other peers. consider using UnixFS for automatic chunking of bigger files, or pass --allow-big-block to override")
4848
}
4949
return nil
5050

0 commit comments

Comments
 (0)