Skip to content

Commit

Permalink
Updated cardano-node
Browse files Browse the repository at this point in the history
  • Loading branch information
coot committed May 9, 2022
1 parent 493bf5f commit 0822e9b
Show file tree
Hide file tree
Showing 8 changed files with 374 additions and 488 deletions.
1 change: 1 addition & 0 deletions cardano-node/cardano-node.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ library
, psqueues
, safe-exceptions
, scientific
, singletons
, strict-stm
, cardano-ledger-shelley
, small-steps
Expand Down
3 changes: 3 additions & 0 deletions cardano-node/src/Cardano/Node/TraceConstraints.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
module Cardano.Node.TraceConstraints (TraceConstraints) where


import Prelude (Show)
import Data.Aeson

import Cardano.BM.Tracing (ToObject)
Expand Down Expand Up @@ -31,6 +32,8 @@ type TraceConstraints blk =
, HasKESMetricsData blk
, HasKESInfo blk
, GetKESInfo blk
, Show blk
, Show (Header blk)

, ToObject (ApplyTxErr blk)
, ToObject (GenTx blk)
Expand Down
2 changes: 2 additions & 0 deletions cardano-node/src/Cardano/Node/Tracing/Documentation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import Cardano.Node.Startup
import Cardano.Node.TraceConstraints

import Ouroboros.Consensus.Block.Forging
import Ouroboros.Consensus.Block.NestedContent (HasNestedContent)
import Ouroboros.Consensus.BlockchainTime.WallClock.Types (RelativeTime)
import Ouroboros.Consensus.BlockchainTime.WallClock.Util (TraceBlockchainTimeEvent (..))
import Ouroboros.Consensus.Cardano.Block
Expand Down Expand Up @@ -172,6 +173,7 @@ docTracers :: forall blk peer remotePeer.
, Show (ForgeStateUpdateError blk)
, Show (CannotForge blk)
, ShowQuery (BlockQuery blk)
, HasNestedContent Header blk
)
=> FilePath
-> FilePath
Expand Down
22 changes: 13 additions & 9 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/Diffusion.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import Data.Aeson (Value (String), (.=))
import Data.Text (pack)
import Network.Mux (MuxTrace (..), WithMuxBearer (..))
import qualified Network.Socket as Socket
import Network.TypedProtocol.Codec (AnyMessageAndAgency (..))
import Network.TypedProtocol.Codec (AnyMessage (..))
import Text.Show

import Cardano.Node.Configuration.TopologyP2P (UseLedger (..))
Expand Down Expand Up @@ -74,6 +74,8 @@ severityMux' MuxTraceChannelRecvStart {} = Debug
severityMux' MuxTraceChannelRecvEnd {} = Debug
severityMux' MuxTraceChannelSendStart {} = Debug
severityMux' MuxTraceChannelSendEnd {} = Debug
severityMux' MuxTraceChannelTryRecvStart {} = Debug
severityMux' MuxTraceChannelTryRecvEnd {} = Debug
severityMux' MuxTraceHandshakeStart = Debug
severityMux' MuxTraceHandshakeClientEnd {} = Info
severityMux' MuxTraceHandshakeServerEnd = Debug
Expand Down Expand Up @@ -107,6 +109,8 @@ namesForMux' MuxTraceChannelRecvStart {} = ["ChannelRecvStart"]
namesForMux' MuxTraceChannelRecvEnd {} = ["ChannelRecvEnd"]
namesForMux' MuxTraceChannelSendStart {} = ["ChannelSendStart"]
namesForMux' MuxTraceChannelSendEnd {} = ["ChannelSendEnd"]
namesForMux' MuxTraceChannelTryRecvStart {} = ["ChannelTryRecvStart"]
namesForMux' MuxTraceChannelTryRecvEnd {} = ["ChannelTryRecvEnd"]
namesForMux' MuxTraceHandshakeStart = ["HandshakeStart "]
namesForMux' MuxTraceHandshakeClientEnd {} = ["HandshakeClientEnd"]
namesForMux' MuxTraceHandshakeServerEnd = ["HandshakeServerEnd"]
Expand Down Expand Up @@ -271,8 +275,8 @@ severityHandshake' ::
severityHandshake' (TraceSendMsg m) = severityHandshake'' m
severityHandshake' (TraceRecvMsg m) = severityHandshake'' m

severityHandshake'' :: AnyMessageAndAgency (HS.Handshake nt CBOR.Term) -> SeverityS
severityHandshake'' (AnyMessageAndAgency _agency msg) = severityHandshake''' msg
severityHandshake'' :: AnyMessage (HS.Handshake nt CBOR.Term) -> SeverityS
severityHandshake'' (AnyMessage msg) = severityHandshake''' msg

severityHandshake''' :: Message (HS.Handshake nt CBOR.Term) from to -> SeverityS
severityHandshake''' HS.MsgProposeVersions {} = Info
Expand All @@ -289,8 +293,8 @@ namesForHandshake' ::
namesForHandshake' (TraceSendMsg m) = "Send" : namesForHandshake'' m
namesForHandshake' (TraceRecvMsg m) = "Recieve" : namesForHandshake'' m

namesForHandshake'' :: AnyMessageAndAgency (HS.Handshake nt CBOR.Term) -> [Text]
namesForHandshake'' (AnyMessageAndAgency _agency msg) = namesForHandshake''' msg
namesForHandshake'' :: AnyMessage (HS.Handshake nt CBOR.Term) -> [Text]
namesForHandshake'' (AnyMessage msg) = namesForHandshake''' msg

namesForHandshake''' :: Message (HS.Handshake nt CBOR.Term) from to -> [Text]
namesForHandshake''' HS.MsgProposeVersions {} = ["ProposeVersions"]
Expand Down Expand Up @@ -348,8 +352,8 @@ severityLocalHandshake' ::
severityLocalHandshake' (TraceSendMsg m) = severityLocalHandshake'' m
severityLocalHandshake' (TraceRecvMsg m) = severityLocalHandshake'' m

severityLocalHandshake'' :: AnyMessageAndAgency (HS.Handshake nt CBOR.Term) -> SeverityS
severityLocalHandshake'' (AnyMessageAndAgency _agency msg) = severityLocalHandshake''' msg
severityLocalHandshake'' :: AnyMessage (HS.Handshake nt CBOR.Term) -> SeverityS
severityLocalHandshake'' (AnyMessage msg) = severityLocalHandshake''' msg

severityLocalHandshake''' :: Message (HS.Handshake nt CBOR.Term) from to -> SeverityS
severityLocalHandshake''' HS.MsgProposeVersions {} = Info
Expand All @@ -366,8 +370,8 @@ namesForLocalHandshake' ::
namesForLocalHandshake' (TraceSendMsg m) = "Send" : namesForLocalHandshake'' m
namesForLocalHandshake' (TraceRecvMsg m) = "Receive" : namesForLocalHandshake'' m

namesForLocalHandshake'' :: AnyMessageAndAgency (HS.Handshake nt CBOR.Term) -> [Text]
namesForLocalHandshake'' (AnyMessageAndAgency _agency msg) = namesForLocalHandshake''' msg
namesForLocalHandshake'' :: AnyMessage (HS.Handshake nt CBOR.Term) -> [Text]
namesForLocalHandshake'' (AnyMessage msg) = namesForLocalHandshake''' msg

namesForLocalHandshake''' :: Message (HS.Handshake nt CBOR.Term) from to -> [Text]
namesForLocalHandshake''' HS.MsgProposeVersions {} = ["ProposeVersions"]
Expand Down
Loading

0 comments on commit 0822e9b

Please sign in to comment.