From 66ff43115cbb07a4a42be2cc5778877e69a49405 Mon Sep 17 00:00:00 2001 From: chessai Date: Thu, 30 May 2024 13:22:41 -0500 Subject: [PATCH] don't prune cuts at startup Change-Id: I82e10ee63220a2d1524c973992dc4e47e0a45f30 --- changes/2024-05-30T141646-0500.txt | 1 + src/Chainweb/CutDB.hs | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) create mode 100644 changes/2024-05-30T141646-0500.txt diff --git a/changes/2024-05-30T141646-0500.txt b/changes/2024-05-30T141646-0500.txt new file mode 100644 index 0000000000..e8eb427fda --- /dev/null +++ b/changes/2024-05-30T141646-0500.txt @@ -0,0 +1 @@ +Don't prune cuts on startup. This avoids a race condition where we prune cuts on startup, and we don't write a cut before shutting down. diff --git a/src/Chainweb/CutDB.hs b/src/Chainweb/CutDB.hs index ea74dec474..c76f6c32b7 100644 --- a/src/Chainweb/CutDB.hs +++ b/src/Chainweb/CutDB.hs @@ -439,8 +439,6 @@ startCutDb config logfun headerStore payloadStore cutHashesStore = mask_ $ do queue <- newEmptyPQueue cutAsync <- asyncWithUnmask $ \u -> u $ processor queue cutVar logg Debug "CutDB started" - unless (_cutDbParamsReadOnly config) $ - pruneCuts logfun (_chainwebVersion headerStore) config (cutAvgBlockHeight v initialCut) cutHashesStore return CutDb { _cutDbCut = cutVar , _cutDbQueue = queue