Repository navigation
Closed
Description
I know it's very early but I'm trying to help :-)
I'm trying to pay a bolt12 offer from the latest Phoenix wallet (from CLN to Phoenix)
Using master, for the first time decode on a Phoenix Bolt12 offer works well:
lightning-cli decode lno1zrxq8pjw7qjlm68mtp7e3yvxee4y5xrgjhhyf2fxhlphpckrvevh50u0qwa3w0uk0h7vytuuytqemllkhfnaux2f2lwe0k4zhnxeu7gvz7pv2qsraavdg00v4xmpjdm7sah7qrjn06eq9tqk2jr3axlszglfct38sjxqqv7ca9z7qyjxg6jq7t900nswque9uznddry9kksky62v303pr4wzyw3pvaeqwncysfzx7qt7myhv8f4v9pf8qw3aaueuy3sm605k20vnlk5yme8g3aldws9maq29mzp788ex6qhujqqstzv26hlksmcr5efxtplpz7fswg
{
"type": "bolt12 offer",
"offer_id": "5a42852313c4fed799792e43a63b115507b4044e74eeb5424a76a9f9467c48f9",
"offer_paths": [
{
"first_node_id": "03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f",
"blinding": "03bb173f967dfcc22f9c22c19dfff6ba67de194957dd97daa2bccd9e790c1782c5",
"path": [
{
"blinded_node_id": "03ef58d43deca9b619377e876fe00e537eb202ac1654871e9bf0123e9c2e27848c",
"encrypted_recipient_data": "d8e945e0124646a40f2caf7ce0e07325e0a6d68c85b5a162694c8be211d5c223a216772074f0482446f017ed92ec3a6ac28527"
},
{
"blinded_node_id": "03a3def33c2461bd3e9653d93fda84de4e88f7ed740bbe8145d883e39f26d02fc9",
"encrypted_recipient_data": "5898ad5ff686f03a6526587e11793072"
}
]
}
],
"valid": true
}
but fetchinvoice crashes core lightning:
lightning-cli fetchinvoice lno1zrxq8pjw7qjlm68mtp7e3yvxee4y5xrgjhhyf2fxhlphpckrvevh50u0qwa3w0uk0h7vytuuytqemllkhfnaux2f2lwe0k4zhnxeu7gvz7pv2qsraavdg00v4xmpjdm7sah7qrjn06eq9tqk2jr3axlszglfct38sjxqqv7ca9z7qyjxg6jq7t900nswque9uznddry9kksky62v303pr4wzyw3pvaeqwncysfzx7qt7myhv8f4v9pf8qw3aaueuy3sm605k20vnlk5yme8g3aldws9maq29mzp788ex6qhujqqstzv26hlksmcr5efxtplpz7fswg 30000
Output:
2024-08-01T04:57:55.897Z INFO lightningd: v24.05-213-gbf54913-modded
2024-08-01T04:58:30.987Z INFO plugin-backup.py: root : Comparing backup version 212995 versus first write version 212996
2024-08-01T04:58:30.987Z INFO plugin-backup.py: Comparing backup version 212995 versus first write version 212996
2024-08-01T04:58:30.988Z INFO plugin-backup.py: root : Versions match up
2024-08-01T04:58:30.988Z INFO plugin-backup.py: Versions match up
2024-08-01T04:58:42.723Z INFO plugin-bcli: bitcoin-cli initialized and connected to bitcoind.
2024-08-01T04:58:57.709Z INFO lightningd: --------------------------------------------------
2024-08-01T04:58:57.709Z INFO lightningd: Server started with public key 02a9dbc1724ecdcd94364920c029cc5b260081d5148d6698328f8dc73b3bfa0fcd, alias shecret (color #02a9db) and lightningd v24.05-213-gbf54913-modded
offers: FATAL SIGNAL 11 (version v24.05-213-gbf54913-modded)
0x55b434b021d3 send_backtrace
common/daemon.c:33
0x55b434b0226a crashdump
common/daemon.c:75
0x7fc6ce3a051f ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x7fc6ce4f7a92 ???
../sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S:83
0x55b434aed600 pubkey_eq
./bitcoin/pubkey.h:20
0x55b434aed600 handle_invreq_response
plugins/fetchinvoice.c:230
0x55b434aedb2d handle_invoice_onion_message
plugins/fetchinvoice.c:374
0x55b434ae3ec6 onion_message_recv
plugins/offers.c:214
0x55b434af2c1e ld_command_handle
plugins/libplugin.c:1862
0x55b434af2fe9 ld_read_json_one
plugins/libplugin.c:1995
0x55b434af3075 ld_read_json
plugins/libplugin.c:2015
0x55b434c46a0e next_plan
ccan/ccan/io/io.c:60
0x55b434c46eed do_plan
ccan/ccan/io/io.c:422
0x55b434c46faa io_ready
ccan/ccan/io/io.c:439
0x55b434c489ad io_loop
ccan/ccan/io/poll.c:455
0x55b434af3828 plugin_main
plugins/libplugin.c:2225
0x55b434ae6aa5 main
plugins/offers.c:1476
0x7fc6ce387d8f __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
0x7fc6ce387e3f __libc_start_main_impl
../csu/libc-start.c:392
0x55b434ae37d4 ???
???:0
0xffffffffffffffff ???
???:0
2024-08-01T05:03:34.025Z INFO plugin-offers: Killing plugin: exited during normal operation
2024-08-01T05:03:34.025Z **BROKEN** plugin-offers: Plugin marked as important, shutting down lightningd!
2024-08-01T05:03:34.026Z INFO 031979fe6ce0e69ece6d99a4bc4a7b30ed22a8cb8703dd7dd2dfaf619e07127e0b-chan#2: Peer transient failure in CHANNELD_NORMAL: channeld: Owning subdaemon channeld died (9)
getinfo output
v24.05-213-gbf54913-modded
Activity
turizspace commentedon Aug 1, 2024
@hMsats bolt 12 should require a fetchOffer i suppose.
vincenzopalazzo commentedon Aug 1, 2024
While I did not get what @turizspace is trying to suggest, I a not able to find the commit where you are running your core lightning node.
@hMsats can you add the
git logfirst item inside the issue?vincenzopalazzo commentedon Aug 1, 2024
Ok I was able to reproduce in testnet with bf54913
hMsats commentedon Aug 1, 2024
@vincenzopalazzo I think you're referring to the
-moddedin the version number but I don't know where that came from. Did a newgit cloneto get the "unmodded"v24.05-213-gbf54913but since you were able to reproduce the issue it doesn't matter anymore.@turizspace CLN doesn't have
fetchOffer. I copied the bolt12 offer directly from my Phoenix wallet (installed from the latest version on GitHub)hMsats commentedon Aug 4, 2024
I boldly commented out the following test in fetchinvoice.c (lines 229-232)
and now I first got:
without crashing CLN. Then I tried again and now it worked well:
Then first decoded the invoice:
I then tried to pay the invoice:
which at this stage is probably normal.
So the only problem seems to be the code starting at line 229 in fetchinvoice.c
hMsats commentedon Aug 4, 2024
Note: when I turn off Phoenix wallet on my phone, I correctly get:
hMsats commentedon Aug 4, 2024
Note: I'm able to pay "normal" invoices from CLN to my Phoenix wallet:
hMsats commentedon Aug 4, 2024
Possible solution: shouldn't
inv->offer_issuer_idbeinv->invoice_node_idinfetchinvoice.cline 230? With that change the test works fine.offers: fix crash when receiving response to offer without `offer_iss…
rustyrussell commentedon Aug 5, 2024
Great report! We don't create an offer without an offer_issuer_id, so this (crap) code was untested :(
Thanks for catching it before release!!
offers: fix crash when receiving response to offer without `offer_iss…
offers: fix crash when receiving response to offer without `offer_iss…
offers: fix crash when receiving response to offer without `offer_iss…
hMsats commentedon Aug 7, 2024
I don't know if this is useful but my Phoenix log shows the following when I try to pay an invoice obtained via
fetchinvoice:all the time I see
payload=<0 bytes>