-
Notifications
You must be signed in to change notification settings - Fork 372
Pr secrethash related #4150
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
Closed
Closed
Pr secrethash related #4150
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this event should be used here. We can only guarantee that a payment has failed after the lock has expired and we expect this event to mean that.
The handling is probably better done on the
handle_secret_requeston the message handler, and do the same thing as thehandle_refund_transfer(as in, handle the special case when the secret is unknown).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hackaugusto So you suggest that I will just ignore this request and let the transfer expire?
Clearly I can do that but let's consider the app that made the payment (XUD). It can take some time until the transfer expires and in that time, XUD does not know what to do with the order in it order book.
XUD knows for sure that it never released the secret so there is no risk in getting back immediately and letting XUD knows that its peer is not configured right.
I added this handling as it was hard to find what is causing XUD transfer to fail. Keep in mind that this is a result of misconfiguration of the peer node and it is the sending that is suffering due to it.
The handling we added in
handle_message_refundtransferis not similar. Here, if the first route fails the transfer is blocked until expiration. However, on XUD level we are checking that there is a direct channel between the peers and that both peers are up, running, and connected to Raiden. So practically this situation of long payment can be avoided.Let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@offerm I believe Augusto's argument was against using
EventPaymentSentFailedas the event to indicate that the payment actually failed. At this point in time where you emit this event, the lockedd amounts are still locked and the payment never really failed in the sense that the locks no longer exist. At this point, we could end up in a situation where the secret request failed because the XUD did not provided it (False returned by the resolve)... so we send this event here but after a while the same request is sent and the resolver provides the secret and the payment was a success. Do you see where this is going?The alternative is as Augusto suggests, is to check this in the message handler to make sure that:
At least, this is how i am thinking about it right now. Maybe Augusto has a better approach to how this can be done in details.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @rakanalh described, IMO the payment is failed only after the lock has expired, this is important because the event is tied to change in the channel capacity. Here is some relevant discussion we had in the past: #3024 (comment)
You could add a new event as from the linked discussion. Since your application controls the secret, it knows the payment will never succeed.