-
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
lnrpc: deprecate SendToRoute with more than one route #2521
lnrpc: deprecate SendToRoute with more than one route #2521
Conversation
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'm fine with doing this change, also something that should be done to the sync methods eventually IMO.
Get this in to v0.6
? LGTM 👍
@@ -4072,7 +4070,7 @@ func unmarshallHop(graph *channeldb.ChannelGraph, hop *lnrpc.Hop, | |||
|
|||
// unmarshallRoute unmarshalls an rpc route. For hops that don't specify a | |||
// pubkey, the channel graph is queried. | |||
func (r *rpcServer) unmarshallRoute(rpcroute *lnrpc.Route, |
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.
ooh, nice
} | ||
|
||
var routes []*routing.Route | ||
if len(req.Routes) > 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.
Why even distinguish these two cases? If the case of the else
statement, it completes after a single loop iteration.
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 chose not to restrict the Routes
field to a single element, but to add a new non-list field Route
. Therefore the else construct here.
The intention behind this is to make one change to the interface and not two (first restrict to a single element and then later make it a non-list field).
28b9b96
to
3ce228c
Compare
ptal @Roasbeef |
3ce228c
to
17645fe
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 🔌
The current SendToRoute RPC call offers the option of passing in multiple routes. Especially in the streaming variant, this makes the structure of the response complicated, because it is double nested (multiple streamed requests each containing multiple routes for each of which a result needs to be reported). The advantage of this in terms of network round trips is negligible, so the proposal is to limit every SendToRoute request to a single route.