Commit graph

1286 commits

Author SHA1 Message Date
yyforyongyu
2d5a2ce78a
lntest+itest: change the method signature of AssertPaymentStatus
So this can be used in other tests when we only care about the payment
hash.
2025-02-28 19:07:38 +08:00
yyforyongyu
4bfcfea2ee
lntest+chainntnfs: make sure bitcoind node is synced
This commit makes sure the bitcoind node is synced to the miner when
initialized and returned from `NewBitcoindBackend`.
2025-02-26 19:51:52 +08:00
yyforyongyu
99d49dec6a
multi: change NewBitcoindBackend to take a miner as its param
Prepares for the following commit where we assert the chain backend is
synced to the miner.
2025-02-26 19:51:52 +08:00
yyforyongyu
1618d2c789
chainntnfs+lntest: fix sync to miner block flake
In this commit we document an unexpected behavior found when connecting
a bitcoind node to a btcd node. We mitigate this in our test by
reconnecting the nodes when the connection is broken. We also limit the
connection made from `bitcoind` to be v1 only.
2025-02-26 19:51:52 +08:00
yyforyongyu
175301628f
lntest/unittest: make sure miner is connected to bitcoind
We change how the `bitcoind` node connects to the miner by creating a
temp RPC client and use it to connect to the miner. In addition we also
assert the connection is made.
2025-02-25 21:11:26 +08:00
yyforyongyu
245ea85894
lntest/unittest: assert bitcoind is shut down
Make sure the shutdown of `bitcoind` is finished without any errors.
2025-02-25 21:11:25 +08:00
yyforyongyu
7666d62a43
lntest/unittest: update config for miner and bitcoind
The config used for the miner is updated to skip banning and debug. For
bitcoind, the config is updated to use a unique port for P2P conn.
2025-02-25 21:10:40 +08:00
ziggie
f458844412
lnd: add max fee rate check to closechannel rpc 2025-02-20 17:43:18 +01:00
yyforyongyu
ca10707b26
itest+lntest: assert payment is failed once the htlc times out 2025-02-10 11:31:51 +08:00
yyforyongyu
5f4716c699
lntest: log timestamp when printing errors 2025-02-05 22:51:46 +08:00
Elle Mouton
af8c8b4bb3
lntest: remove always-nil error from formatted error 2025-01-24 12:49:41 +02: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
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
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
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
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
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
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
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
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
00772ae281
itest+lntest: remove standby nodes
This commit removes the standby nodes Alice and Bob.
2024-12-20 19:38:06 +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
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
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
d7b2025248
lntest+itest: flatten testMultiHopRemoteForceCloseOnChainHtlcTimeout 2024-12-20 17:54:10 +08:00
yyforyongyu
bef17f16cf
lntest+itest: flatten testMultiHopLocalForceCloseOnChainHtlcTimeout 2024-12-20 17:54:10 +08:00
yyforyongyu
9ab9cd5f99
lntest+itest: start flattening the multi-hop tests
Starting from this commit, we begin the process of flattening the
multi-hop itests to make them easier to be maintained. The tests are
refactored into their own test cases, with each test focusing on testing
one channel type. This is necessary to save effort for future
development.

These tests are also updated to reflect the new `blockbeat` behavior.
2024-12-20 17:54:09 +08:00
yyforyongyu
40ac04a254
lntest+itest: fix testSweepCPFPAnchorOutgoingTimeout 2024-12-20 17:54:08 +08:00
Keagan McClelland
ed2989ae33
multi: update to fn v2 2024-12-04 13:19:00 -07:00
Elle Mouton
755ad49440
build: Append commit hash to the main LND context
It can be disabled via the new `logging.no-commit-hash` config option.
2024-12-02 09:23:06 +02:00
Elle Mouton
ab7aae0708
multi: rename nolint:lll to nolint:ll
Find and replace all nolint instances refering to the `lll` linter and
replace with `ll` which is the name of our custom version of the `lll`
linter which can be used to ignore log lines during linting.

The next commit will do the configuration of the custom linter and
disable the default one.
2024-12-02 09:14:21 +02:00
Keagan McClelland
77fd8c6a21
itest+lntest: add itest for Quiesce RPC method 2024-11-26 13:52:51 -07:00
Keagan McClelland
99f5ca4018
lnrpc add new RPC 'Quiesce' to protobuf definitions 2024-11-26 13:51:57 -07:00
Carla Kirk-Cohen
774bfa740a
htlcswitch: relay experimental endorsement signal with update_add_htlc 2024-11-22 09:16:56 -05:00
Abdullahi Yunus
762d01536b multi: return txns first and last indices
In this commit we introduce first and last indices for the
tranasctions returned which can be used to seek for further
transactions in a pagination style.

Signed-off-by: Abdullahi Yunus <abdoollahikbk@gmail.com>
2024-11-22 08:22:55 +01:00
Abdullahi Yunus
cd1df4ac34 multi: modify listtxn definition
This commit modifies listtransactiondetails method definition to
take in additional params: index_offset and maxTxn
2024-11-22 08:21:27 +01:00
Elle
d14f4c7e1f
Merge pull request #9279 from ellemouton/misc
misc: nil checks and remove deprecated default values
2024-11-19 10:37:01 +02:00
Elle Mouton
90ed0fe54c
lntest: nil check edges 2024-11-18 21:09:16 +02:00
Olaoluwa Osuntokun
b9105c35e5 lntest: print node PID when launching in itests
In this commit, we start to print the PID of node's we created within an
itest. This is useful when debugging itests with `dlv` by attaching to a
given node. By printing out the PID, we facilitate such debugging
attempts.
2024-11-15 17:21:43 -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