Skip to content

Commit 0bc9283

Browse files
crocodile-dentistana-pantilie
authored andcommitted
diffusion: update tracers
1 parent 5a4e005 commit 0bc9283

File tree

2 files changed

+31
-32
lines changed

2 files changed

+31
-32
lines changed

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

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -878,8 +878,10 @@ instance MetaTrace TraceLedgerPeers where
878878
namespaceFor UsingBigLedgerPeerSnapshot {} =
879879
Namespace [] ["UsingBigLedgerPeerSnapshot"]
880880

881-
severityFor (Namespace _ ["PickedPeer"]) _ = Just Debug
882-
severityFor (Namespace _ ["PickedPeers"]) _ = Just Info
881+
severityFor (Namespace _ ["PickedLedgerPeer"]) _ = Just Debug
882+
severityFor (Namespace _ ["PickedLedgerPeers"]) _ = Just Info
883+
severityFor (Namespace _ ["PickedBigLedgerPeer"]) _ = Just Debug
884+
severityFor (Namespace _ ["PickedBigLedgerPeers"]) _ = Just Info
883885
severityFor (Namespace _ ["FetchingNewLedgerState"]) _ = Just Info
884886
severityFor (Namespace _ ["DisabledLedgerPeers"]) _ = Just Info
885887
severityFor (Namespace _ ["TraceUseLedgerAfter"]) _ = Just Info
@@ -893,10 +895,14 @@ instance MetaTrace TraceLedgerPeers where
893895
severityFor (Namespace _ ["UsingBigLedgerPeerSnapshot"]) _ = Just Debug
894896
severityFor _ _ = Nothing
895897

896-
documentFor (Namespace _ ["PickedPeer"]) = Just
898+
documentFor (Namespace _ ["PickedLedgerPeer"]) = Just
897899
"Trace for a peer picked with accumulated and relative stake of its pool."
898-
documentFor (Namespace _ ["PickedPeers"]) = Just
900+
documentFor (Namespace _ ["PickedLedgerPeers"]) = Just
899901
"Trace for the number of peers we wanted to pick and the list of peers picked."
902+
documentFor (Namespace _ ["PickedBigLedgerPeer"]) = Just
903+
"Trace for a big ledger peer picked with accumulated and relative stake of its pool."
904+
documentFor (Namespace _ ["PickedBigLedgerPeers"]) = Just
905+
"Trace for the number of big ledger peers we wanted to pick and the list of peers picked."
900906
documentFor (Namespace _ ["FetchingNewLedgerState"]) = Just $ mconcat
901907
[ "Trace for fetching a new list of peers from the ledger. Int is the number of peers"
902908
, " returned."
@@ -917,19 +923,23 @@ instance MetaTrace TraceLedgerPeers where
917923
""
918924
documentFor (Namespace _ ["UsingBigLedgerPeerSnapshot"]) = Just $ mconcat
919925
[ "Trace for when a request for big ledger peers is fulfilled from the snapshot file"
920-
, " defined in the topology configuration file."]
926+
, " specified in the topology file."]
921927
documentFor _ = Nothing
922928

923929
allNamespaces = [
924-
Namespace [] ["PickedPeer"]
925-
, Namespace [] ["PickedPeers"]
930+
Namespace [] ["PickedLedgerPeer"]
931+
, Namespace [] ["PickedLedgerPeers"]
932+
, Namespace [] ["PickedBigLedgerPeer"]
933+
, Namespace [] ["PickedBigLedgerPeers"]
926934
, Namespace [] ["FetchingNewLedgerState"]
927935
, Namespace [] ["DisabledLedgerPeers"]
928936
, Namespace [] ["TraceUseLedgerAfter"]
929937
, Namespace [] ["WaitingOnRequest"]
930938
, Namespace [] ["RequestForPeers"]
931939
, Namespace [] ["ReusingLedgerState"]
932940
, Namespace [] ["FallingBackToPublicRootPeers"]
941+
, Namespace [] ["NotEnoughLedgerPeers"]
942+
, Namespace [] ["NotEnoughBigLedgerPeers"]
933943
, Namespace [] ["TraceLedgerPeersDomains"]
934944
, Namespace [] ["UsingBigLedgerPeerSnapshot"]
935945
]

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

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ instance
103103
]
104104
forMachine _dtal (TraceLocalRootWaiting d dt) =
105105
mconcat [ "kind" .= String "LocalRootWaiting"
106-
-- TODO: `domainAddress` -> `accessPoint`
107106
, "domainAddress" .= toJSON d
108107
, "diffTime" .= show dt
109108
]
@@ -113,13 +112,11 @@ instance
113112
]
114113
forMachine _dtal (TraceLocalRootFailure d exception) =
115114
mconcat [ "kind" .= String "LocalRootFailure"
116-
-- TODO: `domainAddress` -> `accessPoint`
117115
, "domainAddress" .= toJSON d
118116
, "reason" .= displayException exception
119117
]
120118
forMachine _dtal (TraceLocalRootError d exception) =
121119
mconcat [ "kind" .= String "LocalRootError"
122-
-- TODO: `domainAddress` -> `domain`
123120
, "domainAddress" .= String (pack . show $ d)
124121
, "reason" .= displayException exception
125122
]
@@ -147,7 +144,6 @@ instance MetaTrace (TraceLocalRootPeers ntnAddr extraFlags) where
147144

148145
severityFor (Namespace [] ["LocalRootDomains"]) _ = Just Info
149146
severityFor (Namespace [] ["LocalRootWaiting"]) _ = Just Info
150-
severityFor (Namespace [] ["LocalRootResult"]) _ = Just Info
151147
severityFor (Namespace [] ["LocalRootGroups"]) _ = Just Info
152148
severityFor (Namespace [] ["LocalRootFailure"]) _ = Just Info
153149
severityFor (Namespace [] ["LocalRootError"]) _ = Just Info
@@ -159,8 +155,6 @@ instance MetaTrace (TraceLocalRootPeers ntnAddr extraFlags) where
159155
""
160156
documentFor (Namespace [] ["LocalRootWaiting"]) = Just
161157
""
162-
documentFor (Namespace [] ["LocalRootResult"]) = Just
163-
""
164158
documentFor (Namespace [] ["LocalRootGroups"]) = Just
165159
""
166160
documentFor (Namespace [] ["LocalRootFailure"]) = Just
@@ -176,7 +170,6 @@ instance MetaTrace (TraceLocalRootPeers ntnAddr extraFlags) where
176170
allNamespaces =
177171
[ Namespace [] ["LocalRootDomains"]
178172
, Namespace [] ["LocalRootWaiting"]
179-
, Namespace [] ["LocalRootResult"]
180173
, Namespace [] ["LocalRootGroups"]
181174
, Namespace [] ["LocalRootFailure"]
182175
, Namespace [] ["LocalRootError"]
@@ -205,25 +198,17 @@ instance MetaTrace TracePublicRootPeers where
205198

206199
severityFor (Namespace [] ["PublicRootRelayAccessPoint"]) _ = Just Info
207200
severityFor (Namespace [] ["PublicRootDomains"]) _ = Just Info
208-
severityFor (Namespace [] ["PublicRootResult"]) _ = Just Info
209-
severityFor (Namespace [] ["PublicRootFailure"]) _ = Just Info
210201
severityFor _ _ = Nothing
211202

212203
documentFor (Namespace [] ["PublicRootRelayAccessPoint"]) = Just
213204
""
214205
documentFor (Namespace [] ["PublicRootDomains"]) = Just
215206
""
216-
documentFor (Namespace [] ["PublicRootResult"]) = Just
217-
""
218-
documentFor (Namespace [] ["PublicRootFailure"]) = Just
219-
""
220207
documentFor _ = Nothing
221208

222209
allNamespaces = [
223210
Namespace [] ["PublicRootRelayAccessPoint"]
224211
, Namespace [] ["PublicRootDomains"]
225-
, Namespace [] ["PublicRootResult"]
226-
, Namespace [] ["PublicRootFailure"]
227212
]
228213

229214
--------------------------------------------------------------------------------
@@ -599,6 +584,8 @@ instance MetaTrace (TracePeerSelection extraDebugState extraFlags extraPeers Soc
599584
Namespace [] ["PeerShareResults"]
600585
namespaceFor TracePeerShareResultsFiltered {} =
601586
Namespace [] ["PeerShareResultsFiltered"]
587+
namespaceFor TracePickInboundPeers {} =
588+
Namespace [] ["PickInboundPeers"]
602589
namespaceFor TracePromoteColdPeers {} =
603590
Namespace [] ["PromoteColdPeers"]
604591
namespaceFor TracePromoteColdLocalPeers {} =
@@ -675,8 +662,6 @@ instance MetaTrace (TracePeerSelection extraDebugState extraFlags extraPeers Soc
675662
Namespace [] ["GovernorWakeup"]
676663
namespaceFor TraceChurnWait {} =
677664
Namespace [] ["ChurnWait"]
678-
namespaceFor TracePickInboundPeers {} =
679-
Namespace [] ["PickInboundPeers"]
680665
namespaceFor TraceLedgerStateJudgementChanged {} =
681666
Namespace [] ["LedgerStateJudgementChanged"]
682667
namespaceFor TraceOnlyBootstrapPeers {} =
@@ -709,6 +694,7 @@ instance MetaTrace (TracePeerSelection extraDebugState extraFlags extraPeers Soc
709694
severityFor (Namespace [] ["PeerShareRequests"]) _ = Just Debug
710695
severityFor (Namespace [] ["PeerShareResults"]) _ = Just Debug
711696
severityFor (Namespace [] ["PeerShareResultsFiltered"]) _ = Just Info
697+
severityFor (Namespace [] ["PickInboundPeers"]) _ = Just Info
712698
severityFor (Namespace [] ["PromoteColdPeers"]) _ = Just Info
713699
severityFor (Namespace [] ["PromoteColdLocalPeers"]) _ = Just Info
714700
severityFor (Namespace [] ["PromoteColdFailed"]) _ = Just Info
@@ -747,8 +733,6 @@ instance MetaTrace (TracePeerSelection extraDebugState extraFlags extraPeers Soc
747733
severityFor (Namespace [] ["DemoteBigLedgerPeersAsynchronous"]) _ = Just Info
748734
severityFor (Namespace [] ["GovernorWakeup"]) _ = Just Info
749735
severityFor (Namespace [] ["ChurnWait"]) _ = Just Info
750-
severityFor (Namespace [] ["ChurnMode"]) _ = Just Info
751-
severityFor (Namespace [] ["PickInboundPeers"]) _ = Just Info
752736
severityFor (Namespace [] ["LedgerStateJudgementChanged"]) _ = Just Info
753737
severityFor (Namespace [] ["OnlyBootstrapPeers"]) _ = Just Info
754738
severityFor (Namespace [] ["UseBootstrapPeersChanged"]) _ = Just Notice
@@ -817,7 +801,6 @@ instance MetaTrace (TracePeerSelection extraDebugState extraFlags extraPeers Soc
817801
documentFor (Namespace [] ["DemoteLocalAsynchronous"]) = Just ""
818802
documentFor (Namespace [] ["GovernorWakeup"]) = Just ""
819803
documentFor (Namespace [] ["ChurnWait"]) = Just ""
820-
documentFor (Namespace [] ["ChurnMode"]) = Just ""
821804
documentFor (Namespace [] ["PickInboundPeers"]) = Just
822805
"An inbound connection was added to known set of outbound governor"
823806
documentFor (Namespace [] ["OutboundGovernorCriticalFailure"]) = Just
@@ -852,6 +835,7 @@ instance MetaTrace (TracePeerSelection extraDebugState extraFlags extraPeers Soc
852835
, Namespace [] ["PeerShareRequests"]
853836
, Namespace [] ["PeerShareResults"]
854837
, Namespace [] ["PeerShareResultsFiltered"]
838+
, Namespace [] ["PickInboundPeers"]
855839
, Namespace [] ["PromoteColdPeers"]
856840
, Namespace [] ["PromoteColdLocalPeers"]
857841
, Namespace [] ["PromoteColdFailed"]
@@ -890,16 +874,14 @@ instance MetaTrace (TracePeerSelection extraDebugState extraFlags extraPeers Soc
890874
, Namespace [] ["DemoteBigLedgerPeersAsynchronous"]
891875
, Namespace [] ["GovernorWakeup"]
892876
, Namespace [] ["ChurnWait"]
893-
, Namespace [] ["ChurnMode"]
894-
, Namespace [] ["PickInboundPeers"]
877+
, Namespace [] ["ChurnAction"]
878+
, Namespace [] ["ChurnTimeout"]
895879
, Namespace [] ["LedgerStateJudgementChanged"]
896880
, Namespace [] ["OnlyBootstrapPeers"]
881+
, Namespace [] ["BootstrapPeersFlagChangedWhilstInSensitiveState"]
897882
, Namespace [] ["UseBootstrapPeersChanged"]
898883
, Namespace [] ["VerifyPeerSnapshot"]
899-
, Namespace [] ["BootstrapPeersFlagChangedWhilstInSensitiveState"]
900884
, Namespace [] ["OutboundGovernorCriticalFailure"]
901-
, Namespace [] ["ChurnAction"]
902-
, Namespace [] ["ChurnTimeout"]
903885
, Namespace [] ["DebugState"]
904886
]
905887

@@ -2087,12 +2069,19 @@ instance LogFormatting TraceChurnMode where
20872069
mconcat [ "kind" .= String "ChurnMode"
20882070
, "churnMode" .= String (pack . show $ mode)
20892071
]
2072+
20902073
instance MetaTrace TraceChurnMode where
20912074
namespaceFor TraceChurnMode {} =
20922075
Namespace [] ["PeerSelection", "ChurnMode"]
20932076
severityFor _ (Just TraceChurnMode {}) = Just Info
20942077
severityFor _ Nothing = Nothing
20952078

2079+
documentFor (Namespace _ ["PeerSelection", "ChurnMode"]) = Just $ mconcat
2080+
["Affects churning strategy. For a synced node or operating in GenesisMode "
2081+
, " consensus mode, the default strategy is used. Otherwise for a syncing PraosMode"
2082+
, " node, the legacy bulk sync churning intervals are used whose durations"
2083+
, " depend on whether bootstrap peers are enabled."
2084+
]
20962085
documentFor _ = Nothing
20972086

20982087
allNamespaces = [

0 commit comments

Comments
 (0)