-
Notifications
You must be signed in to change notification settings - Fork 59
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
fix: greedy forwarding #392
Conversation
Working in a companion in integration tests: https://circleci.com/gh/interledgerjs/five-bells-integration-test/526 |
Codecov Report
@@ Coverage Diff @@
## master #392 +/- ##
==========================================
- Coverage 83.38% 83.37% -0.02%
==========================================
Files 34 34
Lines 1210 1209 -1
Branches 199 199
==========================================
- Hits 1009 1008 -1
Misses 201 201
Continue to review full report at Codecov.
|
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.
Does this patch resolve interledger/rfcs#316?
@@ -176,8 +176,8 @@ class RouteBuilder { | |||
ilpPacket.account, ilpPacket.amount) | |||
|
|||
const sourceLedger = sourceTransfer.ledger | |||
const nextHop = yield this.quoter.findBestPathForSourceAmount( |
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.
Is findBestPathForSourceAmount
still used or was this the only call? If its the latter, the function should be removed.
comments addressed, now awaiting @emschwartz's confirmation of interledgerjs/five-bells-integration-test#88 (comment)
What happens if the connector doesn't have a curve to the destination? Also, unless there are major objections to this idea: interledger/rfcs#312 (comment) I think we should implement that along with this change. |
That doesn't change, it was doing a quote-by-source and with this change will do a quote-by-destination; both will trigger a liquidity-quote if the curve is missing/unknown
I think best-effort payments are a new feature, unrelated to 'normal' payments; what are the downsides of merging this PR first, and then implementing that new feature in a new PR? Would you feel the master branch would be an incorrect state if we merge this PR now, without adding support for best-effort payments? |
Fair enough. I made that point because this seems to move in the opposite direction so I'm not a big fan of making it worse (from my perspective, thinking we need to support forwarding without delivery). Separately, I realized (from interledger/rfcs#312 (comment)) that you might want to specifically handle the 0 amount case because there's a good chance a lot of ledgers won't let you send a 0 amount. |
How normal ("type 1") payments are handled, and how best-effort ("type 9") payments are handled, are two entirely separate things, and it would be a bug if you try to change the normal behavior in the direction of the best-effort behavior. I think, even if we add support for best effort payments, we still want to keep support for normal payments, right? Noted, you are not a big fan of Current Interledger with its three types of quote requests, but surely you're not advocating that we should remove support for it from the code base because of that, right? Even if the ilp-connector code supports it, you will still be free to not use it. :)
So where does that leave us, can this be merged now? |
Actually, interledger/rfcs#77 was the last agreed upon behavior, so this is arguably just about as much of a departure from that as forwarding all the way to the end.
I actually think we should (not right now but in the not too distant future) remove support for payments with the amount in the packet in cleartext. Everything you can do with the amount in the packet you can do with it not in there, and there are a bunch of other things you can build on top of ILP without the amount in the packet that you can't do with it in there. So I think it's worse in pretty much every way, except for the fact that it's there now. |
@emschwartz on our 1:1 call yesterday we (if I'm wording this correctly) discussed:
So how about the following sequence of steps:
|
What's the motivation behind:
As a sender I may want to put the final destination amount in the packet because my experience tells me that the connectors I use are able to find better routes if they have that information. I understand the motivation for 1 and 2 (and support moving amount up the stack and making it invisible to the intermediaries) but shouldn't that be optional? I guess we could have a transport layer protocol that explicitly provides intermediaries with some contextual data (i.e. it's not encrypted). @sappenin is this something you'd likely be working on with regulatory requirements in mind? |
@emschwartz can this be merged now? |
When the incoming amount is higher than expected, don't forward this difference on to the next connector; instead, always pay as little as possible (based on the curve from next to final).
cc @emschwartz @justmoon