-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include source and destination nodes in routing::Score #1133
Include source and destination nodes in routing::Score #1133
Conversation
In order to make the scoring tests easier to read, only check the relevant RouteHop fields. The remaining fields are tested elsewhere. Expand the test to show the path used without scoring.
Codecov Report
@@ Coverage Diff @@
## main #1133 +/- ##
=======================================
Coverage 90.56% 90.56%
=======================================
Files 67 67
Lines 34567 34597 +30
=======================================
+ Hits 31305 31334 +29
- Misses 3262 3263 +1
Continue to review full report at Codecov.
|
/// An interface used to score payment channels for path finding. | ||
/// | ||
/// Scoring is in terms of fees willing to be paid in order to avoid routing through a channel. | ||
pub trait Score { | ||
/// Returns the fee in msats willing to be paid to avoid routing through the given channel. | ||
fn channel_penalty_msat(&self, short_channel_id: u64) -> u64; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit +"in the given direction" on the docs.
d8f0266
to
a950b8f
Compare
lightning/src/routing/mod.rs
Outdated
@@ -19,7 +19,8 @@ use routing::network_graph::NodeId; | |||
/// | |||
/// Scoring is in terms of fees willing to be paid in order to avoid routing through a channel. | |||
pub trait Score { | |||
/// Returns the fee in msats willing to be paid to avoid routing through the given channel. | |||
/// Returns the fee in msats willing to be paid to avoid routing through the given channel from | |||
/// `source` to `destination`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't the source
and dest
of the payment itself, right? Just the forwarder/forwardee of the given short_channel_id
? Those names are a bit overloaded for me lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. I could use the more general term target
instead of destination
and reword the docs a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that makes it clearer for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you squash.
Expand routing::Score::channel_penalty_msat to include the source and target node ids of the channel. This allows scorers to avoid certain nodes altogether if desired.
e3a1b8a
to
54f490c
Compare
Squashed without changed:
|
Expand
routing::Score::channel_penalty_msat
to include the source and target node ids of the channel. This allows scorers to avoid certain nodes altogether if desired.