From 2089bf9cb89ca46a630343caecda9cc338772242 Mon Sep 17 00:00:00 2001 From: Duncan Coutts Date: Sat, 18 Jul 2020 02:52:35 +0100 Subject: [PATCH] Update consensus and network dep --- cabal.project | 52 +++++++++---------- cardano-api/src/Cardano/Api/LocalChainSync.hs | 8 ++- cardano-api/src/Cardano/Api/Typed.hs | 18 +++++-- stack.yaml | 2 +- 4 files changed, 47 insertions(+), 33 deletions(-) diff --git a/cabal.project b/cabal.project index 53da41d077c..85b137b0d11 100644 --- a/cabal.project +++ b/cabal.project @@ -319,92 +319,92 @@ source-repository-package source-repository-package type: git location: https://github.com/input-output-hk/ouroboros-network - tag: 17d5199fd4415a0258c22982a099744adbfd2489 - --sha256: 1vpyq6c6249ji18valmwqd85vrjj80p1ck6jdsdxiapqqi4br90k + tag: 1c8924b856baf809f193798ff686cdb2c0ed25d2 + --sha256: 1ird981gi7wbj21g8d65jqv4q4iwch2akky4r8pf8r2w3b3767pv subdir: ouroboros-network source-repository-package type: git location: https://github.com/input-output-hk/ouroboros-network - tag: 17d5199fd4415a0258c22982a099744adbfd2489 - --sha256: 1vpyq6c6249ji18valmwqd85vrjj80p1ck6jdsdxiapqqi4br90k + tag: 1c8924b856baf809f193798ff686cdb2c0ed25d2 + --sha256: 1ird981gi7wbj21g8d65jqv4q4iwch2akky4r8pf8r2w3b3767pv subdir: io-sim source-repository-package type: git location: https://github.com/input-output-hk/ouroboros-network - tag: 17d5199fd4415a0258c22982a099744adbfd2489 - --sha256: 1vpyq6c6249ji18valmwqd85vrjj80p1ck6jdsdxiapqqi4br90k + tag: 1c8924b856baf809f193798ff686cdb2c0ed25d2 + --sha256: 1ird981gi7wbj21g8d65jqv4q4iwch2akky4r8pf8r2w3b3767pv subdir: ouroboros-consensus source-repository-package type: git location: https://github.com/input-output-hk/ouroboros-network - tag: 17d5199fd4415a0258c22982a099744adbfd2489 - --sha256: 1vpyq6c6249ji18valmwqd85vrjj80p1ck6jdsdxiapqqi4br90k + tag: 1c8924b856baf809f193798ff686cdb2c0ed25d2 + --sha256: 1ird981gi7wbj21g8d65jqv4q4iwch2akky4r8pf8r2w3b3767pv subdir: ouroboros-consensus/ouroboros-consensus-mock source-repository-package type: git location: https://github.com/input-output-hk/ouroboros-network - tag: 17d5199fd4415a0258c22982a099744adbfd2489 - --sha256: 1vpyq6c6249ji18valmwqd85vrjj80p1ck6jdsdxiapqqi4br90k + tag: 1c8924b856baf809f193798ff686cdb2c0ed25d2 + --sha256: 1ird981gi7wbj21g8d65jqv4q4iwch2akky4r8pf8r2w3b3767pv subdir: ouroboros-consensus-byron source-repository-package type: git location: https://github.com/input-output-hk/ouroboros-network - tag: 17d5199fd4415a0258c22982a099744adbfd2489 - --sha256: 1vpyq6c6249ji18valmwqd85vrjj80p1ck6jdsdxiapqqi4br90k + tag: 1c8924b856baf809f193798ff686cdb2c0ed25d2 + --sha256: 1ird981gi7wbj21g8d65jqv4q4iwch2akky4r8pf8r2w3b3767pv subdir: ouroboros-consensus-shelley source-repository-package type: git location: https://github.com/input-output-hk/ouroboros-network - tag: 17d5199fd4415a0258c22982a099744adbfd2489 - --sha256: 1vpyq6c6249ji18valmwqd85vrjj80p1ck6jdsdxiapqqi4br90k + tag: 1c8924b856baf809f193798ff686cdb2c0ed25d2 + --sha256: 1ird981gi7wbj21g8d65jqv4q4iwch2akky4r8pf8r2w3b3767pv subdir: ouroboros-consensus-cardano source-repository-package type: git location: https://github.com/input-output-hk/ouroboros-network - tag: 17d5199fd4415a0258c22982a099744adbfd2489 - --sha256: 1vpyq6c6249ji18valmwqd85vrjj80p1ck6jdsdxiapqqi4br90k + tag: 1c8924b856baf809f193798ff686cdb2c0ed25d2 + --sha256: 1ird981gi7wbj21g8d65jqv4q4iwch2akky4r8pf8r2w3b3767pv subdir: typed-protocols source-repository-package type: git location: https://github.com/input-output-hk/ouroboros-network - tag: 17d5199fd4415a0258c22982a099744adbfd2489 - --sha256: 1vpyq6c6249ji18valmwqd85vrjj80p1ck6jdsdxiapqqi4br90k + tag: 1c8924b856baf809f193798ff686cdb2c0ed25d2 + --sha256: 1ird981gi7wbj21g8d65jqv4q4iwch2akky4r8pf8r2w3b3767pv subdir: typed-protocols-examples source-repository-package type: git location: https://github.com/input-output-hk/ouroboros-network - tag: 17d5199fd4415a0258c22982a099744adbfd2489 - --sha256: 1vpyq6c6249ji18valmwqd85vrjj80p1ck6jdsdxiapqqi4br90k + tag: 1c8924b856baf809f193798ff686cdb2c0ed25d2 + --sha256: 1ird981gi7wbj21g8d65jqv4q4iwch2akky4r8pf8r2w3b3767pv subdir: ouroboros-network-framework source-repository-package type: git location: https://github.com/input-output-hk/ouroboros-network - tag: 17d5199fd4415a0258c22982a099744adbfd2489 - --sha256: 1vpyq6c6249ji18valmwqd85vrjj80p1ck6jdsdxiapqqi4br90k + tag: 1c8924b856baf809f193798ff686cdb2c0ed25d2 + --sha256: 1ird981gi7wbj21g8d65jqv4q4iwch2akky4r8pf8r2w3b3767pv subdir: network-mux source-repository-package type: git location: https://github.com/input-output-hk/ouroboros-network - tag: 17d5199fd4415a0258c22982a099744adbfd2489 - --sha256: 1vpyq6c6249ji18valmwqd85vrjj80p1ck6jdsdxiapqqi4br90k + tag: 1c8924b856baf809f193798ff686cdb2c0ed25d2 + --sha256: 1ird981gi7wbj21g8d65jqv4q4iwch2akky4r8pf8r2w3b3767pv subdir: io-sim-classes source-repository-package type: git location: https://github.com/input-output-hk/ouroboros-network - tag: 17d5199fd4415a0258c22982a099744adbfd2489 - --sha256: 1vpyq6c6249ji18valmwqd85vrjj80p1ck6jdsdxiapqqi4br90k + tag: 1c8924b856baf809f193798ff686cdb2c0ed25d2 + --sha256: 1ird981gi7wbj21g8d65jqv4q4iwch2akky4r8pf8r2w3b3767pv subdir: Win32-network source-repository-package diff --git a/cardano-api/src/Cardano/Api/LocalChainSync.hs b/cardano-api/src/Cardano/Api/LocalChainSync.hs index cd4420cde6b..0d65f4a50f8 100644 --- a/cardano-api/src/Cardano/Api/LocalChainSync.hs +++ b/cardano-api/src/Cardano/Api/LocalChainSync.hs @@ -12,13 +12,17 @@ import Control.Concurrent.STM import Cardano.Api.Typed import Ouroboros.Network.Block (Tip) +import Ouroboros.Network.Util.ShowProxy (ShowProxy) import Ouroboros.Network.Protocol.ChainSync.Client (ChainSyncClient(..), ClientStIdle(..), ClientStNext(..)) -import Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr) +import Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr, GenTx) +import Ouroboros.Consensus.Ledger.Abstract (Query) -- | Get the node's tip using the local chain sync protocol. -getLocalTip :: (Typeable block, Typeable (ApplyTxErr block)) +getLocalTip :: (Typeable block, Typeable (ApplyTxErr block), + ShowProxy block, ShowProxy (ApplyTxErr block), + ShowProxy (Query block), ShowProxy (GenTx block)) => LocalNodeConnectInfo mode block -> IO (Tip block) getLocalTip connctInfo = do resultVar <- newEmptyTMVarIO diff --git a/cardano-api/src/Cardano/Api/Typed.hs b/cardano-api/src/Cardano/Api/Typed.hs index 50bfe0ec6ce..9f45cca070f 100644 --- a/cardano-api/src/Cardano/Api/Typed.hs +++ b/cardano-api/src/Cardano/Api/Typed.hs @@ -381,6 +381,7 @@ import Ouroboros.Network.NodeToClient import Ouroboros.Network.Mux (MuxMode(InitiatorMode), MuxPeer(..), RunMiniProtocol(InitiatorProtocolOnly)) +import Ouroboros.Network.Util.ShowProxy (ShowProxy) -- TODO: it'd be nice if the consensus imports needed were a bit more coherent import Ouroboros.Consensus.Cardano @@ -2389,7 +2390,12 @@ nullLocalNodeClientProtocols = -- handlers. -- connectToLocalNode :: forall mode block. - (Typeable block, Typeable (ApplyTxErr block)) + (Typeable block, Typeable (ApplyTxErr block), + ShowProxy block, ShowProxy (ApplyTxErr block), + ShowProxy (Query block), ShowProxy (GenTx block)) + --TODO: too many constraints! we should pass + -- a single protocol to run, not all of them, until we + -- have the more flexible interface to run any combo => LocalNodeConnectInfo mode block -> LocalNodeClientProtocols block -> IO () @@ -2476,7 +2482,9 @@ connectToLocalNode LocalNodeConnectInfo { -- local state query protocol. -- queryNodeLocalState :: forall mode block result. - (Typeable block, Typeable (ApplyTxErr block)) + (Typeable block, Typeable (ApplyTxErr block), + ShowProxy block, ShowProxy (ApplyTxErr block), + ShowProxy (Query block), ShowProxy (GenTx block)) => LocalNodeConnectInfo mode block -> (Point block, Query block result) -> IO (Either AcquireFailure result) @@ -2506,7 +2514,7 @@ queryNodeLocalState connctInfo pointAndQuery = do -- writing into an mvar atomically $ putTMVar resultVar (Right result) pure $ SendMsgRelease $ - StateQuery.SendMsgDone () + pure $ StateQuery.SendMsgDone () } , recvMsgFailure = \failure -> do --TODO: return the result via the SendMsgDone rather than @@ -2516,7 +2524,9 @@ queryNodeLocalState connctInfo pointAndQuery = do } submitTxToNodeLocal :: forall mode block. - (Typeable block, Typeable (ApplyTxErr block)) + (Typeable block, Typeable (ApplyTxErr block), + ShowProxy block, ShowProxy (ApplyTxErr block), + ShowProxy (Query block), ShowProxy (GenTx block)) => LocalNodeConnectInfo mode block -> GenTx block -> IO (SubmitResult (ApplyTxErr block)) diff --git a/stack.yaml b/stack.yaml index 8808bf05262..200928b995e 100644 --- a/stack.yaml +++ b/stack.yaml @@ -122,7 +122,7 @@ extra-deps: #Ouroboros-network dependencies - git: https://github.com/input-output-hk/ouroboros-network - commit: 17d5199fd4415a0258c22982a099744adbfd2489 + commit: 1c8924b856baf809f193798ff686cdb2c0ed25d2 subdirs: - io-sim - io-sim-classes