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

htlc post restart 4 #1586

Merged
merged 19 commits into from
Nov 9, 2020
Merged

htlc post restart 4 #1586

merged 19 commits into from
Nov 9, 2020

Conversation

akumaigorodski
Copy link
Contributor

This is continuation of #1580 (rather than wrestling with git I've decided to send a new PR). It follows suggestions outlined in 9d63b94.

- `cleanupRelayDb` accepts `htlcsIn: Seq[IncomingHtlc]` instead of `channels: Seq[HasCommitments]`.
- `remoteOutgoingToLocalIncoming` method is extracted from `getIncomingHtlcs` (will be reused in HC plugin).
- `cleanupRelayDb` accepts `htlcsIn: Seq[IncomingHtlc]` instead of `channels: Seq[HasCommitments]` (to account for plugins).
- `remoteOutgoingToLocalIncoming` method is extracted from `getIncomingHtlcs` (will be reused in HC plugin).
@akumaigorodski akumaigorodski changed the title Extensions htlc post restart 4 htlc post restart 4 Nov 5, 2020
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.

We're getting close, this time is the right one ;)
Have you been able to test that this correctly gives you the hooks you need for HC?

@@ -540,7 +540,7 @@ class ApiServiceSpec extends AnyFunSuite with ScalatestRouteTest with IdiomaticM
system.eventStream.publish(chcr)
wsClient.expectMessage(expectedSerializedChcr)

val chsc = ChannelStateChanged(system.deadLetters, system.deadLetters, bobNodeId, OFFLINE, NORMAL, null)
val chsc = ChannelStateChanged(system.deadLetters, null, system.deadLetters, bobNodeId, OFFLINE, NORMAL, null)
Copy link
Member

Choose a reason for hiding this comment

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

What's nice is that now we'll be able to easily add the channelId here! It's not your job to do it in this PR though, I'll do it in a follow-up one.

@akumaigorodski
Copy link
Contributor Author

Have you been able to test that this correctly gives you the hooks you need for HC?

Yes, getIncomingHtlcs and getHtlcsRelayedOut methods are very close to how it works now (where HC is part of core).

@codecov-io
Copy link

codecov-io commented Nov 6, 2020

Codecov Report

Merging #1586 into master will increase coverage by 0.08%.
The diff coverage is 92.06%.

@@            Coverage Diff             @@
##           master    #1586      +/-   ##
==========================================
+ Coverage   87.25%   87.33%   +0.08%     
==========================================
  Files         145      146       +1     
  Lines       11056    11056              
  Branches      479      471       -8     
==========================================
+ Hits         9647     9656       +9     
+ Misses       1409     1400       -9     
Impacted Files Coverage Δ
.../src/main/scala/fr/acinq/eclair/PluginParams.scala 0.00% <0.00%> (ø)
...c/main/scala/fr/acinq/eclair/channel/Helpers.scala 96.21% <ø> (-0.07%) ⬇️
...c/main/scala/fr/acinq/eclair/channel/Channel.scala 85.97% <85.00%> (-0.02%) ⬇️
.../eclair/payment/relay/PostRestartHtlcCleaner.scala 90.50% <95.45%> (+1.40%) ⬆️
...re/src/main/scala/fr/acinq/eclair/NodeParams.scala 91.71% <100.00%> (+0.59%) ⬆️
...ir-core/src/main/scala/fr/acinq/eclair/Setup.scala 70.96% <100.00%> (ø)
...n/scala/fr/acinq/eclair/channel/ChannelTypes.scala 95.83% <100.00%> (+0.48%) ⬆️
...c/main/scala/fr/acinq/eclair/payment/Auditor.scala 97.82% <100.00%> (ø)
...cala/fr/acinq/eclair/payment/relay/NodeRelay.scala 93.70% <0.00%> (-1.58%) ⬇️
... and 6 more

@t-bast t-bast merged commit e5db314 into ACINQ:master Nov 9, 2020
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.

3 participants