1
0

Trampoline routing.

- trampoline is enabled by default in config, to prevent download of `gossip_db`.
   (if disabled, `gossip_db` will be downloaded, regardless of the existence of channels)
 - if trampoline is enabled:
    - the wallet can only open channels with trampoline nodes
    - already-existing channels with non-trampoline nodes are frozen for sending.
 - there are two types of trampoline payments: legacy and end-to-end (e2e).
 - we decide to perform legacy or e2e based on the invoice:
    - we use trampoline_routing_opt in features to detect Eclair and Phoenix invoices
    - we use trampoline_routing_hints to detect Electrum invoices
 - when trying a legacy payment, we add a second trampoline to the path to preserve privacy.
   (we fall back to a single trampoline if the payment fails for all trampolines)
 - the trampoline list is hardcoded, it will remain so until `trampoline_routing_opt` feature flag is in INIT.
 - there are currently only two nodes in the hardcoded list, it would be nice to have more.
 - similar to Phoenix, we find the fee/cltv by trial-and-error.
    - if there is a second trampoline in the path, we use the same fee for both.
    - the final spec should add fee info in error messages, so we will be able to fine-tune fees
This commit is contained in:
ThomasV
2020-11-11 11:03:31 +01:00
parent f4fe80dfd1
commit ded449233e
19 changed files with 541 additions and 107 deletions

View File

@@ -77,6 +77,7 @@ if [[ $1 == "init" ]]; then
agent="./run_electrum --regtest -D /tmp/$2"
$agent create --offline > /dev/null
$agent setconfig --offline log_to_file True
$agent setconfig --offline use_gossip True
$agent setconfig --offline server 127.0.0.1:51001:t
$agent setconfig --offline lightning_to_self_delay 144
# alice is funded, bob is listening