Repository navigation
Conversation
We only allowed underpaying HTLCs on an inbound channel if protocol discovery had found the counterparty to support LSPS2. Discovery results are kept in memory, so after a restart during which the LSP could not be reached, a JIT channel opened for an earlier invoice was accepted without the override. The fee-skimmed payment was then rejected, and as the override cannot be set later, the invoice could never be paid. We now set the override for any configured LSP, as we already do when deciding whether to trust it for 0conf. The skimmed fee is still checked against the limit from the payment metadata before claiming. Co-Authored-By: HAL 9000
|
👋 Thanks for assigning @tankyleo as a reviewer! |
ajaysehwal
reviewed
Nov 25, 2026
| } | ||
|
|
||
| #[tokio::test(flavor = "multi_thread", worker_threads = 1)] | ||
| async fn lsps2_client_receives_jit_payment_before_discovering_lsp() { |
Contributor
There was a problem hiding this comment.
This test relies on a fixed 6s sleep and on the payment reaching the client before the second discovery retry (about 15s after start). On a slow runner, the retry could succeed first and the test would pass without exercising this change. Could you confirm it fails on the parent commit, or make it deterministic, e.g. assert the LSP is still undiscovered when the channel is accepted?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
We only allowed underpaying HTLCs on an inbound channel if protocol discovery had found the counterparty to support LSPS2. Discovery results are kept in memory, so after a restart during which the LSP could not be reached, a JIT channel opened for an earlier invoice was accepted without the override. The fee-skimmed payment was then rejected, and as the override cannot be set later, the invoice could never be paid.
We now set the override for any configured LSP, as we already do when deciding whether to trust it for 0conf. The skimmed fee is still checked against the limit from the payment metadata before claiming.
Co-Authored-By: HAL 9000