Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

routerrpc: add a default value for timeout_seconds in SendPaymentV2 #9359

Merged
merged 3 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/release-notes/release-notes-0.19.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@
are now [sorted](https://github.com/lightningnetwork/lnd/pull/9337) based on
the `InvoiceHTLC.HtlcIndex`.

* [routerrpc.SendPaymentV2](https://github.com/lightningnetwork/lnd/pull/9359)
RPC method now applies a default timeout of 60 seconds when the
`timeout_seconds` field is not set or is explicitly set to 0.

## lncli Additions

* [A pre-generated macaroon root key can now be specified in `lncli create` and
Expand Down
2 changes: 0 additions & 2 deletions itest/lnd_amp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ func testSendPaymentAMPInvoiceCase(ht *lntest.HarnessTest,
sendReq := &routerrpc.SendPaymentRequest{
PaymentRequest: addInvoiceResp.PaymentRequest,
PaymentAddr: externalPayAddr,
TimeoutSeconds: 60,
NishantBansal2003 marked this conversation as resolved.
Show resolved Hide resolved
FeeLimitMsat: noFeeLimitMsat,
Amp: true,
}
Expand Down Expand Up @@ -400,7 +399,6 @@ func testSendPaymentAMP(ht *lntest.HarnessTest) {
Dest: mts.bob.PubKey[:],
Amt: int64(paymentAmt),
FinalCltvDelta: chainreg.DefaultBitcoinTimeLockDelta,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
Amp: true,
}
Expand Down
1 change: 0 additions & 1 deletion itest/lnd_channel_balance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ func testChannelUnsettledBalance(ht *lntest.HarnessTest) {
Amt: int64(payAmt),
PaymentHash: ht.Random32Bytes(),
FinalCltvDelta: finalCltvDelta,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
ht.SendPaymentAssertInflight(alice, req)
Expand Down
2 changes: 0 additions & 2 deletions itest/lnd_channel_force_close_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ func runChannelForceClosureTest(ht *lntest.HarnessTest,
Amt: int64(paymentAmt),
PaymentHash: ht.Random32Bytes(),
FinalCltvDelta: finalCltvDelta,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
ht.SendPaymentAssertInflight(alice, req)
Expand Down Expand Up @@ -811,7 +810,6 @@ func testFailingChannel(ht *lntest.HarnessTest) {
// won't work as the channel cannot be found.
req := &routerrpc.SendPaymentRequest{
PaymentRequest: resp.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
ht.SendPaymentAndAssertStatus(alice, req, lnrpc.Payment_IN_FLIGHT)
Expand Down
1 change: 0 additions & 1 deletion itest/lnd_channel_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ func testUpdateChannelPolicy(ht *lntest.HarnessTest) {
// not be able to find a path during routing.
payReq := &routerrpc.SendPaymentRequest{
PaymentRequest: resp.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
ht.SendPaymentAssertFail(
Expand Down
2 changes: 0 additions & 2 deletions itest/lnd_coop_close_with_htlcs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func coopCloseWithHTLCs(ht *lntest.HarnessTest) {
// HTLC for it.
req := &routerrpc.SendPaymentRequest{
PaymentRequest: resp.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitSat: 1000000,
}
ht.SendPaymentAndAssertStatus(bob, req, lnrpc.Payment_IN_FLIGHT)
Expand Down Expand Up @@ -166,7 +165,6 @@ func coopCloseWithHTLCsWithRestart(ht *lntest.HarnessTest) {
// for it.
req := &routerrpc.SendPaymentRequest{
PaymentRequest: resp.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitSat: 1000000,
}
ht.SendPaymentAndAssertStatus(bob, req, lnrpc.Payment_IN_FLIGHT)
Expand Down
1 change: 0 additions & 1 deletion itest/lnd_hold_invoice_force_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ func testHoldInvoiceForceClose(ht *lntest.HarnessTest) {
// single htlc.
req := &routerrpc.SendPaymentRequest{
PaymentRequest: bobInvoice.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
ht.SendPaymentAssertInflight(alice, req)
Expand Down
1 change: 0 additions & 1 deletion itest/lnd_hold_persistence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ func testHoldInvoicePersistence(ht *lntest.HarnessTest) {
for _, payReq := range payReqs {
req := &routerrpc.SendPaymentRequest{
PaymentRequest: payReq,
TimeoutSeconds: 60,
FeeLimitSat: 1000000,
}

Expand Down
2 changes: 0 additions & 2 deletions itest/lnd_htlc_timeout_resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ func testHtlcTimeoutResolverExtractPreimageRemote(ht *lntest.HarnessTest) {
// will not immediately settle the payment.
req := &routerrpc.SendPaymentRequest{
PaymentRequest: eveInvoice.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
ht.SendPaymentAssertInflight(alice, req)
Expand Down Expand Up @@ -267,7 +266,6 @@ func testHtlcTimeoutResolverExtractPreimageLocal(ht *lntest.HarnessTest) {
// will not immediately settle the payment.
req := &routerrpc.SendPaymentRequest{
PaymentRequest: carolInvoice.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
ht.SendPaymentAssertInflight(alice, req)
Expand Down
12 changes: 5 additions & 7 deletions itest/lnd_max_htlcs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,11 @@ func testMaxHtlcPathfind(ht *lntest.HarnessTest) {
// We've hit our max remote htlcs, so we expect this payment to spin
// out dramatically with pathfinding.
sendReq := &routerrpc.SendPaymentRequest{
Amt: 1000,
Dest: alice.PubKey[:],
TimeoutSeconds: 60,
FeeLimitSat: 1000000,
MaxParts: 10,
Amp: true,
Amt: 1000,
Dest: alice.PubKey[:],
FeeLimitSat: 1000000,
MaxParts: 10,
Amp: true,
}
ht.SendPaymentAndAssertStatus(bob, sendReq, lnrpc.Payment_FAILED)

Expand Down Expand Up @@ -130,7 +129,6 @@ func acceptHoldInvoice(ht *lntest.HarnessTest, idx int, sender,

sendReq := &routerrpc.SendPaymentRequest{
PaymentRequest: invoice.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitSat: 1000000,
}
payStream := sender.RPC.SendPayment(sendReq)
Expand Down
2 changes: 0 additions & 2 deletions itest/lnd_misc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ func testSphinxReplayPersistence(ht *lntest.HarnessTest) {
// to the above generated invoice.
req := &routerrpc.SendPaymentRequest{
PaymentRequest: invoiceResp.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
payStream := fred.RPC.SendPayment(req)
Expand Down Expand Up @@ -607,7 +606,6 @@ func testRejectHTLC(ht *lntest.HarnessTest) {
// lnd with --rejecthtlc.
paymentReq := &routerrpc.SendPaymentRequest{
PaymentRequest: resp.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
ht.SendPaymentAssertFail(
Expand Down
1 change: 0 additions & 1 deletion itest/lnd_mpp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ func testSendMultiPathPayment(ht *lntest.HarnessTest) {
sendReq := &routerrpc.SendPaymentRequest{
PaymentRequest: payReq,
MaxParts: 10,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
payment := ht.SendPaymentAssertSettled(mts.alice, sendReq)
Expand Down
5 changes: 0 additions & 5 deletions itest/lnd_multi-hop-error-propagation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ func testHtlcErrorPropagation(ht *lntest.HarnessTest) {
Dest: carol.PubKey[:],
Amt: payAmt,
FinalCltvDelta: int32(carolPayReq.CltvExpiry),
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
MaxParts: 1,
}
Expand Down Expand Up @@ -203,7 +202,6 @@ func testHtlcErrorPropagation(ht *lntest.HarnessTest) {
// 10k satoshis are expected.
Amt: int64(htlcAmt.ToSatoshis()),
FinalCltvDelta: int32(carolPayReq.CltvExpiry),
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
MaxParts: 1,
}
Expand Down Expand Up @@ -251,7 +249,6 @@ func testHtlcErrorPropagation(ht *lntest.HarnessTest) {

req := &routerrpc.SendPaymentRequest{
PaymentRequest: carolInvoice2.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
MaxParts: 1,
}
Expand Down Expand Up @@ -287,7 +284,6 @@ func testHtlcErrorPropagation(ht *lntest.HarnessTest) {

sendReq = &routerrpc.SendPaymentRequest{
PaymentRequest: carolInvoice3.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
MaxParts: 1,
}
Expand Down Expand Up @@ -336,7 +332,6 @@ func testHtlcErrorPropagation(ht *lntest.HarnessTest) {

req = &routerrpc.SendPaymentRequest{
PaymentRequest: carolInvoice.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
MaxParts: 1,
}
Expand Down
11 changes: 0 additions & 11 deletions itest/lnd_multi-hop_force_close_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ func runLocalClaimOutgoingHTLC(ht *lntest.HarnessTest,
Amt: int64(dustHtlcAmt),
PaymentHash: dustPayHash,
FinalCltvDelta: finalCltvDelta,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
RouteHints: routeHints,
}
Expand All @@ -383,7 +382,6 @@ func runLocalClaimOutgoingHTLC(ht *lntest.HarnessTest,
Amt: int64(htlcAmt),
PaymentHash: payHash,
FinalCltvDelta: finalCltvDelta,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
RouteHints: routeHints,
}
Expand Down Expand Up @@ -726,7 +724,6 @@ func runMultiHopReceiverPreimageClaim(ht *lntest.HarnessTest,
// will not immediately settle the payment.
req := &routerrpc.SendPaymentRequest{
PaymentRequest: carolInvoice.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
ht.SendPaymentAssertInflight(alice, req)
Expand Down Expand Up @@ -1093,7 +1090,6 @@ func runLocalForceCloseBeforeHtlcTimeout(ht *lntest.HarnessTest,
Amt: int64(htlcAmt),
PaymentHash: payHash,
FinalCltvDelta: finalCltvDelta,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
RouteHints: routeHints,
}
Expand Down Expand Up @@ -1415,7 +1411,6 @@ func runRemoteForceCloseBeforeHtlcTimeout(ht *lntest.HarnessTest,

req := &routerrpc.SendPaymentRequest{
PaymentRequest: carolInvoice.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
ht.SendPaymentAssertInflight(alice, req)
Expand Down Expand Up @@ -1684,7 +1679,6 @@ func runLocalClaimIncomingHTLC(ht *lntest.HarnessTest,
// will not immediately settle the payment.
req := &routerrpc.SendPaymentRequest{
PaymentRequest: carolInvoice.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
ht.SendPaymentAssertInflight(alice, req)
Expand Down Expand Up @@ -1997,7 +1991,6 @@ func runLocalClaimIncomingHTLCLeased(ht *lntest.HarnessTest,
// will not immediately settle the payment.
req := &routerrpc.SendPaymentRequest{
PaymentRequest: carolInvoice.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
ht.SendPaymentAssertInflight(alice, req)
Expand Down Expand Up @@ -2348,7 +2341,6 @@ func runLocalPreimageClaim(ht *lntest.HarnessTest,
// will not immediately settle the payment.
req := &routerrpc.SendPaymentRequest{
PaymentRequest: carolInvoice.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
ht.SendPaymentAssertInflight(alice, req)
Expand Down Expand Up @@ -2654,7 +2646,6 @@ func runLocalPreimageClaimLeased(ht *lntest.HarnessTest,
// will not immediately settle the payment.
req := &routerrpc.SendPaymentRequest{
PaymentRequest: carolInvoice.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
ht.SendPaymentAssertInflight(alice, req)
Expand Down Expand Up @@ -3103,7 +3094,6 @@ func runHtlcAggregation(ht *lntest.HarnessTest,
for _, carolInvoice := range carolInvoices {
req := &routerrpc.SendPaymentRequest{
PaymentRequest: carolInvoice.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
ht.SendPaymentAssertInflight(alice, req)
Expand All @@ -3113,7 +3103,6 @@ func runHtlcAggregation(ht *lntest.HarnessTest,
for _, aliceInvoice := range aliceInvoices {
req := &routerrpc.SendPaymentRequest{
PaymentRequest: aliceInvoice.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
ht.SendPaymentAssertInflight(carol, req)
Expand Down
2 changes: 0 additions & 2 deletions itest/lnd_open_channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,6 @@ func testUpdateOnFunderPendingOpenChannels(ht *lntest.HarnessTest) {
// in-flight instead of being failed by Alice.
bobReq := &routerrpc.SendPaymentRequest{
PaymentRequest: invoice.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
bobStream := bob.RPC.SendPayment(bobReq)
Expand Down Expand Up @@ -750,7 +749,6 @@ func testUpdateOnFundeePendingOpenChannels(ht *lntest.HarnessTest) {
// in-flight instead of being failed by Bob.
aliceReq := &routerrpc.SendPaymentRequest{
PaymentRequest: bobInvoice.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
aliceStream := alice.RPC.SendPayment(aliceReq)
Expand Down
1 change: 0 additions & 1 deletion itest/lnd_payment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,6 @@ func sendPaymentInterceptAndCancel(ht *lntest.HarnessTest,
go func() {
req := &routerrpc.SendPaymentRequest{
PaymentRequest: invoice.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitSat: 100000,
Cancelable: true,
}
Expand Down
1 change: 0 additions & 1 deletion itest/lnd_quiescence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func testQuiescence(ht *lntest.HarnessTest) {
Amt: 100,
PaymentHash: ht.Random32Bytes(),
FinalCltvDelta: finalCltvDelta,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}

Expand Down
3 changes: 0 additions & 3 deletions itest/lnd_route_blinding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@ func (b *blindedForwardTest) drainCarolLiquidity(incoming bool) {
pmtClient := sendingNode.RPC.SendPayment(
&routerrpc.SendPaymentRequest{
PaymentRequest: invoice.PaymentRequest,
TimeoutSeconds: 60,
},
)

Expand Down Expand Up @@ -957,7 +956,6 @@ func testMPPToSingleBlindedPath(ht *lntest.HarnessTest) {
sendReq := &routerrpc.SendPaymentRequest{
PaymentRequest: invoiceResp.PaymentRequest,
MaxParts: 10,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
payment := ht.SendPaymentAssertSettled(alice, sendReq)
Expand Down Expand Up @@ -1302,7 +1300,6 @@ func testMPPToMultipleBlindedPaths(ht *lntest.HarnessTest) {
sendReq := &routerrpc.SendPaymentRequest{
PaymentRequest: invoiceResp.PaymentRequest,
MaxParts: 10,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
payment := ht.SendPaymentAssertSettled(alice, sendReq)
Expand Down
2 changes: 0 additions & 2 deletions itest/lnd_routing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,6 @@ func testRouteFeeCutoff(ht *lntest.HarnessTest) {

sendReq := &routerrpc.SendPaymentRequest{
PaymentRequest: invoiceResp.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
}
switch limit := feeLimit.Limit.(type) {
Expand Down Expand Up @@ -1529,7 +1528,6 @@ func testFeeLimitAfterQueryRoutes(ht *lntest.HarnessTest) {
invoiceResp := carol.RPC.AddInvoice(invoice)
sendReq := &routerrpc.SendPaymentRequest{
PaymentRequest: invoiceResp.PaymentRequest,
TimeoutSeconds: 60,
FeeLimitMsat: 0,
}

Expand Down
3 changes: 1 addition & 2 deletions itest/lnd_single_hop_invoice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ func testSingleHopInvoice(ht *lntest.HarnessTest) {
DestCustomRecords: map[uint64][]byte{
record.KeySendType: keySendPreimage[:],
},
TimeoutSeconds: 60,
FeeLimitMsat: noFeeLimitMsat,
FeeLimitMsat: noFeeLimitMsat,
}
ht.SendPaymentAssertSettled(alice, req)

Expand Down
Loading
Loading