diff --git a/cardano-node/ChangeLog.md b/cardano-node/ChangeLog.md index a65d89f84cc..13ea378718d 100644 --- a/cardano-node/ChangeLog.md +++ b/cardano-node/ChangeLog.md @@ -1,5 +1,9 @@ # Changelog for cardano-node +## Next version + +- Use p2p network stack by default, warn when using the legacy network stack. + ## 8.2.1 -- August 2023 - prevent SIGHUP from killing node during ledger replay diff --git a/cardano-node/src/Cardano/Node/Configuration/POM.hs b/cardano-node/src/Cardano/Node/Configuration/POM.hs index b81c9afc453..d9ff4255aad 100644 --- a/cardano-node/src/Cardano/Node/Configuration/POM.hs +++ b/cardano-node/src/Cardano/Node/Configuration/POM.hs @@ -529,7 +529,7 @@ defaultPartialNodeConfiguration = , pncTargetNumberOfKnownBigLedgerPeers = Last (Just 15) , pncTargetNumberOfEstablishedBigLedgerPeers = Last (Just 10) , pncTargetNumberOfActiveBigLedgerPeers = Last (Just 5) - , pncEnableP2P = Last (Just DisabledP2PMode) + , pncEnableP2P = Last (Just EnabledP2PMode) , pncPeerSharing = Last (Just PeerSharingDisabled) } diff --git a/cardano-node/src/Cardano/Node/Run.hs b/cardano-node/src/Cardano/Node/Run.hs index 1b474f7c14c..cd0b9935119 100644 --- a/cardano-node/src/Cardano/Node/Run.hs +++ b/cardano-node/src/Cardano/Node/Run.hs @@ -586,8 +586,8 @@ handleSimpleNode blockType runP p2pMode tracers nc onKernel = do logStartupWarnings :: IO () logStartupWarnings = do (case p2pMode of - DisabledP2PMode -> return () - EnabledP2PMode -> traceWith (startupTracer tracers) P2PWarning + EnabledP2PMode -> return () + DisabledP2PMode -> traceWith (startupTracer tracers) NonP2PWarning ) :: IO () -- annoying, but unavoidable for GADT type inference let developmentNtnVersions = diff --git a/cardano-node/src/Cardano/Node/Startup.hs b/cardano-node/src/Cardano/Node/Startup.hs index d290b8b460b..a82e7a8229a 100644 --- a/cardano-node/src/Cardano/Node/Startup.hs +++ b/cardano-node/src/Cardano/Node/Startup.hs @@ -114,8 +114,8 @@ data StartupTrace blk = (Map RelayAccessPoint PeerAdvertise) UseLedgerPeers - -- | Warn when 'EnableP2P' is set. - | P2PWarning + -- | Warn when 'DisabledP2P' is set. + | NonP2PWarning -- | Warn when 'ExperimentalProtocolsEnabled' is set and affects -- node-to-node protocol. diff --git a/cardano-node/src/Cardano/Node/Tracing/StateRep.hs b/cardano-node/src/Cardano/Node/Tracing/StateRep.hs index b34e63ec717..a36fb72d4ff 100644 --- a/cardano-node/src/Cardano/Node/Tracing/StateRep.hs +++ b/cardano-node/src/Cardano/Node/Tracing/StateRep.hs @@ -86,7 +86,7 @@ data StartupState | StartupDBValidation | NetworkConfigUpdate | NetworkConfigUpdateError Text - | P2PWarning + | NonP2PWarning | WarningDevelopmentNodeToNodeVersions [NPV.NodeToNodeVersion] | WarningDevelopmentNodeToClientVersions [NPV.NodeToClientVersion] deriving (Generic, FromJSON, ToJSON) @@ -260,8 +260,8 @@ traceNodeStateStartup tr ev = traceWith tr $ NodeStartup NetworkConfigUpdate Startup.NetworkConfigUpdateError e -> traceWith tr $ NodeStartup $ NetworkConfigUpdateError e - Startup.P2PWarning -> - traceWith tr $ NodeStartup P2PWarning + Startup.NonP2PWarning -> + traceWith tr $ NodeStartup NonP2PWarning Startup.WarningDevelopmentNodeToNodeVersions ntnVersions -> traceWith tr $ NodeStartup (WarningDevelopmentNodeToNodeVersions ntnVersions) Startup.WarningDevelopmentNodeToClientVersions ntcVersions -> diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs index 5ff68f54bb1..edbc2c2ffd3 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs @@ -231,9 +231,9 @@ instance ( Show (BlockNodeToNodeVersion blk) mconcat [ "kind" .= String "NetworkConfigLegacy" , "message" .= String p2pNetworkConfigLegacyMessage ] - forMachine _dtal P2PWarning = - mconcat [ "kind" .= String "P2PWarning" - , "message" .= String p2pWarningMessage ] + forMachine _dtal NonP2PWarning = + mconcat [ "kind" .= String "NonP2PWarning" + , "message" .= String nonP2PWarningMessage ] forMachine _ver (WarningDevelopmentNodeToNodeVersions ntnVersions) = mconcat [ "kind" .= String "WarningDevelopmentNodeToNodeVersions" , "message" .= String "enabled development network protocols" @@ -304,8 +304,8 @@ instance MetaTrace (StartupTrace blk) where Namespace [] ["NetworkConfig"] namespaceFor NetworkConfigLegacy {} = Namespace [] ["NetworkConfigLegacy"] - namespaceFor P2PWarning {} = - Namespace [] ["P2PWarning"] + namespaceFor NonP2PWarning {} = + Namespace [] ["NonP2PWarning"] namespaceFor WarningDevelopmentNodeToNodeVersions {} = Namespace [] ["WarningDevelopmentNodeToNodeVersions"] namespaceFor WarningDevelopmentNodeToClientVersions {} = @@ -323,7 +323,7 @@ instance MetaTrace (StartupTrace blk) where severityFor (Namespace _ ["NetworkConfigUpdate"]) _ = Just Notice severityFor (Namespace _ ["NetworkConfigUpdateError"]) _ = Just Error severityFor (Namespace _ ["NetworkConfigUpdateUnsupported"]) _ = Just Warning - severityFor (Namespace _ ["P2PWarning"]) _ = Just Warning + severityFor (Namespace _ ["NonP2PWarning"]) _ = Just Warning severityFor (Namespace _ ["WarningDevelopmentNodeToNodeVersions"]) _ = Just Warning severityFor (Namespace _ ["WarningDevelopmentNodeToClientVersions"]) _ = Just Warning severityFor (Namespace _ ["BlockForgingUpdateError"]) _ = Just Error @@ -358,7 +358,7 @@ instance MetaTrace (StartupTrace blk) where "" documentFor (Namespace [] ["NetworkConfigLegacy"]) = Just "" - documentFor (Namespace [] ["P2PWarning"]) = Just + documentFor (Namespace [] ["NonP2PWarning"]) = Just "" documentFor (Namespace [] ["WarningDevelopmentNodeToNodeVersions"]) = Just "" @@ -409,7 +409,7 @@ instance MetaTrace (StartupTrace blk) where , Namespace [] ["NetworkConfigUpdateError"] , Namespace [] ["NetworkConfig"] , Namespace [] ["NetworkConfigLegacy"] - , Namespace [] ["P2PWarning"] + , Namespace [] ["NonP2PWarning"] , Namespace [] ["WarningDevelopmentNodeToNodeVersions"] , Namespace [] ["WarningDevelopmentNodeToClientVersions"] , Namespace [] ["Common"] @@ -522,7 +522,7 @@ ppStartupInfoTrace (NetworkConfig localRoots publicRoots useLedgerPeers) = ] ppStartupInfoTrace NetworkConfigLegacy = p2pNetworkConfigLegacyMessage -ppStartupInfoTrace P2PWarning = p2pWarningMessage +ppStartupInfoTrace NonP2PWarning = nonP2PWarningMessage ppStartupInfoTrace (WarningDevelopmentNodeToNodeVersions ntnVersions) = "enabled development node-to-node versions: " @@ -557,10 +557,10 @@ ppStartupInfoTrace (BICommon BasicInfoCommon {..}) = <> ", Commit " <> showT biCommit <> ", Node start time " <> showT biNodeStartTime -p2pWarningMessage :: Text -p2pWarningMessage = - "You are using an early release of peer-to-peer capabilities, " - <> "please report any issues." +nonP2PWarningMessage :: Text +nonP2PWarningMessage = + "You are using legacy networking stack, " + <> "consider upgrading to the p2p network stack." p2pNetworkConfigLegacyMessage :: Text p2pNetworkConfigLegacyMessage = diff --git a/cardano-node/src/Cardano/Tracing/Startup.hs b/cardano-node/src/Cardano/Tracing/Startup.hs index 35ce6e85cf2..453e56c6394 100644 --- a/cardano-node/src/Cardano/Tracing/Startup.hs +++ b/cardano-node/src/Cardano/Tracing/Startup.hs @@ -28,7 +28,7 @@ instance HasSeverityAnnotation (StartupTrace blk) where getSeverityAnnotation NetworkConfigUpdate = Notice getSeverityAnnotation (NetworkConfigUpdateError _) = Error getSeverityAnnotation NetworkConfigUpdateUnsupported = Warning - getSeverityAnnotation P2PWarning = Warning + getSeverityAnnotation NonP2PWarning = Warning getSeverityAnnotation WarningDevelopmentNodeToNodeVersions {} = Warning getSeverityAnnotation WarningDevelopmentNodeToClientVersions {} = Warning getSeverityAnnotation _ = Info