-
Notifications
You must be signed in to change notification settings - Fork 407
[#2189] Score Fee Params as a passed in parameter #2237
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
[#2189] Score Fee Params as a passed in parameter #2237
Conversation
henghonglee
commented
Apr 26, 2023
•
edited
Loading
edited
9ec4e0f
to
d3273d3
Compare
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 for working on this!
65a65ea
to
b00c185
Compare
Needs rebase, though it looks like you just have some commits that made their way upstream on this branch? |
7605325
to
25924b3
Compare
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.
Hi @TheBlueMatt, Ive tried to list down the issues im facing here. tried a few different variations of this solution but ive rolled back to this one since its the simplest and imo closest to what i want to achieve
db1db6e
to
9362cbd
Compare
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.
@TheBlueMatt could you also take a quick look at the other comments that i made? in router.rs
530cb5d
to
422d73d
Compare
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.
Hi @TheBlueMatt, it's finally ready for review :)
422d73d
to
1c8c153
Compare
c3e3764
to
490f401
Compare
You can tell github thinks your line is too long because it cut off the last word and replace it with ... :). I think its cutoff is |
6d882ab
to
567a225
Compare
lightning/src/routing/scoring.rs
Outdated
pub manual_node_penalties: HashMap<NodeId, u64>, | ||
|
||
|
||
/// This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the |
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.
I think writing out htlc_maximum_msat ≥ 0.5 * channel_capacity might make this a bit easier to read
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.
I just moved this. but happy to make this change if thats necessary
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.
Do it in a separate commit to preserve the move-only-ness, but nothing wrong with cleaning things up when they're getting touched anyway.
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.
sure i can tease that out it into a seperate commit.
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.
lightning/src/routing/scoring.rs
Outdated
/// these decay parameters affect the score of the channel penalty but are usually not changed on a per-route | ||
/// penalty cost call. |
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: These
Also, "per-route" could probably go on the next line.
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.
okay will do
567a225
to
d1e9af7
Compare
8aacbe7
to
a2d0363
Compare
Its not critical, but if you do have to push again for some reason, your commit message still has lines (in the body, post-title) that are longer than 70 chars long. This LGTM, however, I'll let @arik-so take another look. |
04dc495
to
0614a6a
Compare
Looks good, but there are failing tests, so I imagine you're probably gonna need to push again. |
This PR aims to create a "stateless" scorer. Instead of passing in fee params at construction-time, we want to parametrize the scorer with an associated "parameter" type, which is then passed to the router function itself, and allows passing different parameters per route-finding call.
0614a6a
to
ecd7992
Compare
ecd7992
to
86af670
Compare
@arik-so checks seems to be passing now |
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!
|
||
#[cfg(test)] | ||
impl ProbabilisticScoringDecayParameters { | ||
fn zero_penalty() -> Self { |
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.
Heh, we don't really need a duplicate of default that does the same thing :)