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

Implement Fully Asynchronous Channel Opening #182

Closed
1 of 4 tasks
Roasbeef opened this issue Apr 14, 2017 · 4 comments
Closed
1 of 4 tasks

Implement Fully Asynchronous Channel Opening #182

Roasbeef opened this issue Apr 14, 2017 · 4 comments
Labels
database Related to the database/storage of LND funding Related to the opening of new channels with funding transactions on the blockchain intermediate Issues suitable for developers moderately familiar with the codebase and LN p2p Code related to the peer-to-peer behaviour

Comments

@Roasbeef
Copy link
Member

Roasbeef commented Apr 14, 2017

Currently, when opening a new channel, lnd must stay active during the entire duration of the funding process from initial message, to funding transaction confirmation. Ideally, this wouldn't be necessary and after the funding transaction has been broadcast, then remainder of the process be full asynchronous and able to survive restarts. Such a change would make lnd usable on platforms like laptops and mobile phones.

Two areas within the codebase need to be modified with some additional persistence (assuming retransmission has been implemented): the funding manager, and the authenticated gossiper. The lacking area of persistence within the fundingManager is whether or not we've sent the FundingLocked message and also the AnnouncmentSignature message after the channel has been confirmed. Within the AuthenticatedGossiper, the half of the AnnouncmentSignature received is currently stored in an in-memory map, this should be moved to persistent on-disk storage.

Steps To Completion

  • Once a channel has entered the final stage of funding a new on-disk state-machine for the channel should be created by the fundingManager. This state-machine will track the final stages of the funding workflow to ensure each step is reliable completed, even in the face of restarts.
  • Once the channel has been confirmed after the FundingLocked message has been sent, the on-disk state for the pending channel should be updated to mark that the FL message has been sent.
  • After the FL message has been sent, and the fundingManager constructs the necessary announcement signatures for the channel a special record should be created which tracks if teh channel has been announced on the network or not. Upon restart this record should be cross-checked with the available graph information from the database to ensure the advertised channel edge is present within the graph.
  • The AuthenticatedGossiper should be modified to persist the map that tracks half-proofs to disk s.t it survives restart. This is required as if the fundingManager send the proofs to the AG and a restart occurs, we won't be able to properly parse the remote peer's AnnouncmentSignature message and properly construct the valid ChannelAnnouncements.

NOTE: This depends on #156.

@Roasbeef Roasbeef added database Related to the database/storage of LND funding Related to the opening of new channels with funding transactions on the blockchain intermediate Issues suitable for developers moderately familiar with the codebase and LN p2p Code related to the peer-to-peer behaviour labels Apr 14, 2017
@halseth
Copy link
Contributor

halseth commented May 3, 2017

I'll take a look at this one 🤓

@andrewshvv
Copy link
Contributor

@halseth fourth step currently in progress now (PR #195)

@halseth
Copy link
Contributor

halseth commented May 3, 2017

@AndrewSamokhvalov Thanks for the heads up!

@Roasbeef
Copy link
Member Author

Closed by #195 and #208.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database Related to the database/storage of LND funding Related to the opening of new channels with funding transactions on the blockchain intermediate Issues suitable for developers moderately familiar with the codebase and LN p2p Code related to the peer-to-peer behaviour
Projects
None yet
Development

No branches or pull requests

3 participants