-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
routing: non-strict path finding #3558
routing: non-strict path finding #3558
Conversation
6dd4409
to
1bcafde
Compare
|
||
// MaxMilliSatoshi is the maximum number of msats that can be expressed | ||
// in this data type. | ||
MaxMilliSatoshi = ^MilliSatoshi(0) |
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.
should we cap this at 21M * 100M * 1000 msat instead? introduce in same commit as usage?
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.
ltc...?
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's the maximum amount of millisatoshis that could ever exist on the chain. Litecoin would have a different amount though.
routing/unified_policy.go
Outdated
u.feeProportionalMillionths = policy.FeeProportionalMillionths | ||
} | ||
|
||
// For htlc amount constraints, take the widest range. |
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.
are we not trying to take the narrowest range, as to be able to satisfy any of the links? maybe we are thinking about the widths differently
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 took a different approach where I don't squash all policies together. Instead, the optimal policy is returned based on the actual amount.
1bcafde
to
3a6660a
Compare
Did a quick check how prevalent multiple (advertized) channels between a pair of nodes at the moment. About 7.5% of the node pairs have multiple channels. This doesn't say much though about how often multi-channel node connections are traversed during payments.
|
Results when filtered for channels between bos list nodes is 20%.
|
3a6660a
to
1a473cc
Compare
1a473cc
to
bcbfcc1
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.
Nice refactor on BuildRoute
!
|
||
// MaxMilliSatoshi is the maximum number of msats that can be expressed | ||
// in this data type. | ||
MaxMilliSatoshi = ^MilliSatoshi(0) |
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's the maximum amount of millisatoshis that could ever exist on the chain. Litecoin would have a different amount though.
bcbfcc1
to
9fe7b33
Compare
Travis failed with:
Looks unrelated, but is it known? |
Looks unrelated indeed. Maybe caused by the log commit ticker... Could be fixed by #2927 |
9fe7b33
to
fb486c4
Compare
In this commit we change path finding to no longer consider all channels between a pair of nodes individually. We assume that nodes forward non-strict and when we attempt a connection between two nodes, we don't want to try multiple channels because their policies may not be identical. Having distinct policies for channel to the same peer is against the recommendation in the spec, but it happens in the wild. Especially since we recently changed the default cltv delta value. What this commit introduces is a unified policy. This can be looked upon as the greatest common denominator of all policies and should maximize the probability of getting the payment forwarded.
fb486c4
to
a497a59
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.
Very clean and well tested!! LGTM ✅
a497a59
to
729c3a6
Compare
This pr makes path finding (and build route) aware of non-strict forwarding. Before deciding on a path edge, it calculates a single unified policy for the complete set of channels between two nodes.