Keep a proper cache of all possible ones. I think this may be the
timeout problem: according to the logs, channeld_fakenet stops responding
and thus HTLCs eventually time out.
```
```
2024-12-16T23:16:16.4874420Z lightningd-1 2024-12-16T22:45:14.068Z UNUSUAL 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-channeld-chan#1: Adding HTLC 18446744073709551615 too slow: killing connection
```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We can get the reply_short_channel_ids_end in the messages when
we make a query:
```
2024-11-29T07:39:28.8550652Z time_fast = time.time() - start_fast
2024-11-29T07:39:28.8551067Z assert time_fast < 2
2024-11-29T07:39:28.8551487Z out3 = [m for m in out3 if not m.startswith(b'0109')]
2024-11-29T07:39:28.8552158Z > assert set(out1) == set(out3)
...
2024-11-29T07:39:28.8675516Z E Extra items in the right set:
2024-11-29T07:39:28.8675887Z E b'010606226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f01'
```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This should help us fix the flakes. Dealing with them was a major
headache at the end of the last release (and they covered up real bugs!).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cut & paste from the forwarding code, where we don't let onions use the
unannounced scids. Obviously local commands can use them.
Reported-by: @michael1011
Changelog-Fixed: JSON-RPC: xpay now works through unannounced channels.
Note that the slight code reorder changes the JSON order, which is generally
undefined, but our doc checker is very strict!
Changelog-Changed: `xpay` now gives the same JSON success return as documented by `pay` when `xpay-handle-pay` is set.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fixes: https://github.com/ElementsProject/lightning/issues/7923
maxfeepercent is use by Zeus, so let's make that work.
maxfee is more precise, so it's the only xpay option (maxfee was added
to pay later).
[ Fix to ppm logic by Lagrang3, thanks! --RR ]
Fixes: https://github.com/ElementsProject/lightning/issues/7926
Changelog-Changed: JSON-RPC: With `xpay-handle-pay` set, xpay will now be used even if `pay` uses maxfeeprecent or exemptfee parameters (e.g. Zeus)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This means that it gets shown in listsendpays: omitting this broke spark, apparently!
Changelog-Changed: `xpay` now populates more fields, so `listsendpays` and `listpays` show `destination` and `amount_msat` fields for xpay payments.
Fixes: https://github.com/ElementsProject/lightning/issues/7881
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
If they give us the invstring, we can at least set who signed the invoice. Of course,
it might not be a real node_id (with blinded paths).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This appears in listsendpays / listpays, and is useful information (if we know!).
This doesn't fix old payments, but means that xpay can use this for new payments.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
I used an unknown arg and it didn't complain. injectpaymentonion's schema predated
the sweep which fixed up use of "additionalProperties".
Indeed, we were missing some properties!
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
There was a wrong assumption that the number of bytes read
by `cli_read` would get us for each correctly read token
two extra CR characters. As a matter of fact one could read
enough characters to parse the first token, but the two
extra CR characters are not guaranteed.
```
==143570== Memcheck, a memory error detector
==143570== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==143570== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==143570== Command: /home/lagrange/BACKUP/l4-appdata/github/lagrang3/lightning/cli/lightning-cli --lightning-dir=/tmp/askrene_benchmark/lightning -k getroutes source=032ed0d87ba2bd68e3a386717cf2faaae4fa6d6da247986b1997113930e4f841d5 destination=03b2f16bf472dd03c55c2ce9910aab717321db4489cd87df5225adadb08031da4b amount_msat=100000sat final_cltv=6 layers=[] maxfee_msat=500sat
==143570==
==143570== Invalid read of size 1
==143570== at 0x484A430: memmove (vg_replace_strmem.c:1382)
==143570== by 0x10C3D2: main (lightning-cli.c:871)
==143570== Address 0x4a62f80 is 0 bytes after a block of size 1,040 alloc'd
==143570== at 0x48407B4: malloc (vg_replace_malloc.c:381)
==143570== by 0x11402E: allocate (tal.c:256)
==143570== by 0x11471E: tal_alloc_ (tal.c:473)
==143570== by 0x1147EA: tal_alloc_arr_ (tal.c:517)
==143570== by 0x10C206: main (lightning-cli.c:816)
==143570==
==143570== Invalid read of size 1
==143570== at 0x484A43D: memmove (vg_replace_strmem.c:1382)
==143570== by 0x10C3D2: main (lightning-cli.c:871)
==143570== Address 0x4a62f81 is 1 bytes after a block of size 1,040 alloc'd
==143570== at 0x48407B4: malloc (vg_replace_malloc.c:381)
==143570== by 0x11402E: allocate (tal.c:256)
==143570== by 0x11471E: tal_alloc_ (tal.c:473)
==143570== by 0x1147EA: tal_alloc_arr_ (tal.c:517)
==143570== by 0x10C206: main (lightning-cli.c:816)
==143570==
==143570== Invalid write of size 1
==143570== at 0x484A433: memmove (vg_replace_strmem.c:1382)
==143570== by 0x10C3D2: main (lightning-cli.c:871)
==143570== Address 0x4a62f80 is 0 bytes after a block of size 1,040 alloc'd
==143570== at 0x48407B4: malloc (vg_replace_malloc.c:381)
==143570== by 0x11402E: allocate (tal.c:256)
==143570== by 0x11471E: tal_alloc_ (tal.c:473)
==143570== by 0x1147EA: tal_alloc_arr_ (tal.c:517)
==143570== by 0x10C206: main (lightning-cli.c:816)
```
Changelog-Fixed: lightning-cli: fix "malformed response" bug
Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
We ratelimited DEBUG messages, but that can be annoying and cause us to miss things.
We demoted the worst offenders in the last release, to TRACE level.
Now, only log trace if it's wanted, and never suppress DEBUG.
Changelog-Changed: Logging: we no longer suppress DEBUG messages from subdaemons.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fixes: https://github.com/ElementsProject/lightning/issues/7917
header sys/errno.h gets re-directed to errno.h leading to warning and
then failure so instead directly referencing the header
Changelog-None: change header
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
We are checking if `txw->depth` is `-1` and then print it, when we
clearly want `depth` instead.
Changelog-Fixed logs: When printing depths some unsigned numbers could overflow
It's actually tested by fetchinvoice, but doing an explicit test in Python
allows for schema checking!
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: JSON-RPC: `injectonionmessage` API simplified and documented.
It's undocumented and only used in one place, so we can change it (it
was new in 24.08).
We really want to be able to just handle a raw onionmessage: this allows
oblivious sending of messages, but also, in combination with the coming
onionmessage_forward_fail notification, allows us to connect then
reinject.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Clarify that the ability to reproducibly build a piece of software has
nothing to do with being a maintainer.
Minor typo/grammar fixes.
Changelog-None.
See: https://github.com/ElementsProject/lightning/issues/7899
A node with 23 connections gets far too many debug messages.
Changelog-Fixed: `gossipd` now does logging at trace, not debug level.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
- Removed branch testing as it is not required. Point releases will trigger the event due to `tag` push even when it is not from master branch.
- Added version in inputs for testing
- Added missing `inputs` tag
Changelog-None.