-
Notifications
You must be signed in to change notification settings - Fork 411
Channel fee penalty (WIP) #635
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
Channel fee penalty (WIP) #635
Conversation
Codecov Report
@@ Coverage Diff @@
## master #635 +/- ##
=======================================
Coverage 91.26% 91.26%
=======================================
Files 35 35
Lines 20929 20929
=======================================
Hits 19101 19101
Misses 1828 1828
Continue to review full report at Codecov.
|
@TheBlueMatt @ariard Can you take a look? |
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.
Looking more on the high-level interface, we may want to have a wrapper one like ChannelScorer
to interact with both NetGraphMsgHandler
and get_route
. So Metadata
approach and calculate_minimum_fee_penalty
makes sense.
What we may want to do is the default implementation of our ChannelScorer
composing score from a list of sub-components like iterating over Vec<ScorerProducer>
and payment_success/failure is one of such implementation of trait ScoreProducer. A client must implement the data feeding part from PaymentSuccess/PaymentFailure
reception.
That way a client can benefits from our default ScoreProducer
impls and add custom ones easily (ChannelScorer::add_scorer_producer
)
@@ -488,6 +503,13 @@ impl std::fmt::Display for NetworkGraph { | |||
} | |||
} | |||
|
|||
/// By default, just do nothing when scoring channels. A user is free to extend these | |||
/// definitions to meet their needs. |
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.
It would be great to have example in documentation, like a type Metadata being a struct BasicReliability { uptime: u32, flapiness: u32 }. Just a doc example not a default implementation.
I think the biggest goal of a default channel scorer would be to ensure we don't return a just-failed route - currently if we happily return the same (lowest-fee) route over and over again and there isn't an easy way to say "I literally just tried that route and it failed". Doing more fancy stuff is cool, but just starting with a nice trait and something simple to address this failure mode would be a massive win. |
72f9cf2
to
f08d610
Compare
Idea is to have an interface between NetworkGraph and the user's personal channel metadata. The user needs to implement a way of converting their metadata into a fee penalty so that NetworkGraph's route-finding algorithm remains tractable.