Support DNS hostnames in node announcements
Add support for DNS host names
Notable changes:
- you can now specify a DNS host name as one of your
server.public-ipsaddresses (see PR #911). Note: you can not specify more than one DNS host name. - An IPv4, IPv6 or DNS hostname with port of 0 is invalid as per Bolt #7.
- DNS host names will not be resolved until
Clientattempts to connect to a peer. - will not rebroadcast a
NodeAnnouncementthat contains more than one DNS host name - the codec does not implement punycode parsing; we should create an issue if we want to support non-ASCII character sets for DNS host names
- DNS host name addresses must be resolved to determine if they are IPv4 or IPv6 when deciding whether or not to use a proxy.
To do:
- [X] interop testing with c-lightning PR# 4829
- [ ] ~~interop testing with LND Issue# 6337~~
- [ ] ~~interop testing with LDK PR# 1329~~
See also PR #2202 - Use NodeAddress everywhere and PR #2296 - drop Tor v2 support
Simple interop testing with CLN v0.10.2-252-gc0e3155 configured with:
./configure --enable-experimental-features --enable-developer
Overview of setup:
Alice [Eclair] @ dnstest1.co.fr <---> Bob [CLN] @ dnstest2.co.fr <---> Carol [Eclair] @ dnstest3.co.fr
Added to local /etc/hosts:
127.0.0.1 dnstest1.co.fr
127.0.1.1 dnstest2.co.fr
127.0.2.1 dnstest3.co.fr
Created a script dns_gossip.sh to test that DNS hostnames are gossiped between Eclair and CLN.
dns_gossip.sh
Launch bicoind with ./scripts/start-bitcoin.sh, run nodes: alice-eclair & bob-clightning & carol-eclair & and then run the test script ./scripts/dns_gossip.sh.
Example result:
$ ./scripts/dns_gossip.sh
Alice is 02ca09b2d0fdab441e7e41019e021db360838478484ff191feaf0e49cc13e7a9ba
Bob is 02a821bf4d075dcb88104ab2784ee87ece8979c1e2492c50cac5cdbcaedf686cfc
Carol is 0384f3fca93a670a854f1b9732965b22920c02745f3d91e8084793bf0c7b69f5b5
Adding some Bitcoin to wallets...
Generating a few blocks to confirm wallet balances...
Opening channels between Alice and Bob...
Opening channels between Bob and Carol...
Generating a few blocks to confirm channels...
Creating invoices...
Awaiting gossip sync...
Gossip sync took 14 seconds
Paying invoices...
1. BOB -> CAROL [10,000]
complete
2. ALICE -> BOB [10,000]
payment-sent
3. CAROl -> BOB -> ALICE [5,000]
payment-sent
4. ALICE -> BOB -> CAROL [20,000]
payment-sent
5. BOB -> ALICE [10,000]
complete
6. CAROL -> BOB [5,000]
payment-sent
All invoices paid
"echo All invoices paid" command filed with exit code 0.
To re-run dns_gossip.sh you first must kill the three nodes, reset their databases with ./scripts/reset_all_nodes.sh and then start the nodes again.
As per Roasbeef at today's meeting, LND 0.15 will propagate DNS hostnames, so nodes running a version from about a month ago should not disappear if they add dns host names to their node announcements.
Codecov Report
Merging #2234 (c2df6d2) into master (33e6fac) will decrease coverage by
0.06%. The diff coverage is96.15%.
@@ Coverage Diff @@
## master #2234 +/- ##
==========================================
- Coverage 84.95% 84.89% -0.07%
==========================================
Files 198 198
Lines 15255 15277 +22
Branches 633 640 +7
==========================================
+ Hits 12960 12969 +9
- Misses 2295 2308 +13
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...re/src/main/scala/fr/acinq/eclair/NodeParams.scala | 93.11% <87.50%> (-0.17%) |
:arrow_down: |
| ...ore/src/main/scala/fr/acinq/eclair/io/Client.scala | 56.60% <100.00%> (+0.83%) |
:arrow_up: |
| ...in/scala/fr/acinq/eclair/io/ReconnectionTask.scala | 98.07% <100.00%> (ø) |
|
| ...n/scala/fr/acinq/eclair/router/Announcements.scala | 100.00% <100.00%> (ø) |
|
| ...main/scala/fr/acinq/eclair/router/Validation.scala | 94.11% <100.00%> (-1.24%) |
:arrow_down: |
| ...n/scala/fr/acinq/eclair/tor/Socks5Connection.scala | 9.37% <100.00%> (+0.71%) |
:arrow_up: |
| ...a/fr/acinq/eclair/wire/protocol/CommonCodecs.scala | 97.05% <100.00%> (+0.04%) |
:arrow_up: |
| ...q/eclair/wire/protocol/LightningMessageTypes.scala | 94.64% <100.00%> (+0.52%) |
:arrow_up: |
| ...q/eclair/channel/publish/ReplaceableTxFunder.scala | 86.91% <0.00%> (-3.67%) |
:arrow_down: |
| ...cala/fr/acinq/eclair/payment/relay/NodeRelay.scala | 95.93% <0.00%> (-1.63%) |
:arrow_down: |
| ... and 5 more |