From d9889745f52c2e13b0d011bfd9ab98c59f41f06b Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Thu, 21 Sep 2023 17:21:59 +0200 Subject: [PATCH] fix: correctly persist states based on configured epoch frequency --- packages/beacon-node/src/chain/archiver/archiveStates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/beacon-node/src/chain/archiver/archiveStates.ts b/packages/beacon-node/src/chain/archiver/archiveStates.ts index 98b083b0513d..e3ff48b02355 100644 --- a/packages/beacon-node/src/chain/archiver/archiveStates.ts +++ b/packages/beacon-node/src/chain/archiver/archiveStates.ts @@ -49,7 +49,7 @@ export class StatesArchiver { const lastStoredEpoch = computeEpochAtSlot(lastStoredSlot ?? 0); const {archiveStateEpochFrequency} = this.opts; - if (finalized.epoch - lastStoredEpoch > Math.min(PERSIST_TEMP_STATE_EVERY_EPOCHS, archiveStateEpochFrequency)) { + if (finalized.epoch - lastStoredEpoch >= Math.min(PERSIST_TEMP_STATE_EVERY_EPOCHS, archiveStateEpochFrequency)) { await this.archiveState(finalized); // Only check the current and previous intervals