Commit Graph

640 Commits

Author SHA1 Message Date
de6df1re
29157fe02a itest: fix payment test 2021-08-20 10:01:45 -05:00
yyforyongyu
fda66f6a43
itest: add an extra utxo when using neutrino 2021-08-19 19:35:20 +08:00
yyforyongyu
24e654ffc4
contractcourt: more verbose logging for anchor sweeping 2021-08-19 19:33:36 +08:00
Joost Jager
09386213be
htlcswitch: log link message with channel point
In lnd, log messages about channels are generally logged with a
reference to their channel point rather than the short channel id.
Channel point is reorg-resistant and also easier to look up in for
example a block explorer.

In the link however, all log messages are accompanied by short channel
id. This makes it difficult to grep a log for all channel activity. The
PEER message for example which are often crucial to analyse, are logged
with channel points.

This commit modifies the link logging to also use channel points.
2021-08-16 08:24:35 +02:00
Stevie Zollo
00f7534e06
docs: fix inconsistent naming of channel.backup [skip ci] 2021-08-12 00:26:53 +02:00
yyforyongyu
8eddc50beb
itest: remove context creations outside close channel assertion 2021-08-11 12:44:39 +08:00
yyforyongyu
2e4417454b
itest: create context with timeout in closeChannelAndAssertType 2021-08-11 12:41:57 +08:00
Olaoluwa Osuntokun
be341bcd68
Merge pull request #5528 from guggero/keep-channel-backup-local-force-close
backups: Keep channel backup in case of local force close
2021-08-10 19:31:59 -07:00
Oliver Gugger
f7943448b9
itest: fix channel open and close ntfn test
Because we now get one more update per channel when closing it, we need
to update our test that looks at the close notifications sent by the
SubscribeChannelEvent RPC.
2021-08-09 16:06:56 +02:00
Oliver Gugger
bb4c754504
itest: test local force close restore scenario
We want to make sure we can recover funds from a channel that was force
closed by the local node just before the node needed to be restored. We
add a special test case with specific assertions for that scenario.
2021-08-09 13:55:37 +02:00
Oliver Gugger
294fba0bc5
itest: fix channel backup subscription test
With one more notification event being dispatched in the local force
close case we need to update one of the integration tests to account for
the additional message.
2021-08-09 13:55:35 +02:00
Andras Banki-Horvath
0f400b2b16
itests: payments test flake fix 2021-08-06 17:37:37 +02:00
Oliver Gugger
6421fd532c
itest: fix anchor SCB sweep tests
Fixes another flake related to Neutrino and how it handles UTXOs.
2021-08-05 16:11:29 +02:00
Oliver Gugger
f68335d7e4
itest: fix flake in garbage collect test, use require
This commit uses the require library for the link nodes garbage collect
test and fixes a flake that was discovered while hunting for other
flakes. Some times the channel isn't updated fast enough so we can
detech it on first try. So we give it a few more tries to stabilize the
test.
2021-08-05 16:11:29 +02:00
Oliver Gugger
3ae2cdb003
lntest: fix commitment TX not found in mempool error
This commit fixes an old flake in the neutrino anchor output tests. It
turns out that sometimes with Neutrino we don't have enough UTXOs in our
wallet to sweep both the local and remote anchor. This is very likely a
timing issue, we need to give the wallet more time to catch up with the
chain and process all transactions to find unspent outputs.
We address this two-fold: We add an additional UTXO to Alice. And then
we also make sure we detect both UTXOs properly after restarting.
2021-08-05 16:11:28 +02:00
Oliver Gugger
5cabd980b1
lntest: make it clear that profile failure is follow-up error
From the error in the itest output log it is not clear whether scraping
the profile page caused a test to fail or whether it was just a
follow-up error. We make it a bit more clear with an added message.
2021-08-05 16:11:28 +02:00
Oliver Gugger
b149a090df
itest: update error whitelist 2021-08-05 16:11:28 +02:00
Olaoluwa Osuntokun
945c0fa0df
Merge pull request #5521 from Roasbeef/amp-test-flake-chan-open
lntest: fix possible race condition re asserting channel propagation
2021-08-04 19:21:03 -07:00
Oliver Gugger
66ed64da48
lntest: fix timing related flakes 2021-08-04 19:42:13 +02:00
Oliver Gugger
2eb0a4600f
make+itest: add tranche index to test name
To make it easier to see what tranche a failed test was running in, we
add the tranche index to the test name. This corresponds to the number
in the .logs-tranche<index> folder name so the logs can be found much
quicker.
2021-08-04 14:55:57 +02:00
Oliver Gugger
06032b3f75
itest: fix timeout issue in sweep test 2021-08-04 14:55:56 +02:00
xanoni
f5747c20ef lnwallet/wallet.go: clarify anchor chan error str
Improve 'ErrReservedValueInvalidated' error string to explain that the
error is triggered by a transaction that would deplete funds reserved for
potential future anchor channel closings (via CPFP)

Add hint that further details can be found in the debug log

Update strings in 'lntest/itest/log_error_whitelist.txt' correspondingly
2021-08-02 05:38:09 -04:00
Andras Banki-Horvath
f54c127021
itest: fix async payment benchmark timeout flakes 2021-07-27 13:57:09 +02:00
Andras Banki-Horvath
7ce3223919
harness: remove killed nodes from active nodes 2021-07-15 11:26:27 +02:00
Olaoluwa Osuntokun
6cd981420a
lntest: fix possible race condition re asserting channel propagation
In this commit, we attempt to fix a race condition that may occur in the
current AMP and MPP tests.

It appears the following scenario is possible:
  * The `mppTestContext` [is used to create 6 channels back to
    back](https://github.com/lightningnetwork/lnd/blob/master/lntest/itest/lnd_amp_test.go#L43)
  * The method used to create the channel ends up calling
    [`openChannelAndAssert`](edd4152682/lntest/itest/lnd_mpp_test.go (L300))
    which'll open the channel, mine 6 blocks, [then ensure that the
    channel gets
    advertised](edd4152682/lntest/itest/assertions.go (L78))
  * Later on, [we wait for all nodes to hear about all channels on the
    network
    level](https://github.com/lightningnetwork/lnd/blob/master/lntest/itest/lnd_amp_test.go#L62)

I think the issue here is that we'll potentially already have mined 30
or so blocks before getting to the final nodes, and those nodes may have
already heard about the channel already. This may then cause their
[`lightningNetworkWatcher`](edd4152682/lntest/node.go (L1213))
goroutine to not properly dispatch this, since it's assumed that the
channel hasn't been announced (or notified) when the method is called.

One solution here is to just check if the channel is already in the
node's graph or not, when we go to register the notification. If we do
this in the same state machine as the watcher, then we ensure if the
channel is already known, the client is immediately notified. One thing
that can help us debug this more in the future is adding additional
logging in some of these helper goroutines so we can more easily track
the control flow.

This commit implements this solution by checking to ensure that the
channel isn't already known in our channel graph before attempting to
wait for its notification, as we may already have missed the
notification before this registration request came in.
2021-07-14 20:12:00 -07:00
Olaoluwa Osuntokun
ea7ea33e24
lntest/itest: log node name in addition to ID if waitForChannels fails 2021-07-14 20:11:54 -07:00
yyforyongyu
d28e67ddb0
itest: fix make lint 2021-07-13 15:01:43 +08:00
yyforyongyu
c912d1aae0
itest: move tests into one file
This commit creates the file lnd_misc_test.go to hold all miscellaneous
tests in the file lnd_test.go. From now on, the lnd_test.go will only be
responsible for handling the "top" level functionalities such as
splitting test cases and run them. Newly created test cases should find
their places in the related test files, or create new one when needed.
2021-07-13 15:01:39 +08:00
yyforyongyu
73a2211205
itest: move helper functions into one file
This commit creates the file utils.go to hold the commonly used
functions for tests.
2021-07-13 14:59:00 +08:00
yyforyongyu
27b9273e2f
itest: move channel graph related tests into one file 2021-07-13 14:58:59 +08:00
yyforyongyu
a20f857987
itest: move balance related tests into one file 2021-07-13 14:58:59 +08:00
yyforyongyu
9337f94f0d
itest: move recovery related tests into one file 2021-07-13 14:58:59 +08:00
yyforyongyu
0759771134
itest: move channel openning related tests into one file
This commit creates the file lnd_open_channel_test.go to hold channel
opeopenning related tests.
2021-07-13 14:58:59 +08:00
yyforyongyu
12ca07c089
itest: move testFundingPersistence to lnd_funding_test.go 2021-07-13 14:58:59 +08:00
yyforyongyu
47c40373de
itest: move channel policy update test into one file 2021-07-13 14:58:58 +08:00
yyforyongyu
3f78a5da10
itest: move channel force close test into one file 2021-07-13 14:58:58 +08:00
yyforyongyu
e3f2cf1711
itest: move switch related tests into one file
This commit creates the lnd_switch_test.go file to hold switch related
tests, further breaking down the lnd_test.go file.
2021-07-13 14:58:58 +08:00
yyforyongyu
6ca068660c
itest: move revocation related tests into one file
This commit creates a new file lnd_revocation_test.go to hold
revocation-related tests, further breaking down the lnd_test.go file.
2021-07-13 14:58:56 +08:00
yyforyongyu
f62cdf7bfc
itest: move payment related tests into one file
This commit creates a new file lnd_payment_test.go to hold all payment
related tests, further breaking down the old large lnd_test.go.
2021-07-13 14:52:08 +08:00
yyforyongyu
b657a977e3
itest: refactor assertNumConnections to use wait.NoError
This commit refactors the function assertNumConnections to use
wait.NoError. Prior to this commit, `make lint` will fail on this
function. While fixing it, it's noticed that wait.NoError suits the
case so it's refactored to use it.
2021-07-13 14:52:08 +08:00
yyforyongyu
0612ced087
itest: use require in assertions 2021-07-13 14:52:08 +08:00
yyforyongyu
6f0da73ee1
itest: move assertions into one file
This commit breaks down the lnd_test.go file by moving assertion-related
functions into the file assertions.go.
2021-07-13 14:52:08 +08:00
Joost Jager
98e75b486d
itest: add db backend flag 2021-07-05 10:10:02 +02:00
Joost Jager
387f1ef274
lntest: abstract db backup and restore 2021-07-05 09:20:19 +02:00
Olaoluwa Osuntokun
39ac0ebe41
lntest/itest: add new whitelisted error 2021-07-01 18:26:04 -07:00
Olaoluwa Osuntokun
6d5ab035c5
Merge pull request #5280 from champo/interceptor_dont_leak_htlcs
htlcswitch: set sourceRef when resolving packets through interceptor
2021-07-01 17:35:26 -07:00
Juan Pablo Civile
6e4528515e lntest/itest: verify HTLC interceptor renotification bug 2021-06-30 09:42:52 -03:00
yyforyongyu
7c64e0445a
itest: test anchor sweep with commitment deadline 2021-06-29 20:30:53 +08:00
yyforyongyu
26858da59d
itest: change feeServiceTarget to be 1 2021-06-29 20:25:47 +08:00
yyforyongyu
a77225ba9e
itest: allow set fee rate with conf target
In this commit, we add a method in fee service to allow specifying a fee
rate with a conf target.
2021-06-29 20:25:47 +08:00