Commit Graph

505 Commits

Author SHA1 Message Date
Sangbida Chaudhuri
1279a58910 pytest: changed old_hsmsecret to default to false.
This changes various tests in minor ways:

1. The "l2" secret key in tests/plugins/channeld_fakenet.c is updated.
2. The decompressed gossip data node id needs changing.
3. The coinmoves order changes in bookkeeper for anchors.
4. Various harcoded gossip constants change.
5. Some hardcoded makesecret results change.
6. zeroconf tests which hardcoded node ids change.
7. Arbitrary rune strings change.
8. A log message which uses node ids changes.
2026-01-27 09:32:49 +10:30
Sangbida Chaudhuri
02bfa4136f pyln-testing: add old_hsmsecret param to get_node.
This defaults to false for now: this breaks a lot of tests (since node ids change!)
once we switch to true.
2026-01-27 09:32:49 +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
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
Rusty Russell
e7b3ba6c79 pytest: note that we also trigger CI failure on this "That's weird" messages.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-01-08 22:33:19 +10:30
Rusty Russell
98a19df413 pytest: don't run tests marked slow_test at all if VALGRIND and SLOW_MACHINE.
We used to just run these without valgrind, but we already run them in
CI (which sets SLOW_MACHINE) without valgrind, so this just doubles
up.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-01-08 22:33:19 +10:30
ShahanaFarooqui
54af71c5b3 doc: Added doc schemas with description and update proto 2025-12-19 15:28:46 -08:00
Christian Decker
4b9cffe183 Add comprehensive coverage infrastructure with clang source-based coverage
This commit introduces a modern coverage infrastructure for Core Lightning:

- Migrate from ad-hoc coverage script to integrated Makefile targets
- Add LLVM source-based coverage support with per-test profraw organization
- Integrate coverage collection into pytest framework via TailableProc
- Add GitHub Actions workflow for nightly coverage reports
- Add Taskfile.yml for convenient task automation
- Add codecov.yml for Codecov integration
- Add comprehensive coverage documentation in COVERAGE.md
- Update contributor workflow docs with new coverage script path
- Add coverage data files to .gitignore (*.profraw, *.profdata)
- Remove obsolete contrib/clang-coverage-report.sh
- Remove obsolete tests/conftest.py (now using pyln-testing markers)
- Update pyproject.toml to include pyln-testing in main dependencies

The new infrastructure automatically collects coverage data when CLN_COVERAGE_DIR
is set, organizing profraw files by test name for granular analysis.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 16:37:02 +01:00
Madeline Paech
ed439772a8 release branch for 25.12 release 2025-12-04 10:44:56 +10:30
Rusty Russell
e02f76bdd8 CHANGELOG: update for 25.12rc3
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-11-29 10:32:47 +10:30
Madeline Paech
c59d9beab3 second release candidate for 25.12 2025-11-28 10:48:43 +10:30
Rusty Russell
ea0b8040c2 doc: include delnetworkevent in generated documentation, and grpc.
Also added missing "added" annotation.  This meant that I had to manually
change contrib/msggen/msggen/patch.py to insert that added notation where it
was missing from .msggen.json.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-None: introduced this release.
2025-11-24 14:31:02 +10:30
Madeline Paech
5166fd55bb release candidate PR for 25.12 with Shahana's Makefile update
Changelog-None
2025-11-24 02:50:41 +00:00
Madeline Paech
f16b198cdc change log for 25.12rc1 2025-11-21 14:32:47 +10:30
daywalker90
d125b3c720 msggen: add missing methods from v25.12
Changelog-None
2025-11-21 13:51:28 +10:30
daywalker90
ab73388902 msggen: add missing methods from v25.09 2025-11-21 13:51:28 +10:30
Rusty Russell
19f0b04a3e pyln-testing: don't assume we're doing debug logging for fundwallet and line_graph helpers.
We want to use log-level info for benchmarking, for example.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-11-20 16:30:50 +10:30
Rusty Russell
fd2bf0dc16 pytest: latency and speed test on large coinmoves.
We start with 100,000 entries.  We will scale this to 2M as we fix the
O(N^2) bottlenecks.

I measure the node time after we modify the db, like so:

	while guilt push && rm -rf /tmp/ltests* && uv run make -s RUST=0; do RUST=0 VALGRIND=0 TIMEOUT=100 TEST_DEBUG=1 eatmydata uv run pytest -vvv -p no:logging tests/test_coinmoves.py::test_generate_coinmoves > /tmp/`guilt top`-sql 2>&1; done

Then analyzed the results with:
	FILE=/tmp/synthetic-data.patch-sql; START=$(grep 'lightningd-2 .* Server started with public key' $FILE | tail -n1 | cut -d\  -f2 | cut -d. -f1); END=$(grep 'lightningd-2 .* JSON-RPC shutdown' $FILE | tail -n1 | cut -d\  -f2 | cut -d. -f1); echo $(( $(date +%s -d $END) - $(date +%s -d $START) )); grep 'E       assert' $FILE;

tests/test_coinmoves.py::test_generate_coinmoves (100,000, sqlite3):
	Time (from start to end of l2 node):	85 seconds
	Worst latency:				75 seconds

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-11-20 16:30:50 +10:30
Rusty Russell
39349965a6 lightningd: add withheld flag to listpeerchannels and listclosedchannels.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `listpeerchannels` `funding` object `withheld` flag, and `listclosedchannels` `funding_withheld` flags, indicating fundchannel_complete was called with the `withheld` parameter true.
2025-11-19 07:23:39 +10:30
Rusty Russell
b4eda94ed3 pyln-testing: introduce canned blocks support to bitcoind fixture.
We have to add a send_and_mine_block() for cases where we want to get
a txid and then mine it (for canned blocks, we mine it then figure out
which tx it was!).

And fix up out-by-one in saving blocks.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-11-13 21:21:29 +10:30
Lagrang3
4f1c8806d7 askrene: add askrene-bias-node rpc
Changelog-Added: askrene-bias-node: an RPC command to set a bias on node's outgoing or incoming channels.

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
2025-11-13 15:15:27 +10:30
Lagrang3
5769beb1db askrene: add timestamp to biases
We add one more field to biases: "timestamp".
With the timestamp variable old biases can be removed with the
askrene-age command.

Changelog-Added: Plugins: askrene channel biases now have an associated timestamp, and are timed out by askrene-age

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
2025-11-13 15:15:27 +10:30
Rusty Russell
ec05e5da91 autoclean: clean network events (30 days by default).
We also document this in the listnetworkevents command itself.

The test_autoclean_once was getting repetitive, so I cleaned that
up too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: `autoclean` will remove networkevents after 30 days by default.
2025-11-12 13:58:43 +10:30
Rusty Russell
3b332948dd lightningd: implement listnetworkevents.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-11-12 13:58:43 +10:30
ShahanaFarooqui
d723337af3 meta: Update version 25.09.3 and CHANGELOG
Changelog-None.
2025-11-10 15:08:08 +10:30
Rusty Russell
1e7ffeb89d tests: don't assume newaddr returns bech32 by default.
Either use p2tr (if not elements) or explicitly ask for a bech32 address.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-11-07 10:51:04 +10:30
Sangbida Chaudhuri
de9c6305a1 exposesecret: Add support for mnemonic-based HSM secrets
Update the exposesecret plugin to work with the new unified HSM secret
format that supports BIP39 mnemonics.

Changelog-Added - exposesecret now has a mnemonic field
2025-10-26 12:37:58 +10:30
Madeline Vibes
766db61370 Meta: Adding changelog and version update for 25.09.1 2025-10-21 08:17:35 +05:30
Lakshya Singh
2879ef121e chore: remove uv sources defined at workspace level
duplicate definition isn’t required as we already defined them at 
workspace level sources
2025-10-10 15:47:39 +10:30
Lakshya Singh
d05a8ee70b chore: remove __init__.py for package extension
for python 3.3+ we don’t need an __init__.py at namespace package to 
allow extensions instead we can just get rid of them
2025-10-10 15:47:39 +10:30
Matt Whitlock
f7db14408f pyln-testing: pass timeout to BitcoinProxy
The bitcoin.rpc.DEFAULT_HTTP_TIMEOUT of 30 seconds may not be enough
time to generate a block when the test machine is under load. Pass
pyln.testing.utils.TIMEOUT to bitcoin.rpc.RawProxy to allow extra time:
currently 60 seconds by default or 180 seconds if SLOW_MACHINE is set.

Changelog-None
2025-10-02 10:44:16 +09:30
Matt Whitlock
a05a3748d3 tests: skip certain tests if RUST is not enabled
* tests/test_cln_lsps.py::test_lsps0_listprotocols
 * tests/test_clnrest.py
 * tests/test_connection.py::test_wss_proxy

Changelog-Fixed: pytest: Tests that require Rust no longer fail if Rust is disabled.
2025-10-02 10:19:27 +09:30
Rusty Russell
e7ea57e130 BOLT12: Remove start_any_period from recurrence_base.
Offer_absolute_expiry should be used if you want to require starting at the start.

Changelog-EXPERIMENTAL: Protocol: BOLT 12 recurrence `start_any_period` removed, use expiry if you need to restrict when they can start using the offer.
2025-10-01 15:31:30 +09:30
Christian Decker
7a7a48c34d chore: Update python dependencies
I got a bit annoyed by all the "your protobuf gencode is too old"
warnings in downstream packages, so I spent a bit of time updating any
stale dependency and now we're back allowing packages up to the latest
release. That should maximize the compatibility, and allow downstream
packages to chose their own versions, as long as they are
compatible (semantic versioning).
2025-10-01 11:41:06 +09:30
Rusty Russell
5a52c6bd63 pyln-testing: catch special CI string so we can have non-BROKEN CI warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-09-30 11:37:31 +09:30
Matt Whitlock
4d47cc681d tests: do not leak file descriptors
Changelog-None
2025-09-15 11:19:17 +09:30
Matt Whitlock
f7204c8dd7 pyln-testing: don't leak file descriptor in GossipStore
Changelog-None
2025-09-15 11:19:17 +09:30
Matt Whitlock
a62e9c5573 pyln-testing: close log files when tearing down node_factory
TailableProc has a cleanup_files() method to close its log files. Call
it when tearing down node_factory to avoid leaking resources.

Changelog-None
2025-09-15 11:19:17 +09:30
Matt Whitlock
abcb976eb0 pyln-testing: close 'config.vars' after reading
This code has a resource leak:

	lines = open(fname, 'r').readlines()

This is the correct way:

	with open(fname, 'r') as f:
		lines = f.readlines()

Changelog-None
2025-09-15 11:19:17 +09:30
daywalker90
e732eda37a pyln-testing: set 'dev-save-plugin-io' only on CLN v25.09 and later
Changelog-None
2025-09-15 11:13:28 +09:30
Madeline Paech
d7d0e3222b update the versions for 25.09 2025-09-01 13:13:38 +09:30
madelinevibes
81838fabf9 updates for rc4: name changes and uv 2025-08-28 15:59:52 +09:30
madelinevibes
c25f0fafff small changes of any reference to rc2 to rc3 2025-08-27 15:29:16 +09:30
madelinevibes
fcd92febad change version 25.09rc2 for release
replace rc1
2025-08-21 16:12:27 +09:30
Sangbida Chaudhuri
da7d3057ed Run version script for rc1.
Run version script
2025-08-19 16:46:29 +09:30
Rusty Russell
6c626b124b lightningd: add chainmoves and channelmoves to wait command.
Only makes sense to wait on creation, since they neither are deleted
nor updated.

We also enhance the list commands to take the standard index options.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `wait`: new subsystems `chainmoves` and `channelmoves`.
2025-08-19 13:37:50 +09:30
Rusty Russell
e43a4a96e7 pyln-testing: check plugin notifications against any extant notification schemas.
Note that we need a workaround for deprecated APIs where "channel_state_changed" output "null" which violated the schema.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-08-18 10:01:07 +09:30