Skip to content

Commit 37e8d2f

Browse files
committed
connectd: disable advertizement of WEBSOCKET addresses.
This seems to prevent broad propagation, due to LND not allowing it. See lightningnetwork/lnd#6432 We still announce it if you disable deprecated-apis, so tests still work, and hopefully we can enable it in future. Fixes: #5196 Signed-off-by: Rusty Russell <[email protected]> Changelog-EXPERIMENTAL: Protocol: disabled websocket announcement due to LND propagation issues
1 parent 393e8e5 commit 37e8d2f

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This release named by Simon Vrouwe; this marks the name change to core-lightning
1616

1717
- Protocol: we now support opening multiple channels with the same peer. ([#5078])
1818
- Protocol: we send/receive IP addresses in `init`, and send updated node_announcement when two peers report the same remote_addr (`disable-ip-discovery` suppresses this announcement). ([#5052])
19+
- Protocol: we more aggressively send our own gossip, to improve propagation chances. ([#5200])
1920
- Plugins: `cln-grpc` first class GRPC interface for remotely controlling nodes over mTLS authentication; set `grpc-port` to activate ([#5013])
2021
- Database: With the `sqlite3://` scheme for `--wallet` option, you can now specify a second file path for real-time database backup by separating it from the main file path with a `:` character. ([#4890])
2122
- Protocol: `pay` (and decode, etc) supports bolt11 payment_metadata a-la https://github.com/lightning/bolts/pull/912 ([#5086])
@@ -96,7 +97,7 @@ Note: You should always set `allow-deprecated-apis=false` to test for changes.
9697
- Fixed `experimental-websocket-port` to work with default addresses. ([#4945])
9798
- Protocol: removed support for v0.10.1 onion messages. ([#4921])
9899
- Protocol: Ability to announce DNS addresses ([#4829])
99-
100+
- Protocol: disabled websocket announcement due to LND propagation issues ([#5200])
100101

101102

102103
[#4829]: https://github.com/ElementsProject/lightning/pull/4829
@@ -141,6 +142,7 @@ Note: You should always set `allow-deprecated-apis=false` to test for changes.
141142
[#5130]: https://github.com/ElementsProject/lightning/pull/5130
142143
[#5136]: https://github.com/ElementsProject/lightning/pull/5136
143144
[#5146]: https://github.com/ElementsProject/lightning/pull/5146
145+
[#5200]: https://github.com/ElementsProject/lightning/pull/5200
144146
[0.11.0]: https://github.com/ElementsProject/lightning/releases/tag/v0.11.0
145147

146148
## [0.10.2] - 2021-11-03: Bitcoin Dust Consensus Rule

connectd/connectd.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,10 +1397,15 @@ setup_listeners(const tal_t *ctx,
13971397
* different type.
13981398
*/
13991399
if (tal_count(*announceable) != 0) {
1400-
wireaddr_from_websocket(&addr.u.wireaddr,
1401-
daemon->websocket_port);
1402-
add_announceable(announceable,
1403-
&addr.u.wireaddr);
1400+
/* See https://github.com/lightningnetwork/lnd/issues/6432:
1401+
* if we add websocket to the node_announcement, it doesn't propagate.
1402+
* So we do not do this for now in general! */
1403+
if (daemon->announce_websocket) {
1404+
wireaddr_from_websocket(&addr.u.wireaddr,
1405+
daemon->websocket_port);
1406+
add_announceable(announceable,
1407+
&addr.u.wireaddr);
1408+
}
14041409
} else {
14051410
status_unusual("Bound to websocket %s,"
14061411
" but we cannot announce"
@@ -1535,6 +1540,7 @@ static void connect_init(struct daemon *daemon, const u8 *msg)
15351540
&daemon->timeout_secs,
15361541
&daemon->websocket_helper,
15371542
&daemon->websocket_port,
1543+
&daemon->announce_websocket,
15381544
&dev_fast_gossip,
15391545
&dev_disconnect,
15401546
&dev_no_ping_timer)) {

connectd/connectd.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ struct daemon {
188188
int gossip_store_fd;
189189
size_t gossip_store_end;
190190

191+
/* We only announce websocket addresses if !deprecated_apis */
192+
bool announce_websocket;
193+
191194
#if DEVELOPER
192195
/* Hack to speed up gossip timer */
193196
bool dev_fast_gossip;

connectd/connectd_wire.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ msgdata,connectd_init,use_v3_autotor,bool,
2222
msgdata,connectd_init,timeout_secs,u32,
2323
msgdata,connectd_init,websocket_helper,wirestring,
2424
msgdata,connectd_init,websocket_port,u16,
25+
msgdata,connectd_init,announce_websocket,bool,
2526
msgdata,connectd_init,dev_fast_gossip,bool,
2627
# If this is set, then fd 5 is dev_disconnect_fd.
2728
msgdata,connectd_init,dev_disconnect,bool,

lightningd/connect_control.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ int connectd_init(struct lightningd *ld)
558558
ld->config.connection_timeout_secs,
559559
websocket_helper_path,
560560
ld->websocket_port,
561+
!deprecated_apis,
561562
IFDEV(ld->dev_fast_gossip, false),
562563
IFDEV(ld->dev_disconnect_fd >= 0, false),
563564
IFDEV(ld->dev_no_ping_timer, false));

0 commit comments

Comments
 (0)