diff --git a/packages/core/src/sync/index.ts b/packages/core/src/sync/index.ts index 39820a496..6172dbc63 100644 --- a/packages/core/src/sync/index.ts +++ b/packages/core/src/sync/index.ts @@ -778,9 +778,13 @@ export const createSync = async (args: CreateSyncParameters): Promise => { localSyncContext.get(network)!.unfinalizedEventData = unfinalizedEventData.filter( (led) => - hexToNumber(led.block.number) < hexToNumber(event.block.number), + hexToNumber(led.block.number) <= hexToNumber(event.block.number), ); + unindexedEvents = unindexedEvents.filter( + (event) => event.checkpoint <= checkpoint, + ); + await args.syncStore.pruneRpcRequestResult({ blocks: event.reorgedBlocks, chainId: network.chainId,