Commit Graph

236 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
cc9e2b783e
Merge pull request #8961 from yyforyongyu/fix-leaseoutput
Improve the performace of `LeaseOutput`
2024-08-21 16:31:26 -07:00
Oliver Gugger
e99e6662cf
multi: update linter, fix new issues 2024-08-20 19:14:44 +02:00
ziggie
2d04813dc3
itest: Add itest for bumpclosefeerate rpc.
Add an itest which will bump the close fee rate of an anchor
channel which is force closed without having any HTLCs at stake.
2024-08-09 19:41:27 +02:00
ziggie
75f6622ccf
itest: remove unused LEGACY channel code.
Legacy Channel types are not tested anymore via the multi-hop
test harness, therefore we can remove unused code.
2024-08-09 18:54:57 +02:00
yyforyongyu
8259e0fb5f
itest: remove redundant call to ht.WaitForBlockchainSync
This check has already been done when mining blocks.
2024-08-09 22:01:57 +08:00
Elle Mouton
5e84ba92af
multi: add IsBlinded to lnrpc.Invoice for nicer UX
The BlindedPathConfig struct is nice for invoice creation but when we
use the Invoice message for viewing an invoice, it would be nicer to see
an "is_blinded" field.
2024-08-08 16:46:01 +02:00
Olaoluwa Osuntokun
459ee9b245
Merge pull request #8976 from ellemouton/rb-follow-ups
route blinding: follow ups
2024-08-07 17:54:31 -07:00
Yong
a449a5d132
Merge pull request #8174 from yyforyongyu/fix-inflight-payments
routing: fix stuck inflight payments
2024-08-07 23:23:27 +08:00
Elle Mouton
697f514d09
blindedpath: log chosen blinded paths
In this commit, we log selected blinded paths.
2024-08-07 17:03:12 +02:00
Elle Mouton
3de6c5415a
multi: let blinded path invoice options be set per addinvoice call
Extend the configurability of blinded paths in invoices by adding the
ability to change the global config options on a per-RPC basis.
2024-08-07 17:02:55 +02:00
yyforyongyu
d28d5d7a47
itest: add testSendToRouteFailHTLCTimeout to check SendToRouteV2 2024-08-07 22:17:58 +08:00
yyforyongyu
941716d60e
lntest+itest: add new test testPaymentHTLCTimeout
This commit adds a new test case to validate that when an HTLC has timed
out, the corresponding payment is marked as failed.
2024-08-07 22:17:58 +08:00
yyforyongyu
e542351149
itest: add testSendSelectedCoins to check selected utxos 2024-08-07 20:42:58 +08:00
yyforyongyu
0041426e7e
itest+lntest: return the error from SendCoinsAssertErr
Also rename the send all coins test for clarity.
2024-08-07 20:42:28 +08:00
Olaoluwa Osuntokun
c46b1a467a
Merge pull request #8836 from hieblmi/payment-failure-reason-cancel
routing: add payment failure reason `FailureReasonCancel`
2024-08-01 16:52:06 -07:00
Andras Banki-Horvath
8e49eb652d
itest: add itest covering the leader healthcheck 2024-08-01 19:04:10 +02:00
Slyghtning
0273eac4b2
itest: payment failure reason canceled 2024-08-01 10:25:22 +02:00
Slyghtning
653226d29c
itest: format and typo fixes 2024-08-01 10:24:08 +02:00
Olaoluwa Osuntokun
04dde98edc
Merge pull request #8764 from ellemouton/rb-send-via-multi-path
[3/4] Route Blinding: send MPP over multiple blinded paths
2024-07-31 19:21:49 -07:00
Oliver Gugger
ac4ef28926
Merge pull request #8824 from Crypt-iQ/precise_dust_limit
multi: include commitment fees in dust calculation
2024-07-31 03:13:31 -06:00
Elle Mouton
e416501802
itest: test sending MP payment over multiple blinded paths 2024-07-31 09:36:06 +02:00
ziggie
cac5b32d88
itest: adapt itest for the new anchor behavior.
Now we also register anchors when no HTLCs are at stake.
2024-07-30 20:31:29 +02:00
bitromortac
b0f0715813
routing: fix fee limit condition
When iterating edges, pathfinding checks early whether using an edge
would violate the requested total fee limit for a route. This check is
done on the net amount (an amount the inbound fee is calculated with).
However, a possible next hop's fee discount leads to a reduction in fees
and as such using the net amount leads to assuming a higher cumulative
fee than the route really has, excluding the path erroneously. We
perform the fee limit check on the amount to send, which includes both
inbound and outbound fees. This should be possible as the first hop's
outbound fee is zero and therefore doesn't have to be checked in the
end.
2024-07-30 08:53:09 +02:00
bitromortac
557b33733c
itest: add test for failing send after queryroutes 2024-07-30 08:52:50 +02:00
Olaoluwa Osuntokun
9decf80a68
Merge pull request #8735 from ellemouton/rb-receives
[2/4] Route Blinding Receives: Receive and send to a single blinded path in an invoice.
2024-07-29 19:00:06 -07:00
Eugene Siegel
c1138af4ab
itest: modify async_bidirectional_payments itest to pass 2024-07-29 14:13:22 -04:00
ziggie
d0a7765c68
rpcserver: include fee calc. for psbt flow.
Include the fee calculaltion for the psbt flow. Moreover include
fee rate testing in the itest environment.
2024-07-26 10:48:00 +02:00
Elle Mouton
398623bde5
blindedpath: move blinded path logic to own pkg 2024-07-26 09:54:59 +02:00
Elle Mouton
c62a9c235e
itest: test blinded paths over private channels 2024-07-26 09:54:38 +02:00
Elle Mouton
66765de413
itest: add route blinding dummy hops test
Add an itest that tests the addition of dummy hops to a blinded path. By
testing that invoices containing such a path can be paid, it also tests
the peeling of dummy hops by the receiver.
2024-07-26 09:54:38 +02:00
Elle Mouton
f0558babf3
multi: send MPP payment to blinded path
Make various sender side adjustments so that a sender is able to send an
MP payment to a single blinded path without actually including an MPP
record in the payment.
2024-07-26 09:54:38 +02:00
Elle Mouton
64a99d4a8e
itest: end to end route blinding invoices test
Update one of the route blinding itests to do a full end-to-end test
where the recipient generates and invoice with a blinded path and the
sender just provides that invoice to SendPayment.

The tests also covers the edge case where the recipient is the
introduction node.
2024-07-26 09:54:38 +02:00
Elle Mouton
34d8fff5f9
itest: update route blind tests
The route blinding itests are now updated so that recipient logic is
tested. The creation of a blinded route is also now done through the
AddInvoice API instead of manually.
2024-07-26 09:54:18 +02:00
Elle Mouton
4457ca2e66
record: stricter type for PaymentRelayInfo.BaseFee
In this commit, we update the PaymentRelayInfo struct's BaseFee member
to use a stricter type (lnwire.MilliSatoshi) instead of an ambigious
uint32.
2024-07-26 09:53:49 +02:00
yyforyongyu
91807625bb
itest: fix testUnconfirmedChannelFunding for neutrino
This test was previously working because we'd mine an extra block to
confirm the coins inside `FundCoinsUnconfirmed` when it's a neutrino
backend, as shown in
fdd28c8d88/lntest/harness.go (L1431)
Since neutrino has trouble seeing unconfirmed balance, we now send some
coins to the wallet, confirm those, then do a self-transfer so the node
will have unconfirmed outputs to perform the test.
2024-07-23 21:53:51 +08:00
yyforyongyu
4dcce9df69
lntest+itest: fix flakes found using neutrino backend
This commit makes sure the sweep requests are received before mining
blocks to trigger the actual sweeping.

In addition, `testFundingExpiryBlocksOnPending` is updated to deal with
the old `channel link not found` issue.
2024-07-23 21:30:09 +08:00
yyforyongyu
50279464ad
itest: remove unused param in chanRestoreViaRPC 2024-07-23 21:30:08 +08:00
yyforyongyu
8240a87c2b
itest: fix misuse of MineBlocks and replace it with
`MineBlocksAndAssertNumTxes`
2024-07-23 21:30:08 +08:00
yyforyongyu
f1f341095e
lntest+itest: add new method CurrentHeight 2024-07-23 21:30:08 +08:00
yyforyongyu
14e7b134d9
lntest+itest: make Miner a private instance 2024-07-23 21:30:08 +08:00
yyforyongyu
be4dba5da6
lntest+itest: finalize moving miner methods 2024-07-23 21:30:07 +08:00
yyforyongyu
6bd8baea38
lntest+itest: continue removing direct call to Miner 2024-07-23 21:30:07 +08:00
yyforyongyu
976bb37972
lntest+itest: add method AssertNumTxsInMempool and AssertTxInBlock
in harness

Prepare to make `HarnessTest.Miner` a private instance to sync height.
2024-07-23 21:30:07 +08:00
yyforyongyu
e553895ddd
lntest+itest: strictly define the behavior of MineBlocks
This commit adds more assertion to `MineBlocks` so the caller won't
misuse it.
2024-07-23 21:30:07 +08:00
Elle Mouton
ad0905f10e
record+htlcswitch: convert BlindedRouteData fields to optional
For the final hop in a blinded route, the SCID and RelayInfo fields will
_not_ be set. So these fields need to be converted to optional records.

The existing BlindedRouteData constructor is also renamed to
`NewNonFinalBlindedRouteData` in preparation for a
`NewFinalBlindedRouteData` constructor which will be used to construct
the blinded data for the final hop which will contain a much smaller set
of data. The SCID and RelayInfo parameters of the constructor are left
as non-pointers in order to force the caller to set them in the case
that the constructor is called for non-final nodes. The other option
would be to create a single constructor where all parameters are
optional but I think this makes it easier for the caller to make a
mistake.
2024-07-10 09:12:39 +02:00
Elle Mouton
f3cdbbed2f
itest+lntest: let abandoned channel be either not found or in zombie
index

When abandoning a channel, we remove it from the graph and then add it
to the zombie channel index. However, if we then process a ChannelUpdate
for this channel it will result in us calling `processZombieUpdate`
which will delete the edge from the zombie index. The abandon channel
itest currently asserts that a channel is no longer in the graph by
asserting that when querying for the channel we get a "marked as zombie"
error but to account for the above series of operations, we now also
allow it to just not be found at all ("edge not found").
2024-06-14 14:33:43 -04:00
yyforyongyu
955670fcc2
itest: provide a temporary fix to unblock CI 2024-06-14 15:18:20 +08:00
yyforyongyu
9f34a4dc54
itest: skip error assertion when parent context finishes
We may get a flake like the following,
```
lnd_route_blinding_test.go:468:
            Error Trace:    /Users/runner/work/lnd/lnd/itest/lnd_route_blinding_test.go:468
                                        /Users/runner/hostedtoolcache/go/1.22.3/arm64/src/runtime/asm_arm64.s:1222
            Error:          Received unexpected error:
                            rpc error: code = Canceled desc = context canceled
            Test:           TestLightningNetworkDaemon/tranche15/144-of-156/bitcoind/disable_introduction_node
```

This happens when the test successfully finishes, the parent context is
canceled, causing the child context to return an error. We fix it by
ignoring it in the goroutine.
2024-06-13 17:54:30 +08:00
Keagan McClelland
56048133f2 itest+lntest: add itest to reproduce bug #8535 2024-06-05 12:56:04 -07:00
yyforyongyu
c9cad6ab81
itest+sweep: refactor testSignPsbt to use Subtest and add logs 2024-06-04 09:07:44 +02:00