{-# LANGUAGE FlexibleContexts  #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports    #-}

--------------------------------------------------------------------------------

-- Orphan instances module for Cardano tracer.
{-# OPTIONS_GHC -Wno-orphans #-}
-- Extracted from "cardano-node" `Cardano.Node.Tracing.Tracers.P2P`.
-- Branch "master" (2026-02-11, 85869e9dd21d9dac7c4381418346e97259c3303b).

{- TODO: All references to package "cardano-diffusion" were removed.
--       See all the TODO annotations.
import           "cardano-diffusion" -- "cardano-diffusion:???"
  Cardano.Network.PeerSelection.Governor.Monitor
    ( ExtraTrace (TraceLedgerStateJudgementChanged, TraceUseBootstrapPeersChanged)
    )
--}

--------------------------------------------------------------------------------

module Ouroboros.Network.Tracing.PeerSelection.Governor.TracePeerSelection () where

--------------------------------------------------------------------------------

---------
-- base -
---------
import Control.Exception (fromException)
import Data.Bifunctor (first)
import Data.Foldable (toList)
---------------------
-- Package: "aeson" -
---------------------
import "aeson" Data.Aeson (ToJSON, ToJSONKey, Value (String), toJSON,
           toJSONList, (.=))
-----------------------
-- Package: "network" -
-----------------------
import "network" Network.Socket (SockAddr)
---------------------------------
-- Package: "ouroboros-network" -
---------------------------------
import "ouroboros-network" Ouroboros.Network.PeerSelection.Governor.Types
           (DebugPeerSelectionState (..), DemotionTimeoutException,
           TracePeerSelection (..))
import "ouroboros-network" Ouroboros.Network.PeerSelection.PublicRootPeers
           (PublicRootPeers)
import "ouroboros-network" Ouroboros.Network.PeerSelection.State.KnownPeers qualified as KnownPeers
import "ouroboros-network" Ouroboros.Network.Protocol.PeerSharing.Type
           (PeerSharingAmount (PeerSharingAmount))
--------------------
-- Package: "text" -
--------------------
import "text" Data.Text (pack)
--------------------------------
-- Package: "trace-dispatcher" -
--------------------------------
import "trace-dispatcher" Cardano.Logging
---------
-- Self -
---------
import Ouroboros.Network.Tracing.PeerSelection.Governor.Utils
           (peerSelectionTargetsToObject)

--------------------------------------------------------------------------------
-- PeerSelection Tracer
--------------------------------------------------------------------------------

{-- TODO: Before "cardano-diffusion" removal:
instance LogFormatting (TracePeerSelection Cardano.DebugPeerSelectionState PeerTrustable (Cardano.PublicRootPeers.ExtraPeers SockAddr) SockAddr) where
 -- TODO: That later changed in f550a6eb503cc81807419795ab2360e6042ce9d5:
instance LogFormatting CardanoTracePeerSelection where
--}
instance ( Ord ntnAddr
         , Show extraDebugState
         , Show extraFlags
         , Show extraPeers
         , Show extraTrace
         , Show ntnAddr
         , ToJSON extraFlags
         , ToJSON ntnAddr
         , ToJSON (PublicRootPeers extraPeers ntnAddr)
         , ToJSONKey ntnAddr
         )
      => LogFormatting (TracePeerSelection extraDebugState extraFlags extraPeers extraTrace ntnAddr) where
  forMachine :: DetailLevel
-> TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace ntnAddr
-> Object
forMachine DetailLevel
_dtal (TraceLocalRootPeersChanged LocalRootPeers extraFlags ntnAddr
lrp LocalRootPeers extraFlags ntnAddr
lrp') =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"LocalRootPeersChanged"
             , Key
"previous" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= LocalRootPeers extraFlags ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON LocalRootPeers extraFlags ntnAddr
lrp
             , Key
"current" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= LocalRootPeers extraFlags ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON LocalRootPeers extraFlags ntnAddr
lrp'
             ]
  forMachine DetailLevel
_dtal (TraceTargetsChanged PeerSelectionTargets
pst) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"TargetsChanged"
             , Key
"previous" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= PeerSelectionTargets -> Value
forall a. ToJSON a => a -> Value
toJSON PeerSelectionTargets
pst
{-- TODO: Field was removed here but not in cardano-node master
 -- See: ouroboros-network/changelog.d/20260122_220351_coot_ouroboros_churn_fix.md
             , "current" .= toJSON pst'
--}
             ]
  forMachine DetailLevel
_dtal (TracePublicRootsRequest Int
tRootPeers Int
nRootPeers) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PublicRootsRequest"
             , Key
"targetNumberOfRootPeers" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tRootPeers
             , Key
"numberOfRootPeers" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
nRootPeers
             ]
  forMachine DetailLevel
_dtal (TracePublicRootsResults PublicRootPeers extraPeers ntnAddr
res Int
group DiffTime
dt) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PublicRootsResults"
             , Key
"result" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= PublicRootPeers extraPeers ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON PublicRootPeers extraPeers ntnAddr
res
             , Key
"group" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
group
             , Key
"diffTime" Key -> DiffTime -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DiffTime
dt
             ]
  forMachine DetailLevel
_dtal (TracePublicRootsFailure SomeException
err Int
group DiffTime
dt) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PublicRootsFailure"
             , Key
"reason" Key -> String -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= SomeException -> String
forall a. Show a => a -> String
show SomeException
err
             , Key
"group" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
group
             , Key
"diffTime" Key -> DiffTime -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DiffTime
dt
             ]
  forMachine DetailLevel
_dtal (TraceForgetColdPeers Int
targetKnown Int
actualKnown Set ntnAddr
sp) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"ForgetColdPeers"
             , Key
"targetKnown" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
targetKnown
             , Key
"actualKnown" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
actualKnown
             , Key
"selectedPeers" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [ntnAddr] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList (Set ntnAddr -> [ntnAddr]
forall a. Set a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList Set ntnAddr
sp)
             ]
  forMachine DetailLevel
_dtal (TraceBigLedgerPeersRequest Int
tRootPeers Int
nRootPeers) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"BigLedgerPeersRequest"
             , Key
"targetNumberOfBigLedgerPeers" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tRootPeers
             , Key
"numberOfBigLedgerPeers" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
nRootPeers
             ]
  forMachine DetailLevel
_dtal (TraceBigLedgerPeersResults Set ntnAddr
res Int
group DiffTime
dt) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"BigLedgerPeersResults"
             , Key
"result" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [ntnAddr] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList (Set ntnAddr -> [ntnAddr]
forall a. Set a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList Set ntnAddr
res)
             , Key
"group" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
group
             , Key
"diffTime" Key -> DiffTime -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DiffTime
dt
             ]
  forMachine DetailLevel
_dtal (TraceBigLedgerPeersFailure SomeException
err Int
group DiffTime
dt) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"BigLedgerPeersFailure"
             , Key
"reason" Key -> String -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= SomeException -> String
forall a. Show a => a -> String
show SomeException
err
             , Key
"group" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
group
             , Key
"diffTime" Key -> DiffTime -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DiffTime
dt
             ]
  forMachine DetailLevel
_dtal (TraceForgetBigLedgerPeers Int
targetKnown Int
actualKnown Set ntnAddr
sp) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"ForgetColdBigLedgerPeers"
             , Key
"targetKnown" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
targetKnown
             , Key
"actualKnown" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
actualKnown
             , Key
"selectedPeers" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [ntnAddr] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList (Set ntnAddr -> [ntnAddr]
forall a. Set a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList Set ntnAddr
sp)
             ]
  forMachine DetailLevel
_dtal (TracePeerShareRequests Int
targetKnown Int
actualKnown (PeerSharingAmount Word8
numRequested) Set ntnAddr
aps Set ntnAddr
sps) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PeerShareRequests"
             , Key
"targetKnown" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
targetKnown
             , Key
"actualKnown" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
actualKnown
             , Key
"numRequested" Key -> Word8 -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Word8
numRequested
             , Key
"availablePeers" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [ntnAddr] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList (Set ntnAddr -> [ntnAddr]
forall a. Set a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList Set ntnAddr
aps)
             , Key
"selectedPeers" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [ntnAddr] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList (Set ntnAddr -> [ntnAddr]
forall a. Set a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList Set ntnAddr
sps)
             ]
  forMachine DetailLevel
_dtal (TracePeerShareResults [(ntnAddr, Either SomeException (PeerSharingResult ntnAddr))]
res) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PeerShareResults"
             , Key
"result" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [(ntnAddr, Either String (PeerSharingResult ntnAddr))] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList (((ntnAddr, Either SomeException (PeerSharingResult ntnAddr))
 -> (ntnAddr, Either String (PeerSharingResult ntnAddr)))
-> [(ntnAddr, Either SomeException (PeerSharingResult ntnAddr))]
-> [(ntnAddr, Either String (PeerSharingResult ntnAddr))]
forall a b. (a -> b) -> [a] -> [b]
map ((SomeException -> String)
-> Either SomeException (PeerSharingResult ntnAddr)
-> Either String (PeerSharingResult ntnAddr)
forall a b c. (a -> b) -> Either a c -> Either b c
forall (p :: * -> * -> *) a b c.
Bifunctor p =>
(a -> b) -> p a c -> p b c
first SomeException -> String
forall a. Show a => a -> String
show (Either SomeException (PeerSharingResult ntnAddr)
 -> Either String (PeerSharingResult ntnAddr))
-> (ntnAddr, Either SomeException (PeerSharingResult ntnAddr))
-> (ntnAddr, Either String (PeerSharingResult ntnAddr))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>) [(ntnAddr, Either SomeException (PeerSharingResult ntnAddr))]
res)
             ]
  forMachine DetailLevel
_dtal (TracePeerShareResultsFiltered [ntnAddr]
res) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PeerShareResultsFiltered"
             , Key
"result" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [ntnAddr] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList [ntnAddr]
res
             ]
  forMachine DetailLevel
_dtal (TracePromoteColdPeers Int
targetKnown Int
actualKnown Set ntnAddr
sp) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PromoteColdPeers"
             , Key
"targetEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
targetKnown
             , Key
"actualEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
actualKnown
             , Key
"selectedPeers" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [ntnAddr] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList (Set ntnAddr -> [ntnAddr]
forall a. Set a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList Set ntnAddr
sp)
             ]
  forMachine DetailLevel
_dtal (TracePromoteColdLocalPeers [(WarmValency, Int)]
tLocalEst Set ntnAddr
sp) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PromoteColdLocalPeers"
             , Key
"targetLocalEstablished" Key -> [(WarmValency, Int)] -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [(WarmValency, Int)]
tLocalEst
             , Key
"selectedPeers" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [ntnAddr] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList (Set ntnAddr -> [ntnAddr]
forall a. Set a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList Set ntnAddr
sp)
             ]
  {-- TODO: `forgotten` added here but not in cardano-node master
   -- See: f9ae41a8962174e4f7d7e93d81f70f1c88cef263
  --}
  forMachine DetailLevel
_dtal (TracePromoteColdFailed Int
tEst Int
aEst ntnAddr
p DiffTime
d SomeException
err Bool
forgotten) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PromoteColdFailed"
             , Key
"targetEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tEst
             , Key
"actualEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aEst
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             , Key
"delay" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DiffTime -> Value
forall a. ToJSON a => a -> Value
toJSON DiffTime
d
             , Key
"reason" Key -> String -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= SomeException -> String
forall a. Show a => a -> String
show SomeException
err
             , Key
"forgotten" Key -> Bool -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Bool
forgotten
             ]
  forMachine DetailLevel
_dtal (TracePromoteColdDone Int
tEst Int
aEst ntnAddr
p) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PromoteColdDone"
             , Key
"targetEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tEst
             , Key
"actualEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aEst
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             ]
  forMachine DetailLevel
_dtal (TracePromoteColdBigLedgerPeers Int
targetKnown Int
actualKnown Set ntnAddr
sp) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PromoteColdBigLedgerPeers"
             , Key
"targetEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
targetKnown
             , Key
"actualEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
actualKnown
             , Key
"selectedPeers" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [ntnAddr] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList (Set ntnAddr -> [ntnAddr]
forall a. Set a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList Set ntnAddr
sp)
             ]
  {-- TODO: `forgotten` added here but not in cardano-node master
   -- See: f9ae41a8962174e4f7d7e93d81f70f1c88cef263
  --}
  forMachine DetailLevel
_dtal (TracePromoteColdBigLedgerPeerFailed Int
tEst Int
aEst ntnAddr
p DiffTime
d SomeException
err Bool
forgotten) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PromoteColdBigLedgerPeerFailed"
             , Key
"targetEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tEst
             , Key
"actualEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aEst
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             , Key
"delay" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DiffTime -> Value
forall a. ToJSON a => a -> Value
toJSON DiffTime
d
             , Key
"reason" Key -> String -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= SomeException -> String
forall a. Show a => a -> String
show SomeException
err
             , Key
"forgotten" Key -> Bool -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Bool
forgotten
             ]
  forMachine DetailLevel
_dtal (TracePromoteColdBigLedgerPeerDone Int
tEst Int
aEst ntnAddr
p) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PromoteColdBigLedgerPeerDone"
             , Key
"targetEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tEst
             , Key
"actualEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aEst
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             ]
  forMachine DetailLevel
_dtal (TracePromoteWarmPeers Int
tActive Int
aActive Set ntnAddr
sp) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PromoteWarmPeers"
             , Key
"targetActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tActive
             , Key
"actualActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aActive
             , Key
"selectedPeers" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [ntnAddr] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList (Set ntnAddr -> [ntnAddr]
forall a. Set a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList Set ntnAddr
sp)
             ]
  forMachine DetailLevel
_dtal (TracePromoteWarmLocalPeers [(HotValency, Int)]
taa Set ntnAddr
sp) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PromoteWarmLocalPeers"
             , Key
"targetActualActive" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [(HotValency, Int)] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList [(HotValency, Int)]
taa
             , Key
"selectedPeers" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [ntnAddr] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList (Set ntnAddr -> [ntnAddr]
forall a. Set a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList Set ntnAddr
sp)
             ]
  forMachine DetailLevel
_dtal (TracePromoteWarmFailed Int
tActive Int
aActive ntnAddr
p SomeException
err) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PromoteWarmFailed"
             , Key
"targetActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tActive
             , Key
"actualActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aActive
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             , Key
"reason" Key -> String -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= SomeException -> String
forall a. Show a => a -> String
show SomeException
err
             ]
  forMachine DetailLevel
_dtal (TracePromoteWarmDone Int
tActive Int
aActive ntnAddr
p) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PromoteWarmDone"
             , Key
"targetActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tActive
             , Key
"actualActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aActive
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             ]
  forMachine DetailLevel
_dtal (TracePromoteWarmAborted Int
tActive Int
aActive ntnAddr
p) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PromoteWarmAborted"
             , Key
"targetActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tActive
             , Key
"actualActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aActive
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             ]
  forMachine DetailLevel
_dtal (TracePromoteWarmBigLedgerPeers Int
tActive Int
aActive Set ntnAddr
sp) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PromoteWarmBigLedgerPeers"
             , Key
"targetActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tActive
             , Key
"actualActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aActive
             , Key
"selectedPeers" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [ntnAddr] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList (Set ntnAddr -> [ntnAddr]
forall a. Set a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList Set ntnAddr
sp)
             ]
  forMachine DetailLevel
_dtal (TracePromoteWarmBigLedgerPeerFailed Int
tActive Int
aActive ntnAddr
p SomeException
err) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PromoteWarmBigLedgerPeerFailed"
             , Key
"targetActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tActive
             , Key
"actualActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aActive
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             , Key
"reason" Key -> String -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= SomeException -> String
forall a. Show a => a -> String
show SomeException
err
             ]
  forMachine DetailLevel
_dtal (TracePromoteWarmBigLedgerPeerDone Int
tActive Int
aActive ntnAddr
p) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PromoteWarmBigLedgerPeerDone"
             , Key
"targetActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tActive
             , Key
"actualActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aActive
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             ]
  forMachine DetailLevel
_dtal (TracePromoteWarmBigLedgerPeerAborted Int
tActive Int
aActive ntnAddr
p) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PromoteWarmBigLedgerPeerAborted"
             , Key
"targetActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tActive
             , Key
"actualActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aActive
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             ]
  forMachine DetailLevel
_dtal (TraceDemoteWarmPeers Int
tEst Int
aEst Set ntnAddr
sp) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"DemoteWarmPeers"
             , Key
"targetEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tEst
             , Key
"actualEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aEst
             , Key
"selectedPeers" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [ntnAddr] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList (Set ntnAddr -> [ntnAddr]
forall a. Set a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList Set ntnAddr
sp)
             ]
  forMachine DetailLevel
_dtal (TraceDemoteWarmFailed Int
tEst Int
aEst ntnAddr
p SomeException
err) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"DemoteWarmFailed"
             , Key
"targetEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tEst
             , Key
"actualEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aEst
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             , Key
"reason" Key -> String -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= SomeException -> String
forall a. Show a => a -> String
show SomeException
err
             ]
  forMachine DetailLevel
_dtal (TraceDemoteWarmDone Int
tEst Int
aEst ntnAddr
p) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"DemoteWarmDone"
             , Key
"targetEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tEst
             , Key
"actualEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aEst
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             ]
  forMachine DetailLevel
_dtal (TraceDemoteWarmBigLedgerPeers Int
tEst Int
aEst Set ntnAddr
sp) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"DemoteWarmBigLedgerPeers"
             , Key
"targetEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tEst
             , Key
"actualEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aEst
             , Key
"selectedPeers" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [ntnAddr] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList (Set ntnAddr -> [ntnAddr]
forall a. Set a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList Set ntnAddr
sp)
             ]
  forMachine DetailLevel
_dtal (TraceDemoteWarmBigLedgerPeerFailed Int
tEst Int
aEst ntnAddr
p SomeException
err) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"DemoteWarmBigLedgerPeerFailed"
             , Key
"targetEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tEst
             , Key
"actualEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aEst
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             , Key
"reason" Key -> String -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= SomeException -> String
forall a. Show a => a -> String
show SomeException
err
             ]
  forMachine DetailLevel
_dtal (TraceDemoteWarmBigLedgerPeerDone Int
tEst Int
aEst ntnAddr
p) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"DemoteWarmBigLedgerPeerDone"
             , Key
"targetEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tEst
             , Key
"actualEstablished" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aEst
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             ]
  forMachine DetailLevel
_dtal (TraceDemoteHotPeers Int
tActive Int
aActive Set ntnAddr
sp) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"DemoteHotPeers"
             , Key
"targetActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tActive
             , Key
"actualActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aActive
             , Key
"selectedPeers" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [ntnAddr] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList (Set ntnAddr -> [ntnAddr]
forall a. Set a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList Set ntnAddr
sp)
             ]
  forMachine DetailLevel
_dtal (TraceDemoteLocalHotPeers [(HotValency, Int)]
taa Set ntnAddr
sp) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"DemoteLocalHotPeers"
             , Key
"targetActualActive" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [(HotValency, Int)] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList [(HotValency, Int)]
taa
             , Key
"selectedPeers" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [ntnAddr] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList (Set ntnAddr -> [ntnAddr]
forall a. Set a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList Set ntnAddr
sp)
             ]
  forMachine DetailLevel
_dtal (TraceDemoteHotFailed Int
tActive Int
aActive ntnAddr
p SomeException
err) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"DemoteHotFailed"
             , Key
"targetActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tActive
             , Key
"actualActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aActive
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             , Key
"reason" Key -> String -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= SomeException -> String
forall a. Show a => a -> String
show SomeException
err
             ]
  forMachine DetailLevel
_dtal (TraceDemoteHotDone Int
tActive Int
aActive ntnAddr
p) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"DemoteHotDone"
             , Key
"targetActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tActive
             , Key
"actualActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aActive
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             ]
  forMachine DetailLevel
_dtal (TraceDemoteHotBigLedgerPeers Int
tActive Int
aActive Set ntnAddr
sp) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"DemoteHotBigLedgerPeers"
             , Key
"targetActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tActive
             , Key
"actualActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aActive
             , Key
"selectedPeers" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [ntnAddr] -> Value
forall a. ToJSON a => [a] -> Value
toJSONList (Set ntnAddr -> [ntnAddr]
forall a. Set a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList Set ntnAddr
sp)
             ]
  forMachine DetailLevel
_dtal (TraceDemoteHotBigLedgerPeerFailed Int
tActive Int
aActive ntnAddr
p SomeException
err) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"DemoteHotBigLedgerPeerFailed"
             , Key
"targetActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tActive
             , Key
"actualActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aActive
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             , Key
"reason" Key -> String -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= SomeException -> String
forall a. Show a => a -> String
show SomeException
err
             ]
  forMachine DetailLevel
_dtal (TraceDemoteHotBigLedgerPeerDone Int
tActive Int
aActive ntnAddr
p) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"DemoteHotBigLedgerPeerDone"
             , Key
"targetActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
tActive
             , Key
"actualActive" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
aActive
             , Key
"peer" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ntnAddr -> Value
forall a. ToJSON a => a -> Value
toJSON ntnAddr
p
             ]
  forMachine DetailLevel
_dtal (TraceDemoteAsynchronous Map ntnAddr (PeerStatus, Maybe RepromoteDelay)
msp) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"DemoteAsynchronous"
             , Key
"state" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Map ntnAddr (PeerStatus, Maybe RepromoteDelay) -> Value
forall a. ToJSON a => a -> Value
toJSON Map ntnAddr (PeerStatus, Maybe RepromoteDelay)
msp
             ]
  forMachine DetailLevel
_dtal (TraceDemoteLocalAsynchronous Map ntnAddr (PeerStatus, Maybe RepromoteDelay)
msp) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"DemoteLocalAsynchronous"
             , Key
"state" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Map ntnAddr (PeerStatus, Maybe RepromoteDelay) -> Value
forall a. ToJSON a => a -> Value
toJSON Map ntnAddr (PeerStatus, Maybe RepromoteDelay)
msp
             ]
  forMachine DetailLevel
_dtal (TraceDemoteBigLedgerPeersAsynchronous Map ntnAddr (PeerStatus, Maybe RepromoteDelay)
msp) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"DemoteBigLedgerPeerAsynchronous"
             , Key
"state" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Map ntnAddr (PeerStatus, Maybe RepromoteDelay) -> Value
forall a. ToJSON a => a -> Value
toJSON Map ntnAddr (PeerStatus, Maybe RepromoteDelay)
msp
             ]
  forMachine DetailLevel
_dtal TracePeerSelection
  extraDebugState extraFlags extraPeers extraTrace ntnAddr
TraceGovernorWakeup =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"GovernorWakeup"
             ]
  forMachine DetailLevel
_dtal (TraceChurnWait DiffTime
dt) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"ChurnWait"
             , Key
"diffTime" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DiffTime -> Value
forall a. ToJSON a => a -> Value
toJSON DiffTime
dt
             ]
  forMachine DetailLevel
_dtal (TracePickInboundPeers Int
targetNumberOfKnownPeers Int
numberOfKnownPeers Map ntnAddr PeerSharing
selected Set ntnAddr
available) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"PickInboundPeers"
            , Key
"targetKnown" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
targetNumberOfKnownPeers
            , Key
"actualKnown" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
numberOfKnownPeers
            , Key
"selected" Key -> Map ntnAddr PeerSharing -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Map ntnAddr PeerSharing
selected
            , Key
"available" Key -> Set ntnAddr -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Set ntnAddr
available
            ]
{-- TODO: Before "cardano-diffusion" removal:
  forMachine _dtal (TraceLedgerStateJudgementChanged new) =
    mconcat [ "kind" .= String "LedgerStateJudgementChanged"
            , "new" .= show new ]
--}
  forMachine DetailLevel
_dtal TracePeerSelection
  extraDebugState extraFlags extraPeers extraTrace ntnAddr
TraceOnlyBootstrapPeers =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"LedgerStateJudgementChanged" ]
{-- TODO: Before "cardano-diffusion" removal:
  forMachine _dtal (TraceUseBootstrapPeersChanged ubp) =
    mconcat [ "kind" .= String "UseBootstrapPeersChanged"
            , "useBootstrapPeers" .= toJSON ubp ]
--}
  forMachine DetailLevel
_dtal TracePeerSelection
  extraDebugState extraFlags extraPeers extraTrace ntnAddr
TraceBootstrapPeersFlagChangedWhilstInSensitiveState =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"BootstrapPeersFlagChangedWhilstInSensitiveState"
            ]
  forMachine DetailLevel
_dtal (TraceVerifyPeerSnapshot Bool
result) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"VerifyPeerSnapshot"
            , Key
"result" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Bool -> Value
forall a. ToJSON a => a -> Value
toJSON Bool
result ]
  forMachine DetailLevel
_dtal (TraceOutboundGovernorCriticalFailure SomeException
err) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"OutboundGovernorCriticalFailure"
            , Key
"reason" Key -> String -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= SomeException -> String
forall a. Show a => a -> String
show SomeException
err
            ]
  forMachine DetailLevel
_dtal (TraceChurnAction DiffTime
duration ChurnAction
action Int
counter) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"ChurnAction"
            , Key
"action" Key -> String -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ChurnAction -> String
forall a. Show a => a -> String
show ChurnAction
action
            , Key
"counter" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
counter
            , Key
"duration" Key -> DiffTime -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DiffTime
duration
            ]
  forMachine DetailLevel
_dtal (TraceChurnTimeout DiffTime
duration ChurnAction
action Int
counter) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"ChurnTimeout"
            , Key
"action" Key -> String -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ChurnAction -> String
forall a. Show a => a -> String
show ChurnAction
action
            , Key
"counter" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Int
counter
            , Key
"duration" Key -> DiffTime -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DiffTime
duration
            ]
  forMachine DetailLevel
_dtal (TraceDebugState Time
mtime DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"DebugState"
            , Key
"monotonicTime" Key -> String -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Time -> String
forall a. Show a => a -> String
show Time
mtime
            , Key
"targets" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= PeerSelectionTargets -> Value
peerSelectionTargetsToObject (DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> PeerSelectionTargets
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> PeerSelectionTargets
dpssTargets DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds)
            , Key
"localRootPeers" Key -> LocalRootPeers extraFlags ntnAddr -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> LocalRootPeers extraFlags ntnAddr
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> LocalRootPeers extraFlags peeraddr
dpssLocalRootPeers DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds
            , Key
"publicRootPeers" Key -> PublicRootPeers extraPeers ntnAddr -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> PublicRootPeers extraPeers ntnAddr
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> PublicRootPeers extraPeers peeraddr
dpssPublicRootPeers DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds
            , Key
"knownPeers" Key -> Map ntnAddr KnownPeerInfo -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= KnownPeers ntnAddr -> Map ntnAddr KnownPeerInfo
forall peeraddr. KnownPeers peeraddr -> Map peeraddr KnownPeerInfo
KnownPeers.allPeers (DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> KnownPeers ntnAddr
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> KnownPeers peeraddr
dpssKnownPeers DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds)
            , Key
"establishedPeers" Key -> Set ntnAddr -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> Set ntnAddr
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> Set peeraddr
dpssEstablishedPeers DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds
            , Key
"activePeers" Key -> Set ntnAddr -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> Set ntnAddr
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> Set peeraddr
dpssActivePeers DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds
            , Key
"publicRootBackoffs" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> Int
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> Int
dpssPublicRootBackoffs DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds
            , Key
"publicRootRetryTime" Key -> Time -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> Time
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> Time
dpssPublicRootRetryTime DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds
            , Key
"bigLedgerPeerBackoffs" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> Int
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> Int
dpssBigLedgerPeerBackoffs DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds
            , Key
"bigLedgerPeerRetryTime" Key -> Time -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> Time
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> Time
dpssBigLedgerPeerRetryTime DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds
            , Key
"inProgressBigLedgerPeersReq" Key -> Bool -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> Bool
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> Bool
dpssInProgressBigLedgerPeersReq DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds
            , Key
"inProgressPeerShareReqs" Key -> Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> Int
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> Int
dpssInProgressPeerShareReqs DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds
            , Key
"inProgressPromoteCold" Key -> Set ntnAddr -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> Set ntnAddr
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> Set peeraddr
dpssInProgressPromoteCold DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds
            , Key
"inProgressPromoteWarm" Key -> Set ntnAddr -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> Set ntnAddr
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> Set peeraddr
dpssInProgressPromoteWarm DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds
            , Key
"inProgressDemoteWarm" Key -> Set ntnAddr -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> Set ntnAddr
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> Set peeraddr
dpssInProgressDemoteWarm DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds
            , Key
"inProgressDemoteHot" Key -> Set ntnAddr -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> Set ntnAddr
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> Set peeraddr
dpssInProgressDemoteHot DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds
            , Key
"inProgressDemoteToCold" Key -> Set ntnAddr -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> Set ntnAddr
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> Set peeraddr
dpssInProgressDemoteToCold DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds
            , Key
"upstreamyness" Key -> Map ntnAddr Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> Map ntnAddr Int
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> Map peeraddr Int
dpssUpstreamyness DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds
            , Key
"fetchynessBlocks" Key -> Map ntnAddr Int -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
-> Map ntnAddr Int
forall extraState extraFlags extraPeers peeraddr.
DebugPeerSelectionState extraState extraFlags extraPeers peeraddr
-> Map peeraddr Int
dpssFetchynessBlocks DebugPeerSelectionState
  extraDebugState extraFlags extraPeers ntnAddr
ds
            ]
  {-- TODO: Implementation for `ExtraTrace` was added here but it's not present
   -- in cardano-node master.
   --}
  forMachine DetailLevel
_dtal (ExtraTrace extraTrace
tr) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"ExtraTrace"
            , Key
"event" Key -> Value -> Object
forall v. ToJSON v => Key -> v -> Object
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ extraTrace -> String
forall a. Show a => a -> String
show extraTrace
tr)
            ]

  forHuman :: TracePeerSelection
  extraDebugState extraFlags extraPeers extraTrace ntnAddr
-> Text
forHuman = String -> Text
pack (String -> Text)
-> (TracePeerSelection
      extraDebugState extraFlags extraPeers extraTrace ntnAddr
    -> String)
-> TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace ntnAddr
-> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TracePeerSelection
  extraDebugState extraFlags extraPeers extraTrace ntnAddr
-> String
forall a. Show a => a -> String
show

  asMetrics :: TracePeerSelection
  extraDebugState extraFlags extraPeers extraTrace ntnAddr
-> [Metric]
asMetrics (TraceChurnAction DiffTime
duration ChurnAction
action Int
_) =
    [ Text -> Double -> Metric
DoubleM (Text
"peerSelection.churn" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> String -> Text
pack (ChurnAction -> String
forall a. Show a => a -> String
show ChurnAction
action) Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
".duration")
              (DiffTime -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac DiffTime
duration)
    ]
  asMetrics TracePeerSelection
  extraDebugState extraFlags extraPeers extraTrace ntnAddr
_ = []

{-- TODO: `extraTrace` was added here but no in cardano-node master:
-- instance MetaTrace (TracePeerSelection extraDebugState extraFlags extraPeers SockAddr) where
--}
instance MetaTrace (TracePeerSelection extraDebugState extraFlags extraPeers extraTrace SockAddr) where
    namespaceFor :: TracePeerSelection
  extraDebugState extraFlags extraPeers extraTrace SockAddr
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
namespaceFor TraceLocalRootPeersChanged {} =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"LocalRootPeersChanged"]
    namespaceFor TraceTargetsChanged {}        =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"TargetsChanged"]
    namespaceFor TracePublicRootsRequest {}    =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PublicRootsRequest"]
    namespaceFor TracePublicRootsResults {}    =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PublicRootsResults"]
    namespaceFor TracePublicRootsFailure {}    =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PublicRootsFailure"]
    namespaceFor TraceForgetColdPeers {}       =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ForgetColdPeers"]
    namespaceFor TraceBigLedgerPeersRequest {}    =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"BigLedgerPeersRequest"]
    namespaceFor TraceBigLedgerPeersResults {}    =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"BigLedgerPeersResults"]
    namespaceFor TraceBigLedgerPeersFailure {}    =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"BigLedgerPeersFailure"]
    namespaceFor TraceForgetBigLedgerPeers {}       =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ForgetBigLedgerPeers"]
    namespaceFor TracePeerShareRequests {}     =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PeerShareRequests"]
    namespaceFor TracePeerShareResults {}      =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PeerShareResults"]
    namespaceFor TracePeerShareResultsFiltered {} =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PeerShareResultsFiltered"]
    namespaceFor TracePickInboundPeers {} =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PickInboundPeers"]
    namespaceFor TracePromoteColdPeers {}      =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteColdPeers"]
    namespaceFor TracePromoteColdLocalPeers {} =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteColdLocalPeers"]
    namespaceFor TracePromoteColdFailed {}     =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteColdFailed"]
    namespaceFor TracePromoteColdDone {}       =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteColdDone"]
    namespaceFor TracePromoteColdBigLedgerPeers {}      =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteColdBigLedgerPeers"]
    namespaceFor TracePromoteColdBigLedgerPeerFailed {}     =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteColdBigLedgerPeerFailed"]
    namespaceFor TracePromoteColdBigLedgerPeerDone {}       =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteColdBigLedgerPeerDone"]
    namespaceFor TracePromoteWarmPeers {}      =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmPeers"]
    namespaceFor TracePromoteWarmLocalPeers {} =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmLocalPeers"]
    namespaceFor TracePromoteWarmFailed {}     =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmFailed"]
    namespaceFor TracePromoteWarmDone {}       =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmDone"]
    namespaceFor TracePromoteWarmAborted {}    =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmAborted"]
    namespaceFor TracePromoteWarmBigLedgerPeers {}      =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmBigLedgerPeers"]
    namespaceFor TracePromoteWarmBigLedgerPeerFailed {}     =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmBigLedgerPeerFailed"]
    namespaceFor TracePromoteWarmBigLedgerPeerDone {}       =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmBigLedgerPeerDone"]
    namespaceFor TracePromoteWarmBigLedgerPeerAborted {}    =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmBigLedgerPeerAborted"]
    namespaceFor TraceDemoteWarmPeers {}       =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteWarmPeers"]
    namespaceFor (TraceDemoteWarmFailed Int
_ Int
_ SockAddr
_ SomeException
e) =
      case SomeException -> Maybe DemotionTimeoutException
forall e. Exception e => SomeException -> Maybe e
fromException SomeException
e :: Maybe DemotionTimeoutException of
        Just DemotionTimeoutException
_  -> [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteWarmFailed", Text
"CoolingToColdTimeout"]
        Maybe DemotionTimeoutException
Nothing -> [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteWarmFailed"]
    namespaceFor TraceDemoteWarmDone {}        =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteWarmDone"]
    namespaceFor TraceDemoteWarmBigLedgerPeers {}       =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteWarmBigLedgerPeers"]
    namespaceFor (TraceDemoteWarmBigLedgerPeerFailed Int
_ Int
_ SockAddr
_ SomeException
e) =
      case SomeException -> Maybe DemotionTimeoutException
forall e. Exception e => SomeException -> Maybe e
fromException SomeException
e :: Maybe DemotionTimeoutException of
        Just DemotionTimeoutException
_  -> [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteWarmBigLedgerPeerFailed", Text
"CoolingToColdTimeout"]
        Maybe DemotionTimeoutException
Nothing -> [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteWarmBigLedgerPeerFailed"]
    namespaceFor TraceDemoteWarmBigLedgerPeerDone {}        =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteWarmBigLedgerPeerDone"]
    namespaceFor TraceDemoteHotPeers {}        =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteHotPeers"]
    namespaceFor TraceDemoteLocalHotPeers {}   =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteLocalHotPeers"]
    namespaceFor (TraceDemoteHotFailed Int
_ Int
_ SockAddr
_ SomeException
e)  =
      case SomeException -> Maybe DemotionTimeoutException
forall e. Exception e => SomeException -> Maybe e
fromException SomeException
e :: Maybe DemotionTimeoutException of
        Just DemotionTimeoutException
_  -> [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteHotFailed", Text
"CoolingToColdTimeout"]
        Maybe DemotionTimeoutException
Nothing -> [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteHotFailed"]
    namespaceFor TraceDemoteHotDone {}         =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteHotDone"]
    namespaceFor TraceDemoteHotBigLedgerPeers {}        =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteHotBigLedgerPeers"]
    namespaceFor (TraceDemoteHotBigLedgerPeerFailed Int
_ Int
_ SockAddr
_ SomeException
e)  =
      case SomeException -> Maybe DemotionTimeoutException
forall e. Exception e => SomeException -> Maybe e
fromException SomeException
e :: Maybe DemotionTimeoutException of
        Just DemotionTimeoutException
_  -> [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteHotBigLedgerPeerFailed", Text
"CoolingToColdTimeout"]
        Maybe DemotionTimeoutException
Nothing -> [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteHotBigLedgerPeerFailed"]
    namespaceFor TraceDemoteHotBigLedgerPeerDone {}         =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteHotBigLedgerPeerDone"]
    namespaceFor TraceDemoteAsynchronous {}    =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteAsynchronous"]
    namespaceFor TraceDemoteLocalAsynchronous {} =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteLocalAsynchronous"]
    namespaceFor TraceDemoteBigLedgerPeersAsynchronous {} =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteBigLedgerPeersAsynchronous"]
    namespaceFor TraceGovernorWakeup {}        =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"GovernorWakeup"]
    namespaceFor TraceChurnWait {}             =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ChurnWait"]
{-- TODO: Before "cardano-diffusion" removal:
    namespaceFor TraceLedgerStateJudgementChanged {} =
      Namespace [] ["LedgerStateJudgementChanged"]
--}
    namespaceFor TraceOnlyBootstrapPeers {} =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"OnlyBootstrapPeers"]
{-- TODO: Before "cardano-diffusion" removal:
    namespaceFor TraceUseBootstrapPeersChanged {} =
      Namespace [] ["UseBootstrapPeersChanged"]
--}
    namespaceFor TraceVerifyPeerSnapshot {} =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"VerifyPeerSnapshot"]
    namespaceFor TracePeerSelection
  extraDebugState extraFlags extraPeers extraTrace SockAddr
TraceBootstrapPeersFlagChangedWhilstInSensitiveState =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"BootstrapPeersFlagChangedWhilstInSensitiveState"]
    namespaceFor TraceOutboundGovernorCriticalFailure {} =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"OutboundGovernorCriticalFailure"]
    namespaceFor TraceChurnAction {} =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ChurnAction"]
    namespaceFor TraceChurnTimeout {} =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ChurnTimeout"]
    namespaceFor TraceDebugState {} =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DebugState"]
    namespaceFor (ExtraTrace extraTrace
_) =
      [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ExtraTrace"]

    severityFor :: Namespace
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
-> Maybe
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
-> Maybe SeverityS
severityFor (Namespace [] [Text
"LocalRootPeersChanged"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Notice
    severityFor (Namespace [] [Text
"TargetsChanged"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Notice
    severityFor (Namespace [] [Text
"PublicRootsRequest"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PublicRootsResults"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PublicRootsFailure"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Error
    severityFor (Namespace [] [Text
"ForgetColdPeers"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"BigLedgerPeersRequest"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"BigLedgerPeersResults"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"BigLedgerPeersFailure"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"ForgetBigLedgerPeers"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PeerShareRequests"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
    severityFor (Namespace [] [Text
"PeerShareResults"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
    severityFor (Namespace [] [Text
"PeerShareResultsFiltered"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PickInboundPeers"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PromoteColdPeers"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PromoteColdLocalPeers"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PromoteColdFailed"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PromoteColdDone"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PromoteColdBigLedgerPeers"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PromoteColdBigLedgerPeerFailed"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PromoteColdBigLedgerPeerDone"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PromoteWarmPeers"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PromoteWarmLocalPeers"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PromoteWarmFailed"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PromoteWarmDone"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PromoteWarmAborted"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PromoteWarmBigLedgerPeers"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PromoteWarmBigLedgerPeerFailed"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PromoteWarmBigLedgerPeerDone"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"PromoteWarmBigLedgerPeerAborted"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"DemoteWarmPeers"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"DemoteWarmFailed"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"DemoteWarmFailed", Text
"CoolingToColdTimeout"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Error
    severityFor (Namespace [] [Text
"DemoteWarmDone"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"DemoteWarmBigLedgerPeers"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"DemoteWarmBigLedgerPeerFailed"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"DemoteWarmBigLedgerPeerFailed", Text
"CoolingToColdTimeout"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Error
    severityFor (Namespace [] [Text
"DemoteWarmBigLedgerPeerDone"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"DemoteHotPeers"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"DemoteLocalHotPeers"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"DemoteHotFailed"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"DemoteHotFailed", Text
"CoolingToColdTimeout"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Error
    severityFor (Namespace [] [Text
"DemoteHotDone"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"DemoteHotBigLedgerPeers"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"DemoteHotBigLedgerPeerFailed"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"DemoteHotBigLedgerPeerFailed", Text
"CoolingToColdTimeout"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Error
    severityFor (Namespace [] [Text
"DemoteHotBigLedgerPeerDone"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"DemoteAsynchronous"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"DemoteLocalAsynchronous"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Warning
    severityFor (Namespace [] [Text
"DemoteBigLedgerPeersAsynchronous"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"GovernorWakeup"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"ChurnWait"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"LedgerStateJudgementChanged"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"OnlyBootstrapPeers"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"UseBootstrapPeersChanged"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Notice
    severityFor (Namespace [] [Text
"VerifyPeerSnapshot"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Error
    severityFor (Namespace [] [Text
"BootstrapPeersFlagChangedWhilstInSensitiveState"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Warning
    severityFor (Namespace [] [Text
"OutboundGovernorCriticalFailure"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Error
    severityFor (Namespace [] [Text
"ChurnAction"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"ChurnTimeout"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Notice
    severityFor (Namespace [] [Text
"DebugState"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Info
    severityFor (Namespace [] [Text
"ExtraTrace"]) Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = SeverityS -> Maybe SeverityS
forall a. a -> Maybe a
Just SeverityS
Debug
    severityFor Namespace
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ Maybe
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = Maybe SeverityS
forall a. Maybe a
Nothing

    documentFor :: Namespace
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
-> Maybe Text
documentFor (Namespace [] [Text
"LocalRootPeersChanged"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just  Text
""
    documentFor (Namespace [] [Text
"TargetsChanged"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just  Text
""
    documentFor (Namespace [] [Text
"PublicRootsRequest"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just  Text
""
    documentFor (Namespace [] [Text
"PublicRootsResults"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just  Text
""
    documentFor (Namespace [] [Text
"PublicRootsFailure"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just  Text
""
    documentFor (Namespace [] [Text
"PeerShareRequests"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just (Text -> Maybe Text) -> Text -> Maybe Text
forall a b. (a -> b) -> a -> b
$ [Text] -> Text
forall a. Monoid a => [a] -> a
mconcat
      [ Text
"target known peers, actual known peers, peers available for gossip,"
      , Text
" peers selected for gossip"
      ]
    documentFor (Namespace [] [Text
"PeerShareResults"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just  Text
""
    documentFor (Namespace [] [Text
"ForgetColdPeers"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"target known peers, actual known peers, selected peers"
    documentFor (Namespace [] [Text
"PromoteColdPeers"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"target established, actual established, selected peers"
    documentFor (Namespace [] [Text
"PromoteColdLocalPeers"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"target local established, actual local established, selected peers"
    documentFor (Namespace [] [Text
"PromoteColdFailed"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just (Text -> Maybe Text) -> Text -> Maybe Text
forall a b. (a -> b) -> a -> b
$ [Text] -> Text
forall a. Monoid a => [a] -> a
mconcat
      [ Text
"target established, actual established, peer, delay until next"
      , Text
" promotion, reason"
      ]
    documentFor (Namespace [] [Text
"PromoteColdDone"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"target active, actual active, selected peers"
    documentFor (Namespace [] [Text
"PromoteWarmPeers"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"target active, actual active, selected peers"
    documentFor (Namespace [] [Text
"PromoteWarmLocalPeers"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"local per-group (target active, actual active), selected peers"
    documentFor (Namespace [] [Text
"PromoteWarmFailed"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"target active, actual active, peer, reason"
    documentFor (Namespace [] [Text
"PromoteWarmDone"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"target active, actual active, peer"
    documentFor (Namespace [] [Text
"PromoteWarmAborted"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just Text
""
    documentFor (Namespace [] [Text
"DemoteWarmPeers"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"target established, actual established, selected peers"
    documentFor (Namespace [] [Text
"DemoteWarmFailed"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"target established, actual established, peer, reason"
    documentFor (Namespace [] [Text
"DemoteWarmFailed", Text
"CoolingToColdTimeout"]) =
      Text -> Maybe Text
forall a. a -> Maybe a
Just Text
"Impossible asynchronous demotion timeout"
    documentFor (Namespace [] [Text
"DemoteWarmBigLedgerPeerFailed", Text
"CoolingToColdTimeout"]) =
      Text -> Maybe Text
forall a. a -> Maybe a
Just Text
"Impossible asynchronous demotion timeout"
    documentFor (Namespace [] [Text
"DemoteWarmDone"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"target established, actual established, peer"
    documentFor (Namespace [] [Text
"DemoteHotPeers"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"target active, actual active, selected peers"
    documentFor (Namespace [] [Text
"DemoteLocalHotPeers"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"local per-group (target active, actual active), selected peers"
    documentFor (Namespace [] [Text
"DemoteHotFailed"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"target active, actual active, peer, reason"
    documentFor (Namespace [] [Text
"DemoteHotFailed", Text
"CoolingToColdTimeout"]) =
      Text -> Maybe Text
forall a. a -> Maybe a
Just Text
"Impossible asynchronous demotion timeout"
    documentFor (Namespace [] [Text
"DemoteHotBigLedgerPeerFailed", Text
"CoolingToColdTimeout"]) =
      Text -> Maybe Text
forall a. a -> Maybe a
Just Text
"Impossible asynchronous demotion timeout"
    documentFor (Namespace [] [Text
"DemoteHotDone"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"target active, actual active, peer"
    documentFor (Namespace [] [Text
"DemoteAsynchronous"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just  Text
""
    documentFor (Namespace [] [Text
"DemoteLocalAsynchronous"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just  Text
""
    documentFor (Namespace [] [Text
"GovernorWakeup"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just  Text
""
    documentFor (Namespace [] [Text
"ChurnWait"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just  Text
""
    documentFor (Namespace [] [Text
"PickInboundPeers"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"An inbound connection was added to known set of outbound governor"
    documentFor (Namespace [] [Text
"OutboundGovernorCriticalFailure"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"Outbound Governor was killed unexpectedly"
    documentFor (Namespace [] [Text
"DebugState"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just
      Text
"peer selection internal state"
    {-- TODO: Implementation for `ExtraTrace` was added here but it's not present
     -- in cardano-node master.
     --}
    documentFor (Namespace [] [Text
"ExtraTrace"]) = Text -> Maybe Text
forall a. a -> Maybe a
Just Text
""
    documentFor Namespace
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = Maybe Text
forall a. Maybe a
Nothing

    metricsDocFor :: Namespace
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
-> [(Text, Text)]
metricsDocFor (Namespace [] [Text
"ChurnAction"]) =
     [ (Text
"peerSelection.churn.DecreasedActivePeers.duration", Text
"")
     , (Text
"peerSelection.churn.DecreasedActiveBigLedgerPeers.duration", Text
"")
     , (Text
"peerSelection.churn.DecreasedEstablishedPeers.duration", Text
"")
     , (Text
"peerSelection.churn.DecreasedEstablishedBigLedgerPeers.duration", Text
"")
     , (Text
"peerSelection.churn.DecreasedKnownPeers.duration", Text
"")
     , (Text
"peerSelection.churn.DecreasedKnownBigLedgerPeers.duration", Text
"")
     ]
    metricsDocFor Namespace
  (TracePeerSelection
     extraDebugState extraFlags extraPeers extraTrace SockAddr)
_ = []

    allNamespaces :: [Namespace
   (TracePeerSelection
      extraDebugState extraFlags extraPeers extraTrace SockAddr)]
allNamespaces = [
        [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"LocalRootPeersChanged"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"TargetsChanged"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PublicRootsRequest"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PublicRootsResults"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PublicRootsFailure"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ForgetColdPeers"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"BigLedgerPeersRequest"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"BigLedgerPeersResults"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"BigLedgerPeersFailure"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ForgetBigLedgerPeers"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PeerShareRequests"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PeerShareResults"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PeerShareResultsFiltered"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PickInboundPeers"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteColdPeers"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteColdLocalPeers"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteColdFailed"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteColdDone"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteColdBigLedgerPeers"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteColdBigLedgerPeerFailed"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteColdBigLedgerPeerDone"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmPeers"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmLocalPeers"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmFailed"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmDone"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmAborted"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmBigLedgerPeers"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmBigLedgerPeerFailed"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmBigLedgerPeerDone"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"PromoteWarmBigLedgerPeerAborted"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteWarmPeers"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteWarmFailed"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteWarmFailed", Text
"CoolingToColdTimeout"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteWarmDone"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteWarmBigLedgerPeers"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteWarmBigLedgerPeerFailed"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteWarmBigLedgerPeerFailed", Text
"CoolingToColdTimeout"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteWarmBigLedgerPeerDone"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteHotPeers"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteLocalHotPeers"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteHotFailed"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteHotFailed", Text
"CoolingToColdTimeout"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteHotDone"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteHotBigLedgerPeers"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteHotBigLedgerPeerFailed"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteHotBigLedgerPeerFailed", Text
"CoolingToColdTimeout"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteHotBigLedgerPeerDone"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteAsynchronous"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteLocalAsynchronous"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DemoteBigLedgerPeersAsynchronous"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"GovernorWakeup"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ChurnWait"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ChurnAction"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ChurnTimeout"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"LedgerStateJudgementChanged"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"OnlyBootstrapPeers"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"BootstrapPeersFlagChangedWhilstInSensitiveState"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"UseBootstrapPeersChanged"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"VerifyPeerSnapshot"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"OutboundGovernorCriticalFailure"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"DebugState"]
      , [Text]
-> [Text]
-> Namespace
     (TracePeerSelection
        extraDebugState extraFlags extraPeers extraTrace SockAddr)
forall a. [Text] -> [Text] -> Namespace a
Namespace [] [Text
"ExtraTrace"]
      ]