diff --git a/cardano-ping/CHANGELOG.md b/cardano-ping/CHANGELOG.md index 0f5e91211d..53df14fad5 100644 --- a/cardano-ping/CHANGELOG.md +++ b/cardano-ping/CHANGELOG.md @@ -5,6 +5,7 @@ ### Breaking changes * Added `NodeToClientVersionV18` +* Added `NodeToNodeVersion14` ## 0.4.0.1 -- 2024-08-27 diff --git a/cardano-ping/src/Cardano/Network/Ping.hs b/cardano-ping/src/Cardano/Network/Ping.hs index c1060d0002..272ddcc43d 100644 --- a/cardano-ping/src/Cardano/Network/Ping.hs +++ b/cardano-ping/src/Cardano/Network/Ping.hs @@ -133,6 +133,7 @@ supportedNodeToNodeVersions magic = , NodeToNodeVersionV11 magic InitiatorOnly , NodeToNodeVersionV12 magic InitiatorOnly , NodeToNodeVersionV13 magic InitiatorOnly PeerSharingDisabled + , NodeToNodeVersionV14 magic InitiatorOnly PeerSharingDisabled ] supportedNodeToClientVersions :: Word32 -> [NodeVersion] @@ -195,6 +196,7 @@ data NodeVersion | NodeToNodeVersionV11 Word32 InitiatorOnly | NodeToNodeVersionV12 Word32 InitiatorOnly | NodeToNodeVersionV13 Word32 InitiatorOnly PeerSharing + | NodeToNodeVersionV14 Word32 InitiatorOnly PeerSharing deriving (Eq, Ord, Show) instance ToJSON NodeVersion where @@ -223,6 +225,7 @@ instance ToJSON NodeVersion where NodeToNodeVersionV11 m i -> go3 "NodeToNodeVersionV11" m i NodeToNodeVersionV12 m i -> go3 "NodeToNodeVersionV12" m i NodeToNodeVersionV13 m i ps -> go4 "NodeToNodeVersionV13" m i ps + NodeToNodeVersionV14 m i ps -> go4 "NodeToNodeVersionV14" m i ps where go2 (version :: String) magic = ["version" .= version, "magic" .= magic] go3 version magic initiator = go2 version magic <> ["initiator" .= toJSON initiator] @@ -369,6 +372,7 @@ handshakeReqEnc versions query = encodeVersion (NodeToNodeVersionV11 magic mode) = encodeWithMode 11 magic mode encodeVersion (NodeToNodeVersionV12 magic mode) = encodeWithMode 12 magic mode encodeVersion (NodeToNodeVersionV13 magic mode _) = encodeWithMode 13 magic mode + encodeVersion (NodeToNodeVersionV14 magic mode _) = encodeWithMode 14 magic mode nodeToClientDataWithQuery :: Word32 -> CBOR.Encoding nodeToClientDataWithQuery magic @@ -482,6 +486,7 @@ handshakeDec = do (11, False) -> decodeWithModeAndQuery NodeToNodeVersionV11 (12, False) -> decodeWithModeAndQuery NodeToNodeVersionV12 (13, False) -> decodeWithModeQueryAndPeerSharing NodeToNodeVersionV13 + (14, False) -> decodeWithModeQueryAndPeerSharing NodeToNodeVersionV14 (9, True) -> Right . NodeToClientVersionV9 <$> CBOR.decodeWord32 (10, True) -> Right . NodeToClientVersionV10 <$> CBOR.decodeWord32 @@ -827,3 +832,4 @@ isSameVersionAndMagic v1 v2 = extract v1 == extract v2 extract (NodeToNodeVersionV11 m _) = (11, m) extract (NodeToNodeVersionV12 m _) = (12, m) extract (NodeToNodeVersionV13 m _ _) = (13, m) + extract (NodeToNodeVersionV14 m _ _) = (14, m) diff --git a/docs/network-spec/miniprotocols.tex b/docs/network-spec/miniprotocols.tex index 8a33eab5b7..8119f3e0a6 100644 --- a/docs/network-spec/miniprotocols.tex +++ b/docs/network-spec/miniprotocols.tex @@ -1494,24 +1494,15 @@ \section{Node-to-node protocol} \begin{center} \begin{tabular}{l|l} version & description \\\hline\hline - $NodeToNodeV\_1*$ & initial version \\\hline - $NodeToNodeV\_2*$ & block size hints \\\hline - $NodeToNodeV\_3*$ & introduction of keep-alive mini-protocol \\\hline - $NodeToNodeV\_4*$ & introduction of diffusion mode in handshake mini-protocol \\\hline - $NodeToNodeV\_5*$ & \\\hline - $NodeToNodeV\_6*$ & transaction submission version 2 \\\hline - $NodeToNodeV\_7$ & new keep-alive, Alonzo ledger era \\\hline - $NodeToNodeV\_8$ & chain-sync \& block-fetch pipelining \\\hline - $NodeToNodeV\_9$ & Babbage ledger era \\\hline - $NodeToNodeV\_10$ & Full duplex connections \\\hline - $NodeToNodeV\_11$ & Peer sharing willingness \\\hline - $NodeToNodeV\_12$ & No observable changes \\\hline $NodeToNodeV\_13$ & Disabled peer sharing for buggy V11 \& V12 and for InitiatorOnly nodes \\\hline + $NodeToNodeV\_14$ & No changes, identifies Chang+1 HF nodes\\\hline \end{tabular} - \caption{Node-to-node protocol versions (* - support removed)} + \caption{Node-to-node protocol versions} \label{table:node-to-node-protocol-versions} \end{center} \end{figure} +\newline +Previously supported node-to-node versions are listed in table \ref{table:historical-node-to-node-protocol-versions}. \section{Node-to-client protocol} \label{section:node-to-client-protocol} @@ -1530,14 +1521,6 @@ \section{Node-to-client protocol} \begin{center} \begin{tabular}{l|l} version & description \\\hline\hline - $NodeToClientV\_1*$ & initial version\\\hline - $NodeToClientV\_2*$ & added local-query mini-protocol\\\hline - $NodeToClientV\_3*$ & \\\hline - $NodeToClientV\_4*$ & new queries added to local state query mini-protocol\\\hline - $NodeToClientV\_5*$ & allegra \\\hline - $NodeToClientV\_6*$ & mary \\\hline - $NodeToClientV\_7*$ & new queries added to local state query mini-protocol\\\hline - $NodeToClientV\_8*$ & codec changed for local state query mini-protocol\\\hline $NodeToClientV\_9$ & alonzo \\\hline $NodeToClientV\_10$ & GetChainBlock \& GetChainPoint queries \\\hline $NodeToClientV\_11$ & GetRewardInfoPools query \\\hline @@ -1547,8 +1530,11 @@ \section{Node-to-client protocol} $NodeToClientV\_15$ & internal changes \\\hline $NodeToClientV\_16$ & Add ImmutableTip to LocalStateQuery, conway, GetStakeDelegDeposits query \\\hline $NodeToClientV\_17$ & GetProposals, GetRatifyState queries \\\hline + $NodeToClientV\_18$ & GetFuturePParams query \\\hline \end{tabular} - \caption{Node-to-client protocol versions (* - support removed)} + \caption{Node-to-client protocol versions} \label{table:node-to-client-protocol-versions} \end{center} \end{figure} +\newline +Previously supported node-to-client versions are listed in table \ref{table:historical-node-to-client-protocol-versions}. diff --git a/docs/network-spec/network-spec.tex b/docs/network-spec/network-spec.tex index ec5fd278f0..ce1b1f4c42 100644 --- a/docs/network-spec/network-spec.tex +++ b/docs/network-spec/network-spec.tex @@ -195,10 +195,58 @@ \section*{Version history} % \include{rest} \appendix + \chapter{Common CDDL definitions} \label{cddl-common} \lstinputlisting[style=cddl]{../../ouroboros-network-protocols/test-cddl/specs/common.cddl} +\chapter{Historical protocol versions} +\label{historical-protocol-versions} + +Previously supported versions of the \textit{node-to-node protocol} are listed +in table~\ref{table:historical-node-to-node-protocol-versions}. +\begin{figure}[h] + \begin{center} + \begin{tabular}{l|l} + version & description \\\hline\hline + $NodeToNodeV\_1$ & initial version \\\hline + $NodeToNodeV\_2$ & block size hints \\\hline + $NodeToNodeV\_3$ & introduction of keep-alive mini-protocol \\\hline + $NodeToNodeV\_4$ & introduction of diffusion mode in handshake mini-protocol \\\hline + $NodeToNodeV\_5$ & \\\hline + $NodeToNodeV\_6$ & transaction submission version 2 \\\hline + $NodeToNodeV\_7$ & new keep-alive, Alonzo ledger era \\\hline + $NodeToNodeV\_8$ & chain-sync \& block-fetch pipelining \\\hline + $NodeToNodeV\_9$ & Babbage ledger era \\\hline + $NodeToNodeV\_10$ & Full duplex connections \\\hline + $NodeToNodeV\_11$ & Peer sharing willingness \\\hline + $NodeToNodeV\_12$ & No observable changes \\\hline + \end{tabular} + \caption{Node-to-node protocol versions} + \label{table:historical-node-to-node-protocol-versions} + \end{center} +\end{figure} + +Previously supported versions of the \textit{node-to-client protocol} are listed +in table~\ref{table:historical-node-to-client-protocol-versions}. +\begin{figure}[h] + \begin{center} + \begin{tabular}{l|l} + version & description \\\hline\hline + $NodeToClientV\_1$ & initial version\\\hline + $NodeToClientV\_2$ & added local-query mini-protocol\\\hline + $NodeToClientV\_3$ & \\\hline + $NodeToClientV\_4$ & new queries added to local state query mini-protocol\\\hline + $NodeToClientV\_5$ & allegra \\\hline + $NodeToClientV\_6$ & mary \\\hline + $NodeToClientV\_7$ & new queries added to local state query mini-protocol\\\hline + $NodeToClientV\_8$ & codec changed for local state query mini-protocol\\\hline + \end{tabular} + \caption{Node-to-client protocol versions} + \label{table:historical-node-to-client-protocol-versions} + \end{center} +\end{figure} + \bibliographystyle{apalike} \bibliography{references} diff --git a/ouroboros-network-api/CHANGELOG.md b/ouroboros-network-api/CHANGELOG.md index 2b03ccf2e4..507d97c6c5 100644 --- a/ouroboros-network-api/CHANGELOG.md +++ b/ouroboros-network-api/CHANGELOG.md @@ -14,6 +14,7 @@ * Removed `WhetherReceivingTentativeBlocks` used to distinguish whether a node version is pipelining-enabled, used in older `NodeToNodeVersion` +* Added NodeToNodeV_14 to identify nodes supporting Chang+1 HF ### Non-breaking changes diff --git a/ouroboros-network-api/src/Ouroboros/Network/NodeToNode/Version.hs b/ouroboros-network-api/src/Ouroboros/Network/NodeToNode/Version.hs index fb2ecd9ed4..f2080f8ffd 100644 --- a/ouroboros-network-api/src/Ouroboros/Network/NodeToNode/Version.hs +++ b/ouroboros-network-api/src/Ouroboros/Network/NodeToNode/Version.hs @@ -60,21 +60,25 @@ data NodeToNodeVersion = -- -- -- -- (In the past, this enabled Conway, but the negotiated 'NodeToNodeVersion' -- -- no longer en-/disables eras.) - NodeToNodeV_13 + NodeToNodeV_13 -- ^ Changes: -- -- * Removed PeerSharingPrivate constructor -- * Fixed Codec to disable PeerSharing with buggy versions 11 and 12. -- * Disable PeerSharing with InitiatorOnly nodes, since they do not run -- peer sharing server side and can not reply to requests. + | NodeToNodeV_14 + -- ^ Chang+1 HF deriving (Eq, Ord, Enum, Bounded, Show, Typeable, Generic, NFData) nodeToNodeVersionCodec :: CodecCBORTerm (Text, Maybe Int) NodeToNodeVersion nodeToNodeVersionCodec = CodecCBORTerm { encodeTerm, decodeTerm } where encodeTerm NodeToNodeV_13 = CBOR.TInt 13 + encodeTerm NodeToNodeV_14 = CBOR.TInt 14 decodeTerm (CBOR.TInt 13) = Right NodeToNodeV_13 + decodeTerm (CBOR.TInt 14) = Right NodeToNodeV_14 decodeTerm (CBOR.TInt n) = Left ( T.pack "decode NodeToNodeVersion: unknown tag: " <> T.pack (show n) , Just n @@ -147,6 +151,7 @@ nodeToNodeCodecCBORTerm :: NodeToNodeVersion -> CodecCBORTerm Text NodeToNodeVer nodeToNodeCodecCBORTerm = \case NodeToNodeV_13 -> v13 + NodeToNodeV_14 -> v13 where v13 = CodecCBORTerm { encodeTerm = encodeTerm13, decodeTerm = decodeTerm13 } diff --git a/ouroboros-network-api/src/Ouroboros/Network/PeerSelection/PeerSharing/Codec.hs b/ouroboros-network-api/src/Ouroboros/Network/PeerSelection/PeerSharing/Codec.hs index c1346799d0..196a77953e 100644 --- a/ouroboros-network-api/src/Ouroboros/Network/PeerSelection/PeerSharing/Codec.hs +++ b/ouroboros-network-api/src/Ouroboros/Network/PeerSelection/PeerSharing/Codec.hs @@ -31,6 +31,8 @@ encodeRemoteAddress :: NodeToNodeVersion -> SockAddr -> CBOR.Encoding encodeRemoteAddress = \case NodeToNodeV_13 -> sockAddr + NodeToNodeV_14 -> sockAddr + where sockAddr = \case SockAddrInet pn w -> CBOR.encodeListLen 3 @@ -55,6 +57,8 @@ decodeRemoteAddress :: NodeToNodeVersion -> CBOR.Decoder s SockAddr decodeRemoteAddress = \case NodeToNodeV_13 -> decoder13 + NodeToNodeV_14 -> decoder13 + where decoder13 = do _ <- CBOR.decodeListLen diff --git a/ouroboros-network-protocols/test-cddl/specs/handshake-node-to-node-v13.cddl b/ouroboros-network-protocols/test-cddl/specs/handshake-node-to-node-v13.cddl index 893d7a21f6..8b46703ace 100644 --- a/ouroboros-network-protocols/test-cddl/specs/handshake-node-to-node-v13.cddl +++ b/ouroboros-network-protocols/test-cddl/specs/handshake-node-to-node-v13.cddl @@ -14,7 +14,7 @@ msgQueryReply = [3, versionTable] versionTable = { * versionNumber => nodeToNodeVersionData } -versionNumber = 13 +versionNumber = 13 / 14 nodeToNodeVersionData = [ networkMagic, initiatorOnlyDiffusionMode, peerSharing, query ] @@ -33,4 +33,3 @@ refuseReason refuseReasonVersionMismatch = [0, [ *versionNumber ] ] refuseReasonHandshakeDecodeError = [1, versionNumber, tstr] refuseReasonRefused = [2, versionNumber, tstr] -