diff --git a/cardano-ping/CHANGELOG.md b/cardano-ping/CHANGELOG.md index b29b08408f..269bb153ac 100644 --- a/cardano-ping/CHANGELOG.md +++ b/cardano-ping/CHANGELOG.md @@ -1,5 +1,11 @@ # Revision history for cardano-ping +## next version + +### Breaking changes + +* Added `NodeToClientVersionV20` + ## 0.7.0.0 -- 2024-10-17 ### Breaking changes diff --git a/cardano-ping/src/Cardano/Network/Ping.hs b/cardano-ping/src/Cardano/Network/Ping.hs index 2947d4fb09..62ffafd694 100644 --- a/cardano-ping/src/Cardano/Network/Ping.hs +++ b/cardano-ping/src/Cardano/Network/Ping.hs @@ -151,6 +151,7 @@ supportedNodeToClientVersions magic = , NodeToClientVersionV17 magic , NodeToClientVersionV18 magic , NodeToClientVersionV19 magic + , NodeToClientVersionV20 magic ] data InitiatorOnly = InitiatorOnly | InitiatorAndResponder @@ -187,6 +188,7 @@ data NodeVersion | NodeToClientVersionV17 Word32 | NodeToClientVersionV18 Word32 | NodeToClientVersionV19 Word32 + | NodeToClientVersionV20 Word32 | NodeToNodeVersionV1 Word32 | NodeToNodeVersionV2 Word32 | NodeToNodeVersionV3 Word32 @@ -217,6 +219,7 @@ instance ToJSON NodeVersion where NodeToClientVersionV17 m -> go2 "NodeToClientVersionV17" m NodeToClientVersionV18 m -> go2 "NodeToClientVersionV18" m NodeToClientVersionV19 m -> go2 "NodeToClientVersionV19" m + NodeToClientVersionV20 m -> go2 "NodeToClientVersionV20" m NodeToNodeVersionV1 m -> go2 "NodeToNodeVersionV1" m NodeToNodeVersionV2 m -> go2 "NodeToNodeVersionV2" m NodeToNodeVersionV3 m -> go2 "NodeToNodeVersionV3" m @@ -357,9 +360,13 @@ handshakeReqEnc versions query = CBOR.encodeWord (18 `setBit` nodeToClientVersionBit) <> nodeToClientDataWithQuery magic encodeVersion (NodeToClientVersionV19 magic) = - CBOR.encodeWord (18 `setBit` nodeToClientVersionBit) + CBOR.encodeWord (19 `setBit` nodeToClientVersionBit) + <> nodeToClientDataWithQuery magic + encodeVersion (NodeToClientVersionV20 magic) = + CBOR.encodeWord (20 `setBit` nodeToClientVersionBit) <> nodeToClientDataWithQuery magic + -- node-to-node encodeVersion (NodeToNodeVersionV1 magic) = CBOR.encodeWord 1 @@ -507,6 +514,7 @@ handshakeDec = do (17, True) -> Right . NodeToClientVersionV17 <$> (CBOR.decodeListLen *> CBOR.decodeWord32 <* (modeFromBool <$> CBOR.decodeBool)) (18, True) -> Right . NodeToClientVersionV18 <$> (CBOR.decodeListLen *> CBOR.decodeWord32 <* (modeFromBool <$> CBOR.decodeBool)) (19, True) -> Right . NodeToClientVersionV19 <$> (CBOR.decodeListLen *> CBOR.decodeWord32 <* (modeFromBool <$> CBOR.decodeBool)) + (20, True) -> Right . NodeToClientVersionV20 <$> (CBOR.decodeListLen *> CBOR.decodeWord32 <* (modeFromBool <$> CBOR.decodeBool)) _ -> return $ Left $ UnknownVersionInRsp version decodeWithMode :: (Word32 -> InitiatorOnly -> NodeVersion) -> CBOR.Decoder s (Either HandshakeFailure NodeVersion) @@ -829,6 +837,7 @@ isSameVersionAndMagic v1 v2 = extract v1 == extract v2 extract (NodeToClientVersionV17 m) = (-17, m) extract (NodeToClientVersionV18 m) = (-18, m) extract (NodeToClientVersionV19 m) = (-19, m) + extract (NodeToClientVersionV20 m) = (-20, m) extract (NodeToNodeVersionV1 m) = (1, m) extract (NodeToNodeVersionV2 m) = (2, m) extract (NodeToNodeVersionV3 m) = (3, m) diff --git a/ouroboros-network-api/CHANGELOG.md b/ouroboros-network-api/CHANGELOG.md index 9a88c59cec..8e1dfa6751 100644 --- a/ouroboros-network-api/CHANGELOG.md +++ b/ouroboros-network-api/CHANGELOG.md @@ -4,6 +4,8 @@ ### Breaking changes +* Added `NodeToClientV_20`. + ### Non-breaking changes ## 0.12.0.0 -- 2025-01-02 diff --git a/ouroboros-network-api/src/Ouroboros/Network/NodeToClient/Version.hs b/ouroboros-network-api/src/Ouroboros/Network/NodeToClient/Version.hs index ae7a7973db..5eaea921a5 100644 --- a/ouroboros-network-api/src/Ouroboros/Network/NodeToClient/Version.hs +++ b/ouroboros-network-api/src/Ouroboros/Network/NodeToClient/Version.hs @@ -51,6 +51,8 @@ data NodeToClientVersion -- ^ added @GetFuturePParams@ query | NodeToClientV_19 -- ^ added @GetLedgerPeerSnapshot@ + | NodeToClientV_20 + -- ^ added @QueryStakePoolDefaultVote@ deriving (Eq, Ord, Enum, Bounded, Show, Typeable, Generic, NFData) -- | We set 16ths bit to distinguish `NodeToNodeVersion` and @@ -68,6 +70,7 @@ nodeToClientVersionCodec = CodecCBORTerm { encodeTerm, decodeTerm } NodeToClientV_17 -> enc 17 NodeToClientV_18 -> enc 18 NodeToClientV_19 -> enc 19 + NodeToClientV_20 -> enc 20 where enc :: Int -> CBOR.Term enc = CBOR.TInt . (`setBit` nodeToClientVersionBit) @@ -78,6 +81,7 @@ nodeToClientVersionCodec = CodecCBORTerm { encodeTerm, decodeTerm } 17 -> Right NodeToClientV_17 18 -> Right NodeToClientV_18 19 -> Right NodeToClientV_19 + 20 -> Right NodeToClientV_20 n -> Left (unknownTag n) where dec :: CBOR.Term -> Either (Text, Maybe Int) Int diff --git a/ouroboros-network-protocols/CHANGELOG.md b/ouroboros-network-protocols/CHANGELOG.md index 8234017c93..ce9411c1ba 100644 --- a/ouroboros-network-protocols/CHANGELOG.md +++ b/ouroboros-network-protocols/CHANGELOG.md @@ -4,7 +4,8 @@ ### Breaking changes -* Added kind signatures to protocol types: +* Adapt the `versionNumber` cddl definition to account for `NodeToClientVersionV20`. +* Added kind signatures to protocol types: * `ChainSync`, * `BlockFetch`, * `TxSubmission2`, diff --git a/ouroboros-network-protocols/cddl/specs/handshake-node-to-client.cddl b/ouroboros-network-protocols/cddl/specs/handshake-node-to-client.cddl index 08ef8c9ecf..6db05c1d03 100644 --- a/ouroboros-network-protocols/cddl/specs/handshake-node-to-client.cddl +++ b/ouroboros-network-protocols/cddl/specs/handshake-node-to-client.cddl @@ -18,8 +18,8 @@ versionTable = { * versionNumber => nodeToClientVersionData } ; as of version 2 (which is no longer supported) we set 15th bit to 1 -; 16 / 17 / 18 / 19 -versionNumber = 32784 / 32785 / 32786 / 32787 +; 16 / 17 / 18 / 19 / 20 +versionNumber = 32784 / 32785 / 32786 / 32787 / 32788 ; As of version 15 and higher nodeToClientVersionData = [networkMagic, query]