Commit Graph

2797 Commits

Author SHA1 Message Date
Dusty Daemon
0a5ef7f2e6 splice: Fixes from splice-out test
Added a test for splicing out that exposed some behavior and code glitches that are addressed in this commit.

Added test for splice gossip.

Also added documentation for how to do a splice out.

ChangeLog-Fixed: Added docs, testing, and some fixes related to splicing out, insufficent balance handling, and restarting during a splice.
2023-09-21 13:41:45 +09:30
ShahanaFarooqui
f60882feaf tests/runes: per restriction test cases 2023-09-21 13:31:34 +09:30
ShahanaFarooqui
d745323f74 lightning/runes: added last_used in showrunes
Changelog-Added: JSON-RPC: `showrunes` new field `last_used`
2023-09-21 13:31:34 +09:30
Rusty Russell
48522f3e9e common: don't hang up when we receive a warning.
We were allowed to, but the spec removed that.  So we handle warnings
differently from errors now.

This also means the LND "internal error" workaround is done in
lightningd (we still disconnect, but we don't want to close channel).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: Protocol: we no longer disconnect every time we receive a warning message.
2023-09-20 13:56:46 +09:30
Rusty Russell
8be888e63f pytest: fix renepay test_shadow flake.
Sometimes we don't shadow because it would break our budget:

```
    def test_shadow(node_factory):
        '''Make sure we shadow correctly.'''
        l1, l2, l3 = node_factory.line_graph(3,
                                             wait_for_announce=True,
                                             opts=[{},
                                                   {'fee-base': 2000, 'fee-per-satoshi': 20, 'cltv-delta': 20},
                                                   {'fee-base': 3000, 'fee-per-satoshi': 30, 'cltv-delta': 30}])
    
        # Shadow doesn't always happen (50% chance)!
        for i in range(20):
            inv = l2.rpc.invoice(123000, f'test_renepay{i}', 'description')['bolt11']
            details = l1.rpc.call('renepay', {'invstring': inv})
            assert details['status'] == 'complete'
            assert details['amount_msat'] == Millisatoshi(123000)
            assert details['destination'] == l2.info['id']
    
>           line = l1.daemon.wait_for_log("No MPP, so added .*msat shadow fee")

tests/test_renepay.py:51:
```

```
lightningd-1 2023-09-12T05:08:39.699Z UNUSUAL plugin-cln-renepay: No shadow fee for flow 0/1: fee would add 5005msat to 123000msat, exceeding budget 128000msat.
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-19 10:20:24 +09:30
Matt Morehouse
8596208f52 fuzz: initial wire message seeds
Seeds for every peer wire message, generated from fuzzing with
-max_len=65533 and minimizing the resulting corpora.
2023-09-18 13:58:45 +09:30
Matt Morehouse
42fb17fe58 fuzz: target for your_peer_storage
Fuzz the decoding and encoding of your_peer_storage.
2023-09-18 13:58:45 +09:30
Matt Morehouse
6a975f3c1d fuzz: target for update_blockheight
Fuzz the decoding and encoding of update_blockheight.
2023-09-18 13:58:45 +09:30
Matt Morehouse
eec261101f fuzz: target for tx_signatures
Fuzz the decoding and encoding of tx_signatures.
2023-09-18 13:58:45 +09:30
Matt Morehouse
6b5df73cf4 fuzz: target for tx_remove_output
Fuzz the decoding and encoding of tx_remove_output.
2023-09-18 13:58:45 +09:30
Matt Morehouse
f3db6642a1 fuzz: target for tx_remove_input
Fuzz the decoding and encoding of tx_remove_input.
2023-09-18 13:58:45 +09:30
Matt Morehouse
7ddad8b7df fuzz: target for tx_init_rbf
Fuzz the decoding and encoding of tx_init_rbf.
2023-09-18 13:58:45 +09:30
Matt Morehouse
1dda44c351 fuzz: target for tx_complete
Fuzz the decoding and encoding of tx_complete.
2023-09-18 13:58:45 +09:30
Matt Morehouse
c0e8ccea49 fuzz: target for tx_add_output
Fuzz the decoding and encoding of tx_add_output.
2023-09-18 13:58:45 +09:30
Matt Morehouse
dac211c73e fuzz: target for tx_add_input
Fuzz the decoding and encoding of tx_add_input.
2023-09-18 13:58:45 +09:30
Matt Morehouse
82c719142e fuzz: target for tx_ack_rbf
Fuzz the decoding and encoding of tx_ack_rbf.
2023-09-18 13:58:45 +09:30
Matt Morehouse
9b7ceb7307 fuzz: target for tx_abort
Fuzz the decoding and encoding of tx_abort.
2023-09-18 13:58:45 +09:30
Matt Morehouse
4a09ef122e fuzz: target for stfu
Fuzz the decoding and encoding of stfu.
2023-09-18 13:58:45 +09:30
Matt Morehouse
34ca0f6eac fuzz: target for splice_locked
Fuzz the decoding and encoding of splice_locked.
2023-09-18 13:58:45 +09:30
Matt Morehouse
ae56dcf882 fuzz: target for splice_ack
Fuzz the decoding and encoding of splice_ack.
2023-09-18 13:58:45 +09:30
Matt Morehouse
ea488f767b fuzz: target for splice
Fuzz the decoding and encoding of splice.
2023-09-18 13:58:45 +09:30
Matt Morehouse
e473bfda16 fuzz: target for peer_storage
Fuzz the decoding and encoding of peer_storage.
2023-09-18 13:58:45 +09:30
Matt Morehouse
451edb7c20 fuzz: target for open_channel2
Fuzz the decoding and encoding of open_channel2.
2023-09-18 13:58:45 +09:30
Matt Morehouse
76ccdcd5d0 fuzz: target for onion_message
Fuzz the decoding and encoding of onion_message.
2023-09-18 13:58:45 +09:30
Matt Morehouse
70694c23f1 fuzz: target for accept_channel2
Fuzz the decoding and encoding of accept_channel2.
2023-09-18 13:58:45 +09:30
Matt Morehouse
a72128a0b6 fuzz: target for warning
Fuzz the decoding and encoding of warning.
2023-09-18 13:58:45 +09:30
Matt Morehouse
d60077a8d9 fuzz: target for update_fulfill_htlc
Fuzz the decoding and encoding of update_fulfill_htlc.
2023-09-18 13:58:45 +09:30
Matt Morehouse
41a2901ad4 fuzz: target for update_fee
Fuzz the decoding and encoding of update_fee.
2023-09-18 13:58:45 +09:30
Matt Morehouse
08898333a4 fuzz: target for update_fail_malformed_htlc
Fuzz the decoding and encoding of update_fail_malformed_htlc.
2023-09-18 13:58:45 +09:30
Matt Morehouse
298fe06c20 fuzz: target for update_fail_htlc
Fuzz the decoding and encoding of update_fail_htlc.
2023-09-18 13:58:45 +09:30
Matt Morehouse
fb6d5cf587 fuzz: target for update_add_htlc
Fuzz the decoding and encoding of update_add_htlc.
2023-09-18 13:58:45 +09:30
Matt Morehouse
1fff136d66 fuzz: target for shutdown
Fuzz the decoding and encoding of shutdown.
2023-09-18 13:58:45 +09:30
Matt Morehouse
4aa165e7a2 fuzz: target for revoke_and_ack
Fuzz the decoding and encoding of revoke_and_ack.
2023-09-18 13:58:45 +09:30
Matt Morehouse
1520fac809 fuzz: target for reply_short_channel_ids_end
Fuzz the decoding and encoding of reply_short_channel_ids_end.
2023-09-18 13:58:45 +09:30
Matt Morehouse
4997d0df5b fuzz: target for reply_channel_range
Fuzz the decoding and encoding of reply_channel_range.
2023-09-18 13:58:45 +09:30
Matt Morehouse
389ab0e46f fuzz: target for query_short_channel_ids
Fuzz the decoding and encoding of query_short_channel_ids.
2023-09-18 13:58:45 +09:30
Matt Morehouse
10757bc49c fuzz: target for query_channel_range
Fuzz the decoding and encoding of query_channel_range.
2023-09-18 13:58:45 +09:30
Matt Morehouse
c987b0e43c fuzz: target for pong
Fuzz the decoding and encoding of pong.
2023-09-18 13:58:45 +09:30
Matt Morehouse
06f37a3c86 fuzz: target for ping
Fuzz the decoding and encoding of ping.
2023-09-18 13:58:45 +09:30
Matt Morehouse
62ffb42908 fuzz: target for open_channel
Fuzz the decoding and encoding of open_channel.
2023-09-18 13:58:45 +09:30
Matt Morehouse
07d593a24e fuzz: target for node_announcement
Fuzz the decoding and encoding of node_announcement.
2023-09-18 13:58:45 +09:30
Matt Morehouse
b437835241 fuzz: target for init
Fuzz the decoding and encoding of init.
2023-09-18 13:58:45 +09:30
Matt Morehouse
e41f263b72 fuzz: target for gossip_timestamp_filter
Fuzz the decoding and encoding of gossip_timestamp_filter.
2023-09-18 13:58:45 +09:30
Matt Morehouse
9fababd668 fuzz: target for funding_signed
Fuzz the decoding and encoding of funding_signed.
2023-09-18 13:58:45 +09:30
Matt Morehouse
247457f1f8 fuzz: target for funding_created
Fuzz the decoding and encoding of funding_created.
2023-09-18 13:58:45 +09:30
Matt Morehouse
b1064e0309 fuzz: target for error
Fuzz the decoding and encoding of error.
2023-09-18 13:58:45 +09:30
Matt Morehouse
1f974b8349 fuzz: target for commitment_signed
Fuzz the decoding and encoding of commitment_signed.
2023-09-18 13:58:45 +09:30
Matt Morehouse
38a329f9e6 fuzz: target for closing_signed
Fuzz the decoding and encoding of closing_signed.
2023-09-18 13:58:45 +09:30
Matt Morehouse
f409f3374c fuzz: target for channel_update
Fuzz the decoding and encoding of channel_update.
2023-09-18 13:58:45 +09:30
Matt Morehouse
b7b046ce83 fuzz: target for channel_reestablish
Fuzz the decoding and encoding of channel_reestablish.
2023-09-18 13:58:45 +09:30