Include payment hash in more early payment logs#2515
Merged
TheBlueMatt merged 2 commits intolightningdevkit:mainfrom Aug 23, 2023
Merged
Include payment hash in more early payment logs#2515TheBlueMatt merged 2 commits intolightningdevkit:mainfrom
TheBlueMatt merged 2 commits intolightningdevkit:mainfrom
Conversation
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #2515 +/- ##
==========================================
- Coverage 90.53% 90.52% -0.01%
==========================================
Files 107 107
Lines 56923 56931 +8
Branches 56923 56931 +8
==========================================
+ Hits 51533 51537 +4
- Misses 5390 5394 +4
☔ View full report in Codecov by Sentry. |
If a user has issues with a payment, the most obvious thing they'll do is check logs for the payment hash. Thus, we should ensure our logs that show a payment's lifecycle include the payment hash and are emitted (a) as soon as LDK learns of the payment, (b) once the payment goes out to the peer (which is already reasonably covered in the commitment transaction building logs) and (c) when the payment ultimately is fulfilled or fails. Here we improve our logs for both (a) and (c).
Currently, when we receive an HTLC claim from a peer, we first hash the preimage they gave us before removing the HTLC, then immediately pass the preimage to the inbound channel and hash the preimage again before removing the HTLC and sending our peer an `update_fulfill_htlc`. This second hash is actually only asserted on, never used in any meaningful way as we have the htlc data present in the same code. Here we simply drop this second hash and move it into a `debug_assert`.
5016084 to
5a1f212
Compare
wpaulino
approved these changes
Aug 23, 2023
valentinewallace
approved these changes
Aug 23, 2023
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.
Based on #2492,If a user has issues with a payment, the most obvious thing they'll
do is check logs for the payment hash. Thus, we should ensure our
logs that show a payment's lifecycle include the payment hash and
are emitted (a) as soon as LDK learns of the payment, (b) once the
payment goes out to the peer (which is already reasonably covered
in the commitment transaction building logs) and (c) when the
payment ultimately is fulfilled or fails.
Here we improve our logs for both (a) and (c).
As a nice bonus, we also remove a sha256 hash of a payment preimage in every forwarded HTLC claim :).