Commit Graph

14766 Commits

Author SHA1 Message Date
daywalker90
c1c67635fc msggen: add upgradewallet method
Changelog-None
2024-05-15 22:11:10 +02:00
daywalker90
8edd3d4a06 msggen: add setpsbtversion method
Changelog-None
2024-05-15 22:11:10 +02:00
daywalker90
ad31a18b1d msggen: add setconfig method
Changelog-None
2024-05-15 22:11:10 +02:00
daywalker90
5ed04c9788 msggen: add sendonionmessage method
Changelog-None
2024-05-15 22:11:10 +02:00
Rusty Russell
3c48438821 pay: fix bolt12 blinded path cltv logic.
The spec has moved a bit here: the `outgoing_cltv_value` in the final onion
is basically the blockheight now (plus the 1 block delta we give ourselves).

Also, we were doubling ours, since p->min_final_cltv_expiry was already set
to p->blindedpay->cltv_expiry_delta above.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-15 10:55:16 -05:00
Rusty Russell
121403b5df offers: add final node's CLTV delta in when creating blinded path payinfo.
It should probably be renamed "minimum_cltv_delta" or something.

Fixes: https://github.com/ElementsProject/lightning/issues/7179
Reported-by: @carlaKC
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-15 10:55:16 -05:00
Rusty Russell
8b5bf716a8 offers: use node_id not scid inside blinded path.
Without this, it was broken because our peer will no longer forward
via scids for private channels.  We could use the scid alias, but the
node id is right at hand.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-15 10:55:16 -05:00
Rusty Russell
847208f5d8 offers: put correct CLTV limit inside blinded paths.
At plugin startup, we don't have an accurate blockheight and can get 0!

Fixes: https://github.com/ElementsProject/lightning/issues/7161
Reported-by: @carlaKC
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-15 10:55:16 -05:00
Rusty Russell
f9021b6ca6 pytest: add test for paying an invoice with a one-hop blinded path.
This demonstrates a number of issues reported by Carla: no surprise
since there was no test!

(We create a one-hop blinded path when we only have private channels).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-15 10:55:16 -05:00
daywalker90
abd1b5fe50 cln-plugin: fix over-escaping rpc errors 2024-05-15 13:26:02 +02:00
daywalker90
b69609b9c3 cln-plugin: Add dynamic configs and a callback for changes
Changelog-Added: cln-plugin: Add dynamic configs and a callback for changes
2024-05-15 13:26:02 +02:00
daywalker90
dab9605e1f msggen: add splice_update method 2024-05-15 12:11:18 +02:00
daywalker90
04a2ad6f8b msggen: add splice_signed method 2024-05-15 12:11:18 +02:00
daywalker90
9f9b59d45b msggen: add unreserveinputs method
Changelog-None
2024-05-15 12:11:18 +02:00
daywalker90
15f0beab6b msggen: add reserveinputs method
Changelog-None
2024-05-15 12:11:18 +02:00
Rusty Russell
dca361c5c7 pytest: test that we kick out pending transient connections too.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-14 18:16:26 -05:00
Rusty Russell
155311b053 connectd: --dev-handshake-no-reply so we can test pending connections.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-14 18:16:26 -05:00
Rusty Russell
a9b7402910 pytest: test dropping transient connections.
Requires a hack to exhaust connectd fds and make us close a transient.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-14 18:16:26 -05:00
Rusty Russell
8268df9a4b connectd: implement "transient" connections.
Currently, anything which doesn't have a live channel is considered transient.
We free this first under stress, and also if they're still connecting.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-14 18:16:26 -05:00
Rusty Russell
9aed594177 pytest: test fetchinvoice reply path which is not a direct peer.
Our fetchinvoice always creates a reply path which terminates at their peer,
so we need a dev overrride for that.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-14 18:16:26 -05:00
Rusty Russell
8714289c8c plugin/offers: connect if necessary for replying to invoice_request.
You can disable this with `fetchinvoice-noconnect`.

Changelog-EXPERIMENTAL: We will now reply to invoice_request messages even if reply path requires us to make an outgoing connection (LDK does this)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-14 18:16:26 -05:00
Rusty Russell
2e1274ba76 plugins/fetchinvoice: use new generic connect-if-needed infrastructure.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-14 18:16:26 -05:00
Rusty Russell
b94be330e6 plugins: generalize "connect if we can't route" logic, link into offers plugin.
We're going to dynamically connect if we need to, to reply to incoming invoice_requests.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-14 18:16:26 -05:00
Rusty Russell
541cc9dd1f connectd: fix exhaustion code where we pick random peer.
If we don't find one searching from our random spot in the peer table,
we're supposed to wrap, not crash!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-14 18:16:26 -05:00
ShahanaFarooqui
f474585568 doc: Updating installation instructions for python plugins
Previously, we only had a single python plugin `clnrest` and the instructions were embedded under other heading.

Adding a new heading for python plugins and their installation instructions will make it easier for users to locate them.

Changelog-None.
2024-05-14 21:50:29 +02:00
Ken Sedgwick
cfcdde14d8 hsmd: support HSM_VERSION 6
Changelog-Changed: hsmd: the hsmd now supports HSM_VERSION 6

This is actually optional, everything would be ok leaving native hsmd
support at HSM_VERSION 5 instead.
2024-05-14 10:39:12 -05:00
Ken Sedgwick
eda0b28cbb hsmd: HSM_VERSION 6: get_per_commitment_point never returns secret
Changelog-Changed: hsmd: HSM_VERSION 6: get_per_commitment_point does
not imply index - 2 is revoked, makes it safe to call on any index.
2024-05-14 10:39:12 -05:00
Ken Sedgwick
37fe32aa17 hsmd: make the negotiated hsmd version available to libhsmd
Changelog-None: hsmd internals
2024-05-14 10:39:12 -05:00
Ken Sedgwick
a02cc6441a channeld: split get_per_commitment_point uses into separate functions
Changelog-None: channeld internal

This factoring makes it much clearer which callers only need the pubkey and
which only need the old_secret.

VLS has merged a workaround which prevents crashing when fetching a
per-commitment-point beyond the allowed range (the secret is just not
returned in this case.
https://gitlab.com/lightning-signer/validating-lightning-signer/-/merge_requests/643

In HSM_VERSION 6 the semantic is cleaned up; get_per_commitment_point
never returns a secret and safely be called on any commitment number.
2024-05-14 10:39:12 -05:00
Ken Sedgwick
25312630aa channeld: factor out unneeded make_revocation_msg_from_secret
Changelog-None: internal to channeld

Since we don't need a special path for early old_secrets from validate
we can factor out duplicate code.
2024-05-14 10:39:12 -05:00
Ken Sedgwick
1c65fc2633 hsmd: prune unreachable pre HSM_VERSION 5 code
Changelog-None: shouldn't affect others

HSM_MIN_VERSION is 5 which implies use of
WIRE_HSMD_REVOKE_COMMITMENT_TX; prune branches that can't happen.
2024-05-14 10:39:12 -05:00
Se7enZ
ca4710e942 bcli: Add rpcclienttimeout parameter and use max value of it and retry_timeout 2024-05-13 14:26:24 -05:00
Rusty Russell
86d2478743 common: add unit test for marginal feerate function.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-13 14:06:45 -05:00
Christian Decker
24ec17126c channeld: Adjust the feerate security margin profile
The feerate security margin is a multiplicative factor applied to the
feerate of some transactions in order to guarantee that the
transaction remains publishable and has a sufficient chance of being
confirmed, that we can base some of our decisions on that.

The multiplicative factor is >=1 and was so far a constant 2. This
might have been sensible in the low-fee environment, where the fees
are expected to oscillate, and almost guaranteeing that we will
eventually have rising feerates but in high-fee environments that is
no longer the case, and the 100% margin that the multiplicator 2
brings is excessive. We therefore opt to start out with 100%, then
linearly interpolate up to a given maxfeerate (which does not have to
be a real feerate ever reached, it just indicates the feerate after
which we apply the constant 10% margin.

Fixes #6974
Closes #6976
[Fixed up all the other changes required, including spendable calcualtion
 comments and unit test and pytest tests --RR]
2024-05-13 14:06:45 -05:00
daywalker90
047faf1d34 msggen: add sendinvoice method
Changelog-None
2024-05-13 20:06:40 +02:00
daywalker90
54e1c78e46 msggen: add renepaystatus method
Changelog-None
2024-05-13 20:06:40 +02:00
daywalker90
9538ecccad msggen: add renepay method
Changelog-None
2024-05-13 20:06:40 +02:00
daywalker90
5c0f25f916 msggen: add plugin method
Changelog-None
2024-05-13 20:06:40 +02:00
Rusty Russell
8027922cd4 devtools: make bolt12-cli print blinded paths properly.
Print the first_node_id field, and do it all on one line per path.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-12 19:11:43 -05:00
Rusty Russell
e338452c19 offers: handle scid in blinded reply path first_node_id field.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: offers: we now understand blinded paths which use a short-channel-id(+direction) as entry point.
2024-05-12 19:11:43 -05:00
Rusty Russell
cb2c4963f2 bolt12: allow first_node_id in blinded path to be a scid.
We don't actually support it yet, but this threads through the type change,
puts it in "decode" etc.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-12 19:11:43 -05:00
Rusty Russell
1b9b160108 common: move json_to_blinded_path into its own file.
It's fairly obscure, and let's not make everyone link it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-12 19:11:43 -05:00
Rusty Russell
7eb72c5924 plugins/fetchinvoice: remove "blindedpath" command altogether, since we're the only user.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-12 19:11:43 -05:00
Rusty Russell
3e37a755cd lightningd: move undocumented "blindedpath" command into fetchinvoice plugin.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-12 19:11:43 -05:00
Rusty Russell
e30c835f72 common: add sciddir_or_pubkey type.
This is proposed to be added to bolt 12, so we need a type to
represent it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-12 19:11:43 -05:00
Vincenzo Palazzo
081a2eef6c docs: fixing the json response in documentation
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2024-05-09 23:19:29 -05:00
Alex Myers
370eb73775 pytest: fix flake in test_splice_disconnect_sig
This test was failing CI under valgrind.  Allow l1 to process
incoming signatures before killing.
2024-05-09 16:14:23 -05:00
Alex Myers
840374653a pytest: fix flake in test_rbf_non_last_mined
A race condition seemed to be redirecting rpc before bitcoind processed
the second rbf transaction.
2024-05-09 16:14:23 -05:00
Alex Myers
4bcca301b0 pytest: update bookkeeper chan lease fee
Removing the min_witness_weight saves the lessor 6 sats.

lessor's DF tx vout:
"value": 4.99492248   ->   "value": 4.99492254
2024-05-09 16:14:23 -05:00
Alex Myers
231a3bd9e8 pytest: update dual-fund tests
removing min-witness-weight requirement
2024-05-09 16:14:23 -05:00