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 4, 2024
1 parent 368e8e6 commit fe05fc5
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 ->

This comment has been minimized.

Copy link
@rdlrt

rdlrt Sep 4, 2024

can this 503 be a bit more programatic, we have networks that are much higher number than 503 (on guildnet we have 24K epochs)

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 fe05fc5

Please sign in to comment.