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
Create routes to self using remote alias #2507
Conversation
The introduction of `scid-alias` broke the ability to create a valid route to our own node using `FinalizeRoute` for private or unconfirmed channels because we use our local alias as the shortChannelId of the graph edge in both directions. Using the same identifier for both directions makes sense, because it's a stable identifier whereas the remote alias could be updated by our peer. It's generally not an issue, except when we are building a route, because our peer will not know how to route if we give them our local alias in a payment onion (they expect their own local alias, which from our point of view is the remote alias). The only way to build routes to ourselves is by using `FinalizeRoute`, so we fix the issue only in this handler by looking at our private channels when we notice that we are the destination.
Are you sure we need this? |
Codecov Report
@@ Coverage Diff @@
## master #2507 +/- ##
==========================================
+ Coverage 84.94% 84.99% +0.04%
==========================================
Files 200 200
Lines 15827 15832 +5
Branches 693 696 +3
==========================================
+ Hits 13445 13456 +11
+ Misses 2382 2376 -6
|
I think that's only because you didn't test the private channels case. For private channels, |
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 is really hacky, but should be fixed once we finally make the key of our graph the logical (node1,node2)
, as opposed to the current physical (scid, node1, node2)
, because we will then have to handle the scid selection explicitly.
Agreed, that will be a nice refactoring, we should aim for this. It won't be a trivial change though, it impacts many places in the codebase, but it's a necessary one. |
The introduction of
scid-alias
broke the ability to create a valid route to our own node usingFinalizeRoute
for private or unconfirmed channels because we use our local alias as the shortChannelId of the graph edge in both directions.Using the same identifier for both directions makes sense, because it's a stable identifier whereas the remote alias could be updated by our peer. It's generally not an issue, except when we are building a route, because our peer will not know how to route if we give them our local alias in a payment onion (they expect their own local alias, which from our point of view is the remote alias).
The only way to build routes to ourselves is by using
FinalizeRoute
, so we fix the issue only in this handler by looking at our private channels when we notice that we are the destination.