Module scoring
Expand description
Utilities for scoring payment channels.
ProbabilisticScorer
may be given to find_route
to score payment channels during path
finding when a custom ScoreLookUp
implementation is not needed.
§Example
// Use the default channel penalties.
let params = ProbabilisticScoringFeeParameters::default();
let decay_params = ProbabilisticScoringDecayParameters::default();
let scorer = ProbabilisticScorer::new(decay_params, &network_graph, &logger);
// Or use custom channel penalties.
let params = ProbabilisticScoringFeeParameters {
liquidity_penalty_multiplier_msat: 2 * 1000,
..ProbabilisticScoringFeeParameters::default()
};
let decay_params = ProbabilisticScoringDecayParameters::default();
let scorer = ProbabilisticScorer::new(decay_params, &network_graph, &logger);
let route = find_route(&payer, &route_params, &network_graph, None, &logger, &scorer, ¶ms, &random_seed_bytes);
§Note
Persisting when built with feature no-std
and restoring without it, or vice versa, uses
different types and thus is undefined.
Structs§
- Channel
Usage - Proposed use of a channel passed as a parameter to
ScoreLookUp::channel_penalty_msat
. - Fixed
Penalty Scorer ScoreLookUp
implementation that uses a fixed penalty.- Probabilistic
Scorer Using Time - Probabilistic
ScoreLookUp
implementation. - Probabilistic
Scoring Decay Parameters - Parameters for configuring
ProbabilisticScorer
. - Probabilistic
Scoring FeeParameters - Parameters for configuring
ProbabilisticScorer
.
Traits§
- Lockable
Score - A scorer that is accessed under a lock.
- Score
- A trait which can both lookup and update routing channel penalty scores.
- Score
Look Up - An interface used to score payment channels for path finding.
- Score
Update ScoreUpdate
is used to update the scorer’s internal state after a payment attempt.- Writeable
Score - Refers to a scorer that is accessible under lock and also writeable to disk
Type Aliases§
- Probabilistic
Scorer ScoreLookUp
implementation using channel success probability distributions.