-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Implement Fully Asynchronous Channel Opening #182
Copy link
Copy link
Closed
Labels
databaseRelated to the database/storage of LNDRelated to the database/storage of LNDfundingRelated to the opening of new channels with funding transactions on the blockchainRelated to the opening of new channels with funding transactions on the blockchainintermediateIssues suitable for developers moderately familiar with the codebase and LNIssues suitable for developers moderately familiar with the codebase and LNp2pCode related to the peer-to-peer behaviourCode related to the peer-to-peer behaviour
Metadata
Metadata
Assignees
Labels
databaseRelated to the database/storage of LNDRelated to the database/storage of LNDfundingRelated to the opening of new channels with funding transactions on the blockchainRelated to the opening of new channels with funding transactions on the blockchainintermediateIssues suitable for developers moderately familiar with the codebase and LNIssues suitable for developers moderately familiar with the codebase and LNp2pCode related to the peer-to-peer behaviourCode related to the peer-to-peer behaviour
Currently, when opening a new channel,
lndmust 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 makelndusable 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
fundingManageris whether or not we've sent theFundingLockedmessage and also theAnnouncmentSignaturemessage after the channel has been confirmed. Within theAuthenticatedGossiper, the half of theAnnouncmentSignaturereceived is currently stored in an in-memory map, this should be moved to persistent on-disk storage.Steps To Completion
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.FundingLockedmessage has been sent, the on-disk state for the pending channel should be updated to mark that the FL message has been sent.fundingManagerconstructs 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.AuthenticatedGossipershould be modified to persist the map that tracks half-proofs to disk s.t it survives restart. This is required as if thefundingManagersend the proofs to theAGand a restart occurs, we won't be able to properly parse the remote peer'sAnnouncmentSignaturemessage and properly construct the validChannelAnnouncements.NOTE: This depends on #156.