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

frcli nodereport - payment htlc has a route with zero hops #49

Closed
githorray opened this issue Jun 17, 2020 · 8 comments · Fixed by #53
Closed

frcli nodereport - payment htlc has a route with zero hops #49

githorray opened this issue Jun 17, 2020 · 8 comments · Fixed by #53
Assignees

Comments

@githorray
Copy link

$ frcli nodereport
[frcli] rpc error: code = Unknown desc = payment htlc has a route with zero hops

My node is quite old and has some early payments with no hops stored.

I had a similar problem with joule that was fixed.

joule-labs/joule-extension#207

Versions of faraday and lnd:

frcli version 0.2.0-alpha commit=v0.2.0-alpha-9-gdf39c5a5c9e27d6935d14db1f1c0e7ad2197acc4
lnd version 0.10.99-beta commit=clock/v1.0.0-66-ged93c16e51abfd3512cb9a2800811b598f6768cd

@carlaKC
Copy link
Contributor

carlaKC commented Jun 17, 2020

Thanks for reporting!

We're currently looking at payment hops to detect whether we have made a payment or ourselves (in the hope of identifying circular rebalances). We needed to look at hops rather than payment request because we don't always have payment request present, but I think it would make sense to fall back to checking the payment request for a destination in this case. If we have neither, I think logging a warning and just accepting that some old circular payments may not be detected is ok.

In the meantime, you should be able to get around the issue by running nodereport with a specific start date that is after this payment.

@carlaKC carlaKC self-assigned this Jun 17, 2020
@githorray
Copy link
Author

When I try with different start dates I still get errors.

After the last hopless payment:

$ frcli nodereport --start_time 1533081600
[frcli] rpc error: code = Unknown desc = period too long for granularity level

And from the beginning of this month.

$ frcli nodereport --start_time 1590969600
[frcli] rpc error: code = Unknown desc = payment htlc has a route with zero hops

@carlaKC
Copy link
Contributor

carlaKC commented Jun 18, 2020

period too long for granularity level

Ah, I know what's going on here. Will get a fix up asap. Basically the api we use to get fiat estimates from has a tradeoff between accuracy of data and the length of time you query for. It's currently hardcoded which isn't good, I'll update it to shift this "granularity" with the length of query.

Unknown desc = payment htlc has a route with zero hops

I am intrigued that you have a payment with no htlcs which has zero hops from the last month. Have you recently upgraded? Also going to put the fix in for this, but I am curious.

@githorray
Copy link
Author

I have been recklessly running master since launching the node. :)

@carlaKC
Copy link
Contributor

carlaKC commented Jun 22, 2020

If you know which payment is tripping you up, could you find it in listpayments for me and post the output? I just want to make sure that the fix I put up covers this case.

I don't need payment hash/amount or any identifiable fields, so feel free to remove that info. Specifically interested in the payment status, creation time and the list of htlcs (if it's there).

"status": "?",
"creation_time_ns":
"htlcs":   [list of htlcs, if present],

@githorray
Copy link
Author

githorray commented Jun 23, 2020

The last payment with an empty set of hops is

"SUCCEEDED"
"1531397351000000000"
{
  "status": "SUCCEEDED",
  "route": {
    "total_time_lock": 0,
    "total_fees": "0",
    "total_amt": "X000",
    "hops": [],
    "total_fees_msat": "0",
    "total_amt_msat": "X000000"
  },
  "attempt_time_ns": "0",
  "resolve_time_ns": "0",
  "failure": null,
  "preimage": "00000000000000000000000000000XXX"
}

@carlaKC
Copy link
Contributor

carlaKC commented Jun 23, 2020

Awesome, thanks for the output! Fix is in #53, I'll update the issue once it's merged.

You'll see a warning `payment: {hash} destination unknown" in your logs once the fix is merged. For these payments where we don't know the destination (because they have no hops), we might not pick up circular payments properly (they'll just look like regular payments). Other than that, the report will be unaffected.

@githorray
Copy link
Author

I tested #53. I can pull a default node report now.

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

Successfully merging a pull request may close this issue.

2 participants