Skip to content

Commit 890fd05

Browse files
committed
Probabilistic channel scoring
Add a Score implementation 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 log of the success probability is used to determine the cost of routing a specific HTLC amount through a channel. [1]: https://arxiv.org/abs/2107.05322
1 parent 0a9c2af commit 890fd05

File tree

2 files changed

+602
-10
lines changed

2 files changed

+602
-10
lines changed

lightning-invoice/src/payment.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
//! # }
8383
//! # impl Score for FakeScorer {
8484
//! # fn channel_penalty_msat(
85-
//! # &self, _short_channel_id: u64, _send_amt: u64, _chan_amt: Option<u64>, _source: &NodeId, _target: &NodeId
85+
//! # &self, _short_channel_id: u64, _send_amt: u64, _chan_amt: u64, _source: &NodeId, _target: &NodeId
8686
//! # ) -> u64 { 0 }
8787
//! # fn payment_path_failed(&mut self, _path: &[&RouteHop], _short_channel_id: u64) {}
8888
//! # fn payment_path_successful(&mut self, _path: &[&RouteHop]) {}
@@ -1295,7 +1295,7 @@ mod tests {
12951295

12961296
impl Score for TestScorer {
12971297
fn channel_penalty_msat(
1298-
&self, _short_channel_id: u64, _send_amt: u64, _chan_amt: Option<u64>, _source: &NodeId, _target: &NodeId
1298+
&self, _short_channel_id: u64, _send_amt: u64, _chan_amt: u64, _source: &NodeId, _target: &NodeId
12991299
) -> u64 { 0 }
13001300

13011301
fn payment_path_failed(&mut self, actual_path: &[&RouteHop], actual_short_channel_id: u64) {

0 commit comments

Comments
 (0)