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

store correct reason of failed forwards in the database #2435

Closed
ScottTre opened this issue Mar 2, 2019 · 5 comments
Closed

store correct reason of failed forwards in the database #2435

ScottTre opened this issue Mar 2, 2019 · 5 comments
Labels
db good first issue good for onboarding

Comments

@ScottTre
Copy link

ScottTre commented Mar 2, 2019

Please store the correct reason (channel out of capacity ...) in the forward table and show it in the rpc request

@renepickhardt
Copy link
Collaborator

+1

@cdecker
Copy link
Member

cdecker commented Mar 21, 2019

Unless we are the failing node it is unlikely that we even learn the reason for a failed payment. See the update_fail_htlc message in the spec:

For a timed out or route-failed HTLC:

  1. type: 131 (update_fail_htlc)
  2. data:
    • [32:channel_id]
    • [8:id]
    • [2:len]
    • [len:reason]

The reason field is an opaque encrypted blob for the benefit of the
original HTLC initiator, as defined in BOLT #4;
however, there's a special malformed failure variant for the case where
the peer couldn't parse it: in this case the current node instead takes action, encrypting
it into a update_fail_htlc for relaying.

So we'd be limited to differentiating malformed HTLC failures (if it's the next hop failing) or an opaque failire if any later node fails. In the case of a local failure we can of course be more verbose and log the failcode.

@cdecker cdecker added good first issue good for onboarding db labels Mar 21, 2019
@trueptolemy
Copy link
Collaborator

In the case of a local failure we can of course be more verbose and log the failcode.

Hi, @cdecker! I‘m confused with this:
So, if we should choose to add local failure failcode into DB and add a new rpc command to show these information, or just add a failcode log_entry into LOG with log_unusual/log_broken level?

@cdecker
Copy link
Member

cdecker commented Mar 23, 2019

I think an optional field in the result of listforwards will do just fine. Storing a numeric failcode also doesn't create a huge overhead in terms of storage, and we can interpret that on the fly when returning the result, but for now let's keep the numeric failcode.

@trueptolemy
Copy link
Collaborator

This issue also can be closed(#2524 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
db good first issue good for onboarding
Projects
None yet
Development

No branches or pull requests

5 participants