Skip to content

Commit

Permalink
Rename InitalChainSelected to InitialChainSelected
Browse files Browse the repository at this point in the history
  • Loading branch information
dnadales committed Mar 28, 2024
1 parent 6715a9b commit 7c60413
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion cardano-node/src/Cardano/Node/Tracing/StateRep.hs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ traceNodeStateChainDB _scp tr ev =
case ev' of
ChainDB.StartedInitChainSelection ->
traceWith tr $ NodeInitChainSelection InitChainStartedSelection
ChainDB.InitalChainSelected ->
ChainDB.InitialChainSelected ->
traceWith tr $ NodeInitChainSelection InitChainSelected
_ -> return ()
ChainDB.TraceAddBlockEvent ev' ->
Expand Down
18 changes: 9 additions & 9 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/ChainDB.hs
Original file line number Diff line number Diff line change
Expand Up @@ -950,30 +950,30 @@ instance MetaTrace (ChainDB.TraceGCEvent blk) where
instance (ConvertRawHash blk, LedgerSupportsProtocol blk)
=> LogFormatting (ChainDB.TraceInitChainSelEvent blk) where
forHuman (ChainDB.InitChainSelValidation v) = forHumanOrMachine v
forHuman ChainDB.InitalChainSelected{} =
forHuman ChainDB.InitialChainSelected{} =
"Initial chain selected"
forHuman ChainDB.StartedInitChainSelection {} =
"Started initial chain selection"

forMachine dtal (ChainDB.InitChainSelValidation v) = forMachine dtal v
forMachine _dtal ChainDB.InitalChainSelected =
mconcat ["kind" .= String "Follower.InitalChainSelected"]
forMachine _dtal ChainDB.InitialChainSelected =
mconcat ["kind" .= String "Follower.InitialChainSelected"]
forMachine _dtal ChainDB.StartedInitChainSelection =
mconcat ["kind" .= String "Follower.StartedInitChainSelection"]

asMetrics (ChainDB.InitChainSelValidation v) = asMetrics v
asMetrics ChainDB.InitalChainSelected = []
asMetrics ChainDB.InitialChainSelected = []
asMetrics ChainDB.StartedInitChainSelection = []

instance MetaTrace (ChainDB.TraceInitChainSelEvent blk) where
namespaceFor ChainDB.InitalChainSelected {} =
Namespace [] ["InitalChainSelected"]
namespaceFor ChainDB.InitialChainSelected {} =
Namespace [] ["InitialChainSelected"]
namespaceFor ChainDB.StartedInitChainSelection {} =
Namespace [] ["StartedInitChainSelection"]
namespaceFor (ChainDB.InitChainSelValidation ev') =
nsPrependInner "Validation" (namespaceFor ev')

severityFor (Namespace _ ["InitalChainSelected"]) _ = Just Info
severityFor (Namespace _ ["InitialChainSelected"]) _ = Just Info
severityFor (Namespace _ ["StartedInitChainSelection"]) _ = Just Info
severityFor (Namespace out ("Validation" : tl))
(Just (ChainDB.InitChainSelValidation ev')) =
Expand Down Expand Up @@ -1003,7 +1003,7 @@ instance MetaTrace (ChainDB.TraceInitChainSelEvent blk) where
metricsDocFor (Namespace out tl :: Namespace (ChainDB.TraceValidationEvent blk))
metricsDocFor _ = []

documentFor (Namespace _ ["InitalChainSelected"]) = Just
documentFor (Namespace _ ["InitialChainSelected"]) = Just
"A garbage collection for the given 'SlotNo' was performed."
documentFor (Namespace _ ["StartedInitChainSelection"]) = Just $ mconcat
[ "A garbage collection for the given 'SlotNo' was scheduled to happen"
Expand All @@ -1014,7 +1014,7 @@ instance MetaTrace (ChainDB.TraceInitChainSelEvent blk) where
documentFor _ = Nothing

allNamespaces =
[ Namespace [] ["InitalChainSelected"]
[ Namespace [] ["InitialChainSelected"]
, Namespace [] ["StartedInitChainSelection"]
]
++ map (nsPrependInner "Validation")
Expand Down
8 changes: 4 additions & 4 deletions cardano-node/src/Cardano/Tracing/OrphanInstances/Consensus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ instance HasSeverityAnnotation (ChainDB.TraceEvent blk) where
ChainDB.FollowerNewImmIterator {} -> Debug
getSeverityAnnotation (ChainDB.TraceInitChainSelEvent ev) = case ev of
ChainDB.StartedInitChainSelection{} -> Info
ChainDB.InitalChainSelected{} -> Info
ChainDB.InitialChainSelected{} -> Info
ChainDB.InitChainSelValidation ev' -> case ev' of
ChainDB.InvalidBlock{} -> Debug
ChainDB.ValidCandidate {} -> Info
Expand Down Expand Up @@ -604,7 +604,7 @@ instance ( ConvertRawHash blk
ChainDB.FollowerNewImmIterator _ _ -> "FollowerNewImmIterator"
ChainDB.TraceInitChainSelEvent ev -> case ev of
ChainDB.StartedInitChainSelection -> "Started initial chain selection"
ChainDB.InitalChainSelected -> "Initial chain selected"
ChainDB.InitialChainSelected -> "Initial chain selected"
ChainDB.InitChainSelValidation e -> case e of
ChainDB.InvalidBlock _err _pt -> "Invalid block found during Initial chain selection, truncating the candidate and retrying to select a best candidate."
ChainDB.ValidCandidate af -> "Valid candidate at tip " <> renderPointAsPhrase (AF.lastPoint af)
Expand Down Expand Up @@ -1073,8 +1073,8 @@ instance ( ConvertRawHash blk
ChainDB.FollowerNewImmIterator _ _ ->
mconcat [ "kind" .= String "TraceFollowerEvent.FollowerNewImmIterator" ]
toObject verb (ChainDB.TraceInitChainSelEvent ev) = case ev of
ChainDB.InitalChainSelected ->
mconcat ["kind" .= String "TraceFollowerEvent.InitalChainSelected"]
ChainDB.InitialChainSelected ->
mconcat ["kind" .= String "TraceFollowerEvent.InitialChainSelected"]
ChainDB.StartedInitChainSelection ->
mconcat ["kind" .= String "TraceFollowerEvent.StartedInitChainSelection"]
ChainDB.InitChainSelValidation ev' -> case ev' of
Expand Down

0 comments on commit 7c60413

Please sign in to comment.