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

Pre-refactor for HTLC Interception #1840

Conversation

valentinewallace
Copy link
Contributor

Clears the path for #1835 to have a smaller changeset there.

If we want, I can also pull in bcac847 which tracks pending intercepts in ChannelManager (though none will be tracked until 1835).

@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2022

Codecov Report

Base: 90.77% // Head: 90.81% // Increases project coverage by +0.04% 🎉

Coverage data is based on head (c793549) compared to base (505102d).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1840      +/-   ##
==========================================
+ Coverage   90.77%   90.81%   +0.04%     
==========================================
  Files          87       87              
  Lines       47595    47727     +132     
  Branches    47595    47727     +132     
==========================================
+ Hits        43204    43345     +141     
+ Misses       4391     4382       -9     
Impacted Files Coverage Δ
lightning/src/ln/channelmanager.rs 85.38% <100.00%> (-0.02%) ⬇️
lightning/src/ln/onion_route_tests.rs 97.58% <100.00%> (ø)
lightning/src/util/scid_utils.rs 99.20% <100.00%> (+0.01%) ⬆️
lightning-net-tokio/src/lib.rs 76.73% <0.00%> (-0.31%) ⬇️
lightning/src/chain/channelmonitor.rs 90.70% <0.00%> (+0.05%) ⬆️
lightning/src/ln/functional_tests.rs 97.09% <0.00%> (+0.07%) ⬆️
lightning/src/chain/onchaintx.rs 95.22% <0.00%> (+0.86%) ⬆️
lightning-rapid-gossip-sync/src/processing.rs 94.76% <0.00%> (+3.27%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

valentinewallace and others added 4 commits November 8, 2022 15:48
In upcoming commit(s), we'll want to store intercepted HTLC forwards in
ChannelManager before the user signals that they should be forwarded.  It
wouldn't make sense to store a HTLCForwardInfo as-is because the FailHTLC
variant doesn't make sense, so we refactor out the ::AddHTLC contents into its
own struct for storage.

Co-authored-by: John Cantrell <[email protected]>
Co-authored-by: Valentine Wallace <[email protected]>
Used in upcoming commit(s) when we generate the PaymentIntercepted event for
intercepted payments.

Co-authored-by: John Cantrell <[email protected]>
Co-authored-by: Valentine Wallace <[email protected]>
cargo bench was able to find an scid of 0 as a valid fake scid
@@ -2194,6 +2197,7 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
routing,
payment_hash,
incoming_shared_secret: shared_secret,
amt_incoming: Some(amt_msat),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a followup, lets rename this incoming_amt_msat and the following to_forward_amt_msat or just some ther names with msat in them.

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 this pull request may close these issues.

4 participants