Skip to content

Commit af1fd37

Browse files
committed
fix chunk lengths in shard
1 parent 71d4fff commit af1fd37

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/hub/src/utils/uploadShards.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,11 @@ export async function* uploadShards(
119119
for (const chunk of output.chunks) {
120120
writeHashToArray(chunk.hash, xorbInfoSection, xorbViewOffset);
121121
xorbViewOffset += HASH_LENGTH;
122+
// start offset
122123
xorbView.setUint32(xorbViewOffset, chunkBytes, true);
123124
xorbViewOffset += 4;
124-
xorbView.setUint32(xorbViewOffset, chunkBytes + chunk.length, true);
125+
// chunk length
126+
xorbView.setUint32(xorbViewOffset, chunk.length, true);
125127
xorbViewOffset += 4;
126128
xorbView.setBigUint64(xorbViewOffset, 0n, true); // reserved
127129
xorbViewOffset += 8;

0 commit comments

Comments
 (0)