Skip to content

Commit 3d81c1f

Browse files
Added trace tags used in validation of big ledger peer snapshot
1 parent 6762467 commit 3d81c1f

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
@@ -554,6 +554,9 @@ instance LogFormatting (TracePeerSelection SockAddr) where
554554
, "upstreamyness" .= dpssUpstreamyness ds
555555
, "fetchynessBlocks" .= dpssFetchynessBlocks ds
556556
]
557+
forMachine _dtal (TraceVerifyPeerSnapshot result) =
558+
mconcat [ "kind" .= String "VerifyPeerSnapshot"
559+
, "result" .= result]
557560

558561
forHuman = pack . show
559562

@@ -678,6 +681,8 @@ instance MetaTrace (TracePeerSelection SockAddr) where
678681
Namespace [] ["ChurnTimeout"]
679682
namespaceFor TraceDebugState {} =
680683
Namespace [] ["DebugState"]
684+
namespaceFor TraceVerifyPeerSnapshot {} =
685+
Namespace [] ["VerifyPeerSnapshot"]
681686

682687
severityFor (Namespace [] ["LocalRootPeersChanged"]) _ = Just Notice
683688
severityFor (Namespace [] ["TargetsChanged"]) _ = Just Notice
@@ -713,6 +718,7 @@ instance MetaTrace (TracePeerSelection SockAddr) where
713718
severityFor (Namespace [] ["ChurnAction"]) _ = Just Info
714719
severityFor (Namespace [] ["ChurnTimeout"]) _ = Just Notice
715720
severityFor (Namespace [] ["DebugState"]) _ = Just Info
721+
severityFor (Namespace [] ["VerifyPeerSnapshot"]) _ = Just Error
716722
severityFor _ _ = Nothing
717723

718724
documentFor (Namespace [] ["LocalRootPeersChanged"]) = Just ""
@@ -771,6 +777,8 @@ instance MetaTrace (TracePeerSelection SockAddr) where
771777
"Outbound Governor was killed unexpectedly"
772778
documentFor (Namespace [] ["DebugState"]) = Just
773779
"peer selection internal state"
780+
documentFor (Namespace [] ["VerifyPeerSnapshot"]) = Just
781+
"Big ledger peer snapshot file failed integrity check against the ledger"
774782
documentFor _ = Nothing
775783

776784
metricsDocFor (Namespace [] ["ChurnAction"]) =
@@ -816,6 +824,7 @@ instance MetaTrace (TracePeerSelection SockAddr) where
816824
, Namespace [] ["PickInboundPeers"]
817825
, Namespace [] ["OutboundGovernorCriticalFailure"]
818826
, Namespace [] ["DebugState"]
827+
, Namespace [] ["VerifyPeerSnapshot"]
819828
]
820829

821830
--------------------------------------------------------------------------------

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

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

486486
TraceDebugState {} -> Info
487487

488+
TraceVerifyPeerSnapshot True -> Info
489+
TraceVerifyPeerSnapshot False -> Error
490+
488491
instance HasPrivacyAnnotation (DebugPeerSelection addr)
489492
instance HasSeverityAnnotation (DebugPeerSelection addr) where
490493
getSeverityAnnotation _ = Debug
@@ -1963,6 +1966,9 @@ instance ToObject (TracePeerSelection SockAddr) where
19631966
, "ledgerStateJudgement" .= dpssLedgerStateJudgement ds
19641967
, "associationMode" .= dpssAssociationMode ds
19651968
]
1969+
toObject _verb (TraceVerifyPeerSnapshot result) =
1970+
mconcat [ "kind" .= String "VerifyPeerSnapshot"
1971+
, "result" .= result ]
19661972

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

0 commit comments

Comments
 (0)