Commit Graph
97 Commits
Author SHA1 Message Date
yyforyongyu 7374392abe lnrpc: sort Invoice.HTLCs based on HtlcIndex
So the returned HTLCs are ordered.
2024-12-07 09:54:46 +08:00
yyforyongyu d108e14c5d multi: rename lll to ll and remove unused nolint 2024-12-04 07:20:59 +08:00
yyforyongyu b243394049 lnwallet: log the amounts in the same unit 2024-11-21 20:42:47 +08:00
yyforyongyu 57084804d4 lnd: stop graphBuilder during shutdown 2024-11-21 15:37:49 +08:00
yyforyongyu db6901c9f3 chainntnfs: skip duplicate numConfsLeft notifications
This commit adds a new state to the `ConfNtfn` struct to start tracking
the number of confs left to be notified to avoid sending duplicate
notifications.
2024-11-19 16:27:26 +08:00
yyforyongyu 7695880c13 chainntnfs: add new method notifyNumConfsLeft
So it's easier to handle the following commit where we start skipping
duplicate notifications.
2024-11-19 16:02:19 +08:00
yyforyongyu 0c3b2b5e06 docs: update release notes 2024-11-19 15:56:27 +08:00
yyforyongyu 4ff1f19fbf chainntnfs: make sure notification is sent to the whole set
This commit fixes a bug where the confirmation details may be missed.
When the same tx is subscribed via `RegisterConfirmationsNtfn`, we will
put them into the same set and notify the whole set. However, this logic
is missing when performing the rescan - once the confirmation detail is
found, we only notify the current subscriber. Later we will skip
notifying other subscribers in `UpdateConfDetails` due to the
`confSet.details != nil` check. We now fix it by immediately notify all
the subscribers when the confirmation detail is found during the rescan.
2024-11-19 15:56:08 +08:00
yyforyongyu 1200b75546 chainntnfs: always notify txns before block
This commit changes the order of notifications when a relevant tx is
found in a block and now we will always notify the tx subscribers before
notifying the block, which has implications in the upcoming blockbeat.

When a block notification is subscribed via `RegisterBlockEpochNtfn` and
a confirm or spend is subscribed via `RegisterConfirmationsNtfn` or
`RegisterSpendNtfn`, we would always notify the block first before the
tx, causing the subsystem to think there's no relevant txns found in
this block, while the notifications are sent later. We now fix it by
always sending the txns notifications first, so the subsystem can
receive the txns, process them, then attempt to advance its state based
on the block received.
2024-11-19 15:55:22 +08:00
yyforyongyu 3ab5669ff2 docs: update release notes 2024-11-18 18:49:34 +08:00
yyforyongyu fe03aa0201 peer+lnd: fix peer blocking on node shutdown
This commit fixes a case where the peer blocks the shutdown process.
During the shutdown, the server will call `s.DisconnectPeer`, which
calls `peer.Disconnect`. Because the peer never enters `peer.Start` via
`s.peerInitializer`, the `startReady` chan will not be closed, causing
`peer.Disconnect` to hang forever. We now fix it by only block on
`startReady` when the peer is started.
2024-11-18 18:49:34 +08:00
Yong 0876173c45 Merge pull request #9261 from yyforyongyu/fix-rpcclient-shutdown
multi: fix rpcclient shutdown
2024-11-14 03:18:07 +08:00
yyforyongyu 1c6d89446d docs: update release notes 2024-11-14 01:22:32 +08:00
yyforyongyu fc5f8e32f5 chanfitness: exit early when there are no updates 2024-11-14 01:22:32 +08:00
yyforyongyu 523ecc0653 multi: wait for rpcclients shutdown to complete
We need to call `WaitForShutdown` after stopping the rpc clients of the
chain backends.
2024-11-14 01:22:31 +08:00
yyforyongyu 653a8ac55e lntest+itest: add new method AssertChannelInGraph
This commit replaces `AssertTopologyChannelOpen` with
`AssertChannelInGraph`, which asserts a given channel edge is found.
`AssertTopologyChannelOpen` only asserts a given edge has been received
via the topology subscription, while we need to make sure the channel is
in the graph before continuing our tests.
2024-11-12 23:55:40 +08:00
yyforyongyu 7dda2960a5 lntest: update the block height of HarnessTest during start 2024-11-12 23:55:40 +08:00
yyforyongyu 2905e7b3df lntest+itest: kill node and wait its process
Fix a flake found in `testRPCMiddlewareInterceptor` when running in
macOS.
2024-11-12 23:55:40 +08:00
yyforyongyu 90bca1022b lntest: retry finding the payment from ListPayments 2024-11-12 23:55:40 +08:00
yyforyongyu 4506fd30cb lntest: change the nodeCounter to be atomic 2024-11-12 23:55:13 +08:00
yyforyongyu cc6ff150b9 lntest: remove deprecated config --profile 2024-11-12 14:46:31 +08:00
yyforyongyu 6ac588e655 lntest: remove an invalid check
`openChannelsForNodes` is called inside `openZeroConfChannelsForNodes`
so this value can be true.
2024-11-12 14:46:30 +08:00
Yong 4f6b510869 Merge pull request #9248 from yyforyongyu/fix-itest
lntest: fix edge assertion and reset min relay fee
2024-11-11 22:16:03 +08:00
yyforyongyu 7dd9a17625 lntest+itest: fix testUpdateChanStatus 2024-11-11 20:57:50 +08:00
yyforyongyu d27ff34b04 lntest+itest: rename AssertNumEdges to AssertNumActiveEdges
To properly reflect what the assertion is.
2024-11-11 20:57:49 +08:00
yyforyongyu 35992e1503 lntest+itest: expore method createSimpleNetwork
So it can be used via `ht.CreateSimpleNetwork`.
2024-11-11 20:57:49 +08:00
yyforyongyu 9682aa7a78 itest: fix testZeroConfChannelOpen and testOptionScidAlias
Use a new node instead of standby node to avoid closing the channels in
the end.
2024-11-11 20:54:10 +08:00
yyforyongyu a745d74e7c lntest: make sure standby nodes' edges are cleaned 2024-11-11 20:54:10 +08:00
yyforyongyu e7d0754615 lntest: make sure minRelayFeerate is reset
So every test starts with the default minRelayFeerate.
2024-11-11 20:54:10 +08:00
yyforyongyu 4fe36f1887 docs: add release notes 2024-11-08 01:53:07 +08:00
yyforyongyu 227cc3a45c routing: fix missionControlStore blocks on shutting down 2024-11-08 01:23:33 +08:00
yyforyongyu 8311bc56e5 htlcswitch: fix flake in TestChannelLinkCancelFullCommitment
We bring down the max number of inflight HTLCs in the link's unit tests
to speed up the tests.
2024-10-31 20:23:31 +08:00
yyforyongyu 611405f59c chainntnfs/btcdnotify: remove redundant config params re-assignment 2024-10-30 02:01:14 +08:00
yyforyongyu 785e058b77 itest: fix flake in testPaymentFailureReasonCanceled
Fix the case,
```
--- FAIL: TestLightningNetworkDaemon/tranche01/46-of-191/bitcoind/payment_failure_reason_canceled (20.86s)
        harness.go:2113:
            	Error Trace:	/home/runner/work/lnd/lnd/lntest/harness.go:2113
            	            				/home/runner/work/lnd/lnd/itest/lnd_payment_test.go:1183
            	            				/home/runner/work/lnd/lnd/itest/lnd_payment_test.go:1138
            	            				/home/runner/work/lnd/lnd/lntest/harness.go:396
            	            				/home/runner/work/lnd/lnd/itest/lnd_test.go:139
            	Error:      	err from HTLC interceptor stream
            	Test:       	TestLightningNetworkDaemon/tranche01/46-of-191/bitcoind/payment_failure_reason_canceled
            	Messages:   	received err from HTLC interceptor stream: rpc error: code = Unknown desc = interceptor already exists
```
2024-10-29 15:32:17 +08:00
yyforyongyu 21535826ba lntest: remove redundant MineBlocks 2024-10-29 15:31:21 +08:00
Yong 6a5a79fb88 Merge pull request #9209 from guggero/lntest-shutdown
lntest: shutdown all nodes at end of test
2024-10-23 02:00:39 +08:00
Yong caff5a00d1 Merge pull request #9138 from ziggie1984/detail_debug_process
Detail LND's debug procedures.
2024-10-22 20:26:11 +08:00
yyforyongyu 7849e63e0f docs: update release doc 2024-10-17 07:45:06 +08:00
yyforyongyu bf8ae68eea lntest: add method AssertTxnsNotInMempool
So we only need to do one `GetRawMempool` lookup when checking the
exclusion of multiple txns.
2024-10-17 07:34:40 +08:00
yyforyongyu e560e00aeb lntest: remove unused return value 2024-10-17 07:34:25 +08:00
yyforyongyu ed3cb26188 itest+lntest: stop using pointer to chainhash.Hash
This commit fixes the methods used in `lntest` so they stop using
pointers to chainhash.
2024-10-17 07:14:51 +08:00
Yong da7f8aeb61 Merge pull request #9099 from lightningnetwork/kvdb-wallet-db
kvdb: update to latest walletdb version
2024-09-15 15:22:15 +08:00
yyforyongyu db332db025 Makefile: add -test.v for make itest 2024-09-10 17:21:03 +08:00
Yong 278cf03078 Merge pull request #9028 from yyforyongyu/improve-ci-log
Makefile: silence testing log in `make itest-parallel`
2024-08-23 17:55:04 +08:00
yyforyongyu 35287ee899 scripts: silence test outputs 2024-08-23 15:48:09 +08:00
Yong 77c7f776d5 Merge pull request #9002 from Roasbeef/tlv-edge-info-bug-fix
discovery: fix bug that can lead to sending invalid chan_ann msgs
2024-08-14 23:29:36 +08:00
yyforyongyu 363e529f9b docs: update release notes 2024-08-09 22:01:57 +08: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
yyforyongyu 3e36adf476 mulit: remove ListLeasedOutputs in LeaseOutput
This commit removes the call toe `ListLeasedOutputs` in `LeaseOutput` -
the returned info from `ListLeasedOutputs` can easily be accessed via
`FetchInputInfo` and this info is only used at one callsite.
`ListLeasedOutputs` then becomes unnecessary here, plus it's very slow
and needs to be refactored in `btcwallet` instead.
2024-08-09 22:01:57 +08:00
yyforyongyu f70c919164 lnrpc: fetch utxo info in lockInputs
This commit prepares the following commit where we change the
`LeaseOutput` to be more efficient.
2024-08-09 22:01:57 +08:00
yyforyongyu b17db4a32a lntest+lnwallet: remove the method FetchInputInfo
This method is no longer used. In addition, the `Derivation` field on
the `Utxo` is also removed to avoid nil dereference.
2024-08-09 22:01:56 +08:00
yyforyongyu d7381ce3fe rpcserver: remove redundant call to FetchInputInfo 2024-08-09 22:01:56 +08:00
yyforyongyu aba8507b2a lnrpc+lnwallet: replace FetchInputInfo with new methods
This commit replaces the usage of `FetchInputInfo` with
`FetchOutpointInfo` and `FetchDerivationInfo` to remove unncessary
fetching of the derivation path.
2024-08-09 21:51:18 +08:00
yyforyongyu 9801ee036b lnwallet+lntest: add FetchOutpointInfo and FetchDerivationInfo 2024-08-09 21:51:17 +08:00
yyforyongyu 8f35612364 mod: update btcwallet version 2024-08-09 21:51:15 +08: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
yyforyongyu bc31a8b36f routing: fix doc string 2024-08-07 22:19:23 +08:00
yyforyongyu 677f2c390a lntest: re-define CleanupForceClose
To reflect the new sweeping behavior, also makes it easier to be used as
we need to method to quickly cleanup force closes without concerning the
details when we are not testing the force close behavior.
2024-08-07 22:19:23 +08:00
yyforyongyu 7aba5cbc0a routing: fix linter complains 2024-08-07 22:19:23 +08:00
yyforyongyu dcd8269050 docs: update release notes 2024-08-07 20:42: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
Yong ab96de3f07 Merge pull request #8967 from ProofOfKeags/feature/stfu-wire
[MICRO]: add wire messages for quiescence
2024-08-06 13:52:12 +08:00
yyforyongyu d992cf94d6 multi: add SpewLogClosure to avoid code repetition 2024-07-25 22:18:49 +08:00
yyforyongyu b6049ff94b multi: add NewLogClosure in lnutils to avoid repetition
And replaces all usage of `logClosure` with `lnutils.LogClosure`.
2024-07-25 21:25:23 +08:00
yyforyongyu 7e60d41898 chainfee: make sure web API has been started before estimating
Previously we may get a floor feerate when calling `EstimateFeePerKW`
due to the fee estimator not finishing its startup process, which gives
us an empty fee map.

This is now fixed to return an error if the estimator is not started.
2024-07-24 20:05:00 +08:00
yyforyongyu 0a0d51ce22 docs: update release notes 2024-07-24 20:05:00 +08:00
yyforyongyu a1d71afde8 lntest: allow specifying min relay feerate in itest 2024-07-24 20:05:00 +08:00
yyforyongyu ce43e4bab7 chainfee: allow specifying min relay feerate from API source
This commit adds a new expected field, `min_relay_feerate`, in the
response body returned from the API source, allowing the API to specify
a min relay feerate to be used instead of the FeePerKwFloor.

This change is backwards compatible as for an old API source which
doesn't specify the `min_relay_feerate`, it will be interpreted as zero.
2024-07-24 20:05:00 +08:00
yyforyongyu 48a0efe40c bitcoindnotify: add debug logs in unit test 2024-07-24 18:05:06 +08:00
yyforyongyu 9fee656d70 chainntnfs+lntest: fix TestInterfaces
This commit upgrades the test to always use a segwit v0 witness program
when creating testing txns.
2024-07-24 17:43:27 +08: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
https://github.com/lightningnetwork/lnd/blob/fdd28c8d888792ea8fde3c557ba9f2594e0a6ec8/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 2d21aa3718 docs: update release notes 2024-07-23 21:30:09 +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 2608c0893e multi: make sure missionControlStore catches done signal
This commit makes sure `missionControlStore` catches the shutdown signal
when draining the ticker. A few debug logs are added to aid the process.
2024-07-23 21:30:08 +08:00
yyforyongyu 50279464ad itest: remove unused param in chanRestoreViaRPC 2024-07-23 21:30:08 +08:00
yyforyongyu 623f816f8e lntest: remove redundant nodes shutdown
The nodes are already shut down in the `Cleanup` in `ht.Subtest` so
there's no need to shutdown them again.
2024-07-23 21:30:08 +08:00
Yong 3526f82b5d Merge pull request #8887 from yyforyongyu/fix-err-match
multi: fix `lnwallet.ErrDoubleSpend`
2024-07-08 14:09:07 +08:00
yyforyongyu e27a656c07 docs: add release notes for 0.18.3 2024-07-06 14:01:40 +08:00
yyforyongyu 26a365eb32 docs: update release notes 2024-07-06 13:59:28 +08:00
yyforyongyu 8f4bcd0b3a lnwallet: fix ErrDoubleSpend 2024-07-06 13:59:28 +08:00
yyforyongyu ddf46f435c multi: update RPC error import path
These errors are now defined in `btcwallet/chain` instead of
`btcd/rpcclient`.
2024-07-06 13:59:28 +08:00
yyforyongyu e0a506ab26 multi: use chain.MapRPCErr instead of rpcclient.MapRPCErr 2024-07-06 13:59:25 +08:00
yyforyongyu 1d40c55550 gomod: update btcwallet to include RPC errors 2024-07-06 13:55:12 +08:00
yyforyongyu 7fd099b146 docs: update release notes and add notes for 0.18.2 2024-06-26 01:44:00 +08:00
yyforyongyu 3b4106ca00 mod: update btcd and btcwallet versions 2024-06-26 00:41:17 +08:00
Yong e6f7a2d6a7 Merge pull request #8734 from hieblmi/cancel-estimateroutefee
routing: cancelable payment loop
2024-06-17 18:06:52 +08:00
yyforyongyu 955670fcc2 itest: provide a temporary fix to unblock CI 2024-06-14 15:18:20 +08:00
yyforyongyu 0f7c641f92 cli: update pendingsweeps response 2024-06-13 19:17:16 +08:00
Yong cf88a8ae04 Merge pull request #8828 from yyforyongyu/increase-itest-timeout
lntest: increase timeout for postgres backend
2024-06-13 19:00:49 +08:00
yyforyongyu 84e58d6f02 workflows: decrease TRANCHES to 8 2024-06-13 17:54:34 +08:00
yyforyongyu 6de1b026dd chainntnfs: add verbose logging in unit test 2024-06-13 17:54:34 +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
yyforyongyu ddceb2b15b lntest: increase timeout for postgres backend
Also decrease timeout values for other builds.
2024-06-13 17:54:30 +08:00
Yong 286ee95735 Merge pull request #8800 from ProofOfKeags/bugfix/8535
contractcourt: consider delivery addresses when evaluating toSelfAmount
2024-06-12 01:06:36 +08:00
yyforyongyu e61cba8d22 multi: return verbose errors when fetching edges 2024-06-10 08:40:18 +08:00
yyforyongyu 78cc1619d7 multi: fix complaints from IDE and linter
Fixed unused param and nilness cond.
2024-06-07 00:45:15 +08:00