Re-send FundingLocked in ChannelLink upon re-connect if at state zero #303
Labels
commitments
Commitment transactions containing the state of the channel
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
Issue
The current specification draft describes the process of re-synchronizing channel state upon reconnection. As transports can be unreliable, we don't have a guarantee that the remote party actually received the last update we sent before the connection was closed. As a result, upon reconnection we'll attempt to retransmit the state necessary to reconcile any possible deviations in our state.
PR #231 implements the bulk of the retransmission logic but leaves one component un-implemented:
Steps to Completion
Upon reconnection (as an intermediate step before Add retransmission subsystem in channel link #231 is merge) if the current state number o is zero within the ChannelLink's main goroutine then the
FundingLocked
message should be reconstructed, and re-sent to the remote peer.The
FundingLocked
message can be reconstructed by obtaining the the nextcommitmentPoint
from the core channel state machine.Within the
fundingManager
when handling theFundingLocked
message if this is a retransmitted message, then it should be ignored, rather than continuing normal processing. We can determine if this is a retransmission by examining the RemoteNextRevocation field fornil-ness
Currently, within the
fundingManager
when we try to send theFundingLocked
message to the remote party, but they're not currently online, we simply exit early and fail to properly announce the channel. Instead, we should send a request to the server to be notified of when the target peer comes online again. In the case the peer re-connects, then we should wait up and resume duties as normal. This is also related to Implement block-based grace period for channel announcements #305 as we'll need to decouple channel graph insertion from channel announcement as well.The text was updated successfully, but these errors were encountered: