Commit Graph

11507 Commits

Author SHA1 Message Date
Rusty Russell f078e54e98 lightningd: remove various deprecated JSON fields.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: JSON-RPC: removed `listtransactions` `outputs` `satoshis` field (deprecated v0.10.1)
Changelog-Removed: JSON-RPC: removed `listpeers` `channels` deprecated fields (deprecated v0.10.1)
Changelog-Removed: JSON-RPC: removed `listpeers` `channels` `closer` now omitted, rather than `null` (deprecated v0.10.1)
2022-05-18 10:15:36 +09:30
Rusty Russell 8b62e2584f connectd: remove enable-autotor-v2-mode option
Changelog-Removed: lightningd: removed `enable-autotor-v2-mode` option (deprecated v0.10.1)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-05-18 10:15:36 +09:30
Kristaps Kaupe 8dd51d127f Restore description of "reserved" field for listfunds
It was lost in 2296d4452f.
2022-05-17 10:28:03 +09:30
niftynei c78b349f44 README: add links to discord + telegram so people can easily find us!
Suggested-By: @justinmoon
2022-05-17 10:18:10 +09:30
Rusty Russell 1860bbaed7 CHANGELOG.md: release notes for 0.11.1.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-05-16 09:59:42 +09:30
Rusty Russell 4343f720be connectd: remove assert which can trigger.
I have a test which reproduces this, too, and it's been seen in the
wild.  It seems we can add a subd as we're closing, which causes
this assert to trigger.

Fixes: #5254
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-05-16 09:59:42 +09:30
Rusty Russell 1c495ca5a8 connectd: fix accidental handling of old reconnections.
We had multiple reports of channels being unilaterally closed because
it seemed like the peer was sending old revocation numbers.

Turns out, it was actually old reestablish messages!  When we have a
reconnection, we would put the new connection aside, and tell lightningd
to close the current connection: when it did, we would restart
processing of the initial reconnection.

However, we could end up with *multiple* "reconnecting" connections,
while waiting for an existing connection to close.  Though the
connections were long gone, there could still be messages queued
(particularly the channel_reestablish message, which comes early on).

Eventually, a normal reconnection would cause us to process one of
these reconnecting connections, and channeld would see the (perhaps
very old!) messages, and get confused.

(I have a test which triggers this, but it also hangs the connect
 command, due to other issues we will fix in the next release...)

Fixes: #5240
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-05-16 09:59:42 +09:30
Christian Decker 9039c9c46e docker: Update name from c-lightning to Core-Lightning 2022-05-14 11:43:46 +09:30
Christian Decker e972e37e8c docs: Update references from c-lightning to Core-Lightning 2022-05-14 11:43:46 +09:30
Christian Decker ae522229f0 doc: Update lightning.readthedocs.org project name after rebrand 2022-05-14 11:43:46 +09:30
Vincenzo Palazzo f90ee0ecfd ignore generic binary
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-05-09 04:04:25 +00:00
Christian Decker 2cf92acaa8 gh: Add @cdecker as codeowner for the Rust artifacts
Changelog-None
2022-05-08 16:57:58 +02:00
Christian Decker e7a3471af6 gh: Remove @wythe from the codeowners
For some reason Github complains that @wythe doesn't have access to
the public repository, removing in order to silence that warning. Feel
free to contact me to investigate what's happening and re-enable :-)

Changelog-None
2022-05-08 16:57:58 +02:00
Vincenzo Palazzo 2ab2061cc9 msggen: adding example and fixes typo
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-05-07 11:11:51 +02:00
Vincenzo Palazzo 4e902fbd88 msggen: introduce chain of responsibility pattern to make msggen extensible
Changelog-Added: msggen: introduce chain of responsibility pattern to make msggen extensible

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-05-07 11:11:51 +02:00
Alex Myers 80db867a30 pytest: websocket test can tolerate ipv6 address
test_connection.py::test_websocket no longer fails on presence of ipv6
address.
2022-05-04 15:51:17 +02:00
Rusty Russell e516a5dffe external/Makefile: fix `submodcheck` for sudo make install and modern git.
We can't run refresh-submodules without a working git, either:

```
$ sudo make install
mkdir -p /usr/local/bin
mkdir -p /usr/local/libexec/c-lightning
mkdir -p /usr/local/libexec/c-lightning/plugins
mkdir -p /usr/local/share/man/man1
mkdir -p /usr/local/share/man/man5
mkdir -p /usr/local/share/man/man7
mkdir -p /usr/local/share/man/man8
mkdir -p /usr/local/share/doc/c-lightning
fatal: unsafe repository ('/home/rusty/lightning' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /home/rusty/lightning
Reinitializing submodules external/libsodium external/libwally-core external/gheap external/jsmn external/libbacktrace external/lnprototest ...
fatal: unsafe repository ('/home/rusty/lightning' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /home/rusty/lightning
fatal: unsafe repository ('/home/rusty/lightning' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /home/rusty/lightning
make: *** [external/Makefile:52: submodcheck] Error 128
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-05-03 09:08:33 +09:30
Clay Shoaf 43ace03685 "removed asterisks, in case that's what made build fail" 2022-05-01 14:36:20 +09:30
Clay Shoaf 55b5653726 Slight problem with `./configure help` 2022-05-01 14:36:20 +09:30
Christian Decker cc9bdb8298 pyln: Update the makefile to use poetry for publishing 2022-05-01 14:22:49 +09:30
Rusty Russell 6ced5558fb Makefile: stumble along if git does not work.
In particular, it's started complaining about "sudo make install"
and the .git directory being owned by someone else :(

Fixes: #5221
Fixes: #5189
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-28 13:05:35 +02:00
Christian Decker f40b6da457 repro: Update repro dockerfiles and instructions
Switching to poetry, and deprecating python 3.6, made things a bit
more tricky. Sadly we'll not be able to build jammy, as its support is
missing in the tag tarball, but it'll be there for the next release.
2022-04-28 12:28:48 +09:30
Christian Decker 182c900cea repro: Add reprobuild support for ubuntu:22.04 2022-04-28 12:28:48 +09:30
Rusty Russell 0ec947f699 doc: fix getinfo non-ASCII chars for older mrkd.
When building reproducible build for Bionic:

```
Traceback (most recent call last):
  File "/usr/local/bin/mrkd", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/mrkd/__init__.py", line 261, in main
    result = mistune.markdown(fp.read(), inline=inline, renderer=renderer)
  File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1856: ordinal not in range(128)
doc/Makefile:120: recipe for target 'doc/lightning-getinfo.7' failed
make: *** [doc/lightning-getinfo.7] Error 1
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-25 21:03:22 +09:30
Rusty Russell f5df69020d v0.11.0.1: final fixes for release build
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-25 20:49:44 +09:30
Rusty Russell 27352d0a7b CHANGELOG.md: Looks like rc5 was the ticket!
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-25 15:30:26 +09:30
Rusty Russell be2523ec63 CHANGELOG: rc5
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-21 20:50:23 +09:30
Rusty Russell 98f64fb623 lightningd: don't crash listpeers if we're opening DF channel.
We call out to connectd to activate the peer, and while we do that,
channel->owner is NULL.  A better pattern would be to set up the unsaved
channel once connectd has given us the peer, but this works for now.

Fixes: #5204
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-21 20:45:32 +09:30
Rusty Russell f6e7d0c5dc pytest: add test for crashing listpeers.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-21 20:45:32 +09:30
joe.miyamoto 562974acdb Fix miner bug in rust client generator.
This commit fixes a bug in a function `gen_enum`, which
is not caught because so far we have no non-required field in enums
defined in json schema.
2022-04-21 16:43:50 +09:30
Rusty Russell 34e93a718e v0.11.0rc4
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-21 08:38:02 +09:30
Rusty Russell 37e8d2fb0f connectd: disable advertizement of WEBSOCKET addresses.
This seems to prevent broad propagation, due to LND not allowing it.  See
	https://github.com/lightningnetwork/lnd/issues/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 <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: Protocol: disabled websocket announcement due to LND propagation issues
2022-04-21 06:13:55 +09:30
Rusty Russell 393e8e5e6a connectd: remove a noisy debug msg, fix name typo.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-21 06:13:55 +09:30
Rusty Russell c110d0b068 pytest: test that node_announcement regeneration works as expected.
We shorten 24 hours to 24 seconds using --dev--fast-gossip-prune.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-21 06:13:55 +09:30
Rusty Russell f81a7ff792 gossipd: fix daily node_announcement regeneration.
We have an explicit filter against redundant node_announcement
updates; we only allow 1 a week.  This means that our change to force
a reannouncement every 24 hours did not work!

Allow once a day, instead.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-21 06:13:55 +09:30
Rusty Russell a5d027cefc connectd: send our own gossip, even if peer hasn't sent timestamp_filter.
We seem to have made node_announcement propagation *worse*, not
better.  Explorers don't see my nodes updates.

At least some LND nodes never send us timestamp_filter, so we are
never actually stream *any* gossip.  We should send gossip about
ourselves, even if they haven't set a filter (yet).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Protocol: we more aggressively send our own gossip, to improve propagation chances.
2022-04-21 06:13:55 +09:30
Rusty Russell 9b944dbed4 common/gossip_store: add flag to *only* fetch "push"-marked messages.
These are the ones which are for our own channels (and our own node_announcement).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-21 06:13:55 +09:30
Rusty Russell ee21ae814a gossipd: revert useless bf8cb640b7.
This attempted to make us re-xmit our own node_announcement at restart,
by moving the node_announcement to the end of the gossip store.  But,
as nothing is connected, yet, this had no effect!

We will rexmit it anyway, since it's marked PUSH.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-21 06:13:55 +09:30
zero fee routing cb70d06d67 corrected typo in description 2022-04-20 21:17:01 +09:30
Rusty Russell f0dc028fa9 lightningd: fix overzealous check in htlc_out_check:
```
+11.668971802 lightningdBROKEN: backtrace: lightningd/log.c:821 (fatal_vfmt) 0x558c893c997f
+11.668978165 lightningdBROKEN: backtrace: lightningd/log.c:829 (fatal) 0x558c893c9a30
+11.668984935 lightningdBROKEN: backtrace: lightningd/htlc_end.c:87 (corrupt) 0x558c893b9b7d
+11.668991262 lightningdBROKEN: backtrace: lightningd/htlc_end.c:205 (htlc_out_check) 0x558c893ba352
+11.669016705 lightningdBROKEN: backtrace: lightningd/peer_htlcs.c:1471 (check_already_failed) 0x558c893ea9c9
+11.669023345 lightningdBROKEN: backtrace: lightningd/peer_htlcs.c:1575 (onchain_failed_our_htlc) 0x558c893eb098
+11.669043122 lightningdBROKEN: backtrace: lightningd/onchain_control.c:438 (handle_onchain_htlc_timeout) 0x558c893cd6ec
+11.669049818 lightningdBROKEN: backtrace: lightningd/onchain_control.c:548 (onchain_msg) 0x558c893cdbdc
+11.669056372 lightningdBROKEN: backtrace: lightningd/subd.c:556 (sd_msg_read) 0x558c893fa532
+11.669063030 lightningdBROKEN: backtrace: ccan/ccan/io/io.c:59 (next_plan) 0x558c8948e3cd
+11.669069093 lightningdBROKEN: backtrace: ccan/ccan/io/io.c:407 (do_plan) 0x558c8948ef9e
+11.669075470 lightningdBROKEN: backtrace: ccan/ccan/io/io.c:417 (io_ready) 0x558c8948efdc
+11.669081900 lightningdBROKEN: backtrace: ccan/ccan/io/poll.c:453 (io_loop) 0x558c894912a8
+11.669087916 lightningdBROKEN: backtrace: lightningd/io_loop_with_timers.c:22 (io_loop_with_timers) 0x558c893c0966
+11.669094531 lightningdBROKEN: backtrace: lightningd/lightningd.c:1181 (main) 0x558c893c6bf9
```

Fixes: #5191
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-20 16:30:05 +09:30
Rusty Russell 33ae601266 CI: fix bsd workflow.
I have no idea why someone else owns the directory suddenly, but all git
commands fail.  Workaround as suggested by the error message.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-20 07:16:01 +09:30
Rusty Russell c3a7499573 connectd: avoid use-after-free on reconnect with remote_addr.
I was seeing a strange crash:
	Connectd gave bad CONNECT_PEER_CONNECTED message

The message is indeed mangled, around the remote_addr!
A quick review of the code revealed that we were not making a copy
when it was a reconnect, and so the remote_addr pointer was pointing
to memory which was freed.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-20 06:44:58 +09:30
Rusty Russell 151d009435 lightningd: remove over-zealous assert.
This was hit on my node.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-13 10:32:29 +09:30
Rusty Russell a326ea8bb2 CHANGELOG.md: rc3
This time for sure!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-13 08:02:45 +09:30
Rusty Russell e90b50a1b2 dualopend: handle dev_memleak during RBF.
Happens in CI:

```
lightningd-2: 2022-04-10T15:30:40.788Z **BROKEN** 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-dualopend-chan#1: STATUS_FAIL_MASTER_IO: Error parsing 7507: 1b79
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-13 05:25:20 +09:30
Rusty Russell 3f94b74e07 pytest: don't add extra cln-grpc instance now plugin is builtin
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-13 05:25:00 +09:30
Rusty Russell 355025239d Make sure DEFAULT_TARGETS includes rust testing examples.
Otherwise tests fail:

```
    def test_plugin_start(node_factory):
        """Start a minimal plugin and ensure it is well-behaved
        """
        bin_path = Path.cwd() / "target" / "debug" / "examples" / "cln-plugin-startup"
>       l1 = node_factory.get_node(options={"plugin": str(bin_path), 'test-option': 31337})
...
error starting plugin '/home/runner/work/lightning/lightning/target/debug/examples/cln-plugin-startup': opening pipe: No such file or directory
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-13 05:25:00 +09:30
Rusty Russell e5abc10ae2 configure: require rustfmt as well, for rust support.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-13 05:25:00 +09:30
Rusty Russell bad89f186a doc/Makefile: make check-manpages require the cln-grpc plugin.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-13 05:25:00 +09:30
Rusty Russell c598d4df74 Makefile: make sure ALL_PROGRAMS doesn't include cln-grpc plugin.
$(ALL_PROGRAMS) are assumed to be C programs for now.

Add $(C_PLUGINS) as a new variable.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-04-13 05:25:00 +09:30