Commit Graph

3658 Commits

Author SHA1 Message Date
Rusty Russell
8895ca2982 Revert "update makefile to remove hsm_encryption"
This reverts commit 084b03375c.
2025-10-02 11:08:35 +09:30
Rusty Russell
aa8d858c1d pytest: test that we don't delete htlcs as soon as channel closed, wait for restart.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-10-02 10:19:55 +09:30
Rusty Russell
cb2849d03f wallet: don't delete old htlcs when we forget a channel, do it on startup.
For old channels, this can take a while, and it stops everything.  But
we are only doing this to save space; it's not a *functional* necessity.

A quick and dirty test with 50,000 htlcs shows the htlc deletion took
450msec.  I tried adding an index, and changing it to set hstate to
HTLC_STATE_INVALID instead of deleting entries, but it still took about 350ms.

Whereas the "COUNT(*)" only took 1.7msec, so it's worth keeping.

Reported-by: @michael1011
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: lightningd: we defer deletion of old htlcs on channel close, to avoid pausing for a long time (we clean them on startup)
Fixes: https://github.com/ElementsProject/lightning/issues/7962
2025-10-02 10:19:55 +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
Sangbida Chaudhuri
084b03375c update makefile to remove hsm_encryption 2025-10-01 22:59:55 +09:30
Rusty Russell
343d30ae5b bookkeeper: fix reloading of rebalances.
Parse key correctly.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: bookkeeper: failed reload of rebalances on restart.
2025-10-01 15:35:50 +09:30
Rusty Russell
ea1d233dc1 bookkeeper: test (failing!) for rebalances on restart.
```
lightningd-1 2025-09-22T02:10:10.978Z **BROKEN** plugin-bookkeeper: Unparsable datastore ["bookkeeper","rebalances","1-2"]
```

And, indeed, rebalance is missing:

```
>       outbound_ev = only_one([ev for ev in inc_evs if ev['tag'] == 'rebalance_fee'])

tests/test_bookkeeper.py:825: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

arr = []

    def only_one(arr):
        """Many JSON RPC calls return an array; often we only expect a single entry
        """
>       assert len(arr) == 1
E       AssertionError

```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-10-01 15:35:50 +09:30
Rusty Russell
5e53af7d3f plugins/offers: handle invoice_request with invreq_recurrence_cancel
In this case, we make an immediately-expiring invoice.  This correctly blocks
any successive requests for invoices, as per the spec requirement.

This means we have to handle invoice_requests without reply_path, amounts
or quantity *if* they specify invreq_recurrence_cancel.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-10-01 15:31:30 +09:30
Rusty Russell
b30e063432 plugins/fetchinvoice: allow use of expired offers *for recurrence*.
We added this to the recurrence spec: the offer expiration only applies to the
first request, not subsequent ones.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-10-01 15:31:30 +09:30
Rusty Russell
54444e4337 BOLT12: Update recurrence to latest spec draft.
Changes:
* Fields renumbered to their draft values + billion.
* offer_recurrence now comes in compulsory or optional (backwards compat) flavors.
* `proportional_amount` is now inside `offer_recurrence_base` not `offer_recurrence_paywindow`.
* New field `invreq_recurrence_cancel`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: Draft specification for recurring offers changed: old recurring offers will no longer work.
2025-10-01 15:31:30 +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
Rusty Russell
05005475e3 BOLT12: Remove years from recurrence.
Use months instead.

Changelog-EXPERIMENTAL: Protocol: BOLT 12 recurrence `years` removed; use 12 x months.
2025-10-01 15:31:30 +09:30
Rusty Russell
907f7c6698 unit tests: update all the gossmaps to have the GOSSIP_STORE_COMPLETED_BIT set.
Mostly this meant running them, then running devtools/convert-gossmap and replacing the code.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-10-01 13:29:33 +09:30
Rusty Russell
694626f050 connectd: fix race where last msg can still get lost.
openingd sends an ERROR, and exits.  lightningd tells us to
disconnect.  We read from lightningd first, and don't read from
openingd.

We need to drain subds when we're told to disconnect.
2025-10-01 12:12:56 +09:30
Rusty Russell
0d97631075 connectd: simplify logic, and add a "reconnected" message.
One issue we have in CI is reconnection races: if an incoming
connection arrives while an outgoing one is negotiated, we close the
outgoing one and issue a disconnect, which fails any connect attempts.

By sending a "reconnected" message instead of disconnect/connect we
can avoid disturbing in-progress connection attempts which happens in CI
quite a bit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-10-01 12:12:56 +09:30
Rusty Russell
77b8a42eea pytest: fix flake in test_splicing.py::test_route_by_old_scid
```
2025-09-30T00:07:37.3118831Z _________________ ERROR at teardown of test_route_by_old_scid __________________
...
2025-09-30T00:07:37.3131523Z             request.node.has_errors = True
2025-09-30T00:07:37.3131989Z >           raise ValueError(str(errors))
2025-09-30T00:07:37.3132834Z E           ValueError: 
2025-09-30T00:07:37.3133226Z E           Node errors:
2025-09-30T00:07:37.3133632Z E            - lightningd-1: had warning messages
2025-09-30T00:07:37.3134086Z E           Global errors:
...
2025-09-30T00:07:37.5835258Z lightningd-2 2025-09-30T00:04:24.544Z TRACE   0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-gossipd: Bad gossip order: channel_announcement: no unspent txout 109x1x1
2025-09-30T00:07:37.5835659Z lightningd-2 2025-09-30T00:04:24.544Z DEBUG   0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-connectd: peer_out WIRE_WARNING
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-09-30 11:37:31 +09:30
Rusty Russell
5d5a3ef496 pytest: use rustcorp.com.au for BIP353 test.
Something changed in Matt's example:

	  error: {'code': -32700, 'data': None, 'message': 'failed to fetch payment instructions: HrnResolutionError("Multiple TXT records existed for the HRN, which is invalid")'}

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-09-30 11:37:31 +09:30
Rusty Russell
3c3788a241 pytest: fix test_xpay_fake_channeld flake
Also, resulting log was huge, so suppress log level (will probably speed test)

```
2025-09-02T06:01:39.4881086Z >       l1.rpc.plugin_start(os.path.join(os.getcwd(), 'plugins/cln-askrene'))
2025-09-02T06:01:39.4881090Z 
2025-09-02T06:01:39.4881174Z tests/test_xpay.py:279: 
...
2025-09-02T06:01:39.4883193Z >           self.sock.connect(str(self.path))
2025-09-02T06:01:39.4883340Z E           ConnectionRefusedError: [Errno 111] Connection refused
...
2025-09-02T06:01:41.7767610Z lightningd-1 2025-09-02T06:01:27.235Z **BROKEN** plugin-cln-xpay: askrene-age failed with {"code":-4, "message":"Plugin terminated before replying to RPC call."}
2025-09-02T06:01:41.7768127Z lightningd-1 2025-09-02T06:01:27.305Z INFO    plugin-cln-xpay: Killing plugin: exited during normal operation
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-09-30 11:37:31 +09:30
Rusty Russell
64541ca899 pytest: clean up JSON sql test.
1. Establish a channel with l3; we already have one with l2.
2. Don't bother generating 6 more blocks (fundchannel ensures it's mined).
3. Allow htlcs to be empty: Whitslack reported that happens for him
4. Use only_one() to access where we insist there is only one element in the list.
5. Tighten tests to assert the exact contents, not just test some.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fixes: https://github.com/ElementsProject/lightning/issues/8497
2025-09-30 11:37:31 +09:30
Rusty Russell
702a88de0c pytest: fix flake in test_coinmoves_unilateral_htlc_fulfill / test_coinmoves_unilateral_htlc_timeout
DER sigs!  Normally, the commitment weight is:

```
Anchorspend for local commit tx fee 9751sat (w=722), commit_tx fee 4866sat (w=1284): package feerate 7286 perkw
Creating anchor spend for local commit tx 6a0816ca60d499edc70bfb786ebd164fb7a55d234c84d926102f5bd35087fd45: we're paying fee 9751sat
```

But if we're "lucky" the commitment tx is shorter:

```
Anchorspend for local commit tx fee 9744sat (w=722), commit_tx fee 4866sat (w=1283): package feerate 7286 perkw
Creating anchor spend for local commit tx acf78532a9448dd62a4e6319a3d2712189a88b6e59abc637260067d60df70782: we're paying fee 9744sat
```

The resulting failure:

```
2025-08-21T02:30:34.1906751Z >       assert moves == expected
...
...
2025-08-21T02:30:34.1965346Z E               {
2025-08-21T02:30:34.1965529Z E                   'account_id': 'wallet',
2025-08-21T02:30:34.1965767Z E                   'blockheight': 104,
2025-08-21T02:30:34.1965997Z E                   'created_index': 6,
2025-08-21T02:30:34.1966229Z E         -         'credit_msat': 15579000,
2025-08-21T02:30:34.1966467Z E         ?                           ^^
2025-08-21T02:30:34.1966698Z E         +         'credit_msat': 15586000,
2025-08-21T02:30:34.1966927Z E         ?                           ^^
2025-08-21T02:30:34.1967150Z E                   'debit_msat': 0,
2025-08-21T02:30:34.1967376Z E                   'extra_tags': [],
2025-08-21T02:30:34.1967599Z E         -         'output_msat': 15579000,
2025-08-21T02:30:34.1967832Z E         ?                           ^^
2025-08-21T02:30:34.1968061Z E         +         'output_msat': 15586000,
2025-08-21T02:30:34.1968294Z E         ?                           ^^
2025-08-21T02:30:34.1968540Z E                   'primary_tag': 'deposit',
2025-08-21T02:30:34.1968908Z E                   'utxo': 'acf78532a9448dd62a4e6319a3d2712189a88b6e59abc637260067d60df70782:0',
2025-08-21T02:30:34.1969366Z E               },
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-09-30 11:37:31 +09:30
Rusty Russell
f5fe10c4d5 pytest: fix flake in reckless install timeout.
Don't test installing a plugin under valgrind.  There's no way to
increase reckless' (completely reasonable) 15 seconds timeout, and that
can happen under valgrind & CI:

```
 def test_reckless_uv_install(node_factory):
        node = get_reckless_node(node_factory)
        node.start()
        r = reckless([f"--network={NETWORK}", "-v", "install", "testpluguv"],
                     dir=node.lightning_dir)
>       assert r.returncode == 0
E       assert 1 == 0
E        +  where 1 = self.returncode, self.stdout, self.stderr.returncode

tests/test_reckless.py:359: AssertionError
...
***RECKLESS STDERR***
config file not found: /tmp/ltests-tui1vmrg/test_reckless_uv_install_1/lightning-1/regtest/config
press [Y] to create one now.
config file not found: /tmp/ltests-tui1vmrg/test_reckless_uv_install_1/lightning-1/reckless/regtest-reckless.conf
config file not found: /tmp/ltests-tui1vmrg/test_reckless_uv_install_1/lightning-1/reckless/.sources
Traceback (most recent call last):
  File "/home/runner/work/lightning/lightning/tools/reckless", line 2091, in <module>
    log.add_result(args.func(target))
  File "/home/runner/work/lightning/lightning/tools/reckless", line 1524, in install
    return _enable_installed(installed, plugin_name)
  File "/home/runner/work/lightning/lightning/tools/reckless", line 1476, in _enable_installed
    if enable(installed.name):
  File "/home/runner/work/lightning/lightning/tools/reckless", line 1647, in enable
    lightning_cli('plugin', 'start', path)
  File "/home/runner/work/lightning/lightning/tools/reckless", line 1613, in lightning_cli
    clncli = run(cmd, stdout=PIPE, stderr=PIPE, check=False, timeout=timeout)
  File "/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/subprocess.py", line 505, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
  File "/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/subprocess.py", line 1154, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/subprocess.py", line 2022, in _communicate
    self._check_timeout(endtime, orig_timeout, stdout, stderr)
  File "/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/subprocess.py", line 1198, in _check_timeout
    raise TimeoutExpired(
subprocess.TimeoutExpired: Command '['/home/runner/work/lightning/lightning/cli/lightning-cli', '--network=regtest', '--lightning-dir=/tmp/ltests-tui1vmrg/test_reckless_uv_install_1/lightning-1', 'plugin', 'start', '/tmp/ltests-tui1vmrg/test_reckless_uv_install_1/lightning-1/reckless/testpluguv/testpluguv.py']' timed out after 15 seconds
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-09-30 11:37:31 +09:30
Rusty Russell
f0448efa8a pytest: fix flake in tests/test_bookkeeper.py::test_bookkeeping_missed_chans_leases
```
 FAILED tests/test_bookkeeper.py::test_bookkeeping_missed_chans_leases - AssertionError: assert [{'tag': 'channel_open', 'credit_msat': 506268000, 'debit_msat': 0}, {'tag': 'lease_fee', 'credit_msat': 0, 'debit_msat': 6268000}, {'tag': 'invoice', 'credit_msat': 0, 'debit_msat': 11000000}, {'tag': 'onchain_fee', 'credit_msat': 1314000, 'debit_msat': 0}] == [{'tag': 'channel_open', 'credit_msat': 506268000, 'debit_msat': 0}, {'tag': 'lease_fee', 'credit_msat': 0, 'debit_msat': 6268000}, {'tag': 'onchain_fee', 'credit_msat': 1314000, 'debit_msat': 0}, {'tag': 'invoice', 'credit_msat': 0, 'debit_msat': 11000000}]
  
  At index 2 diff: {'tag': 'invoice', 'credit_msat': 0, 'debit_msat': 11000000} != {'tag': 'onchain_fee', 'credit_msat': 1314000, 'debit_msat': 0}
  
  Full diff:
    [
        {
            'credit_msat': 506268000,
            'debit_msat': 0,
            'tag': 'channel_open',
        },
        {
            'credit_msat': 0,
            'debit_msat': 6268000,
            'tag': 'lease_fee',
        },
        {
  +         'credit_msat': 0,
  +         'debit_msat': 11000000,
  +         'tag': 'invoice',
  +     },
  +     {
            'credit_msat': 1314000,
            'debit_msat': 0,
            'tag': 'onchain_fee',
        },
  -     {
  -         'credit_msat': 0,
  -         'debit_msat': 11000000,
  -         'tag': 'invoice',
  -     },
    ]
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-09-30 11:37:31 +09:30
Rusty Russell
9fe8f3ab2e build: suppress amount checking in fuzzing tests.
```
tests/fuzz/fuzz-funder-policy.c:32:	amt.satoshis %= (MAX_SATS + 1);
tests/fuzz/fuzz-funder-policy.c:132:				total.satoshis, tcase->max_channel_size.satoshis);
tests/fuzz/fuzz-funder-policy.c:140:				our_funds.satoshis, tcase->policy.per_channel_min.satoshis);
tests/fuzz/fuzz-funder-policy.c:145:				our_funds.satoshis, tcase->policy.per_channel_max.satoshis);
tests/fuzz/fuzz-funder-policy.c:155:				our_funds.satoshis, tcase->available_funds.satoshis,
tests/fuzz/fuzz-funder-policy.c:156:				tcase->policy.reserve_tank.satoshis);
tests/fuzz/fuzz-funder-policy.c:161:			tcase->policy.reserve_tank.satoshis, tcase->available_funds.satoshis,
tests/fuzz/fuzz-funder-policy.c:162:			our_funds.satoshis);
make: *** [Makefile:577: check-amount-access] Error 1
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-09-22 12:43:35 +09:30
Chandra Pratap
cedf2f9d47 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-09-22 11:03:54 +09:30
Chandra Pratap
d6a7c29af0 fuzz-tests: Add a test for codex32 operations
Changelog-None: Add a test for `codex32_encode()` and
`codex32_secret_decode()` defined in `common/codex32.{c, h}`.
2025-09-22 11:03:54 +09:30
Chandra Pratap
6e16f94443 fuzz-tests: Add coverage-increasing inputs to seed corpora
Change in the fuzzing scheme of fuzz-bech32 led to the
discovery of test inputs that result in greater in code
coverage. Add these inputs to the test's seed corpus.
2025-09-22 10:23:24 +09:30
Chandra Pratap
b6a1c97c41 fuzz-tests: test 8-to-5 bit conversion
Currently, the test only verifies the 5-to-8 bit conversion. Replace
it with a roundtrip check that verifies 8-to-5 bit conversion as well.
2025-09-22 10:23:24 +09:30
Chandra Pratap
f4fdb1962a fuzz-tests: Test over all possible witness version values
According to `common/bech32.h`, the valid values of witness
program version are between 0 and 16 (inclusive). Update the
test to iterate over all of these values.
2025-09-22 10:23:24 +09:30
Chandra Pratap
83894faa21 fuzz-tests: Replace manual allocations with tal_arr()
Changelog-None: Use the common library utilities for temporary
allocations instead of manually calling `malloc` and `free`.

This makes the code conformant with rest of the codebase and
reduces the chances of leaks.
2025-09-22 10:23:24 +09:30
Chandra Pratap
5cc8d0ad78 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-09-22 10:21:27 +09:30
Chandra Pratap
48ced70f9a fuzz-tests: Add a test for calculate_our_funding()
Changelog-None: `calculate_our_funding()` in `plugins/funder_policy.c`
is responsible for calculating our funding policy. Add a test for it.
2025-09-22 10:21:27 +09:30
Chandra Pratap
6f4cfedeea fuzz-tests: Add coverage-increasing inputs to seed corpora
Change in the fuzzing scheme of `fuzz-close_tx` led to the
discovery of test inputs that result in greater in code
coverage. Add these inputs to the test's seed corpus.
2025-09-15 13:43:40 +09:30
Chandra Pratap
20e252b548 fuzz-tests: fix overflow of u32 in fuzz-close-tx
Changelog-None: The value WALLY_SATOSHI_PER_BTC * WALLY_BTC_MAX
is equal to 2.1e15, which is much higher than the maximum capacity
of a u32, which is 4.29e9.

Hence, use a u64 to store this value instead.
2025-09-15 13:43:40 +09:30
Chandra Pratap
17cf63aec3 fuzz-tests: Add coverage increasing inputs to seed corpora
Improvements in the fuzz-testing scheme of `fuzz-channel_id led
to the discovery of test inputs that result in greater in code
coverage. Add these inputs to the test's seed corpus.
2025-09-15 13:42:38 +09:30
Chandra Pratap
9e341453d5 fuzz-tests: Get rid of magic numbers
Replace instances of 36 with sizeof(outpoint) and 32 with
sizeof(chan_id) since that's what they represent. This makes
the test more future-proof.
2025-09-15 13:42:38 +09:30
Chandra Pratap
bc57dc9b90 fuzz-tests: Make the channel_id wire test roundtrip
Changelog-None: `memcmp()` the output of `towire_channel_id()`
and the input to `fromwire_channel_id()` to ensure that wire
encoding-decoding is correctly performed.
2025-09-15 13:42:38 +09:30
Chandra Pratap
271356f695 fuzz-tests: Add coverage-increasing inputs to seed corpora
Change in the fuzzing scheme of `fuzz-bolt11` led to the
discovery of test inputs that result in greater in code
coverage. Add these inputs to the test's seed corpus.
2025-09-15 13:39:18 +09:30
Chandra Pratap
2a877633a4 fuzz-tests: Remove unnecessary #includes in the BOLT #11 test
The fuzz target for BOLT #11 has some unnecessary #includes.
Get rid of them.
2025-09-15 13:39:18 +09:30
Chandra Pratap
974af91cc6 fuzz-tests: add a check for bolt11_encode()
Changelog-None: Since `bolt11_decode()` defined in `common/bolt11.c`
is untested by the current BOLT #11 fuzz test, add a test for it.
2025-09-15 13:39:18 +09:30
Chandra Pratap
fc549b3bc8 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-09-15 11:31:00 +09:30
Chandra Pratap
69a604fca5 fuzz-tests: add a test for handle_peer_error_or_warning()
Changelog-None: `handle_peer_error_or_warning()` in
`common/read_peer_message.{c, h}` is responsible for parsing any
incoming `error` or `warning` messages as defined in BOLT #1.

Add a test for it.
2025-09-15 11:31:00 +09:30
Chandra Pratap
7b4e182fbe fuzz-tests: order FUZZ_COMMON_OBJS lexicographic
The FUZZ_COMMON_OBJS list roughly follows lexicographic
order. Make it adhere strictly to the order. This makes adding
and reviewing changes to the file easier.
2025-09-15 11:31:00 +09:30
Chandra Pratap
3e96f07635 fuzz-tests: Add coverage-increasing inputs to seed corpora
Improvements in the fuzz-testing scheme of fuzz-bigsize led
to the discovery of test inputs that result in greater in
code-coverage. Add these inputs to the test's seed corpus.
2025-09-15 11:30:08 +09:30
Chandra Pratap
66e0d9c285 fuzz-tests: Add a roundtrip check for bigsize_put()
Add a roundtrip check for `bigsize_put()` using `bigsize_get()`.
This enforces a stricter check for the former and adds a test
for the latter, which is currently untested.
2025-09-15 11:30:08 +09:30
Chandra Pratap
8ab0a01e82 fuzz-tests: Replace hardcoded chunk size with iteration over sizes
Changelog-None: The exisiting fuzz test only extracts chunks of
a fixed size (8) from the fuzzer's input. Replace this with an
iteration over a set of chunk sizes (1 to BIGSIZE_MAX_LEN) for
better coverage.

While at it, get rid of the check `if (bs != 0)` because 0 is a
valid value for bigsize_t as well.
2025-09-15 11:30:08 +09:30
Chandra Pratap
a23dcf67f2 fuzz-tests: Add coverage-increasing inputs to seed corpora
Change in the fuzz-testing scheme of fuzz-addr led to the
discovery of test inputs that result in greater in code
coverage. Add these inputs to the test's seed corpus.
2025-09-15 11:28:20 +09:30
Chandra Pratap
763be38e6d fuzz-tests: verify round‑trip scriptpubkey <-> addr conversion
Changelog-None: Currently, fuzz-addr only tests encoding via
encode_scriptpubkey_to_addr(), without checking decoding. Add a
round‑trip assertion: if encoding produces an address, decode
it back with decode_scriptpubkey_from_addr() and confirm the
result matches the original scriptpubkey.
2025-09-15 11:28:20 +09:30
Chandra Pratap
c7052b7d27 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-09-15 11:28:07 +09:30
Chandra Pratap
871ae75b5e fuzz-tests: Add fuzz target for closing_sig
Changelog-None: 'closing_signed' and 'closing_sig' are
channel closing negotiation messages defined in BOLT #2.

While 'closing_signed' has a wire fuzz test, 'closing_sig'
does not. Add a test to perform a round-trip encoding check
(towire -> fromwire) similar to the other wire fuzzers.
2025-09-15 11:28:07 +09:30
Chandra Pratap
59ccced19d 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-09-15 11:21:25 +09:30