@@ -62,7 +62,7 @@ import Control.Concurrent.Async
6262import Control.Exception
6363 ( IOException )
6464import Control.Monad
65- ( (>=>) )
65+ ( forever , (>=>) )
6666import Control.Monad.Catch
6767 ( Handler (.. ) )
6868import Control.Monad.Class.MonadAsync
@@ -159,6 +159,8 @@ import Ouroboros.Network.Channel
159159 ( Channel )
160160import Ouroboros.Network.Codec
161161 ( DeserialiseFailure )
162+ import Ouroboros.Network.CodecCBORTerm
163+ ( CodecCBORTerm )
162164import Ouroboros.Network.Driver.Simple
163165 ( TraceSendRecv , runPeer )
164166import Ouroboros.Network.Mux
@@ -190,7 +192,7 @@ import Ouroboros.Network.Protocol.ChainSync.Codec
190192import Ouroboros.Network.Protocol.ChainSync.Type
191193 ( ChainSync )
192194import Ouroboros.Network.Protocol.Handshake.Version
193- ( CodecCBORTerm , DictVersion (.. ), simpleSingletonVersions )
195+ ( DictVersion (.. ), simpleSingletonVersions )
194196import Ouroboros.Network.Protocol.LocalTxSubmission.Client
195197 ( LocalTxClientStIdle (.. )
196198 , LocalTxSubmissionClient (.. )
@@ -425,7 +427,17 @@ mkNetworkClient tr bp chainSyncQ localTxSubmissionQ =
425427 let tr' = contramap MsgTxSubmission tr in
426428 InitiatorProtocolOnly $ MuxPeerRaw $ \ channel ->
427429 localTxSubmission tr' localTxSubmissionQ channel
430+ , localStateQueryProtocol =
431+ doNothingProtocol
428432 }
433+ NodeToClientV_2
434+
435+ -- | A protocol client that will never leave the initial state.
436+ doNothingProtocol
437+ :: MonadTimer m => RunMiniProtocol 'InitiatorApp ByteString m a Void
438+ doNothingProtocol =
439+ InitiatorProtocolOnly $ MuxPeerRaw $
440+ const $ forever $ threadDelay 1e6
429441
430442-- Connect a client to a network, see `mkNetworkClient` to construct a network
431443-- client interface.
@@ -440,7 +452,7 @@ connectClient
440452 -> IO ()
441453connectClient tr handlers client (vData, vCodec) addr = withIOManager $ \ iocp -> do
442454 let vDict = DictVersion vCodec
443- let versions = simpleSingletonVersions NodeToClientV_1 vData vDict client
455+ let versions = simpleSingletonVersions NodeToClientV_2 vData vDict client
444456 let tracers = NetworkConnectTracers
445457 { nctMuxTracer = nullTracer
446458 , nctHandshakeTracer = contramap MsgHandshakeTracer tr
@@ -511,6 +523,7 @@ handleMuxError tr onResourceVanished = pure . errorType >=> \case
511523 MuxIngressQueueOverRun -> pure False
512524 MuxInitiatorOnly -> pure False
513525 MuxSDUReadTimeout -> pure False
526+ MuxSDUWriteTimeout -> pure False
514527 MuxIOException e ->
515528 handleIOException tr onResourceVanished e
516529 MuxBearerClosed -> do
0 commit comments