Skip to content

JIT Forwards Reload Consistency #1858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TheBlueMatt opened this issue Nov 16, 2022 · 0 comments · Fixed by #1915
Closed

JIT Forwards Reload Consistency #1858

TheBlueMatt opened this issue Nov 16, 2022 · 0 comments · Fixed by #1915
Assignees
Milestone

Comments

@TheBlueMatt
Copy link
Collaborator

After #1835 and #1857 we need to update the changes in 1857 which drop things from the forward_htlcs set if they've already been forwarded to include things in the to-be-intercept-forwarded set, otherwise users can accidentally forward twice if the channelmanager wasnt persisted and the original forward channel is now on chain. Should be an easy change though.

@TheBlueMatt TheBlueMatt added this to the 0.0.113 milestone Nov 16, 2022
@TheBlueMatt TheBlueMatt self-assigned this Dec 1, 2022
TheBlueMatt added a commit to TheBlueMatt/rust-lightning that referenced this issue Dec 13, 2022
If, after forwarding an intercepted payment to our counterparty, we
restart with a ChannelMonitor update having been persisted, but the
corresponding ChannelManager update not having been persisted,
we'll still have the intercepted HTLC in the
`pending_intercepted_htlcs` map on start (and potentially a pending
`HTLCIntercepted` event). This will cause us to allow the user to
handle the forwarded HTLC twice, potentially double-forwarding it.

This builds on 0bb87dd, which
provided a preemptive fix for the general relay case (though it was
not an actual issue at the time). We simply check for the HTLCs
having been forwarded on startup and remove them from the map.

Fixes lightningdevkit#1858
TheBlueMatt added a commit to TheBlueMatt/rust-lightning that referenced this issue Dec 13, 2022
If, after forwarding an intercepted payment to our counterparty, we
restart with a ChannelMonitor update having been persisted, but the
corresponding ChannelManager update not having been persisted,
we'll still have the intercepted HTLC in the
`pending_intercepted_htlcs` map on start (and potentially a pending
`HTLCIntercepted` event). This will cause us to allow the user to
handle the forwarded HTLC twice, potentially double-forwarding it.

This builds on 0bb87dd, which
provided a preemptive fix for the general relay case (though it was
not an actual issue at the time). We simply check for the HTLCs
having been forwarded on startup and remove them from the map.

Fixes lightningdevkit#1858
optout21 pushed a commit to optout21/rust-lightning that referenced this issue Jul 24, 2023
If, after forwarding an intercepted payment to our counterparty, we
restart with a ChannelMonitor update having been persisted, but the
corresponding ChannelManager update not having been persisted,
we'll still have the intercepted HTLC in the
`pending_intercepted_htlcs` map on start (and potentially a pending
`HTLCIntercepted` event). This will cause us to allow the user to
handle the forwarded HTLC twice, potentially double-forwarding it.

This builds on 0bb87dd, which
provided a preemptive fix for the general relay case (though it was
not an actual issue at the time). We simply check for the HTLCs
having been forwarded on startup and remove them from the map.

Fixes lightningdevkit#1858
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 a pull request may close this issue.

1 participant