Commit Graph

14198 Commits

Author SHA1 Message Date
Rusty Russell ac4c396537 lightningd: reuse code for "dynamic" getmanifest response parsing.
And clean up weird indent.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-01-26 10:30:22 +10:30
Rusty Russell ba2c912a39 config: remove disable-ip-discovery
Changelog-Removed: Config: `disable-ip-discovery` (deprecated in v23.02): use `announce-addr-discovered`
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-01-26 10:30:22 +10:30
Rusty Russell a2dadfe46b funder: remove lease-fee-base-msat
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Experimental: Plugins: `funder` option "lease-fee-base-msat" removed (deprecated in v0.11, use "lease-fee-base-sat")
2024-01-26 10:30:22 +10:30
Rusty Russell f342630b92 wallet: remove P2SH support.
Seriously, it's taproot time, let's get rid of p2sh wrapped segwit.

Changelog-Removed: wallet: removal of p2sh-segwit addresses; newaddr won't issue them, we won't watch them for new funds (deprecated in *23.02*)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-01-26 10:30:22 +10:30
Rusty Russell 222ca17333 pyln-client: remove long-obsolete support for msatoshi arg.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-01-26 10:30:22 +10:30
Rusty Russell 66c93dcfcf common: remove parameter aliases.
We currently don't have any!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-01-26 10:30:22 +10:30
Rusty Russell 5036605501 common: remove no-longer-required p_req_dup_ok hack.
This was for "msatoshi" and "amount_msat" in routes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-01-26 10:30:22 +10:30
Rusty Russell 5ef4779edc lightningd: remove msatoshi alias for amount_msat.
Changelog-Removed: JSON-RPC: `invoice`, `sendonion`, `sendpay`, `pay`, `keysend`, `fetchinvoice`, `sendinvoice`: `msatoshi` argument (deprecated 0.12.0). Use `amount_msat`.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-01-26 10:30:22 +10:30
Rusty Russell 0946a5ac35 lightningd: clean up notification infrastructure.
The `struct notification` lost type-safety, but avoided a redundant
string.  The string is better, I think.

Since all notifications now contain an object of same name (some have
deprecated fields outside that), we can add helpers to do that, too.

Also, add some const (easy to do now we're typesafe!)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-01-26 10:30:22 +10:30
Lagrang3 7c7d13d6dc renepay: add self-pay feature 2024-01-24 14:42:45 +10:30
singlebeam 71e41165e3 Update configuration.md 2024-01-23 12:44:08 +01:00
Matt Morehouse 3260d7dd5e fuzz: initial fuzz-bolt12-invoice-decode corpus 2024-01-23 20:21:48 +10:30
Matt Morehouse 1c18269cd1 fuzz: initial fuzz-bolt12-invrequest-decode corpus 2024-01-23 20:21:48 +10:30
Matt Morehouse 2073d9771d fuzz: initial fuzz-bolt12-offer-decode corpus 2024-01-23 20:21:48 +10:30
Matt Morehouse 3af61e087c fuzz: initial fuzz-bolt12-bech32-decode corpus 2024-01-23 20:21:48 +10:30
Matt Morehouse 7d05f07a2b fuzz: test bolt12 decoding
Add fuzz targets for decoding of offers, invoice requests, and invoices.
Mutators are shared in bolt12.h.
2024-01-23 20:21:48 +10:30
Matt Morehouse b73f921a91 fuzz: test bolt12 bech32 decoding 2024-01-23 20:21:48 +10:30
Lagrang3 b19b08d749 fix CI test: uninitialized variable 2024-01-22 15:10:08 +10:30
Lagrang3 020a03fc3b fix CIL maybe-uninitialized variable 2024-01-22 15:10:08 +10:30
Lagrang3 102dce2515 error handling in mcf.c
Adds a "canonical" error handling in the module mcf.c,
adhering to the same convention we have adopted in flow.c.
So that when a function fails it signals the caller with an invalid
return value, or bool false, and it communicates an error message.
2024-01-22 15:10:08 +10:30
Lagrang3 acc8e8e96f move function linear_fee_cost to mcf 2024-01-22 15:10:08 +10:30
Lagrang3 7edf3c2a55 remove unnecessary arguments
Functions chan_extra_can_send and chan_extra_cannot_send
do not need to know the amount, because flow is already allocated in
htlc_total.
2024-01-22 15:10:08 +10:30
Lagrang3 feef829362 remove declaration of derive_mu 2024-01-22 15:10:08 +10:30
Lagrang3 6f3e2521c8 renepay: low level update knowledge failure
failure to update the knowledge on a channel is guaranteed to preserve
the original state.
2024-01-22 15:10:08 +10:30
Lagrang3 1f6772160f uniform error handling pattern for flow.c 2024-01-22 15:10:08 +10:30
Lagrang3 af3bcddc1f renepay: remove unused derive_mu function 2024-01-22 15:10:08 +10:30
Lagrang3 c9c03dedb7 remove amount_accumulate and amount_reduce
These two functions would make 'pay_flow' dependent on 'pay'
which is not cool, 'pay_flow' should be lower level.
2024-01-22 15:10:08 +10:30
Lagrang3 c4cbc10cfa remove flow dependency on payment 2024-01-22 15:10:08 +10:30
Christian Decker 451a1465ed rs: Temporarily remove a test that is failing due to log changes 2024-01-17 20:55:03 +01:00
Ken Sedgwick e9ff50df96 hsmd: Implement hsmd_forget_channel for Channel Deletion in HSMD
Changelog-Added: hsmd: Added hsmd_forget_channel to enable explicit channel deletion. ([#6987])

Motivation: Previously, a signer prematurely forgetting a channel led
to failures in unresolved channel requests. This update introduces
hsmd_forget_channel, allowing nodes to explicitly notify signers when
a channel is irrevocably resolved and can be safely forgotten. This
ensures synchronized channel cleanup between nodes and signers.

This change maintains backward and forward compatibility. Nodes
explicitly check whether a signer has `WIRE_HSMD_FORGET_CHANNEL`
capability before sending the message.  Nodes without
`WIRE_HSMD_FORGET_CHANNEL` capability won't send this message. Signers
capable of handling this message but not receiving it will continue to
use conservative pruning methods.

Fixes #6987
2024-01-17 13:34:20 +01:00
Christian Decker 78deb485fb py: Publish pyln-grpc-proto following new methods 2024-01-16 19:47:50 +01:00
Christian Decker ea6ae31bcd doc: add a nice explainer about how to update PR branches
This is good info to have, that I often forget and have to spend time
looking for. It'd be nice to have it documented in the project somewhere
so people new the project (or new to maintaining maybe?) know where to
find it.
2024-01-16 19:00:34 +01:00
S. Santos 3ce8d20a89 Update installation.md 2024-01-16 18:38:34 +01:00
Christian Decker 60e1532dd8 cln-plugin: Switch from `env_logger` to `tracing-subscriber`
This switches the logging implementation from using the `log`-facade
to using the `tracing-subscriber` instead. This allows us to also tap
into the tracing instrumentation if desired, which was not possible
with `log`.

Changelog-Changed cln-plugin: The logging adapter now uses tracing-subscriber allowing the `tracing` ecosystem to be used. No format changes.
2024-01-16 18:36:12 +01:00
Erik De Smedt 0d877ffb71 cln-plugin: Allow setting `usage` of RPC-method
The `cln-plugin` can be used to create a plugin that registers
additional rpc-methods. However, it doesn't allow to specify the `usage`
of the command.

This change makes it possible to specify the `usage`. It should not
contain any breaking changes.

I've opted to add a new method called `rpcmethod_from_builder` to the
`Builder` struct. This approach allows us to add new parameters in the
future.
2024-01-16 16:55:06 +01:00
Jon Griffiths 43e302cd94 chaintopology: fetch item counts just once when iterating
Removes the tal_count checking overhead when iterating constant arrays.
Separated from the previous commit to make review easier.

Changelog-None

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
2024-01-16 15:47:03 +01:00
Jon Griffiths d5808d921a chaintopology: do less work when iterating blocks
- Avoid overhead from tal checks when iterating block txs
- Skip pegin txs as well as coinbase txs while iterating
- Early-exit if the txout cannot possibly be p2wsh
- Don't re-calculate the txid when we already have it
- Don't allocate a script for non-policy asset outputs
- Don't copy txids for non-interesting UTXOs

Note the below -Changed line covers the previous wally and PSBT commits
which also provide general block processing speedups.

Changelog-Changed: core: Processing blocks should now be faster

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
2024-01-16 15:47:03 +01:00
Jon Griffiths 40dd780ea7 bitcoin_block_from_hex: avoid creating PSBT wrappers for finalized block txs
Changelog-None

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
2024-01-16 15:47:03 +01:00
Jon Griffiths cdb5de0bce fromwire_bitcoin_tx: avoid creating a PSBT wrapper just to throw it away again
Changelog-None

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
2024-01-16 15:47:03 +01:00
Jon Griffiths 1b37515528 dualfund: avoid creating PSBT wrappers for input UTXOs
Changelog-None

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
2024-01-16 15:47:03 +01:00
Jon Griffiths d4fdf8b94e interactive-tx: avoid creating PSBT wrappers for input UTXOs
Changelog-None

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
2024-01-16 15:47:03 +01:00
Jon Griffiths 2137343e7a tx: add pull_bitcoin_tx_only to pull without creating a psbt wrapper
There are many contexts in which it doesn't make sense to create a PSBT
wrapping the tx. There are also tx features that are not supported in
wallys PSBT implementation yet (such as pegins), which fail if a PSBT
wrapper is created, even though such features are unlikely to ever be
used in txs that cln will create/manipulate.

Allow these cases to be explicit that they only want the tx. This avoids
hitting such errors, is clearer on the caller side, and is more efficient.

Changelog-None

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
2024-01-16 15:47:03 +01:00
Jon Griffiths 2e670a2a62 tx_parts: use wally to clone tx outputs
Input cloning has not been exposed yet; I'll add that to wally in a
future release.

Changelog-None

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
2024-01-16 15:47:03 +01:00
Jon Griffiths 23a04d1bba base58: use _n api variant to avoid duplicating our input string
Changelog-None

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
2024-01-16 15:47:03 +01:00
Jon Griffiths 5e63e55b99 psbt: use wally_map_get instead of wally_map_find
Changelog-None

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
2024-01-16 15:47:03 +01:00
Jon Griffiths 16ac5cf085 psbt: use wally_map_replace instead of coding our own
Changelog-None

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
2024-01-16 15:47:03 +01:00
Jon Griffiths ffeb5553a5 wally: build debug or release according to the top-level configuration
Wally release builds are significantly faster than debug builds. Plus we
pass down our build flags to libsecp, which means release builds have
been disabling the asm optimisations for both libraries.

Changelog-Changed: Enable optimizations for libwally/libsecp256k1-zkp

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
2024-01-16 15:47:03 +01:00
Jon Griffiths 1b2d81f7ce wally: remove now-redundant BUILD_ELEMENTS define
As of wally v1.0.0, Elements/Liquid support is enabled and part of the
library ABI by default.

Changelog-None

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
2024-01-16 15:47:03 +01:00
Jon Griffiths 84ee3d5701 wally: update libwally to 1.0.0
Also removes incorrect/redundant configure flags when building.

Changelog-Changed: Update libwally to 1.0.0

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
2024-01-16 15:47:03 +01:00
Jon Griffiths 1f45dd1acb wally: rename functions that clash with wally v1.0.0
Rename the offending functions from wally_foo to cln_wally_foo.

For the sake of a minimal diff, only calls which conflict with wally
v1.0.0 have been changed. However it is bad form to use the wally_
function namespace; the remaining such calls should also be renamed.

Changelog-None

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
2024-01-16 15:47:03 +01:00