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

renepay crashes after retrying an xpay payment #7968

Open
Lagrang3 opened this issue Dec 24, 2024 · 3 comments · May be fixed by #7979
Open

renepay crashes after retrying an xpay payment #7968

Lagrang3 opened this issue Dec 24, 2024 · 3 comments · May be fixed by #7979

Comments

@Lagrang3
Copy link
Collaborator

Trying a payment with xpay version v24.11.1, I noticed the groupid is a huge number.
I am not sure this is expected but it is beyond u32. It seems like uninitialized values to me.

For example

cln listsendpays
...
      {
         "created_index": 1068,
         "id": 1068,
         "payment_hash": "efa0ffd0c279c3d0586c06a4d53b633dcee23c66205c5bbb1407e9f0301f843e",
         "groupid": 3129650225004885374,
         "updated_index": 1068,
         "partid": 3,
         "destination": "03d607f3e69fd032524a867b288216bfab263b6eaee4e07783799a6fe69bb84fac",
         "amount_msat": 20405000,
         "amount_sent_msat": 20437609,
         "created_at": 1735062389,
         "completed_at": 1735062391,
         "status": "failed",
         "bolt11": "lnbc204050n1pnk4umfpp5a7s0l5xz08paqkrvq6jd2wmr8h8wy0rxypw9hwc5ql5lqvqlsslqdz2gf5hgun9ve5kcmpqxc6xvve48ycnzttr89sk2tf5vvungtfcvgmrzttyvyurgvfkxgckgcnrxucqzx7xqrpcgsp597v4m0mpn2w2scqdsq0tuj4r4qslqzyqs7qw3q3mgcw3057qwjds9qxpqysgqg69v0q6q7gpxz9r2l5ufpd6yl2eszf2xa6483spx6m68hwekzg4kesanmuvqmrm2qj5s2mz7zvsa8vmdfdvtvdareu88qdqkz9jntrgpu56kqy",
         "erroronion": "c921aef47f8a4bc12e1f3a5a39f6becc16e94dbffc48517c90d67744570ed386b08dac56d7744a52e99023459bfce6e0fb4f6e24238cf88b2f8c77d2c14dac949bf098c07f9c4ad8f112e0c911c755f85f08885710c2dea5caf19e5f5adda2771dfd880581b42f87a05bf7e65473c6bf53a4386ce0071ce1c1f65b561d1a90217e58ca48fdc2a7b840cf2e008282f65ca437c36341492421f03c6f37c24e0395dfb82874c2d8db11624f11dd4769c6ac610c8bc1257f342bdaf7b6ab7c44517a8fd98c666e048a01570c13aa681bbe172b0829355414948fcc232cc0e1666bbd740827687245c690385a7bd5af1ad9ac6658254c76abc4ee4ff993de8175a671daec4c51d2e62627aaf701444bc35f41c573e94a9e5a77792a3ee8749bb26f1bdbbc3fa2"
      },
      {
         "created_index": 1069,
         "id": 1069,
         "payment_hash": "efa0ffd0c279c3d0586c06a4d53b633dcee23c66205c5bbb1407e9f0301f843e",
         "groupid": 3129650225004885374,
         "updated_index": 1069,
         "partid": 4,
         "destination": "03d607f3e69fd032524a867b288216bfab263b6eaee4e07783799a6fe69bb84fac",
         "amount_msat": 20405000,
         "amount_sent_msat": 20432556,
         "created_at": 1735062391,
         "completed_at": 1735062394,
         "status": "complete",
         "payment_preimage": "xxx",
         "bolt11": "lnbc204050n1pnk4umfpp5a7s0l5xz08paqkrvq6jd2wmr8h8wy0rxypw9hwc5ql5lqvqlsslqdz2gf5hgun9ve5kcmpqxc6xvve48ycnzttr89sk2tf5vvungtfcvgmrzttyvyurgvfkxgckgcnrxucqzx7xqrpcgsp597v4m0mpn2w2scqdsq0tuj4r4qslqzyqs7qw3q3mgcw3057qwjds9qxpqysgqg69v0q6q7gpxz9r2l5ufpd6yl2eszf2xa6483spx6m68hwekzg4kesanmuvqmrm2qj5s2mz7zvsa8vmdfdvtvdareu88qdqkz9jntrgpu56kqy"
      }
   ]

@whitslack
Copy link
Collaborator

If one tries renepay on the same invoice after xpay fails, then the cln-renepay plugin crashes with:

2025-01-06T19:06:04.898Z **BROKEN** plugin-cln-renepay: pendingsendpays_done json_scan of listsendpay returns the following error: Parsing '{status:%,groupid:%': json_to_u32 could not parse 6052863309857293674
2025-01-06T19:06:04.906Z INFO    plugin-cln-renepay: Killing plugin: exited during normal operation

@Lagrang3
Copy link
Collaborator Author

Lagrang3 commented Jan 7, 2025

Allright, so xpay sets the group id as a random number. That explains it.

payment->group_id = pseudorand(INT64_MAX);

On the other hand renepay expects group ids as 32 bit integers.
I'll fix renepay to read group ids as 64 bit integers.

@Lagrang3 Lagrang3 changed the title xpay generating big groupids renepay crashes after retrying an xpay payment Jan 7, 2025
@Lagrang3 Lagrang3 linked a pull request Jan 7, 2025 that will close this issue
@lightningcheckout
Copy link

Nice, I ran into this issue as well. Since xpay more often fails due to #7960

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 a pull request may close this issue.

3 participants