Skip to content

Commit

Permalink
Change now-misleading log trace regarding found checkpoints on startup
Browse files Browse the repository at this point in the history
  In particular, the 'totalCheckpoints' was confusing. In the past, kupo used to store only the necessary checkpoints, but it does now store ALL of them to allow looking up past points. Thus, there are way more than the reported 'totalCheckpoints' from this message. Also, since we know that we sample a subset of the checkpoints to give for intersection to the chain-sync server, it's okay and informative to simply show them as-is.
  • Loading branch information
KtorZ committed Aug 6, 2022
1 parent a4eae0b commit 7a29c0b
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions src/Kupo/App/Configuration.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,8 @@ startOrResume
startOrResume tr configuration Database{..} = do
checkpoints <- runReadOnlyTransaction (listCheckpointsDesc pointFromRow)

case nonEmpty (sortOn Down (unSlotNo . getPointSlotNo <$> checkpoints)) of
Nothing -> pure ()
Just slots -> do
let mostRecentCheckpoint = head slots
let oldestCheckpoint = last slots
let totalCheckpoints = length slots
logWith tr $ ConfigurationFoundCheckpoints
{ totalCheckpoints
, mostRecentCheckpoint
, oldestCheckpoint
}
let slots = unSlotNo . getPointSlotNo <$> checkpoints
logWith tr $ ConfigurationCheckpointsForIntersection { slots }

case (since, checkpoints) of
(Nothing, []) -> do
Expand Down Expand Up @@ -205,11 +196,8 @@ data TraceConfiguration where
ConfigurationPatterns
:: { patterns :: [Text] }
-> TraceConfiguration
ConfigurationFoundCheckpoints
:: { totalCheckpoints :: Int
, mostRecentCheckpoint :: Word64
, oldestCheckpoint :: Word64
}
ConfigurationCheckpointsForIntersection
:: { slots :: [Word64] }
-> TraceConfiguration
ConfigurationInvalidOrMissingOption
:: { hint :: Text }
Expand All @@ -226,5 +214,5 @@ instance HasSeverityAnnotation TraceConfiguration where
ConfigurationOgmios{} -> Info
ConfigurationCardanoNode{} -> Info
ConfigurationPatterns{} -> Info
ConfigurationFoundCheckpoints{} -> Info
ConfigurationCheckpointsForIntersection{} -> Info
ConfigurationInvalidOrMissingOption{} -> Error

0 comments on commit 7a29c0b

Please sign in to comment.