Skip to content

Commit

Permalink
connectd: disable advertizement of WEBSOCKET addresses.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rustyrussell committed Apr 20, 2022
1 parent 393e8e5 commit 37e8d2f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This release named by Simon Vrouwe; this marks the name change to core-lightning

- Protocol: we now support opening multiple channels with the same peer. ([#5078])
- 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])
- Protocol: we more aggressively send our own gossip, to improve propagation chances. ([#5200])
- Plugins: `cln-grpc` first class GRPC interface for remotely controlling nodes over mTLS authentication; set `grpc-port` to activate ([#5013])
- 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])
- Protocol: `pay` (and decode, etc) supports bolt11 payment_metadata a-la https://github.com/lightning/bolts/pull/912 ([#5086])
Expand Down Expand Up @@ -96,7 +97,7 @@ Note: You should always set `allow-deprecated-apis=false` to test for changes.
- Fixed `experimental-websocket-port` to work with default addresses. ([#4945])
- Protocol: removed support for v0.10.1 onion messages. ([#4921])
- Protocol: Ability to announce DNS addresses ([#4829])

- Protocol: disabled websocket announcement due to LND propagation issues ([#5200])


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

## [0.10.2] - 2021-11-03: Bitcoin Dust Consensus Rule
Expand Down
14 changes: 10 additions & 4 deletions connectd/connectd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1397,10 +1397,15 @@ setup_listeners(const tal_t *ctx,
* different type.
*/
if (tal_count(*announceable) != 0) {
wireaddr_from_websocket(&addr.u.wireaddr,
daemon->websocket_port);
add_announceable(announceable,
&addr.u.wireaddr);
/* See https://github.com/lightningnetwork/lnd/issues/6432:
* if we add websocket to the node_announcement, it doesn't propagate.
* So we do not do this for now in general! */
if (daemon->announce_websocket) {
wireaddr_from_websocket(&addr.u.wireaddr,
daemon->websocket_port);
add_announceable(announceable,
&addr.u.wireaddr);
}
} else {
status_unusual("Bound to websocket %s,"
" but we cannot announce"
Expand Down Expand Up @@ -1535,6 +1540,7 @@ static void connect_init(struct daemon *daemon, const u8 *msg)
&daemon->timeout_secs,
&daemon->websocket_helper,
&daemon->websocket_port,
&daemon->announce_websocket,
&dev_fast_gossip,
&dev_disconnect,
&dev_no_ping_timer)) {
Expand Down
3 changes: 3 additions & 0 deletions connectd/connectd.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ struct daemon {
int gossip_store_fd;
size_t gossip_store_end;

/* We only announce websocket addresses if !deprecated_apis */
bool announce_websocket;

#if DEVELOPER
/* Hack to speed up gossip timer */
bool dev_fast_gossip;
Expand Down
1 change: 1 addition & 0 deletions connectd/connectd_wire.csv
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ msgdata,connectd_init,use_v3_autotor,bool,
msgdata,connectd_init,timeout_secs,u32,
msgdata,connectd_init,websocket_helper,wirestring,
msgdata,connectd_init,websocket_port,u16,
msgdata,connectd_init,announce_websocket,bool,
msgdata,connectd_init,dev_fast_gossip,bool,
# If this is set, then fd 5 is dev_disconnect_fd.
msgdata,connectd_init,dev_disconnect,bool,
Expand Down
1 change: 1 addition & 0 deletions lightningd/connect_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ int connectd_init(struct lightningd *ld)
ld->config.connection_timeout_secs,
websocket_helper_path,
ld->websocket_port,
!deprecated_apis,
IFDEV(ld->dev_fast_gossip, false),
IFDEV(ld->dev_disconnect_fd >= 0, false),
IFDEV(ld->dev_no_ping_timer, false));
Expand Down

0 comments on commit 37e8d2f

Please sign in to comment.