-
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
routerrpc: fix estimateroutefee for public route hints #9433
routerrpc: fix estimateroutefee for public route hints #9433
Conversation
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
b3d97b5
to
eb1d56a
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 the quick fix, looking good.
I think a unit-test might be worthwhile for the new behaviour.
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.
Concept ACK, in principle, a single public hop hint doesn't lead to fee estimation errors, I think. The advantage in checking if we know the last hop is that we'll also probe it and know if it supports the payment as opposed to the case when we assume an LSP.
7be7d83
to
ec2132b
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, LGTM.
Please update the documentation otherwise good-to-go
ec2132b
to
8c8e852
Compare
@gijswijs: review reminder |
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.
Had 1 question and 1 remark: I think there's an unneeded definition in the lspTestCases
struct. I would just remove it.
Apart from that, LGTM 🎉
} | ||
|
||
// Returns ErrEdgeNotFound for private channels. | ||
fetchChannelEndpoints := func(chanID uint64) (route.Vertex, |
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 mock func.
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, I think it would be better to check if we know any public last hop to rule out an LSP, see comment, other than that, it looks good 🙏.
8c8e852
to
4ecb5e8
Compare
lnrpc/routerrpc/router_server.go
Outdated
return false | ||
} | ||
|
||
refNodeID := destHopHint.NodeID |
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: refNodeID
can be removed here.
4ecb5e8
to
f867954
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.
LGTM 🎉
During testing I found that probing a phoenix invoice I got an invalid payload error which indicated that TLV type 8 (payment address) was somehow not set correctly (but I think we do set it). This is likely independent of this PR, but will investigate more.
This PR attempts to fix #9431, an edge case in
EstimateRouteFee
.We want to send a probe in case a route hint contains a public edge.