From 8a00c067bb646a536df7d99ed54c8975703133fd Mon Sep 17 00:00:00 2001 From: Sebastian Nagel Date: Mon, 4 Mar 2024 19:32:21 +0100 Subject: [PATCH] Restore usage of persistenceIncremental in Hydra.Network.Reliability We do not want to update this module (yet) with a different means for persistence. --- hydra-node/src/Hydra/Network/Reliability.hs | 8 +++----- hydra-node/src/Hydra/Node/Network.hs | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/hydra-node/src/Hydra/Network/Reliability.hs b/hydra-node/src/Hydra/Network/Reliability.hs index 56cc93b0e1c..9b13c74c253 100644 --- a/hydra-node/src/Hydra/Network/Reliability.hs +++ b/hydra-node/src/Hydra/Network/Reliability.hs @@ -189,7 +189,7 @@ mkMessagePersistence :: PersistenceIncremental (Heartbeat msg) m -> Persistence (Vector Int) m -> MessagePersistence m msg -mkMessagePersistence numberOfParties persistenceIncremental ackPersistence = +mkMessagePersistence numberOfParties msgPersistence ackPersistence = MessagePersistence { loadAcks = do macks <- load ackPersistence @@ -199,13 +199,11 @@ mkMessagePersistence numberOfParties persistenceIncremental ackPersistence = , saveAcks = \acks -> do save ackPersistence acks , loadMessages = do - loadAll persistenceIncremental + loadAll msgPersistence , appendMessage = \msg -> do - append persistenceIncremental msg + append msgPersistence msg } --- TODO(Elaine): this can probably be replaced with new persistence - -- | Middleware function to handle message counters tracking and resending logic. -- -- '''NOTE''': There is some "abstraction leak" here, because the `withReliability` diff --git a/hydra-node/src/Hydra/Node/Network.hs b/hydra-node/src/Hydra/Node/Network.hs index 5171a1a3734..6197196cb6e 100644 --- a/hydra-node/src/Hydra/Node/Network.hs +++ b/hydra-node/src/Hydra/Node/Network.hs @@ -150,7 +150,6 @@ configureMessagePersistence :: m (MessagePersistence m msg) configureMessagePersistence tracer persistenceDir numberOfParties = do msgPersistence <- createPersistenceIncremental $ storedMessagesFile persistenceDir - -- NOTE(Elaine): after deliberation, new persistence should be fine for network messages ackPersistence@Persistence{load} <- createPersistence $ acksFile persistenceDir mAcks <- load ackPersistence' <- case fmap (\acks -> length acks == numberOfParties) mAcks of