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

htlc callback acceptance #3953

Closed
nicolasburtey opened this issue Jan 24, 2020 · 5 comments
Closed

htlc callback acceptance #3953

nicolasburtey opened this issue Jan 24, 2020 · 5 comments
Labels
feature request Requests for new features htlcswitch P3 might get fixed, nice to have

Comments

@nicolasburtey
Copy link

There is a PR about better reporting for HTLC forwarding: #3420 (comment)

It would relevant to go one step further and allow callback for acceptance.

I see at least one use case where this would be relevant:
If a routing node is connected to knowingly mobile phone nodes that are offline most of the time but could be notified when a payment is pending. One of the requirement would be to make payment pending when receiving an HTLC for some channels, instead of automatically fail if the node is offline, as is currently happening with lnd.

@carlaKC carlaKC added enhancement Improvements to existing features / behaviour P3 might get fixed, nice to have htlcswitch labels Jan 24, 2020
@carlaKC
Copy link
Collaborator

carlaKC commented Jan 24, 2020

One of the requirement would be to make payment pending when receiving an HTLC for some channels, instead of automatically fail if the node is offline, as is currently happening with lnd.

Would the idea be to get the incoming htlc, see that it's for a known mobile client and then notify them to come online so that the htlc can be locked into their commitment?

@champo
Copy link
Contributor

champo commented Jan 24, 2020

@carlaKC at Muun we would love to have that feature! Ideally we would be able to decide whether to accept an htlc meant for a non existant channel with the mobile node, so actual channels can be created on demand.

I'd be more than happy to contribute to make this possible.

@carlaKC
Copy link
Collaborator

carlaKC commented Jan 24, 2020

Ideally we would be able to decide whether to accept an htlc meant for a non existant channel with the mobile node, so actual channels can be created on demand.

If the channel doesn't exist yet, nodes wouldn't be able to find a route to the mobile device. If you were sure your routing node would be the second last hop, I think you could do some moon magic with hop hints but would have to think about it more.

This would be a non-trivial change to lnd, because the switch (where we forward htlcs) is one of the more complex subsystems. Some things you'd have to think about are htlcs timing out while channel acceptor is waiting for the mobile node to come online, and handling this kind of blocking in the switch (which I think would be most challenging).

I'd be more than happy to contribute to make this possible.

That would be great! A good place to start would be handlePacketForward in htlcSwitch/switch.go and having a look at the ChannelAcceptor in lnd which is a similar principle for channels being opened to our node. Feel free to ping me on the lnd slack/request for review if you decide to take this on :D

@carlaKC carlaKC added feature request Requests for new features and removed enhancement Improvements to existing features / behaviour labels Jan 24, 2020
@nicolasburtey
Copy link
Author

@carlaKC my request was for existing channels (to get started :) )

But as @champo suggested, having this for non-existing channels (the "Phoenix" wallet way) would be a great addition.

@Roasbeef
Copy link
Member

Implemented by #4018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new features htlcswitch P3 might get fixed, nice to have
Projects
None yet
Development

No branches or pull requests

4 participants