From f3a75d8e7c971b4117aa23826dc7f1c6045766fc Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Mon, 1 Apr 2024 06:58:15 -0400 Subject: [PATCH 1/3] Change max block size for rooted splitter Reduce from 4MiB to 2MiB per Bitswap spec --- lib/rooted/root-node.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rooted/root-node.js b/lib/rooted/root-node.js index 7d42b84..e124067 100644 --- a/lib/rooted/root-node.js +++ b/lib/rooted/root-node.js @@ -5,7 +5,7 @@ import { Block } from 'multiformats/block' /** @typedef {['/carbites/1', CID[], CID[]]} RootNode */ -const MAX_SIZE = 1024 * 1024 * 4 +const MAX_SIZE = 1024 * 1024 * 2 /** * Make a carbites root node. Format: ['/carbites/1', roots, blocks] From 73fe19b249f852ba35479242162c04a4a27ec6e9 Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Mon, 1 Apr 2024 06:59:59 -0400 Subject: [PATCH 2/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e323862..83ecc16 100644 --- a/README.md +++ b/README.md @@ -231,7 +231,7 @@ The API is the same as for [`CarSplitter`](#class-carsplitter). The root node is a `dag-cbor` node that is a tuple of the string `/carbites/1`, an array of root CIDs (only seen in first CAR) and an array of block CIDs (all the blocks in the CAR). e.g. `['/carbites/1', ['bafkroot'], ['bafy1', 'bafy2']]`. -Note: The root node is limited to 4MB in size (the largest message IPFS will bitswap). Depending on the settings used to construct the DAG in the CAR, this may mean a split CAR size limit of around 30GiB. +Note: The root node is limited to 2MiB in size (the largest message IPFS will bitswap). Depending on the settings used to construct the DAG in the CAR, this may mean a split CAR size limit of around 15GiB. ### `class RootedCarJoiner` From 49f64565d308ceb74e38472f266fcaa2d6406f7e Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Mon, 1 Apr 2024 07:00:39 -0400 Subject: [PATCH 3/3] Update root-node.js --- lib/rooted/root-node.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rooted/root-node.js b/lib/rooted/root-node.js index e124067..fb41e90 100644 --- a/lib/rooted/root-node.js +++ b/lib/rooted/root-node.js @@ -18,7 +18,7 @@ export async function mkRootNode (roots, blocks) { const value = ['/carbites/1', Array.from(roots), Array.from(blocks)] const bytes = encode(value) // FIXME: Given a V1 CID of ~36 bytes and the default IPFS chunk size of - // 262,144 bytes you'd need to be splitting at 30GiB or more to experience + // 262,144 bytes you'd need to be splitting at 15GiB or more to experience // this error. if (bytes.length >= MAX_SIZE) { throw new Error('root node too big. The root node is bigger than 4MiB: the biggest message IPFS will bitswap. Split the CAR into smaller chunks.')