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 trampoline onion support #1209

Merged
merged 4 commits into from Nov 14, 2019
Merged

Add trampoline onion support #1209

merged 4 commits into from Nov 14, 2019

Conversation

@t-bast
Copy link
Member

t-bast commented Nov 13, 2019

This commit adds support for creating and decrypting trampoline onions.
It doesn't add support for forwarding trampoline payments yet.

This commit adds support for creating and decrypting trampoline onions.
It doesn't add support for forwarding trampoline payments yet.
@t-bast t-bast requested a review from pm47 Nov 13, 2019
@pm47 pm47 self-assigned this Nov 13, 2019
@t-bast

This comment has been minimized.

Copy link
Member Author

t-bast commented Nov 13, 2019

The code here can be tricky because we have two-levels of onion nesting (and thus two levels of decrypting then decoding) and it's easy to get confused between amounts/expiries from the outer and inner onion.
Please review carefully (especially in PaymentPacket.scala) and have a good look at the tests.
This is a necessary foundation before trampoline relay can be built, so it would be nice to progress quickly here (if we need to change the type architecture this will impact the next trampoline commits).

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Nov 13, 2019

Codecov Report

❗️ No coverage uploaded for pull request base (master@e5060d9). Click here to learn what that means.
The diff coverage is 91.61%.

@@            Coverage Diff            @@
##             master    #1209   +/-   ##
=========================================
  Coverage          ?   76.28%           
=========================================
  Files             ?      139           
  Lines             ?     9480           
  Branches          ?      370           
=========================================
  Hits              ?     7232           
  Misses            ?     2248           
  Partials          ?        0
Impacted Files Coverage Δ
.../scala/fr/acinq/eclair/payment/PaymentEvents.scala 100% <ø> (ø)
...src/main/scala/fr/acinq/eclair/router/Router.scala 91.97% <100%> (ø)
...scala/fr/acinq/eclair/payment/PaymentRequest.scala 93.25% <100%> (ø)
...cinq/eclair/payment/receive/MultiPartHandler.scala 95% <100%> (ø)
.../src/main/scala/fr/acinq/eclair/router/Graph.scala 98% <100%> (ø)
...core/src/main/scala/fr/acinq/eclair/Features.scala 100% <100%> (ø)
...r/acinq/eclair/payment/send/PaymentInitiator.scala 100% <100%> (ø)
...re/src/main/scala/fr/acinq/eclair/NodeParams.scala 86.84% <100%> (ø)
...src/main/scala/fr/acinq/eclair/db/PaymentsDb.scala 70% <100%> (ø)
...r/acinq/eclair/payment/send/PaymentLifecycle.scala 89.9% <100%> (ø)
... and 6 more
* ChannelRelayPayload \ / \
* ________/\______________ \ / \
* / \ \ / \
* RelayLegacyPayload ChannelRelayTlvPayload NodeRelayPayload FinalLegacyPayload FinalTlvPayload

This comment has been minimized.

Copy link
@pm47

pm47 Nov 13, 2019

Member

Shouldn't we rename RelayLegacyPayload -> ChannelRelayLegacyPayload?

This comment has been minimized.

Copy link
@t-bast

t-bast Nov 13, 2019

Author Member

We could, but legacy already implies only channel relay. And since we're adding more dimensions to those type at some point we won't be able to mention all the dimensions inside each concrete type's name so we shouldn't strive for that 😅

eclair-core/src/main/resources/reference.conf Outdated Show resolved Hide resolved
t-bast added 2 commits Nov 13, 2019
We tie the type of onion packet to the payloads it may contain.
@pm47
pm47 approved these changes Nov 14, 2019
@t-bast t-bast merged commit 6bc5fcf into master Nov 14, 2019
4 checks passed
4 checks passed
ci/semaphoreci/pr: Build & Test The build passed on Semaphore 2.0.
Details
ci/semaphoreci/push: Build & Test The build passed on Semaphore 2.0.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@t-bast t-bast deleted the trampoline-onion branch Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.