Skip to content

xpay: fakenet test: move funds when payment succeeds#9282

Draft
Lagrang3 wants to merge 1 commit into
ElementsProject:masterfrom
Lagrang3:xpay-1msat-bug
Draft

xpay: fakenet test: move funds when payment succeeds#9282
Lagrang3 wants to merge 1 commit into
ElementsProject:masterfrom
Lagrang3:xpay-1msat-bug

Conversation

@Lagrang3

@Lagrang3 Lagrang3 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Improved the fakenet simulation by moving funds after a payment succeeds. This triggers a bug in xpay.

To-do:

  • fix the 1msat xpay bug that fails the test_xpay_fake_channeld

Improved the fakenet simulation by moving funds after a payment
succeeds. This triggers a bug in xpay.

Changelog-None

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
@Lagrang3

Lagrang3 commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator Author

This is an extract of the logs

...
PAYING Node #0
PAYING Node #1
PAYING Node #2
PAYING Node #3
PAYING Node #4
PAYING Node #5
PAYING Node #6
PAYING Node #7
PAYING Node #8
...
        for n in range(0, 9):
            if n in canned_gossmap_badnodes:
                continue
    
            print(f"PAYING Node #{n}")
    
            preimage_hex = bytes([n]).hex() + '00' * 31
            hash_hex = sha256(bytes.fromhex(preimage_hex)).hexdigest()
            inv = subprocess.check_output(["devtools/bolt11-cli",
                                           "encode",
                                           n.to_bytes(length=8, byteorder=sys.byteorder).hex() + '01' * 24,
                                           f"currency={chainparams['bip173_prefix']}",
                                           f"p={hash_hex}",
                                           f"s={'00' * 32}",
                                           "9=020000",  # option_basic_mpp
                                           f"d=Paying node {n}",
                                           f"amount={AMOUNT}msat"]).decode('utf-8').strip()
            assert l1.rpc.decode(inv)['payee'] == nodeids[n]
>           failed_parts.append(l1.rpc.xpay(inv)['failed_parts'])
...
>           raise RpcError(method, payload, resp['error'])
E           pyln.client.lightning.RpcError: RPC call failed: method: xpay, payload: {'invstring': 'lnbcrt5m1p4yhz30sp5qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpp5qe7ud2qsrqlfq60k8sszpd5jcy3v34vzv0kh7hqw2v2sfhpmdcrqdq42pshj6twvusxummyv5srscqpj9qyyqqqzmuns0mernvj9rzhsa07vh8p87rmrywxk6744wsjjxsu8x5j5vq4zaharev330qc9k3qgderuw8xh8phykajy8nwkl9ve83f4weau7sqd7675n'},
error: {'code': 209, 'message': "Timed out after after 842 attempts.
We got temporary_channel_failure for 45210x2134x44171/0, assuming it can't carry 198102199msat.
We got temporary_channel_failure for 45210x2134x44171/0, assuming it can't carry 198102197msat.
We got temporary_channel_failure for 45210x2134x44171/0, assuming it can't carry 198102196msat.
We got temporary_channel_failure for 45210x2134x44171/0, assuming it can't carry 198102195msat.
We got temporary_channel_failure for 45210x2134x44171/0, assuming it can't carry 198102194msat.
We got temporary_channel_failure for 45210x2134x44171/0, assuming it can't carry 198102193msat.
We got temporary_channel_failure for 45210x2134x44171/0, assuming it can't carry 198102192msat.
We got temporary_channel_failure for 45210x2134x44171/0, assuming it can't carry 198102191msat.
We got temporary_channel_failure for 45210x2134x44171/0, assuming it can't carry 198102190msat
...
We got temporary_channel_failure for 45210x2134x44171/0, assuming it can't carry 198101779msat.
Payment of 9996982msat reached destination, but timed out before the rest arrived..
Payment of 998000msat reached destination, but timed out before the rest arrived..
Payment of 3000000msat reached destination, but timed out before the rest arrived..
Payment of 197000000msat reached destination, but timed out before the rest arrived..
Payment of 91005018msat reached destination, but timed out before the rest arrived..
Payment of 1msat reached destination, but timed out before the rest arrived..
Payment of 1msat reached destination, but timed out before the rest arrived..
Payment of 1msat reached destination, but timed out before the rest arrived..
Payment of 1msat reached destination, but timed out before the rest arrived..
Payment of 1msat reached destination, but timed out before the rest arrived..
Payment of 1msat reached destination, but timed out before the rest arrived..
Payment of 1msat reached destination, but timed out before the rest arrived..
Payment of 1msat reached destination, but timed out before the rest arrived..
Payment of 1msat reached destination, but timed out before the rest arrived.. 
...
Payment of 1msat reached destination, but timed out before the rest arrived..
Payment of 1msat reached destination, but timed out before the rest arrived.. "}

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