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

Improve trampoline CLTV estimation #1

Open
t-bast opened this issue Dec 13, 2019 · 1 comment
Open

Improve trampoline CLTV estimation #1

t-bast opened this issue Dec 13, 2019 · 1 comment

Comments

@t-bast
Copy link
Member

t-bast commented Dec 13, 2019

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

  • ACINQ is able to reach all nodes in the network (except 13 that seem orphaned) with a cltv_delta of 576
  • If we lower that value (to 575), we immediately lose 15 remote nodes. If we accept losing those 15 nodes we can lower the cltv_delta to 472 without more losses
  • We have an upper limit of 1008 (1 week)
  • We need to account for one private channel hop (for which we get the cltv_delta in the invoice)

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
Copy link
Member Author

t-bast commented Dec 13, 2019

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.

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

No branches or pull requests

1 participant