Class ProbabilisticScorer


  • public class ProbabilisticScorer
    extends Object
    [`Score`] implementation using channel success probability distributions. Based on *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt and Stefan Richter [[1]]. Given the uncertainty of channel liquidity balances, probability distributions are defined based on knowledge learned from successful and unsuccessful attempts. Then the negative `log10` of the success probability is used to determine the cost of routing a specific HTLC amount through a channel. Knowledge about channel liquidity balances takes the form of upper and lower bounds on the possible liquidity. Certainty of the bounds is decreased over time using a decay function. See [`ProbabilisticScoringParameters`] for details. Since the scorer aims to learn the current channel liquidity balances, it works best for nodes with high payment volume or that actively probe the [`NetworkGraph`]. Nodes with low payment volume are more likely to experience failed payment paths, which would need to be retried. # Note Mixing the `no-std` feature between serialization and deserialization results in undefined behavior. [1]: https://arxiv.org/abs/2107.05322
    • Method Detail

      • debug_log_liquidity_stats

        public void debug_log_liquidity_stats()
        Dump the contents of this scorer into the configured logger. Note that this writes roughly one line per channel for which we have a liquidity estimate, which may be a substantial amount of log output.
      • as_Score

        public Score as_Score()
        Constructs a new Score which calls the relevant methods on this_arg. This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
      • write

        public byte[] write()
        Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read