Uh oh!
There was an error while loading. Please reload this page.
Add ChannelContext::get_commitment_stats - #3682
Conversation
👋 Thanks for assigning @wpaulino as a reviewer! |
0af1b43 to
31300c3CompareTheBlueMatt
commented
Mar 25, 2025
Why is this draft? |
tankyleo
commented
Mar 25, 2025
@TheBlueMatt I don't feel great about the code duplication between Let me know what you think. |
tankyleo
commented
Mar 25, 2025
I'm working on further cleanups now. |
d6b1f51 to
c540347Comparetankyleo
commented
Mar 25, 2025
@wpaulino the PR is in a better spot now, let me know what you think. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
c540347 to
c9b30cbComparee637050 to
4d6bf13CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
5a212d8 to
d682615CompareCodecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #3682 +/- ##
==========================================
- Coverage 89.18% 89.16% -0.03%
==========================================
Files 155 155 Lines 120796 120861 +65 Branches 120796 120861 +65 ==========================================
+ Hits 107731 107760 +29 - Misses 10415 10446 +31 - Partials 2650 2655 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d682615 to
6f80f99Comparetankyleo
commented
Mar 27, 2025
@TheBlueMatt take a look when you can thank you! |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
a6c6eac to
71df614Compare
TheBlueMatt
left a comment
There was a problem hiding this comment.
Basically LGTM, one nit. Sorry somehow I lost track of this one.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
TheBlueMatt
left a comment
There was a problem hiding this comment.
Needs rebase, it seems
6d8fb6e to
793d4d2Comparetankyleo
commented
Apr 4, 2025
A question for you in an above comment Matt thanks :) |
0c7bab6 to
285f1b9CompareUh oh!
There was an error while loading. Please reload this page.
ldk-reviews-bot
commented
Apr 7, 2025
🔔 1st Reminder Hey @wpaulino! This PR has been waiting for your review. |
Uh oh!
There was an error while loading. Please reload this page.
285f1b9 to
39f11e6Compare39f11e6 to
107619eCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
It can be useful to get the stats on a potential commitment transaction without actually building it. Therefore, this commit splits the stats calculations from the actual build of a commitment transaction. This introduces an extra loop over the pending htlcs when actually building a commitment transaction, but current network behavior produces very few concurrent htlcs on channels. Furthermore, each iteration of the loop in the stats calculation is very cheap. The motivating use case for `build_commitment_stats` is to calculate the balances of the channel parties in order to validate the `funding_contribution_satoshis` field of `splice_init` and `splice_ack` messages without building a full commitment transaction.
186a320 to
fb69869CompareThis allows us to DRY the code that calculates the `value_to_self_msat_offset` in `ChannelContext::build_commitment_stats`. HTLC success states have held their corresponding preimage since 0.0.105, and the release notes of 0.1 already require users running 0.0.123 and earlier to resolve their HTLCs before upgrading to 0.1. So this change is fully compatible with existing upgrade paths to the yet-to-be-shipped 0.2 release.
fb69869 to
671c4b0Compare
Requested by @wpaulino in #3641