Skip to content

Commit 2df4e27

Browse files
Added trace tags used in validation of big ledger peer snapshot
1 parent 13da539 commit 2df4e27

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

559562
forHuman = pack . show
560563

@@ -679,6 +682,8 @@ instance MetaTrace (TracePeerSelection SockAddr) where
679682
Namespace [] ["ChurnTimeout"]
680683
namespaceFor TraceDebugState {} =
681684
Namespace [] ["DebugState"]
685+
namespaceFor TraceVerifyPeerSnapshot {} =
686+
Namespace [] ["VerifyPeerSnapshot"]
682687

683688
severityFor (Namespace [] ["LocalRootPeersChanged"]) _ = Just Notice
684689
severityFor (Namespace [] ["TargetsChanged"]) _ = Just Notice
@@ -714,6 +719,7 @@ instance MetaTrace (TracePeerSelection SockAddr) where
714719
severityFor (Namespace [] ["ChurnAction"]) _ = Just Info
715720
severityFor (Namespace [] ["ChurnTimeout"]) _ = Just Notice
716721
severityFor (Namespace [] ["DebugState"]) _ = Just Info
722+
severityFor (Namespace [] ["VerifyPeerSnapshot"]) _ = Just Error
717723
severityFor _ _ = Nothing
718724

719725
documentFor (Namespace [] ["LocalRootPeersChanged"]) = Just ""
@@ -772,6 +778,8 @@ instance MetaTrace (TracePeerSelection SockAddr) where
772778
"Outbound Governor was killed unexpectedly"
773779
documentFor (Namespace [] ["DebugState"]) = Just
774780
"peer selection internal state"
781+
documentFor (Namespace [] ["VerifyPeerSnapshot"]) = Just
782+
"Big ledger peer snapshot file failed integrity check against the ledger"
775783
documentFor _ = Nothing
776784

777785
allNamespaces = [
@@ -807,6 +815,7 @@ instance MetaTrace (TracePeerSelection SockAddr) where
807815
, Namespace [] ["PickInboundPeers"]
808816
, Namespace [] ["OutboundGovernorCriticalFailure"]
809817
, Namespace [] ["DebugState"]
818+
, Namespace [] ["VerifyPeerSnapshot"]
810819
]
811820

812821
--------------------------------------------------------------------------------

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

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

487487
TraceDebugState {} -> Info
488488

489+
TraceVerifyPeerSnapshot True -> Info
490+
TraceVerifyPeerSnapshot False -> Error
491+
489492
instance HasPrivacyAnnotation (DebugPeerSelection addr)
490493
instance HasSeverityAnnotation (DebugPeerSelection addr) where
491494
getSeverityAnnotation _ = Debug
@@ -1943,6 +1946,9 @@ instance ToObject (TracePeerSelection SockAddr) where
19431946
, "upstreamyness" .= dpssUpstreamyness ds
19441947
, "fetchynessBlocks" .= dpssFetchynessBlocks ds
19451948
]
1949+
toObject _verb (TraceVerifyPeerSnapshot result) =
1950+
mconcat [ "kind" .= String "VerifyPeerSnapshot"
1951+
, "result" .= result ]
19461952

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

0 commit comments

Comments
 (0)