Skip to content

Commit f0fcee5

Browse files
author
Alan Shaw
committed
fix: bump MAX_BLOCK_SIZE to 2MiB limit imposed by bitswap
Bitswap spec is being updated to clarify the 2MiB limit: ipfs/specs#269 go-ipfs chunker accepts a max size of 1MiB but protobuf wrapping can make it a bit bigger. Switching to 2MiB allows us to support blocks created using that max chunker size.
1 parent 459c4c1 commit f0fcee5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/api/src/routes/nfts-upload.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { JSONResponse } from '../utils/json-response.js'
1010
import { checkAuth } from '../utils/auth.js'
1111
import { toNFTResponse } from '../utils/db-transforms.js'
1212

13-
const MAX_BLOCK_SIZE = 1 << 20 // Maximum permitted block size in bytes (1MiB).
13+
const MAX_BLOCK_SIZE = 1 << 21 // Maximum permitted block size in bytes (2MiB).
1414
const decoders = [pb, raw, cbor]
1515

1616
/**
@@ -195,7 +195,7 @@ export async function nftUpdateUpload(event, ctx) {
195195
*
196196
* - Missing root CIDs
197197
* - >1 root CID
198-
* - Any block bigger than MAX_BLOCK_SIZE (1MiB)
198+
* - Any block bigger than MAX_BLOCK_SIZE (2MiB)
199199
* - 0 blocks
200200
* - Missing root block
201201
* - Missing non-root blocks (when root block has links)

0 commit comments

Comments
 (0)