Commit Graph

11529 Commits

Author SHA1 Message Date
Michael Schmoock 033ac323d1 connectd: prefer IPv6 when available
Changelog-Changed: connectd: prefer IPv6 connections when available.
2022-06-17 20:30:16 +09:30
Dustin Dettmer aac22f3cb1 devtools: Add fund_ln command to startup_regtest.sh
fund_ln connects the two peers and funds a channel between them.

Changelog-Added: Added fund_ln to the contrib/startup_regtest.sh
2022-06-17 14:28:32 +09:30
Brian Barto 24b02c33cc
lightning-cli plugin start - Assume default relative path
When starting a plugin, if the plugin path cannot be found in
absolute context, assume it is a relative path to the default
plugins dir. As a result, the following now works when my_plugin.py
is installed in the default plugins dir:

lightning-cli plugin start my_plugin.py

Also update the plugin documentation to reflect that the use of a
relative path is now available.

Changelog-Added: plugin start RPC subcommand now assumes relative path to default plugins dir if the path is not found in absolute context. i.e. lightning-cli plugin start my_plugin.py

[ Squashed two commits into one -- RR ]
2022-06-17 14:18:48 +09:30
Rusty Russell 0c9017fb76 connectd: shrink max filter size.
10,000 per peer was too much.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-06-17 14:14:02 +09:30
Rusty Russell d922abeaba connectd: optimize gossip_rcvd_filter.
Instead of doing an allocation per entry, put the entry in directly.
This means only 30 bit resolution on 32-bit machines, but if a bit
of gossip gets accidently suppressed that's ok.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-06-17 14:14:02 +09:30
Rusty Russell 87a471af98 connectd: use is_msg_gossip_broadcast into gossip_rcvd_filter.c
It was doing its own equivalent check anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-06-17 14:14:02 +09:30
Rusty Russell 7c8dc62035 channeld: take over gossip_rcvd_filter.c and is_msg_gossip_broadcast.
channeld is the only user of these functions, since it now streams
all gossip itself.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-06-17 14:14:02 +09:30
Rusty Russell ecdfbbf359 connectd: restore gossip filter aging.
When we moved gossip filtering to connectd, this aging got lost.

Without this, we hit the 10,000 entry limit before expiring full
gossip anti-echo cache.  This is under 1M in allocations per peer, but
in DEVELOPER mode each allocation includes adds 3 notifiers (32 bytes
each) and a backtrace child (40 + 40 + 256 bytes), making it almost
10MB per peer, plus allocation overhead.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: connectd: large memory usage with many peers fixed.
2022-06-17 14:14:02 +09:30
Jon Griffiths 572942c783 psbt: use DER encoded + sighash byte for PSBT_IN_PARTIAL_SIG items
Per BIP-0171, the signature map is of pubkey to "The signature as would
be pushed to the stack from a scriptSig or witness".

Fixes 5298

Changelog-Fixed: PSBT: Fix signature encoding to comply with BIP-0171.

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
2022-06-09 18:28:35 +02:00
Christian Decker 74ddc15435 route: Do not require both directions to be active
This likely lead to a number of false errors when attempting to
route. We deemed a channel to be unusable as soon as either direction
isn't usable. This is bad since it excludes not only zeroconf
channels (which have different scids for the two directions), but it
also excludes any channel that we haven't seen an update from
yet. This was likely introduced when attemting to exclude nodes that
haven't sent a disable, but their peer has, but this is not necessary
as the unresponsive node would be marked as isolated by all its peers,
so we don't need to artificially mark a channel direction as disabled
when really we can't even enter the node to traverse the channel in
that direction.

Changelog-Fixed: routing: Fixed an issue where we would exclude the entire channel if either direction was disabled, or we hadn't seen an update yet.
2022-05-25 14:47:05 +09:30
Christian Decker f1d0325620 topo: Fix issue considering the wrong direction for capacity limits
Changelog-Fixed: topology: Under some circumstances we were considering the limits on the wrong direction for a channel
2022-05-25 14:47:05 +09:30
José A.P 0153621b32 Fixes #5276 by using as docker base image debian bullseye instead of buster
Changelog-Fixed: Upgrade docker base image from Debian buster to bullseye to work with glibc 2.29+ #5276
2022-05-22 14:25:05 +02:00
Rusty Russell c7d359baf4 cln-grpc: API updates after 8dd51d127f
Changing the JSON schemas changes this, and I didn't rebuild!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-05-19 10:00:27 +09:30
Rusty Russell abd01a1701 Makefile: update to include fix for remote_addr generation.
Now it's formatted properly, we don't need the patch.

But we need to explicitly marshal/unmarshal into a byte stream,
which involves some code rearrangement.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-05-19 09:47:32 +09:30
Rusty Russell 685fa25756 Makefile: update bolts to include remote_pubkey change.
Only affects comments.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-05-19 09:47:32 +09:30
Rusty Russell bf040c398b Makefile: update to BOLTs without zlib.
This contains a typo fix and a clarification on channel_type, but also
removes ZLIB.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-05-19 09:47:32 +09:30
Rusty Russell a4c365f8d0 gossipd: neaten code now we don't have to prepend prefix after.
We can simply start with a '0' where encoding is prefixed, so simplify
internal interface.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-05-19 09:47:32 +09:30
Rusty Russell 5735f71e3c gossipd: don't ever use zlib compression on gossip.
This was eliminated this morning in the latest spec.  We still accept them,
we just don't produce them any more.

Changelog-Removed: Protocol: We no longer create gossip messages which use zlib encoding (we still understand them, for now!)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-05-19 09:47:32 +09:30
Christian Decker 4cd6210c19 docker: Add rust build support to Dockerfile
We weren't building the Rust plugins in the `Dockerfile` since we were
missing the dependencies. Now we do.

Changelog-Fixed: docker: The docker images are now built with the rust plugins `cln-grpc`
2022-05-18 15:24:16 +02:00
Gregory Sanders b15cf312e8 Change lightning-rfc to bolts post repo move 2022-05-18 10:19:16 +09:30
Gregory Sanders 535fdc0690 More explanation of bolt csv regeneration 2022-05-18 10:19:16 +09:30
Vincenzo Palazzo c77eda6d64 pyln-spec: upgrade to the last bolt version
Changelog-Fixed: pyln-spec: update the bolts implementation

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-05-18 10:17:25 +09:30
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