{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE QuantifiedConstraints #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UndecidableInstances #-}

{-# OPTIONS_GHC -Wno-orphans  #-}

module Cardano.Node.Tracing.Tracers.NodeToClient
  ( severityTChainSync
  , namesForTChainSync
  , docTChainSyncNodeToClient
  , docTChainSyncNodeToNode
  , docTChainSyncNodeToNodeSerisalised

  , severityTTxMonitor
  , namesForTTxMonitor
  , docTTxMonitor

  , severityTTxSubmission
  , namesForTTxSubmission
  , docTTxSubmission

  , severityTStateQuery
  , namesForTStateQuery
  , docTStateQuery
  ) where

import           Cardano.Logging
import           Cardano.Prelude hiding (Show, show)
import           Data.Aeson (Value (String), (.=))
import           Data.Text (pack)
import           Network.TypedProtocol.Codec (AnyMessageAndAgency (..))
import           Text.Show

import           Cardano.Slotting.Slot (SlotNo)

import           Network.Mux.Trace (TraceLabelPeer (..))

import           Ouroboros.Consensus.Ledger.Query (Query)
import           Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr, GenTx, GenTxId)

import           Ouroboros.Network.Block (Point, Serialised, Tip)
import qualified Ouroboros.Network.BlockFetch.ClientState as BlockFetch
import           Ouroboros.Network.Driver.Simple (TraceSendRecv (..))
import           Ouroboros.Network.Protocol.ChainSync.Type as ChainSync
import qualified Ouroboros.Network.Protocol.LocalStateQuery.Type as LSQ
import qualified Ouroboros.Network.Protocol.LocalTxMonitor.Type as LTM
import qualified Ouroboros.Network.Protocol.LocalTxSubmission.Type as LTS


instance LogFormatting (AnyMessageAndAgency ps)
      => LogFormatting (TraceSendRecv ps) where
  forMachine :: DetailLevel -> TraceSendRecv ps -> Object
forMachine DetailLevel
dtal (TraceSendMsg AnyMessageAndAgency ps
m) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
    [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Send" , Key
"msg" Key -> Object -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= DetailLevel -> AnyMessageAndAgency ps -> Object
forall a. LogFormatting a => DetailLevel -> a -> Object
forMachine DetailLevel
dtal AnyMessageAndAgency ps
m ]
  forMachine DetailLevel
dtal (TraceRecvMsg AnyMessageAndAgency ps
m) = [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat
    [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"Recv" , Key
"msg" Key -> Object -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= DetailLevel -> AnyMessageAndAgency ps -> Object
forall a. LogFormatting a => DetailLevel -> a -> Object
forMachine DetailLevel
dtal AnyMessageAndAgency ps
m ]

  forHuman :: TraceSendRecv ps -> Text
forHuman (TraceSendMsg AnyMessageAndAgency ps
m) = Text
"Send: " Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> AnyMessageAndAgency ps -> Text
forall a. LogFormatting a => a -> Text
forHuman AnyMessageAndAgency ps
m
  forHuman (TraceRecvMsg AnyMessageAndAgency ps
m) = Text
"Receive: " Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> AnyMessageAndAgency ps -> Text
forall a. LogFormatting a => a -> Text
forHuman AnyMessageAndAgency ps
m

  asMetrics :: TraceSendRecv ps -> [Metric]
asMetrics (TraceSendMsg AnyMessageAndAgency ps
m) = AnyMessageAndAgency ps -> [Metric]
forall a. LogFormatting a => a -> [Metric]
asMetrics AnyMessageAndAgency ps
m
  asMetrics (TraceRecvMsg AnyMessageAndAgency ps
m) = AnyMessageAndAgency ps -> [Metric]
forall a. LogFormatting a => a -> [Metric]
asMetrics AnyMessageAndAgency ps
m


--------------------------------------------------------------------------------
-- TChainSync Tracer
--------------------------------------------------------------------------------

severityTChainSync :: BlockFetch.TraceLabelPeer peer (TraceSendRecv
    (ChainSync (Serialised blk) (Point blk) (Tip blk))) -> SeverityS
severityTChainSync :: TraceLabelPeer
  peer
  (TraceSendRecv (ChainSync (Serialised blk) (Point blk) (Tip blk)))
-> SeverityS
severityTChainSync (BlockFetch.TraceLabelPeer peer
_ TraceSendRecv (ChainSync (Serialised blk) (Point blk) (Tip blk))
v) = TraceSendRecv (ChainSync (Serialised blk) (Point blk) (Tip blk))
-> SeverityS
forall header point tip.
TraceSendRecv (ChainSync header point tip) -> SeverityS
severityTChainSync' TraceSendRecv (ChainSync (Serialised blk) (Point blk) (Tip blk))
v
  where
    severityTChainSync' :: TraceSendRecv (ChainSync header point tip) -> SeverityS
severityTChainSync' (TraceSendMsg AnyMessageAndAgency (ChainSync header point tip)
msg) = AnyMessageAndAgency (ChainSync header point tip) -> SeverityS
forall header point tip.
AnyMessageAndAgency (ChainSync header point tip) -> SeverityS
severityTChainSync'' AnyMessageAndAgency (ChainSync header point tip)
msg
    severityTChainSync' (TraceRecvMsg AnyMessageAndAgency (ChainSync header point tip)
msg) = AnyMessageAndAgency (ChainSync header point tip) -> SeverityS
forall header point tip.
AnyMessageAndAgency (ChainSync header point tip) -> SeverityS
severityTChainSync'' AnyMessageAndAgency (ChainSync header point tip)
msg

    severityTChainSync'' :: AnyMessageAndAgency (ChainSync header point tip) -> SeverityS
severityTChainSync'' (AnyMessageAndAgency PeerHasAgency pr st
_agency Message (ChainSync header point tip) st st'
msg) = Message (ChainSync header point tip) st st' -> SeverityS
forall header point tip (from :: ChainSync header point tip)
       (to :: ChainSync header point tip).
Message (ChainSync header point tip) from to -> SeverityS
severityTChainSync''' Message (ChainSync header point tip) st st'
msg

    severityTChainSync''' :: Message
                                     (ChainSync header point tip) from to
                                   -> SeverityS
    severityTChainSync''' :: Message (ChainSync header point tip) from to -> SeverityS
severityTChainSync''' MsgRequestNext {}       = SeverityS
Info
    severityTChainSync''' MsgAwaitReply {}        = SeverityS
Info
    severityTChainSync''' MsgRollForward {}       = SeverityS
Info
    severityTChainSync''' MsgRollBackward {}      = SeverityS
Info
    severityTChainSync''' MsgFindIntersect {}     = SeverityS
Info
    severityTChainSync''' MsgIntersectFound {}    = SeverityS
Info
    severityTChainSync''' MsgIntersectNotFound {} = SeverityS
Info
    severityTChainSync''' MsgDone {}              = SeverityS
Info

namesForTChainSync :: BlockFetch.TraceLabelPeer peer (TraceSendRecv
    (ChainSync (Serialised blk) (Point blk) (Tip blk))) -> [Text]
namesForTChainSync :: TraceLabelPeer
  peer
  (TraceSendRecv (ChainSync (Serialised blk) (Point blk) (Tip blk)))
-> [Text]
namesForTChainSync (BlockFetch.TraceLabelPeer peer
_ TraceSendRecv (ChainSync (Serialised blk) (Point blk) (Tip blk))
v) = Text
"NodeToClient" Text -> [Text] -> [Text]
forall a. a -> [a] -> [a]
: TraceSendRecv (ChainSync (Serialised blk) (Point blk) (Tip blk))
-> [Text]
forall header point tip.
TraceSendRecv (ChainSync header point tip) -> [Text]
namesTChainSync TraceSendRecv (ChainSync (Serialised blk) (Point blk) (Tip blk))
v
  where

    namesTChainSync :: TraceSendRecv (ChainSync header point tip) -> [Text]
namesTChainSync (TraceSendMsg AnyMessageAndAgency (ChainSync header point tip)
msg) = Text
"Send" Text -> [Text] -> [Text]
forall a. a -> [a] -> [a]
: AnyMessageAndAgency (ChainSync header point tip) -> [Text]
forall header point tip.
AnyMessageAndAgency (ChainSync header point tip) -> [Text]
namesTChainSync' AnyMessageAndAgency (ChainSync header point tip)
msg
    namesTChainSync (TraceRecvMsg AnyMessageAndAgency (ChainSync header point tip)
msg) = Text
"Receive" Text -> [Text] -> [Text]
forall a. a -> [a] -> [a]
: AnyMessageAndAgency (ChainSync header point tip) -> [Text]
forall header point tip.
AnyMessageAndAgency (ChainSync header point tip) -> [Text]
namesTChainSync' AnyMessageAndAgency (ChainSync header point tip)
msg

    namesTChainSync' :: AnyMessageAndAgency (ChainSync header point tip) -> [Text]
namesTChainSync' (AnyMessageAndAgency PeerHasAgency pr st
_agency Message (ChainSync header point tip) st st'
msg) = Message (ChainSync header point tip) st st' -> [Text]
forall header point tip (from :: ChainSync header point tip)
       (to :: ChainSync header point tip).
Message (ChainSync header point tip) from to -> [Text]
namesTChainSync'' Message (ChainSync header point tip) st st'
msg

    namesTChainSync'' :: Message (ChainSync header point tip) from to
                               -> [Text]
    namesTChainSync'' :: Message (ChainSync header point tip) from to -> [Text]
namesTChainSync'' MsgRequestNext {}       = [Text
"RequestNext"]
    namesTChainSync'' MsgAwaitReply {}        = [Text
"AwaitReply"]
    namesTChainSync'' MsgRollForward {}       = [Text
"RollForward"]
    namesTChainSync'' MsgRollBackward {}      = [Text
"RollBackward"]
    namesTChainSync'' MsgFindIntersect {}     = [Text
"FindIntersect"]
    namesTChainSync'' MsgIntersectFound {}    = [Text
"IntersectFound"]
    namesTChainSync'' MsgIntersectNotFound {} = [Text
"IntersectNotFound"]
    namesTChainSync'' MsgDone {}              = [Text
"Done"]


instance LogFormatting (AnyMessageAndAgency (ChainSync blk pt tip)) where
   forMachine :: DetailLevel -> AnyMessageAndAgency (ChainSync blk pt tip) -> Object
forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok ChainSync.MsgRequestNext{}) =
     [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgRequestNext"
              , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
              ]
   forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok ChainSync.MsgAwaitReply{}) =
     [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgAwaitReply"
              , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
              ]
   forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok ChainSync.MsgRollForward{}) =
     [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgRollForward"
              , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
              ]
   forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok ChainSync.MsgRollBackward{}) =
     [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgRollBackward"
              , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
              ]
   forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok ChainSync.MsgFindIntersect{}) =
     [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgFindIntersect"
              , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
              ]
   forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok ChainSync.MsgIntersectFound{}) =
     [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgIntersectFound"
              , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
              ]
   forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok ChainSync.MsgIntersectNotFound{}) =
     [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgIntersectNotFound"
              , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
              ]
   forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok ChainSync.MsgDone{}) =
     [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgDone"
              , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
              ]

docTChainSyncNodeToClient :: Documented (BlockFetch.TraceLabelPeer peer (TraceSendRecv
    (ChainSync x (Point blk) (Tip blk))))
docTChainSyncNodeToClient :: Documented
  (TraceLabelPeer
     peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
docTChainSyncNodeToClient =
    [Text]
-> Documented
     (TraceLabelPeer
        Any (TraceSendRecv (ChainSync Any (Point Any) (Tip Any))))
-> Documented
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a b. [Text] -> Documented a -> Documented b
addDocumentedNamespace  [Text
"NodeToClient", Text
"Send"] Documented
  (TraceLabelPeer
     Any (TraceSendRecv (ChainSync Any (Point Any) (Tip Any))))
forall peer x blk.
Documented
  (TraceLabelPeer
     peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
docTChainSync
    Documented
  (TraceLabelPeer
     peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
-> Documented
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
-> Documented
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a. Documented a -> Documented a -> Documented a
`addDocs` [Text]
-> Documented
     (TraceLabelPeer
        Any (TraceSendRecv (ChainSync Any (Point Any) (Tip Any))))
-> Documented
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a b. [Text] -> Documented a -> Documented b
addDocumentedNamespace  [Text
"NodeToClient", Text
"Recieve"] Documented
  (TraceLabelPeer
     Any (TraceSendRecv (ChainSync Any (Point Any) (Tip Any))))
forall peer x blk.
Documented
  (TraceLabelPeer
     peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
docTChainSync


docTChainSyncNodeToNode :: Documented (BlockFetch.TraceLabelPeer peer (TraceSendRecv
    (ChainSync x (Point blk) (Tip blk))))
docTChainSyncNodeToNode :: Documented
  (TraceLabelPeer
     peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
docTChainSyncNodeToNode =
    [Text]
-> Documented
     (TraceLabelPeer
        Any (TraceSendRecv (ChainSync Any (Point Any) (Tip Any))))
-> Documented
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a b. [Text] -> Documented a -> Documented b
addDocumentedNamespace  [Text
"NodeToNode", Text
"Send"] Documented
  (TraceLabelPeer
     Any (TraceSendRecv (ChainSync Any (Point Any) (Tip Any))))
forall peer x blk.
Documented
  (TraceLabelPeer
     peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
docTChainSync
    Documented
  (TraceLabelPeer
     peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
-> Documented
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
-> Documented
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a. Documented a -> Documented a -> Documented a
`addDocs` [Text]
-> Documented
     (TraceLabelPeer
        Any (TraceSendRecv (ChainSync Any (Point Any) (Tip Any))))
-> Documented
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a b. [Text] -> Documented a -> Documented b
addDocumentedNamespace  [Text
"NodeToNode", Text
"Recieve"] Documented
  (TraceLabelPeer
     Any (TraceSendRecv (ChainSync Any (Point Any) (Tip Any))))
forall peer x blk.
Documented
  (TraceLabelPeer
     peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
docTChainSync

docTChainSyncNodeToNodeSerisalised :: Documented (BlockFetch.TraceLabelPeer peer (TraceSendRecv
    (ChainSync x (Point blk) (Tip blk))))
docTChainSyncNodeToNodeSerisalised :: Documented
  (TraceLabelPeer
     peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
docTChainSyncNodeToNodeSerisalised =
    [Text]
-> Documented
     (TraceLabelPeer
        Any (TraceSendRecv (ChainSync Any (Point Any) (Tip Any))))
-> Documented
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a b. [Text] -> Documented a -> Documented b
addDocumentedNamespace  [Text
"NodeToNode", Text
"Send"] Documented
  (TraceLabelPeer
     Any (TraceSendRecv (ChainSync Any (Point Any) (Tip Any))))
forall peer x blk.
Documented
  (TraceLabelPeer
     peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
docTChainSync
    Documented
  (TraceLabelPeer
     peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
-> Documented
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
-> Documented
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a. Documented a -> Documented a -> Documented a
`addDocs` [Text]
-> Documented
     (TraceLabelPeer
        Any (TraceSendRecv (ChainSync Any (Point Any) (Tip Any))))
-> Documented
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a b. [Text] -> Documented a -> Documented b
addDocumentedNamespace  [Text
"NodeToNode", Text
"Recieve"] Documented
  (TraceLabelPeer
     Any (TraceSendRecv (ChainSync Any (Point Any) (Tip Any))))
forall peer x blk.
Documented
  (TraceLabelPeer
     peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
docTChainSync


docTChainSync :: Documented (BlockFetch.TraceLabelPeer peer (TraceSendRecv
    (ChainSync x (Point blk) (Tip blk))))
docTChainSync :: Documented
  (TraceLabelPeer
     peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
docTChainSync = [DocMsg
   (TraceLabelPeer
      peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))]
-> Documented
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a. [DocMsg a] -> Documented a
Documented [
      [Text]
-> [(Text, Text)]
-> Text
-> DocMsg
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"RequestNext"]
        []
        Text
"Request the next update from the producer. The response can be a roll\
        \forward, a roll back or wait."
    , [Text]
-> [(Text, Text)]
-> Text
-> DocMsg
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"AwaitReply"]
        []
        Text
"Acknowledge the request but require the consumer to wait for the next\
        \update. This means that the consumer is synced with the producer, and\
        \the producer is waiting for its own chain state to change."
    , [Text]
-> [(Text, Text)]
-> Text
-> DocMsg
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"RollForward"]
        []
        Text
"Tell the consumer to extend their chain with the given header.\
        \\n\
        \The message also tells the consumer about the head point of the producer."
    , [Text]
-> [(Text, Text)]
-> Text
-> DocMsg
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"RollBackward"]
        []
        Text
"Tell the consumer to roll back to a given point on their chain.\
        \\n\
        \The message also tells the consumer about the head point of the producer."
    , [Text]
-> [(Text, Text)]
-> Text
-> DocMsg
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"FindIntersect"]
        []
        Text
"Ask the producer to try to find an improved intersection point between\
        \the consumer and producer's chains. The consumer sends a sequence of\
        \points and it is up to the producer to find the first intersection point\
        \on its chain and send it back to the consumer."
    , [Text]
-> [(Text, Text)]
-> Text
-> DocMsg
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"IntersectFound"]
        []
        Text
"The reply to the consumer about an intersection found.\
        \The consumer can decide weather to send more points.\
        \\n\
        \The message also tells the consumer about the head point of the producer."
    , [Text]
-> [(Text, Text)]
-> Text
-> DocMsg
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"IntersectNotFound"]
        []
        Text
"The reply to the consumer that no intersection was found: none of the\
        \points the consumer supplied are on the producer chain.\
        \\n\
        \The message also tells the consumer about the head point of the producer."
    , [Text]
-> [(Text, Text)]
-> Text
-> DocMsg
     (TraceLabelPeer
        peer (TraceSendRecv (ChainSync x (Point blk) (Tip blk))))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"Done"]
        []
        Text
"We have to explain to the framework what our states mean, in terms of\
        \which party has agency in each state.\
        \\n\
        \Idle states are where it is for the client to send a message,\
        \busy states are where the server is expected to send a reply."
  ]

--------------------------------------------------------------------------------
-- LocalTxMonitor Tracer
--------------------------------------------------------------------------------

severityTTxMonitor
  :: TraceLabelPeer peer
       (TraceSendRecv (LTM.LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo))
  -> SeverityS
severityTTxMonitor :: TraceLabelPeer
  peer
  (TraceSendRecv (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo))
-> SeverityS
severityTTxMonitor TraceLabelPeer
  peer
  (TraceSendRecv (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo))
_ = SeverityS
Info

namesForTTxMonitor
  :: TraceLabelPeer peer
       (TraceSendRecv (LTM.LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo))
  -> [Text]
namesForTTxMonitor :: TraceLabelPeer
  peer
  (TraceSendRecv (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo))
-> [Text]
namesForTTxMonitor (TraceLabelPeer peer
_ TraceSendRecv (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)
v) = TraceSendRecv (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)
-> [Text]
forall blk.
TraceSendRecv (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)
-> [Text]
namesForTTxMonitor' TraceSendRecv (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)
v
  where
    namesForTTxMonitor' :: TraceSendRecv (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)
-> [Text]
namesForTTxMonitor' (TraceSendMsg AnyMessageAndAgency
  (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)
msg) = Text
"Send"    Text -> [Text] -> [Text]
forall a. a -> [a] -> [a]
: AnyMessageAndAgency
  (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)
-> [Text]
forall blk.
AnyMessageAndAgency
  (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)
-> [Text]
namesForTTxMonitor'' AnyMessageAndAgency
  (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)
msg
    namesForTTxMonitor' (TraceRecvMsg AnyMessageAndAgency
  (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)
msg) = Text
"Receive" Text -> [Text] -> [Text]
forall a. a -> [a] -> [a]
: AnyMessageAndAgency
  (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)
-> [Text]
forall blk.
AnyMessageAndAgency
  (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)
-> [Text]
namesForTTxMonitor'' AnyMessageAndAgency
  (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)
msg

    namesForTTxMonitor'' :: AnyMessageAndAgency
  (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)
-> [Text]
namesForTTxMonitor'' (AnyMessageAndAgency PeerHasAgency pr st
_agency Message (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo) st st'
msg) = Message (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo) st st'
-> [Text]
forall blk
       (from :: LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)
       (to :: LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo).
Message (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo) from to
-> [Text]
namesForTTxMonitor''' Message (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo) st st'
msg

    namesForTTxMonitor''' :: Message (LTM.LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)
                                     from to
                          -> [Text]
    namesForTTxMonitor''' :: Message (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo) from to
-> [Text]
namesForTTxMonitor''' LTM.MsgAcquire {} = [Text
"Acquire"]
    namesForTTxMonitor''' LTM.MsgAcquired {} = [Text
"Acquired"]
    namesForTTxMonitor''' LTM.MsgAwaitAcquire {} = [Text
"AwaitAcquire"]
    namesForTTxMonitor''' LTM.MsgNextTx {} = [Text
"NextTx"]
    namesForTTxMonitor''' LTM.MsgReplyNextTx {} = [Text
"ReplyNextTx"]
    namesForTTxMonitor''' LTM.MsgHasTx {} = [Text
"HasTx"]
    namesForTTxMonitor''' LTM.MsgReplyHasTx {} = [Text
"ReplyHasTx"]
    namesForTTxMonitor''' LTM.MsgGetSizes {} = [Text
"GetSizes"]
    namesForTTxMonitor''' LTM.MsgReplyGetSizes {} = [Text
"ReplyGetSizes"]
    namesForTTxMonitor''' LTM.MsgRelease {} = [Text
"Release"]
    namesForTTxMonitor''' LTM.MsgDone {} = [Text
"Done"]

instance LogFormatting (AnyMessageAndAgency (LTM.LocalTxMonitor txid tx slotNo)) where
  forMachine :: DetailLevel
-> AnyMessageAndAgency (LocalTxMonitor txid tx slotNo) -> Object
forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LTM.MsgAcquire {}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgAcquire"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LTM.MsgAcquired {}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgAcquired"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LTM.MsgAwaitAcquire {}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgAwaitAcquire"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LTM.MsgNextTx {}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgNextTx"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LTM.MsgReplyNextTx {}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgReplyNextTx"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LTM.MsgHasTx {}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgHasTx"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LTM.MsgReplyHasTx {}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgReplyHasTx"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LTM.MsgGetSizes {}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgGetSizes"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LTM.MsgReplyGetSizes {}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgReplyGetSizes"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LTM.MsgRelease {}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgRelease"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LTM.MsgDone {}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgDone"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]

docTTxMonitor :: Documented
  (TraceLabelPeer
     localPeer
     (TraceSendRecv
        (LTM.LocalTxMonitor
           (GenTxId blk) (GenTx blk) SlotNo)))
docTTxMonitor :: Documented
  (TraceLabelPeer
     localPeer
     (TraceSendRecv (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)))
docTTxMonitor =
  [Text]
-> Documented (TraceLabelPeer Any (TraceSendRecv Any))
-> Documented
     (TraceLabelPeer
        localPeer
        (TraceSendRecv (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)))
forall a b. [Text] -> Documented a -> Documented b
addDocumentedNamespace  [Text
"Send"] Documented (TraceLabelPeer Any (TraceSendRecv Any))
forall peer x. Documented (TraceLabelPeer peer (TraceSendRecv x))
docTState
   Documented
  (TraceLabelPeer
     localPeer
     (TraceSendRecv (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)))
-> Documented
     (TraceLabelPeer
        localPeer
        (TraceSendRecv (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)))
-> Documented
     (TraceLabelPeer
        localPeer
        (TraceSendRecv (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)))
forall a. Documented a -> Documented a -> Documented a
`addDocs` [Text]
-> Documented (TraceLabelPeer Any (TraceSendRecv Any))
-> Documented
     (TraceLabelPeer
        localPeer
        (TraceSendRecv (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)))
forall a b. [Text] -> Documented a -> Documented b
addDocumentedNamespace  [Text
"Recieve"] Documented (TraceLabelPeer Any (TraceSendRecv Any))
forall peer x. Documented (TraceLabelPeer peer (TraceSendRecv x))
docTState


--------------------------------------------------------------------------------
-- LocalTxSubmission Tracer
--------------------------------------------------------------------------------

severityTTxSubmission :: BlockFetch.TraceLabelPeer peer
  (TraceSendRecv (LTS.LocalTxSubmission (GenTx blk) (ApplyTxErr blk)))
  -> SeverityS
severityTTxSubmission :: TraceLabelPeer
  peer
  (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk)))
-> SeverityS
severityTTxSubmission (BlockFetch.TraceLabelPeer peer
_ TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))
v) = TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))
-> SeverityS
forall tx reject.
TraceSendRecv (LocalTxSubmission tx reject) -> SeverityS
severityTTxSubmission' TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))
v
  where
    severityTTxSubmission' :: TraceSendRecv (LocalTxSubmission tx reject) -> SeverityS
severityTTxSubmission' (TraceSendMsg AnyMessageAndAgency (LocalTxSubmission tx reject)
msg) = AnyMessageAndAgency (LocalTxSubmission tx reject) -> SeverityS
forall tx reject.
AnyMessageAndAgency (LocalTxSubmission tx reject) -> SeverityS
severityTTxSubmission'' AnyMessageAndAgency (LocalTxSubmission tx reject)
msg
    severityTTxSubmission' (TraceRecvMsg AnyMessageAndAgency (LocalTxSubmission tx reject)
msg) = AnyMessageAndAgency (LocalTxSubmission tx reject) -> SeverityS
forall tx reject.
AnyMessageAndAgency (LocalTxSubmission tx reject) -> SeverityS
severityTTxSubmission'' AnyMessageAndAgency (LocalTxSubmission tx reject)
msg

    severityTTxSubmission'' :: AnyMessageAndAgency (LocalTxSubmission tx reject) -> SeverityS
severityTTxSubmission'' (AnyMessageAndAgency PeerHasAgency pr st
_agency Message (LocalTxSubmission tx reject) st st'
msg) = Message (LocalTxSubmission tx reject) st st' -> SeverityS
forall tx reject (from :: LocalTxSubmission tx reject)
       (to :: LocalTxSubmission tx reject).
Message (LocalTxSubmission tx reject) from to -> SeverityS
severityTTxSubmission''' Message (LocalTxSubmission tx reject) st st'
msg

    severityTTxSubmission''' :: Message
                                        (LTS.LocalTxSubmission tx reject) from to
                                      -> SeverityS
    severityTTxSubmission''' :: Message (LocalTxSubmission tx reject) from to -> SeverityS
severityTTxSubmission''' LTS.MsgSubmitTx {} = SeverityS
Info
    severityTTxSubmission''' LTS.MsgAcceptTx {} = SeverityS
Info
    severityTTxSubmission''' LTS.MsgRejectTx {} = SeverityS
Info
    severityTTxSubmission''' LTS.MsgDone {}     = SeverityS
Info


namesForTTxSubmission :: BlockFetch.TraceLabelPeer peer
  (TraceSendRecv (LTS.LocalTxSubmission (GenTx blk) (ApplyTxErr blk)))
  -> [Text]
namesForTTxSubmission :: TraceLabelPeer
  peer
  (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk)))
-> [Text]
namesForTTxSubmission (BlockFetch.TraceLabelPeer peer
_ TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))
v) = TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))
-> [Text]
forall tx reject.
TraceSendRecv (LocalTxSubmission tx reject) -> [Text]
namesTTxSubmission TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))
v
  where
    namesTTxSubmission :: TraceSendRecv (LocalTxSubmission tx reject) -> [Text]
namesTTxSubmission (TraceSendMsg AnyMessageAndAgency (LocalTxSubmission tx reject)
msg) = Text
"Send" Text -> [Text] -> [Text]
forall a. a -> [a] -> [a]
: AnyMessageAndAgency (LocalTxSubmission tx reject) -> [Text]
forall tx reject.
AnyMessageAndAgency (LocalTxSubmission tx reject) -> [Text]
namesTTxSubmission' AnyMessageAndAgency (LocalTxSubmission tx reject)
msg
    namesTTxSubmission (TraceRecvMsg AnyMessageAndAgency (LocalTxSubmission tx reject)
msg) = Text
"Receive" Text -> [Text] -> [Text]
forall a. a -> [a] -> [a]
: AnyMessageAndAgency (LocalTxSubmission tx reject) -> [Text]
forall tx reject.
AnyMessageAndAgency (LocalTxSubmission tx reject) -> [Text]
namesTTxSubmission' AnyMessageAndAgency (LocalTxSubmission tx reject)
msg

    namesTTxSubmission' :: AnyMessageAndAgency (LocalTxSubmission tx reject) -> [Text]
namesTTxSubmission' (AnyMessageAndAgency PeerHasAgency pr st
_agency Message (LocalTxSubmission tx reject) st st'
msg) = Message (LocalTxSubmission tx reject) st st' -> [Text]
forall tx reject (from :: LocalTxSubmission tx reject)
       (to :: LocalTxSubmission tx reject).
Message (LocalTxSubmission tx reject) from to -> [Text]
namesTTxSubmission'' Message (LocalTxSubmission tx reject) st st'
msg

    namesTTxSubmission'' :: Message
                                    (LTS.LocalTxSubmission tx reject) from to
                                  -> [Text]
    namesTTxSubmission'' :: Message (LocalTxSubmission tx reject) from to -> [Text]
namesTTxSubmission'' LTS.MsgSubmitTx {} = [Text
"SubmitTx"]
    namesTTxSubmission'' LTS.MsgAcceptTx {} = [Text
"AcceptTx"]
    namesTTxSubmission'' LTS.MsgRejectTx {} = [Text
"RejectTx"]
    namesTTxSubmission'' LTS.MsgDone {}     = [Text
"Done"]


instance LogFormatting (AnyMessageAndAgency (LTS.LocalTxSubmission tx err)) where
  forMachine :: DetailLevel
-> AnyMessageAndAgency (LocalTxSubmission tx err) -> Object
forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LTS.MsgSubmitTx{}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgSubmitTx"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LTS.MsgAcceptTx{}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgAcceptTx"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LTS.MsgRejectTx{}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgRejectTx"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LTS.MsgDone{}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgDone"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]

docTTxSubmission :: Documented
  (BlockFetch.TraceLabelPeer
     localPeer
     (TraceSendRecv
        (LTS.LocalTxSubmission
           (GenTx blk) (ApplyTxErr blk))))
docTTxSubmission :: Documented
  (TraceLabelPeer
     localPeer
     (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))
docTTxSubmission =
  [Text]
-> Documented
     (TraceLabelPeer
        Any
        (TraceSendRecv (LocalTxSubmission (GenTx Any) (ApplyTxErr Any))))
-> Documented
     (TraceLabelPeer
        localPeer
        (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))
forall a b. [Text] -> Documented a -> Documented b
addDocumentedNamespace  [Text
"Send"] Documented
  (TraceLabelPeer
     Any
     (TraceSendRecv (LocalTxSubmission (GenTx Any) (ApplyTxErr Any))))
forall localPeer blk.
Documented
  (TraceLabelPeer
     localPeer
     (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))
docTTxSubmission'
   Documented
  (TraceLabelPeer
     localPeer
     (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))
-> Documented
     (TraceLabelPeer
        localPeer
        (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))
-> Documented
     (TraceLabelPeer
        localPeer
        (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))
forall a. Documented a -> Documented a -> Documented a
`addDocs` [Text]
-> Documented
     (TraceLabelPeer
        Any
        (TraceSendRecv (LocalTxSubmission (GenTx Any) (ApplyTxErr Any))))
-> Documented
     (TraceLabelPeer
        localPeer
        (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))
forall a b. [Text] -> Documented a -> Documented b
addDocumentedNamespace  [Text
"Recieve"] Documented
  (TraceLabelPeer
     Any
     (TraceSendRecv (LocalTxSubmission (GenTx Any) (ApplyTxErr Any))))
forall localPeer blk.
Documented
  (TraceLabelPeer
     localPeer
     (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))
docTTxSubmission'

docTTxSubmission' :: Documented
   (BlockFetch.TraceLabelPeer
      localPeer
      (TraceSendRecv
         (LTS.LocalTxSubmission
            (GenTx blk) (ApplyTxErr blk))))
docTTxSubmission' :: Documented
  (TraceLabelPeer
     localPeer
     (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))
docTTxSubmission' = [DocMsg
   (TraceLabelPeer
      localPeer
      (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))]
-> Documented
     (TraceLabelPeer
        localPeer
        (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))
forall a. [DocMsg a] -> Documented a
Documented [
      [Text]
-> [(Text, Text)]
-> Text
-> DocMsg
     (TraceLabelPeer
        localPeer
        (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"SubmitTx"]
        []
        Text
"The client submits a single transaction and waits a reply."
    , [Text]
-> [(Text, Text)]
-> Text
-> DocMsg
     (TraceLabelPeer
        localPeer
        (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"AcceptTx"]
        []
        Text
"The server can reply to inform the client that it has accepted the\
        \transaction."
    , [Text]
-> [(Text, Text)]
-> Text
-> DocMsg
     (TraceLabelPeer
        localPeer
        (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"RejectTx"]
        []
        Text
"The server can reply to inform the client that it has rejected the\
        \transaction. A reason for the rejection is included."
    , [Text]
-> [(Text, Text)]
-> Text
-> DocMsg
     (TraceLabelPeer
        localPeer
        (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"Done"]
        []
        Text
"The client can terminate the protocol."
  ]

--------------------------------------------------------------------------------
-- TStateQuery Tracer
--------------------------------------------------------------------------------

severityTStateQuery :: BlockFetch.TraceLabelPeer peer
  (TraceSendRecv (LSQ.LocalStateQuery blk (Point blk) query))
  -> SeverityS
severityTStateQuery :: TraceLabelPeer
  peer (TraceSendRecv (LocalStateQuery blk (Point blk) query))
-> SeverityS
severityTStateQuery (BlockFetch.TraceLabelPeer peer
_ TraceSendRecv (LocalStateQuery blk (Point blk) query)
v) = TraceSendRecv (LocalStateQuery blk (Point blk) query) -> SeverityS
forall block point (query1 :: * -> *).
TraceSendRecv (LocalStateQuery block point query1) -> SeverityS
severityTStateQuery' TraceSendRecv (LocalStateQuery blk (Point blk) query)
v
  where
    severityTStateQuery' :: TraceSendRecv (LocalStateQuery block point query1) -> SeverityS
severityTStateQuery' (TraceSendMsg AnyMessageAndAgency (LocalStateQuery block point query1)
msg) = AnyMessageAndAgency (LocalStateQuery block point query1)
-> SeverityS
forall block point (query1 :: * -> *).
AnyMessageAndAgency (LocalStateQuery block point query1)
-> SeverityS
severityTStateQuery'' AnyMessageAndAgency (LocalStateQuery block point query1)
msg
    severityTStateQuery' (TraceRecvMsg AnyMessageAndAgency (LocalStateQuery block point query1)
msg) = AnyMessageAndAgency (LocalStateQuery block point query1)
-> SeverityS
forall block point (query1 :: * -> *).
AnyMessageAndAgency (LocalStateQuery block point query1)
-> SeverityS
severityTStateQuery'' AnyMessageAndAgency (LocalStateQuery block point query1)
msg

    severityTStateQuery'' :: AnyMessageAndAgency (LocalStateQuery block point query1)
-> SeverityS
severityTStateQuery'' (AnyMessageAndAgency PeerHasAgency pr st
_agency Message (LocalStateQuery block point query1) st st'
msg) = Message (LocalStateQuery block point query1) st st' -> SeverityS
forall block point (query1 :: * -> *)
       (from :: LocalStateQuery block point query1)
       (to :: LocalStateQuery block point query1).
Message (LocalStateQuery block point query1) from to -> SeverityS
severityTStateQuery''' Message (LocalStateQuery block point query1) st st'
msg

    severityTStateQuery''' :: Message
                                    (LSQ.LocalStateQuery block point query1) from to
                                  -> SeverityS
    severityTStateQuery''' :: Message (LocalStateQuery block point query1) from to -> SeverityS
severityTStateQuery''' LSQ.MsgAcquire {}   = SeverityS
Info
    severityTStateQuery''' LSQ.MsgAcquired {}  = SeverityS
Info
    severityTStateQuery''' LSQ.MsgFailure {}   = SeverityS
Warning
    severityTStateQuery''' LSQ.MsgQuery {}     = SeverityS
Info
    severityTStateQuery''' LSQ.MsgResult {}    = SeverityS
Info
    severityTStateQuery''' LSQ.MsgRelease {}   = SeverityS
Info
    severityTStateQuery''' LSQ.MsgReAcquire {} = SeverityS
Info
    severityTStateQuery''' LSQ.MsgDone {}      = SeverityS
Info

namesForTStateQuery :: BlockFetch.TraceLabelPeer peer
  (TraceSendRecv (LSQ.LocalStateQuery blk (Point blk) query))
  -> [Text]
namesForTStateQuery :: TraceLabelPeer
  peer (TraceSendRecv (LocalStateQuery blk (Point blk) query))
-> [Text]
namesForTStateQuery (BlockFetch.TraceLabelPeer peer
_ TraceSendRecv (LocalStateQuery blk (Point blk) query)
v) = TraceSendRecv (LocalStateQuery blk (Point blk) query) -> [Text]
forall block point (query1 :: * -> *).
TraceSendRecv (LocalStateQuery block point query1) -> [Text]
namesForTStateQuery' TraceSendRecv (LocalStateQuery blk (Point blk) query)
v
  where
    namesForTStateQuery' :: TraceSendRecv (LocalStateQuery block point query1) -> [Text]
namesForTStateQuery' (TraceSendMsg AnyMessageAndAgency (LocalStateQuery block point query1)
msg) = Text
"Send" Text -> [Text] -> [Text]
forall a. a -> [a] -> [a]
: AnyMessageAndAgency (LocalStateQuery block point query1) -> [Text]
forall block point (query1 :: * -> *).
AnyMessageAndAgency (LocalStateQuery block point query1) -> [Text]
namesForTStateQuery'' AnyMessageAndAgency (LocalStateQuery block point query1)
msg
    namesForTStateQuery' (TraceRecvMsg AnyMessageAndAgency (LocalStateQuery block point query1)
msg) = Text
"Receive" Text -> [Text] -> [Text]
forall a. a -> [a] -> [a]
: AnyMessageAndAgency (LocalStateQuery block point query1) -> [Text]
forall block point (query1 :: * -> *).
AnyMessageAndAgency (LocalStateQuery block point query1) -> [Text]
namesForTStateQuery'' AnyMessageAndAgency (LocalStateQuery block point query1)
msg

    namesForTStateQuery'' :: AnyMessageAndAgency (LocalStateQuery block point query1) -> [Text]
namesForTStateQuery'' (AnyMessageAndAgency PeerHasAgency pr st
_agency Message (LocalStateQuery block point query1) st st'
msg) = Message (LocalStateQuery block point query1) st st' -> [Text]
forall block point (query1 :: * -> *)
       (from :: LocalStateQuery block point query1)
       (to :: LocalStateQuery block point query1).
Message (LocalStateQuery block point query1) from to -> [Text]
namesForTStateQuery''' Message (LocalStateQuery block point query1) st st'
msg

    namesForTStateQuery''' :: Message
                                    (LSQ.LocalStateQuery block point query1) from to
                                  -> [Text]

    namesForTStateQuery''' :: Message (LocalStateQuery block point query1) from to -> [Text]
namesForTStateQuery''' LSQ.MsgAcquire {}   = [Text
"Acquire"]
    namesForTStateQuery''' LSQ.MsgAcquired {}  = [Text
"Acquired"]
    namesForTStateQuery''' LSQ.MsgFailure {}   = [Text
"Failure"]
    namesForTStateQuery''' LSQ.MsgQuery {}     = [Text
"Query"]
    namesForTStateQuery''' LSQ.MsgResult {}    = [Text
"Result"]
    namesForTStateQuery''' LSQ.MsgRelease {}   = [Text
"Release"]
    namesForTStateQuery''' LSQ.MsgReAcquire {} = [Text
"ReAcquire"]
    namesForTStateQuery''' LSQ.MsgDone {}      = [Text
"Done"]

instance (forall result. Show (Query blk result))
      => LogFormatting (AnyMessageAndAgency (LSQ.LocalStateQuery blk pt (Query blk))) where
  forMachine :: DetailLevel
-> AnyMessageAndAgency (LocalStateQuery blk pt (Query blk))
-> Object
forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LSQ.MsgAcquire{}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgAcquire"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LSQ.MsgAcquired{}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgAcquired"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LSQ.MsgFailure{}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgFailure"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LSQ.MsgQuery{}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgQuery"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LSQ.MsgResult{}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgResult"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LSQ.MsgRelease{}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgRelease"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LSQ.MsgReAcquire{}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgReAcquire"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]
  forMachine DetailLevel
_dtal (AnyMessageAndAgency PeerHasAgency pr st
stok LSQ.MsgDone{}) =
    [Object] -> Object
forall a. Monoid a => [a] -> a
mconcat [ Key
"kind" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String Text
"MsgDone"
             , Key
"agency" Key -> Value -> Object
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> Value
String (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ PeerHasAgency pr st -> String
forall a. Show a => a -> String
show PeerHasAgency pr st
stok)
             ]

docTStateQuery :: Documented
      (BlockFetch.TraceLabelPeer peer
       (TraceSendRecv
       (LSQ.LocalStateQuery blk pt (Query blk))))
docTStateQuery :: Documented
  (TraceLabelPeer
     peer (TraceSendRecv (LocalStateQuery blk pt (Query blk))))
docTStateQuery =
   [Text]
-> Documented (TraceLabelPeer Any (TraceSendRecv Any))
-> Documented
     (TraceLabelPeer
        peer (TraceSendRecv (LocalStateQuery blk pt (Query blk))))
forall a b. [Text] -> Documented a -> Documented b
addDocumentedNamespace  [Text
"Send"] Documented (TraceLabelPeer Any (TraceSendRecv Any))
forall peer x. Documented (TraceLabelPeer peer (TraceSendRecv x))
docTState
    Documented
  (TraceLabelPeer
     peer (TraceSendRecv (LocalStateQuery blk pt (Query blk))))
-> Documented
     (TraceLabelPeer
        peer (TraceSendRecv (LocalStateQuery blk pt (Query blk))))
-> Documented
     (TraceLabelPeer
        peer (TraceSendRecv (LocalStateQuery blk pt (Query blk))))
forall a. Documented a -> Documented a -> Documented a
`addDocs` [Text]
-> Documented (TraceLabelPeer Any (TraceSendRecv Any))
-> Documented
     (TraceLabelPeer
        peer (TraceSendRecv (LocalStateQuery blk pt (Query blk))))
forall a b. [Text] -> Documented a -> Documented b
addDocumentedNamespace  [Text
"Recieve"] Documented (TraceLabelPeer Any (TraceSendRecv Any))
forall peer x. Documented (TraceLabelPeer peer (TraceSendRecv x))
docTState

docTState :: Documented
      (BlockFetch.TraceLabelPeer peer
       (TraceSendRecv
         x))
docTState :: Documented (TraceLabelPeer peer (TraceSendRecv x))
docTState = [DocMsg (TraceLabelPeer peer (TraceSendRecv x))]
-> Documented (TraceLabelPeer peer (TraceSendRecv x))
forall a. [DocMsg a] -> Documented a
Documented [
      [Text]
-> [(Text, Text)]
-> Text
-> DocMsg (TraceLabelPeer peer (TraceSendRecv x))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"Acquire"]
        []
        Text
"The client requests that the state as of a particular recent point on\
        \the server's chain (within K of the tip) be made available to query,\
        \and waits for confirmation or failure.\
        \\n\
        \From 'NodeToClient_V8' onwards if the point is not specified, current tip\
        \will be acquired.  For previous versions of the protocol 'point' must be\
        \given."
    , [Text]
-> [(Text, Text)]
-> Text
-> DocMsg (TraceLabelPeer peer (TraceSendRecv x))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"Acquired"]
        []
        Text
"The server can confirm that it has the state at the requested point."
    , [Text]
-> [(Text, Text)]
-> Text
-> DocMsg (TraceLabelPeer peer (TraceSendRecv x))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"Failure"]
        []
        Text
"The server can report that it cannot obtain the state for the\
        \requested point."
    , [Text]
-> [(Text, Text)]
-> Text
-> DocMsg (TraceLabelPeer peer (TraceSendRecv x))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"Query"]
        []
        Text
"The client can perform queries on the current acquired state."
    , [Text]
-> [(Text, Text)]
-> Text
-> DocMsg (TraceLabelPeer peer (TraceSendRecv x))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"Result"]
        []
        Text
"The server must reply with the queries."
    , [Text]
-> [(Text, Text)]
-> Text
-> DocMsg (TraceLabelPeer peer (TraceSendRecv x))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"Release"]
        []
        Text
"The client can instruct the server to release the state. This lets\
        \the server free resources."
    , [Text]
-> [(Text, Text)]
-> Text
-> DocMsg (TraceLabelPeer peer (TraceSendRecv x))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"ReAcquire"]
        []
        Text
"This is like 'MsgAcquire' but for when the client already has a\
        \state. By moveing to another state directly without a 'MsgRelease' it\
        \enables optimisations on the server side (e.g. moving to the state for\
        \the immediate next block).\
        \\n\
        \Note that failure to re-acquire is equivalent to 'MsgRelease',\
        \rather than keeping the exiting acquired state.\
        \\n\
        \From 'NodeToClient_V8' onwards if the point is not specified, current tip\
        \will be acquired.  For previous versions of the protocol 'point' must be\
        \given."
    , [Text]
-> [(Text, Text)]
-> Text
-> DocMsg (TraceLabelPeer peer (TraceSendRecv x))
forall a. [Text] -> [(Text, Text)] -> Text -> DocMsg a
DocMsg
        [Text
"Done"]
        []
        Text
"The client can terminate the protocol."
  ]