17611 Commits

Author SHA1 Message Date
Se7enZ
70fe02513c build: Replace PLUGIN_RENEPAY_HDRS json.c with json.h in Makefile. 2026-01-24 09:40:49 +10:00
Se7enZ
ee94ba3df9 devtools: Add clang-format to pre-commit. 2026-01-24 09:40:49 +10:00
Se7enZ
2bc67c37c4 doc: Add pre-commit section to Contributor Workflow documentation. 2026-01-24 09:40:49 +10:00
Se7enZ
854dec008e devtools: Add pre-commit as a dev Python package. 2026-01-24 09:40:49 +10:00
Se7enZ
27482957a9 devtools: Add fix-style-errors script by @sangbida.
A helper tool to fix code style errors using `ruff` and `clang-format`
and correct spelling.
2026-01-24 09:40:49 +10:00
Se7enZ
e91625a68b devtools: Add EOF fixer and trailing whitespace fix to pre-commit. 2026-01-24 09:40:49 +10:00
Se7enZ
a22ba9ba52 devtools: Add doc JSON schema checks and formatting to pre-commit. 2026-01-24 09:40:49 +10:00
Se7enZ
969bd22d2f devtools: Add codespell to pre-commit.
Includes default config file and an initial word list to ignore.
2026-01-24 09:40:49 +10:00
Se7enZ
6e50148bcd devtools: Add discouraged function check to pre-commit.
Reimplements `make check-discouraged-functions` for Python regex.
2026-01-24 09:40:49 +10:00
Se7enZ
a04fdb74d9 devtools: Add amount access check to pre-commit.
Reimplements `make check-amount-access` for Python regex.
2026-01-24 09:40:49 +10:00
Se7enZ
98c149c797 devtools: Add shellcheck to pre-commit. 2026-01-24 09:40:49 +10:00
Rusty Russell
d5f66ceabc plugins: don't try to fetch max-locktime-blocks.
It was removed in v25.09, so this code is useless.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-01-20 19:32:42 +10:30
Rusty Russell
95d876011a lightningd: remove support for long-deprecated old-style feerate responses.
This was supposed to be removed in v24.05.  Finally remove it now.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: lightningd: `estimatefeesv1` support for older bcli plugins (deprecated v23.05, disabled by default v24.05).
2026-01-20 19:32:42 +10:30
Rusty Russell
f8ef6e143b lightningd: removing comment insisting plugin hooks are an array of objects, not names.
This was changed in v0.9.2 (November 2020), with a comment saying to remove.

But it turns out that the rust plugin support still uses the old
method (found this by removing it and watching everything fail!).  So
simply undeprecate and document.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-01-20 19:32:42 +10:30
Rusty Russell
983146791a lightningd: remove tx and txid fields from close response.
Changelog-Removed: JSON-RPC: `close` `tx` and `txid` field (use `txs` and `txids`), deprecated v24.11.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-01-20 19:32:42 +10:30
Rusty Russell
592f8586f4 lightningd: remove decodepay.
Changelog-Removed: JSON-RPC: `decodepay` (use `decode`), deprecated v24.11.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-01-20 19:32:42 +10:30
Rusty Russell
9881e04636 lightningd: remove the "listpeers.features.option_anchors_zero_fee_htlc_tx" option.
Everyone should be using the new name.

Changelog-Removed: JSON-RPC: `listpeers` `features` array string "option_anchors_zero_fee_htlc_tx": use "option_anchors" (spec renamed it). Deprecated in 24.08.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-01-20 19:32:42 +10:30
Rusty Russell
af1c9640b5 hsmd: remove unused "sign_local_htlc_tx" function which onchaind used to use.
I tried removing sign_penalty_to_us, but that comment is wrong: channeld
uses that for the watchtower, so it stays (with updated comment).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-01-20 19:32:42 +10:30
Rusty Russell
bcce29eeb0 connectd: remove unused flag to connect_init.
We haven't announced websocket addresses for some time!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-01-20 19:32:42 +10:30
Rusty Russell
ee0175b85f Makefile: update next and prev versions now we've released.
This means:
1. downgrade changes (we no longer fail due to node biases).
2. various deprecations no longer are

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-01-20 19:32:42 +10:30
Rusty Russell
3af6fd2f30 doc: fix end deprecation date of max_htlc_value_in_flight_msat.
The code had this as 26.03, but the documentation said 26.06.  The
usual deprecation period is a year, so I'm changing the documentation.
Unfortunately the documentation (fe4d5036c2) was updated separately
from the code (afb54ff8e8), so this wasn't obvious at the time!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-01-20 19:32:42 +10:30
Rusty Russell
9081499b0e libplugin: fix 'i-promise-to-fix-broken-api-user' parsing.
This is important for the first xpay deprecation end-of-life!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-01-20 19:32:42 +10:30
Rusty Russell
c8525a1322 git: correctly mark contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py for binary diffs.
The giant text lines make emacs ... run... slowly.  Finally got around to fixing it
to see that it had already been done, just not updated!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-01-20 19:32:42 +10:30
ShahanaFarooqui
9655f53194 script: More error checks and logging 2026-01-20 15:22:31 +10:30
ShahanaFarooqui
58a620aa88 script: API v2 accepts position param rather than order 2026-01-20 15:22:31 +10:30
ShahanaFarooqui
15081de19f script: Change category slug for better Admin panel management 2026-01-20 15:22:31 +10:30
ShahanaFarooqui
79ffb3a7ab doc: Update json and markdowns to make them .mdx compatible
readme v2 API expects files to be .mdx compatible.
2026-01-20 15:22:31 +10:30
ShahanaFarooqui
6a1f467d3f doc: Add signmessagewithkey to generate documentation
And sorted list with file name.
2026-01-20 15:22:31 +10:30
Christian Decker
eae521b15d chore: Ensure the logging library does not get upset when output capture is disabled.
Changelog-Fixed: Testing infrastructure no longer fails when logging output capture is disabled.
2026-01-20 15:05:07 +10:30
Christian Decker
49049deb82 testing: Add TEST_LOG_IGNORE_ERRORS envvar to suppress logging errors 2026-01-20 15:05:07 +10:30
daywalker90
d03cf820a8 clnrest: add clnrest-register-path method for dynamic paths
Changelog-Added: clnrest: add clnrest-register-path rpc method to register dynamic paths
2026-01-19 12:55:57 +10:30
daywalker90
8bc2e76f44 msggen: add string_map type 2026-01-19 12:55:57 +10:30
ShahanaFarooqui
ec7d247f38 docker: Added fixed SOURCE_DATE_EPOCH flag for reproducible Fedora build
- Using environment variable `SOURCE_DATE_EPOCH` with fixed value will enforce a consistent timestamp for Fedora build.
. Similar to Ubuntu fix in commit 490fb0fc3b
- Locked cargo version
- Add `no-cache` to Fedora build

Changelog-Fixed: Core lightning builds for Fedora on all systems are deterministic.
2026-01-16 12:34:03 -08:00
ShahanaFarooqui
12ccfb5c65 script: Add Fedora as target for SHASUMS verification 2026-01-16 12:34:03 -08:00
Alex Myers
9e490942af contrib: ignore cache when rebuilding docker builder images
This caused issues when dependencies were updated do to cached
images continuing to be used.

Changelog-None
2026-01-15 18:31:11 -08:00
ShahanaFarooqui
ae0e10875c doc: Update installation instruction on Fedora 2026-01-15 17:10:27 -08:00
ShahanaFarooqui
3f7565a3d2 docker: Update Fedora base image to 40
- Upgraded Fedora base image from 35 to 40. The existing Cargo failures were caused by the outdated Rust toolchain in Fedora 35. Cargo lockfile format v4 was introduced in Cargo 1.84 (December 2024), while Fedora 35 provides a Rust/Cargo version from roughly 2021–2022. As a result, the system Cargo could not parse modern Cargo.lock files, making it incompatible with current Rust projects.

- Added missing build dependencies to the Dockerfile, most notably the protobuf compiler (protoc).

Changelog-None: Upgraded Fedora version to 40 for reproducible build.
2026-01-15 17:10:27 -08:00
Rusty Russell
29465f5240 wallet: use correct derivation for elements when using mnemonic hsm_secret.
Even though we don't do taproot addresses on elements yet, use the
same scheme for simplicity and for future when we *do* do taproot.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-01-14 17:18:56 +10:30
Sangbida Chaudhuri
0269d0c0c9 jsonrpc: fix recover command for BIP86 wallets
The recover command checks if a node has already issued bitcoin
addresses before allowing recovery. This check only looked at
bip32_max_index, but with BIP86 wallets, newaddr() increments
bip86_max_index instead.

Also, the recover test asserted on hex but now it's asserting on codex32 instead. We should probably go in and fix the end point. @rustyrussell what do you think?
2026-01-14 17:18:56 +10:30
Sangbida Chaudhuri
e19fd5d62c wallet: change dev_listaddrs to also list bip86 addresses
listaddrs is dev only and used in tests so it's okay if we change the API here, the usage is by positional arguments in tests so we're okay. Also changing est_option_upfront_shutdown_script to handle both old hsmsecret and the newer mnemonic one.
2026-01-14 17:18:56 +10:30
Sangbida Chaudhuri
5fdc56c544 wallet/hsmd: fix signmessagewithkey for BIP86 wallets
The signmessagewithkey RPC was failing for BIP86 (mnemonic-based)
wallets because:

1. The wallet RPC was iterating through BIP32-derived addresses only,
   so it couldn't find BIP86-derived addresses.

2. The HSM's handle_bip137_sign_message always used bitcoin_key()
   (BIP32 derivation) regardless of wallet type.
2026-01-14 17:18:56 +10:30
Sangbida Chaudhuri
c17590379e lightningd: use BIP86 derivation in p2wpkh_for_keyidx when available
When a peer doesn't support OPT_SHUTDOWN_ANYSEGWIT, we fall back to P2WPKH for the shutdown script. For BIP86 wallets, we need to use bip86_pubkey for derivation (matching p2tr_for_keyidx), otherwise the resulting script won't be recognized after restart.
2026-01-14 17:18:56 +10:30
Sangbida Chaudhuri
4106a212ec lightningd: add p2wpkh script for bip86 base
A bech32 address can be generated from a bip86 base so we should add both script types (p2wpkh, p2tr) to the txfilter for bip86 bases.
2026-01-14 17:18:56 +10:30
Sangbida Chaudhuri
4b1f2a079e lightningd: use BIP86 derivation for P2TR in HTLC rebroadcast change outputs 2026-01-14 17:18:56 +10:30
Sangbida Chaudhuri
fa96b60113 lightningd: use bip86 derivation for anchor spend change outputs 2026-01-14 17:18:56 +10:30
Sangbida Chaudhuri
bf43fbb7cc lightningd: Fix penalty tx output derivation for BIP86 wallets
When using the new BIP39 mnemonic HSM secret format, the wallet uses
BIP86 derivation for taproot addresses. However, onchaind_tx_unsigned() was always using bip32_pubkey() to derive the final key for penalty transaction outputs.
2026-01-14 17:18:56 +10:30
Rusty Russell
9b85ce7b03 hsmd: fix derivation for non-taproot addresses in modern mnemonic (25.12+) nodes.
This is a fix from https://github.com/rauaap who correctly diagnosed the problem:

```
Error broadcasting transaction: error code: -26\nerror message\nmempool-script-verify-flag-failed (Script failed an OP_EQUALVERIFY operation), input 0 of ...
```

The decision to use the changed derivation for all addresses, not just
taproot, came up during review.  Unfortunately, the signing code
(here) was not changed to match the address generation code (in the
wallet).

Reported-by: https://github.com/postanissue
Fixes: https://github.com/ElementsProject/lightning/issues/8804
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: lightningd: we now correctly sign for non-taproot addresses given by nodes created by v25.12 or newer.
2026-01-14 17:18:56 +10:30
Rusty Russell
d2123a94a5 lightning-hsmtool: fix dumponchaindescriptors for mnemonic hsm_secrets.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: `lightning-hsmtool`: handle mnemonic hsm_secret files (nodes created >= v25.12).
2026-01-14 17:18:56 +10:30
Rusty Russell
9c6430c076 plugins/pay: don't crash if erring index is past route array end.
I assume this happens with multi-hop routehints?

```
1768169599027	2026-01-11T22:13:19.027Z	pay: plugins/libplugin-pay.c:1199: payment_result_infer: Assertion `i <= len' failed.
1768169599027	2026-01-11T22:13:19.027Z	pay: FATAL SIGNAL 6 (version 25.12)
1768169599036	2026-01-11T22:13:19.036Z	0x5562816bcaa4 send_backtrace
1768169599036	2026-01-11T22:13:19.036Z		common/daemon.c:38
1768169599036	2026-01-11T22:13:19.036Z	0x5562816bcb40 crashdump
1768169599036	2026-01-11T22:13:19.036Z		common/daemon.c:83
1768169599036	2026-01-11T22:13:19.036Z	0x7f5fca29d32f ???
1768169599036	2026-01-11T22:13:19.036Z		???:0
1768169599036	2026-01-11T22:13:19.036Z	0x7f5fca2f6b2c ???
1768169599036	2026-01-11T22:13:19.036Z		pthread_kill+0x11c:0
1768169599036	2026-01-11T22:13:19.036Z	0x7f5fca29d27d ???
1768169599036	2026-01-11T22:13:19.036Z		gsignal+0x1d:0
1768169599036	2026-01-11T22:13:19.036Z	0x7f5fca2808fe ???
1768169599036	2026-01-11T22:13:19.036Z		abort+0xde:0
1768169599036	2026-01-11T22:13:19.036Z	0x7f5fca28081a ???
1768169599036	2026-01-11T22:13:19.036Z		???:0
1768169599036	2026-01-11T22:13:19.036Z	0x7f5fca293516 ???
1768169599036	2026-01-11T22:13:19.036Z		__assert_fail+0x46:0
1768169599037	2026-01-11T22:13:19.037Z	0x5562816ae9f6 payment_result_infer
1768169599037	2026-01-11T22:13:19.037Z		plugins/libplugin-pay.c:1199
1768169599037	2026-01-11T22:13:19.037Z	0x5562816b4acd payment_waitsendpay_finished
1768169599037	2026-01-11T22:13:19.037Z		plugins/libplugin-pay.c:1653
1768169599037	2026-01-11T22:13:19.037Z	0x5562816aca60 handle_rpc_reply
1768169599037	2026-01-11T22:13:19.037Z		plugins/libplugin.c:1062
1768169599037	2026-01-11T22:13:19.037Z	0x5562816acc86 rpc_conn_read_response
1768169599037	2026-01-11T22:13:19.037Z		plugins/libplugin.c:1377
1768169599037	2026-01-11T22:13:19.037Z	0x5562816f0e87 next_plan
1768169599037	2026-01-11T22:13:19.037Z		ccan/ccan/io/io.c:60
1768169599037	2026-01-11T22:13:19.037Z	0x5562816f1358 do_plan
1768169599037	2026-01-11T22:13:19.037Z		ccan/ccan/io/io.c:422
1768169599037	2026-01-11T22:13:19.037Z	0x5562816f1415 io_ready
1768169599037	2026-01-11T22:13:19.037Z		ccan/ccan/io/io.c:439
1768169599037	2026-01-11T22:13:19.037Z	0x5562816f2e23 io_loop
1768169599037	2026-01-11T22:13:19.037Z		ccan/ccan/io/poll.c:470
1768169599037	2026-01-11T22:13:19.037Z	0x5562816ae114 plugin_main
1768169599037	2026-01-11T22:13:19.037Z		plugins/libplugin.c:2429
1768169599037	2026-01-11T22:13:19.037Z	0x5562816a894c main
1768169599037	2026-01-11T22:13:19.037Z		plugins/pay.c:1581
1768169599037	2026-01-11T22:13:19.037Z	0x7f5fca2821c9 ???
1768169599037	2026-01-11T22:13:19.037Z		???:0
1768169599037	2026-01-11T22:13:19.037Z	0x7f5fca28228a ???
1768169599037	2026-01-11T22:13:19.037Z		__libc_start_main+0x8a:0
1768169599037	2026-01-11T22:13:19.037Z	0x5562816a4eb4 ???
1768169599037	2026-01-11T22:13:19.037Z		_start+0x24:0
1768169599037	2026-01-11T22:13:19.037Z	0xffffffffffffffff ???
1768169599037	2026-01-11T22:13:19.037Z		???:0
1768169599136	2026-01-11T22:13:19.136Z	2026-01-11T22:13:19.136Z INFO    plugin-pay: Killing plugin: exited during normal operation
69599136	2026-01-11T22:13:19.136Z	2026-01-11T22:13:19.136Z **BROKEN** plugin-pay: Plugin marked as important, shutting down lightningd!
```

Reported-by: michael1011
Fixes: https://github.com/ElementsProject/lightning/issues/8828
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: plugins: `pay` can crash on errors returned from deep inside routehints.
2026-01-14 17:06:02 +10:30
Rusty Russell
35e703bfe1 askrene: don't crash if refining flow which has capacity greaater than max it should have.
```
1767724611265   2026-01-06T18:36:51.265Z                plugins/libplugin.c:1073
1767724611265   2026-01-06T18:36:51.265Z        0x55fc0c1428ac handle_rpc_reply
1767724611264   2026-01-06T18:36:51.264Z                plugins/askrene/askrene.c:801
1767724611264   2026-01-06T18:36:51.264Z        0x55fc0c13174c listpeerchannels_done
1767724611264   2026-01-06T18:36:51.264Z                plugins/askrene/askrene.c:669
1767724611264   2026-01-06T18:36:51.264Z        0x55fc0c130f55 do_getroutes
1767724611264   2026-01-06T18:36:51.264Z                plugins/askrene/mcf.c:1636
1767724611264   2026-01-06T18:36:51.264Z        0x55fc0c138bd7 default_routes
1767724611264   2026-01-06T18:36:51.264Z                plugins/askrene/mcf.c:1415
1767724611264   2026-01-06T18:36:51.264Z        0x55fc0c1382ec linear_routes
1767724611264   2026-01-06T18:36:51.264Z                plugins/askrene/refine.c:510
1767724611264   2026-01-06T18:36:51.264Z        0x55fc0c13b110 refine_flows
1767724611264   2026-01-06T18:36:51.264Z                plugins/askrene/refine.c:449
1767724611264   2026-01-06T18:36:51.264Z        0x55fc0c13ac9f increase_flows
1767724611264   2026-01-06T18:36:51.264Z                abort+0xde:0
```

Fixes: #8823
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: plugins: `askrene` can crash on a corner case in increase_flows.
2026-01-14 17:06:02 +10:30