Support decoding HTLC onions once fully committed#2845
Merged
TheBlueMatt merged 15 commits intolightningdevkit:mainfrom Mar 28, 2024
Merged
Support decoding HTLC onions once fully committed#2845TheBlueMatt merged 15 commits intolightningdevkit:mainfrom
TheBlueMatt merged 15 commits intolightningdevkit:mainfrom
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.
Currently, we decode HTLC onions immediately upon receiving an
update_add_htlc. Doing so determines what we should do with the HTLC: forward it, or immediately fail it back if it cannot be accepted. This action is tracked until the HTLC is fully committed to by both sides, and a new commitment in the latter case is proposed to fully remove the HTLC. While this has worked so far, it has some minor privacy implications, as forwarding/failing back do not go through the usualPendingHTLCsForwardableflow. It also presents issues with the quiescence handshake, as failures through this path do not go through the holding cell abstraction, leading to a potential violation of the protocol by sending anupdate_fail_*after already having sentstfu.This PR aims to support, but does not enable, decoding incoming HTLC onions once HTLCs are fully committed to by both sides instead. Unfortunately, switching over is not a forwards compatible change, so we'll need to do so over multiple releases.