ACINQ / phoenix

Phoenix is a self-custodial Bitcoin wallet using Lightning to send/receive payments.
https://phoenix.acinq.co
Apache License 2.0
644 stars 97 forks source link

Improve trampoline CLTV estimation #1

Open t-bast opened 4 years ago

t-bast commented 4 years ago

I've done some analysis on the network graph, and here are the results:

Currently the code doesn't take the invoice routing hint into account: it should. The calculation of the trampoline cltv_delta should be:

  1. Select the highest cltv_delta value in the invoice routing hints
  2. Add 472 to it
  3. If ACINQ responds with an error TrampolineExpiryTooSoon or TrampolineInsufficientFees (will be added to core soon) retry adding using 576 instead of 472

I think it should be decorelated from the trampoline fee calculation: routing nodes are starting to update their fees so we'll need something more dynamic there, but they're mostly keeping default cltv_delta.

t-bast commented 4 years ago

In the longer term, Trampoline nodes will instead give you an error saying: if you retry with exactly that fee and cltv_delta it should work, but that will take more time to implement in eclair-core.