-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
rpc+htlcswitch: add HTLC transformation capabilities to the interceptor #8619
Comments
Hi @Roasbeef I would like to take on this. |
Hi @dstadulis thanks for the reply. I'll be reaching out to @saubyk on slack for another one then. |
On a high level, from what I understand (from standup), the path forward for this issue is to recognise that we should not attempt to modify HTLC fields which are part of the onion. Instead, we should modify fields which are included in the And then, the final node in the route should disregard the onion message and use the p2p message fields instead. Is that correct? We might also need to modify this code so that we can extra the p2p custom records field in the final node. However, I think that this code is only called when retrieving an invoice. Does that mean we intend on adding a p2p message custom records field to the returned invoice? As things currently stand, the |
What we seem to be doing here is using the HTLC interceptor to generate a The "settled" action interceptor response effectively does this already by updating the preimage. |
It's correct that we cannot change anything that's in the onion. AFAIU the And I think there's a confusion around the custom TLV fields: The goal is not to modify the custom records that are displayed on the invoice. The goal is to transmit additional information to the final recipient in order for them to accept an HTLC who's p2p wire message |
My Current stratergy is to pass the custom records added during HTLC interception to the peer by adding them to the |
@ffranr so we do need to also modify the invoice logic here to include the TLV fields in the wire message. That'll be part of #8616. I think doing both of them concurrently will be useful as it'll enable us to do a proper itest.
This sounds good. So then now we'll add a new hold response type, this type can then say add this Note that there're two custom records here:
|
We should consider this issue complete now that #8633 has been merged into staging. We have a separate issue for the |
Today we have the
HTLCInterceptor
, it's useful for doing things like implementing a custom forwarding policy. Today you can accept/reject, and even provide a custompreimage
to short circuit normal forwarding an "inject" the preimage directly into the route.Protocol improvement proposals such as the endorsement bit also need the ability to transform an incoming HTLC into a new outgoing HTLC. On example is if you get the bit set on the incoming link, but decide to not set it on the outgoing link. Today, the htlc interceptor won't allow such a workflow. We should extend the interceptor to support this feature.
Steps To Completion
Extend the
ForwardHtlcInterceptResponse
struct with the ability to swap out the outgoing amt and/or custom TLV blobs.Update the intercept-able switch to be able to process the new
ResolveHoldForwardAction
type.The text was updated successfully, but these errors were encountered: