Skip to content

tests: add an xpay test to reproduce a regression where we pay fees in a direct route#8972

Open
daywalker90 wants to merge 1 commit intoElementsProject:masterfrom
daywalker90:xpay-bolt12-direct-fees
Open

tests: add an xpay test to reproduce a regression where we pay fees in a direct route#8972
daywalker90 wants to merge 1 commit intoElementsProject:masterfrom
daywalker90:xpay-bolt12-direct-fees

Conversation

@daywalker90
Copy link
Collaborator

I noticed this in one of my plugin's tests.

        # BOLT 12, direct peer
        offer = l2.rpc.offer('any')['bolt12']
        b12 = l1.rpc.fetchinvoice(offer, '10000msat')['invoice']
        ret = l1.rpc.xpay(invstring=b12)
        assert ret['failed_parts'] == 0
        assert ret['successful_parts'] == 1
        assert ret['amount_msat'] == 10000
>       assert ret['amount_sent_msat'] == 10000
E       assert 10001 == 10000

tests/test_xpay.py:187: AssertionError

This is also quite flaky on my local tests with this result instead:

>       ret = l1.rpc.xpay(invstring=b12)

tests/test_xpay.py:183:

pyln.client.lightning.RpcError: RPC call failed: method: xpay, payload: {'invstring': '<removed>'}, error: {'code': 205, 'message': 'Failed: We could not find a usable set of paths. The shortest path is 103x1x0->103x2x0->0x0x0, but 0x0x0/1 exceeds htlc_maximum_msat ~0msat'}

@daywalker90
Copy link
Collaborator Author

This also happens with pay btw with even weirder results:

l1-cli pay "<removed>"
{
   "destination": "035ed467e11a1990fd4fc7d98dafbc3c49abcf8d2a48fb24f914e909e95a6737cb",
   "payment_hash": "b461b5fae962473ad0d198c0a69e458cbd6a9ef959918ea5cd6c434e75422ff4",
   "created_at": 1774304621.999080537,
   "parts": 1,
   "amount_msat": 10001,
   "amount_sent_msat": 10001,
   "payment_preimage": "a70a45a55d5121b9ba54daeb62a8cb0bb31fcaeda643974ef3ed8952c0c83f55",
   "status": "complete"
}

This is a direct pay from l1 to l2 with an "any" offer aswell and a fetched invoice for 10000msat. Notice how both amount_msat and amount_sent_msat include a fee.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant