Merge pull request #4147 from joostjager/unify-pay-responses

router+routerrpc: unify sendtoroute and payment responses
This commit is contained in:
Joost Jager authored and GitHub committed 2020-05-13 20:36:14 +02:00
commit 1bd211a722
20 files changed
+1137 -983

No files matched your search

+13
View File
@@ -2,6 +2,7 @@ package channeldb
import ( import (
"bytes" "bytes"
"errors"
"io" "io"
"time" "time"
@@ -177,6 +178,18 @@ func (m *MPPayment) InFlightHTLCs() []HTLCAttempt {
return inflights return inflights
} }
// GetAttempt returns the specified htlc attempt on the payment.
func (m *MPPayment) GetAttempt(id uint64) (*HTLCAttempt, error) {
for _, htlc := range m.HTLCs {
htlc := htlc
if htlc.AttemptID == id {
return &htlc, nil
}
}
return nil, errors.New("htlc attempt not found on payment")
}
// serializeHTLCSettleInfo serializes the details of a settled htlc. // serializeHTLCSettleInfo serializes the details of a settled htlc.
func serializeHTLCSettleInfo(w io.Writer, s *HTLCSettleInfo) error { func serializeHTLCSettleInfo(w io.Writer, s *HTLCSettleInfo) error {
if _, err := w.Write(s.Preimage[:]); err != nil { if _, err := w.Write(s.Preimage[:]); err != nil {
+6 -13
View File
@@ -836,7 +836,7 @@ func sendToRoute(ctx *cli.Context) error {
route = routes.Route route = routes.Route
} }
req := &lnrpc.SendToRouteRequest{ req := &routerrpc.SendToRouteRequest{
PaymentHash: rHash, PaymentHash: rHash,
Route: route, Route: route,
} }
@@ -844,20 +844,13 @@ func sendToRoute(ctx *cli.Context) error {
return sendToRouteRequest(ctx, req) return sendToRouteRequest(ctx, req)
} }
func sendToRouteRequest(ctx *cli.Context, req *lnrpc.SendToRouteRequest) error { func sendToRouteRequest(ctx *cli.Context, req *routerrpc.SendToRouteRequest) error {
client, cleanUp := getClient(ctx) conn := getClientConn(ctx, false)
defer cleanUp() defer conn.Close()
paymentStream, err := client.SendToRoute(context.Background()) client := routerrpc.NewRouterClient(conn)
if err != nil {
return err
}
if err := paymentStream.Send(req); err != nil { resp, err := client.SendToRouteV2(context.Background(), req)
return err
}
resp, err := paymentStream.Recv()
if err != nil { if err != nil {
return err return err
} }
+194 -147
View File
@@ -1759,149 +1759,150 @@ func init() {
func init() { proto.RegisterFile("routerrpc/router.proto", fileDescriptor_7a0613f69d37b0a5) } func init() { proto.RegisterFile("routerrpc/router.proto", fileDescriptor_7a0613f69d37b0a5) }
var fileDescriptor_7a0613f69d37b0a5 = []byte{ var fileDescriptor_7a0613f69d37b0a5 = []byte{
// 2268 bytes of a gzipped FileDescriptorProto // 2283 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x58, 0xcf, 0x77, 0xdb, 0xc6, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x58, 0x5d, 0x73, 0xdb, 0xc6,
0xf1, 0x0f, 0x48, 0x50, 0x22, 0x87, 0x3f, 0x04, 0x2d, 0x1d, 0x19, 0x5f, 0x2a, 0x4e, 0x18, 0x7c, 0xd5, 0x0e, 0x48, 0x50, 0x22, 0x0f, 0x3f, 0x04, 0x2d, 0x1d, 0x19, 0x2f, 0x15, 0x27, 0x0c, 0xde,
0x13, 0x87, 0xcf, 0x4d, 0x24, 0x47, 0xed, 0x6b, 0xf3, 0xda, 0x26, 0x2d, 0x45, 0x42, 0x11, 0x6c, 0xc4, 0xe1, 0xb8, 0x89, 0xe4, 0xa8, 0x9d, 0x36, 0xd3, 0x36, 0x69, 0x29, 0x12, 0x8a, 0x60, 0x53,
0x0a, 0x60, 0x96, 0x94, 0x6c, 0xd7, 0x87, 0x7d, 0x10, 0xb9, 0x14, 0x51, 0x81, 0x00, 0x0b, 0x2c, 0x00, 0xb3, 0xa4, 0x64, 0xbb, 0xbe, 0xd8, 0x81, 0xc8, 0xa5, 0x88, 0x0a, 0x04, 0x58, 0x60, 0x69,
0xed, 0xe8, 0xd8, 0x5b, 0x5f, 0xaf, 0xfd, 0x23, 0x7a, 0xeb, 0x5f, 0xd0, 0x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d, 0xc3, 0xf5, 0x75, 0xe5, 0x34, 0xee, 0xbf, 0xde, 0x36, 0x1e,
0x22, 0x8b, 0xd8, 0xc8, 0xff, 0x29, 0xa7, 0x3c, 0x55, 0x90, 0x03, 0x95, 0x6c, 0x72, 0xbf, 0x37, 0x6c, 0xba, 0xe5, 0x3d, 0x55, 0xd0, 0x59, 0x92, 0x60, 0xe9, 0xdf, 0x66, 0xde, 0x53, 0x31, 0xfa,
0xeb, 0xdf, 0xa7, 0xf0, 0xf8, 0xeb, 0xdf, 0x1d, 0x5e, 0x79, 0x6c, 0xba, 0xb8, 0x3c, 0x18, 0x85, 0xe6, 0x69, 0xb4, 0x88, 0x45, 0x6a, 0x3d, 0x55, 0x90, 0x03, 0x95, 0x6c, 0x95, 0xbc, 0xb7, 0x7c,
0xb3, 0x43, 0xf1, 0x4b, 0x46, 0xe0, 0x05, 0x57, 0x01, 0x65, 0x6f, 0xc3, 0xe8, 0xfa, 0xd0, 0x0f, 0xde, 0xa7, 0xf0, 0xf8, 0xeb, 0xdf, 0x1d, 0x5e, 0x79, 0x6c, 0xba, 0xb8, 0x3c, 0x18, 0x85, 0xb3,
0xc6, 0x87, 0xa2, 0x6e, 0x0e, 0x97, 0x7a, 0x2e, 0xb7, 0xc4, 0x0f, 0x99, 0x3f, 0xfd, 0x4f, 0x00, 0x43, 0xf1, 0x27, 0x91, 0xc0, 0x0b, 0xae, 0x02, 0xca, 0xde, 0x86, 0xd1, 0xf5, 0xa1, 0x1f, 0x8c,
0x00, 0x00, 0xff, 0xff, 0x61, 0x45, 0xd3, 0x59, 0xf8, 0x14, 0x00, 0x00, 0x0f, 0x45, 0x7a, 0x1e, 0x2e, 0xf5, 0x5c, 0x6e, 0x89, 0xbf, 0x88, 0xfe, 0xf4, 0x3f, 0x01, 0x00,
0x00, 0xff, 0xff, 0x77, 0xd4, 0x07, 0xd1, 0x41, 0x15, 0x00, 0x00,
} }
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@@ -1930,10 +1931,17 @@ type RouterClient interface {
//may cost to send an HTLC to the target end destination. //may cost to send an HTLC to the target end destination.
EstimateRouteFee(ctx context.Context, in *RouteFeeRequest, opts ...grpc.CallOption) (*RouteFeeResponse, error) EstimateRouteFee(ctx context.Context, in *RouteFeeRequest, opts ...grpc.CallOption) (*RouteFeeResponse, error)
// //
//SendToRoute attempts to make a payment via the specified route. This method //Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via
//the specified route. This method differs from SendPayment in that it
//allows users to specify a full route manually. This can be used for
//things like rebalancing, and atomic swaps. It differs from the newer
//SendToRouteV2 in that it doesn't return the full HTLC information.
SendToRoute(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*SendToRouteResponse, error)
//
//SendToRouteV2 attempts to make a payment via the specified route. This method
//differs from SendPayment in that it allows users to specify a full route //differs from SendPayment in that it allows users to specify a full route
//manually. This can be used for things like rebalancing, and atomic swaps. //manually. This can be used for things like rebalancing, and atomic swaps.
SendToRoute(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*SendToRouteResponse, error) SendToRouteV2(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*lnrpc.HTLCAttempt, error)
// //
//ResetMissionControl clears all mission control state and starts with a clean //ResetMissionControl clears all mission control state and starts with a clean
//slate. //slate.
@@ -2047,6 +2055,7 @@ func (c *routerClient) EstimateRouteFee(ctx context.Context, in *RouteFeeRequest
return out, nil return out, nil
} }
// Deprecated: Do not use.
func (c *routerClient) SendToRoute(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*SendToRouteResponse, error) { func (c *routerClient) SendToRoute(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*SendToRouteResponse, error) {
out := new(SendToRouteResponse) out := new(SendToRouteResponse)
err := c.cc.Invoke(ctx, "/routerrpc.Router/SendToRoute", in, out, opts...) err := c.cc.Invoke(ctx, "/routerrpc.Router/SendToRoute", in, out, opts...)
@@ -2056,6 +2065,15 @@ func (c *routerClient) SendToRoute(ctx context.Context, in *SendToRouteRequest,
return out, nil return out, nil
} }
func (c *routerClient) SendToRouteV2(ctx context.Context, in *SendToRouteRequest, opts ...grpc.CallOption) (*lnrpc.HTLCAttempt, error) {
out := new(lnrpc.HTLCAttempt)
err := c.cc.Invoke(ctx, "/routerrpc.Router/SendToRouteV2", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *routerClient) ResetMissionControl(ctx context.Context, in *ResetMissionControlRequest, opts ...grpc.CallOption) (*ResetMissionControlResponse, error) { func (c *routerClient) ResetMissionControl(ctx context.Context, in *ResetMissionControlRequest, opts ...grpc.CallOption) (*ResetMissionControlResponse, error) {
out := new(ResetMissionControlResponse) out := new(ResetMissionControlResponse)
err := c.cc.Invoke(ctx, "/routerrpc.Router/ResetMissionControl", in, out, opts...) err := c.cc.Invoke(ctx, "/routerrpc.Router/ResetMissionControl", in, out, opts...)
@@ -2206,10 +2224,17 @@ type RouterServer interface {
//may cost to send an HTLC to the target end destination. //may cost to send an HTLC to the target end destination.
EstimateRouteFee(context.Context, *RouteFeeRequest) (*RouteFeeResponse, error) EstimateRouteFee(context.Context, *RouteFeeRequest) (*RouteFeeResponse, error)
// //
//SendToRoute attempts to make a payment via the specified route. This method //Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via
//the specified route. This method differs from SendPayment in that it
//allows users to specify a full route manually. This can be used for
//things like rebalancing, and atomic swaps. It differs from the newer
//SendToRouteV2 in that it doesn't return the full HTLC information.
SendToRoute(context.Context, *SendToRouteRequest) (*SendToRouteResponse, error)
//
//SendToRouteV2 attempts to make a payment via the specified route. This method
//differs from SendPayment in that it allows users to specify a full route //differs from SendPayment in that it allows users to specify a full route
//manually. This can be used for things like rebalancing, and atomic swaps. //manually. This can be used for things like rebalancing, and atomic swaps.
SendToRoute(context.Context, *SendToRouteRequest) (*SendToRouteResponse, error) SendToRouteV2(context.Context, *SendToRouteRequest) (*lnrpc.HTLCAttempt, error)
// //
//ResetMissionControl clears all mission control state and starts with a clean //ResetMissionControl clears all mission control state and starts with a clean
//slate. //slate.
@@ -2324,6 +2349,24 @@ func _Router_SendToRoute_Handler(srv interface{}, ctx context.Context, dec func(
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Router_SendToRouteV2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SendToRouteRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RouterServer).SendToRouteV2(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/routerrpc.Router/SendToRouteV2",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RouterServer).SendToRouteV2(ctx, req.(*SendToRouteRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Router_ResetMissionControl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Router_ResetMissionControl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ResetMissionControlRequest) in := new(ResetMissionControlRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@@ -2471,6 +2514,10 @@ var _Router_serviceDesc = grpc.ServiceDesc{
MethodName: "SendToRoute", MethodName: "SendToRoute",
Handler: _Router_SendToRoute_Handler, Handler: _Router_SendToRoute_Handler,
}, },
{
MethodName: "SendToRouteV2",
Handler: _Router_SendToRouteV2_Handler,
},
{ {
MethodName: "ResetMissionControl", MethodName: "ResetMissionControl",
Handler: _Router_ResetMissionControl_Handler, Handler: _Router_ResetMissionControl_Handler,
+14 -2
View File
@@ -29,11 +29,22 @@ service Router {
rpc EstimateRouteFee (RouteFeeRequest) returns (RouteFeeResponse); rpc EstimateRouteFee (RouteFeeRequest) returns (RouteFeeResponse);
/* /*
SendToRoute attempts to make a payment via the specified route. This method Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via
the specified route. This method differs from SendPayment in that it
allows users to specify a full route manually. This can be used for
things like rebalancing, and atomic swaps. It differs from the newer
SendToRouteV2 in that it doesn't return the full HTLC information.
*/
rpc SendToRoute (SendToRouteRequest) returns (SendToRouteResponse) {
option deprecated = true;
}
/*
SendToRouteV2 attempts to make a payment via the specified route. This method
differs from SendPayment in that it allows users to specify a full route differs from SendPayment in that it allows users to specify a full route
manually. This can be used for things like rebalancing, and atomic swaps. manually. This can be used for things like rebalancing, and atomic swaps.
*/ */
rpc SendToRoute (SendToRouteRequest) returns (SendToRouteResponse); rpc SendToRouteV2 (SendToRouteRequest) returns (lnrpc.HTLCAttempt);
/* /*
ResetMissionControl clears all mission control state and starts with a clean ResetMissionControl clears all mission control state and starts with a clean
@@ -567,3 +578,4 @@ message PaymentStatus {
*/ */
repeated lnrpc.HTLCAttempt htlcs = 4; repeated lnrpc.HTLCAttempt htlcs = 4;
} }
+5
View File
@@ -214,6 +214,11 @@
"failure": { "failure": {
"$ref": "#/definitions/lnrpcFailure", "$ref": "#/definitions/lnrpcFailure",
"description": "Detailed htlc failure info." "description": "Detailed htlc failure info."
},
"preimage": {
"type": "string",
"format": "byte",
"description": "The preimage that was used to settle the HTLC."
} }
} }
}, },
+1
View File
@@ -872,6 +872,7 @@ func (r *RouterBackend) MarshalHTLCAttempt(
rpcAttempt.ResolveTimeNs = MarshalTimeNano( rpcAttempt.ResolveTimeNs = MarshalTimeNano(
htlc.Settle.SettleTime, htlc.Settle.SettleTime,
) )
rpcAttempt.Preimage = htlc.Settle.Preimage[:]
case htlc.Failure != nil: case htlc.Failure != nil:
rpcAttempt.Status = lnrpc.HTLCAttempt_FAILED rpcAttempt.Status = lnrpc.HTLCAttempt_FAILED
+23 -20
View File
@@ -52,6 +52,10 @@ var (
Entity: "offchain", Entity: "offchain",
Action: "write", Action: "write",
}}, }},
"/routerrpc.Router/SendToRouteV2": {{
Entity: "offchain",
Action: "write",
}},
"/routerrpc.Router/SendToRoute": {{ "/routerrpc.Router/SendToRoute": {{
Entity: "offchain", Entity: "offchain",
Action: "write", Action: "write",
@@ -299,10 +303,10 @@ func (s *Server) EstimateRouteFee(ctx context.Context,
}, nil }, nil
} }
// SendToRoute sends a payment through a predefined route. The response of this // SendToRouteV2 sends a payment through a predefined route. The response of this
// call contains structured error information. // call contains structured error information.
func (s *Server) SendToRoute(ctx context.Context, func (s *Server) SendToRouteV2(ctx context.Context,
req *SendToRouteRequest) (*SendToRouteResponse, error) { req *SendToRouteRequest) (*lnrpc.HTLCAttempt, error) {
if req.Route == nil { if req.Route == nil {
return nil, fmt.Errorf("unable to send, no routes provided") return nil, fmt.Errorf("unable to send, no routes provided")
@@ -318,25 +322,24 @@ func (s *Server) SendToRoute(ctx context.Context,
return nil, err return nil, err
} }
preimage, err := s.cfg.Router.SendToRoute(hash, route) // Pass route to the router. This call returns the full htlc attempt
// information as it is stored in the database. It is possible that both
// In the success case, return the preimage. // the attempt return value and err are non-nil. This can happen when
if err == nil { // the attempt was already initiated before the error happened. In that
return &SendToRouteResponse{ // case, we give precedence to the attempt information as stored in the
Preimage: preimage[:], // db.
}, nil attempt, err := s.cfg.Router.SendToRoute(hash, route)
if attempt != nil {
rpcAttempt, err := s.cfg.RouterBackend.MarshalHTLCAttempt(
*attempt,
)
if err != nil {
return nil, err
}
return rpcAttempt, nil
} }
// In the failure case, marshall the failure message to the rpc format return nil, err
// before returning it to the caller.
rpcErr, err := marshallError(err)
if err != nil {
return nil, err
}
return &SendToRouteResponse{
Failure: rpcErr,
}, nil
} }
// ResetMissionControl clears all mission control state and starts with a clean // ResetMissionControl clears all mission control state and starts with a clean
@@ -1,6 +1,7 @@
package routerrpc package routerrpc
import ( import (
"context"
"encoding/hex" "encoding/hex"
"errors" "errors"
"fmt" "fmt"
@@ -93,3 +94,27 @@ func (s *Server) SendPayment(request *SendPaymentRequest,
} }
return s.SendPaymentV2(request, &legacyStream) return s.SendPaymentV2(request, &legacyStream)
} }
// SendToRoute sends a payment through a predefined route. The response of this
// call contains structured error information.
func (s *Server) SendToRoute(ctx context.Context,
req *SendToRouteRequest) (*SendToRouteResponse, error) {
resp, err := s.SendToRouteV2(ctx, req)
if err != nil {
return nil, err
}
if resp == nil {
return nil, nil
}
// Need to convert to legacy response message because proto identifiers
// don't line up.
legacyResp := &SendToRouteResponse{
Preimage: resp.Preimage,
Failure: resp.Failure,
}
return legacyResp, err
}
+750 -738
View File
File diff suppressed because it is too large. Load diff
+12 -6
View File
@@ -313,7 +313,7 @@ service Lightning {
} }
/* lncli: `sendpayment` /* lncli: `sendpayment`
Deprecated, use routerrpc.SendPayment. SendPayment dispatches a Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a
bi-directional streaming RPC for sending payments through the Lightning bi-directional streaming RPC for sending payments through the Lightning
Network. A single RPC invocation creates a persistent bi-directional Network. A single RPC invocation creates a persistent bi-directional
stream allowing clients to rapidly send payments through the Lightning stream allowing clients to rapidly send payments through the Lightning
@@ -337,12 +337,15 @@ service Lightning {
} }
/* lncli: `sendtoroute` /* lncli: `sendtoroute`
SendToRoute is a bi-directional streaming RPC for sending payment through Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional
the Lightning Network. This method differs from SendPayment in that it streaming RPC for sending payment through the Lightning Network. This
allows users to specify a full route manually. This can be used for things method differs from SendPayment in that it allows users to specify a full
like rebalancing, and atomic swaps. route manually. This can be used for things like rebalancing, and atomic
swaps.
*/ */
rpc SendToRoute (stream SendToRouteRequest) returns (stream SendResponse); rpc SendToRoute (stream SendToRouteRequest) returns (stream SendResponse) {
option deprecated = true;
}
/* /*
SendToRouteSync is a synchronous version of SendToRoute. It Will block SendToRouteSync is a synchronous version of SendToRoute. It Will block
@@ -2998,6 +3001,9 @@ message HTLCAttempt {
// Detailed htlc failure info. // Detailed htlc failure info.
Failure failure = 5; Failure failure = 5;
// The preimage that was used to settle the HTLC.
bytes preimage = 6;
} }
message ListPaymentsRequest { message ListPaymentsRequest {
+5
View File
@@ -2944,6 +2944,11 @@
"failure": { "failure": {
"$ref": "#/definitions/lnrpcFailure", "$ref": "#/definitions/lnrpcFailure",
"description": "Detailed htlc failure info." "description": "Detailed htlc failure info."
},
"preimage": {
"type": "string",
"format": "byte",
"description": "The preimage that was used to settle the HTLC."
} }
} }
}, },
+3 -3
View File
@@ -113,7 +113,7 @@ func testSendToRouteMultiPath(net *lntest.NetworkHarness, t *harnessTest) {
{ctx.carol, ctx.eve, ctx.bob}, {ctx.carol, ctx.eve, ctx.bob},
} }
responses := make(chan *routerrpc.SendToRouteResponse, len(sendRoutes)) responses := make(chan *lnrpc.HTLCAttempt, len(sendRoutes))
for _, hops := range sendRoutes { for _, hops := range sendRoutes {
// Build a route for the specified hops. // Build a route for the specified hops.
r, err := buildRoute(shardAmt, hops) r, err := buildRoute(shardAmt, hops)
@@ -139,7 +139,7 @@ func testSendToRouteMultiPath(net *lntest.NetworkHarness, t *harnessTest) {
// block as long as the payment is in flight. // block as long as the payment is in flight.
go func() { go func() {
ctxt, _ := context.WithTimeout(ctxb, defaultTimeout) ctxt, _ := context.WithTimeout(ctxb, defaultTimeout)
resp, err := net.Alice.RouterClient.SendToRoute(ctxt, sendReq) resp, err := net.Alice.RouterClient.SendToRouteV2(ctxt, sendReq)
if err != nil { if err != nil {
t.Fatalf("unable to send payment: %v", err) t.Fatalf("unable to send payment: %v", err)
} }
@@ -151,7 +151,7 @@ func testSendToRouteMultiPath(net *lntest.NetworkHarness, t *harnessTest) {
// Wait for all responses to be back, and check that they all // Wait for all responses to be back, and check that they all
// succeeded. // succeeded.
for range sendRoutes { for range sendRoutes {
var resp *routerrpc.SendToRouteResponse var resp *lnrpc.HTLCAttempt
select { select {
case resp = <-responses: case resp = <-responses:
case <-time.After(defaultTimeout): case <-time.After(defaultTimeout):
+1 -1
View File
@@ -4830,7 +4830,7 @@ func testSingleHopSendToRouteCase(net *lntest.NetworkHarness, t *harnessTest,
Route: r, Route: r,
} }
ctxt, _ = context.WithTimeout(ctxb, defaultTimeout) ctxt, _ = context.WithTimeout(ctxb, defaultTimeout)
resp, err := carol.RouterClient.SendToRoute( resp, err := carol.RouterClient.SendToRouteV2(
ctxt, sendReq, ctxt, sendReq,
) )
if err != nil { if err != nil {
+12 -8
View File
@@ -30,10 +30,12 @@ type ControlTower interface {
// error to prevent us from making duplicate payments to the same // error to prevent us from making duplicate payments to the same
// payment hash. The provided preimage is atomically saved to the DB // payment hash. The provided preimage is atomically saved to the DB
// for record keeping. // for record keeping.
SettleAttempt(lntypes.Hash, uint64, *channeldb.HTLCSettleInfo) error SettleAttempt(lntypes.Hash, uint64, *channeldb.HTLCSettleInfo) (
*channeldb.HTLCAttempt, error)
// FailAttempt marks the given payment attempt failed. // FailAttempt marks the given payment attempt failed.
FailAttempt(lntypes.Hash, uint64, *channeldb.HTLCFailInfo) error FailAttempt(lntypes.Hash, uint64, *channeldb.HTLCFailInfo) (
*channeldb.HTLCAttempt, error)
// FetchPayment fetches the payment corresponding to the given payment // FetchPayment fetches the payment corresponding to the given payment
// hash. // hash.
@@ -146,38 +148,40 @@ func (p *controlTower) RegisterAttempt(paymentHash lntypes.Hash,
// this is a multi shard payment, this might implicitly mean the the // this is a multi shard payment, this might implicitly mean the the
// full payment succeeded. // full payment succeeded.
func (p *controlTower) SettleAttempt(paymentHash lntypes.Hash, func (p *controlTower) SettleAttempt(paymentHash lntypes.Hash,
attemptID uint64, settleInfo *channeldb.HTLCSettleInfo) error { attemptID uint64, settleInfo *channeldb.HTLCSettleInfo) (
*channeldb.HTLCAttempt, error) {
p.paymentsMtx.Lock(paymentHash) p.paymentsMtx.Lock(paymentHash)
defer p.paymentsMtx.Unlock(paymentHash) defer p.paymentsMtx.Unlock(paymentHash)
payment, err := p.db.SettleAttempt(paymentHash, attemptID, settleInfo) payment, err := p.db.SettleAttempt(paymentHash, attemptID, settleInfo)
if err != nil { if err != nil {
return err return nil, err
} }
// Notify subscribers of success event. // Notify subscribers of success event.
p.notifySubscribers(paymentHash, payment) p.notifySubscribers(paymentHash, payment)
return nil return payment.GetAttempt(attemptID)
} }
// FailAttempt marks the given payment attempt failed. // FailAttempt marks the given payment attempt failed.
func (p *controlTower) FailAttempt(paymentHash lntypes.Hash, func (p *controlTower) FailAttempt(paymentHash lntypes.Hash,
attemptID uint64, failInfo *channeldb.HTLCFailInfo) error { attemptID uint64, failInfo *channeldb.HTLCFailInfo) (
*channeldb.HTLCAttempt, error) {
p.paymentsMtx.Lock(paymentHash) p.paymentsMtx.Lock(paymentHash)
defer p.paymentsMtx.Unlock(paymentHash) defer p.paymentsMtx.Unlock(paymentHash)
payment, err := p.db.FailAttempt(paymentHash, attemptID, failInfo) payment, err := p.db.FailAttempt(paymentHash, attemptID, failInfo)
if err != nil { if err != nil {
return err return nil, err
} }
// Notify subscribers of failed attempt. // Notify subscribers of failed attempt.
p.notifySubscribers(paymentHash, payment) p.notifySubscribers(paymentHash, payment)
return nil return payment.GetAttempt(attemptID)
} }
// FetchPayment fetches the payment corresponding to the given payment hash. // FetchPayment fetches the payment corresponding to the given payment hash.
+16 -8
View File
@@ -104,15 +104,18 @@ func TestControlTowerSubscribeSuccess(t *testing.T) {
} }
// Mark the payment as successful. // Mark the payment as successful.
err = pControl.SettleAttempt( settleInfo := channeldb.HTLCSettleInfo{
info.PaymentHash, attempt.AttemptID, Preimage: preimg,
&channeldb.HTLCSettleInfo{ }
Preimage: preimg, htlcAttempt, err := pControl.SettleAttempt(
}, info.PaymentHash, attempt.AttemptID, &settleInfo,
) )
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
if *htlcAttempt.Settle != settleInfo {
t.Fatalf("unexpected settle info returned")
}
// Register a third subscriber after the payment succeeded. // Register a third subscriber after the payment succeeded.
subscriber3, err := pControl.SubscribePayment(info.PaymentHash) subscriber3, err := pControl.SubscribePayment(info.PaymentHash)
@@ -215,13 +218,18 @@ func testPaymentControlSubscribeFail(t *testing.T, registerAttempt bool) {
} }
// Fail the payment attempt. // Fail the payment attempt.
err := pControl.FailAttempt( failInfo := channeldb.HTLCFailInfo{
info.PaymentHash, attempt.AttemptID, Reason: channeldb.HTLCFailInternal,
&channeldb.HTLCFailInfo{}, }
htlcAttempt, err := pControl.FailAttempt(
info.PaymentHash, attempt.AttemptID, &failInfo,
) )
if err != nil { if err != nil {
t.Fatalf("unable to fail htlc: %v", err) t.Fatalf("unable to fail htlc: %v", err)
} }
if *htlcAttempt.Failure != failInfo {
t.Fatalf("unexpected fail info returned")
}
} }
// Mark the payment as failed. // Mark the payment as failed.
+17 -12
View File
@@ -301,7 +301,8 @@ func (m *mockControlTower) RegisterAttempt(phash lntypes.Hash,
} }
func (m *mockControlTower) SettleAttempt(phash lntypes.Hash, func (m *mockControlTower) SettleAttempt(phash lntypes.Hash,
pid uint64, settleInfo *channeldb.HTLCSettleInfo) error { pid uint64, settleInfo *channeldb.HTLCSettleInfo) (
*channeldb.HTLCAttempt, error) {
m.Lock() m.Lock()
defer m.Unlock() defer m.Unlock()
@@ -313,7 +314,7 @@ func (m *mockControlTower) SettleAttempt(phash lntypes.Hash,
// Only allow setting attempts if the payment is known. // Only allow setting attempts if the payment is known.
p, ok := m.payments[phash] p, ok := m.payments[phash]
if !ok { if !ok {
return channeldb.ErrPaymentNotInitiated return nil, channeldb.ErrPaymentNotInitiated
} }
// Find the attempt with this pid, and set the settle info. // Find the attempt with this pid, and set the settle info.
@@ -323,24 +324,26 @@ func (m *mockControlTower) SettleAttempt(phash lntypes.Hash,
} }
if a.Settle != nil { if a.Settle != nil {
return channeldb.ErrAttemptAlreadySettled return nil, channeldb.ErrAttemptAlreadySettled
} }
if a.Failure != nil { if a.Failure != nil {
return channeldb.ErrAttemptAlreadyFailed return nil, channeldb.ErrAttemptAlreadyFailed
} }
p.attempts[i].Settle = settleInfo p.attempts[i].Settle = settleInfo
// Mark the payment successful on first settled attempt. // Mark the payment successful on first settled attempt.
m.successful[phash] = struct{}{} m.successful[phash] = struct{}{}
return nil return &channeldb.HTLCAttempt{
Settle: settleInfo,
}, nil
} }
return fmt.Errorf("pid not found") return nil, fmt.Errorf("pid not found")
} }
func (m *mockControlTower) FailAttempt(phash lntypes.Hash, pid uint64, func (m *mockControlTower) FailAttempt(phash lntypes.Hash, pid uint64,
failInfo *channeldb.HTLCFailInfo) error { failInfo *channeldb.HTLCFailInfo) (*channeldb.HTLCAttempt, error) {
m.Lock() m.Lock()
defer m.Unlock() defer m.Unlock()
@@ -352,7 +355,7 @@ func (m *mockControlTower) FailAttempt(phash lntypes.Hash, pid uint64,
// Only allow failing attempts if the payment is known. // Only allow failing attempts if the payment is known.
p, ok := m.payments[phash] p, ok := m.payments[phash]
if !ok { if !ok {
return channeldb.ErrPaymentNotInitiated return nil, channeldb.ErrPaymentNotInitiated
} }
// Find the attempt with this pid, and set the failure info. // Find the attempt with this pid, and set the failure info.
@@ -362,17 +365,19 @@ func (m *mockControlTower) FailAttempt(phash lntypes.Hash, pid uint64,
} }
if a.Settle != nil { if a.Settle != nil {
return channeldb.ErrAttemptAlreadySettled return nil, channeldb.ErrAttemptAlreadySettled
} }
if a.Failure != nil { if a.Failure != nil {
return channeldb.ErrAttemptAlreadyFailed return nil, channeldb.ErrAttemptAlreadyFailed
} }
p.attempts[i].Failure = failInfo p.attempts[i].Failure = failInfo
return nil return &channeldb.HTLCAttempt{
Failure: failInfo,
}, nil
} }
return fmt.Errorf("pid not found") return nil, fmt.Errorf("pid not found")
} }
func (m *mockControlTower) Fail(phash lntypes.Hash, func (m *mockControlTower) Fail(phash lntypes.Hash,
+17 -12
View File
@@ -345,6 +345,9 @@ type launchOutcome struct {
// reflect this error. This can be errors like not enough local // reflect this error. This can be errors like not enough local
// balance for the given route etc. // balance for the given route etc.
err error err error
// attempt is the attempt structure as recorded in the database.
attempt *channeldb.HTLCAttempt
} }
// launchShard creates and sends an HTLC attempt along the given route, // launchShard creates and sends an HTLC attempt along the given route,
@@ -382,14 +385,15 @@ func (p *shardHandler) launchShard(rt *route.Route) (*channeldb.HTLCAttemptInfo,
if sendErr != nil { if sendErr != nil {
// TODO(joostjager): Distinguish unexpected internal errors // TODO(joostjager): Distinguish unexpected internal errors
// from real send errors. // from real send errors.
err := p.failAttempt(attempt, sendErr) htlcAttempt, err := p.failAttempt(attempt, sendErr)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
// Return a launchOutcome indicating the shard failed. // Return a launchOutcome indicating the shard failed.
return attempt, &launchOutcome{ return attempt, &launchOutcome{
err: sendErr, attempt: htlcAttempt,
err: sendErr,
}, nil }, nil
} }
@@ -398,9 +402,8 @@ func (p *shardHandler) launchShard(rt *route.Route) (*channeldb.HTLCAttemptInfo,
// shardResult holds the resulting outcome of a shard sent. // shardResult holds the resulting outcome of a shard sent.
type shardResult struct { type shardResult struct {
// preimage is the payment preimage in case of a settled HTLC. Only set // attempt is the attempt structure as recorded in the database.
// if err is non-nil. attempt *channeldb.HTLCAttempt
preimage lntypes.Preimage
// err indicates that the shard failed. // err indicates that the shard failed.
err error err error
@@ -493,13 +496,14 @@ func (p *shardHandler) collectResult(attempt *channeldb.HTLCAttemptInfo) (
"the Switch, retrying.", attempt.AttemptID, "the Switch, retrying.", attempt.AttemptID,
p.paymentHash) p.paymentHash)
cErr := p.failAttempt(attempt, err) attempt, cErr := p.failAttempt(attempt, err)
if cErr != nil { if cErr != nil {
return nil, cErr return nil, cErr
} }
return &shardResult{ return &shardResult{
err: err, attempt: attempt,
err: err,
}, nil }, nil
// A critical, unexpected error was encountered. // A critical, unexpected error was encountered.
@@ -533,13 +537,14 @@ func (p *shardHandler) collectResult(attempt *channeldb.HTLCAttemptInfo) (
// In case of a payment failure, fail the attempt with the control // In case of a payment failure, fail the attempt with the control
// tower and return. // tower and return.
if result.Error != nil { if result.Error != nil {
err := p.failAttempt(attempt, result.Error) attempt, err := p.failAttempt(attempt, result.Error)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return &shardResult{ return &shardResult{
err: result.Error, attempt: attempt,
err: result.Error,
}, nil }, nil
} }
@@ -558,7 +563,7 @@ func (p *shardHandler) collectResult(attempt *channeldb.HTLCAttemptInfo) (
// In case of success we atomically store settle result to the DB move // In case of success we atomically store settle result to the DB move
// the shard to the settled state. // the shard to the settled state.
err = p.router.cfg.Control.SettleAttempt( htlcAttempt, err := p.router.cfg.Control.SettleAttempt(
p.paymentHash, attempt.AttemptID, p.paymentHash, attempt.AttemptID,
&channeldb.HTLCSettleInfo{ &channeldb.HTLCSettleInfo{
Preimage: result.Preimage, Preimage: result.Preimage,
@@ -571,7 +576,7 @@ func (p *shardHandler) collectResult(attempt *channeldb.HTLCAttemptInfo) (
} }
return &shardResult{ return &shardResult{
preimage: result.Preimage, attempt: htlcAttempt,
}, nil }, nil
} }
@@ -691,7 +696,7 @@ func (p *shardHandler) handleSendError(attempt *channeldb.HTLCAttemptInfo,
// failAttempt calls control tower to fail the current payment attempt. // failAttempt calls control tower to fail the current payment attempt.
func (p *shardHandler) failAttempt(attempt *channeldb.HTLCAttemptInfo, func (p *shardHandler) failAttempt(attempt *channeldb.HTLCAttemptInfo,
sendError error) error { sendError error) (*channeldb.HTLCAttempt, error) {
log.Warnf("Attempt %v for payment %v failed: %v", attempt.AttemptID, log.Warnf("Attempt %v for payment %v failed: %v", attempt.AttemptID,
p.paymentHash, sendError) p.paymentHash, sendError)
+15 -10
View File
@@ -1741,10 +1741,12 @@ func (r *ChannelRouter) preparePayment(payment *LightningPayment) (
} }
// SendToRoute attempts to send a payment with the given hash through the // SendToRoute attempts to send a payment with the given hash through the
// provided route. This function is blocking and will return the obtained // provided route. This function is blocking and will return the attempt
// preimage if the payment is successful or the full error in case of a failure. // information as it is stored in the database. For a successful htlc, this
// information will contain the preimage. If an error occurs after the attempt
// was initiated, both return values will be non-nil.
func (r *ChannelRouter) SendToRoute(hash lntypes.Hash, rt *route.Route) ( func (r *ChannelRouter) SendToRoute(hash lntypes.Hash, rt *route.Route) (
lntypes.Preimage, error) { *channeldb.HTLCAttempt, error) {
// Calculate amount paid to receiver. // Calculate amount paid to receiver.
amt := rt.ReceiverAmt() amt := rt.ReceiverAmt()
@@ -1774,7 +1776,7 @@ func (r *ChannelRouter) SendToRoute(hash lntypes.Hash, rt *route.Route) (
// Any other error is not tolerated. // Any other error is not tolerated.
case err != nil: case err != nil:
return [32]byte{}, err return nil, err
} }
log.Tracef("Dispatching SendToRoute for hash %v: %v", log.Tracef("Dispatching SendToRoute for hash %v: %v",
@@ -1804,34 +1806,37 @@ func (r *ChannelRouter) SendToRoute(hash lntypes.Hash, rt *route.Route) (
hash, channeldb.FailureReasonError, hash, channeldb.FailureReasonError,
) )
if controlErr != nil { if controlErr != nil {
return [32]byte{}, controlErr return nil, controlErr
} }
} }
// In any case, don't continue if there is an error. // In any case, don't continue if there is an error.
if err != nil { if err != nil {
return lntypes.Preimage{}, err return nil, err
} }
var htlcAttempt *channeldb.HTLCAttempt
switch { switch {
// Failed to launch shard. // Failed to launch shard.
case outcome.err != nil: case outcome.err != nil:
shardError = outcome.err shardError = outcome.err
htlcAttempt = outcome.attempt
// Shard successfully launched, wait for the result to be available. // Shard successfully launched, wait for the result to be available.
default: default:
result, err := sh.collectResult(attempt) result, err := sh.collectResult(attempt)
if err != nil { if err != nil {
return lntypes.Preimage{}, err return nil, err
} }
// We got a successful result. // We got a successful result.
if result.err == nil { if result.err == nil {
return result.preimage, nil return result.attempt, nil
} }
// The shard failed, break switch to handle it. // The shard failed, break switch to handle it.
shardError = result.err shardError = result.err
htlcAttempt = result.attempt
} }
// Since for SendToRoute we won't retry in case the shard fails, we'll // Since for SendToRoute we won't retry in case the shard fails, we'll
@@ -1848,10 +1853,10 @@ func (r *ChannelRouter) SendToRoute(hash lntypes.Hash, rt *route.Route) (
err = r.cfg.Control.Fail(hash, *reason) err = r.cfg.Control.Fail(hash, *reason)
if err != nil { if err != nil {
return lntypes.Preimage{}, err return nil, err
} }
return lntypes.Preimage{}, shardError return htlcAttempt, shardError
} }
// sendPayment attempts to send a payment to the passed payment hash. This // sendPayment attempts to send a payment to the passed payment hash. This
+2 -2
View File
@@ -2809,13 +2809,13 @@ func TestSendToRouteMultiShardSend(t *testing.T) {
for i := 0; i < numShards; i++ { for i := 0; i < numShards; i++ {
go func() { go func() {
preimg, err := ctx.router.SendToRoute(payment, rt) attempt, err := ctx.router.SendToRoute(payment, rt)
if err != nil { if err != nil {
errChan <- err errChan <- err
return return
} }
successes <- preimg successes <- attempt.Settle.Preimage
}() }()
} }
+6 -1
View File
@@ -3978,10 +3978,15 @@ func (r *rpcServer) dispatchPaymentIntent(
payment, payment,
) )
} else { } else {
preImage, routerErr = r.server.chanRouter.SendToRoute( var attempt *channeldb.HTLCAttempt
attempt, routerErr = r.server.chanRouter.SendToRoute(
payIntent.rHash, payIntent.route, payIntent.rHash, payIntent.route,
) )
if routerErr == nil {
preImage = attempt.Settle.Preimage
}
route = payIntent.route route = payIntent.route
} }