Skip to content

Commit

Permalink
temp 8.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
karknu committed May 7, 2024
1 parent 424983f commit 6575cb8
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 11 deletions.
2 changes: 2 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ packages:
trace-dispatcher
trace-resources
trace-forward
../ouroboros-network/ouroboros-network
../ouroboros-network/ouroboros-network-framework

program-options
ghc-options: -Werror
Expand Down
30 changes: 24 additions & 6 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/P2P.hs
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,6 @@ instance LogFormatting (TracePeerSelection SockAddr) where
forMachine _dtal (TraceChurnMode c) =
mconcat [ "kind" .= String "ChurnMode"
, "event" .= show c ]
forMachine _dtal (TraceKnownInboundConnection addr sharing) =
mconcat [ "kind" .= String "KnownInboundConnection"
, "peer" .= toJSON addr
, "peerSharing" .= String (pack . show $ sharing) ]
forMachine _dtal (TraceLedgerStateJudgementChanged new) =
mconcat [ "kind" .= String "LedgerStateJudgementChanged"
, "new" .= show new ]
Expand All @@ -511,6 +507,13 @@ instance LogFormatting (TracePeerSelection SockAddr) where
mconcat [ "kind" .= String "OutboundGovernorCriticalFailure"
, "reason" .= show err
]
forMachine _dtal (TracePickInboundPeers targetKnown actualKnown selected available) =
mconcat [ "kind" .= String "TracePickInboundPeers"
, "targetKnown" .= targetKnown
, "actualKnown" .= actualKnown
, "selected" .= Map.keys selected
, "available" .= available
]
forMachine _dtal (TraceDebugState mtime ds) =
mconcat [ "kind" .= String "DebugState"
, "monotonicTime" .= show mtime
Expand Down Expand Up @@ -634,8 +637,6 @@ instance MetaTrace (TracePeerSelection SockAddr) where
Namespace [] ["ChurnWait"]
namespaceFor TraceChurnMode {} =
Namespace [] ["ChurnMode"]
namespaceFor TraceKnownInboundConnection {} =
Namespace [] ["KnownInboundConnection"]
namespaceFor TraceLedgerStateJudgementChanged {} =
Namespace [] ["LedgerStateJudgementChanged"]
namespaceFor TraceOnlyBootstrapPeers {} =
Expand All @@ -646,6 +647,8 @@ instance MetaTrace (TracePeerSelection SockAddr) where
Namespace [] ["BootstrapPeersFlagChangedWhilstInSensitiveState"]
namespaceFor TraceOutboundGovernorCriticalFailure {} =
Namespace [] ["OutboundGovernorCriticalFailure"]
namespaceFor TracePickInboundPeers {} =
Namespace [] ["PickInboundPeers"]
namespaceFor TraceDebugState {} =
Namespace [] ["DebugState"]

Expand Down Expand Up @@ -1480,6 +1483,16 @@ forMachineGov _dtal (InboundGovernor.TrInboundGovernorError err) =
mconcat [ "kind" .= String "InboundGovernorError"
, "remoteSt" .= String (pack . show $ err)
]
forMachineGov _dtal (InboundGovernor.TrMaturedConnections matured _) =
mconcat [ "kind" .= String "MaturedConnections"
, "maturedConnections" .= matured
]
forMachineGov _dtal (InboundGovernor.TrInactive inactive) =
mconcat [ "kind" .= String "Inactive"
, "inactiveConnections" .= inactive
]



instance MetaTrace (InboundGovernorTrace addr) where
namespaceFor TrNewConnection {} = Namespace [] ["NewConnection"]
Expand All @@ -1501,6 +1514,9 @@ instance MetaTrace (InboundGovernorTrace addr) where
Namespace [] ["UnexpectedlyFalseAssertion"]
namespaceFor InboundGovernor.TrInboundGovernorError {} =
Namespace [] ["InboundGovernorError"]
namespaceFor InboundGovernor.TrMaturedConnections {} =
Namespace [] ["MaturedConnections"]
namespaceFor InboundGovernor.TrInactive {} = Namespace [] ["Inactive"]

severityFor (Namespace _ ["NewConnection"]) _ = Just Debug
severityFor (Namespace _ ["ResponderRestarted"]) _ = Just Debug
Expand Down Expand Up @@ -1544,6 +1560,8 @@ instance MetaTrace (InboundGovernorTrace addr) where
documentFor (Namespace _ ["RemoteState"]) = Just ""
documentFor (Namespace _ ["UnexpectedlyFalseAssertion"]) = Just ""
documentFor (Namespace _ ["InboundGovernorError"]) = Just ""
documentFor (Namespace _ ["MaturedConnections"]) = Just ""
documentFor (Namespace _ ["Inactive"]) = Just ""
documentFor _ = Nothing

metricsDocFor (Namespace [] ["InboundGovernorCounters"]) =
Expand Down
27 changes: 22 additions & 5 deletions cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ instance HasSeverityAnnotation (TracePeerSelection addr) where
TraceGovernorWakeup {} -> Info
TraceChurnWait {} -> Info
TraceChurnMode {} -> Info
TraceKnownInboundConnection {} -> Info

TraceForgetBigLedgerPeers {} -> Info

Expand Down Expand Up @@ -474,6 +473,8 @@ instance HasSeverityAnnotation (TracePeerSelection addr) where

TraceDebugState {} -> Info

TracePickInboundPeers {} -> Info

instance HasPrivacyAnnotation (DebugPeerSelection addr)
instance HasSeverityAnnotation (DebugPeerSelection addr) where
getSeverityAnnotation _ = Debug
Expand Down Expand Up @@ -562,6 +563,8 @@ instance HasSeverityAnnotation (InboundGovernorTrace addr) where
InboundGovernor.TrUnexpectedlyFalseAssertion {}
-> Error
InboundGovernor.TrInboundGovernorError {} -> Error
InboundGovernor.TrMaturedConnections {} -> Info
InboundGovernor.TrInactive {} -> Info

instance HasPrivacyAnnotation (Server.RemoteTransitionTrace addr)
instance HasSeverityAnnotation (Server.RemoteTransitionTrace addr) where
Expand Down Expand Up @@ -1869,10 +1872,6 @@ instance ToObject (TracePeerSelection SockAddr) where
toObject _verb (TraceChurnMode c) =
mconcat [ "kind" .= String "ChurnMode"
, "event" .= show c ]
toObject _verb (TraceKnownInboundConnection addr sharing) =
mconcat [ "kind" .= String "KnownInboundConnection"
, "peer" .= show addr
, "peerSharing" .= show sharing ]
toObject _verb (TraceLedgerStateJudgementChanged new) =
mconcat [ "kind" .= String "LedgerStateJudgementChanged"
, "new" .= show new ]
Expand All @@ -1888,6 +1887,13 @@ instance ToObject (TracePeerSelection SockAddr) where
mconcat [ "kind" .= String "OutboundGovernorCriticalFailure"
, "reason" .= show err
]
toObject _verb (TracePickInboundPeers targetKnown actualKnown selected available) =
mconcat [ "kind" .= String "PickInboundPeers"
, "targetKnown" .= targetKnown
, "actualKnown" .= actualKnown
, "selected" .= Map.keys selected
, "available" .= available
]
toObject _verb (TraceDebugState mtime ds) =
mconcat [ "kind" .= String "DebugState"
, "monotonicTime" .= mtime
Expand Down Expand Up @@ -2515,6 +2521,17 @@ instance (ToJSON addr, Show addr)
mconcat [ "kind" .= String "InboundGovernorError"
, "remoteSt" .= String (pack . show $ err)
]
toObject _verb (InboundGovernor.TrMaturedConnections matured imatured) =
mconcat [ "kind" .= String "MaturedConnections"
, "maturedConnections" .= matured
, "imaturedConnections" .= imatured
]
toObject _verb (InboundGovernor.TrInactive inactive) =
mconcat [ "kind" .= String "Inactive"
, "inactiveConnections" .= inactive
]



instance ToJSON addr
=> ToObject (Server.RemoteTransitionTrace addr) where
Expand Down

0 comments on commit 6575cb8

Please sign in to comment.