Skip to content

Build Bolt12 invoices with provided intermediary nodes#2499

Merged
thomash-acinq merged 9 commits into
masterfrom
byor2
Nov 24, 2022
Merged

Build Bolt12 invoices with provided intermediary nodes#2499
thomash-acinq merged 9 commits into
masterfrom
byor2

Conversation

@thomash-acinq
Copy link
Copy Markdown
Contributor

Allows creating arbitrary blinded routes for BOLT12 invoices.

Copy link
Copy Markdown
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.

I don't mind the use of pipeTo, it's a bit ugly but it removes the need for boilerplate actor management.

My other comments from #2471 still apply though: it would be useful to refactor most of what is happening inside the handler to dedicated functions that can be called in tests.

Also, test coverage is really low, you must test the cases where one of the FinalizeRoute fails, when one of them times out, when edge cases are hit, etc. Please spend more time on this and think about what makes sense to test.

@thomash-acinq thomash-acinq marked this pull request as ready for review November 23, 2022 14:51
@thomash-acinq
Copy link
Copy Markdown
Contributor Author

I've put the blinded route creation and the aggregation of fees in separate functions.
For the test where a FinalizeRoute times out, I'm not sure it would bring much value and just waste testing time.

This commit contains no logical changes, it just moves some code to
places where it makes more sense.
Copy link
Copy Markdown
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.

The logic looks good and the test coverage is nice, I have made two follow-up commits in #2504
One of them contains a change to provide more flexibility in building the dummy hops (to make them credible) and the other just moves the code around.

Comment thread eclair-core/src/main/scala/fr/acinq/eclair/router/RouteCalculation.scala Outdated
Comment thread eclair-core/src/main/scala/fr/acinq/eclair/payment/receive/MultiPartHandler.scala Outdated
Comment thread eclair-core/src/main/scala/fr/acinq/eclair/payment/receive/MultiPartHandler.scala Outdated
Comment thread eclair-core/src/test/scala/fr/acinq/eclair/payment/MultiPartHandlerSpec.scala Outdated
Comment thread eclair-core/src/test/scala/fr/acinq/eclair/payment/MultiPartHandlerSpec.scala Outdated
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 24, 2022

Codecov Report

Merging #2499 (a7f812b) into master (6d3991b) will increase coverage by 0.02%.
The diff coverage is 97.91%.

@@            Coverage Diff             @@
##           master    #2499      +/-   ##
==========================================
+ Coverage   84.94%   84.96%   +0.02%     
==========================================
  Files         199      200       +1     
  Lines       15802    15827      +25     
  Branches      668      693      +25     
==========================================
+ Hits        13423    13448      +25     
  Misses       2379     2379              
Impacted Files Coverage Δ
...cinq/eclair/payment/receive/MultiPartHandler.scala 93.65% <93.75%> (-0.65%) ⬇️
.../scala/fr/acinq/eclair/payment/Bolt12Invoice.scala 98.87% <100.00%> (+0.01%) ⬆️
.../fr/acinq/eclair/router/BlindedRouteCreation.scala 100.00% <100.00%> (ø)
...cala/fr/acinq/eclair/router/RouteCalculation.scala 94.48% <100.00%> (ø)
...ala/fr/acinq/eclair/wire/protocol/OfferTypes.scala 95.31% <100.00%> (+0.03%) ⬆️
...air-core/src/main/scala/fr/acinq/eclair/Logs.scala 83.33% <0.00%> (-3.34%) ⬇️
...fr/acinq/eclair/channel/InteractiveTxBuilder.scala 84.87% <0.00%> (-1.03%) ⬇️
...cala/fr/acinq/eclair/crypto/TransportHandler.scala 90.60% <0.00%> (-0.56%) ⬇️
...in/scala/fr/acinq/eclair/channel/fsm/Channel.scala 86.27% <0.00%> (ø)
... and 3 more

@thomash-acinq thomash-acinq merged commit e32697e into master Nov 24, 2022
@thomash-acinq thomash-acinq deleted the byor2 branch November 24, 2022 17:32
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