Skip to content
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+routerrpc+lnrpc: add option to use mc in queryroutes #3221

Merged
merged 4 commits into from
Jul 19, 2019

Conversation

joostjager
Copy link
Contributor

@joostjager joostjager commented Jun 19, 2019

A boolean flag is added to the QueryRoutes rpc that allows feeding mission control probabilities into path finding.

This pr builds on #3298

lnrpc/rpc.proto Outdated Show resolved Hide resolved
@joostjager joostjager force-pushed the queryroutes-mc branch 2 times, most recently from 5df0f52 to 7ed8afe Compare June 20, 2019 10:12
@joostjager
Copy link
Contributor Author

I just gave it a try. The first route had a temporary channel failure. Immediately afterwards the same route was returned by QueryRoutes, so I didn't see any change by mission control. Please tell me how to debug this, I'd be happy to help.

What I think happened is: It did work, but the reason the same route was returned was because it was still the route with the highest probability (although very low).

In SendPayment we apply a minimum probability. If the best route is below that, we give up.

Modified this PR to also apply that minimum probability to QueryRoutes with UseMissionControl is true.

@C-Otto
Copy link
Contributor

C-Otto commented Jun 23, 2019

Same issue. With the code from this PR I get a route, resulting in a temporary channel failure. Running QueryRoutes again returns the same route.

With my code, ignoring based on the channel failure, I get a different route when running QueryRoutes the second time.

@joostjager
Copy link
Contributor Author

I failed to reproduce in the following set up on regtest: A -> B -> C. The B has 100k sat balance on the B->C channel.

  • queryroutes for 200k sat from A -> C.
  • sendtoroute using that route -> fails because TempChannelFailure
  • queryroutes again for 200k from A -> C: unable to find path to destination.

This is the behavior that I'd expect.

Do you have more detailed steps? One thing about TempChannelFailure is that it only takes out the channel only for amounts that are at least the failing amount. So if it fails for 200k sat, it is only blacklisted for values >=200 k sat.

@joostjager joostjager force-pushed the queryroutes-mc branch 3 times, most recently from ce717af to d5bb8ca Compare June 28, 2019 08:01
@joostjager
Copy link
Contributor Author

joostjager commented Jun 30, 2019

Note to self: use_mc doesn't work fully until all mission control state is globalized. Currently the second try logic still resides in the payment session.

Needs to be rebased onto #3164

@Roasbeef Roasbeef added enhancement Improvements to existing features / behaviour P2 should be fixed if one has time payments Related to invoices/payments rpc Related to the RPC interface labels Jul 1, 2019
@wpaulino wpaulino added this to the 0.7.1 milestone Jul 2, 2019
@wpaulino wpaulino added the v0.7.1 label Jul 2, 2019
@joostjager
Copy link
Contributor Author

Rebased onto first part of #3164

@joostjager joostjager force-pushed the queryroutes-mc branch 3 times, most recently from edf729a to 37bae01 Compare July 11, 2019 07:44
@joostjager joostjager force-pushed the queryroutes-mc branch 4 times, most recently from c3a190a to 483694a Compare July 12, 2019 18:53
Copy link
Contributor

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last 5 commits LGTM, just needs to rebased on final version of #3298 🚀

routing/router.go Outdated Show resolved Hide resolved
cmd/lncli/commands.go Show resolved Hide resolved
@Roasbeef
Copy link
Member

Needs a rebase.

@joostjager
Copy link
Contributor Author

rebased

@@ -55,6 +55,22 @@ type RouterBackend struct {
Tower routing.ControlTower
}

// MissionControl defines the mission control dependencies of routerrpc.
type MissionControl interface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't we define this interface in routing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but these are routerrpc's specific requirements for a mission control.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i think it makes sense to do it in routerrpc, so it can minimally define what it requires to operate

@halseth
Copy link
Contributor

halseth commented Jul 17, 2019 via email

@cfromknecht cfromknecht self-requested a review July 17, 2019 21:30
Copy link
Contributor

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🌋

Copy link
Contributor

@halseth halseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@halseth
Copy link
Contributor

halseth commented Jul 18, 2019

Needs rebase

@joostjager
Copy link
Contributor Author

rebased

@Roasbeef Roasbeef merged commit 02a5408 into lightningnetwork:master Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to existing features / behaviour P2 should be fixed if one has time payments Related to invoices/payments rpc Related to the RPC interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants