Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using fetchinvoice on a Phoenix Bolt12 offer crashes CLN #7513

Closed
hMsats opened this issue Aug 1, 2024 · 10 comments · Fixed by #7525
Closed

Using fetchinvoice on a Phoenix Bolt12 offer crashes CLN #7513

hMsats opened this issue Aug 1, 2024 · 10 comments · Fixed by #7525
Labels
Milestone

Comments

@hMsats
Copy link
Contributor

hMsats commented Aug 1, 2024

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

@vincenzopalazzo vincenzopalazzo added this to the v24.08 milestone Aug 1, 2024
@turizspace
Copy link

@hMsats bolt 12 should require a fetchOffer i suppose.

@vincenzopalazzo
Copy link
Contributor

vincenzopalazzo commented 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 log first item inside the issue?

@vincenzopalazzo
Copy link
Contributor

vincenzopalazzo commented Aug 1, 2024

Ok I was able to reproduce in testnet with bf54913

➜  ~ lightning-cli --testnet fetchinvoice lno1qgsyxjtl6luzd9t3pr62xr7eemp6awnejusgf6gw45q75vcfqqqqqqqsespexwyy4tcadvgg89l9aljus6709kx235hhqrk6n8dey98uyuftzdqzrtkahuum7m56dxlnx8r6tffy54004l7kvs7pylmxx7xs4n54986qyqeeuhhunayntt50snmdkq4t7fzsgghpl69v9csgparek8kv7dlp5uqr8ymp5s4z9upmwr2s8xu020d45t5phqc8nljrq8gzsjmurzevawjz6j6rc95xwfvnhgfx6v4c3jha7jwynecrz3y092nn25ek4yl7xp9yu9ry9zqagt0ktn4wwvqg52v9ss9ls22sqyqqestzp2l6decpn87pq96udsvx 10sat
offers: FATAL SIGNAL 11 (version v24.05-213-gbf54913)
0x5647ab786889 send_backtrace
	common/daemon.c:33
0x5647ab786911 crashdump
	common/daemon.c:75
0x7f8c0f73fd5f ???
	./signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x7f8c0f86095e ???
	../sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S:75
0x5647ab7724a8 pubkey_eq
	./bitcoin/pubkey.h:20
0x5647ab7724a8 handle_invreq_response
	plugins/fetchinvoice.c:230
0x5647ab7729d2 handle_invoice_onion_message
	plugins/fetchinvoice.c:374
0x5647ab768e4e onion_message_recv
	plugins/offers.c:214
0x5647ab777995 ld_command_handle
	plugins/libplugin.c:1862
0x5647ab777d6b ld_read_json_one
	plugins/libplugin.c:1995
0x5647ab777df4 ld_read_json
	plugins/libplugin.c:2015
0x5647ab81236d next_plan
	ccan/ccan/io/io.c:60
0x5647ab8127f8 do_plan
	ccan/ccan/io/io.c:422
0x5647ab8128b1 io_ready
	ccan/ccan/io/io.c:439
0x5647ab8141fe io_loop
	ccan/ccan/io/poll.c:455
0x5647ab778587 plugin_main
	plugins/libplugin.c:2225
0x5647ab76b9eb main
	plugins/offers.c:1476
0x7f8c0f72ad09 __libc_start_main
	../csu/libc-start.c:308
0x5647ab768779 ???
	???:0
0xffffffffffffffff ???
	???:0
{
   "code": -4,
   "message": "Plugin terminated before replying to RPC call."
}

@hMsats
Copy link
Contributor Author

hMsats commented Aug 1, 2024

@vincenzopalazzo I think you're referring to the -modded in the version number but I don't know where that came from. Did a new git clone to get the "unmodded" v24.05-213-gbf54913 but 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
Copy link
Contributor Author

hMsats commented Aug 4, 2024

I boldly commented out the following test in fetchinvoice.c (lines 229-232)

if (!inv->invoice_node_id || !pubkey_eq(inv->offer_issuer_id, sent->issuer_key)) {
                badfield = "invoice_node_id";
                goto badinv;
}

and now I first got:

lightning-cli fetchinvoice lno1zrxq8pjw7qjlm68mtp7e3yvxee4y5xrgjhhyf2fxhlphpckrvevh50u0qwa3w0uk0h7vytuuytqemllkhfnaux2f2lwe0k4zhnxeu7gvz7pv2qsraavdg00v4xmpjdm7sah7qrjn06eq9tqk2jr3axlszglfct38sjxqqv7ca9z7qyjxg6jq7t900nswque9uznddry9kksky62v303pr4wzyw3pvaeqwncysfzx7qt7myhv8f4v9pf8qw3aaueuy3sm605k20vnlk5yme8g3aldws9maq29mzp788ex6qhujqqstzv26hlksmcr5efxtplpz7fswg 42000
{
   "code": 1005,
   "message": "Timeout waiting for response"
}

without crashing CLN. Then I tried again and now it worked well:

lightning-cli fetchinvoice lno1zrxq8pjw7qjlm68mtp7e3yvxee4y5xrgjhhyf2fxhlphpckrvevh50u0qwa3w0uk0h7vytuuytqemllkhfnaux2f2lwe0k4zhnxeu7gvz7pv2qsraavdg00v4xmpjdm7sah7qrjn06eq9tqk2jr3axlszglfct38sjxqqv7ca9z7qyjxg6jq7t900nswque9uznddry9kksky62v303pr4wzyw3pvaeqwncysfzx7qt7myhv8f4v9pf8qw3aaueuy3sm605k20vnlk5yme8g3aldws9maq29mzp788ex6qhujqqstzv26hlksmcr5efxtplpz7fswg 42000
{
   "invoice": "lni1qqgyq9a6ddqn53yhpacerdn8aze4gyxvqwryaup9lh50kkranzgcdnn2fgvx390wgj5jd07rwr3vxeje0glc7qamzulevl0ucghecgkpnhlldwn8mcv5j47ajld290xdneusc9uzc5pq8m6c6s77e2dkrymhapm0uq89xl4jq2kpv4y8r6dlqy37nshz0pyvqqea3629uqfyv34ypuk27l8qupejtc9x66xgtddpvf55ezlzz82uygazzemjqa8sfqjyduqhakfwcwn2c2zjwqarmmencfrph5lfv57e8ldgfhjw3rm76aqth6q5tkyruw0jd5p0eyqpqkyc440ldphs8fjjvkr7z9unqujjq2jpqkppqfm8fn3u38f0elc73mdrf0ltz90fhjvpvx5pppld8lnu9wtt8ydp8g8aqxvs8pjw7qjlm68mtp7e3yvxee4y5xrgjhhyf2fxhlphpckrvevh50u0qwnlg2qecnkxfdhlu7fmeyprc4vg75ua7tga66nh9ej3ej0af6m7qqsrmm85kfmr0hs4y0zcq0dxa55fq25aetj58nc7hmzss2y4z7e7sz6sq3z6ds3cc4yath7k40g26ye96klg9rhl6x3flskepu7y2t8t9fzuju6a5dkejnqf8j2agpkzsqlu64hf2uz98vcmjuhx09h37vj255t6v42klnqqyj3mmlrunhvvkvzjk4due3zwhtz78gnzfd3qhqxxay3k6x88qfz3qrxqn28wsutdnsxccjgz434n0ggzl9wny88nak6skuw79c3xvacskpq9rlj5tz95sl2nu70s0w7aln3ew7y2me0dunnfn222tck7fqcsxu67j69yqasmkpcsqgghkrq2f9a2w0vmes76wja8raevpgcmcpf3u373pu0gjp29zqz2s3gyh295hvknr43al84kl7989465df9dghzszruh2q2s58vm6t74j0yxlpdl0rms7vmzvvyjpk3evfgpm83gpsue6leaxauh36g6fm0nw452kqen4f6mdj5ajpscvk87eup2uwp8nnlr2y2v9sfuaquv7awrcj3pcqqqq05qqqqqvsqfqqqqqqqqqqqqqyqqqqqqqqq2gyqqqzjqge40v992vqfu4qswff99pupu7anxv98sekkpja3segz3kn898g43qwy80yk5tg885yd2q2jpptsrqgqqpvppqw3aaueuy3sm605k20vnlk5yme8g3aldws9maq29mzp788ex6qhunuzq0pv8c0zch6crg05ccvykz2tp695aylwhdsjuymqf2n0g6x0mxv7ct7exhduu2cpgmxl75lngzvqp3clefraxx28kvgt9qfu2f4xeaxs",
   "changes": {}
}

Then first decoded the invoice:

lightning-cli decode lni1qqgyq9a6ddqn53yhpacerdn8aze4gyxvqwryaup9lh50kkranzgcdnn2fgvx390wgj5jd07rwr3vxeje0glc7qamzulevl0ucghecgkpnhlldwn8mcv5j47ajld290xdneusc9uzc5pq8m6c6s77e2dkrymhapm0uq89xl4jq2kpv4y8r6dlqy37nshz0pyvqqea3629uqfyv34ypuk27l8qupejtc9x66xgtddpvf55ezlzz82uygazzemjqa8sfqjyduqhakfwcwn2c2zjwqarmmencfrph5lfv57e8ldgfhjw3rm76aqth6q5tkyruw0jd5p0eyqpqkyc440ldphs8fjjvkr7z9unqujjq2jpqkppqfm8fn3u38f0elc73mdrf0ltz90fhjvpvx5pppld8lnu9wtt8ydp8g8aqxvs8pjw7qjlm68mtp7e3yvxee4y5xrgjhhyf2fxhlphpckrvevh50u0qwnlg2qecnkxfdhlu7fmeyprc4vg75ua7tga66nh9ej3ej0af6m7qqsrmm85kfmr0hs4y0zcq0dxa55fq25aetj58nc7hmzss2y4z7e7sz6sq3z6ds3cc4yath7k40g26ye96klg9rhl6x3flskepu7y2t8t9fzuju6a5dkejnqf8j2agpkzsqlu64hf2uz98vcmjuhx09h37vj255t6v42klnqqyj3mmlrunhvvkvzjk4due3zwhtz78gnzfd3qhqxxay3k6x88qfz3qrxqn28wsutdnsxccjgz434n0ggzl9wny88nak6skuw79c3xvacskpq9rlj5tz95sl2nu70s0w7aln3ew7y2me0dunnfn222tck7fqcsxu67j69yqasmkpcsqgghkrq2f9a2w0vmes76wja8raevpgcmcpf3u373pu0gjp29zqz2s3gyh295hvknr43al84kl7989465df9dghzszruh2q2s58vm6t74j0yxlpdl0rms7vmzvvyjpk3evfgpm83gpsue6leaxauh36g6fm0nw452kqen4f6mdj5ajpscvk87eup2uwp8nnlr2y2v9sfuaquv7awrcj3pcqqqq05qqqqqvsqfqqqqqqqqqqqqqyqqqqqqqqq2gyqqqzjqge40v992vqfu4qswff99pupu7anxv98sekkpja3segz3kn898g43qwy80yk5tg885yd2q2jpptsrqgqqpvppqw3aaueuy3sm605k20vnlk5yme8g3aldws9maq29mzp788ex6qhunuzq0pv8c0zch6crg05ccvykz2tp695aylwhdsjuymqf2n0g6x0mxv7ct7exhduu2cpgmxl75lngzvqp3clefraxx28kvgt9qfu2f4xeaxs
{
   "type": "bolt12 invoice",
   "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"
            }
         ]
      }
   ],
   "invreq_metadata": "4017ba6b413a44970f7191b667e8b354",
   "invreq_payer_id": "027674ce3c89d2fcff1e8eda34bfeb115e9bc98161a81087ed3fe7c2b96b391a13",
   "invreq_amount_msat": 42000,
   "invoice_paths": [
      {
         "first_node_id": "03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f",
         "blinding": "03a7f42819c4ec64b6ffe793bc9023c5588f539df2d1dd6a772e651cc9fd4eb7e0",
         "payinfo": {
            "fee_base_msat": 1000,
            "fee_proportional_millionths": 100,
            "cltv_expiry_delta": 144,
            "features": ""
         },
         "path": [
            {
               "blinded_node_id": "03decf4b27637de1523c5803da6ed28902a9dcae543cf1ebec508289517b3e80b5",
               "encrypted_recipient_data": "5a6c238c549d5dfd6abd0ad1325d5be828effd1a29fc2d90f3c452ceb2a45c9735da36d994c093c95d406c2803fcd56e9570453b31b972e6796f1f324aa517a65556fcc0"
            },
            {
               "blinded_node_id": "024a3bdfc7c9dd8cb3052b55bccc44ebac5e3a2624b620b80c6e9236d18e702451",
               "encrypted_recipient_data": "09a8ee8716d9c0d8c4902ac6b37a102f95d321cf3edb50b71de2e22667710b04051fe54588b487d53e79f07bbddfce397788ade5ede4e699a94a5e2de483103735e968a40761bb071002117b0c0a497aa73d9bcc3da74ba71f72c0a31bc0531e47d10f1e8905451004a84504ba8b4bb2d31d63df9eb6ff8a72d7546a4ad45c5010f9750150a1d9bd2fd593c86f85bf78f70f3362630920da3962501d9e280c399d7f3d377978e91a4edf37568ab0333aa75b6ca9d90618658fecf02ae38279cfe35114c2c13ce838cf75c3c4"
            }
         ]
      }
   ],
   "invoice_created_at": 1722769738,
   "invoice_relative_expiry": 60,
   "invoice_payment_hash": "e4a4a50f03cf7666614f0cdac197630ca051b4ce53a2b103887792d45a0e7a11",
   "invoice_amount_msat": 42000,
   "features": "020000",
   "invoice_node_id": "03a3def33c2461bd3e9653d93fda84de4e88f7ed740bbe8145d883e39f26d02fc9",
   "signature": "78587c3c58beb0343e98c309612961d169d27dd76c25c26c0954de8d19fb333d85fb26bb79c56028d9bfea7e68130018e3f948fa6328f6621650278a4d4d9e9a",
   "valid": true
}

I then tried to pay the invoice:

lightning-cli pay lni1qqgyq9a6ddqn53yhpacerdn8aze4gyxvqwryaup9lh50kkranzgcdnn2fgvx390wgj5jd07rwr3vxeje0glc7qamzulevl0ucghecgkpnhlldwn8mcv5j47ajld290xdneusc9uzc5pq8m6c6s77e2dkrymhapm0uq89xl4jq2kpv4y8r6dlqy37nshz0pyvqqea3629uqfyv34ypuk27l8qupejtc9x66xgtddpvf55ezlzz82uygazzemjqa8sfqjyduqhakfwcwn2c2zjwqarmmencfrph5lfv57e8ldgfhjw3rm76aqth6q5tkyruw0jd5p0eyqpqkyc440ldphs8fjjvkr7z9unqujjq2jpqkppqfm8fn3u38f0elc73mdrf0ltz90fhjvpvx5pppld8lnu9wtt8ydp8g8aqxvs8pjw7qjlm68mtp7e3yvxee4y5xrgjhhyf2fxhlphpckrvevh50u0qwnlg2qecnkxfdhlu7fmeyprc4vg75ua7tga66nh9ej3ej0af6m7qqsrmm85kfmr0hs4y0zcq0dxa55fq25aetj58nc7hmzss2y4z7e7sz6sq3z6ds3cc4yath7k40g26ye96klg9rhl6x3flskepu7y2t8t9fzuju6a5dkejnqf8j2agpkzsqlu64hf2uz98vcmjuhx09h37vj255t6v42klnqqyj3mmlrunhvvkvzjk4due3zwhtz78gnzfd3qhqxxay3k6x88qfz3qrxqn28wsutdnsxccjgz434n0ggzl9wny88nak6skuw79c3xvacskpq9rlj5tz95sl2nu70s0w7aln3ew7y2me0dunnfn222tck7fqcsxu67j69yqasmkpcsqgghkrq2f9a2w0vmes76wja8raevpgcmcpf3u373pu0gjp29zqz2s3gyh295hvknr43al84kl7989465df9dghzszruh2q2s58vm6t74j0yxlpdl0rms7vmzvvyjpk3evfgpm83gpsue6leaxauh36g6fm0nw452kqen4f6mdj5ajpscvk87eup2uwp8nnlr2y2v9sfuaquv7awrcj3pcqqqq05qqqqqvsqfqqqqqqqqqqqqqyqqqqqqqqq2gyqqqzjqge40v992vqfu4qswff99pupu7anxv98sekkpja3segz3kn898g43qwy80yk5tg885yd2q2jpptsrqgqqpvppqw3aaueuy3sm605k20vnlk5yme8g3aldws9maq29mzp788ex6qhunuzq0pv8c0zch6crg05ccvykz2tp695aylwhdsjuymqf2n0g6x0mxv7ct7exhduu2cpgmxl75lngzvqp3clefraxx28kvgt9qfu2f4xeaxs
{
   "code": 203,
   "message": "failed: WIRE_INVALID_ONION_BLINDING (reply from remote)",
   "id": 262,
   "failcode": 49176,
   "failcodename": "WIRE_INVALID_ONION_BLINDING",
   "bolt12": "lni1qqgyq9a6ddqn53yhpacerdn8aze4gyxvqwryaup9lh50kkranzgcdnn2fgvx390wgj5jd07rwr3vxeje0glc7qamzulevl0ucghecgkpnhlldwn8mcv5j47ajld290xdneusc9uzc5pq8m6c6s77e2dkrymhapm0uq89xl4jq2kpv4y8r6dlqy37nshz0pyvqqea3629uqfyv34ypuk27l8qupejtc9x66xgtddpvf55ezlzz82uygazzemjqa8sfqjyduqhakfwcwn2c2zjwqarmmencfrph5lfv57e8ldgfhjw3rm76aqth6q5tkyruw0jd5p0eyqpqkyc440ldphs8fjjvkr7z9unqujjq2jpqkppqfm8fn3u38f0elc73mdrf0ltz90fhjvpvx5pppld8lnu9wtt8ydp8g8aqxvs8pjw7qjlm68mtp7e3yvxee4y5xrgjhhyf2fxhlphpckrvevh50u0qwnlg2qecnkxfdhlu7fmeyprc4vg75ua7tga66nh9ej3ej0af6m7qqsrmm85kfmr0hs4y0zcq0dxa55fq25aetj58nc7hmzss2y4z7e7sz6sq3z6ds3cc4yath7k40g26ye96klg9rhl6x3flskepu7y2t8t9fzuju6a5dkejnqf8j2agpkzsqlu64hf2uz98vcmjuhx09h37vj255t6v42klnqqyj3mmlrunhvvkvzjk4due3zwhtz78gnzfd3qhqxxay3k6x88qfz3qrxqn28wsutdnsxccjgz434n0ggzl9wny88nak6skuw79c3xvacskpq9rlj5tz95sl2nu70s0w7aln3ew7y2me0dunnfn222tck7fqcsxu67j69yqasmkpcsqgghkrq2f9a2w0vmes76wja8raevpgcmcpf3u373pu0gjp29zqz2s3gyh295hvknr43al84kl7989465df9dghzszruh2q2s58vm6t74j0yxlpdl0rms7vmzvvyjpk3evfgpm83gpsue6leaxauh36g6fm0nw452kqen4f6mdj5ajpscvk87eup2uwp8nnlr2y2v9sfuaquv7awrcj3pcqqqq05qqqqqvsqfqqqqqqqqqqqqqyqqqqqqqqq2gyqqqzjqge40v992vqfu4qswff99pupu7anxv98sekkpja3segz3kn898g43qwy80yk5tg885yd2q2jpptsrqgqqpvppqw3aaueuy3sm605k20vnlk5yme8g3aldws9maq29mzp788ex6qhunuzq0pv8c0zch6crg05ccvykz2tp695aylwhdsjuymqf2n0g6x0mxv7ct7exhduu2cpgmxl75lngzvqp3clefraxx28kvgt9qfu2f4xeaxs",
   "raw_message": "c018deabbd37b638f22278355e7f0ff082ed1f2d52ce86414a243e95843af693b22d",
   "created_at": 1722769748,
   "destination": "03a3def33c2461bd3e9653d93fda84de4e88f7ed740bbe8145d883e39f26d02fc9",
   "payment_hash": "e4a4a50f03cf7666614f0cdac197630ca051b4ce53a2b103887792d45a0e7a11",
   "status": "failed",
   "amount_msat": 43004,
   "amount_sent_msat": 0,
   "erring_index": 2,
   "erring_node": "03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f"
}

which at this stage is probably normal.

So the only problem seems to be the code starting at line 229 in fetchinvoice.c

@hMsats
Copy link
Contributor Author

hMsats commented Aug 4, 2024

Note: when I turn off Phoenix wallet on my phone, I correctly get:

lightning-cli fetchinvoice lno1zrxq8pjw7qjlm68mtp7e3yvxee4y5xrgjhhyf2fxhlphpckrvevh50u0qwa3w0uk0h7vytuuytqemllkhfnaux2f2lwe0k4zhnxeu7gvz7pv2qsraavdg00v4xmpjdm7sah7qrjn06eq9tqk2jr3axlszglfct38sjxqqv7ca9z7qyjxg6jq7t900nswque9uznddry9kksky62v303pr4wzyw3pvaeqwncysfzx7qt7myhv8f4v9pf8qw3aaueuy3sm605k20vnlk5yme8g3aldws9maq29mzp788ex6qhujqqstzv26hlksmcr5efxtplpz7fswg 42000
{
   "code": 1005,
   "message": "Timeout waiting for response"
}

@hMsats
Copy link
Contributor Author

hMsats commented Aug 4, 2024

Note: I'm able to pay "normal" invoices from CLN to my Phoenix wallet:

lightning-cli pay lnbc1pn27e5cpp56saurku7de8tg2xkmuhj89674s7g4hw5xqzc6newpy6yymq8klfscqpjsp5qkxuqlptp5y62x5gwxclw8my84gey6tv8hxxns626r6jfeun2uas9q7sqqqqqqqqqqqqqqqqqqqsqqqqqysgqdqqmqz9gxqyjw5qrzjqwryaup9lh50kkranzgcdnn2fgvx390wgj5jd07rwr3vxeje0glclluxwv9rqu2e4sqqqqlgqqqqqeqqjqnz40u8l6cqfufhgyf2fajstqs07fstu0u48xf9alxkjmyjkcwdvkkd98mc2xh5j7pu0llxh8fqw0886e9jwkhy2pr6lnddwf7p34uasp74l3p6 41000
{
   "destination": "021d42b28b34c9ff3c98fa8408b4b58e4ecf2acf7fcdc171438e86730a307159ac",
   "payment_hash": "d43bc1db9e6e4eb428d6df2f23975eac3c8addd430058d4f2e0934426c07b7d3",
   "created_at": 1722771243.434156162,
   "parts": 1,
   "amount_msat": 41000,
   "amount_sent_msat": 42004,
   "payment_preimage": "1335b32a36ae30825bcb31af116dd490a87790c11f129bc72507aa2e11516414",
   "status": "complete"
}

@hMsats
Copy link
Contributor Author

hMsats commented Aug 4, 2024

Possible solution: shouldn't inv->offer_issuer_id be inv->invoice_node_id in fetchinvoice.c line 230? With that change the test works fine.

rustyrussell added a commit to rustyrussell/lightning that referenced this issue Aug 5, 2024
…uer_id`

Now we actually check the other fields too, as per BOLT!

Reported-by: https://github.com/hMsats
Fixes: ElementsProject#7513
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell
Copy link
Contributor

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!!

rustyrussell added a commit to rustyrussell/lightning that referenced this issue Aug 5, 2024
…uer_id`

Now we actually check the other fields too, as per BOLT!

Reported-by: https://github.com/hMsats
Fixes: ElementsProject#7513
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ShahanaFarooqui pushed a commit to rustyrussell/lightning that referenced this issue Aug 6, 2024
…uer_id`

Now we actually check the other fields too, as per BOLT!

Reported-by: https://github.com/hMsats
Fixes: ElementsProject#7513
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@hMsats
Copy link
Contributor Author

hMsats commented 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:

2024-08-04 13:34:35,781 INFO  f.a.lightning.io.Peer  - sending OnionMessage(blindingKey=0301f44439abfd987f6dbd75a8bd99ea4f10f47152411be04a70b06c9a2854f789, onionRoutingPacket=OnionRoutingPacket(version=0, publicKey=03ca76055dfed0bca619f2f616c80a9c09a7d43140ea115ced924a28a429f42987, payload=<0 bytes>, hmac=f9ae76e12c936a94b3360f4466d0800feb51ab11c1d3cb197455cfa5b6250b1f)) (truncated payload)

all the time I see payload=<0 bytes>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants