Add probe path selection for background liquidity probing#4664
Add probe path selection for background liquidity probing#4664151henry151 wants to merge 1 commit into
Conversation
|
👋 Thanks for assigning @tnull as a reviewer! |
|
No new issues found in this re-review pass. The previously flagged issues have been addressed in the current commit. Review SummaryPreviously flagged issues — now resolved:
Still open (judgment calls, not re-posted):
I verified the refactored preflight loop and the shared |
|
Addressed the bot feedback in cbd9c04: corrected the Is the norm here is to squash this kind of follow-up into one commit or keep the two-commit history? |
|
Addressed all three comments in the latest commit (b17afa6). Moved probe score-param tuning to Squash commits, or keep history? |
|
🔔 1st Reminder Hey @wpaulino! This PR has been waiting for your review. |
|
🔔 2nd Reminder Hey @wpaulino! This PR has been waiting for your review. |
b17afa6 to
914d5db
Compare
|
Squashed to one commit — review feedback folded in, instead of added as fix-ups on top. |
Add RouteParameters::from_probe_target, ProbabilisticScoringFeeParameters::for_probing, and ScoreLookUp::params_for_probe so background probes route through find_route with diversity scoring. Add ChannelManager::send_probe_to_node and probing integration tests. Fixes lightningdevkit#2720
914d5db to
7d1af6f
Compare
|
Latest squash sets max_path_count = 1 in from_probe_target per bot feedback. |
|
🔔 1st Reminder Hey @tnull! This PR has been waiting for your review. |
PR description updated (2026-06-08) to match review feedback in
b17afa6b4.Issue #2720 originally suggested a wrapper
ScoreLookUparoundProbabilisticScorer. #3422 already addedprobing_diversity_penalty_msatfor the same purpose; this PR wires that field into background probe path selection without a redundant wrapper or separate router API.Background prober loops (random target/amount on a timer) remain userland / separate-crate per maintainer consensus.
This adds
RouteParameters::from_probe_target(uncapped routing fees and a runtime-onlybackground_probeflag),ProbabilisticScoringFeeParameters::for_probing(amount_msat)(sets a diversity penalty when none is configured), andScoreLookUp::params_for_probe(ProbabilisticScorercallsfor_probing;DefaultRouter::find_routecalls it automatically whenbackground_probeis set). Background probes route through the existingfind_routepath — there is no separatefind_probe_routeonRouter.ChannelManager::send_probe_to_nodeis the simple find-and-send entry point. Manual callers using the freefind_routeshould callscorer.params_for_probe(...)themselves. Preflight probe sending shares an internaltrim_unannounced_probe_last_hopshelper; behavior is unchanged. Router and functional tests verify probe path diversity across repeated probes and end-to-end probe sending.For ongoing probing, use
send_probe_to_nodewith aDefaultRouter— diversity scoring is applied per call viaparams_for_probe. Alternatively, setprobing_diversity_penalty_msaton the router at construction for fixed probe amounts. This is intentionally different fromsend_spontaneous_preflight_probes, which probes all MPP paths with payment fee caps and tries to avoid saturating liquidity immediately before the payment is sent.Fixes #2720
Tested with:
cargo +1.75.0 test -p lightning --lib probing— passedcargo +1.75.0 test -p lightning --lib find_probe_route— passedcargo +1.75.0 test -p lightning --lib for_probing— passedcargo +1.75.0 test -p lightning --lib preflight_probe— passedcargo +1.75.0 test -p lightning --lib router::tests— passedcargo +1.75.0 doc -p lightning --no-deps— passedRUSTFLAGS="--cfg=c_bindings" cargo +1.75.0 check -p lightning— passedcargo +1.75.0 fmt --all— passed