Skip to content

Commit 7221a9b

Browse files
Added trace tags used in validation of big ledger peer snapshot
1 parent f5c0912 commit 7221a9b

File tree

2 files changed

+15
-0
lines changed
  • cardano-node/src/Cardano

2 files changed

+15
-0
lines changed

cardano-node/src/Cardano/Node/Tracing/Tracers/P2P.hs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,9 @@ instance LogFormatting (TracePeerSelection SockAddr) where
558558
, "upstreamyness" .= dpssUpstreamyness ds
559559
, "fetchynessBlocks" .= dpssFetchynessBlocks ds
560560
]
561+
forMachine _dtal (TraceVerifyPeerSnapshot result) =
562+
mconcat [ "kind" .= String "VerifyPeerSnapshot"
563+
, "result" .= result]
561564

562565
forHuman = pack . show
563566

@@ -684,6 +687,8 @@ instance MetaTrace (TracePeerSelection SockAddr) where
684687
Namespace [] ["ChurnTimeout"]
685688
namespaceFor TraceDebugState {} =
686689
Namespace [] ["DebugState"]
690+
namespaceFor TraceVerifyPeerSnapshot {} =
691+
Namespace [] ["VerifyPeerSnapshot"]
687692

688693
severityFor (Namespace [] ["LocalRootPeersChanged"]) _ = Just Notice
689694
severityFor (Namespace [] ["TargetsChanged"]) _ = Just Notice
@@ -719,6 +724,7 @@ instance MetaTrace (TracePeerSelection SockAddr) where
719724
severityFor (Namespace [] ["ChurnAction"]) _ = Just Info
720725
severityFor (Namespace [] ["ChurnTimeout"]) _ = Just Notice
721726
severityFor (Namespace [] ["DebugState"]) _ = Just Info
727+
severityFor (Namespace [] ["VerifyPeerSnapshot"]) _ = Just Error
722728
severityFor _ _ = Nothing
723729

724730
documentFor (Namespace [] ["LocalRootPeersChanged"]) = Just ""
@@ -777,6 +783,8 @@ instance MetaTrace (TracePeerSelection SockAddr) where
777783
"Outbound Governor was killed unexpectedly"
778784
documentFor (Namespace [] ["DebugState"]) = Just
779785
"peer selection internal state"
786+
documentFor (Namespace [] ["VerifyPeerSnapshot"]) = Just
787+
"Big ledger peer snapshot file failed integrity check against the ledger"
780788
documentFor _ = Nothing
781789

782790
metricsDocFor (Namespace [] ["ChurnAction"]) =
@@ -822,6 +830,7 @@ instance MetaTrace (TracePeerSelection SockAddr) where
822830
, Namespace [] ["PickInboundPeers"]
823831
, Namespace [] ["OutboundGovernorCriticalFailure"]
824832
, Namespace [] ["DebugState"]
833+
, Namespace [] ["VerifyPeerSnapshot"]
825834
]
826835

827836
--------------------------------------------------------------------------------

cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,9 @@ instance HasSeverityAnnotation (TracePeerSelection addr) where
493493

494494
TraceDebugState {} -> Info
495495

496+
TraceVerifyPeerSnapshot True -> Info
497+
TraceVerifyPeerSnapshot False -> Error
498+
496499
instance HasPrivacyAnnotation (DebugPeerSelection addr)
497500
instance HasSeverityAnnotation (DebugPeerSelection addr) where
498501
getSeverityAnnotation _ = Debug
@@ -2043,6 +2046,9 @@ instance ToObject (TracePeerSelection SockAddr) where
20432046
, "ledgerStateJudgement" .= dpssLedgerStateJudgement ds
20442047
, "associationMode" .= dpssAssociationMode ds
20452048
]
2049+
toObject _verb (TraceVerifyPeerSnapshot result) =
2050+
mconcat [ "kind" .= String "VerifyPeerSnapshot"
2051+
, "result" .= result ]
20462052

20472053
-- Connection manager abstract state. For explanation of each state see
20482054
-- <https://hydra.iohk.io/job/Cardano/ouroboros-network/native.network-docs.x86_64-linux/latest/download/2>

0 commit comments

Comments
 (0)