Commit a727bcf
Fix probing budget accounting and remove Probe::Destination
The locked_msat budget tracking was broken for Destination probes:
send_spontaneous_preflight_probes only returns (PaymentHash, PaymentId)
without exposing the actual paths or per-hop amounts. This meant we
locked amount_msat at send time but released amount+fees per path in
ProbeSuccessful/ProbeFailed events, causing a systematic mismatch.
Fix by removing Probe::Destination entirely. Strategies now return a
fully constructed Path, and run_prober always uses send_probe(path),
locking and releasing the same path.hops.sum(fee_msat) on both sides.
HighDegreeStrategy now calls Router::find_route directly and applies the
liquidity-limit check itself, mirroring send_preflight_probes.
Other fixes in this commit:
- Fix RandomStrategy fee calculation: compute proportional fees on the
forwarded amount (delivery + downstream fees), not just delivery
- Fix HighDegreeStrategy doc
- Fix random_range overflow when max - min == u64::MAX
- Add doc warning about scorer_channel_liquidity being O(scorer size)
- Make probing module public, import objects directly in builder.rs
- Reorder EventHandler fields (prober after om_mailbox)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent c470da6 commit a727bcf
File tree
7 files changed
+257
-162
lines changed- src
- tests
- common
7 files changed
+257
-162
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| |||
284 | 286 | | |
285 | 287 | | |
286 | 288 | | |
287 | | - | |
| 289 | + | |
288 | 290 | | |
289 | 291 | | |
290 | 292 | | |
| |||
623 | 625 | | |
624 | 626 | | |
625 | 627 | | |
626 | | - | |
| 628 | + | |
627 | 629 | | |
628 | 630 | | |
629 | 631 | | |
| |||
633 | 635 | | |
634 | 636 | | |
635 | 637 | | |
636 | | - | |
| 638 | + | |
637 | 639 | | |
638 | 640 | | |
639 | 641 | | |
| |||
1108 | 1110 | | |
1109 | 1111 | | |
1110 | 1112 | | |
1111 | | - | |
1112 | | - | |
| 1113 | + | |
| 1114 | + | |
1113 | 1115 | | |
1114 | 1116 | | |
1115 | 1117 | | |
| |||
1256 | 1258 | | |
1257 | 1259 | | |
1258 | 1260 | | |
1259 | | - | |
1260 | | - | |
1261 | | - | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
1262 | 1264 | | |
1263 | 1265 | | |
1264 | 1266 | | |
| |||
2002 | 2004 | | |
2003 | 2005 | | |
2004 | 2006 | | |
2005 | | - | |
2006 | | - | |
2007 | | - | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
2008 | 2010 | | |
| 2011 | + | |
| 2012 | + | |
2009 | 2013 | | |
2010 | 2014 | | |
2011 | 2015 | | |
2012 | 2016 | | |
| 2017 | + | |
2013 | 2018 | | |
2014 | 2019 | | |
2015 | | - | |
2016 | | - | |
2017 | | - | |
2018 | | - | |
2019 | | - | |
2020 | | - | |
2021 | | - | |
2022 | | - | |
2023 | | - | |
2024 | | - | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
2025 | 2028 | | |
2026 | | - | |
| 2029 | + | |
2027 | 2030 | | |
2028 | 2031 | | |
2029 | 2032 | | |
2030 | 2033 | | |
2031 | | - | |
2032 | 2034 | | |
2033 | 2035 | | |
2034 | 2036 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | 513 | | |
517 | 514 | | |
518 | 515 | | |
519 | 516 | | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
520 | 520 | | |
521 | 521 | | |
522 | 522 | | |
| |||
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
535 | | - | |
| 535 | + | |
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
| |||
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | 549 | | |
553 | 550 | | |
554 | 551 | | |
555 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
| 175 | + | |
179 | 176 | | |
180 | 177 | | |
181 | 178 | | |
| |||
245 | 242 | | |
246 | 243 | | |
247 | 244 | | |
248 | | - | |
| 245 | + | |
249 | 246 | | |
250 | 247 | | |
251 | 248 | | |
| |||
597 | 594 | | |
598 | 595 | | |
599 | 596 | | |
| 597 | + | |
600 | 598 | | |
601 | 599 | | |
602 | 600 | | |
603 | | - | |
604 | 601 | | |
605 | 602 | | |
606 | 603 | | |
607 | 604 | | |
608 | 605 | | |
609 | | - | |
| 606 | + | |
610 | 607 | | |
611 | 608 | | |
612 | 609 | | |
| |||
1090 | 1087 | | |
1091 | 1088 | | |
1092 | 1089 | | |
1093 | | - | |
1094 | | - | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
1095 | 1093 | | |
1096 | 1094 | | |
1097 | 1095 | | |
| |||
0 commit comments