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

Multi-trampoline multipart payments #7623

Merged
merged 2 commits into from
Feb 19, 2022

Conversation

bitromortac
Copy link
Contributor

@bitromortac bitromortac commented Jan 10, 2022

Based on #7426 (first four commits) and partially fixes #7604, related to #7648.

  • Refactored create_trampoline_route.
  • Enables end-to-end multi-trampoline multipart payments. Trampoline-to-legacy payments are still not enabled, as this is currently not supported by Eclair.
  • Reintroduces a global trampoline fee level.

@bitromortac
Copy link
Contributor Author

Rebased.

@bitromortac bitromortac marked this pull request as draft January 31, 2022 16:16
@bitromortac bitromortac force-pushed the 2201-multi-trampoline-mpp branch 3 times, most recently from 9e764fb to c6cb85d Compare February 3, 2022 14:16
@bitromortac bitromortac marked this pull request as ready for review February 3, 2022 14:17
@SomberNight
Copy link
Member

  • Removes all second-hop trampoline forwarders for the legacy case, as trampoline failures are currently not handled properly, see (Many trampoline payment attempts due to wrong TrampolineFeeInsufficient attribution #7648), with the downside of removing some privacy (not much, there are only three trampolines), but the upside of improvements in sending reliability.
  • In the e2e case, we sometimes need two trampoline forwarders, e.g., when the two endpoints are connected to different trampolines. We cannot know about which of the two trampoline fee levels should be bumped on insufficient fee error, therefore we revert to a global fee level and bump both (which doubles the fees).

Why remove the second hop TF for the legacy case -- can't we just use the same approach as for e2e and revert to a global fee level?

@bitromortac
Copy link
Contributor Author

Why remove the second hop TF for the legacy case -- can't we just use the same approach as for e2e and revert to a global fee level?

My impression is that currently it takes many attempts to make larger payments, with quite a few fee bumps involved.

The is some dynamics between random choice of second forwarder and insufficient fees which gets doubled up if we consider a global policy. I don't know if the next makes fully sense (for say a 1Msat payment) or if there are other edge cases, there could be more fee bumps:

two TF scenario (kind of worst case):

  • Route: TF1 -> TF2 -> Receiver
    Fee is insufficient for T1 -> T2, bump fee level
  • Route TF1 -> TF3 -> Receiver
    Fee is insufficient for T1 -> T3, bump fee level
  • Route TF1 -> TF2 -> Receiver
    Fee is insufficient for T2 -> Receiver, bump fee level
  • Route TF1 -> TF3 -> Receiver
    Fee is insufficient for TF3 -> Receiver, bump fee level

fee level: 4 -> 0.001000 * 1_000_000 sat = 1000 sat -> 2000 sat

single TF scenario:

  • Route: TF1 -> Receiver
    Fee is insufficient for T1 -> Receiver, bump fee level
  • Route: TF1 -> Receiver
    Fee is insufficient for T1 -> Receiver, bump fee level

fee level: 2 -> 0.000100 * 1_000_000 sat = 100 sat

Of course there's a tradeoff between reliability, fees, payment time and privacy. I didn't make many large trampoline payments but from my experience they seemed rather unreliable.

@ecdsa
Copy link
Member

ecdsa commented Feb 16, 2022

@bitromortac can you clarify in the example above, whether those are MPPs or sequential attempts?

@bitromortac
Copy link
Contributor Author

bitromortac commented Feb 16, 2022

@bitromortac can you clarify in the example above, whether those are MPPs or sequential attempts?

Those would be sequential attempts, but considering the fee_level dict, going back to a global fee level could fix things, as you wrote.

@bitromortac
Copy link
Contributor Author

I reverted to a global fee rate and added the second forwarder again for legacy payments.

electrum/lnworker.py Outdated Show resolved Hide resolved
* Refactor `create_trampoline_route`.
* Enables end-to-end multi-trampoline multipart payments.
  Trampoline-to-legacy payments are still not enabled, as this is
  currently not supported by Eclair.
* Reverts to a global trampoline fee level, as trampoline failures
  are currently not handled properly, see (spesmilo#7648), which doubles
  fee rates.
@ecdsa
Copy link
Member

ecdsa commented Feb 18, 2022

The PR looks good to me.
One question, though: the pay-to-open-feature-bit branch on ACINQ seems to only add the feature bits, but I do not see how it inhibits the pay-to-open behaviour if a client does not have the feature bit.

@bitromortac
Copy link
Contributor Author

I will explicitly test again an e2e payment to a wallet with a channel which has not enough receiving capacity with ACINQ and will let you know.

@ecdsa
Copy link
Member

ecdsa commented Feb 19, 2022

I tested myself, it looks like the ACINQ node no longer tries pay-to-open on Electrum clients.

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.

Enable multipart trampoline payments via several different trampoline nodes
3 participants