Skip to content
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

htlcswitch: pipeline pre-images to the incoming link as soon as it's obtained #3069

Closed
2 tasks
Roasbeef opened this issue May 10, 2019 · 1 comment · Fixed by #3143
Closed
2 tasks

htlcswitch: pipeline pre-images to the incoming link as soon as it's obtained #3069

Roasbeef opened this issue May 10, 2019 · 1 comment · Fixed by #3143
Labels
advanced Issues suitable for very experienced developers bug fix enhancement Improvements to existing features / behaviour intermediate Issues suitable for developers moderately familiar with the codebase and LN P2 should be fixed if one has time

Comments

@Roasbeef
Copy link
Member

Roasbeef commented May 10, 2019

Today, once we receive a pre-image from the remote party, we don't immediately pipeline it to the incoming link. Instead, we'll wait until we receive a revocation from the remote party as that's when we examine the commitments for updates that have been fully locked in which we can process. If we start to properly pipeline these pre-images, then we'll be able to save some perceived latency of payments (1.5 RTT vs 0.5 RTT), as well as address some scenarios where lost messages may cause us to never settle the HTLC on the incoming link (#2045 ).

Steps To Completion

  • Right after we receive the settle, send the pre-image to the switch using the proper circuit identifiers. This achieves pipelining, but introduces other loose ends that need to be tied up.

  • With the above change, it's possible to send a duplicate settle to the incoming link. As implement atm, this would cause an error on the incoming link, making it reject that new update. Atm, we don't distinguish between a double settle error, and an invalid pre-image. We'll need to make concrete errors for both these cases to ensure we don't cause any force closes or link failures due to duplicate settles.

@Roasbeef Roasbeef added enhancement Improvements to existing features / behaviour intermediate Issues suitable for developers moderately familiar with the codebase and LN advanced Issues suitable for very experienced developers P2 should be fixed if one has time bug fix labels May 10, 2019
@Crypt-iQ
Copy link
Collaborator

I can take a look at this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advanced Issues suitable for very experienced developers bug fix enhancement Improvements to existing features / behaviour intermediate Issues suitable for developers moderately familiar with the codebase and LN P2 should be fixed if one has time
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants