-
Notifications
You must be signed in to change notification settings - Fork 29
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
Trampoline client to delegate payments to the LSP #475
Conversation
0c5646b
to
3c91b2e
Compare
09bb268
to
de0a9f9
Compare
b29397b
to
26a4819
Compare
26a4819
to
cb2507f
Compare
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.
Very nice, I like the tests too, they cover quite a bit of surface 👍
Now the linguist annotations work 👍 |
07b7492
to
9b8603e
Compare
Rebased on |
Documenting here that there is an issue where the breez sdk gets a transport error from the trampoline_pay call when the trampoline payment succeeds. Other things I was wondering are:
|
ec2d252
to
7977109
Compare
} | ||
|
||
#[derive(Clone, Debug, Deserialize, Serialize)] | ||
pub struct SendpayRequest { |
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'm surprised this is necessary, shouldn't we have a Pay request like this already in cln-rpc?
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.
We have this in cln-rpc but on 0.1.8
it does not include payment_metadata
so I copied it and add the extra field.
I squashed the two proto commits into one to be able to separately cherry-pick it. |
In the past we had problems with github showing copied files as changes. This is somewhat annoying and we wan to skip those duplicate changes. The attributes had been set already but github ignored them. Hopefully these syntactical changes help github to understand the file. Signed-off-by: Peter Neuroth <[email protected]>
We need to access the SerializedTlvStream also for the trampoline_pay command in future commits. This commit moves the struct and all associated commits and helper functions into their own module. Signed-off-by: Peter Neuroth <[email protected]>
This commits enables trampoline pay on the signer. It teaches the signer about the message and allows to call PreapproveInvoice during a trampoline pay request. Calling PreapproveInvoice allows us to call send_pay on the invoice in later commits. Signed-off-by: Peter Neuroth <[email protected]>
This commit adds a derive to the TrampolinePayRequest in order to be able to serialize and deserialize it via serde. This allows to use those messages as json::Value's directly. Signed-off-by: Peter Neuroth <[email protected]>
This commit adds a core-lightning rpc method for trampoline payments to gl-plugin. This variant of trampoline payments works as follows: We hand over one or many htlcs to a peer node that is a trampoline node. The htlcs have a litte extra on the amount and the trampoline node can then search for a route and complete the payment. Once the payment is completed the trampoline node will resolve the pending htlcs. We use multiple htlcs if the initiating node shares multiple channels with the trampoline node and if the amount is bigger than what can be send through one channel. Signed-off-by: Peter Neuroth <[email protected]>
Signed-off-by: Peter Neuroth <[email protected]>
This commit adds trampoline pay to the python library to allow for testing of the implementation. We also add some basic checks. Signed-off-by: Peter Neuroth <[email protected]>
Signed-off-by: Peter Neuroth <[email protected]>
Signed-off-by: Peter Neuroth <[email protected]>
Instead of running trampoline_pay on the plugin and wire it up through a custom rpc command we can actually just perform trampoline_pay directly. Signed-off-by: Peter Neuroth <[email protected]>
Signed-off-by: Peter Neuroth <[email protected]>
Signed-off-by: Peter Neuroth <[email protected]>
We of course need to send the amount that is to be sent to the receiver not the amount including the overpayment for the trampoline node. Signed-off-by: Peter Neuroth <[email protected]>
Signed-off-by: Peter Neuroth <[email protected]>
This commit adds `trampoline_pay_keepalive` to the greenlight grpc node client. This version does exactly the same as `trampoline_pay` but streams log messages from the node as long as `trampoline_pay` is inflight, in order to keep the connection busy. Signed-off-by: Peter Neuroth <[email protected]>
1b14fe6
to
6606973
Compare
Currently we can not handle custom errors returned by the server directly as CLN does not understand the error codes (NODE|25, PERM|27) that signal termporary and permanent failures on the trampoline server. This is an internediate step where we at least pass down an error message that reflects a server failure in the meantime. Signed-off-by: Peter Neuroth <[email protected]>
ACK 3cd3b50 |
Adds a custom trampoline client to
gl-plugin
to enable custom trampoline payments via breez on greenlight. This covers basic functionality and basic tests.This PR also resolves #470