Commit Graph

16446 Commits

Author SHA1 Message Date
ShahanaFarooqui
87d862992a doc: Remove c-lightning-REST documentation
Changelog-None
2025-07-10 15:51:42 +09:30
Rusty Russell
89c4201918 plugins/sql: fix doc formatting for tables with multiple indices.
Before vs after:

   - `forwards` indexed by `in_channel and in_htlc_id` (see lightning-listforwards(7))
   - `forwards` indexed by `in_channel` and `in_htlc_id` (see lightning-listforwards(7))

And:
   - `htlcs` indexed by `short_channel_id and id` (see lightning-listhtlcs(7))
   - `htlcs` indexed by `short_channel_id` and `id` (see lightning-listhtlcs(7))

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-07-09 14:13:31 +09:30
Chandra Pratap
de5e4fe9ca fuzz-tests: Add a seed corpus for the new test
Add a minimal input set as a seed corpus for the newly introduced
test. This leads to discovery of interesting code paths faster.
2025-07-08 14:47:36 +09:30
Chandra Pratap
61bf4ffc35 fuzz-tests: Add differential test for HMAC-SHA256
Changelog-None: Add a differential fuzz test for
HMAC-SHA256, similar to those for SHA256 and RIPEMD160,
to verify CCAN’s implementation against OpenSSL’s.
2025-07-08 14:47:36 +09:30
Alex Myers
0e080a1c22 devtools/credit: add aliases of previous namers
It was suggesting past namers as new namers.

Also fixed the count extraction so that @21M4TW would be
properly credited.

Changelog-None
2025-07-08 12:56:17 +09:30
Chandra Pratap
0651b37ae4 fuzz-tests: Add coverage-increasing inputs to seed corpora
Change in the fuzz-testing scheme of fuzz-base32-64 led to
the discovery of test inputs that result in greater in
code-coverage. Add these inputs to the test's seed corpus.
2025-07-08 12:54:56 +09:30
Chandra Pratap
e721b0a89a fuzz-tests: Enhance b64_encode() validation with roundtrip decoding
Changelog-None: Currently, fuzz testing for b64_encode() merely
encodes input and frees the result, providing no real verification
of its behavior.

Introduce a new b64_decode() function (modeled after b32_decode())
and update the fuzz test to perform a roundtrip—encoding followed
by decoding—to ensure that b64_encode() correctly preserves the
original data.
2025-07-08 12:54:56 +09:30
Dusty Daemon
b4d0da5ff4 logs: A basic javascript log viewer
A basic javascript tool for filtering through large CLN log files.

Changelog-Added: A new tool for rendering CLN log files in the browser.
2025-07-08 12:24:24 +09:30
Matt Whitlock
cc0f66f07b hsmtool: implement new "derivetoremote" method
This method has a similar purpose as "guesstoremote" but is for use when
the channel's database ID is known. It produces the private key that can
spend the to_remote output of the peer's commitment transaction. It
assumes the channel was negotiated with option_static_remotekey unless
the optional per-commitment point argument is provided.

Changelog-Added: hsmtool has a new `derivetoremote` method.
2025-07-08 12:21:24 +09:30
Erick Cestari
6724db65de BOLT11: Make payment secret field ('s') mandatory
Make the payment secret field ('s') mandatory for BOLT11 payment requests,
implementing the requirement specified in BOLT11 spec PR #1242
(https://github.com/lightning/bolts/pull/1242).

This security enhancement prevents payment probing attacks by requiring
all invoices to include payment secrets. Changes include:

1. Adding validation in bolt11_decode_nosig() to reject invoices without
   the 's' field
2. Adding payment secrets to all test vectors
3. Updating expected encoded values in test cases to include payment secrets
4. Adding a specific test case that verifies proper rejection of invoices
   missing the payment secret field

Changelog-Changed: Made payment secret ('s' field) mandatory in BOLT11 payment requests for improved security.
2025-07-07 11:18:37 +09:30
Rusty Russell
66b6c111c2 pytest: fix up bolt11 tests to include s field.
It's about to be made compulsory.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-07-07 11:18:37 +09:30
Rusty Russell
2b023be022 bolt11: don't accept wrong-length p, h, s or n fields.
Spec got stricter.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-07-07 11:18:37 +09:30
Rusty Russell
17b3fb5196 common/bolt11: meet the new tighter parsing requirements.
These checks are a SHOULD, but implementing them helps avoid anyone
making such weird things in future.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-07-07 11:18:37 +09:30
Rusty Russell
c0ff1b5768 lightningd: update comments about known preimages for missing HTLC outputs.
Doesn't change anything for us, since we will already fulfull the incoming
HTLCs if we can, but good to note.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-07-07 11:18:37 +09:30
Rusty Russell
9298e5c212 wire: use real peer_storage messages now their format is fixed.
They weren't formatted correctly for bolts/tools/extract-formats.py
until this commit, so we had to patch them in manually.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-07-07 11:18:37 +09:30
Rusty Russell
0cd6efe585 wire: update splice patch to produce expected peer_wire.csv.
Dusty patched peer_wire.csv directly, breaking regeneration `make extract-peer-csv`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-07-07 11:18:37 +09:30
Rusty Russell
d86b88d409 channeld: remove experimental-upgrade-protocol.
It was already disabled by Dusty due to a number conflict with splicing, and
the proposal probably needs updating to use quiescence now that is merged.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: The non-functional `experimental-upgrade-protocol` config option.
2025-07-07 11:18:37 +09:30
Rusty Russell
c50bd381ec doc: recommend injectpaymentonion in place of sendonion.
Among other things, injectpaymentonion insists on knowing the destination
amount_msat.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-06-30 13:23:26 +09:30
Rusty Russell
89f411ca79 doc: be explicit (with tests!) on when we don't know amount_msat for listsendpays.
Sangbida and I traced back through ancient history: when the pay plugin was introduced
in 0.9.0 (2019!) it already used the amount_msat parameter (then called `msatoshi`),
so this case effectively "never happens".

But we added a test for it just in case.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-06-30 13:23:26 +09:30
ShahanaFarooqui
bd743d741e doc: Change commando plugin title
Changelog-None.
2025-06-27 11:08:16 +09:30
ShahanaFarooqui
d52e3c394b doc: Update image on App Development page 2025-06-27 11:08:16 +09:30
ShahanaFarooqui
94bdad19f0 doc: Update json-rpc-api categories due to updated RPC links 2025-06-27 11:08:16 +09:30
ShahanaFarooqui
e5ec688bf4 doc: Fix links to avoid 404 error 2025-06-26 14:21:56 +09:30
ShahanaFarooqui
adbe634453 doc: Update Commando plugin details and link 2025-06-26 14:21:56 +09:30
ShahanaFarooqui
2d73186a1e doc: Move deprecated features page from API reference list to Developer's guide 2025-06-26 14:21:56 +09:30
ShahanaFarooqui
5cc28a84eb docs: Fix script used to update versions in point release instructions
Changelog-None.
2025-06-26 13:58:51 +09:30
Rusty Russell
29230325bd doc: flesh out PR section of coding style guidelines.
Sangbida asked some excellent questions, and rather than answer them once,
I decided to update this document appropriately.  Could probably become
an entire video, TBH.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-06-25 11:21:11 +09:30
Rusty Russell
46fb007ea0 lightningd: remove experimental-anchors / experimental-onion-messages.
Changelog-Removed: Config: `experimental-anchors` and `experimental-onion-messages` (deprecated 24.02 / 24.08, disabled v25.05).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-06-25 09:06:31 +09:30
Rusty Russell
50e4aabe18 commando: remove old commando rune commands.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: JSON-RPC: `commando-rune`, `commando-listrunes`, `commando-blacklist` (deprecated v23.08, disabled v25.05).
2025-06-25 09:06:31 +09:30
Rusty Russell
4fc9856cf2 lightningd: remove clnrest override options.
Changelog-Removed: Config: autodetection for rest-port/rest-protocol/rest-host/rest-certs options to clnrest-* (deprecated v23.11, disabled v25.02).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-06-25 09:06:31 +09:30
Rusty Russell
b3c1728abc lightningd: remove --max-locktime-blocks.
Changelog-Removed: Config: `max-locktime-blocks` (deprecated v24.05, disabled v25.02).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-06-25 09:06:31 +09:30
Rusty Russell
710d632383 Makefile: update CLN_NEXT_VERSION to v25.09.
Hopefully Antoine Poinset won't have to go on a podcast to argue the
merits for this change.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-06-24 09:57:24 +09:30
Rusty Russell
884778635c deprecations: update v26.05 to v26.06.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: Future release schedule moved one month: v25.05 is now v25.06, and all deprecations incremented accordingly.
2025-06-24 09:57:24 +09:30
Rusty Russell
094ac3518f deprecations: update v26.02 to v26.03.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-06-24 09:57:24 +09:30
Rusty Russell
09e03e98ef deprecations: update v25.11 to v25.12.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-06-24 09:57:24 +09:30
Rusty Russell
f69fdd2664 deprecations: update v25.08 to v25.09.
There's only one (but in multiple places!).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-06-24 09:57:24 +09:30
Alex Myers
2b8b709bfd meta: update changelog for v25.05
Changelog-None
2025-06-16 13:10:33 -05:00
Alex Myers
acf935e1c8 github: Update release dates for 25.09
Changelog-None
2025-06-16 13:10:33 -05:00
Rusty Russell
f2f7b6e225 pytest: fix flake in test_anchorspend_using_to_remote
With recent changes, particularly using postgres, we can finish the HTLC before
we force close, so the test fails.  Insert an explicit hangup here so we reliably
get the result we expect:

```
    @pytest.mark.parametrize("anchors", [False, True])
    @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd anchors not supportd')
    def test_anchorspend_using_to_remote(node_factory, bitcoind, anchors):
        """Make sure we can use `to_remote` output of previous close to spend anchor"""
        # Try with old output from both anchor and non-anchor channel.
        l4_opts = {}
        if anchors is False:
            l4_opts['dev-force-features'] = "-23"
    
        l1, l2, l3, l4 = node_factory.get_nodes(4, opts=[{},
                                                         {},
                                                         {'disconnect': ['-WIRE_UPDATE_FULFILL_HTLC']},
                                                         l4_opts])
    
        # Give l2 some funds, from a to-remote output.  It will have to spend
        # this to use anchor.
        node_factory.join_nodes([l4, l2])
    
        # l4 unilaterally closes, l2 gets to-remote with its output.
        l4.rpc.pay(l2.rpc.invoice(100000000, 'test', 'test')['bolt11'])
>       wait_for(lambda: only_one(l4.rpc.listpeerchannels()['channels'])['htlcs'] != [])

tests/test_closing.py:4183: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

success = <function test_anchorspend_using_to_remote.<locals>.<lambda> at 0x7f8293e7fe20>
timeout = 180

    def wait_for(success, timeout=TIMEOUT):
        start_time = time.time()
        interval = 0.25
        while not success():
            time_left = start_time + timeout - time.time()
            if time_left <= 0:
>               raise ValueError("Timeout while waiting for {}".format(success))
E               ValueError: Timeout while waiting for <function test_anchorspend_using_to_remote.<locals>.<lambda> at 0x7f8293e7fe20>

```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-06-13 13:55:31 -05:00
Rusty Russell
6468d439e0 ccan: update for FreeBSD compile fixes.
Also gets some new timemono helpers, but we don't use them (yet).

Changelog-Fixed: Compilation on FreeBSD.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Closes: https://github.com/ElementsProject/lightning/issues/7758
2025-06-13 12:21:53 -05:00
Alex Myers
9d160eb8fb wallet: load closed channels at init
This seems to have been inadvertently omitted in the recent
closed channel refactor.

Fixes: #8346

Changelog-None: Changed this release.
2025-06-13 11:40:06 +09:30
daywalker90
40d319b7be python: raise minimum supported python version to 3.9
Changelog-None
2025-06-12 13:51:18 +02:00
Rusty Russell
03b4f4778e lightningd: fix log crash on weird escape lines from plugin.
Apparently clboss gives us \u UTF codes.  We don't support that (use UTF-8 directly)

```
126	../sysdeps/x86_64/multiarch/strlen-vec.S: No such file or directory.
(gdb) bt
    label=label@entry=0x63e2f9604db9 "char *[]") at ccan/ccan/tal/str/str.c:137
    complete=complete@entry=0x7ffe9090b0f6, destroyed=destroyed@entry=0x7ffe9090b0f7) at lightningd/plugin.c:773
```

Reported-by: Ken Sedgwick
Fixes: #8338
Changelog-None: broken in this release
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-06-11 08:50:34 -05:00
Rusty Russell
eddb0e3bbd CHANGELOG.md: warn that spec compliance mean we broke splicing.
The TLV numbers for splicing were used by the upgrade protocol, and we always
demarshal TLVs:

```
rusty@rusty-Framework:~/devel/cvs/lightning ((v25.02.1))$ ./devtools/decodemsg 00883d448f5a4d2d82c861a1e60ba317f5c848989d8c92f65833ff85cc82cb96adf500000000000000c600000000000000c559ebae46ed6f64c3e7c0005494bc684a630223d4b942a7e09b76742727b863cc02aac24eb41bbcfd77cb2e75f51bc5d298a6862cd7c2478268aa67572d8a08311801203d448f5a4d2d82c861a1e60ba317f5c848989d8c92f65833ff85cc82cb96adf503203d448f5a4d2d82c861a1e60ba317f5c848989d8c92f65833ff85cc82cb96adf5
WIRE_CHANNEL_REESTABLISH:
channel_id=3d448f5a4d2d82c861a1e60ba317f5c848989d8c92f65833ff85cc82cb96adf5
next_commitment_number=198
next_revocation_number=197
your_last_per_commitment_secret=59ebae46ed6f64c3e7c0005494bc684a630223d4b942a7e09b76742727b863cc
my_current_per_commitment_point=02aac24eb41bbcfd77cb2e75f51bc5d298a6862cd7c2478268aa67572d8a083118
channel_reestablish={
type=1
len=32
(msg_name=next_to_send)
commitment_number=**TRUNCATED tu64 channel_reestablish.channel_reestablish.commitment_number**
**TRUNCATED TLV channel_reestablish.channel_reestablish**
Segmentation fault (core dumped)
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Closes: #8337
2025-06-11 08:15:56 -05:00
Matt Whitlock
3f6cd59dc9 gossipd: check for existing channel announcement before sigcheck
Checking a signature is a CPU-intensive operation that should be performed only
if gossmap doesn't already have the channel announcement in question and we're
not already checking for the announcement's UTxO.

Changelog-Fixed: `gossipd` doesn't waste CPU cycles checking signatures on channel announcements that are already known
Issue: https://github.com/ElementsProject/lightning/issues/7972
2025-06-10 16:40:33 -05:00
ShahanaFarooqui
ae320cd8d2 CI: Update Ubuntu version from 20 to 22 for Github Actions
Ubuntu 20.04 reached its end-of-life (EOL) on April 15, 2025, and GitHub Actions subsequently removed the Ubuntu 20.04 LTS runner. As a result, we must upgrade all workflow runners to at least Ubuntu 22.04. Currently, this update has only been applied to pypi.yml for core-lightning.

Changelog-None.
2025-06-09 14:24:53 -05:00
ShahanaFarooqui
ad2dc972de ci: Fix noble repro build by updating sqlite3 version and shasums
The reproducible build is currently failing on Ubuntu Noble, causing the daily `Repro Build Nightly` GitHub action to fail and triggering email notifications.

This update resolves the issue by adjusting the default sqlite3 version and checksums to match the packages now available in Noble, allowing the image to build successfully.

Changelog-None.
2025-06-05 17:38:55 -05:00
daywalker90
b97278fb9a python: upgrade grpcio-tools to 1.69.0 and protobuf to 5.29.4 for python3.13 compatibility
Changelog-None
2025-05-21 10:58:15 -05:00
Alex Myers
2c2fbe36e1 meta: update changelog for 25.05rc1 2025-05-19 14:12:55 -05:00
Alex Myers
8d6ae149ff release: update version for 25.05rc1
Changelog-None
2025-05-19 14:12:55 -05:00