Commit Graph

14117 Commits

Author SHA1 Message Date
evansmj 7d52d4135e Sync bind-addr docs
In the original [$6173] pr `bind` was a typo for `bind-addr`.
`bind` never existed, so this commit updates uses of `bind` to `bind-addr`.
This links lightningd-config.5.md to configuration.md since `bind-addr` has options of interest such as ipv4/ipv6.
2023-12-15 10:03:10 +10:30
Christian Decker 05105d404c rs: Bump versions of `cln-plugin` and `cln-rpc` 2023-12-15 10:01:57 +10:30
Christian Decker c8fd911e79 grpc: Add metadata to Cargo.toml 2023-12-15 10:01:57 +10:30
Christian Decker a55c1edd66 pyln: Also generate type stubs in pyln-grpc-proto 2023-12-15 10:01:57 +10:30
Christian Decker c7da72cd39 gci: Upload to test.pypi.org only from `master`
Turns out that if we publish from PRs we may end up with versioning
collisions, causing errors. This publishes only from `master` where we
have a linearizable history, and should therefore get unique versions.

Changelog-None
2023-12-15 10:01:57 +10:30
arowser 34a32361a8 build: 32-bit status_debug fix 2023-12-15 10:00:16 +10:30
Adi Shankara dfd18fa2f1 fix typo 2023-12-15 09:55:26 +10:30
Adi Shankara d50d7d428d fix typos and add suggested edits from community 2023-12-15 09:55:26 +10:30
Dusty Daemon 6f4a3c86e9 splice: Agressive restart testing during splices
Test node restarts in lots of phases of splice.

Changelog-None
2023-12-15 09:42:45 +10:30
Erik De Smedt 1754858ca7 Doc fix: dynamic options
When the value of a `dynamic` option is updated core Lightning
will make a JSON-RPC request to the plugin.

The documentation falsely mentioned the request has a method named
`setvalue. It appears it is actually called `setconfig`.
2023-12-15 09:40:29 +10:30
Erik De Smedt 557b5fee46 Allow dynamic option in python plugin 2023-12-14 16:48:02 +01:00
Christian Decker b6c486c2ba gha: Add `--skip-existing` option to publish to testpypi
Changelog-None
2023-12-14 13:03:55 +01:00
Rusty Russell 36b631699b plugins: re-enable listchannels local info in deprecated mode.
We only deprecated this, we didn't actually remove it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell c8e30de513 topology: deprecate overriding `active` in `listchannels` with `listpeerchannels` info.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Deprecated: `listchannels` no longer uses local knowledge to set `active` to false if disconnected.
2023-12-14 09:16:56 +10:30
Rusty Russell 4b92c773df common: gossmap now always ignores private gossip_store messages.
In the next PR, they'll be removed, but for now all our code doesn't
want them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell 58a1c4c012 topology: don't show private nodes in listchannels.
This alters a few remaining tests, as well.

[ Inclused even more test fixes from Alex Myers <alex@endothermic.dev>! ]

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Deprecated: JSON-RPC: `listchannels` listing private channels: use listpeerchannels
2023-12-14 09:16:56 +10:30
Alex Myers 3a6b9f2ec6 pytest: skip test_hook_crash on liquid CI 2023-12-14 09:16:56 +10:30
Rusty Russell b318811a2d pytest: fix tests in assumption that listchannels will no longer show private gossip.
Some can only be changed once that is true, but some can be removed/amended already.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell ea0d00e677 topology: don't show private nodes in listnodes.
This breaks our tests a bit, which assumed we can always see ourselves
even if we don't have a proper channel.

Usually we would deprecate this first, but it's unlikely to break
anyone since it's a bit obscure that this worked at all.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: JSON-RPC: `listnodes` no longer shows private (peer) nodes: use listpeers
2023-12-14 09:16:56 +10:30
Rusty Russell f61ba7b332 pytest: remove test waits for routehints.
Now listincoming sees local channels in listpeerchannels, we don't need these waits.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell 6ee59629f9 lightningd: make listincoming use gossmods_from_listpeerchannels().
We temporarily use a second gossmap so we can just switch private info off
for listincoming and not listchannels.

Note that listchannels now uses the local alias (if no scid), so we have
to change that in the routehint caller.

Since we now *always* use a channel alias in hints if one exists, a
test broke, so fix that.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell 0c949dcd04 lightningd: permit wrong-alias lookups for private channel_update.
This is wrong, but we send them for now in zeroconf!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell f3b4821d36 pytest: fix test_zeroconf_open()
l2 gave us a routehint, but it should have seen l1 as a dead-end.  It
didn't due to the presence of a channel alias, which was a bug.  We're
about to fix this, which breaks the test.

Add a dummy node off l1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell bac02b462b plugins/renepay: use gossmods_from_listpeerchannels instead of private gossip_store records.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell c8eb46fe30 plugins/renepay: add localmods later.
We will get localmods from gossmods_from_listpeerchannels in the next commit,
so we need to save routehints to add to that later.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell 7c26f140d8 common: add tests that json_scan can omit an entire object member.
We can, but I had a typo and thought we couldn't!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell 8738d78c86 plugins/pay: use gossmods_from_listpeerchannels instead of private gossip_store records.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell 3fdae99524 libplugin-pay: make sure get_gossmap calls are balanced by put_gossmap.
This will become important when we apply localmods to the gossmap at these points.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell a5c0563612 plugins/fetchinvoice: use gossmods_from_listpeerchannels instead of private gossip_store records.
[ Includes use-after-free fix from Alex Myers <alex@endothermic.dev> ]

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell 5256690c6f plugins/topology: temporary hack to allow per-access private gossmap suppression.
We have multiple different routines here, and we want to wean them off private
gossip one at a time.  This converts `getroute`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell cdaad1bf2a common: generic routine to turn listpeerchannels into gossmap local updates.
This is more thorough than the minimal one required for getroute(), including the feerates
and cltv deltas.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell f2fff4de55 gossmap: insert temporary per-caller flag to turn off private gossip.
This lets us convert one user at a time.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell 1d9a6d1efa pyln-testing: when waiting for active channel, make sure remote has sent fee info.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell c3f33eb6dd listpeerchannels: show gossip updates.
This is redundant if it's a public channel, but vital if it's not.  Publishing unconditionally makes
it easier for gossmap: we create a local modification all the time, even if redundant (and we can
have the actual capacity ceiling accurate in this case, since we know it for local channels).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Changelog-Added: JSON-RPC: `listpeerchannels` now shows gossip update contents (even if channel unannounced).
2023-12-14 09:16:56 +10:30
Rusty Russell 5583f730de gossipd: always send information about our channels' gossip updates.
Not just when it's a private channel.  This is useful for listpeerchannels in the next patch.
Most of this is renaming.

It also means that source can be NULL, so move it out of the struct and put it in the message,
where it logically belongs, and make it an optional field.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Alex Myers 8e897746e2 gossipd: pass remote private channel update to ld
and stash in the database.

Rusty: I added the bad gossip message so we would see unknown updates in CI, and made sure we don't send our own generated updates to lightningd.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Alex Myers c1beb4b745 db: add private channel inbound fields
This will be used for generating route hints rather than private gossip
2023-12-14 09:16:56 +10:30
Alex Myers 014cc46328 gossipd: correctly attribute our own channel update to ourselves 2023-12-14 09:16:56 +10:30
Alex Myers a8995caa8b pytest: use wait_local_channel_active 2023-12-14 09:16:56 +10:30
Rusty Russell 674684369f common: prepare unit tests for lack of private channels.
Created a new canned gossmap without private channels, updated tests.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell a12e41a930 compiler: fix for -O3 errors.
CI revealed one:

```
cc plugins/libplugin-pay.c
plugins/libplugin-pay.c: In function ‘payment_getroute’:
plugins/libplugin-pay.c:888:17: error: ‘errstr’ may be used uninitialized [-Werror=maybe-uninitialized]
  888 |                 payment_fail(p, "%s", errstr);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
plugins/libplugin-pay.c:851:21: note: ‘errstr’ was declared here
  851 |         const char *errstr;
      |                     ^~~~~~
cc1: all warnings being treated as errors
```

My local compiler gave another:

```
channeld/channeld.c: In function ‘resume_splice_negotiation’:
channeld/channeld.c:3734:23: error: ‘final_tx’ may be used uninitialized [-Werror=maybe-uninitialized]
 3734 |                 msg = towire_channeld_splice_confirmed_signed(tmpctx, final_tx,
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 3735 |                                                               chan_output_index);
      |                                                               ~~~~~~~~~~~~~~~~~~
channeld/channeld.c:3461:28: note: ‘final_tx’ was declared here
 3461 |         struct bitcoin_tx *final_tx;
      |                            ^~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:298: channeld/channeld.o] Error 1
```

So fix both.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Erik De Smedt a48e2258c7 Implement `is_some` for `cln_rpc::options::Value`
Can be used to check if a configuration is set
2023-12-12 17:17:10 +01:00
Erik De Smedt c404ebedcc Doc: Formatting
Fixed formatting of json.

Combination of tabs and spaces made the json looks bad on
my device
2023-12-12 16:53:59 +01:00
Erik De Smedt acce3b1b32 Fix docs for invoice_payment hook and notification
The data-format changed in 2019.
The field `amount_msat` was renamed to `msat`
(See 2907e430d5)

The data-format changed again in november 2023.
The content of the field `amount_msat` was changed.
It was a string `"1000msat"` and became a number `1000`.
(See 0b23133ab2)

The current documentation still mentions the data-format before
2907e430d5.

I've updated the docs to reflect the latest changes.
I've also incluced a short mention of 0b23133ab2 to help help
developers create plugins that work both pre 23.11 and post 23.11.
2023-12-12 16:53:59 +01:00
ShahanaFarooqui 4d22f5af2d doc: Documentation update
- Separated Docker documentation from repro builds
- Separated release checklist documentation from contributor workflow
2023-12-12 16:31:44 +01:00
ShahanaFarooqui 78518344f4 docker: Creating docker `latest` image
- Create docker multiarch image with/without push
- Create docker latest image and publish if asked

Changelog-None
2023-12-12 16:31:44 +01:00
Christian Decker a9aa93d822 subd: Do not send feerate updates to non-channeld subds
Turns out we were sending feerate updates to daemons that do not
understand it. Don't do that!

Closes #6932

Changelog-Fixed: channeld: We could crash `closingd` by sending it a `channeld` message
2023-12-12 16:27:56 +01:00
Alex Myers b0377d2323 misc: Add Alex's gpg key
Changelog-None
2023-12-11 18:46:43 +01:00
ShahanaFarooqui f89e91332f misc: Add Shahana's gpg key
Changelog-None
2023-12-11 18:46:31 +01:00
Alex Myers 9585b7c238 startup_regtest: test for clnrest dependencies before writing config 2023-12-05 20:31:42 -06:00