From eda743b277ec32c07d6363932ad46bcd5ddab632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wiktor=20Tkaczy=C5=84ski?= Date: Tue, 23 Jan 2024 14:53:12 +0100 Subject: [PATCH] fix: select checkpoint blocks by distinct If there are multiple contracts checkpointed at same block, this block can then be processed multiple times causing issues. --- src/stores/checkpoints.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stores/checkpoints.ts b/src/stores/checkpoints.ts index ad7b843..116d8ec 100644 --- a/src/stores/checkpoints.ts +++ b/src/stores/checkpoints.ts @@ -233,7 +233,7 @@ export class CheckpointsStore { limit = 15 ): Promise { const result = await this.knex - .select(Fields.Checkpoints.BlockNumber) + .distinct(Fields.Checkpoints.BlockNumber) .from(Table.Checkpoints) .where(Fields.Checkpoints.BlockNumber, '>=', block) .whereIn(Fields.Checkpoints.ContractAddress, contracts)