diff --git a/cardano-node/src/Cardano/Node/Run.hs b/cardano-node/src/Cardano/Node/Run.hs index 915df39bf5e..f2ee5c942d6 100644 --- a/cardano-node/src/Cardano/Node/Run.hs +++ b/cardano-node/src/Cardano/Node/Run.hs @@ -506,10 +506,15 @@ handleSimpleNode runP p2pMode tracers nc onKernel = do (_, Nothing) -> Map.keys $ supportedNodeToClientVersions (Proxy @blk) when ( ncTestEnableDevelopmentNetworkProtocols nc - && (not (null developmentNtnVersions) || not (null developmentNtcVersions)) ) + && not (null developmentNtnVersions)) $ traceWith (startupTracer tracers) - (WarningDevelopmentNetworkProtocols - developmentNtnVersions + (WarningDevelopmentNodeToNodeVersions + developmentNtnVersions) + + when ( ncTestEnableDevelopmentNetworkProtocols nc + && not (null developmentNtcVersions)) + $ traceWith (startupTracer tracers) + (WarningDevelopmentNodeToClientVersions developmentNtcVersions) #ifdef UNIX diff --git a/cardano-node/src/Cardano/Node/Startup.hs b/cardano-node/src/Cardano/Node/Startup.hs index 14edc4eda98..b63c6f15c11 100644 --- a/cardano-node/src/Cardano/Node/Startup.hs +++ b/cardano-node/src/Cardano/Node/Startup.hs @@ -108,9 +108,15 @@ data StartupTrace blk = -- | P2PWarningDevelopementNetworkProtocols - -- | Warn when 'TestEnableDevelopmentNetworkProtocols' is set. + -- | Warn when 'TestEnableDevelopmentNetworkProtocols' is set and affects + -- node-to-node protocol. -- - | WarningDevelopmentNetworkProtocols [NodeToNodeVersion] [NodeToClientVersion] + | WarningDevelopmentNodeToNodeVersions [NodeToNodeVersion] + + -- | Warn when 'TestEnableDevelopmentNetworkProtocols' is set and affects + -- node-to-client protocol. + -- + | WarningDevelopmentNodeToClientVersions [NodeToClientVersion] | BICommon BasicInfoCommon | BIShelley BasicInfoShelleyBased @@ -124,7 +130,8 @@ severityStartupTracer (NetworkConfigUpdateError _) = Error severityStartupTracer NetworkConfigUpdateUnsupported = Warning severityStartupTracer P2PWarning = Warning severityStartupTracer P2PWarningDevelopementNetworkProtocols = Warning -severityStartupTracer WarningDevelopmentNetworkProtocols {} = Warning +severityStartupTracer WarningDevelopmentNodeToNodeVersions {} = Warning +severityStartupTracer WarningDevelopmentNodeToClientVersions {} = Warning severityStartupTracer _ = Info data BasicInfoCommon = BasicInfoCommon { diff --git a/cardano-node/src/Cardano/Node/Tracing/StateRep.hs b/cardano-node/src/Cardano/Node/Tracing/StateRep.hs index c2b2fb3a4c4..5975f40282b 100644 --- a/cardano-node/src/Cardano/Node/Tracing/StateRep.hs +++ b/cardano-node/src/Cardano/Node/Tracing/StateRep.hs @@ -79,7 +79,8 @@ data StartupState | NetworkConfigUpdateError Text | P2PWarning | P2PWarningDevelopementNetworkProtocols - | WarningDevelopmentNetworkProtocols [NPV.NodeToNodeVersion] [NPV.NodeToClientVersion] + | WarningDevelopmentNodeToNodeVersions [NPV.NodeToNodeVersion] + | WarningDevelopmentNodeToClientVersions [NPV.NodeToClientVersion] deriving (Generic, FromJSON, ToJSON) -- | The representation of the current state of node. @@ -215,10 +216,11 @@ traceNodeStateStartup tr ev = traceWith tr $ NodeStartup $ NetworkConfigUpdateError e Startup.P2PWarning -> traceWith tr $ NodeStartup P2PWarning - Startup.P2PWarningDevelopementNetworkProtocols -> - traceWith tr $ NodeStartup P2PWarningDevelopementNetworkProtocols - Startup.WarningDevelopmentNetworkProtocols n2ns n2cs -> - traceWith tr $ NodeStartup $ WarningDevelopmentNetworkProtocols n2ns n2cs + Startup.WarningDevelopmentNodeToNodeVersions ntnVersions -> + traceWith tr $ NodeStartup (WarningDevelopmentNodeToNodeVersions ntnVersions) + Startup.WarningDevelopmentNodeToClientVersions ntcVersions -> + traceWith tr $ NodeStartup (WarningDevelopmentNodeToClientVersions ntcVersions) + -- TODO: why other constructors are not traced? _ -> return () traceNodeStateShutdown diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs index 48bbb1cdc8b..ebc35ffe864 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs @@ -137,7 +137,8 @@ namesStartupInfo = \case NetworkConfigLegacy {} -> ["NetworkConfigLegacy"] P2PWarning {} -> ["P2PWarning"] P2PWarningDevelopementNetworkProtocols {} -> ["P2PWarningDevelopementNetworkProtocols"] - WarningDevelopmentNetworkProtocols {} -> ["WarningDevelopmentNetworkProtocols"] + WarningDevelopmentNodeToNodeVersions {} -> ["WarningDevelopmentNodeToNodeVersions"] + WarningDevelopmentNodeToClientVersions {} -> ["WarningDevelopmentNodeToClientVersions"] BICommon {} -> ["Common"] BIShelley {} -> ["ShelleyBased"] BIByron {} -> ["Byron"] @@ -245,11 +246,15 @@ instance ( Show (BlockNodeToNodeVersion blk) forMachine _dtal P2PWarningDevelopementNetworkProtocols = mconcat [ "kind" .= String "P2PWarningDevelopementNetworkProtocols" , "message" .= String p2pWarningDevelopmentNetworkProtocolsMessage ] - forMachine _ver (WarningDevelopmentNetworkProtocols ntnVersions ntcVersions) = - mconcat [ "kind" .= String "WarningDevelopmentNetworkProtocols" + forMachine _ver (WarningDevelopmentNodeToNodeVersions ntnVersions) = + mconcat [ "kind" .= String "WarningDevelopmentNodeToNodeVersions" , "message" .= String "enabled development network protocols" - , "nodeToNodeDevelopmentVersions" .= String (showT ntnVersions) - , "nodeToClientDevelopmentVersions" .= String (showT ntcVersions) + , "versions" .= String (showT ntnVersions) + ] + forMachine _ver (WarningDevelopmentNodeToClientVersions ntcVersions) = + mconcat [ "kind" .= String "WarningDevelopmentNodeToClientVersions" + , "message" .= String "enabled development network protocols" + , "versions" .= String (showT ntcVersions) ] forMachine _dtal (BINetwork BasicInfoNetwork {..}) = mconcat [ "kind" .= String "BasicInfoNetwork" @@ -353,10 +358,12 @@ ppStartupInfoTrace P2PWarning = p2pWarningMessage ppStartupInfoTrace P2PWarningDevelopementNetworkProtocols = p2pWarningDevelopmentNetworkProtocolsMessage -ppStartupInfoTrace (WarningDevelopmentNetworkProtocols ntnVersions ntcVersions) = - "enabled development network protocols: " +ppStartupInfoTrace (WarningDevelopmentNodeToNodeVersions ntnVersions) = + "enabled development node-to-node versions: " <> showT ntnVersions - <> " " + +ppStartupInfoTrace (WarningDevelopmentNodeToClientVersions ntcVersions) = + "enabled development node-to-client versions: " <> showT ntcVersions ppStartupInfoTrace (BINetwork BasicInfoNetwork {..}) = diff --git a/cardano-node/src/Cardano/Tracing/Startup.hs b/cardano-node/src/Cardano/Tracing/Startup.hs index ba45dffb4d8..d3347427a12 100644 --- a/cardano-node/src/Cardano/Tracing/Startup.hs +++ b/cardano-node/src/Cardano/Tracing/Startup.hs @@ -31,7 +31,8 @@ instance HasSeverityAnnotation (StartupTrace blk) where getSeverityAnnotation NetworkConfigUpdateUnsupported = Warning getSeverityAnnotation P2PWarning = Warning getSeverityAnnotation P2PWarningDevelopementNetworkProtocols = Warning - getSeverityAnnotation WarningDevelopmentNetworkProtocols {} = Warning + getSeverityAnnotation WarningDevelopmentNodeToNodeVersions {} = Warning + getSeverityAnnotation WarningDevelopmentNodeToClientVersions {} = Warning getSeverityAnnotation _ = Info instance HasPrivacyAnnotation (StartupTrace blk)