routing: global probability based mission control
Previously every payment had its own local mission control state which was in effect only for that payment. In this commit most of the local state is removed and payments all tap into the global mission control probability estimator. Furthermore the decay time of pruned edges and nodes is extended, so that observations about the network can better benefit future payment processes. Last, the probability function is transformed from a binary output to a gradual curve, allowing for a better trade off between candidate routes.
This commit is contained in:
12 files changed
+338
-220
No files matched your search
@@ -32,6 +32,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd"
|
||||
"github.com/lightningnetwork/lnd/chanbackup"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/routerrpc"
|
||||
"github.com/lightningnetwork/lnd/lntest"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"golang.org/x/net/context"
|
||||
@@ -8382,8 +8383,14 @@ out:
|
||||
// failed payment.
|
||||
shutdownAndAssert(net, t, carol)
|
||||
|
||||
// TODO(roasbeef): mission control
|
||||
time.Sleep(time.Second * 5)
|
||||
// Reset mission control to forget the temporary channel failure above.
|
||||
ctxt, _ = context.WithTimeout(ctxb, defaultTimeout)
|
||||
_, err = net.Alice.RouterClient.ResetMissionControl(
|
||||
ctxt, &routerrpc.ResetMissionControlRequest{},
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to reset mission control: %v", err)
|
||||
}
|
||||
|
||||
sendReq = &lnrpc.SendRequest{
|
||||
PaymentRequest: carolInvoice.PaymentRequest,
|
||||
|
||||
@@ -28,6 +28,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/chanbackup"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/invoicesrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/routerrpc"
|
||||
"github.com/lightningnetwork/lnd/macaroons"
|
||||
)
|
||||
|
||||
@@ -248,6 +249,10 @@ type HarnessNode struct {
|
||||
lnrpc.WalletUnlockerClient
|
||||
|
||||
invoicesrpc.InvoicesClient
|
||||
|
||||
// RouterClient cannot be embedded, because a name collision would occur
|
||||
// on the main rpc SendPayment.
|
||||
RouterClient routerrpc.RouterClient
|
||||
}
|
||||
|
||||
// Assert *HarnessNode implements the lnrpc.LightningClient interface.
|
||||
@@ -497,6 +502,7 @@ func (hn *HarnessNode) initLightningClient(conn *grpc.ClientConn) error {
|
||||
// HarnessNode directly for normal rpc operations.
|
||||
hn.LightningClient = lnrpc.NewLightningClient(conn)
|
||||
hn.InvoicesClient = invoicesrpc.NewInvoicesClient(conn)
|
||||
hn.RouterClient = routerrpc.NewRouterClient(conn)
|
||||
|
||||
// Set the harness node's pubkey to what the node claims in GetInfo.
|
||||
err := hn.FetchNodeInfo()
|
||||
|
||||
Reference in new issue
Block a user