Handle fallible per commitment point in channel establishment#3109
Merged
TheBlueMatt merged 7 commits intoDec 15, 2024
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Handles fallible
get_per_commitment_pointsigner method (except for channel reestablish).We make
get_per_commitment_pointreturn a result type so that in theErrcase, we (LDK) can resume operation while an async signer fetches the commitment point. This will typically block sending out a message, but otherwise most state updates will occur. When the signature arrives, the user is expected to callChannelManager::signer_unblockedand we will retryget_per_commitment_pointhowever this time the signer will return the commitment point withOk, and we'll send out our message.This PR implements this flow for channel establishment, i.e.
open_channel,accept_channel, andchannel_ready.Rough outline of how our
HolderCommitmentPointadvances and gets new signatures:open_channel- creates new outbound channel, immediately requests the first commit point, waits to have the first 2 commit points to be unblocked to send the messageaccept_channel- same ^funding_created- no op regarding commit pointsfunding_created- uses point to verify first commitment, then advances commitment, requesting next pointfunding_signed- no opfunding_signed- same as above, verifies, advances, requests next pointchannel_ready- waits to have the next commit point ready, then once unblocked sends the current point in thechannel_readymessage