Skip to content

Add infra to block ChannelMonitorUpdates on forwarded claims#2167

Merged
TheBlueMatt merged 8 commits intolightningdevkit:mainfrom
TheBlueMatt:2023-04-monitor-e-monitor-prep
May 31, 2023
Merged

Add infra to block ChannelMonitorUpdates on forwarded claims#2167
TheBlueMatt merged 8 commits intolightningdevkit:mainfrom
TheBlueMatt:2023-04-monitor-e-monitor-prep

Conversation

@TheBlueMatt
Copy link
Copy Markdown
Collaborator

@TheBlueMatt TheBlueMatt commented Apr 7, 2023

When we forward a payment and receive an update_fulfill_htlc
message from the downstream channel, we immediately claim the HTLC
on the upstream channel, before even doing a commitment_signed
dance on the downstream channel. This implies that our
ChannelMonitorUpdates "go out" in the right order - first we
ensure 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 the
order 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 upstream
preimage-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.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants