lnwire+htlcswitch: report height for invalid payment details failure

Extends the invalid payment details failure with the new accept height
field. This allows sender to distinguish between a genuine invalid
details situation and a delay caused by intermediate nodes.
This commit is contained in:
Joost Jager 2019-06-12 12:18:58 +02:00
parent 1de08c4780
commit f60e4b1e14
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7
9 changed files with 212 additions and 118 deletions

@ -1206,7 +1206,7 @@ func (l *channelLink) processHodlEvent(hodlEvent invoices.HodlEvent,
// In case of a cancel, always return // In case of a cancel, always return
// incorrect_or_unknown_payment_details in order to avoid leaking info. // incorrect_or_unknown_payment_details in order to avoid leaking info.
failure := lnwire.NewFailIncorrectDetails( failure := lnwire.NewFailIncorrectDetails(
htlc.pd.Amount, htlc.pd.Amount, uint32(hodlEvent.AcceptHeight),
) )
l.sendHTLCError( l.sendHTLCError(
@ -2867,7 +2867,7 @@ func (l *channelLink) processExitHop(pd *lnwallet.PaymentDescriptor,
// Cancel htlc if we don't have an invoice for it. // Cancel htlc if we don't have an invoice for it.
case channeldb.ErrInvoiceNotFound: case channeldb.ErrInvoiceNotFound:
failure := lnwire.NewFailIncorrectDetails(pd.Amount) failure := lnwire.NewFailIncorrectDetails(pd.Amount, heightNow)
l.sendHTLCError(pd.HtlcIndex, failure, obfuscator, pd.SourceRef) l.sendHTLCError(pd.HtlcIndex, failure, obfuscator, pd.SourceRef)
return true, nil return true, nil

@ -1803,7 +1803,7 @@ func TestSwitchSendPayment(t *testing.T) {
// the add htlc request with error and sent the htlc fail request // the add htlc request with error and sent the htlc fail request
// back. This request should be forwarded back to alice channel link. // back. This request should be forwarded back to alice channel link.
obfuscator := NewMockObfuscator() obfuscator := NewMockObfuscator()
failure := lnwire.NewFailIncorrectDetails(update.Amount) failure := lnwire.NewFailIncorrectDetails(update.Amount, 100)
reason, err := obfuscator.EncryptFirstHop(failure) reason, err := obfuscator.EncryptFirstHop(failure)
if err != nil { if err != nil {
t.Fatalf("unable obfuscate failure: %v", err) t.Fatalf("unable obfuscate failure: %v", err)

@ -646,7 +646,9 @@ type Failure struct {
//* //*
//The position in the path of the intermediate or final node that generated //The position in the path of the intermediate or final node that generated
//the failure message. Position zero is the sender node. //the failure message. Position zero is the sender node.
FailureSourceIndex uint32 `protobuf:"varint,8,opt,name=failure_source_index,json=failureSourceIndex,proto3" json:"failure_source_index,omitempty"` FailureSourceIndex uint32 `protobuf:"varint,8,opt,name=failure_source_index,json=failureSourceIndex,proto3" json:"failure_source_index,omitempty"`
/// A failure type-dependent block height.
Height uint32 `protobuf:"varint,9,opt,name=height,proto3" json:"height,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
@ -726,6 +728,13 @@ func (m *Failure) GetFailureSourceIndex() uint32 {
return 0 return 0
} }
func (m *Failure) GetHeight() uint32 {
if m != nil {
return m.Height
}
return 0
}
type ChannelUpdate struct { type ChannelUpdate struct {
//* //*
//The signature that validates the announced data and proves the ownership //The signature that validates the announced data and proves the ownership
@ -1212,117 +1221,118 @@ 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{
// 1759 bytes of a gzipped FileDescriptorProto // 1769 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0x41, 0x73, 0x22, 0xb9, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0x41, 0x73, 0x22, 0xb9,
0x15, 0x5e, 0x0c, 0x18, 0x78, 0x80, 0xdd, 0x96, 0x3d, 0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x7f, 0xd1, 0x16, 0xab, 0xac, 0x91, 0x8a, 0xa5, 0x55, 0x1e, 0x17, 0x9a, 0xbd, 0x8d, 0x60, 0x77, 0x8d, 0x02, 0xa0, 0x5f, 0xa4, 0x77, 0xf0, 0xa8, 0x7e, 0xd4, 0x9e, 0xff,
0xa5, 0x55, 0x3e, 0xa2, 0x38, 0xaf, 0x7e, 0xf5, 0xbb, 0xb3, 0x1b, 0x57, 0x8c, 0x67, 0x57, 0xa7, 0x2f, 0xda, 0x62, 0x95, 0x35, 0x52, 0xb1, 0xb4, 0xca, 0xe3, 0x42, 0xb3, 0xb4, 0xca, 0x47, 0x14,
0xc3, 0x60, 0x72, 0xe6, 0xb9, 0x37, 0x63, 0xe1, 0xbb, 0xfe, 0x8d, 0xcf, 0xc5, 0x1f, 0x82, 0xf0, 0xe7, 0xd5, 0xaf, 0x7e, 0x77, 0x76, 0xe3, 0x8a, 0xf1, 0xec, 0xea, 0x74, 0x18, 0x4c, 0xce, 0x3c,
0xf6, 0xcc, 0xf3, 0x47, 0x67, 0xaa, 0x01, 0x3e, 0x9b, 0xbb, 0xbb, 0xda, 0x54, 0xff, 0x60, 0x7f, 0xd9, 0x52, 0xf9, 0xae, 0x7f, 0xe3, 0x73, 0xf1, 0x87, 0x20, 0xbc, 0x3d, 0xf3, 0xfc, 0xd1, 0x99,
0xfd, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd5, 0x11, 0xe6, 0x51, 0xf1, 0x0e, 0x00, 0x00, 0x6a, 0x8c, 0xcf, 0xe6, 0xee, 0xae, 0x36, 0xd5, 0x3f, 0xdb, 0x5f, 0xff, 0x37, 0x00, 0x00, 0xff,
0xff, 0x3c, 0xe4, 0x5c, 0x67, 0x09, 0x0f, 0x00, 0x00,
} }
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.

@ -239,6 +239,9 @@ message Failure {
the failure message. Position zero is the sender node. the failure message. Position zero is the sender node.
**/ **/
uint32 failure_source_index = 8; uint32 failure_source_index = 8;
/// A failure type-dependent block height.
uint32 height = 9;
} }

@ -324,6 +324,7 @@ func marshallError(sendError error) (*Failure, error) {
case *lnwire.FailIncorrectDetails: case *lnwire.FailIncorrectDetails:
response.Code = Failure_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS response.Code = Failure_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS
response.Height = onionErr.Height()
case *lnwire.FailIncorrectPaymentAmount: case *lnwire.FailIncorrectPaymentAmount:
response.Code = Failure_INCORRECT_PAYMENT_AMOUNT response.Code = Failure_INCORRECT_PAYMENT_AMOUNT

@ -333,13 +333,19 @@ func (f *FailIncorrectPaymentAmount) Error() string {
type FailIncorrectDetails struct { type FailIncorrectDetails struct {
// amount is the value of the extended HTLC. // amount is the value of the extended HTLC.
amount MilliSatoshi amount MilliSatoshi
// height is the block height when the htlc was received.
height uint32
} }
// NewFailIncorrectDetails makes a new instance of the FailIncorrectDetails // NewFailIncorrectDetails makes a new instance of the FailIncorrectDetails
// error bound to the specified HTLC amount. // error bound to the specified HTLC amount and acceptance height.
func NewFailIncorrectDetails(amt MilliSatoshi) *FailIncorrectDetails { func NewFailIncorrectDetails(amt MilliSatoshi,
height uint32) *FailIncorrectDetails {
return &FailIncorrectDetails{ return &FailIncorrectDetails{
amount: amt, amount: amt,
height: height,
} }
} }
@ -348,6 +354,11 @@ func (f *FailIncorrectDetails) Amount() MilliSatoshi {
return f.amount return f.amount
} }
// Height is the block height when the htlc was received.
func (f *FailIncorrectDetails) Height() uint32 {
return f.height
}
// Code returns the failure unique code. // Code returns the failure unique code.
// //
// NOTE: Part of the FailureMessage interface. // NOTE: Part of the FailureMessage interface.
@ -360,7 +371,8 @@ func (f *FailIncorrectDetails) Code() FailCode {
// NOTE: Implements the error interface. // NOTE: Implements the error interface.
func (f *FailIncorrectDetails) Error() string { func (f *FailIncorrectDetails) Error() string {
return fmt.Sprintf( return fmt.Sprintf(
"%v(amt=%v)", CodeIncorrectOrUnknownPaymentDetails, f.amount, "%v(amt=%v, height=%v)", CodeIncorrectOrUnknownPaymentDetails,
f.amount, f.height,
) )
} }
@ -381,6 +393,17 @@ func (f *FailIncorrectDetails) Decode(r io.Reader, pver uint32) error {
return err return err
} }
// At a later stage, the height field was also tacked on. We need to
// check for io.EOF here as well.
err = ReadElement(r, &f.height)
switch {
case err == io.EOF:
return nil
case err != nil:
return err
}
return nil return nil
} }
@ -388,7 +411,7 @@ func (f *FailIncorrectDetails) Decode(r io.Reader, pver uint32) error {
// //
// NOTE: Part of the Serializable interface. // NOTE: Part of the Serializable interface.
func (f *FailIncorrectDetails) Encode(w io.Writer, pver uint32) error { func (f *FailIncorrectDetails) Encode(w io.Writer, pver uint32) error {
return WriteElement(w, f.amount) return WriteElements(w, f.amount, f.height)
} }
// FailFinalExpiryTooSoon is returned if the cltv_expiry is too low, the final // FailFinalExpiryTooSoon is returned if the cltv_expiry is too low, the final

@ -37,7 +37,7 @@ var onionFailures = []FailureMessage{
&FailIncorrectPaymentAmount{}, &FailIncorrectPaymentAmount{},
&FailFinalExpiryTooSoon{}, &FailFinalExpiryTooSoon{},
NewFailIncorrectDetails(99), NewFailIncorrectDetails(99, 100),
NewInvalidOnionVersion(testOnionHash), NewInvalidOnionVersion(testOnionHash),
NewInvalidOnionHmac(testOnionHash), NewInvalidOnionHmac(testOnionHash),
NewInvalidOnionKey(testOnionHash), NewInvalidOnionKey(testOnionHash),
@ -196,6 +196,9 @@ func TestFailIncorrectDetailsOptionalAmount(t *testing.T) {
if invalidDetailsErr.amount != 0 { if invalidDetailsErr.amount != 0 {
t.Fatalf("expected amount to be zero") t.Fatalf("expected amount to be zero")
} }
if invalidDetailsErr.height != 0 {
t.Fatalf("height incorrect")
}
} }
type mockFailIncorrectDetailsNoAmt struct { type mockFailIncorrectDetailsNoAmt struct {
@ -216,3 +219,57 @@ func (f *mockFailIncorrectDetailsNoAmt) Decode(r io.Reader, pver uint32) error {
func (f *mockFailIncorrectDetailsNoAmt) Encode(w io.Writer, pver uint32) error { func (f *mockFailIncorrectDetailsNoAmt) Encode(w io.Writer, pver uint32) error {
return nil return nil
} }
// TestFailIncorrectDetailsOptionalHeight tests that we're able to decode an
// FailIncorrectDetails error that doesn't have the optional height. This
// ensures we're able to decode FailIncorrectDetails messages from older nodes.
func TestFailIncorrectDetailsOptionalHeight(t *testing.T) {
t.Parallel()
onionError := &mockFailIncorrectDetailsNoHeight{
amount: uint64(123),
}
var b bytes.Buffer
if err := EncodeFailure(&b, onionError, 0); err != nil {
t.Fatalf("unable to encode failure: %v", err)
}
onionError2, err := DecodeFailure(bytes.NewReader(b.Bytes()), 0)
if err != nil {
t.Fatalf("unable to decode error: %v", err)
}
invalidDetailsErr, ok := onionError2.(*FailIncorrectDetails)
if !ok {
t.Fatalf("expected FailIncorrectDetails, but got %T",
onionError2)
}
if invalidDetailsErr.amount != 123 {
t.Fatalf("amount incorrect")
}
if invalidDetailsErr.height != 0 {
t.Fatalf("height incorrect")
}
}
type mockFailIncorrectDetailsNoHeight struct {
amount uint64
}
func (f *mockFailIncorrectDetailsNoHeight) Code() FailCode {
return CodeIncorrectOrUnknownPaymentDetails
}
func (f *mockFailIncorrectDetailsNoHeight) Error() string {
return ""
}
func (f *mockFailIncorrectDetailsNoHeight) Decode(r io.Reader, pver uint32) error {
return nil
}
func (f *mockFailIncorrectDetailsNoHeight) Encode(w io.Writer, pver uint32) error {
return WriteElement(w, f.amount)
}

@ -61,7 +61,7 @@ func TestMissionControlStore(t *testing.T) {
result1 := paymentResult{ result1 := paymentResult{
route: &testRoute, route: &testRoute,
failure: lnwire.NewFailIncorrectDetails(100), failure: lnwire.NewFailIncorrectDetails(100, 1000),
failureSourceIdx: &failureSourceIdx, failureSourceIdx: &failureSourceIdx,
id: 99, id: 99,
timeReply: testTime, timeReply: testTime,

@ -103,7 +103,7 @@ var resultTestCases = []resultTestCase{
name: "fail incorrect details", name: "fail incorrect details",
route: &routeTwoHop, route: &routeTwoHop,
failureSrcIdx: 2, failureSrcIdx: 2,
failure: lnwire.NewFailIncorrectDetails(97), failure: lnwire.NewFailIncorrectDetails(97, 0),
expectedResult: &interpretedResult{ expectedResult: &interpretedResult{
pairResults: map[DirectedNodePair]pairResult{ pairResults: map[DirectedNodePair]pairResult{