Module scoring

Source
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, &params, &random_seed_bytes);

Structs§

ChannelLiquidities
Container for live and historical liquidity bounds for each channel.
ChannelUsage
Proposed use of a channel passed as a parameter to ScoreLookUp::channel_penalty_msat.
CombinedScorer
A probabilistic scorer that combines local and external information to score channels. This scorer is shadow-tracking local only scores, so that it becomes possible to cleanly merge external scores when they become available.
FixedPenaltyScorer
ScoreLookUp implementation that uses a fixed penalty.
ProbabilisticScorer
ScoreLookUp implementation using channel success probability distributions.
ProbabilisticScoringDecayParameters
Parameters for configuring ProbabilisticScorer.
ProbabilisticScoringFeeParameters
Parameters for configuring ProbabilisticScorer.

Traits§

LockableScore
A scorer that is accessed under a lock.
Score
A trait which can both lookup and update routing channel penalty scores.
ScoreLookUp
An interface used to score payment channels for path finding.
ScoreUpdate
ScoreUpdate is used to update the scorer’s internal state after a payment attempt.
WriteableScore
Refers to a scorer that is accessible under lock and also writeable to disk