-
Notifications
You must be signed in to change notification settings - Fork 912
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
Fix offer payment failure #7839
Fix offer payment failure #7839
Conversation
Uh! and I leave the PR open without fixing it? what a rude person I am becoming. Thanks for taking this for me I completely forgot. LN summit organization took from me some cycles of CPU and I forget to put it on my todo list. Back to the PR, now a couple of them are failing
|
e7cc8d6
to
105c03a
Compare
Yes, this revealed a different bug, so I fixed that too! |
105c03a
to
1e49d4c
Compare
I had to use fprintf, which is terrible. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Don't reply with update_fail_malformed_htlc, even though WIRE_INVALID_ONION_BLINDING has BADONION set. Fail it with a normal error message. This fixes a known FIXME. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Fixed: Protocol: entry to blinded paths return more useful errors (e.g if it's the final node, you get a real error, otherwise you get invalid_onion_blinding).
``` > raise RpcError(method, payload, resp['error']) E pyln.client.lightning.RpcError: RPC call failed: method: pay, payload: {'bolt11': 'lni1qqgvsykv6pslpmzq73597z0ws2qv5q3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg48getnw30k7enxv4e97amfw3597urjd9mxzar9ta3ksctwdejkcu6ld46kcaredphhqvssacp462c3jt0m5y6wzrj5pp6axehtez7r20265antsrqfpvuu8fwcshgzqjushll8xx9x356tn40gk9mxzkyua9ajtrdpyhm3uaj9nvj0fm9qyqnjp20gp6gr2qsmfas7j086jvkmszqgyys3uht6jq7g4p6vsg7fyyqrx76aulp40m9uxejn57eyczy6v6hqmxr8xx273l480kd5zcl0g9hqp3d9qnsrj40gmeshx0w7fu6j9cfthksz2xv78wxr4ae4wrc3lht8lryc2kxxdpxvs3tpdepm0asuvp0l25fqqvjumjneecjg9etepcu426t2ueu6p3escfrxl9ggnkh5k2vm929tnt26dx66nt67kfy5lgx99py2jhqalaqkyypjeu2artvufgydym4tryv0wvkca78ac64mjeqt70d3wsmjcjgnqnjsyqrzymjxzydqkkw24ufxqslttwlj3s608f0rx2slc7etw0833zgs7kppqd350d9wur2l6mkanmpsswv4xrc49kaq6ey9sfn3rg3z8afgng8fdg8aqr7sxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzzaqtyu8wy0yul9hk026znqy6pn6xd2fpxva7jjcpmvqugeewk7emufyqsru03er082j6ya0p694k6qu858hl0g9rt7g2y042ppzyhdv4qdv99qqs3scf49sff7vg27zlmx6n3kgywrh3s82rwgpza2s8jmqqx72ah0kurp94rj7dlxq438nnm34w78kq7hwu53chx0aqh824eqcsgmq9j2fyvsqttg4yksstnk7h7ga5as69fhemltg0m9hqnn2yxr0lxv70293l7ryqpjfamk2k4mzgax8txef7zcxdzjn0wg7te2cx98ft9cyhk0hquzypasww8m40kyzyqvahtzamflylsygnny5gwqqqqqqyqqqqq2qq9sqqqqqqqqqqqqqqqqqqp6tqqqqqqq5szxdnxnuk5zpctsclfcs4yx0kcvz8nckast2ueswxftuelh49su6sqs2vlzs8ha4gqs9vppqvk0zhg6m8z2prfxa2cerrmn9k803lwx4wukgzlnmvt5xukyjycyauzqwvm6pxlfpfffgktvj3wkurcwrqcp0537hnkd8pnm7tsa0zcklua9zv338cjuphz38wml6tlr8xgdzxdsqh0ks2pns2zkn3c52crfcfs'}, error: {'code': 203, 'message': 'failed: WIRE_INVALID_ONION_PAYLOAD (reply from remote)', 'id': 1, 'failcode': 16406, 'failcodename': 'WIRE_INVALID_ONION_PAYLOAD', 'bolt12': 'lni1qqgvsykv6pslpmzq73597z0ws2qv5q3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqgzpg48getnw30k7enxv4e97amfw3597urjd9mxzar9ta3ksctwdejkcu6ld46kcaredphhqvssacp462c3jt0m5y6wzrj5pp6axehtez7r20265antsrqfpvuu8fwcshgzqjushll8xx9x356tn40gk9mxzkyua9ajtrdpyhm3uaj9nvj0fm9qyqnjp20gp6gr2qsmfas7j086jvkmszqgyys3uht6jq7g4p6vsg7fyyqrx76aulp40m9uxejn57eyczy6v6hqmxr8xx273l480kd5zcl0g9hqp3d9qnsrj40gmeshx0w7fu6j9cfthksz2xv78wxr4ae4wrc3lht8lryc2kxxdpxvs3tpdepm0asuvp0l25fqqvjumjneecjg9etepcu426t2ueu6p3escfrxl9ggnkh5k2vm929tnt26dx66nt67kfy5lgx99py2jhqalaqkyypjeu2artvufgydym4tryv0wvkca78ac64mjeqt70d3wsmjcjgnqnjsyqrzymjxzydqkkw24ufxqslttwlj3s608f0rx2slc7etw0833zgs7kppqd350d9wur2l6mkanmpsswv4xrc49kaq6ey9sfn3rg3z8afgng8fdg8aqr7sxhftzxfdlwsnfcgw2sy8t5mxa0ytcdfat2nkdwqvpy9nnsa9mzzaqtyu8wy0yul9hk026znqy6pn6xd2fpxva7jjcpmvqugeewk7emufyqsru03er082j6ya0p694k6qu858hl0g9rt7g2y042ppzyhdv4qdv99qqs3scf49sff7vg27zlmx6n3kgywrh3s82rwgpza2s8jmqqx72ah0kurp94rj7dlxq438nnm34w78kq7hwu53chx0aqh824eqcsgmq9j2fyvsqttg4yksstnk7h7ga5as69fhemltg0m9hqnn2yxr0lxv70293l7ryqpjfamk2k4mzgax8txef7zcxdzjn0wg7te2cx98ft9cyhk0hquzypasww8m40kyzyqvahtzamflylsygnny5gwqqqqqqyqqqqq2qq9sqqqqqqqqqqqqqqqqqqp6tqqqqqqq5szxdnxnuk5zpctsclfcs4yx0kcvz8nckast2ueswxftuelh49su6sqs2vlzs8ha4gqs9vppqvk0zhg6m8z2prfxa2cerrmn9k803lwx4wukgzlnmvt5xukyjycyauzqwvm6pxlfpfffgktvj3wkurcwrqcp0537hnkd8pnm7tsa0zcklua9zv338cjuphz38wml6tlr8xgdzxdsqh0ks2pns2zkn3c52crfcfs', 'raw_message': '40160a0068', 'created_at': 1724699621, 'destination': '032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e', 'payment_hash': 'e170c7d38854867db0c11e78b760b573307192be67f7a961cd4010533e281efd', 'status': 'failed', 'amount_msat': 3, 'amount_sent_msat': 0, 'erring_index': 2, 'erring_node': '035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d'} contrib/pyln-client/pyln/client/lightning.py:416: RpcError ``` Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
As we can see from the previous test, l3 tells us why it rejected the payment: ``` lightningd-3 2024-11-19T03:56:27.151Z DEBUG 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-chan#1: Failing HTLC because of an invalid payload (TLV 10 pos 104): cltv_expiry 136 > payment_constraint 130 ``` It turns out, we were not updating the block height in the plugin! Without this, when we create a (non-dummy) blinded path we set a too-low CLTV restriction, and it doesn't work after a few blocks! Note we were actually triggering this error in the xpay tests! Reported-by: Vincenzo Palazzo Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Fixed: Offers: Receiving bolt12 payments where we have no public channels would fail a few blocks after startup.
1e49d4c
to
9932a71
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to use fprintf, which is terrible.
A tell you a secret, I do it too sometimes :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_reconnect_no_additional_transient_failure passed 1 out of the required 1 times. Success!
test_offline failed (1 runs remaining out of 2).
<class 'AssertionError'>
assert not 'lightningd-1 2024-11-20T09:36:09.764Z DEBUG connectd: Created listener on 127.0.0.1:46599'
+ where 'lightningd-1 2024-11-20T09:36:09.764Z DEBUG connectd: Created listener on 127.0.0.1:46599' = <bound method TailableProc.is_in_log of <pyln.testing.utils.LightningD object at 0x7fe1acb61b70>>('connectd: Created listener on')
+ where <bound method TailableProc.is_in_log of <pyln.testing.utils.LightningD object at 0x7fe1acb61b70>> = <pyln.testing.utils.LightningD object at 0x7fe1acb61b70>.is_in_log
+ where <pyln.testing.utils.LightningD object at 0x7fe1acb61b70> = <fixtures.LightningNode object at 0x7fe1af59bcd0>.daemon
[<TracebackEntry /home/runner/.cache/pypoetry/virtualenvs/cln-meta-project-AqJ9wMix-py3.10/lib/python3.10/site-packages/_pytest/runner.py:341>, <TracebackEntry /home/runner/.cache/pypoetry/virtualenvs/cln-meta-project-AqJ9wMix-py3.10/lib/python3.10/site-packages/flaky/flaky_pytest_plugin.py:146>, <TracebackEntry /home/runner/.cache/pypoetry/virtualenvs/cln-meta-project-AqJ9wMix-py3.10/lib/python3.10/site-packages/pluggy/_hooks.py:513>, <TracebackEntry /home/runner/.cache/pypoetry/virtualenvs/cln-meta-project-AqJ9wMix-py3.10/lib/python3.10/site-packages/pluggy/_manager.py:120>, <TracebackEntry /home/runner/.cache/pypoetry/virtualenvs/cln-meta-project-AqJ9wMix-py3.10/lib/python3.10/site-packages/pluggy/_callers.py:182>, <TracebackEntry /home/runner/.cache/pypoetry/virtualenvs/cln-meta-project-AqJ9wMix-py3.10/lib/python3.10/site-packages/pluggy/_result.py:100>, <TracebackEntry /home/runner/.cache/pypoetry/virtualenvs/cln-meta-project-AqJ9wMix-py3.10/lib/python3.10/site-packages/pluggy/_callers.py:103>, <TracebackEntry /home/runner/.cache/pypoetry/virtualenvs/cln-meta-project-AqJ9wMix-py3.10/lib/python3.10/site-packages/_pytest/runner.py:177>, <TracebackEntry /home/runner/.cache/pypoetry/virtualenvs/cln-meta-project-AqJ9wMix-py3.10/lib/python3.10/site-packages/_pytest/runner.py:169>, <TracebackEntry /home/runner/.cache/pypoetry/virtualenvs/cln-meta-project-AqJ9wMix-py3.10/lib/python3.10/site-packages/_pytest/python.py:1792>, <TracebackEntry /home/runner/.cache/pypoetry/virtualenvs/cln-meta-project-AqJ9wMix-py3.10/lib/python3.10/site-packages/pluggy/_hooks.py:513>, <TracebackEntry /home/runner/.cache/pypoetry/virtualenvs/cln-meta-project-AqJ9wMix-py3.10/lib/python3.10/site-packages/pluggy/_manager.py:120>, <TracebackEntry /home/runner/.cache/pypoetry/virtualenvs/cln-meta-project-AqJ9wMix-py3.10/lib/python3.10/site-packages/pluggy/_callers.py:182>, <TracebackEntry /home/runner/.cache/pypoetry/virtualenvs/cln-meta-project-AqJ9wMix-py3.10/lib/python3.10/site-packages/pluggy/_result.py:100>, <TracebackEntry /home/runner/.cache/pypoetry/virtualenvs/cln-meta-project-AqJ9wMix-py3.10/lib/python3.10/site-packages/pluggy/_callers.py:103>, <TracebackEntry /home/runner/.cache/pypoetry/virtualenvs/cln-meta-project-AqJ9wMix-py3.10/lib/python3.10/site-packages/_pytest/python.py:194>, <TracebackEntry /home/runner/work/lightning/lightning/tests/test_connection.py:4509>]
test_offline failed; it passed 0 out of the required 1 times.
<class 'AssertionError'>
assert not 'lightningd-1 2024-11-20T09:36:20.916Z DEBUG connectd: Created listener on 127.0.0.1:39885'
+ where 'lightningd-1 2024-11-20T09:36:20.916Z DEBUG connectd: Created listener on 127.0.0.1:39885' = <bound method TailableProc.is_in_log of <pyln.testing.utils.LightningD object at 0x7fe1ace3e110>>('connectd: Created listener on')
+ where <bound method TailableProc.is_in_log of <pyln.testing.utils.LightningD object at 0x7fe1ace3e110>> = <pyln.testing.utils.LightningD object at 0x7fe1ace3e110>.is_in_log
+ where <pyln.testing.utils.LightningD object at 0x7fe1ace3e110> = <fixtures.LightningNode object at 0x7fe1ace3cdf0>.daemon
Not sure if this error should be address here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 9932a71
2bf1053
into
ElementsProject:master
Based on #7610 this fixes a great error which @vincenzopalazzo found (and makes it easier to find similar errors in future, with better logging).
Closes: #7610