Skip to content

Commit

Permalink
Take less snapshots during ledger replay
Browse files Browse the repository at this point in the history
  • Loading branch information
kderme committed Sep 12, 2024
1 parent 4e3c3f7 commit 182cdb4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cardano-db-sync/src/Cardano/DbSync/Ledger/State.hs
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,12 @@ storeSnapshotAndCleanupMaybe env oldState appResult blkNo isCons syncState =
case maybeFromStrict (apNewEpoch appResult) of
Just newEpoch
| newEpochNo <- unEpochNo (Generic.neEpoch newEpoch)
, newEpochNo > 0 -> do
-- TODO: Instead of newEpochNo - 1, is there any way to get the epochNo from 'lssOldState'?
liftIO $ saveCleanupState env oldState (Just $ EpochNo $ newEpochNo - 1)
pure True
, newEpochNo > 0
, isCons || (newEpochNo `mod` 10 == 0) || newEpochNo >= 503 ->
do
-- TODO: Instead of newEpochNo - 1, is there any way to get the epochNo from 'lssOldState'?
liftIO $ saveCleanupState env oldState (Just $ EpochNo $ newEpochNo - 1)
pure True
_ ->
if timeToSnapshot syncState blkNo && isCons
then do
Expand Down

0 comments on commit 182cdb4

Please sign in to comment.