From fb36115f52ad424f59918e7fae189a1fa0073f4f Mon Sep 17 00:00:00 2001 From: KtorZ Date: Mon, 17 Jan 2022 01:49:49 +0100 Subject: [PATCH] Bump dependencies to 1.33.0 + local-tx-monitor This is the same dependencies set as for cardano-node's 1.33.0 except for ouroboros-network which includes the various commits that enable the local-tx-monitor protocol. To be tested, this requires a compiled version of the node that also include this revision of ouroboros-network. --- Dockerfile | 2 +- docker-compose.yml | 2 +- server/cabal.project | 32 +++--- .../cardano-client/cardano-client.cabal | 2 + server/modules/cardano-client/package.yaml | 2 + .../Cardano/Network/Protocol/NodeToClient.hs | 10 +- server/ogmios.cabal | 3 + server/package.yaml | 3 + server/resolver.yaml | 23 ++-- server/src/Ogmios.hs | 105 +++++++++++++++++- server/src/Ogmios/App/Health.hs | 6 +- server/src/Ogmios/Control/MonadSTM.hs | 20 +--- server/src/Ogmios/Data/Json/Shelley.hs | 9 +- server/test/unit/Ogmios/Data/JsonSpec.hs | 4 +- server/test/unit/Test/Generators.hs | 4 +- 15 files changed, 168 insertions(+), 59 deletions(-) diff --git a/Dockerfile b/Dockerfile index ff21d00ae1..671542758c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,7 +43,7 @@ ENTRYPOINT ["/bin/ogmios"] # --------------------- RUN (cardano-node & ogmios) -------------------------- # # # -FROM inputoutput/cardano-node:1.31.0 as cardano-node-ogmios +FROM inputoutput/cardano-node:1.33.0 as cardano-node-ogmios ARG NETWORK=mainnet diff --git a/docker-compose.yml b/docker-compose.yml index 97c374dcc7..b9bc2b00f4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.5" services: cardano-node: - image: inputoutput/cardano-node:1.31.0 + image: inputoutput/cardano-node:1.33.0 command: [ "run", "--config", "/config/config.json", diff --git a/server/cabal.project b/server/cabal.project index 132038e563..be7265d042 100644 --- a/server/cabal.project +++ b/server/cabal.project @@ -1,4 +1,4 @@ -index-state: 2021-09-15T00:00:00Z +index-state: 2021-12-07T00:00:00Z packages: ./ @@ -52,8 +52,8 @@ allow-newer: source-repository-package type: git location: https://github.com/input-output-hk/cardano-node - tag: 2cbe363874d0261bc62f52185cf23ed492cf4859 - --sha256: 0x5j0cynlc9kiyj9w7casax477z3fb74pfsyfl373dn7rv1grg4d + tag: 814df2c146f5d56f8c35a681fe75e85b905aed5d + --sha256: 1hr00wqzmcyc3x0kp2hyw78rfmimf6z4zd4vv85b9zv3nqbjgrik subdir: cardano-api @@ -66,8 +66,8 @@ source-repository-package source-repository-package type: git location: https://github.com/input-output-hk/cardano-base - tag: 654f5b7c76f7cc57900b4ddc664a82fc3b925fb0 - --sha256: 0j4x9zbx5dkww82sqi086h39p456iq5xr476ylmrnpwcpfb4xai4 + tag: 41545ba3ac6b3095966316a99883d678b5ab8da8 + --sha256: 0icq9y3nnl42fz536da84414av36g37894qnyw4rk3qkalksqwir subdir: base-deriving-via binary @@ -88,9 +88,9 @@ source-repository-package source-repository-package type: git - location: https://github.com/input-output-hk/cardano-ledger-specs - tag: bf008ce028751cae9fb0b53c3bef20f07c06e333 - --sha256: 0my3801w1vinc0kf5yh9lxl6saqxgwm6ccg0vvzi104pafcwwcqx + location: https://github.com/input-output-hk/cardano-ledger + tag: 1a9ec4ae9e0b09d54e49b2a40c4ead37edadcce5 + --sha256: 0avzyiqq0m8njd41ck9kpn992yq676b1az9xs77977h7cf85y4wm subdir: eras/alonzo/impl eras/alonzo/test-suite @@ -100,17 +100,17 @@ source-repository-package eras/byron/ledger/executable-spec eras/byron/ledger/impl eras/byron/ledger/impl/test - eras/shelley-ma/impl - eras/shelley-ma/test-suite - eras/shelley/chain-and-ledger/dependencies/non-integer - eras/shelley/chain-and-ledger/executable-spec - eras/shelley/chain-and-ledger/shelley-spec-ledger-test eras/shelley/impl eras/shelley/test-suite + eras/shelley-ma/impl + eras/shelley-ma/test-suite + libs/cardano-data libs/cardano-ledger-core libs/cardano-ledger-pretty libs/cardano-protocol-tpraos + libs/compact-map libs/non-integral + libs/set-algebra libs/small-steps libs/small-steps-test @@ -153,8 +153,8 @@ source-repository-package source-repository-package type: git location: https://github.com/input-output-hk/ouroboros-network - tag: 94782e5ca52f234ff8eeddc6322a46cca0b69c0e - --sha256: 1da3pka4pn6sjf6w19d957aryjc9ip1a3g0vz7jz66pjri3v2n0j + tag: 32af91686b86dac7454eee8b8a8d6e97a80638da + --sha256: 0wkk40nw9vylc7imndhj3ca60mv59034mi2irnnilfvpzavj5zlz subdir: io-classes io-sim @@ -165,6 +165,7 @@ source-repository-package ouroboros-consensus-byron ouroboros-consensus-byronspec ouroboros-consensus-byron-test + ouroboros-consensus-cardano ouroboros-consensus-shelley ouroboros-consensus-shelley-test ouroboros-consensus-cardano @@ -173,6 +174,7 @@ source-repository-package ouroboros-network ouroboros-network-framework ouroboros-network-testing + strict-stm typed-protocols typed-protocols-cborg typed-protocols-examples diff --git a/server/modules/cardano-client/cardano-client.cabal b/server/modules/cardano-client/cardano-client.cabal index acbecb6dcf..4cb69ad01a 100644 --- a/server/modules/cardano-client/cardano-client.cabal +++ b/server/modules/cardano-client/cardano-client.cabal @@ -77,6 +77,8 @@ library , base >=4.7 && <5 , bytestring , cardano-ledger-byron + , cardano-ledger-core + , cardano-slotting , cborg , containers , contra-tracer diff --git a/server/modules/cardano-client/package.yaml b/server/modules/cardano-client/package.yaml index 15662aa4ee..d76fdee814 100644 --- a/server/modules/cardano-client/package.yaml +++ b/server/modules/cardano-client/package.yaml @@ -28,6 +28,8 @@ library: - aeson - bytestring - cardano-ledger-byron + - cardano-ledger-core + - cardano-slotting - cborg - containers - contra-tracer diff --git a/server/modules/cardano-client/src/Cardano/Network/Protocol/NodeToClient.hs b/server/modules/cardano-client/src/Cardano/Network/Protocol/NodeToClient.hs index 69df9d34fd..5446dcec6c 100644 --- a/server/modules/cardano-client/src/Cardano/Network/Protocol/NodeToClient.hs +++ b/server/modules/cardano-client/src/Cardano/Network/Protocol/NodeToClient.hs @@ -53,8 +53,12 @@ import Prelude hiding import Cardano.Chain.Slotting ( EpochSlots (..) ) +import Cardano.Ledger.Crypto + ( StandardCrypto ) import Cardano.Network.Protocol.NodeToClient.Trace ( TraceClient (..) ) +import Cardano.Slotting.Slot + ( SlotNo ) import Control.Monad.Class.MonadAsync ( MonadAsync ) import Control.Monad.Class.MonadST @@ -86,17 +90,17 @@ import Ouroboros.Consensus.Byron.Ledger.Config import Ouroboros.Consensus.Cardano ( CardanoBlock ) import Ouroboros.Consensus.Cardano.Block - ( CardanoEras, CodecConfig (..), GenTx, HardForkApplyTxErr ) + ( CardanoEras, CodecConfig (..), HardForkApplyTxErr ) import Ouroboros.Consensus.Ledger.Query ( Query (..) ) +import Ouroboros.Consensus.Ledger.SupportsMempool + ( GenTx, GenTxId ) import Ouroboros.Consensus.Network.NodeToClient ( ClientCodecs, Codecs' (..), clientCodecs ) import Ouroboros.Consensus.Node.NetworkProtocolVersion ( SupportedNetworkProtocolVersion (..) ) import Ouroboros.Consensus.Shelley.Ledger.Config ( CodecConfig (..) ) -import Ouroboros.Consensus.Shelley.Protocol - ( StandardCrypto ) import Ouroboros.Network.Block ( Point (..), Tip (..) ) import Ouroboros.Network.Channel diff --git a/server/ogmios.cabal b/server/ogmios.cabal index 2e24992538..4297dc6fff 100644 --- a/server/ogmios.cabal +++ b/server/ogmios.cabal @@ -116,6 +116,7 @@ library git build-depends: aeson + , async , base >=4.7 && <5 , base16 , base58-bytestring @@ -128,6 +129,7 @@ library , cardano-crypto , cardano-crypto-class , cardano-crypto-wrapper + , cardano-data , cardano-ledger-alonzo , cardano-ledger-byron , cardano-ledger-core @@ -169,6 +171,7 @@ library , scientific , serialise , small-steps + , stm , strict-containers , text , time diff --git a/server/package.yaml b/server/package.yaml index 6d275b3f75..d2c40b52b7 100644 --- a/server/package.yaml +++ b/server/package.yaml @@ -37,6 +37,7 @@ library: - -O2 dependencies: - aeson + - async - base16 - base64 - base58-bytestring @@ -48,6 +49,7 @@ library: - cardano-crypto - cardano-crypto-class - cardano-crypto-wrapper + - cardano-data - cardano-ledger-alonzo - cardano-ledger-byron - cardano-ledger-core @@ -89,6 +91,7 @@ library: - scientific - serialise - small-steps + - stm - strict-containers - text - time diff --git a/server/resolver.yaml b/server/resolver.yaml index 85ff76ed86..acd8d60ee5 100644 --- a/server/resolver.yaml +++ b/server/resolver.yaml @@ -25,19 +25,22 @@ packages: - markov-chain-usage-model-0.0.0 - monoidal-containers-0.6.0.1 - moo-1.2 +- network-3.1.2.2 - nothunks-0.1.3 - partial-order-0.2.0.0 - quickcheck-state-machine-0.7.0 +- random-1.2.1 - size-based-0.1.2.0 - statistics-linreg-0.3 - Stream-0.4.7.2 - streaming-binary-0.2.2.0 - transformers-except-0.1.2 - Unique-0.4.7.9 +- vector-0.12.3.1 - witherable-0.4.1 - git: https://github.com/input-output-hk/cardano-base - commit: 654f5b7c76f7cc57900b4ddc664a82fc3b925fb0 + commit: 41545ba3ac6b3095966316a99883d678b5ab8da8 subdirs: - base-deriving-via - binary @@ -53,8 +56,8 @@ packages: - git: https://github.com/input-output-hk/cardano-crypto commit: f73079303f663e028288f9f4a9e08bcca39a923e -- git: https://github.com/input-output-hk/cardano-ledger-specs - commit: bf008ce028751cae9fb0b53c3bef20f07c06e333 +- git: https://github.com/input-output-hk/cardano-ledger + commit: 1a9ec4ae9e0b09d54e49b2a40c4ead37edadcce5 subdirs: - eras/alonzo/impl - eras/alonzo/test-suite @@ -68,18 +71,18 @@ packages: - eras/shelley/test-suite - eras/shelley-ma/impl - eras/shelley-ma/test-suite - - eras/shelley/chain-and-ledger/dependencies/non-integer - - eras/shelley/chain-and-ledger/executable-spec - - eras/shelley/chain-and-ledger/shelley-spec-ledger-test + - libs/cardano-data - libs/cardano-ledger-core - libs/cardano-ledger-pretty - libs/cardano-protocol-tpraos + - libs/compact-map + - libs/non-integral + - libs/set-algebra - libs/small-steps - libs/small-steps-test - - libs/non-integral - git: https://github.com/input-output-hk/cardano-node - commit: 2cbe363874d0261bc62f52185cf23ed492cf4859 + commit: 814df2c146f5d56f8c35a681fe75e85b905aed5d subdirs: - cardano-api @@ -111,7 +114,7 @@ packages: - tracer-transformers - git: https://github.com/input-output-hk/ouroboros-network - commit: 94782e5ca52f234ff8eeddc6322a46cca0b69c0e + commit: 32af91686b86dac7454eee8b8a8d6e97a80638da subdirs: - io-classes - io-sim @@ -123,12 +126,14 @@ packages: - ouroboros-consensus-byronspec - ouroboros-consensus-byron-test - ouroboros-consensus-cardano + - ouroboros-consensus-protocol - ouroboros-consensus-shelley - ouroboros-consensus-shelley-test - ouroboros-consensus-cardano-test - ouroboros-network - ouroboros-network-framework - ouroboros-network-testing + - strict-stm - typed-protocols - typed-protocols-cborg - typed-protocols-examples diff --git a/server/src/Ogmios.hs b/server/src/Ogmios.hs index 7a04c5b5c9..7f7f359151 100644 --- a/server/src/Ogmios.hs +++ b/server/src/Ogmios.hs @@ -34,6 +34,7 @@ import Ogmios.Prelude import Cardano.Network.Protocol.NodeToClient ( Block ) +import qualified Control.Concurrent.Async as Async import Control.Monad.Class.MonadST ( MonadST ) import Ogmios.App.Configuration @@ -59,7 +60,7 @@ import Ogmios.Control.MonadLog import Ogmios.Control.MonadMetrics ( MonadMetrics ) import Ogmios.Control.MonadSTM - ( MonadSTM (..), TVar, newTVar ) + ( MonadSTM (..) ) import Ogmios.Control.MonadWebSocket ( MonadWebSocket ) import Ogmios.Options @@ -74,6 +75,12 @@ import System.Posix.Signals , softwareTermination ) +import qualified Control.Concurrent.STM.TBQueue as STM +import qualified Control.Concurrent.STM.TMVar as STM +import qualified Control.Concurrent.STM.TQueue as STM +import qualified Control.Concurrent.STM.TVar as STM +import qualified Control.Monad.STM as STM + -- -- App -- @@ -88,8 +95,8 @@ newtype App a = App , MonadLog, MonadMetrics , MonadWebSocket , MonadClock - , MonadSTM, MonadST - , MonadAsync, MonadThread, MonadFork + , MonadST + , MonadThread, MonadFork , MonadThrow, MonadCatch, MonadMask ) @@ -150,3 +157,95 @@ newEnvironment Tracers{tracerMetrics} network configuration = do sensors <- newSensors sampler <- newSampler tracerMetrics pure $ Env{health,sensors,sampler,network,configuration} + +-- +-- Instances +-- + +-- NOTE: +-- +-- Since `6b83e2b385b3533ccfc336c1099d27f1c6a79a2c` in ouroboros-network, +-- functional dependencies have been introduced between the class type family +-- and the monad argument making that monad injective with the type-family. +-- +-- This means it's no longer possible to define instances of MonadSTM which use +-- `STM` as a target monad directly, without conflicting with the existing +-- instance definition for `IO`... this disqualifies `ReaderT` and all kind of +-- transformers, and also, our `App` application monad! + +newtype WrappedSTM a = WrappedSTM { unwrapSTM :: STM.STM a } + deriving newtype (Functor, Applicative, Alternative, Monad, MonadPlus, MonadThrow) + +instance MonadSTM App where + type STM App = WrappedSTM + type TVar App = STM.TVar + type TMVar App = STM.TMVar + type TQueue App = STM.TQueue + type TBQueue App = STM.TBQueue + + atomically = App . lift . STM.atomically . unwrapSTM + retry = WrappedSTM STM.retry + orElse = \a0 a1 -> WrappedSTM (STM.orElse (unwrapSTM a0) (unwrapSTM a1)) + check = WrappedSTM . STM.check + + newTVar = WrappedSTM . STM.newTVar + newTVarIO = App . lift . STM.newTVarIO + readTVar = WrappedSTM . STM.readTVar + readTVarIO = App . lift . STM.readTVarIO + writeTVar = \a0 -> WrappedSTM . STM.writeTVar a0 + modifyTVar = \a0 -> WrappedSTM . STM.modifyTVar a0 + modifyTVar' = \a0 -> WrappedSTM . STM.modifyTVar' a0 + stateTVar = \a0 -> WrappedSTM . STM.stateTVar a0 + swapTVar = \a0 -> WrappedSTM . STM.swapTVar a0 + + newTMVar = WrappedSTM . STM.newTMVar + newTMVarIO = App . lift . STM.newTMVarIO + newEmptyTMVar = WrappedSTM STM.newEmptyTMVar + newEmptyTMVarIO = App (lift STM.newEmptyTMVarIO) + takeTMVar = WrappedSTM . STM.takeTMVar + tryTakeTMVar = WrappedSTM . STM.tryTakeTMVar + putTMVar = \a0 -> WrappedSTM . STM.putTMVar a0 + tryPutTMVar = \a0 -> WrappedSTM . STM.tryPutTMVar a0 + readTMVar = WrappedSTM . STM.readTMVar + tryReadTMVar = WrappedSTM . STM.tryReadTMVar + swapTMVar = \a0 -> WrappedSTM . STM.swapTMVar a0 + isEmptyTMVar = WrappedSTM . STM.isEmptyTMVar + + newTQueue = WrappedSTM STM.newTQueue + newTQueueIO = App (lift STM.newTQueueIO) + readTQueue = WrappedSTM . STM.readTQueue + tryReadTQueue = WrappedSTM . STM.tryReadTQueue + peekTQueue = WrappedSTM . STM.peekTQueue + tryPeekTQueue = WrappedSTM . STM.tryPeekTQueue + flushTBQueue = WrappedSTM . STM.flushTBQueue + writeTQueue = \a0 -> WrappedSTM . STM.writeTQueue a0 + isEmptyTQueue = WrappedSTM . STM.isEmptyTQueue + + newTBQueue = WrappedSTM . STM.newTBQueue + newTBQueueIO = App . lift . STM.newTBQueueIO + readTBQueue = WrappedSTM . STM.readTBQueue + tryReadTBQueue = WrappedSTM . STM.tryReadTBQueue + peekTBQueue = WrappedSTM . STM.peekTBQueue + tryPeekTBQueue = WrappedSTM . STM.tryPeekTBQueue + writeTBQueue = \a0 -> WrappedSTM . STM.writeTBQueue a0 + lengthTBQueue = WrappedSTM . STM.lengthTBQueue + isEmptyTBQueue = WrappedSTM . STM.isEmptyTBQueue + isFullTBQueue = WrappedSTM . STM.isFullTBQueue + +newtype WrappedAsync a = WrappedAsync { unwrapAsync :: Async.Async a } + deriving newtype (Functor) + +instance MonadAsync App where + type Async App = WrappedAsync + async = \(App (ReaderT m)) -> App (ReaderT $ \r -> WrappedAsync <$> async (m r)) + asyncThreadId = Async.asyncThreadId . unwrapAsync + pollSTM = WrappedSTM . Async.pollSTM . unwrapAsync + waitCatchSTM = WrappedSTM . Async.waitCatchSTM . unwrapAsync + cancel = App . lift . Async.cancel . unwrapAsync + cancelWith = \a0 -> App . lift . Async.cancelWith (unwrapAsync a0) + asyncWithUnmask = \restore -> App $ ReaderT $ \r -> + fmap WrappedAsync $ Async.asyncWithUnmask $ \unmask -> + runReaderT (unApp (restore (liftF unmask))) r + where + liftF :: (IO a -> IO a) -> App a -> App a + liftF g (App (ReaderT f)) = App (ReaderT (g . f)) diff --git a/server/src/Ogmios/App/Health.hs b/server/src/Ogmios/App/Health.hs index f7c6adf564..a1e0e5f0a3 100644 --- a/server/src/Ogmios/App/Health.hs +++ b/server/src/Ogmios/App/Health.hs @@ -243,11 +243,11 @@ mkHealthCheckClient notify = stNext :: ClientStNext Z block (Point block) (Tip block) m () stNext = ClientStNext - { recvMsgRollForward = const check - , recvMsgRollBackward = const check + { recvMsgRollForward = const doCheck + , recvMsgRollBackward = const doCheck } where - check tip = notify tip *> stIdle + doCheck tip = notify tip *> stIdle -- | A simple client which is used to determine some metrics about the -- underlying node. In particular, it allows for knowing the network diff --git a/server/src/Ogmios/Control/MonadSTM.hs b/server/src/Ogmios/Control/MonadSTM.hs index ca91c796f7..22b4342699 100644 --- a/server/src/Ogmios/Control/MonadSTM.hs +++ b/server/src/Ogmios/Control/MonadSTM.hs @@ -4,31 +4,13 @@ module Ogmios.Control.MonadSTM ( MonadSTM (..) - - , TQueue - , newTQueue - , writeTQueue - , readTQueue - , tryReadTQueue - - , TVar - , newTVar - , writeTVar - , readTVar - - , TMVar - , newTMVar - , newEmptyTMVar - , putTMVar - , takeTMVar - , tryTakeTMVar , withTMVar ) where import Ogmios.Prelude import Control.Monad.Class.MonadSTM - ( MonadSTM (..), MonadSTMTx (..), TMVar, TQueue, TVar ) + ( MonadSTM (..) ) import Control.Monad.Class.MonadThrow ( MonadCatch (..), MonadMask (..) ) diff --git a/server/src/Ogmios/Data/Json/Shelley.hs b/server/src/Ogmios/Data/Json/Shelley.hs index 79cb93d51c..b43d847313 100644 --- a/server/src/Ogmios/Data/Json/Shelley.hs +++ b/server/src/Ogmios/Data/Json/Shelley.hs @@ -19,7 +19,7 @@ import Cardano.Ledger.Era import Cardano.Ledger.Keys ( KeyRole (..) ) import Cardano.Ledger.Shelley.Constraints - ( ShelleyBased ) + ( UsesAuxiliary, UsesScript, UsesTxBody, UsesValue ) import Control.State.Transition ( STS (..) ) import Data.ByteString.Base16 @@ -78,6 +78,13 @@ import qualified Cardano.Ledger.Shelley.Tx as Sh import qualified Cardano.Ledger.Shelley.TxBody as Sh import qualified Cardano.Ledger.Shelley.UTxO as Sh +type ShelleyBased era = + ( UsesValue era + , UsesTxBody era + , UsesScript era + , UsesAuxiliary era + ) + -- -- Encoders -- diff --git a/server/test/unit/Ogmios/Data/JsonSpec.hs b/server/test/unit/Ogmios/Data/JsonSpec.hs index aaf0fec4e4..e9d2db54f1 100644 --- a/server/test/unit/Ogmios/Data/JsonSpec.hs +++ b/server/test/unit/Ogmios/Data/JsonSpec.hs @@ -14,6 +14,8 @@ module Ogmios.Data.JsonSpec import Ogmios.Prelude +import Cardano.Ledger.Crypto + ( StandardCrypto ) import Cardano.Network.Protocol.NodeToClient ( Block ) import Control.Monad.Class.MonadAsync @@ -93,8 +95,6 @@ import Ogmios.Data.Protocol.TxSubmission ( SubmitTxResponse, _encodeSubmitTxResponse ) import Ouroboros.Consensus.Cardano.Block ( CardanoEras, GenTx, HardForkApplyTxErr (..) ) -import Ouroboros.Consensus.Shelley.Protocol - ( StandardCrypto ) import Ouroboros.Network.Block ( Point (..), Tip (..) ) import Ouroboros.Network.Protocol.LocalStateQuery.Type diff --git a/server/test/unit/Test/Generators.hs b/server/test/unit/Test/Generators.hs index 59108dfda0..f17607090d 100644 --- a/server/test/unit/Test/Generators.hs +++ b/server/test/unit/Test/Generators.hs @@ -8,6 +8,8 @@ module Test.Generators where import Ogmios.Prelude +import Cardano.Ledger.Crypto + ( StandardCrypto ) import Cardano.Ledger.Era ( Crypto, Era, SupportsSegWit (..) ) import Cardano.Ledger.Keys @@ -57,8 +59,6 @@ import Ouroboros.Consensus.Shelley.Ledger.Config ( CompactGenesis, compactGenesis ) import Ouroboros.Consensus.Shelley.Ledger.Query ( NonMyopicMemberRewards (..) ) -import Ouroboros.Consensus.Shelley.Protocol - ( StandardCrypto ) import Ouroboros.Network.Block ( BlockNo (..), HeaderHash, Point (..), SlotNo (..), Tip (..) ) import Ouroboros.Network.Protocol.LocalStateQuery.Type