Implement Fully Asynchronous Channel Opening #182
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
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 makelnd
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 theFundingLocked
message and also theAnnouncmentSignature
message after the channel has been confirmed. Within theAuthenticatedGossiper
, the half of theAnnouncmentSignature
received 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.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.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.AuthenticatedGossiper
should be modified to persist the map that tracks half-proofs to disk s.t it survives restart. This is required as if thefundingManager
send the proofs to theAG
and a restart occurs, we won't be able to properly parse the remote peer'sAnnouncmentSignature
message and properly construct the validChannelAnnouncement
s.NOTE: This depends on #156.
The text was updated successfully, but these errors were encountered: