From 27aaca8cd72aa5baa4165f0c973c860c8e594279 Mon Sep 17 00:00:00 2001 From: dholms Date: Tue, 29 Oct 2024 16:44:50 -0500 Subject: [PATCH] fix handling of too big events --- packages/pds/src/sequencer/events.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/pds/src/sequencer/events.ts b/packages/pds/src/sequencer/events.ts index 29fe5f059b2..df9da952eec 100644 --- a/packages/pds/src/sequencer/events.ts +++ b/packages/pds/src/sequencer/events.ts @@ -26,7 +26,11 @@ export const formatSeqCommit = async ( if (writes.length > 200 || commitData.newBlocks.byteSize > 1000000) { tooBig = true const justRoot = new BlockMap() - justRoot.add(commitData.newBlocks.get(commitData.cid)) + const commitCid = commitData.cid + const commitBlock = commitData.newBlocks.get(commitCid) + if (commitBlock) { + justRoot.set(commitCid, commitBlock) + } carSlice = await blocksToCarFile(commitData.cid, justRoot) } else { tooBig = false