From 4d78bdb7c6cf613e81faa694558fd099e97eb9f3 Mon Sep 17 00:00:00 2001 From: Neil Mayhew Date: Wed, 20 Nov 2024 16:21:02 -0700 Subject: [PATCH 1/3] Bump Hackage and CHaP indexes --- cabal.project | 4 ++-- flake.lock | 44 ++++++++++++++++++++++---------------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/cabal.project b/cabal.project index 30bffd7256..2dadea3e3f 100644 --- a/cabal.project +++ b/cabal.project @@ -13,8 +13,8 @@ repository cardano-haskell-packages -- See CONTRIBUTING for information about these, including some Nix commands -- you need to run if you change them index-state: - , hackage.haskell.org 2024-10-10T08:11:33Z - , cardano-haskell-packages 2024-10-14T23:19:53Z + , hackage.haskell.org 2024-12-10T16:20:07Z + , cardano-haskell-packages 2024-12-18T14:29:04Z packages: cardano-api diff --git a/flake.lock b/flake.lock index 785b5bc9f9..99d17f2e77 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1728953092, - "narHash": "sha256-DBqT9uexf/yoZjtEP3263ltnhP/o7iBl8IZdJRfPjJs=", + "lastModified": 1734535858, + "narHash": "sha256-9DzduMA63FdftXjZi5j2JKqxVnU8tC246w8N77MM1fs=", "owner": "intersectmbo", "repo": "cardano-haskell-packages", - "rev": "fd5e5cf056090977ecbd661ad07f602eb7e2614d", + "rev": "9cc1161fab9bafb3d6b7ee28395a732519caf540", "type": "github" }, "original": { @@ -205,11 +205,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1728952051, - "narHash": "sha256-nCNldd8iA8/T3qUKbSFzBmiHu4oFjmgwz0DFrZaUJhU=", + "lastModified": 1733877006, + "narHash": "sha256-rNpSFS/ziUQBPgo6iAbKgU00yRpeCngv215TW0D+kCo=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "1762ac2d3054cb53246ff77e8a6786f6d7357b4f", + "rev": "583f569545854160b6bc5606374bf5006a9f6929", "type": "github" }, "original": { @@ -258,11 +258,11 @@ "stackage": "stackage" }, "locked": { - "lastModified": 1723683036, - "narHash": "sha256-pT74TrE+bCaeXhYLYJrZVocwopwwua4qOwN7waUdUpU=", + "lastModified": 1732063900, + "narHash": "sha256-uuaN+jFurAw5h1vntx4Jcqy1vGJaReXJSbTuR1q5rf0=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "88aeace47b5e43cb4df5f96e754179293c06f47c", + "rev": "3cca9b78a23dcb2146b4fe0aef12b9d2e8e6213c", "type": "github" }, "original": { @@ -427,16 +427,16 @@ "hls-2.9": { "flake": false, "locked": { - "lastModified": 1718469202, - "narHash": "sha256-THXSz+iwB1yQQsr/PY151+2GvtoJnTIB2pIQ4OzfjD4=", + "lastModified": 1720003792, + "narHash": "sha256-qnDx8Pk0UxtoPr7BimEsAZh9g2WuTuMB/kGqnmdryKs=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "40891bccb235ebacce020b598b083eab9dda80f1", + "rev": "0c1817cb2babef0765e4e72dd297c013e8e3d12b", "type": "github" }, "original": { "owner": "haskell", - "ref": "2.9.0.0", + "ref": "2.9.0.1", "repo": "haskell-language-server", "type": "github" } @@ -685,11 +685,11 @@ }, "nixpkgs-2405": { "locked": { - "lastModified": 1720122915, - "narHash": "sha256-Nby8WWxj0elBu1xuRaUcRjPi/rU3xVbkAt2kj4QwX2U=", + "lastModified": 1729242558, + "narHash": "sha256-VgcLDu4igNT0eYua6OAl9pWCI0cYXhDbR+pWP44tte0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "835cf2d3f37989c5db6585a28de967a667a75fb1", + "rev": "4a3f2d3195b60d07530574988df92e049372c10e", "type": "github" }, "original": { @@ -717,11 +717,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1720181791, - "narHash": "sha256-i4vJL12/AdyuQuviMMd1Hk2tsGt02hDNhA0Zj1m16N8=", + "lastModified": 1729980323, + "narHash": "sha256-eWPRZAlhf446bKSmzw6x7RWEE4IuZgAp8NW3eXZwRAY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4284c2b73c8bce4b46a6adf23e16d9e2ec8da4bb", + "rev": "86e78d3d2084ff87688da662cf78c2af085d8e73", "type": "github" }, "original": { @@ -815,11 +815,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1723594352, - "narHash": "sha256-cQVhF1M1et3/XNE1sclwH39prxIDMUojTdnW61t3YrM=", + "lastModified": 1732061500, + "narHash": "sha256-exwtyDeUn6BwKd5gWseAT8SVn+na/YGw/VIwuBkeUd0=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "c077da02c56031a78adc4bf0cf2b182effc895ed", + "rev": "000b2806cef5408df133a22bc5460ec91b25606b", "type": "github" }, "original": { From 4b5b0daa3cdb9ca997314b150a270f90c7170a75 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Thu, 25 Jul 2024 21:33:57 +0200 Subject: [PATCH 2/3] Updated to use typed-protocols-0.3.0.0 --- cardano-api/cardano-api.cabal | 6 +-- cardano-api/internal/Cardano/Api/IPC.hs | 26 ++++++++----- .../internal/Cardano/Api/LedgerState.hs | 38 +++++++++---------- .../Cardano/Api/ChainSync/ClientPipelined.hs | 2 +- 4 files changed, 39 insertions(+), 33 deletions(-) diff --git a/cardano-api/cardano-api.cabal b/cardano-api/cardano-api.cabal index f64a1ed28c..57ba2f808c 100644 --- a/cardano-api/cardano-api.cabal +++ b/cardano-api/cardano-api.cabal @@ -207,7 +207,7 @@ library internal ouroboros-consensus-diffusion ^>=0.18, ouroboros-consensus-protocol ^>=0.9.0.2, ouroboros-network, - ouroboros-network-api ^>=0.10, + ouroboros-network-api ^>=0.11, ouroboros-network-framework, ouroboros-network-protocols, parsec, @@ -226,7 +226,7 @@ library internal time, transformers, transformers-except ^>=0.1.3, - typed-protocols ^>=0.1.1, + typed-protocols ^>=0.3, vector, yaml, @@ -262,7 +262,7 @@ library memory, nothunks, ouroboros-network-protocols, - typed-protocols ^>=0.1.1, + typed-protocols, library gen import: project-config diff --git a/cardano-api/internal/Cardano/Api/IPC.hs b/cardano-api/internal/Cardano/Api/IPC.hs index c277fc35a5..4171cf9032 100644 --- a/cardano-api/internal/Cardano/Api/IPC.hs +++ b/cardano-api/internal/Cardano/Api/IPC.hs @@ -122,6 +122,7 @@ import qualified Ouroboros.Network.Protocol.LocalTxSubmission.Client as Net.Tx import Control.Concurrent.STM (TMVar, atomically, newEmptyTMVarIO, putTMVar, takeTMVar, tryPutTMVar) +import Control.Exception (throwIO) import Control.Monad (void) import Control.Monad.IO.Class import Control.Tracer (nullTracer) @@ -202,15 +203,19 @@ connectToLocalNodeWithVersion , localConsensusModeParams } clients = - liftIO $ Net.withIOManager $ \iomgr -> - Net.connectTo - (Net.localSnocket iomgr) - Net.NetworkConnectTracers - { Net.nctMuxTracer = nullTracer - , Net.nctHandshakeTracer = nullTracer - } - versionedProtocls - (unFile localNodeSocketPath) + liftIO $ Net.withIOManager $ \iomgr -> do + r <- + Net.connectTo + (Net.localSnocket iomgr) + Net.NetworkConnectTracers + { Net.nctMuxTracer = nullTracer + , Net.nctHandshakeTracer = nullTracer + } + versionedProtocls + (unFile localNodeSocketPath) + case r of + Left e -> throwIO e + Right _ -> pure () where versionedProtocls = -- First convert from the mode-parametrised view of things to the @@ -302,10 +307,11 @@ mkVersionedProtocols networkid ptcl unversionedClients = ) , localStateQueryProtocol = Net.InitiatorProtocolOnly $ - Net.mkMiniProtocolCbFromPeer $ + Net.mkMiniProtocolCbFromPeerSt $ const ( nullTracer , cStateQueryCodec + , Net.Query.StateIdle , maybe Net.localStateQueryPeerNull Net.Query.localStateQueryClientPeer diff --git a/cardano-api/internal/Cardano/Api/LedgerState.hs b/cardano-api/internal/Cardano/Api/LedgerState.hs index a960aaaf72..468242a2c7 100644 --- a/cardano-api/internal/Cardano/Api/LedgerState.hs +++ b/cardano-api/internal/Cardano/Api/LedgerState.hs @@ -220,7 +220,7 @@ import qualified Data.Yaml as Yaml import Formatting.Buildable (build) import GHC.Exts (IsList (..)) import Lens.Micro -import Network.TypedProtocol.Pipelined (Nat (..)) +import Network.TypedProtocol.Core (Nat (..)) import System.FilePath data InitialLedgerStateError @@ -1097,45 +1097,45 @@ instance FromJSON NodeConfig where <*> parseBabbageHardForkEpoch o <*> parseConwayHardForkEpoch o - parseShelleyHardForkEpoch :: Object -> Parser Consensus.TriggerHardFork + parseShelleyHardForkEpoch :: Object -> Parser (Consensus.CardanoHardForkTrigger blk) parseShelleyHardForkEpoch o = asum - [ Consensus.TriggerHardForkAtEpoch <$> o .: "TestShelleyHardForkAtEpoch" - , pure $ Consensus.TriggerHardForkAtVersion 2 -- Mainnet default + [ Consensus.CardanoTriggerHardForkAtEpoch <$> o .: "TestShelleyHardForkAtEpoch" + , pure Consensus.CardanoTriggerHardForkAtDefaultVersion ] - parseAllegraHardForkEpoch :: Object -> Parser Consensus.TriggerHardFork + parseAllegraHardForkEpoch :: Object -> Parser (Consensus.CardanoHardForkTrigger blk) parseAllegraHardForkEpoch o = asum - [ Consensus.TriggerHardForkAtEpoch <$> o .: "TestAllegraHardForkAtEpoch" - , pure $ Consensus.TriggerHardForkAtVersion 3 -- Mainnet default + [ Consensus.CardanoTriggerHardForkAtEpoch <$> o .: "TestAllegraHardForkAtEpoch" + , pure Consensus.CardanoTriggerHardForkAtDefaultVersion ] - parseMaryHardForkEpoch :: Object -> Parser Consensus.TriggerHardFork + parseMaryHardForkEpoch :: Object -> Parser (Consensus.CardanoHardForkTrigger blk) parseMaryHardForkEpoch o = asum - [ Consensus.TriggerHardForkAtEpoch <$> o .: "TestMaryHardForkAtEpoch" - , pure $ Consensus.TriggerHardForkAtVersion 4 -- Mainnet default + [ Consensus.CardanoTriggerHardForkAtEpoch <$> o .: "TestMaryHardForkAtEpoch" + , pure Consensus.CardanoTriggerHardForkAtDefaultVersion ] - parseAlonzoHardForkEpoch :: Object -> Parser Consensus.TriggerHardFork + parseAlonzoHardForkEpoch :: Object -> Parser (Consensus.CardanoHardForkTrigger blk) parseAlonzoHardForkEpoch o = asum - [ Consensus.TriggerHardForkAtEpoch <$> o .: "TestAlonzoHardForkAtEpoch" - , pure $ Consensus.TriggerHardForkAtVersion 5 -- Mainnet default + [ Consensus.CardanoTriggerHardForkAtEpoch <$> o .: "TestAlonzoHardForkAtEpoch" + , pure Consensus.CardanoTriggerHardForkAtDefaultVersion ] - parseBabbageHardForkEpoch :: Object -> Parser Consensus.TriggerHardFork + parseBabbageHardForkEpoch :: Object -> Parser (Consensus.CardanoHardForkTrigger blk) parseBabbageHardForkEpoch o = asum - [ Consensus.TriggerHardForkAtEpoch <$> o .: "TestBabbageHardForkAtEpoch" - , pure $ Consensus.TriggerHardForkAtVersion 7 -- Mainnet default + [ Consensus.CardanoTriggerHardForkAtEpoch <$> o .: "TestBabbageHardForkAtEpoch" + , pure Consensus.CardanoTriggerHardForkAtDefaultVersion ] - parseConwayHardForkEpoch :: Object -> Parser Consensus.TriggerHardFork + parseConwayHardForkEpoch :: Object -> Parser (Consensus.CardanoHardForkTrigger blk) parseConwayHardForkEpoch o = asum - [ Consensus.TriggerHardForkAtEpoch <$> o .: "TestConwayHardForkAtEpoch" - , pure $ Consensus.TriggerHardForkAtVersion 9 -- Mainnet default + [ Consensus.CardanoTriggerHardForkAtEpoch <$> o .: "TestConwayHardForkAtEpoch" + , pure Consensus.CardanoTriggerHardForkAtDefaultVersion ] ---------------------------------------------------------------------- diff --git a/cardano-api/src/Cardano/Api/ChainSync/ClientPipelined.hs b/cardano-api/src/Cardano/Api/ChainSync/ClientPipelined.hs index 0ff1ba8e89..e794708a29 100644 --- a/cardano-api/src/Cardano/Api/ChainSync/ClientPipelined.hs +++ b/cardano-api/src/Cardano/Api/ChainSync/ClientPipelined.hs @@ -34,4 +34,4 @@ where import Ouroboros.Network.Protocol.ChainSync.ClientPipelined import Ouroboros.Network.Protocol.ChainSync.PipelineDecision -import Network.TypedProtocol.Pipelined (N (..), Nat (..), natToInt) +import Network.TypedProtocol.Core (N (..), Nat (..), natToInt) From f1a8204633c82fdd5bd775624648b9fcee473a23 Mon Sep 17 00:00:00 2001 From: Neil Mayhew Date: Wed, 18 Dec 2024 17:48:08 -0700 Subject: [PATCH 3/3] Add an srp for ouroboros-consensus --- cabal.project | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cabal.project b/cabal.project index 2dadea3e3f..c0bcbdc1d9 100644 --- a/cabal.project +++ b/cabal.project @@ -52,3 +52,13 @@ write-ghc-environment-files: always constraints: Cabal < 3.14, cardano-ledger-shelley ^>= 1.14.1 + +source-repository-package + type: git + location: https://github.com/IntersectMBO/ouroboros-consensus + tag: 592e11c8ce941d10aaf185ca58796f25e6f403f0 + --sha256: sha256-0NU/Z9Xmewk0kbVSZdTBoieFwYdaO5qgxJmlOZ7dVmM= + subdir: ouroboros-consensus + ouroboros-consensus-cardano + ouroboros-consensus-diffusion + ouroboros-consensus-protocol