Add probe path selection for background liquidity probing#4664
Add probe path selection for background liquidity probing#4664151henry151 wants to merge 2 commits into
Conversation
Expose probe-tuned route finding via find_probe_route, Router::find_probe_route, and ChannelManager::send_probe_to_node. Wire probing_diversity_penalty_msat through ProbabilisticScoringFeeParameters::for_probing and DefaultRouter::find_probe_route_with_diversity.
|
I've assigned @wpaulino as a reviewer! |
|
All three of my prior comments have been addressed by the latest commit:
I've reviewed all remaining code in the diff — the refactoring of trim logic, the Review SummaryNo new issues found. All three issues from the prior review pass have been addressed in the latest commit (cbd9c04 "Address review feedback on probing path selection"):
|
Fix find_probe_route_with_diversity docs to recommend send_probe for pre-computed routes rather than send_probe_to_node. Correct for_probing historical amount divisor to AMOUNT_PENALTY_DIVISOR. Extend send_probe_to_node_happy_path to complete the probe lifecycle.
|
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? |
Issue #2720 originally suggested a wrapper
ScoreLookUparoundProbabilisticScorer. #3422 already addedprobing_diversity_penalty_msatfor the same purpose; this PR wires that field into a dedicated path-selection API rather than adding a redundant wrapper.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 for probing),ProbabilisticScoringFeeParameters::for_probing(amount_msat)(sets a diversity penalty when none is configured), a genericfind_probe_routefree function, a defaultRouter::find_probe_route,DefaultRouter::find_probe_route_with_diversityfor per-call dynamic diversity, andChannelManager::send_probe_to_nodeas the simple find-and-send entry point. Preflight probe sending now 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 with fixed amounts, configure diversity on the router at startup and use
send_probe_to_node. For variable probe amounts, useDefaultRouter::find_probe_route_with_diversityand pass the first path toChannelManager::send_probe, or usesend_probe_to_nodeif trimming and sending in one step is enough. This is intentionally different fromsend_spontaneous_preflight_probes, which probes all MPP paths with payment fee caps and a liquidity multiplier for pre-payment training.Fixes #2720
Tested with:
cargo +1.75.0 test -p lightning --lib probing— passedcargo +1.75.0 test -p lightning --lib probes_for_diversity— passedcargo +1.75.0 test -p lightning --lib preflight_probe— passedcargo +1.75.0 test -p lightning --lib router— 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