Add infra to block ChannelMonitorUpdates on forwarded claims#2167
Merged
TheBlueMatt merged 8 commits intolightningdevkit:mainfrom May 31, 2023
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.
When we forward a payment and receive an
update_fulfill_htlcmessage from the downstream channel, we immediately claim the HTLC
on the upstream channel, before even doing a
commitment_signeddance on the downstream channel. This implies that our
ChannelMonitorUpdates "go out" in the right order - first weensure we'll get our money by writing the preimage down, then we
write the update that resolves giving money on the downstream node.
This is safe as long as
ChannelMonitorUpdates complete in theorder in which they are generated, but of course looking forward we
want to support asynchronous updates, which may complete in any
order.
Here we add infrastructure to handle downstream
ChannelMonitorUpdates which are blocked on an upstreampreimage-containing one. We don't yet actually do the blocking which
will come in a future commit.
Based on #2111,the follow up is be based on #2112 plus this.