Commit Graph

14861 Commits

Author SHA1 Message Date
ShahanaFarooqui
c9c1df6710 script: Added caching option for docker publish and shellcheck fixes
Changelog-None.
2024-06-13 11:43:37 +09:30
Rusty Russell
11586abf79 CHANGELOG.md: make more consistent.
1. Plugin things should all be prefixed by `Plugins:` then the name of the plugin altered.
2. New config options should always be named in CHANGELOG.md!
3. Unify groups of changes into a single line, in this case, GRPC.
4. Command, plugin and option names are in backticks.
5. Offers changes are still under EXPERIMENTAL.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-06-04 20:23:24 -05:00
Alex Myers
36367ca0d9 meta: update changelog for v24.05
Changelog-None
2024-06-04 20:23:24 -05:00
Alex Myers
b17bc9cc69 meta: bump rust versions for 24.05 release 2024-06-04 20:23:24 -05:00
Rusty Russell
107fc8b9fb gossipd: fix crash when processing pending node_announcements.
When we process pending channel updates, it can cause the node_announcement
to be moved.  Then, we process a new node_announcement and go to delete
the old one, but it's already moved!

Do the obvious thing, and refresh gossmap if necessary each time around
the loop.

```
2024-05-17T02:56:12.701Z **BROKEN** gossipd: gossip_store: get delete entry offset 554921761/585584347 (version v24.02.1-151-g6e2ab02-modded)
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: common/daemon.c:38 (send_backtrace) 0x55b4c962518b
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: common/status.c:221 (status_failed) 0x55b4c962e83e
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: gossipd/gossip_store.c:466 (gossip_store_get_with_hdr) 0x55b4c961b6e3
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: gossipd/gossip_store.c:491 (check_msg_type) 0x55b4c961b75d
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: gossipd/gossip_store.c:509 (gossip_store_set_flag) 0x55b4c961b8e0
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: gossipd/gossip_store.c:561 (gossip_store_del) 0x55b4c961bb26
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: gossipd/gossmap_manage.c:913 (process_node_announcement) 0x55b4c961c472
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: gossipd/gossmap_manage.c:1111 (reprocess_queued_msgs) 0x55b4c961d6a6
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: gossipd/gossmap_manage.c:670 (gossmap_manage_handle_get_txout_reply) 0x55b4c961d840
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: gossipd/gossipd.c:585 (recv_req) 0x55b4c9619e6a
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: common/daemon_conn.c:35 (handle_read) 0x55b4c9625436
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: ccan/ccan/io/io.c:59 (next_plan) 0x55b4c96b8506
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: ccan/ccan/io/io.c:407 (do_plan) 0x55b4c96b898d
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: ccan/ccan/io/io.c:417 (io_ready) 0x55b4c96b8a26
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: ccan/ccan/io/poll.c:453 (io_loop) 0x55b4c96ba315
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: gossipd/gossipd.c:683 (main) 0x55b4c961a84c
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: ../csu/libc-start.c:308 (__libc_start_main) 0x7f3931a3dd09
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: (null):0 ((null)) 0x55b4c9616d39
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: (null):0 ((null)) 0xffffffffffffffff
2024-05-17T02:56:12.702Z **BROKEN** gossipd: STATUS_FAIL_INTERNAL_ERROR: gossip_store: get delete entry offset 554921761/585584347
```

Reported-by: Vincenzo Palazzo
Fixes: https://github.com/ElementsProject/lightning/issues/7320
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-06-04 08:09:54 -05:00
ShahanaFarooqui
3dc6e6d29e script: Add reproducible build script for Ubuntu v24.04
This PR will help in publishing CLN reproducible binaries for Ubuntu v24.04 (noble).

Please note that I adjusted Dockerfiles for focal and jammy also to keep the base image creation script same for all three images. The step update was required because `noble` only runs with ubuntu:noble setup.

Changelog-None.
2024-06-03 14:23:36 -05:00
ShahanaFarooqui
fbd454bd31 docs: Update chat links
- Added badges for BoL2, Telegram and Discord.
- rearranged chat links.
2024-05-31 09:43:18 +09:30
Alex Myers
f109bc27e1 meta: update changelog for 24.05rc2 2024-05-29 20:16:44 -05:00
Rusty Russell
818cf06139 common: translate legacy onion payloads.
We do this by literally creating the modern-style TLV, and pretending we found it in the onion.

This isolates us from messing with any callers, who don't even know.

Co-programmed-with: Alex Myers <alex@endothermic.dev>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fixes: https://github.com/ElementsProject/lightning/issues/7347
Changelog-Fixed: Protocol: forward legacy non-TLV onions which we removed in 22.11 and spec itself in Feb 2022.  Still sent by LND nodes who haven't seen our node_announcement.
2024-05-29 12:40:01 -05:00
Rusty Russell
a4732177bb pytest: test for forwarding legacy onion.
This fails, because l2 can't decode the onion:

```
lightningd-2 2024-05-28T21:43:35.137Z DEBUG   0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-chan#1: Rejecting their htlc 0 since onion is unprocessable WIRE_INVALID_ONION_HMAC ss=4202c24ea44d9029a2ea3abb24cded51da93164f8bb5cddce9cc824af9945435
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-29 12:40:01 -05:00
Rusty Russell
288c47483f lightningd: pay dev_legacy_hop arg to make second-last onion a v0.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-29 12:40:01 -05:00
Rusty Russell
f26b140acb common: re-add legacy v0 hop generation to Sphinx for testing.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-29 12:40:01 -05:00
Rusty Russell
1d4783a756 lightningd: send CHANNEL_REESTABLISH ourselves on closed channels.
We used to fire up channeld to send this, but:
1. That's silly, we have all the information to make it ourselves.
2. We didn't do it if there was an error on the channel, which as of 24.02
   there always is!
3. When it did work, running channeld *stops* onchaind, indefinitely slowing recovery.

Fixes: https://github.com/Blockstream/greenlight/issues/433
Changelog-Fixed: Protocol: we once again send CHANNEL_REESTABLISH responses on closing channels.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-29 12:39:20 -05:00
Rusty Russell
f9e7d5653a pytest: test that we get REESTABLISH msg reply on closed channels.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-29 12:39:20 -05:00
Aditya Sharma
4789eb9fa0 chanbackup: typo fix. 2024-05-29 10:34:58 -05:00
ShahanaFarooqui
43f4e12cde docs: Type change for request amount too
For multifund and openchannel_init schemas, request_amt type is also `sat`.
2024-05-28 09:49:17 -05:00
daywalker90
0eb65e4bb5 schemas: use sat and sat_or_all again where appropiate
Changelog-None
2024-05-28 09:49:17 -05:00
Rusty Russell
964c0732cf pytest: remove xfail in test (accidental commit?)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-28 09:42:36 -05:00
ShahanaFarooqui
7f5282aa65 docker: Add missing git dependency for Fedora Dockerfile
Fedora image building by build-release.sh currently throws error ` git: command not found`.

Fixed it by adding git in the Dockerfile and loading the image in the script.

Changelog-None.
2024-05-24 15:07:39 -05:00
ShahanaFarooqui
0a163c456f docker: Adding Docker release action 2024-05-24 14:45:31 -05:00
Alex Myers
c9f7b78473 meta: update python versions to 24.05
Changelog-None
2024-05-23 18:09:03 -05:00
Alex Myers
d9213c305b Meta: update the changelog for 24.05rc1 2024-05-23 18:09:03 -05:00
Se7enZ
21a27cef16 doc: Including docs references for addpsbtoutput where it seems to be missing 2024-05-23 15:55:57 -05:00
Se7enZ
e5a1d9331f msggen: Include AddPsbtOutput to RPC list and meta field map; regenerate libraries 2024-05-23 15:55:57 -05:00
Lagrang3
428b23c975 renepay: relax knowledge mod
Add a payment mod that relaxes the knowledge of the uncertainty network
as a function of time.

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
2024-05-23 15:15:57 -05:00
Lagrang3
2664faea38 renepay: put global variables into renepayconfig.h
Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
2024-05-23 15:15:57 -05:00
Rusty Russell
6b91497223 common: make gossmap ignore redundant channel_announcements.
This seems to be happening to some people, so don't panic.  Unfortunately we don't have
a good error callback here, so msg to stderr.

Fixes: https://github.com/ElementsProject/lightning/issues/7249
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-23 20:23:36 +02:00
Rusty Russell
744116e501 gossipd: make extra-sure we don't put in redundant channel_announcement messages.
We only write these in two places: one where we get a message from lightningd about
our own channel, and one where we get a reply from lightningd about a txout check.

The former case we explicitly check that we don't already have it in gossmap, so
add checks to the latter case, and give verbose detail if it's found.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-23 20:23:36 +02:00
nicolas.dorier
369c0c1391 Update Dockerfile and build-release.sh to PR7214 2024-05-23 10:30:15 -05:00
nicolas.dorier
738ddc66cc Use cross compile in dockerfile, fix arm32 support 2024-05-23 10:30:15 -05:00
Rusty Russell
877df5afdd lightningd: don't ignore fee limits on mutual close.
LDK will pick the *upper* limit (see: https://github.com/lightningdevkit/rust-lightning/issues/3014)!

It should not do this, but since you can set a manual range for mutual close, it's probably better to disable this option for close, as it's even more dangerous than documented.

Changelog-Changed: config/JSON: --ignore-fee-limits / setchannel ignorefeelimits no longer applies to mutual close.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fixes: https://github.com/ElementsProject/lightning/issues/7242
2024-05-22 08:26:51 -05:00
Rusty Russell
9556fa5210 pytest: test that ignore-fee-limits doesn't apply for mutual close.
Thought it's intuitive, it's not documented to, and LDK's current behavior makes it quite dangerous to do so.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-22 08:26:51 -05:00
Vincenzo Palazzo
fbecefe5ac offer: fix type to the getchaininfo rpc
This is violate what the docs of getchainfo is telling us that the
last_block_height is a u64.

```
2024-05-17T09:53:23.464Z **BROKEN** plugin-offers: Got error reply to getchaininfo: '{\"error\":{\"code\":-1,\"data\":null,\"message\":\"invalid type: string \\\"0\\\", expected u64\"},\"id\":\"init/offers:getchaininfo#1\",\"jsonrpc\":\"2.0\"}\n\n'
2024-05-17T09:53:23.496Z INFO    plugin-offers: Killing plugin: exited before replying to init
2024-05-17T09:53:23.496Z **BROKEN** plugin-offers: Plugin marked as important, shutting down lightningd!
2024-05-17T09:53:23.496Z DEBUG   lightningd: io_break: lightningd_exit
2024-05-17T09:53:23.496Z **BROKEN** plugin-topology: Reading JSON input: Connection reset by peer
2024-05-17T09:53:23.504Z INFO    plugin-topology: Killing plugin: exited before replying to init
2024-05-17T09:53:23.504Z **BROKEN** plugin-topology: Plugin marked as important, shutting down lightningd!
2024-05-17T09:53:23.504Z DEBUG   lightningd: io_break: lightningd_exit
2024-05-17T09:53:23.504Z DEBUG   plugin-bookkeeper: Setting up database at sqlite3://accounts.sqlite3
2024-05-17T09:53:23.504Z DEBUG   connectd: REPLY WIRE_CONNECTD_START_SHUTDOWN_REPLY with 0 fds
2024-05-17T09:53:23.504Z DEBUG   lightningd: io_break: connectd_start_shutdown_reply
```

Fixing the following crash

```
Got error reply to getchaininfo: '{"error":{"code":-1,"data":null,"message":"invalid type: string \"0\", expected u64"},"id":"init/offers:getchaininfo#1","jsonrpc":"2.0"}

'lightningd: lightningd already running? Error locking PID file: Resource temporarily unavailable
```

Fixes: 847208f5d8
Changelog-None: offer: fix type to the getchaininfo rpc
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2024-05-22 07:46:39 -05:00
Vincenzo Palazzo
4b4516c67c bcli: make last height optional
This is on me, and the last height is optional, and not required,
because sometimes you do not want wait the sync of the blockchain
but just get the information of the current status.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2024-05-22 07:46:39 -05:00
ShahanaFarooqui
037d269a58 doc: Updating python grpcio-tool dependency
Issue: rpc documentation on the readme server is not being updated.

It is an extension of PR #7326 to fix runtime error from github actions.

Changelog-None.
2024-05-21 20:10:13 -05:00
Aditya Sharma
7fa2e9bc60 wallet: recoverchannel RPC only stubs a channel if the id is vacant in the DB as well. Closed channels are not loaded inside the peer struct, hence find_channel_by_id fails when the id is occupied by a closed channel. So we need to create a function to directly check if the ID is occupied or not. 2024-05-21 19:21:10 -05:00
ShahanaFarooqui
425b3b02e6 doc: Adding manual trigger event
Issue: rpc documentation on the readme server is not being updated.

Updating the path from `doc/**.md` to `doc/schemas/lightning-*.json` for triggering the action because all `doc/*.7.md` files are fully generated by the `tools/fromschema.py` now.

Added manual trigger event for readme's documentation update.

Changelog-None.
2024-05-21 17:43:09 -05:00
ShahanaFarooqui
8a0a9a48f1 doc: listpeerchannel typo and description fix
Suggested by: @evansmj

In Draft PRs:
7155: doc: Clarify listpeerchannels documentation.
7156: doc: Fix two typos in documentation and schema descriptions
2024-05-21 17:43:09 -05:00
Lagrang3
abfcc9bc5d renepay: clean unit tests
Delete temporary gossmap files after unit tests completion.

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
2024-05-20 16:58:49 -05:00
Lagrang3
638fff8526 renepay: fix memleak in CI
Keep a double-entry record of pending routes so that we can flag them as
not memory leaks.

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
2024-05-20 16:58:49 -05:00
Lagrang3
4b8d9116de renepay: test channel capacity unavailable
Add a test that checks `get_route` and `uncertainty_update` behaviour's
handling of missing channel capacities.

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
2024-05-20 16:58:49 -05:00
Alex Myers
d30b1c8dc2 unit-test: update mocks 2024-05-20 16:58:49 -05:00
Niklas Gögge
123166790f common: Fix off-by-one in from_bech32_charset
`bech32_charset_rev` is only 128 bytes in size but the `c < 0 || c > 128` check allows for `c` to be equal to 128 which would be out-of-bounds. Fix this off-by-one bug by changing the check to `c >= 128`.
2024-05-18 10:02:43 +02:00
Rusty Russell
7040d49242 renepay: fix 32-bit compilation.
```
plugins/renepay/mods.c: In function 'payment_continue':
plugins/renepay/mods.c:63:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
   63 |       (u64)payment_virtual_program[payment->exec_state++];
      |       ^
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-17 14:06:36 -05:00
Rusty Russell
e03f56fe39 bcli: fix compilation on 32-bit platforms.
Reported-by: Shahana Farooqui
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-17 14:06:36 -05:00
Alex Myers
8a2d6fa644 doc: update rpc docs before pushing to readme
Now that our rpc documenation is generated from schema, we need to build
the docs before trying to update the rdme contents.  The goal is to fix
the following issue with the rdme-rpc-sync workflow:

Run python .github/scripts/sync-rpc-cmds.py
lightning-addgossip		lightning-addgossip.7.md
Traceback (most recent call last):
  File .github/scripts/sync-rpc-cmds.py, line 92, in <module>
    main()
  File .github/scripts/sync-rpc-cmds.py, line 82, in main
    with open(doc/ + file) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'doc/lightning-addgossip.7.md'
2024-05-17 13:56:18 -05:00
Alex Myers
cbf343269b pytest: use reserve_unused_port even more
Uses the NodeFactory method to call reserve_unused_port
which replaced the ephemeral_port_reserve function. This
frees the reserved ports at teardown.
2024-05-17 13:56:18 -05:00
Vincenzo Palazzo
b5cfd981a1 docs: adds documentation about the log notification
Changelog-None: docs: adds documentation about the log notification
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2024-05-17 13:03:12 -05:00
Vincenzo Palazzo
ce70167ead core: notify plugins when a log line is emitted.
Currently make a plugin that do reportings of logs on
a services like graphana is not possible. So this commit
include the possibility to write a plugin that do the report
of this analisys.

Changelog-Added: core: notify plugins when a log line is emitted.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2024-05-17 13:03:12 -05:00
daywalker90
5430b65b4c msggen: add checkrune method 2024-05-17 16:30:43 +02:00