From a142bbd005af561187d48588c4ce50fb59e25de1 Mon Sep 17 00:00:00 2001 From: kyscott18 <43524469+kyscott18@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:18:47 -0500 Subject: [PATCH] fix: reorg bug (#1250) * fix: reorg bug * chore: changeset --- .changeset/nine-dolls-run.md | 5 +++++ packages/core/src/bin/utils/run.ts | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/nine-dolls-run.md diff --git a/.changeset/nine-dolls-run.md b/.changeset/nine-dolls-run.md new file mode 100644 index 000000000..f0f505278 --- /dev/null +++ b/.changeset/nine-dolls-run.md @@ -0,0 +1,5 @@ +--- +"@ponder/core": patch +--- + +Fixed a bug in reorg reconciliation logic. diff --git a/packages/core/src/bin/utils/run.ts b/packages/core/src/bin/utils/run.ts index 0cd15584d..48e3945fc 100644 --- a/packages/core/src/bin/utils/run.ts +++ b/packages/core/src/bin/utils/run.ts @@ -103,7 +103,9 @@ export async function run({ break; } case "reorg": + await database.removeTriggers(); await database.revert({ checkpoint: event.checkpoint }); + await database.createTriggers(); break;