Commit Graph
100 Commits
Author SHA1 Message Date
Yong bac699df8f Merge pull request #9446 from yyforyongyu/yy-prepare-fee-replace
sweeper: rename `Failed` to `Fatal` and minor refactor
2025-02-05 22:48:41 +08:00
yyforyongyu b98542bd96 docs: update release notes 2025-02-05 19:49:09 +08:00
yyforyongyu e5f39dd644 sweep: refactor storeRecord to updateRecord
To make it clear we are only updating fields, which will be handy for
the following commit where we start tracking for spending notifications.
2025-02-05 19:49:09 +08:00
yyforyongyu 7eea7a7e9a sweep: add requestID to monitorRecord
This way we can greatly simplify the method signatures, also paving the
upcoming changes where we wanna make it clear when updating the
monitorRecord, we only touch a portion of it.
2025-02-05 19:49:04 +08:00
yyforyongyu bde5124e1b sweep: shorten storeRecord method signature
This commit shortens the function signature of `storeRecord`, also makes
sure we don't call `t.records.Store` directly but always using
`storeRecord` instead so it's easier to trace the record creation.
2025-02-05 19:48:18 +08:00
yyforyongyu c68b8e8c1e sweep: rename Failed to Fatal
This commit renames `Failed` to `Fatal` as it sounds too close to
`PublishFailed`. We also wanna emphasize that inputs in this state won't
be retried.
2025-02-05 19:48:18 +08:00
yyforyongyu bc8c1643c6 itest: move channel force closes into one sub test var 2025-01-26 09:16:02 +08:00
yyforyongyu e4b205cd90 itest: fix flake in testAnchorThirdPartySpend
When mining lots of blocks in the itest, the subsystems can be out of
sync in terms of the best block height. We now assert the num of pending
sweeps on Alice's node to give her more time to sync the blocks,
essentially behaving like a `time.Sleep` as in reality, the blocks would
never be generated this fast.
2025-01-26 09:15:36 +08:00
yyforyongyu 29603954bd .github: update actions versions 2025-01-20 21:55:20 +08:00
yyforyongyu c24f839fbe itest: fix flake in testSweepHTLCs
We need to make sure Caarol finishes settling her invoice with Bob
before shutting down, so we make sure `AssertHTLCNotActive` on Bob
happens before shutting node Carol.
2025-01-17 22:58:37 +08:00
Yong fb91b04906 Merge pull request #9405 from yyforyongyu/fix-unused-params
discovery+lnd: make param `ProofMatureDelta` configurable
2025-01-17 22:57:26 +08:00
yyforyongyu ae2bcfe3d8 docs: add release notes 2025-01-17 21:44:23 +08:00
yyforyongyu 27a05694cb multi: make ProofMatureDelta configurable
We add a new config option to set the `ProofMatureDelta` so the users
can tune their graphs based on their own preference over the num of
confs found in the announcement signatures.
2025-01-17 21:44:23 +08:00
yyforyongyu 56ff6d1fe0 docs: update release notes 2025-01-17 18:58:20 +08:00
yyforyongyu 772a9d5f42 discovery: fix mocked peer in unit tests
The mocked peer used here blocks on `sendToPeer`, which is not the
behavior of the `SendMessageLazy` of `lnpeer.Peer`. To reflect the
reality, we now make sure the `sendToPeer` is non-blocking in the tests.
2025-01-17 17:59:06 +08:00
yyforyongyu 9fecfed3b5 discovery: fix race access to syncer's state
This commit fixes the following race,
1. syncer(state=syncingChans) sends QueryChannelRange
2. remote peer replies ReplyChannelRange
3. ProcessQueryMsg fails to process the remote peer's msg as its state
   is neither waitingQueryChanReply nor waitingQueryRangeReply.
4. syncer marks its new state waitingQueryChanReply, but too late.

The historical sync will now fail, and the syncer will be stuck at this
state. What's worse is it cannot forward channel announcements to other
connected peers now as it will skip the broadcasting during initial
graph sync.

This is now fixed to make sure the following two steps are atomic,
1. syncer(state=syncingChans) sends QueryChannelRange
2. syncer marks its new state waitingQueryChanReply.
2025-01-17 02:39:07 +08:00
yyforyongyu 4b30b09d1c discovery: add new method handleSyncingChans
This is a pure refactor to add a dedicated handler when the gossiper is
in state syncingChans.
2025-01-17 00:22:22 +08:00
yyforyongyu eb2b0c783f graph: fix staticcheck suggestion
From staticcheck: QF1002 - Convert untagged switch to tagged switch.
2025-01-17 00:21:45 +08:00
yyforyongyu 001e5599b6 multi: add debug logs for edge policy flow
This commit adds more logs around the ChannelUpdate->edge policy process
flow.
2025-01-17 00:17:23 +08:00
Yong e0a920af44 Merge pull request #9420 from yyforyongyu/assert-channel-graph
itest+lntest: make sure to assert edge in both graph db and cache
2025-01-17 00:13:02 +08:00
yyforyongyu faa1f67480 lntest: assert channel edge in both graph db and cache
We need to make sure the channel edge has been updated in both the graph
DB and cache.
2025-01-16 23:00:22 +08:00
yyforyongyu e576d661ef itest: fix docs 2025-01-16 23:00:21 +08:00
yyforyongyu 848f42ea1d itest: fix flake in graph_topology_notifications
We need to make sure to wait for the `ListPeers` to give us the latest
response.
2025-01-16 16:19:37 +08:00
Yong 4b16c2902e Merge pull request #9383 from ziggie1984/bugfix-createmissingedge
bugfix createmissingedge
2025-01-14 16:20:15 +08:00
yyforyongyu bafe5d009f chainntnfs: fix test testSingleConfirmationNotification 2024-12-20 22:08:32 +08:00
yyforyongyu 2913f6e4c9 itest: fix flake in testCoopCloseWithExternalDeliveryImpl
The response from `ClosedChannels` may not be up-to-date, so we wrap it
inside a wait closure.
2024-12-20 19:38:15 +08:00
yyforyongyu 76eeae32d6 itest: document and fix wallet UTXO flake 2024-12-20 19:38:14 +08:00
yyforyongyu 7ab4081ffd lntest: make sure chain backend is synced to miner
We sometimes see `timeout waiting for UTXOs` error from bitcoind-related
itests due to the chain backend not synced to the miner. We now assert
it's synced before continue.
2024-12-20 19:38:14 +08:00
yyforyongyu 1dec926165 workflows: increase num of tranches to 16
Keep the SQL, etcd, bitcoin rpcpolling builds and non-ubuntu builds at 8
since they are less stable.
2024-12-20 19:38:14 +08:00
yyforyongyu 31b66962d8 lntest: properly handle shutdown error
This commit removes the panic used in checking the shutdown log.
Instead, the error is returned and asserted in `shutdownAllNodes` so
it's easier to check which node failed in which test. We also catch all
the errors returned from `StopDaemon` call to properly access the
shutdown behavior.
2024-12-20 19:38:14 +08:00
yyforyongyu 73574d919d lntest: add timeouts for windows
For Windows the tests run much slower so we create customized timeouts
for them.
2024-12-20 19:38:14 +08:00
yyforyongyu d7f8fa6ab6 lntest: increase port timeout 2024-12-20 19:38:14 +08:00
yyforyongyu 33b07be8c3 itest: even out num of tests per tranche
Previous splitting logic simply put all the remainder in the last
tranche, which could make the last tranche run significantly more test
cases. We now change it so the remainder is evened out across tranches.
2024-12-20 19:38:14 +08:00
yyforyongyu c536bc220f itest: add a prefix before appending a subtest case 2024-12-20 19:38:13 +08:00
yyforyongyu 686a7dd31c docs: update release notes 2024-12-20 19:38:13 +08:00
yyforyongyu becbdce64c lntest: limit the num of blocks mined in each test 2024-12-20 19:38:13 +08:00
yyforyongyu 5236c05dc6 itest+lntest: add new method FundNumCoins
Most of the time we only need to fund the node with given number of
UTXOs without concerning the amount, so we add the more efficient
funding method as it mines a single block in the end.
2024-12-20 19:38:13 +08:00
yyforyongyu 691a6267be workflows: use btcd for macOS
To increase the speed from 40m per run to roughly 20m per run.
2024-12-20 19:38:13 +08:00
yyforyongyu 77b2fa0271 lntest: make sure policies are populated in AssertChannelInGraph 2024-12-20 19:38:13 +08:00
yyforyongyu c97c31a70b lntest: increase node start timeout and payment benchmark timeout 2024-12-20 19:38:12 +08:00
yyforyongyu efe81f2d3c itest: track and skip flaky tests for windows
To make the CI indicative, we now starting tracking the flaky tests
found when running on Windows. As a starting point, rather than ignore
the windows CI entirely, we now identify there are cases where lnd can
be buggy when running in windows.

We should fix the tests in the future, otherwise the windows build
should be deleted.
2024-12-20 19:38:12 +08:00
yyforyongyu e79ad6e5aa itest: further reduce block mined in tests 2024-12-20 19:38:12 +08:00
yyforyongyu 6f2e7feb94 itest: breakdown testSendDirectPayment
Also fixes a wrong usage of `ht.Subtest`.
2024-12-20 19:38:12 +08:00
yyforyongyu c7b8379602 itest: break down channel fundmax tests 2024-12-20 19:38:12 +08:00
yyforyongyu 37b8210f37 itest: break down taproot tests 2024-12-20 19:38:12 +08:00
yyforyongyu efae8ea56f itest: break down single hop send to route
Also removed the duplicate test cases.
2024-12-20 19:38:11 +08:00
yyforyongyu c029f0a84f itest: break down basic funding flow tests 2024-12-20 19:38:11 +08:00
yyforyongyu c58fa01a66 itest: break down wallet import account tests 2024-12-20 19:38:11 +08:00
yyforyongyu 31aada65a4 itest: break down channel backup restore tests 2024-12-20 19:38:11 +08:00
yyforyongyu 7b1427a565 itest: break down payment failed tests 2024-12-20 19:38:11 +08:00
yyforyongyu 3319d0d983 itest: break down open channel fee policy 2024-12-20 19:38:11 +08:00
yyforyongyu 21c5d36812 itest: break down scid alias channel update tests 2024-12-20 19:38:10 +08:00
yyforyongyu 04a15039d7 itest: break all multihop test cases 2024-12-20 19:38:10 +08:00
yyforyongyu a76ff79adc itest: break down utxo selection funding tests 2024-12-20 19:38:10 +08:00
yyforyongyu b1cb819f07 itest: break down channel restore commit types cases 2024-12-20 19:38:10 +08:00
yyforyongyu 5663edfc2f itest: break remote signer into independent cases
So the test can run faster.
2024-12-20 19:38:10 +08:00
yyforyongyu cca2364097 itest: optimize blocks mined in testGarbageCollectLinkNodes
There's no need to mine 80ish blocks here.
2024-12-20 19:38:10 +08:00
yyforyongyu 1950d89925 itest: document a flake found in SendToRoute 2024-12-20 19:38:10 +08:00
yyforyongyu 7e80b77535 itest: document a rare flake found in macOS 2024-12-20 19:38:09 +08:00
yyforyongyu 39104c53d4 lntest: fix flakeness in openChannelsForNodes
We now make sure the channel participants have heard their private
channel when opening channels.
2024-12-20 19:38:09 +08:00
yyforyongyu cfb5713cda itest+lntest: fix flake in MPP-related tests 2024-12-20 19:38:09 +08:00
yyforyongyu fb59669ae8 itest: document details about MPP-related tests
This is needed so we can have one place to fix the flakes found in the
MPP-related tests, which is fixed in the following commit.
2024-12-20 19:38:09 +08:00
yyforyongyu f912f407c8 lntest: increase rpcmaxwebsockets for btcd
This has been seen in the itest which can lead to the node startup
failure,
```
2024-11-20 18:55:15.727 [INF] RPCS: Max websocket clients exceeded [25] - disconnecting client 127.0.0.1:57224
```
2024-12-20 19:38:09 +08:00
yyforyongyu 4e85d86a2e itest: fix flake in update_pending_open_channels 2024-12-20 19:38:09 +08:00
yyforyongyu 23edca8d19 itest: fix flake in testPrivateUpdateAlias 2024-12-20 19:38:08 +08:00
yyforyongyu 7c3564eeb6 itest: fix flake in runPsbtChanFundingWithNodes 2024-12-20 19:38:08 +08:00
yyforyongyu 7ceb9a4af5 lntest+itest: remove AssertNumActiveEdges
This is no longer needed since we don't have standby nodes, plus it's
causing panic in windows build due to `edge.Policy` being nil.
2024-12-20 19:38:08 +08:00
yyforyongyu 8f3100c984 itest: put mpp tests in one file 2024-12-20 19:38:08 +08:00
yyforyongyu fee6b70519 itest: use ht.CreateSimpleNetwork whenever applicable
So we won't forget to assert the topology after opening a chain of
channels.
2024-12-20 19:38:08 +08:00
yyforyongyu 4eea2078fb itest+routing: fix flake in runFeeEstimationTestCase
The test used 10s as the timeout value, which can easily cause a timeout
in a slow build so we increase it to 60s.
2024-12-20 19:38:08 +08:00
yyforyongyu 8b8f0c4eb4 itest: fix flake in testSwitchOfflineDelivery
The reconnection will happen automatically when the nodes have a
channel, so we just ensure the connection instead of reconnecting
directly.
2024-12-20 19:38:07 +08:00
yyforyongyu 66b35018b8 itest: fix flake in testRevokedCloseRetributionZeroValueRemoteOutput
We need to mine an empty block as the tx may already have entered the
mempool. This should be fixed once we start using the sweeper to handle
the justice tx.
2024-12-20 19:38:07 +08:00
yyforyongyu c07162603d itest: remove loop in wsTestCaseBiDirectionalSubscription
So we know which open channel operation failed.
2024-12-20 19:38:07 +08:00
yyforyongyu 782edde213 itest: fix and document flake in sweeping tests
We previously didn't see this issue because we always have nodes being
over-funded.
2024-12-20 19:38:07 +08:00
yyforyongyu 9f764c25f9 itest: flatten PSBT funding test cases
So it's easier to get the logs and debug.
2024-12-20 19:38:07 +08:00
yyforyongyu 762e59d78c itest: fix flake for neutrino backend 2024-12-20 19:38:07 +08:00
yyforyongyu 3a45492398 itest: fix spawning temp miner 2024-12-20 19:38:07 +08:00
yyforyongyu 2a9b7ec536 itest: fix flake in testSendDirectPayment
This bug was hidden because we used standby nodes before, which always
have more-than-necessary wallet utxos.
2024-12-20 19:38:06 +08:00
yyforyongyu e7310ff1b6 itest: fix testOpenChannelUpdateFeePolicy
This commit fixes a misuse of `ht.Subtest`, where the nodes should
always be created inside the subtest.
2024-12-20 19:38:06 +08:00
yyforyongyu 010a4f1571 lntest: add human-readble names and check num of nodes 2024-12-20 19:38:06 +08:00
yyforyongyu f64b2ce8f2 lntest: make sure node is properly shut down
Soemtimes the node may be hanging for a while without being noticed,
causing failures in its following tests, thus making the debugging
extrememly difficult. We now assert the node has been shut down from the
logs to assert the shutdown process behaves as expected.
2024-12-20 19:38:06 +08:00
yyforyongyu 72f3f41d41 itest: remove unnecessary channel close and node shutdown
Since we don't have standby nodes anymore, we don't need to close the
channels when the test finishes. Previously we would do so to make sure
the standby nodes have a clean state for the next test case, which is no
longer relevant.
2024-12-20 19:38:06 +08:00
yyforyongyu 00772ae281 itest+lntest: remove standby nodes
This commit removes the standby nodes Alice and Bob.
2024-12-20 19:38:06 +08:00
yyforyongyu 11c9dd5ff2 itest: remove unused method setupFourHopNetwork 2024-12-20 19:38:05 +08:00
yyforyongyu de8f14bed2 itest: remove the use of standby nodes
This commit removes the usage of the standby nodes and uses
`CreateSimpleNetwork` when applicable. Also introduces a helper method
`NewNodeWithCoins` to quickly start a node with funds.
2024-12-20 19:38:05 +08:00
yyforyongyu 3eda87fff9 itest: remove direct reference to stanby nodes
Prepares the upcoming refactor. We now never call `ht.Alice` directly,
instead, we always init `alice := ht.Alice` so it's easier to see how
they are removed in a following commit.
2024-12-20 19:38:05 +08:00
yyforyongyu ef167835dd workflows: pass action ID as the shuffle seed
To make sure each run is shuffled, we use the action ID as the seed.
2024-12-20 19:38:05 +08:00
yyforyongyu 88bd0cb806 itest: shuffle test cases to even out blocks mined in tranches
This commit adds a new flag to shuffle all the test cases before running
them so tests which require lots of blocks to be mined are less likely
to be run in the same tranch.

The other benefit is this approach provides a more efficient way to
figure which tests are broken since all the differnet backends are
running different tranches in their builds, we can identify more failed
tests in one push.
2024-12-20 19:38:05 +08:00
yyforyongyu 2c27df6c30 itest: print num of blocks for debugging 2024-12-20 19:38:05 +08:00
yyforyongyu ecd82a3bcb contractcourt: include custom records on replayed htlc
Add another case in addition to #9357.
2024-12-20 17:54:13 +08:00
yyforyongyu a1bd8943db lntest+itest: export DeriveFundingShim 2024-12-20 17:54:12 +08:00
yyforyongyu c4a6abb14d lntest+itest: remove the usage of ht.AssertActiveHtlcs
The method `AssertActiveHtlcs` is now removed due to it's easy to be
misused. To assert a given htlc, use `AssertOutgoingHTLCActive` and
`AssertIncomingHTLCActive` instead for ensuring the HTLC exists in the
right direction. Although often the case `AssertNumActiveHtlcs` would be
enough as it implicitly checks the forwarding behavior for an
intermediate node by asserting there are always num_payment*2 HTLCs.
2024-12-20 17:54:12 +08:00
yyforyongyu 36a87ad5f4 itest: assert payment status after sending 2024-12-20 17:54:12 +08:00
yyforyongyu 425877e745 itest: remove redundant block in multiple tests 2024-12-20 17:54:12 +08:00
yyforyongyu 9c0c373b7e itest: flatten and fix testWatchtower 2024-12-20 17:54:12 +08:00
yyforyongyu b7feeba008 itest+lntest: fix channel force close test
Also flatten the tests to make them easier to be maintained.
2024-12-20 17:54:12 +08:00
yyforyongyu 9d4a60d613 itest: remove redundant blocks in channel backup tests 2024-12-20 17:54:12 +08:00
yyforyongyu a55408d4a1 itest: remove redudant block in testPsbtChanFundingWithUnstableUtxos 2024-12-20 17:54:11 +08:00
yyforyongyu 22b9350320 itest: remove redunant block mining in testChannelFundingWithUnstableUtxos 2024-12-20 17:54:11 +08:00
yyforyongyu 2494f1ed32 itest: remove redundant block mining in testFailingChannel 2024-12-20 17:54:11 +08:00