Skip to content

Commit c276c46

Browse files
authored
Merge pull request #6408 from Roasbeef/v0.14.3-branch-rc2
release: create v0.14.3-rc2 branch
2 parents 2c68e3b + c3c752e commit c276c46

File tree

7 files changed

+1430
-1406
lines changed

7 files changed

+1430
-1406
lines changed

build/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const (
4848

4949
// AppPreRelease MUST only contain characters from semanticAlphabet
5050
// per the semantic versioning spec.
51-
AppPreRelease = "beta.rc1"
51+
AppPreRelease = "beta.rc2"
5252
)
5353

5454
func init() {

docs/release-notes/release-notes-0.14.3.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release Notes
22

3+
## RPC Server
4+
5+
* [Support for making routes with the legacy onion payload format via `SendToRoute` has been removed.](https://github.com/lightningnetwork/lnd/pull/6385)
6+
37
## Bug fixes
48

59
* The REST proxy (`grpc-gateway` library) had a fallback that redirected `POST`
@@ -26,6 +30,9 @@
2630
party sweeps our anchor
2731
output](https://github.com/lightningnetwork/lnd/pull/6274).
2832

33+
* [Fixed race condition resulting in MPP payments sometimes getting stuck
34+
in-flight](https://github.com/lightningnetwork/lnd/pull/6352).
35+
2936
## Code Health
3037

3138
### Code cleanup, refactor, typo fixes
@@ -35,7 +42,7 @@
3542
code external to lnd to call the function, where previously it would require
3643
access to lnd's internals.
3744

38-
## Misc
45+
## Clustering
3946

4047
* [Make etcd leader election session
4148
TTL](https://github.com/lightningnetwork/lnd/pull/6342) configurable.

lnrpc/lightning.pb.go

+1,387-1,384
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lnrpc/lightning.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -2718,7 +2718,7 @@ message Hop {
27182718
TLV format. Note that if any custom tlv_records below are specified, then
27192719
this field MUST be set to true for them to be encoded properly.
27202720
*/
2721-
bool tlv_payload = 9;
2721+
bool tlv_payload = 9 [deprecated = true];
27222722

27232723
/*
27242724
An optional TLV record that signals the use of an MPP payment. If present,

lnrpc/routerrpc/router_backend.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ func UnmarshallHopWithPubkey(rpcHop *lnrpc.Hop, pubkey route.Vertex) (*route.Hop
476476
PubKeyBytes: pubkey,
477477
ChannelID: rpcHop.ChanId,
478478
CustomRecords: customRecords,
479-
LegacyPayload: !rpcHop.TlvPayload,
479+
LegacyPayload: false,
480480
MPP: mpp,
481481
AMP: amp,
482482
}, nil

routing/payment_lifecycle.go

-3
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,6 @@ func (p *shardHandler) collectResult(attempt *channeldb.HTLCAttemptInfo) (
600600

601601
case <-p.router.quit:
602602
return nil, ErrRouterShuttingDown
603-
604-
case <-p.quit:
605-
return nil, errShardHandlerExiting
606603
}
607604

608605
// In case of a payment failure, fail the attempt with the control

routing/router_test.go

+32-15
Original file line numberDiff line numberDiff line change
@@ -4187,37 +4187,46 @@ func TestSendMPPaymentFailedWithShardsInFlight(t *testing.T) {
41874187
// Create a buffered chan and it will be returned by GetPaymentResult.
41884188
payer.resultChan = make(chan *htlcswitch.PaymentResult, 10)
41894189

4190-
// We use the failAttemptCount to track how many attempts we want to
4191-
// fail. Each time the following mock method is called, the count gets
4192-
// updated.
4193-
failAttemptCount := 0
4190+
// We use the getPaymentResultCnt to track how many times we called
4191+
// GetPaymentResult. As shard launch is sequential, and we fail the
4192+
// first shard that calls GetPaymentResult, we may end up with different
4193+
// counts since the lifecycle itself is asynchronous. To avoid flakes
4194+
// due to this undeterminsitic behavior, we'll compare the final
4195+
// getPaymentResultCnt with other counters to create a final test
4196+
// expectation.
4197+
getPaymentResultCnt := 0
41944198
payer.On("GetPaymentResult",
41954199
mock.Anything, identifier, mock.Anything,
41964200
).Run(func(args mock.Arguments) {
41974201
// Before the mock method is returned, we send the result to
41984202
// the read-only chan.
41994203

42004204
// Update the counter.
4201-
failAttemptCount++
4205+
getPaymentResultCnt++
42024206

42034207
// We fail the first attempt with terminal error.
4204-
if failAttemptCount == 1 {
4208+
if getPaymentResultCnt == 1 {
42054209
payer.resultChan <- &htlcswitch.PaymentResult{
42064210
Error: htlcswitch.NewForwardingError(
42074211
&lnwire.FailIncorrectDetails{},
42084212
1,
42094213
),
42104214
}
42114215
return
4212-
42134216
}
42144217

4215-
// For the rest attempts we will NOT send anything to the
4216-
// resultChan, thus making all the shards in active state,
4217-
// neither settled or failed.
4218+
// For the rest of the attempts we'll simulate that a network
4219+
// result update_fail_htlc has been received. This way the
4220+
// payment will fail cleanly.
4221+
payer.resultChan <- &htlcswitch.PaymentResult{
4222+
Error: htlcswitch.NewForwardingError(
4223+
&lnwire.FailTemporaryChannelFailure{},
4224+
1,
4225+
),
4226+
}
42184227
})
42194228

4220-
// Mock the FailAttempt method to fail EXACTLY once.
4229+
// Mock the FailAttempt method to fail (at least once).
42214230
var failedAttempt channeldb.HTLCAttempt
42224231
controlTower.On("FailAttempt",
42234232
identifier, mock.Anything, mock.Anything,
@@ -4227,22 +4236,27 @@ func TestSendMPPaymentFailedWithShardsInFlight(t *testing.T) {
42274236
failedAttempt = payment.HTLCs[0]
42284237
failedAttempt.Failure = &channeldb.HTLCFailInfo{}
42294238
payment.HTLCs[0] = failedAttempt
4230-
}).Once()
4239+
})
42314240

42324241
// Setup ReportPaymentFail to return nil reason and error so the
42334242
// payment won't fail.
42344243
failureReason := channeldb.FailureReasonPaymentDetails
4244+
cntReportPaymentFail := 0
42354245
missionControl.On("ReportPaymentFail",
42364246
mock.Anything, mock.Anything, mock.Anything, mock.Anything,
42374247
).Return(&failureReason, nil).Run(func(args mock.Arguments) {
42384248
payment.FailureReason = &failureReason
4239-
}).Once()
4249+
cntReportPaymentFail++
4250+
})
42404251

42414252
// Simple mocking the rest.
4242-
controlTower.On("Fail", identifier, failureReason).Return(nil).Once()
4253+
cntFail := 0
4254+
controlTower.On("Fail", identifier, failureReason).Return(nil)
42434255
payer.On("SendHTLC",
42444256
mock.Anything, mock.Anything, mock.Anything,
4245-
).Return(nil)
4257+
).Return(nil).Run(func(args mock.Arguments) {
4258+
cntFail++
4259+
})
42464260

42474261
// Call the actual method SendPayment on router. This is place inside a
42484262
// goroutine so we can set a timeout for the whole test, in case
@@ -4264,6 +4278,9 @@ func TestSendMPPaymentFailedWithShardsInFlight(t *testing.T) {
42644278
// methods are called as expected.
42654279
require.Error(t, err, "expected send payment error")
42664280
require.EqualValues(t, [32]byte{}, p, "preimage not match")
4281+
require.GreaterOrEqual(t, getPaymentResultCnt, 1)
4282+
require.Equal(t, getPaymentResultCnt, cntReportPaymentFail)
4283+
require.Equal(t, getPaymentResultCnt, cntFail)
42674284

42684285
controlTower.AssertExpectations(t)
42694286
payer.AssertExpectations(t)

0 commit comments

Comments
 (0)