From fd0c8f3598462dbbb033e9450e4fc788e502e5b0 Mon Sep 17 00:00:00 2001 From: pragmaxim Date: Thu, 29 Jul 2021 16:01:10 +0200 Subject: [PATCH 1/7] handle db errors at higher level Signed-off-by: pragmaxim --- .../hybrid/history/HybridHistory.scala | 6 ++--- .../scala/scorex/core/NodeViewHolder.scala | 22 ++++++++++++++----- .../scala/scorex/core/consensus/History.scala | 4 ++-- .../testkit/properties/HistoryTests.scala | 2 +- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/examples/src/main/scala/examples/hybrid/history/HybridHistory.scala b/examples/src/main/scala/examples/hybrid/history/HybridHistory.scala index 93528cf34..051213ad5 100644 --- a/examples/src/main/scala/examples/hybrid/history/HybridHistory.scala +++ b/examples/src/main/scala/examples/hybrid/history/HybridHistory.scala @@ -474,7 +474,7 @@ class HybridHistory(val storage: HistoryStorage, chainBack(storage.bestPosBlock, isGenesis).get.map(_._2).map(encoder.encodeId).mkString(",") } - override def reportModifierIsValid(modifier: HybridBlock): HybridHistory = { + override def reportModifierIsValid(modifier: HybridBlock): Try[HybridHistory] = Try { storage.updateValidity(modifier, Valid) storage.update(modifier, None, isBest = true) @@ -482,8 +482,8 @@ class HybridHistory(val storage: HistoryStorage, } override def reportModifierIsInvalid(modifier: HybridBlock, - progressInfo: ProgressInfo[HybridBlock]): (HybridHistory, - ProgressInfo[HybridBlock]) = { + progressInfo: ProgressInfo[HybridBlock]): Try[(HybridHistory, + ProgressInfo[HybridBlock])] = Try { storage.updateValidity(modifier, Invalid) new HybridHistory(storage, settings, validators, statsLogger, timeProvider) -> diff --git a/src/main/scala/scorex/core/NodeViewHolder.scala b/src/main/scala/scorex/core/NodeViewHolder.scala index 285231ce5..02231167b 100644 --- a/src/main/scala/scorex/core/NodeViewHolder.scala +++ b/src/main/scala/scorex/core/NodeViewHolder.scala @@ -248,13 +248,23 @@ trait NodeViewHolder[TX <: Transaction, PMOD <: PersistentNodeViewModifier] if (updateInfo.failedMod.isEmpty) { updateInfo.state.applyModifier(modToApply) match { case Success(stateAfterApply) => - val newHis = history.reportModifierIsValid(modToApply) - context.system.eventStream.publish(SemanticallySuccessfulModifier(modToApply)) - UpdateInformation(newHis, stateAfterApply, None, None, updateInfo.suffix :+ modToApply) + history.reportModifierIsValid(modToApply) match { + case Success(newHis) => + context.system.eventStream.publish(SemanticallySuccessfulModifier(modToApply)) + UpdateInformation(newHis, stateAfterApply, None, None, updateInfo.suffix :+ modToApply) + case Failure(t) => + log.error("Applying valid modifier to history failed", t) + UpdateInformation(history, updateInfo.state, Some(modToApply), None, updateInfo.suffix) + } case Failure(e) => - val (newHis, newProgressInfo) = history.reportModifierIsInvalid(modToApply, progressInfo) - context.system.eventStream.publish(SemanticallyFailedModification(modToApply, e)) - UpdateInformation(newHis, updateInfo.state, Some(modToApply), Some(newProgressInfo), updateInfo.suffix) + history.reportModifierIsInvalid(modToApply, progressInfo) match { + case Success((newHis, newProgressInfo)) => + context.system.eventStream.publish(SemanticallyFailedModification(modToApply, e)) + UpdateInformation(newHis, updateInfo.state, Some(modToApply), Some(newProgressInfo), updateInfo.suffix) + case Failure(t) => + log.error("Applying invalid modifier to history failed", t) + UpdateInformation(history, updateInfo.state, Some(modToApply), None, updateInfo.suffix) + } } } else updateInfo } diff --git a/src/main/scala/scorex/core/consensus/History.scala b/src/main/scala/scorex/core/consensus/History.scala index 11979b588..1e0d8bfc3 100644 --- a/src/main/scala/scorex/core/consensus/History.scala +++ b/src/main/scala/scorex/core/consensus/History.scala @@ -33,7 +33,7 @@ trait History[PM <: PersistentNodeViewModifier, SI <: SyncInfo, HT <: History[PM * @param modifier - valid modifier * @return modified history */ - def reportModifierIsValid(modifier: PM): HT + def reportModifierIsValid(modifier: PM): Try[HT] /** * Report that modifier is invalid from other nodeViewHolder components point of view @@ -42,7 +42,7 @@ trait History[PM <: PersistentNodeViewModifier, SI <: SyncInfo, HT <: History[PM * @param progressInfo - what suffix failed to be applied because of an invalid modifier * @return modified history and new progress info */ - def reportModifierIsInvalid(modifier: PM, progressInfo: ProgressInfo[PM]): (HT, ProgressInfo[PM]) + def reportModifierIsInvalid(modifier: PM, progressInfo: ProgressInfo[PM]): Try[(HT, ProgressInfo[PM])] /** diff --git a/testkit/src/main/scala/scorex/testkit/properties/HistoryTests.scala b/testkit/src/main/scala/scorex/testkit/properties/HistoryTests.scala index bfa1ac829..8ce528647 100644 --- a/testkit/src/main/scala/scorex/testkit/properties/HistoryTests.scala +++ b/testkit/src/main/scala/scorex/testkit/properties/HistoryTests.scala @@ -53,7 +53,7 @@ trait HistoryTests[TX <: Transaction, PM <: PersistentNodeViewModifier, SI <: Sy property(propertyNameGenerator("report semantically validation after appending valid modifier")) { forAll(generatorWithValidModifier) { case (h, m) => h.append(m) - h.reportModifierIsValid(m) + h.reportModifierIsValid(m).get h.isSemanticallyValid(m.id) shouldBe Valid } } From 7119da5e18dc67b05097708fe894f15d91cbaabe Mon Sep 17 00:00:00 2001 From: Alex Chepurnoy Date: Thu, 5 Aug 2021 00:38:40 +0300 Subject: [PATCH 2/7] ScalaDoc update on reporting methods --- src/main/scala/scorex/core/consensus/History.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/scorex/core/consensus/History.scala b/src/main/scala/scorex/core/consensus/History.scala index 1e0d8bfc3..2d0a6582e 100644 --- a/src/main/scala/scorex/core/consensus/History.scala +++ b/src/main/scala/scorex/core/consensus/History.scala @@ -31,7 +31,7 @@ trait History[PM <: PersistentNodeViewModifier, SI <: SyncInfo, HT <: History[PM * Report that modifier is valid from point of view of the state component * * @param modifier - valid modifier - * @return modified history + * @return modified history, or failure if reporting was not successful */ def reportModifierIsValid(modifier: PM): Try[HT] @@ -40,7 +40,7 @@ trait History[PM <: PersistentNodeViewModifier, SI <: SyncInfo, HT <: History[PM * * @param modifier - invalid modifier * @param progressInfo - what suffix failed to be applied because of an invalid modifier - * @return modified history and new progress info + * @return modified history and new progress info, or failure if reporting was not successful */ def reportModifierIsInvalid(modifier: PM, progressInfo: ProgressInfo[PM]): Try[(HT, ProgressInfo[PM])] From e0b269b7338a83929754d56a56f6504ee9b5ea39 Mon Sep 17 00:00:00 2001 From: pragmaxim Date: Fri, 6 Aug 2021 23:19:56 +0200 Subject: [PATCH 3/7] handle db errors at higher level fix Signed-off-by: pragmaxim --- .../scala/scorex/core/NodeViewHolder.scala | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/main/scala/scorex/core/NodeViewHolder.scala b/src/main/scala/scorex/core/NodeViewHolder.scala index 02231167b..98cc27fe5 100644 --- a/src/main/scala/scorex/core/NodeViewHolder.scala +++ b/src/main/scala/scorex/core/NodeViewHolder.scala @@ -222,14 +222,18 @@ trait NodeViewHolder[TX <: Transaction, PMOD <: PersistentNodeViewModifier] stateToApplyTry match { case Success(stateToApply) => - val stateUpdateInfo = applyState(history, stateToApply, suffixTrimmed, progressInfo) - - stateUpdateInfo.failedMod match { - case Some(_) => - @SuppressWarnings(Array("org.wartremover.warts.OptionPartial")) - val alternativeProgressInfo = stateUpdateInfo.alternativeProgressInfo.get - updateState(stateUpdateInfo.history, stateUpdateInfo.state, alternativeProgressInfo, stateUpdateInfo.suffix) - case None => (stateUpdateInfo.history, Success(stateUpdateInfo.state), stateUpdateInfo.suffix) + applyState(history, stateToApply, suffixTrimmed, progressInfo) match { + case Success(stateUpdateInfo) => + stateUpdateInfo.failedMod match { + case Some(_) => + @SuppressWarnings(Array("org.wartremover.warts.OptionPartial")) + val alternativeProgressInfo = stateUpdateInfo.alternativeProgressInfo.get + updateState(stateUpdateInfo.history, stateUpdateInfo.state, alternativeProgressInfo, stateUpdateInfo.suffix) + case None => + (stateUpdateInfo.history, Success(stateUpdateInfo.state), stateUpdateInfo.suffix) + } + case Failure(ex) => + (history, Failure(ex), suffixTrimmed) } case Failure(e) => log.error("Rollback failed: ", e) @@ -239,34 +243,30 @@ trait NodeViewHolder[TX <: Transaction, PMOD <: PersistentNodeViewModifier] } } - protected def applyState(history: HIS, + private def applyState(history: HIS, stateToApply: MS, suffixTrimmed: IndexedSeq[PMOD], - progressInfo: ProgressInfo[PMOD]): UpdateInformation = { + progressInfo: ProgressInfo[PMOD]): Try[UpdateInformation] = { val updateInfoSample = UpdateInformation(history, stateToApply, None, None, suffixTrimmed) - progressInfo.toApply.foldLeft(updateInfoSample) { case (updateInfo, modToApply) => - if (updateInfo.failedMod.isEmpty) { - updateInfo.state.applyModifier(modToApply) match { - case Success(stateAfterApply) => - history.reportModifierIsValid(modToApply) match { - case Success(newHis) => + progressInfo.toApply.foldLeft[Try[UpdateInformation]](Success(updateInfoSample)) { + case (f@Failure(ex), _) => + log.error("Reporting modifier failed", ex) + f + case (success@Success(updateInfo), modToApply) => + if (updateInfo.failedMod.isEmpty) { + updateInfo.state.applyModifier(modToApply) match { + case Success(stateAfterApply) => + history.reportModifierIsValid(modToApply).map { newHis => context.system.eventStream.publish(SemanticallySuccessfulModifier(modToApply)) UpdateInformation(newHis, stateAfterApply, None, None, updateInfo.suffix :+ modToApply) - case Failure(t) => - log.error("Applying valid modifier to history failed", t) - UpdateInformation(history, updateInfo.state, Some(modToApply), None, updateInfo.suffix) - } - case Failure(e) => - history.reportModifierIsInvalid(modToApply, progressInfo) match { - case Success((newHis, newProgressInfo)) => + } + case Failure(e) => + history.reportModifierIsInvalid(modToApply, progressInfo).map { case (newHis, newProgressInfo) => context.system.eventStream.publish(SemanticallyFailedModification(modToApply, e)) UpdateInformation(newHis, updateInfo.state, Some(modToApply), Some(newProgressInfo), updateInfo.suffix) - case Failure(t) => - log.error("Applying invalid modifier to history failed", t) - UpdateInformation(history, updateInfo.state, Some(modToApply), None, updateInfo.suffix) - } - } - } else updateInfo + } + } + } else success } } @@ -304,8 +304,8 @@ trait NodeViewHolder[TX <: Transaction, PMOD <: PersistentNodeViewModifier] case Failure(e) => log.warn(s"Can`t apply persistent modifier (id: ${pmod.encodedId}, contents: $pmod) to minimal state", e) + // not publishing SemanticallyFailedModification as this is an internal error updateNodeView(updatedHistory = Some(newHistory)) - context.system.eventStream.publish(SemanticallyFailedModification(pmod, e)) } } else { requestDownloads(progressInfo) From 51b13be76908d9a54071a2d18b29541a93e34d2f Mon Sep 17 00:00:00 2001 From: pragmaxim Date: Thu, 29 Jul 2021 16:01:10 +0200 Subject: [PATCH 4/7] handle db errors at higher level Signed-off-by: pragmaxim --- .../hybrid/history/HybridHistory.scala | 6 ++--- .../scala/scorex/core/NodeViewHolder.scala | 22 ++++++++++++++----- .../scala/scorex/core/consensus/History.scala | 4 ++-- .../testkit/properties/HistoryTests.scala | 2 +- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/examples/src/main/scala/examples/hybrid/history/HybridHistory.scala b/examples/src/main/scala/examples/hybrid/history/HybridHistory.scala index 93528cf34..051213ad5 100644 --- a/examples/src/main/scala/examples/hybrid/history/HybridHistory.scala +++ b/examples/src/main/scala/examples/hybrid/history/HybridHistory.scala @@ -474,7 +474,7 @@ class HybridHistory(val storage: HistoryStorage, chainBack(storage.bestPosBlock, isGenesis).get.map(_._2).map(encoder.encodeId).mkString(",") } - override def reportModifierIsValid(modifier: HybridBlock): HybridHistory = { + override def reportModifierIsValid(modifier: HybridBlock): Try[HybridHistory] = Try { storage.updateValidity(modifier, Valid) storage.update(modifier, None, isBest = true) @@ -482,8 +482,8 @@ class HybridHistory(val storage: HistoryStorage, } override def reportModifierIsInvalid(modifier: HybridBlock, - progressInfo: ProgressInfo[HybridBlock]): (HybridHistory, - ProgressInfo[HybridBlock]) = { + progressInfo: ProgressInfo[HybridBlock]): Try[(HybridHistory, + ProgressInfo[HybridBlock])] = Try { storage.updateValidity(modifier, Invalid) new HybridHistory(storage, settings, validators, statsLogger, timeProvider) -> diff --git a/src/main/scala/scorex/core/NodeViewHolder.scala b/src/main/scala/scorex/core/NodeViewHolder.scala index 285231ce5..02231167b 100644 --- a/src/main/scala/scorex/core/NodeViewHolder.scala +++ b/src/main/scala/scorex/core/NodeViewHolder.scala @@ -248,13 +248,23 @@ trait NodeViewHolder[TX <: Transaction, PMOD <: PersistentNodeViewModifier] if (updateInfo.failedMod.isEmpty) { updateInfo.state.applyModifier(modToApply) match { case Success(stateAfterApply) => - val newHis = history.reportModifierIsValid(modToApply) - context.system.eventStream.publish(SemanticallySuccessfulModifier(modToApply)) - UpdateInformation(newHis, stateAfterApply, None, None, updateInfo.suffix :+ modToApply) + history.reportModifierIsValid(modToApply) match { + case Success(newHis) => + context.system.eventStream.publish(SemanticallySuccessfulModifier(modToApply)) + UpdateInformation(newHis, stateAfterApply, None, None, updateInfo.suffix :+ modToApply) + case Failure(t) => + log.error("Applying valid modifier to history failed", t) + UpdateInformation(history, updateInfo.state, Some(modToApply), None, updateInfo.suffix) + } case Failure(e) => - val (newHis, newProgressInfo) = history.reportModifierIsInvalid(modToApply, progressInfo) - context.system.eventStream.publish(SemanticallyFailedModification(modToApply, e)) - UpdateInformation(newHis, updateInfo.state, Some(modToApply), Some(newProgressInfo), updateInfo.suffix) + history.reportModifierIsInvalid(modToApply, progressInfo) match { + case Success((newHis, newProgressInfo)) => + context.system.eventStream.publish(SemanticallyFailedModification(modToApply, e)) + UpdateInformation(newHis, updateInfo.state, Some(modToApply), Some(newProgressInfo), updateInfo.suffix) + case Failure(t) => + log.error("Applying invalid modifier to history failed", t) + UpdateInformation(history, updateInfo.state, Some(modToApply), None, updateInfo.suffix) + } } } else updateInfo } diff --git a/src/main/scala/scorex/core/consensus/History.scala b/src/main/scala/scorex/core/consensus/History.scala index 11979b588..1e0d8bfc3 100644 --- a/src/main/scala/scorex/core/consensus/History.scala +++ b/src/main/scala/scorex/core/consensus/History.scala @@ -33,7 +33,7 @@ trait History[PM <: PersistentNodeViewModifier, SI <: SyncInfo, HT <: History[PM * @param modifier - valid modifier * @return modified history */ - def reportModifierIsValid(modifier: PM): HT + def reportModifierIsValid(modifier: PM): Try[HT] /** * Report that modifier is invalid from other nodeViewHolder components point of view @@ -42,7 +42,7 @@ trait History[PM <: PersistentNodeViewModifier, SI <: SyncInfo, HT <: History[PM * @param progressInfo - what suffix failed to be applied because of an invalid modifier * @return modified history and new progress info */ - def reportModifierIsInvalid(modifier: PM, progressInfo: ProgressInfo[PM]): (HT, ProgressInfo[PM]) + def reportModifierIsInvalid(modifier: PM, progressInfo: ProgressInfo[PM]): Try[(HT, ProgressInfo[PM])] /** diff --git a/testkit/src/main/scala/scorex/testkit/properties/HistoryTests.scala b/testkit/src/main/scala/scorex/testkit/properties/HistoryTests.scala index bfa1ac829..8ce528647 100644 --- a/testkit/src/main/scala/scorex/testkit/properties/HistoryTests.scala +++ b/testkit/src/main/scala/scorex/testkit/properties/HistoryTests.scala @@ -53,7 +53,7 @@ trait HistoryTests[TX <: Transaction, PM <: PersistentNodeViewModifier, SI <: Sy property(propertyNameGenerator("report semantically validation after appending valid modifier")) { forAll(generatorWithValidModifier) { case (h, m) => h.append(m) - h.reportModifierIsValid(m) + h.reportModifierIsValid(m).get h.isSemanticallyValid(m.id) shouldBe Valid } } From 555eba613417d8d956325f6d32556f66d5d164be Mon Sep 17 00:00:00 2001 From: pragmaxim Date: Fri, 6 Aug 2021 23:19:56 +0200 Subject: [PATCH 5/7] handle db errors at higher level fix Signed-off-by: pragmaxim --- .../scala/scorex/core/NodeViewHolder.scala | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/main/scala/scorex/core/NodeViewHolder.scala b/src/main/scala/scorex/core/NodeViewHolder.scala index 02231167b..98cc27fe5 100644 --- a/src/main/scala/scorex/core/NodeViewHolder.scala +++ b/src/main/scala/scorex/core/NodeViewHolder.scala @@ -222,14 +222,18 @@ trait NodeViewHolder[TX <: Transaction, PMOD <: PersistentNodeViewModifier] stateToApplyTry match { case Success(stateToApply) => - val stateUpdateInfo = applyState(history, stateToApply, suffixTrimmed, progressInfo) - - stateUpdateInfo.failedMod match { - case Some(_) => - @SuppressWarnings(Array("org.wartremover.warts.OptionPartial")) - val alternativeProgressInfo = stateUpdateInfo.alternativeProgressInfo.get - updateState(stateUpdateInfo.history, stateUpdateInfo.state, alternativeProgressInfo, stateUpdateInfo.suffix) - case None => (stateUpdateInfo.history, Success(stateUpdateInfo.state), stateUpdateInfo.suffix) + applyState(history, stateToApply, suffixTrimmed, progressInfo) match { + case Success(stateUpdateInfo) => + stateUpdateInfo.failedMod match { + case Some(_) => + @SuppressWarnings(Array("org.wartremover.warts.OptionPartial")) + val alternativeProgressInfo = stateUpdateInfo.alternativeProgressInfo.get + updateState(stateUpdateInfo.history, stateUpdateInfo.state, alternativeProgressInfo, stateUpdateInfo.suffix) + case None => + (stateUpdateInfo.history, Success(stateUpdateInfo.state), stateUpdateInfo.suffix) + } + case Failure(ex) => + (history, Failure(ex), suffixTrimmed) } case Failure(e) => log.error("Rollback failed: ", e) @@ -239,34 +243,30 @@ trait NodeViewHolder[TX <: Transaction, PMOD <: PersistentNodeViewModifier] } } - protected def applyState(history: HIS, + private def applyState(history: HIS, stateToApply: MS, suffixTrimmed: IndexedSeq[PMOD], - progressInfo: ProgressInfo[PMOD]): UpdateInformation = { + progressInfo: ProgressInfo[PMOD]): Try[UpdateInformation] = { val updateInfoSample = UpdateInformation(history, stateToApply, None, None, suffixTrimmed) - progressInfo.toApply.foldLeft(updateInfoSample) { case (updateInfo, modToApply) => - if (updateInfo.failedMod.isEmpty) { - updateInfo.state.applyModifier(modToApply) match { - case Success(stateAfterApply) => - history.reportModifierIsValid(modToApply) match { - case Success(newHis) => + progressInfo.toApply.foldLeft[Try[UpdateInformation]](Success(updateInfoSample)) { + case (f@Failure(ex), _) => + log.error("Reporting modifier failed", ex) + f + case (success@Success(updateInfo), modToApply) => + if (updateInfo.failedMod.isEmpty) { + updateInfo.state.applyModifier(modToApply) match { + case Success(stateAfterApply) => + history.reportModifierIsValid(modToApply).map { newHis => context.system.eventStream.publish(SemanticallySuccessfulModifier(modToApply)) UpdateInformation(newHis, stateAfterApply, None, None, updateInfo.suffix :+ modToApply) - case Failure(t) => - log.error("Applying valid modifier to history failed", t) - UpdateInformation(history, updateInfo.state, Some(modToApply), None, updateInfo.suffix) - } - case Failure(e) => - history.reportModifierIsInvalid(modToApply, progressInfo) match { - case Success((newHis, newProgressInfo)) => + } + case Failure(e) => + history.reportModifierIsInvalid(modToApply, progressInfo).map { case (newHis, newProgressInfo) => context.system.eventStream.publish(SemanticallyFailedModification(modToApply, e)) UpdateInformation(newHis, updateInfo.state, Some(modToApply), Some(newProgressInfo), updateInfo.suffix) - case Failure(t) => - log.error("Applying invalid modifier to history failed", t) - UpdateInformation(history, updateInfo.state, Some(modToApply), None, updateInfo.suffix) - } - } - } else updateInfo + } + } + } else success } } @@ -304,8 +304,8 @@ trait NodeViewHolder[TX <: Transaction, PMOD <: PersistentNodeViewModifier] case Failure(e) => log.warn(s"Can`t apply persistent modifier (id: ${pmod.encodedId}, contents: $pmod) to minimal state", e) + // not publishing SemanticallyFailedModification as this is an internal error updateNodeView(updatedHistory = Some(newHistory)) - context.system.eventStream.publish(SemanticallyFailedModification(pmod, e)) } } else { requestDownloads(progressInfo) From bd4e5d43abbcfa6375027aedf251397195b83eb4 Mon Sep 17 00:00:00 2001 From: pragmaxim Date: Wed, 11 Aug 2021 18:51:28 +0200 Subject: [PATCH 6/7] custom implementation of history appending needs access Signed-off-by: pragmaxim --- src/main/scala/scorex/core/NodeViewHolder.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/scorex/core/NodeViewHolder.scala b/src/main/scala/scorex/core/NodeViewHolder.scala index 98cc27fe5..cbf012316 100644 --- a/src/main/scala/scorex/core/NodeViewHolder.scala +++ b/src/main/scala/scorex/core/NodeViewHolder.scala @@ -163,7 +163,7 @@ trait NodeViewHolder[TX <: Transaction, PMOD <: PersistentNodeViewModifier] } } - private def requestDownloads(pi: ProgressInfo[PMOD]): Unit = + protected def requestDownloads(pi: ProgressInfo[PMOD]): Unit = pi.toDownload.foreach { case (tid, id) => context.system.eventStream.publish(DownloadRequest(tid, id)) } @@ -206,7 +206,7 @@ trait NodeViewHolder[TX <: Transaction, PMOD <: PersistentNodeViewModifier] **/ @tailrec - private def updateState(history: HIS, + protected final def updateState(history: HIS, state: MS, progressInfo: ProgressInfo[PMOD], suffixApplied: IndexedSeq[PMOD]): (HIS, Try[MS], Seq[PMOD]) = { From e8e705292cecf9d04741037bcdf503974685d652 Mon Sep 17 00:00:00 2001 From: pragmaxim Date: Wed, 11 Aug 2021 19:09:22 +0200 Subject: [PATCH 7/7] fixing wrong actor ref Signed-off-by: pragmaxim --- src/main/scala/scorex/core/network/NetworkController.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/scorex/core/network/NetworkController.scala b/src/main/scala/scorex/core/network/NetworkController.scala index f1abe5789..6d3a639e2 100644 --- a/src/main/scala/scorex/core/network/NetworkController.scala +++ b/src/main/scala/scorex/core/network/NetworkController.scala @@ -203,7 +203,7 @@ class NetworkController(settings: NetworkSettings, filterConnections(Broadcast, Version.initial).foreach { connectedPeer => connectedPeer.handlerRef ! CloseConnection } - self ! Unbind + tcpManager ! Unbind context stop self }