Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add defenses against looping paths #2109

Merged
merged 1 commit into from
Dec 17, 2021
Merged

Add defenses against looping paths #2109

merged 1 commit into from
Dec 17, 2021

Conversation

thomash-acinq
Copy link
Member

No description provided.

@thomash-acinq thomash-acinq requested a review from t-bast December 17, 2021 13:26
Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@codecov-commenter
Copy link

Codecov Report

Merging #2109 (536f413) into master (8afb02a) will decrease coverage by 0.07%.
The diff coverage is 33.33%.

@@            Coverage Diff             @@
##           master    #2109      +/-   ##
==========================================
- Coverage   87.63%   87.56%   -0.08%     
==========================================
  Files         165      165              
  Lines       12778    12783       +5     
  Branches      559      561       +2     
==========================================
- Hits        11198    11193       -5     
- Misses       1580     1590      +10     
Impacted Files Coverage Δ
...cala/fr/acinq/eclair/router/RouteCalculation.scala 97.14% <25.00%> (-2.13%) ⬇️
.../src/main/scala/fr/acinq/eclair/router/Graph.scala 97.70% <50.00%> (-0.56%) ⬇️
...scala/fr/acinq/eclair/crypto/WeakEntropyPool.scala 89.47% <0.00%> (-5.27%) ⬇️
...main/scala/fr/acinq/eclair/router/Validation.scala 90.76% <0.00%> (-1.54%) ⬇️
...cinq/eclair/payment/receive/MultiPartHandler.scala 93.18% <0.00%> (-1.52%) ⬇️
...clair/channel/publish/ReplaceableTxPublisher.scala 85.71% <0.00%> (-1.10%) ⬇️
...c/main/scala/fr/acinq/eclair/channel/Channel.scala 87.88% <0.00%> (+0.07%) ⬆️
...main/scala/fr/acinq/eclair/io/PeerConnection.scala 85.82% <0.00%> (+0.38%) ⬆️
...ala/fr/acinq/eclair/balance/ChannelsListener.scala 96.55% <0.00%> (+3.44%) ⬆️

@thomash-acinq thomash-acinq merged commit bf0969a into master Dec 17, 2021
@thomash-acinq thomash-acinq deleted the moo branch December 17, 2021 13:43
Comment on lines +133 to +136
case Failure(InfiniteLoop(loop)) =>
log.error(s"found infinite loop ${loop.map(edge => edge.desc).mkString(" -> ")}")
Metrics.FindRouteErrors.withTags(tags.withTag(Tags.Error, "InfiniteLoop")).increment()
ctx.sender() ! Status.Failure(InfiniteLoop(loop))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small detail (no unnecessary degree of liberty by instantiating a new exception, and more consistent with the next handler):

          case Failure(failure: InfiniteLoop) =>
            log.error(s"found infinite loop ${failure.loop.map(edge => edge.desc).mkString(" -> ")}")
            Metrics.FindRouteErrors.withTags(tags.withTag(Tags.Error, "InfiniteLoop")).increment()
            ctx.sender() ! Status.Failure(failure)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants