Skip to content

Delayed status updates with pay and listpays (gRPC) #6327

Open
@theborakompanioni

Description

@theborakompanioni

Currently observed this behaviour while testing an application that sends out payments via pay (gRPC) and another service polling these payments via listpays (gRPC). There is a rather long delay before listpays reports the correct state after the pay request either returns COMPLETE or FAILED.

Initiating he pay request:

2023-06-12T08:39:08.724Z  WARN: Payment '70ab8e36814...' with amount '16777215001 msat' resulted in error: UNKNOWN: Error calling method Pay: RpcError { code: Some(210), message: "Ran out of routes to try after 31 attempts: see `paystatus`" }

Subequently polling the listpays gRPC endpoint, which will report PENDING for more than 70 seconds.

2023-06-12T08:39:09.699Z DEBUG: Checking payment 70ab8e36814… resulted in: PENDING.
2023-06-12T08:39:10.761Z DEBUG: Checking payment 70ab8e36814… resulted in: PENDING.
2023-06-12T08:39:11.833Z DEBUG: Checking payment 70ab8e36814… resulted in: PENDING.
[...] # polling every second (same output)
2023-06-12T08:40:18.181Z DEBUG: Checking payment 70ab8e36814… resulted in: PENDING.
2023-06-12T08:40:19.194Z DEBUG: Checking payment 70ab8e36814… resulted in: PENDING.
2023-06-12T08:40:20.228Z  INFO: Checking payment 70ab8e36814… resulted in: FAILED.

It is not big issue per se, rather an inconvenience (albeit it has real impact on UX). If this could be somehow configured, it would also massively speed up the test suite runs. I tried a few things, but to no avail.. e.g. reducing retry_for to a small number (i.e. 2 seconds) does not influence the delay.

The docs say:

You can monitor the progress and retries of a payment using the lightning-paystatus(7) command.

However, paystatus does not seem to be exposed via gRPC..

Any ideas? Is there a way to speed things up?
Any and all feedback is highly appreciated 🙏

Edit: Same happened for successful payments in previous versions, but with v23.05, it seems to update the state to COMPLETE quite quickly 🚀 (However, I might just have been lucky a few times?)

Issue and Steps to Reproduce

  1. Initiate a payment via pay gRPC endpoint (e.g. one that is definitely failing)
  2. Watch pay reporting the payment as FAILED
  3. Start polling listpays
  4. Watch listpays return PENDING for quite a while
  5. Wait till listpays reports the payment as FAILED

getinfo output

Using CLN v23.05 on regtest:

$ lightning-cli --network=regtest getinfo
{
   "id": "0213c5927a0045bcf53c3c8ea04cf3e230ee3f066ca6ea3b2fcce95e8da471d191",
   "alias": "cln1-integration-test",
   "color": "0213c5",
   "num_peers": 1,
   "num_pending_channels": 0,
   "num_active_channels": 1,
   "num_inactive_channels": 0,
   "address": [],
   "binding": [
      {
         "type": "ipv6",
         "address": "::",
         "port": 19846
      },
      {
         "type": "ipv4",
         "address": "0.0.0.0",
         "port": 19846
      }
   ],
   "version": "v23.05",
   "blockheight": 123,
   "network": "regtest",
   "fees_collected_msat": 0,
   "lightning-dir": "/home/clightning/.lightning/regtest",
   "our_features": {
      "init": "08a0000a0269a2",
      "node": "88a0000a0269a2",
      "channel": "",
      "invoice": "02000002024100"
   }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions