Better Encapsulate Scoring and Cache Point Count
When we go to score a channel using the historical liquidity data, the first thing we do is step through all the valid bucket combinations, multiply the min and max bucket, and then add them together to calculate the total number of points tracked. This isn't a free operation, and for scorers without much data it represents a large part of the total time spent scoring during routefinding.
Thus, here we cache this value, updating it every time the buckets
are updated. In order to do so, we first have to clean up scorer.rs, which has been needed for some time anyway, improving encapsulation so that caching is more reasonable.
Codecov Report
Attention: Patch coverage is 95.23810% with 8 lines in your changes missing coverage. Please review.
Project coverage is 89.70%. Comparing base (
ccce9d9) to head (4fd07ec). Report is 23 commits behind head on main.
| Files | Patch % | Lines |
|---|---|---|
| lightning/src/routing/scoring.rs | 94.32% | 8 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #3188 +/- ##
==========================================
+ Coverage 89.68% 89.70% +0.01%
==========================================
Files 124 125 +1
Lines 102386 102458 +72
Branches 102386 102458 +72
==========================================
+ Hits 91827 91912 +85
+ Misses 7857 7843 -14
- Partials 2702 2703 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
LMK if I should squash.
Yup, feel free to squash.
Squashed without further changes.
Rewrote the last commit message but didn't change the diff at all.
Rebased