routerrpc: bring back legacy track and send rpcs

To soften the transition for routerrpc users to the V2 messages.
This commit is contained in:
Joost Jager 2020-04-13 12:16:55 +02:00
parent ad5f1404cb
commit 7fe100bcfb
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7
4 changed files with 570 additions and 129 deletions

@ -111,6 +111,62 @@ func (FailureDetail) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_7a0613f69d37b0a5, []int{0} return fileDescriptor_7a0613f69d37b0a5, []int{0}
} }
type PaymentState int32
const (
//*
//Payment is still in flight.
PaymentState_IN_FLIGHT PaymentState = 0
//*
//Payment completed successfully.
PaymentState_SUCCEEDED PaymentState = 1
//*
//There are more routes to try, but the payment timeout was exceeded.
PaymentState_FAILED_TIMEOUT PaymentState = 2
//*
//All possible routes were tried and failed permanently. Or were no
//routes to the destination at all.
PaymentState_FAILED_NO_ROUTE PaymentState = 3
//*
//A non-recoverable error has occured.
PaymentState_FAILED_ERROR PaymentState = 4
//*
//Payment details incorrect (unknown hash, invalid amt or
//invalid final cltv delta)
PaymentState_FAILED_INCORRECT_PAYMENT_DETAILS PaymentState = 5
//*
//Insufficient local balance.
PaymentState_FAILED_INSUFFICIENT_BALANCE PaymentState = 6
)
var PaymentState_name = map[int32]string{
0: "IN_FLIGHT",
1: "SUCCEEDED",
2: "FAILED_TIMEOUT",
3: "FAILED_NO_ROUTE",
4: "FAILED_ERROR",
5: "FAILED_INCORRECT_PAYMENT_DETAILS",
6: "FAILED_INSUFFICIENT_BALANCE",
}
var PaymentState_value = map[string]int32{
"IN_FLIGHT": 0,
"SUCCEEDED": 1,
"FAILED_TIMEOUT": 2,
"FAILED_NO_ROUTE": 3,
"FAILED_ERROR": 4,
"FAILED_INCORRECT_PAYMENT_DETAILS": 5,
"FAILED_INSUFFICIENT_BALANCE": 6,
}
func (x PaymentState) String() string {
return proto.EnumName(PaymentState_name, int32(x))
}
func (PaymentState) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_7a0613f69d37b0a5, []int{1}
}
type HtlcEvent_EventType int32 type HtlcEvent_EventType int32
const ( const (
@ -1574,8 +1630,69 @@ func (m *LinkFailEvent) GetFailureString() string {
return "" return ""
} }
type PaymentStatus struct {
/// Current state the payment is in.
State PaymentState `protobuf:"varint,1,opt,name=state,proto3,enum=routerrpc.PaymentState" json:"state,omitempty"`
//*
//The pre-image of the payment when state is SUCCEEDED.
Preimage []byte `protobuf:"bytes,2,opt,name=preimage,proto3" json:"preimage,omitempty"`
//*
//The HTLCs made in attempt to settle the payment [EXPERIMENTAL].
Htlcs []*lnrpc.HTLCAttempt `protobuf:"bytes,4,rep,name=htlcs,proto3" json:"htlcs,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PaymentStatus) Reset() { *m = PaymentStatus{} }
func (m *PaymentStatus) String() string { return proto.CompactTextString(m) }
func (*PaymentStatus) ProtoMessage() {}
func (*PaymentStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_7a0613f69d37b0a5, []int{23}
}
func (m *PaymentStatus) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PaymentStatus.Unmarshal(m, b)
}
func (m *PaymentStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PaymentStatus.Marshal(b, m, deterministic)
}
func (m *PaymentStatus) XXX_Merge(src proto.Message) {
xxx_messageInfo_PaymentStatus.Merge(m, src)
}
func (m *PaymentStatus) XXX_Size() int {
return xxx_messageInfo_PaymentStatus.Size(m)
}
func (m *PaymentStatus) XXX_DiscardUnknown() {
xxx_messageInfo_PaymentStatus.DiscardUnknown(m)
}
var xxx_messageInfo_PaymentStatus proto.InternalMessageInfo
func (m *PaymentStatus) GetState() PaymentState {
if m != nil {
return m.State
}
return PaymentState_IN_FLIGHT
}
func (m *PaymentStatus) GetPreimage() []byte {
if m != nil {
return m.Preimage
}
return nil
}
func (m *PaymentStatus) GetHtlcs() []*lnrpc.HTLCAttempt {
if m != nil {
return m.Htlcs
}
return nil
}
func init() { func init() {
proto.RegisterEnum("routerrpc.FailureDetail", FailureDetail_name, FailureDetail_value) proto.RegisterEnum("routerrpc.FailureDetail", FailureDetail_name, FailureDetail_value)
proto.RegisterEnum("routerrpc.PaymentState", PaymentState_name, PaymentState_value)
proto.RegisterEnum("routerrpc.HtlcEvent_EventType", HtlcEvent_EventType_name, HtlcEvent_EventType_value) proto.RegisterEnum("routerrpc.HtlcEvent_EventType", HtlcEvent_EventType_name, HtlcEvent_EventType_value)
proto.RegisterType((*SendPaymentRequest)(nil), "routerrpc.SendPaymentRequest") proto.RegisterType((*SendPaymentRequest)(nil), "routerrpc.SendPaymentRequest")
proto.RegisterMapType((map[uint64][]byte)(nil), "routerrpc.SendPaymentRequest.DestCustomRecordsEntry") proto.RegisterMapType((map[uint64][]byte)(nil), "routerrpc.SendPaymentRequest.DestCustomRecordsEntry")
@ -1601,140 +1718,152 @@ func init() {
proto.RegisterType((*ForwardFailEvent)(nil), "routerrpc.ForwardFailEvent") proto.RegisterType((*ForwardFailEvent)(nil), "routerrpc.ForwardFailEvent")
proto.RegisterType((*SettleEvent)(nil), "routerrpc.SettleEvent") proto.RegisterType((*SettleEvent)(nil), "routerrpc.SettleEvent")
proto.RegisterType((*LinkFailEvent)(nil), "routerrpc.LinkFailEvent") proto.RegisterType((*LinkFailEvent)(nil), "routerrpc.LinkFailEvent")
proto.RegisterType((*PaymentStatus)(nil), "routerrpc.PaymentStatus")
} }
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{
// 2044 bytes of a gzipped FileDescriptorProto // 2215 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c,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x09,
0xc8, 0xdd, 0x00, 0x6c, 0x14, 0x00, 0x00,
} }
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@ -1788,6 +1917,15 @@ type RouterClient interface {
//SubscribeHtlcEvents creates a uni-directional stream from the server to //SubscribeHtlcEvents creates a uni-directional stream from the server to
//the client which delivers a stream of htlc events. //the client which delivers a stream of htlc events.
SubscribeHtlcEvents(ctx context.Context, in *SubscribeHtlcEventsRequest, opts ...grpc.CallOption) (Router_SubscribeHtlcEventsClient, error) SubscribeHtlcEvents(ctx context.Context, in *SubscribeHtlcEventsRequest, opts ...grpc.CallOption) (Router_SubscribeHtlcEventsClient, error)
//*
//Deprecated, use SendPaymentV2. SendPayment attempts to route a payment
//described by the passed PaymentRequest to the final destination. The call
//returns a stream of payment status updates.
SendPayment(ctx context.Context, in *SendPaymentRequest, opts ...grpc.CallOption) (Router_SendPaymentClient, error)
//*
//Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for
//the payment identified by the payment hash.
TrackPayment(ctx context.Context, in *TrackPaymentRequest, opts ...grpc.CallOption) (Router_TrackPaymentClient, error)
} }
type routerClient struct { type routerClient struct {
@ -1948,6 +2086,72 @@ func (x *routerSubscribeHtlcEventsClient) Recv() (*HtlcEvent, error) {
return m, nil return m, nil
} }
// Deprecated: Do not use.
func (c *routerClient) SendPayment(ctx context.Context, in *SendPaymentRequest, opts ...grpc.CallOption) (Router_SendPaymentClient, error) {
stream, err := c.cc.NewStream(ctx, &_Router_serviceDesc.Streams[3], "/routerrpc.Router/SendPayment", opts...)
if err != nil {
return nil, err
}
x := &routerSendPaymentClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type Router_SendPaymentClient interface {
Recv() (*PaymentStatus, error)
grpc.ClientStream
}
type routerSendPaymentClient struct {
grpc.ClientStream
}
func (x *routerSendPaymentClient) Recv() (*PaymentStatus, error) {
m := new(PaymentStatus)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// Deprecated: Do not use.
func (c *routerClient) TrackPayment(ctx context.Context, in *TrackPaymentRequest, opts ...grpc.CallOption) (Router_TrackPaymentClient, error) {
stream, err := c.cc.NewStream(ctx, &_Router_serviceDesc.Streams[4], "/routerrpc.Router/TrackPayment", opts...)
if err != nil {
return nil, err
}
x := &routerTrackPaymentClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type Router_TrackPaymentClient interface {
Recv() (*PaymentStatus, error)
grpc.ClientStream
}
type routerTrackPaymentClient struct {
grpc.ClientStream
}
func (x *routerTrackPaymentClient) Recv() (*PaymentStatus, error) {
m := new(PaymentStatus)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// RouterServer is the server API for Router service. // RouterServer is the server API for Router service.
type RouterServer interface { type RouterServer interface {
//* //*
@ -1989,6 +2193,15 @@ type RouterServer interface {
//SubscribeHtlcEvents creates a uni-directional stream from the server to //SubscribeHtlcEvents creates a uni-directional stream from the server to
//the client which delivers a stream of htlc events. //the client which delivers a stream of htlc events.
SubscribeHtlcEvents(*SubscribeHtlcEventsRequest, Router_SubscribeHtlcEventsServer) error SubscribeHtlcEvents(*SubscribeHtlcEventsRequest, Router_SubscribeHtlcEventsServer) error
//*
//Deprecated, use SendPaymentV2. SendPayment attempts to route a payment
//described by the passed PaymentRequest to the final destination. The call
//returns a stream of payment status updates.
SendPayment(*SendPaymentRequest, Router_SendPaymentServer) error
//*
//Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for
//the payment identified by the payment hash.
TrackPayment(*TrackPaymentRequest, Router_TrackPaymentServer) error
} }
func RegisterRouterServer(s *grpc.Server, srv RouterServer) { func RegisterRouterServer(s *grpc.Server, srv RouterServer) {
@ -2166,6 +2379,48 @@ func (x *routerSubscribeHtlcEventsServer) Send(m *HtlcEvent) error {
return x.ServerStream.SendMsg(m) return x.ServerStream.SendMsg(m)
} }
func _Router_SendPayment_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(SendPaymentRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(RouterServer).SendPayment(m, &routerSendPaymentServer{stream})
}
type Router_SendPaymentServer interface {
Send(*PaymentStatus) error
grpc.ServerStream
}
type routerSendPaymentServer struct {
grpc.ServerStream
}
func (x *routerSendPaymentServer) Send(m *PaymentStatus) error {
return x.ServerStream.SendMsg(m)
}
func _Router_TrackPayment_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(TrackPaymentRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(RouterServer).TrackPayment(m, &routerTrackPaymentServer{stream})
}
type Router_TrackPaymentServer interface {
Send(*PaymentStatus) error
grpc.ServerStream
}
type routerTrackPaymentServer struct {
grpc.ServerStream
}
func (x *routerTrackPaymentServer) Send(m *PaymentStatus) error {
return x.ServerStream.SendMsg(m)
}
var _Router_serviceDesc = grpc.ServiceDesc{ var _Router_serviceDesc = grpc.ServiceDesc{
ServiceName: "routerrpc.Router", ServiceName: "routerrpc.Router",
HandlerType: (*RouterServer)(nil), HandlerType: (*RouterServer)(nil),
@ -2211,6 +2466,16 @@ var _Router_serviceDesc = grpc.ServiceDesc{
Handler: _Router_SubscribeHtlcEvents_Handler, Handler: _Router_SubscribeHtlcEvents_Handler,
ServerStreams: true, ServerStreams: true,
}, },
{
StreamName: "SendPayment",
Handler: _Router_SendPayment_Handler,
ServerStreams: true,
},
{
StreamName: "TrackPayment",
Handler: _Router_TrackPayment_Handler,
ServerStreams: true,
},
}, },
Metadata: "routerrpc/router.proto", Metadata: "routerrpc/router.proto",
} }

@ -411,6 +411,62 @@ enum FailureDetail {
CIRCULAR_ROUTE = 22; CIRCULAR_ROUTE = 22;
} }
enum PaymentState {
/**
Payment is still in flight.
*/
IN_FLIGHT = 0;
/**
Payment completed successfully.
*/
SUCCEEDED = 1;
/**
There are more routes to try, but the payment timeout was exceeded.
*/
FAILED_TIMEOUT = 2;
/**
All possible routes were tried and failed permanently. Or were no
routes to the destination at all.
*/
FAILED_NO_ROUTE = 3;
/**
A non-recoverable error has occured.
*/
FAILED_ERROR = 4;
/**
Payment details incorrect (unknown hash, invalid amt or
invalid final cltv delta)
*/
FAILED_INCORRECT_PAYMENT_DETAILS = 5;
/**
Insufficient local balance.
*/
FAILED_INSUFFICIENT_BALANCE = 6;
}
message PaymentStatus {
/// Current state the payment is in.
PaymentState state = 1;
/**
The pre-image of the payment when state is SUCCEEDED.
*/
bytes preimage = 2;
reserved 3;
/**
The HTLCs made in attempt to settle the payment [EXPERIMENTAL].
*/
repeated lnrpc.HTLCAttempt htlcs = 4;
}
service Router { service Router {
/** /**
SendPaymentV2 attempts to route a payment described by the passed SendPaymentV2 attempts to route a payment described by the passed
@ -472,4 +528,21 @@ service Router {
*/ */
rpc SubscribeHtlcEvents (SubscribeHtlcEventsRequest) rpc SubscribeHtlcEvents (SubscribeHtlcEventsRequest)
returns (stream HtlcEvent); returns (stream HtlcEvent);
/**
Deprecated, use SendPaymentV2. SendPayment attempts to route a payment
described by the passed PaymentRequest to the final destination. The call
returns a stream of payment status updates.
*/
rpc SendPayment(SendPaymentRequest) returns (stream PaymentStatus) {
option deprecated = true;
}
/**
Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for
the payment identified by the payment hash.
*/
rpc TrackPayment(TrackPaymentRequest) returns (stream PaymentStatus) {
option deprecated = true;
}
} }

@ -84,6 +84,14 @@ var (
Entity: "offchain", Entity: "offchain",
Action: "read", Action: "read",
}}, }},
"/routerrpc.Router/SendPayment": {{
Entity: "offchain",
Action: "write",
}},
"/routerrpc.Router/TrackPayment": {{
Entity: "offchain",
Action: "read",
}},
} }
// DefaultRouterMacFilename is the default name of the router macaroon // DefaultRouterMacFilename is the default name of the router macaroon

@ -0,0 +1,95 @@
package routerrpc
import (
"encoding/hex"
"errors"
"fmt"
"github.com/lightningnetwork/lnd/lnrpc"
)
// legacyTrackPaymentServer is a wrapper struct that transforms a stream of main
// rpc payment structs into the legacy PaymentStatus format.
type legacyTrackPaymentServer struct {
Router_TrackPaymentServer
}
// Send converts a Payment object and sends it as a PaymentStatus object on the
// embedded stream.
func (i *legacyTrackPaymentServer) Send(p *lnrpc.Payment) error {
var state PaymentState
switch p.Status {
case lnrpc.Payment_IN_FLIGHT:
state = PaymentState_IN_FLIGHT
case lnrpc.Payment_SUCCEEDED:
state = PaymentState_SUCCEEDED
case lnrpc.Payment_FAILED:
switch p.FailureReason {
case lnrpc.PaymentFailureReason_FAILURE_REASON_NONE:
return fmt.Errorf("expected fail reason")
case lnrpc.PaymentFailureReason_FAILURE_REASON_TIMEOUT:
state = PaymentState_FAILED_TIMEOUT
case lnrpc.PaymentFailureReason_FAILURE_REASON_NO_ROUTE:
state = PaymentState_FAILED_NO_ROUTE
case lnrpc.PaymentFailureReason_FAILURE_REASON_ERROR:
state = PaymentState_FAILED_ERROR
case lnrpc.PaymentFailureReason_FAILURE_REASON_INCORRECT_PAYMENT_DETAILS:
state = PaymentState_FAILED_INCORRECT_PAYMENT_DETAILS
case lnrpc.PaymentFailureReason_FAILURE_REASON_INSUFFICIENT_BALANCE:
state = PaymentState_FAILED_INSUFFICIENT_BALANCE
default:
return fmt.Errorf("unknown failure reason %v",
p.FailureReason)
}
default:
return fmt.Errorf("unknown state %v", p.Status)
}
preimage, err := hex.DecodeString(p.PaymentPreimage)
if err != nil {
return err
}
legacyState := PaymentStatus{
State: state,
Preimage: preimage,
Htlcs: p.Htlcs,
}
return i.Router_TrackPaymentServer.Send(&legacyState)
}
// TrackPayment returns a stream of payment state updates. The stream is
// closed when the payment completes.
func (s *Server) TrackPayment(request *TrackPaymentRequest,
stream Router_TrackPaymentServer) error {
legacyStream := legacyTrackPaymentServer{
Router_TrackPaymentServer: stream,
}
return s.TrackPaymentV2(request, &legacyStream)
}
// SendPayment attempts to route a payment described by the passed
// PaymentRequest to the final destination. If we are unable to route the
// payment, or cannot find a route that satisfies the constraints in the
// PaymentRequest, then an error will be returned. Otherwise, the payment
// pre-image, along with the final route will be returned.
func (s *Server) SendPayment(request *SendPaymentRequest,
stream Router_SendPaymentServer) error {
if request.MaxShards > 1 {
return errors.New("for multi-part payments, use SendPaymentV2")
}
legacyStream := legacyTrackPaymentServer{
Router_TrackPaymentServer: stream,
}
return s.SendPaymentV2(request, &legacyStream)
}