Conversation
LDK folds every probe result into the scorer's decayed liquidity bounds and throws the individual event away. By the time anything downstream reads ChannelLiquidities, each probe's path, timing, amount and failing hop have been collapsed into one (min, max) interval per channel direction and are unrecoverable. Add an opt-in sink so a consumer can retain them: - ProbeOutcome: payment id, status, destination, path pubkeys and scids, delivered amount, routing fee. - ProbeStatus: Succeeded, or Failed with the failing scid when LDK attributed one (it often cannot, and the scid may be an alias rather than a public-graph scid, so consumers must tolerate a miss). - ProbeObserver: one callback, documented as must-not-block because it runs inline on the event-handling path. - ProbingConfigBuilder::probe_observer registers it; unset means today's behavior exactly. The ProbeFailed arm in event.rs now destructures short_channel_id, which it previously discarded, and handle_background_probe_failed takes it through. Both handlers already fire for probes sent via send_probes as well as background ones, so targeted probing is covered by the same hook. ProbingConfig loses its derived Debug (Arc<dyn ProbeObserver> cannot derive one) and gains a hand-written impl, mirroring how ProbingStrategyKind::Custom is already handled. Five unit tests cover the path-to-outcome mapping, including the two edge cases that would otherwise panic or mislead: an empty path yields nothing, and a single-hop path reports the full amount with a zero routing fee.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of 3 for ZeusLN/mytikas#130. Targets
probing-service, notmain.Why
LDK folds every probe result into the scorer's decayed liquidity bounds and
throws the individual event away. By the time anything downstream reads
ChannelLiquidities, each probe's path, timing, amount and failing hop havebeen collapsed into one
(min, max)interval per channel direction and areunrecoverable. Today
handle_background_probe_successful/_faileddonothing but
log_debug!.What
An opt-in sink, unset by default:
ProbeOutcome— payment id, status, destination, path pubkeys and scids,delivered amount, routing fee.
ProbeStatus—Succeeded, orFailed { failing_scid }when LDK attributedone. It often cannot, and when it can the scid may be an SCID alias rather
than a public-graph scid, so the docs tell consumers to tolerate a miss.
ProbeObserver— one callback, documented as must not block: it runsinline on the event-handling path.
ProbingConfigBuilder::probe_observerregisters it.The
ProbeFailedarm inevent.rsnow destructuresshort_channel_id, whichit previously discarded. Both handlers already fire for probes sent via
send_probesas well as background ones, so targeted probing is covered by thesame hook with no extra wiring.
ProbingConfigloses its derivedDebug(Arc<dyn ProbeObserver>cannotderive one) and gains a hand-written impl, mirroring how
ProbingStrategyKind::Customis already handled.Note on what is not here
There is no failure-reason field, because LDK's
ProbeFaileddoes not carryone at this revision:
{ payment_id, payment_hash, path, short_channel_id }.Anything wanting
PaymentFailureReasonon a probe needs an upstream changefirst.
Testing
Five unit tests over the path-to-outcome mapping, including the two edge cases
that would otherwise panic or mislead: an empty path yields nothing rather than
indexing
hops.last(), and a single-hop path reports the full amount with azero routing fee (LDK stores the delivered value in the last hop's
fee_msat, so the naive sum is wrong).cargo test --lib: 46 passed, including the 5 new ones.cargo check --libclean with and without--features uniffi.cargo doc --no-depsclean (intra-doc links resolve).cargo fmt --check: the three files touched here are clean. The tree haspre-existing diffs in
chain/mod.rs,lib.rsandwallet/mod.rsthat thisbranch does not touch, so the new code was hand-matched rather than running
a formatter over the tree.