Commit Graph

1164 Commits

Author SHA1 Message Date
Oliver Gugger
fd7fe2ae5a
itest: use SendCoinsUnconfirmed in funding test 2022-05-10 18:39:45 +02:00
Oliver Gugger
e27a9fec66
lntest: rename sendCoins to SendCoinsOfType 2022-05-10 18:31:18 +02:00
Oliver Gugger
5d8fba6810
Merge pull request #6502 from bhandras/musig-fix
signer: fix crash in `MuSig2Combine` when the final signature isn't ready
2022-05-06 13:24:27 +02:00
Andras Banki-Horvath
ddf0571031
itest: cover musig2 combine without all signatures ready 2022-05-06 12:29:32 +02:00
Olaoluwa Osuntokun
0ec88b5346
Merge pull request #6347 from yyforyongyu/5388-rm-revc-log
lnwallet+channeldb: store minimal info in revocation log bucket
2022-05-05 15:52:59 -07:00
Oliver Gugger
52e42fc107
lnrpc+itest: implement MuSig2Cleanup RPC 2022-05-04 19:23:58 +02:00
Oliver Gugger
95ff670c0e
multi: add MuSig2Cleanup method to MuSig2 signer 2022-05-04 19:23:58 +02:00
eugene
f7b3da4bb2
htlcswitch+lntest: modify Switch to persist resolution messages
Include unit tests for the Switch, and integration tests that
exercise the persistence logic.
2022-04-29 16:40:19 -04:00
Oliver Gugger
63e93ae572
itest: add taproot SignOutputRaw Bip86 signing test 2022-04-29 11:42:46 +02:00
Oliver Gugger
3ba6421d5c
itest: add MuSig2 end-to-end tests 2022-04-29 11:42:43 +02:00
Oliver Gugger
e31aab5af6
multi: fix inclusion proof size
The inclusion proof field in the TapscriptPartialReveal function was
incorrect. An inclusion proof can be zero or more elements of 32-byte
slices. So an empty inclusion proof can be valid too for a tree that
only consists of a single leaf.
2022-04-29 11:41:09 +02:00
Oliver Gugger
f7275c7fc4
multi: implement MuSig2 RPCs and remote signing 2022-04-29 11:41:09 +02:00
Oliver Gugger
fee2b28d1b
itest: refactor taproot test 2022-04-29 11:41:05 +02:00
Turtle
8d11a90d72 itest: test config option for picking particular peers 2022-04-19 12:37:44 -05:00
yyforyongyu
f42d1f2d62
multi: remove function BalancesAtHeight
This commit deletes the function `BalancesAtHeight` since its only
usague is to find the push amount, which can be achieved by saving the
initial balances.
Another reason to remove it is to pave the way to incooperate our new
revocation log. If we ever need this function again, we can add it back
by visiting all the revocation logs to calculate the balances at a given
height.
2022-04-20 01:18:13 +08:00
Oliver Gugger
1e72d6737d
lnrpc+itest: fix panic with missing UTXO info
Fixes #6396.
This commit fixes a panic that occurred when trying to sign for a
Taproot output without specifying the full UTXO information for each
input. Instead of panicking an error is now returned.
2022-04-12 19:30:12 +02:00
positiveblue
ae2aa5671f
lnrpc/peers: handle feature bit changes in updateNodeAnnouncement 2022-04-02 19:10:25 -07:00
positiveblue
76196db70e
lnrpc/peers: handle net address changes in updateNodeAnnouncement 2022-04-02 19:09:10 -07:00
positiveblue
aacb2565f5
lnrpc/peers: handle color changes in updateNodeAnnouncement 2022-04-01 18:36:26 -07:00
positiveblue
ce4813940d
lnrpc/peers: handle alias changes in updateNodeAnnouncement 2022-04-01 18:36:26 -07:00
positiveblue
e4e0935816
lnrpc/peers: skeleton logic for updateNodeAnnouncement
Basic logic for the endpoint:

- Get the current nodeAnn information
- Calculate modifications
- Apply modifications
- Return changes
2022-04-01 18:36:21 -07:00
Oliver Gugger
3b5585c12b
multi: fix and test v1 output spend ntfns
Because Taproot key spend only spends don't allow us to re-construct the
spent pkScript from the witness alone, we cannot support registering
spend notifications for v1 pkScripts only. We instead require the
outpoint to be specified. This commit makes it possible to only match by
outpoint and also adds an itest for it.
2022-03-24 18:02:40 +01:00
Oliver Gugger
ef98f2df8a
multi: add p2tr tapscript key path signing capabilities 2022-03-24 18:02:39 +01:00
Oliver Gugger
78db46be7e
multi: add p2tr tapscript signing capabilities 2022-03-24 18:02:39 +01:00
Oliver Gugger
5109c55721
itest: assert P2TR on-chain fund recovery 2022-03-24 18:02:38 +01:00
Oliver Gugger
c73cf03a55
multi: add p2tr keyspend wallet support 2022-03-24 18:02:38 +01:00
Oliver Gugger
0dcaa511a2
Merge pull request #6341 from guggero/remote-signer-signoutputraw
remote signer: fix SignOutputRaw RPC for incomplete key info, fix healthcheck connection leak
2022-03-24 14:59:38 +01:00
Oliver Gugger
42b0aa9a8e
rpcwallet+itest: fix incomplete key info problem
Fixes an issue with SignOutputRaw in remote signing mode where we
weren't able to sign on the remote signer if we only provided the public
key or only the family/index (and not both).

Fixes part of an issue detected in lightninglabs/loop#457.
2022-03-24 14:13:05 +01:00
Oliver Gugger
efa36ce8f2
lntest+lnwallet: add AddressInfo to WalletController
We need to be able to query the watch-only wallet about a public key
when trying to sign with a key that we don't know the family or index
of. The easiest way to do that is to leverage the wallet's address index
to query the derivation path for a public key.
To give the RPC wallet access to that functionality, we need to expose
the method on the WalletController interface.
2022-03-24 14:13:05 +01:00
Oliver Gugger
e86a0ba197
itest: add new test for SignOutputRaw RPC 2022-03-24 14:13:04 +01:00
Liviu
57cb9d09da itest: fix node shutdown in interceptor itests 2022-03-23 19:45:45 -07:00
Andras Banki-Horvath
0e4d7cf143
itest: make use of session ttl in failover test 2022-03-22 14:20:40 +01:00
Olaoluwa Osuntokun
e5625878e9
lntest/itest: add new itest for 3rd party anchor spends
In this commit, we add a new integration tests to exercise the fix
introduced in the prior commit. In this test, we reconstruct a scenario
for a 3rd party to sweep an anchor spend after force closing, causing a
prior spend we had to be invalidated. Without the prior commit, this test
fails as the original anchor sweep is still found in the wallet.
2022-03-17 16:36:49 -07:00
Olaoluwa Osuntokun
e1e9de24df
sweep: remove all unconfirmed descendant transactions when a sweep conflicts
Before this commit, we we were trying to sweep an anchor output, and
that output was spent by someone else (not the sweeper), then we would
report this back to the original resolver (allowing it to be cleaned
up), and also remove the set of inputs spent by that transaction from
the set we need to sweep.

However, it's possible that if a user is spending unconfirmed outputs,
then the wallet is holding onto an invalid transaction, as the outputs
that were used as inputs have been double spent elsewhere.

In this commit, we fix this issue by recursively removing all descendant
transactions of our past sweeps that have an intersecting input set as
the spending transaction. In cases where a user spent an unconfirmed
output to funding a channel, and that output was a descendant of the now
swept anchor output, the funds will now properly be marked as available.

Fixes #6241
2022-03-17 16:36:47 -07:00
Oliver Gugger
7dfe4018ce
multi: use btcd's btcec/v2 and btcutil modules
This commit was previously split into the following parts to ease
review:
 - 2d746f68: replace imports
 - 4008f0fd: use ecdsa.Signature
 - 849e33d1: remove btcec.S256()
 - b8f6ebbd: use v2 library correctly
 - fa80bca9: bump go modules
2022-03-09 19:02:37 +01:00
yyforyongyu
e4d9551a6a
itest: check feeService against nil upon shutdown [skip ci] 2022-02-22 13:16:06 +08:00
Oliver Gugger
13f187046b
multi: fix issues reported by whitespace linter 2022-02-15 16:26:08 +01:00
Oliver Gugger
895a2e497b
multi: formatting and comment fixes 2022-02-10 11:02:02 +01:00
Oliver Gugger
ffee7d1bcf
multi: fix newly detected linter issues 2022-02-10 11:02:02 +01:00
Oliver Gugger
dfdc2bff8b
multi: run gosimports 2022-02-10 11:02:01 +01:00
carla
4ac6f82b5e
itest: fix lack of hop hint coverage in hold invoice test
Update our test to assert that we have hop hints present when we
expect them, and fix the "alice is a private node" issue that was
previously preventing us from adding hop hints. Asserting that we
have hop hints present in this itest ensures that we'll fail our
itests if a change to SelectHopHints results in our no longer
having hints in this secnario.
2022-02-07 09:03:09 +02:00
Oliver Gugger
8d3d8580f9
Merge pull request #6197 from carlaKC/itest-policy-ensureconnected
lntest/test: ensure nodes connected before disconnecting
2022-01-27 13:20:13 +01:00
Oliver Gugger
bc3319a7d2
lntest: set --lnddir instead of --datadir
If we only set the --datadir flag then lnd will create empty directories
(for letsencrypt and watchtower client) in the default user's home .lnd
directory and will also pick up a config file from there if one exists.
To instruct lnd to only act within the temp itest directory, we need to
use the --lnddir flag instead.
Using the --lnddir flag also overwrites the TLS cert/key path and the
log dir, so we don't need to explicitly set those anymore.
But we need to make sure the node's variables point to the correct
default files/directories.
2022-01-26 11:37:10 +01:00
Andras Banki-Horvath
9591e058ea itest: add test for the channel policy fee rate round down bug 2022-01-25 15:58:43 -08:00
carla
5e8f86a9b6
lntest/test: ensure nodes connected before disconnecting [skip ci] 2022-01-25 14:42:11 +02:00
Olaoluwa Osuntokun
234fdc6c9c
Merge pull request #6185 from sangaman/rpc-middleware-custom-caveat
rpcperms: set CustomCaveatCondition on middleware req
2022-01-24 15:45:49 -08:00
Daniel McNally
4a573b18cf
rpcperms: set CustomCaveatCondition on middleware req
This sets the `CustomCaveatCondition` value on rpc middleware requests
if one exists. Previously, this value was always blank even if the
macaroon had a value set for its custom caveat condition.
2022-01-24 11:39:07 -05:00
Oliver Gugger
1482e5e20a
Merge pull request #6156 from rex4539/typos
multi: Fix typos
2022-01-24 13:24:49 +01:00
Dimitris Apostolou
530a2059e5
multi: Fix typos [skip ci] 2022-01-24 12:19:02 +02:00
zdebra
6baf7af79e itest: fix documentation for LookupNodeByPub [skip ci] 2022-01-23 18:00:24 +01:00
naveen
87a0e52464
multi: Removed deprecated interfacer linter
Removed the deprecated interfacer linter from being called for linting.

Also removed the `nolint:interfacer` within the code.

https://github.com/lightningnetwork/lnd/issues/5741
2022-01-11 14:08:18 +01:00
naveen
545e84f4ce
multi: formatting changes 2022-01-11 14:08:17 +01:00
MrManPew
0f167fd03e
config: better error message if config file doesn't exist 2022-01-11 14:08:17 +01:00
Harsha Goli
baf6977948
Revert "lntest: export attributes of type BitcoindBackendConfig"
[skip ci]

This reverts commit eccf20c5b2.
2022-01-10 14:49:29 -05:00
Harsha Goli
69ae56ad5c
lntest: surface bitcoin backend rpc credentials
[skip ci]
2022-01-10 14:49:10 -05:00
Olaoluwa Osuntokun
fd63301dc5
Merge pull request #6006 from guggero/remote-signer-no-chain
Allow remote signer to run without chain backend
2022-01-07 17:37:16 -08:00
Oliver Gugger
afc53d1c52
lnwallet: initialize first 255 accounts
This fixes lightninglabs/loop#437 by adding all accounts that are used
in liquidity products such as Loop or Pool. Since both of these products
use key families below 255, we can get by with that number.
The alternative to creating way too many accounts (which increases the
default wallet size by ~250kB) would be to hard code the exact accounts
used by Loop (99) and Pool (210). But that sounds like a bad idea given
that there could always be more accounts being added to those (or other)
products. By making sure the first 255 accounts exist, we have a lot
more flexibility in those products for choosing key families.
2022-01-06 14:35:26 +01:00
Oliver Gugger
3d353a9879
config_builder+rpcwallet: simplify RPC signing
With the remote signing instance now not needing to know anything about
addresses or current derivation indices, we don't need to forward any
such calls to that instance and can simplify the RPCKeyRing
considerably.
2022-01-06 14:35:24 +01:00
Oliver Gugger
8994d86a1d
walletrpc+itest: add SignPsbt RPC 2022-01-06 14:35:07 +01:00
Oliver Gugger
d135b638f6
btcwallet: add SignPsbt 2022-01-06 13:24:32 +01:00
Oliver Gugger
8c77829c46
lnwallet+lntest+mod: bump btcwallet to export ScriptForOutput 2022-01-06 13:24:30 +01:00
Oliver Gugger
9da8333a6e
multi: fix formatting 2022-01-06 13:24:30 +01:00
Oliver Gugger
5401b12402
lntest: export base node config for re-use 2022-01-06 12:58:27 +01:00
Oliver Gugger
8c3f2eaba0
lntest: export ListenerFormat constant 2022-01-06 12:57:27 +01:00
Oliver Gugger
5afe7852b5
lntest: fix colliding variable name
The variable name "bytes" collides with an imported package name, so we
rename it to avoid shadowing.
2022-01-06 12:57:27 +01:00
Oliver Gugger
10d876ae98
itest: fix RPC middleware itest 2022-01-06 15:01:02 +08:00
yyforyongyu
587273174e
itest: start using harness miner in harness net
This commit replaces the old miner with the new HarnessMiner and cleans
harness_node.go by moving methods into the test_common.go.
2022-01-05 13:10:06 +08:00
yyforyongyu
337aa6670b
itest: introduce harness miner
This commit adds a new component, harness miner, to the itest. This
newly added component is responsible for checking the mempool and blocks
for the itest.
2022-01-05 13:10:06 +08:00
yyforyongyu
61d6f5da11
itest: refactor initClientWhenReady to clean up init node 2022-01-05 13:10:05 +08:00
yyforyongyu
75da5cabc8
itest: add method waitTillServerState in harness node 2022-01-05 13:10:05 +08:00
yyforyongyu
f5f1289dab
itest: use node.rpc namespace inside harness net
This commit adds a new struct RPCClients to better handle rpc clients.
A private field, rpc, is added to HarnessNode to prevent direct access
to its clients. Inside RPCClients, all clients are exported in case a
test case need access to a specific client.
2022-01-05 13:10:05 +08:00
yyforyongyu
f8cf7c8775
itest: shorten functions inside harness node
This commit refactors the long function start() into smaller pieces and
moves commonly used functions into test_common.go.
2022-01-05 13:10:05 +08:00
Martin Habovstiak
2b3b70d40b test: don't enforce reserved value in PSBT midstep
This adds an integration test that makes sure channel can be funded from
empty wallet using PSBT if the funding transaction contains an output
belonging to the wallet, satisfying the reserve.
2021-12-10 00:22:17 +01:00
Oliver Gugger
c75c3bd847
Merge pull request #5756 from yyforyongyu/itest-1-run-ctx
itest: refactor context management inside harness node and net
2021-12-07 13:14:27 +01:00
yyforyongyu
05ac516762
itest: replace fakeLogger with v2 logger with Discard 2021-12-04 14:54:37 +08:00
yyforyongyu
403fdaa716
itest: use run context when making rpc requests 2021-12-04 14:54:37 +08:00
yyforyongyu
bd521dd2f0
itest: rename harness net file and add run context
This commit renames harness.go to harness_net.go. It also adds a run
context which is served as the parent context when creating new
contexts.
2021-12-04 14:54:37 +08:00
yyforyongyu
26ed64fa52
itest: manage context within HarnessNode
This commit removes the context as a param needed when calling methods
of HarnessNode. This change moves the context management inside
HarnessNode, aside from saving us a few lines, it makes the context
creation/timeout less error-prone.
2021-12-04 14:54:36 +08:00
yyforyongyu
6f59f41e86
itest: use ProcessState and runCtx to control process quit 2021-12-04 14:54:36 +08:00
yyforyongyu
f81bcdf4db
itest: add run context to harness node
This commit adds a running context to HarnessNode which replaces all the
background context used and also serves as a way to signal quit when the
test is shutting down.
2021-12-04 14:54:36 +08:00
yyforyongyu
98d7e64dc1
itest: add test_common to hold commonly used methods
A new file, test_common.go, is added to hold commonly used functions
across lntest.
2021-12-04 14:54:36 +08:00
Harsha Goli
eccf20c5b2
lntest: export attributes of type BitcoindBackendConfig
Allows these values to be accessed upstream
2021-12-03 13:03:36 -05:00
Oliver Gugger
54a25146f4
rpcperms: add unique request ID
This commit adds a unique request ID that is the same for each gRPC
request and response intercept message or each request/response message
of a gRPC stream.
2021-11-08 15:01:26 +01:00
Oliver Gugger
9a28a4a9ff
lnrpc+rpcperms+lntest: add unique MW message ID
This commit adds a new unique intercept message ID that is different for
each message sent to an RPC middleware. This will allow us to re-purpose
the existing request ID field into its original intention, which was to
have a unique ID for a full gRPC request/response pair or gRPC stream as
a whole.
2021-11-08 15:00:29 +01:00
Olaoluwa Osuntokun
67e18e6089
rpc: optimize DescribeGraph by caching the response
Unfortunately, we can't use the graph cache directly here as it doesn't
include all the information we need, since it only includes the minimal
amount of information needed for path finding.

Instead, we use a simple mutex guarded cache that evicts itself after a
certain interval. The default is set small enough that most users
shouldn't really notice. We also provide a way to disable the cache, and
also disable the cache in the itests.

Fixes https://github.com/lightningnetwork/lnd/issues/1232
2021-11-04 15:30:31 -07:00
Oliver Gugger
eb2be7c7c0
lntest: count unconfirmed balance as well
It looks like in some cases (apparently mostly on Windows) a previous
sub test sometimes leaves some unconfirmed balance in the wallet. That
balance is confirmed in the next test when new coins are sent to the
wallet.
2021-11-02 20:36:45 +01:00
Oliver Gugger
2a6f128a43
itest: wait for channel to be properly closed
It looks like in some cases a channel is still being closed while we
already try to create a sweep output. In that case the pending closed
channel is still counted as anchor channel and a reserve output is
created. To make sure that doesn't happen, we make sure there are no
pending or open channels of any kind around before we create the sweep
transaction.
2021-11-02 20:36:27 +01:00
Oliver Gugger
2ca3eea3f7
itest: fix REST WebSocket ping/pong itest
This commit fixes a flake in the REST itest that was caused by an
invoice being created before the actual subscription client was
registered.
2021-11-02 20:36:26 +01:00
Olaoluwa Osuntokun
66ca2a994b
Merge pull request #5901 from Roasbeef/dedup-interceptor
Dedup interceptor
2021-10-28 17:44:49 -07:00
Roei Erez
fe44aedb25
itest: dedup interceptor packets
Aded a test for the dedup intercepted packets of htlc interceptor.
2021-10-28 16:16:55 -07:00
Olaoluwa Osuntokun
a5ae7fbf9c
lntest: add new itest for repeated payments to the same AMP invoice 2021-10-28 15:50:35 -07:00
Olaoluwa Osuntokun
0a3bc3ee3d
Merge pull request #5840 from guggero/bolt-pathfinding-fallback
db: allow turning off in-memory graph cache for bbolt
2021-10-25 14:24:10 -07:00
Oliver Gugger
27632daa98
itest: test path finding without cache 2021-10-22 09:32:50 +02:00
Oliver Gugger
423de4d79a
itest: defer close of done channel
The testing framework uses runtime.Goexit() when a test fails which
still allows the defer calls to execute. That's why we should use defer
to close the done channel to allow all goroutines to exit properly.
2021-10-21 11:09:52 +02:00
Wilmer Paulino
e891dd0fd3
itest: test backup restore of script enforced lease channel type 2021-10-19 18:30:53 -07:00
Wilmer Paulino
974fc346cf
itest: update itests to use new script-enforced lease commitment type
We update several of our integration tests that exercise different
scenarios with regards to the broadcast of a channel commitment
transaction with HTLCs in-flight to use the new commitment type for
channel leases. We do this to ensure we have complete coverage of said
channel commitment type. This required changing several assumptions
throughout the tests based on when we should expect sweeps to happen.
2021-10-19 18:30:48 -07:00
Olaoluwa Osuntokun
94b7b71809
Merge pull request #5689 from guggero/remote-signer
Support remote signing over RPC
2021-10-18 18:39:17 -07:00
Oliver Gugger
a6ea019f56
lntest: add itest for remote signing 2021-10-14 16:14:49 +02:00
Oliver Gugger
36dc4b3abf
itest: refactor tests to be re-used 2021-10-14 15:42:59 +02:00
Oliver Gugger
a3addcc927
multi: forward SendCoins call over RPC 2021-10-14 15:42:52 +02:00
Oliver Gugger
6093393e2f
multi: refactor SignMessage to specify hashing 2021-10-14 15:42:44 +02:00
Oliver Gugger
5d7e814ea8
Merge pull request #5674 from torkelrogstad/2021-08-26-http-mux
lntest: avoid global ServeMux
2021-10-13 10:45:57 +02:00
Oliver Gugger
e79d59dd4c
multi: use key locator for lnwallet.MessageSigner
To simplify the message signing API even further, we refactor the
lnwallet.MessageSigner interface to use a key locator instead of the
public key to identify which key should be signed with.
2021-10-08 12:06:52 +02:00
Oliver Gugger
afa03f22cc
multi: use key locator only for signing messages
To simplify the API surface of a remote signer even more, we refactor
the SignMessage and SignMessageCompact calls to only accept a key
locator as we always know what key we're using for signing anyway.
2021-10-08 12:06:52 +02:00
Oliver Gugger
8b7c88537c
multi: refactor SignDigestCompact into SignMessageCompact
To make it possible to use a remote lnrpc server as a signer for our
wallet, we need to change our main interface to sign the message instead
of the message's digest. Otherwise we'd need to alter the
lnrpc.SignMessage RPC to accept a digest instead of only the message
which has security implications.
2021-10-08 12:06:52 +02:00
Oliver Gugger
02757f6735
multi: refactor SignDigest into SignMessage
To make it possible to use a remote signrpc server as a signer for our
wallet, we need to change our main interface to sign the message instead
of the message's digest. Otherwise we'd need to alter the
signrpc.SignMessage RPC to accept a digest instead of only the message
which has security implications.
2021-10-08 12:06:51 +02:00
Oliver Gugger
0fac6c400e
itest: wait for node to fully start up 2021-10-06 16:29:49 +02:00
Oliver Gugger
e9c9ec2e84
itest: exit goroutines on error 2021-10-06 16:29:44 +02:00
Oliver Gugger
c89637a4e2
itest: fix close of closed channel panic 2021-10-05 20:48:48 +02:00
Oliver Gugger
6bc0862fdf
itest: fix commitment_deadline context expired flake 2021-10-05 20:48:48 +02:00
Oliver Gugger
bedba02a2d
itest: enable slow mining by default
We now redirect the mineBlocks function to the mineBlocksSlow function
which waits after each mined block. To reduce the overall time impact of
using that function everywhere, we only wait 20 milliseconds instead of 50ms
after each mined block to give all nodes
some time to process the block. This will still slow down everything by a bit
but reduce flakes that are caused by different sub systems not being
up-to-date.
2021-10-05 20:48:47 +02:00
Oliver Gugger
98061dfd58
mod+lntest: disable stall handler in btcd mining node
The latest version of btcd allows its stall handler to be disabled. We
use that new config option to make sure the mining btcd node and the lnd
chain backend btcd node aren't disconnected if some test takes too long
and no new p2p messages are exchanged.
2021-10-05 20:48:47 +02:00
Elle Mouton
da64a24ad8
server: update persistent peer addrs from announcements
In this commit, a subscription is made to topology updates. For any
NodeAnnouncements received for our peristent peers, we store their newly
advertised addresses. If at the time of receiving these new addresses
there are any existing connection requests, these are updated to reflect
the newly advertised addresses.
2021-10-04 14:57:50 +02:00
Elle Mouton
6b5b53d517
lntest: show reconnection bug
In this commit we demonstrate a bug to show that if an inbound peer
changes their listening address to one not advertised in their original
NodeAnnouncement then we will not be able to reconnect to them. This bug
will be fixed in a follow-up commit.
2021-10-04 14:57:50 +02:00
Elle Mouton
d639a4d73f
server+lntest: use all addrs during reconnect
In this commit, all advertised addresses of a peer are used during
reconnection. This fixes a bug previously demonstrated in an itest.
2021-10-04 14:57:50 +02:00
Elle Mouton
18909e1a8e
lntest: show that multi addresses are not used
This commit adds an itest to demonstrate that if a peer advertises
multiplie external IP addresses, then they will not all be used to
reconnect to the peer during reconnection. This will be fixed in a
follow-up commit.
2021-10-04 14:57:49 +02:00
Elle Mouton
5177ec2f84
lntest: create persistent connection
This commit adds a ConnectNodesPerm function to the itest NetworkHarness
so that persistent connections between nodes can be mocked.
2021-10-04 14:57:49 +02:00
Elle Mouton
9a97577c00
lntest: refactor assertNumConnections
The assertNumConnection function currently takes in an 'expected' number
of connections argument and asserts that both alice and bob only each
only have that number of connections. So this fails to be useful if say
alice is also connected to charlie cause then if we call
assertNumConnections between alice and bob it will fail saying there are
2 connections between them since all it does is count alice's total
  number of connections. This commit replaces this function with 2 new
functions: assertConnected which asserts that at least one connection
exists between two peers and assertNotConnected which asserts that no
connections exists between the two peers.
2021-10-04 14:57:48 +02:00
Oliver Gugger
51d19dad87
Merge pull request #5363 from guggero/psbt-no-final-tx
Allow skipping `PsbtFinalize` step during channel funding to support external broadcast
2021-10-04 12:37:51 +02:00
Oliver Gugger
692ea25295
Merge pull request #5642 from guggero/in-memory-graph
In-memory graph cache for faster pathfinding
2021-10-04 11:20:23 +02:00
Oliver Gugger
57253c0c05
itest: add test for fully external PSBT funding 2021-10-04 11:17:08 +02:00
Olaoluwa Osuntokun
32fa48df7d
Merge pull request #5770 from Crypt-iQ/dust_threshold_0619
lnwallet+htlcswitch: make Switch dust-aware
2021-09-30 20:20:19 -07:00
eugene
702b3a3258
multi: introduce config-level DustThreshold for defining threshold 2021-09-30 13:44:35 -04:00
Oliver Gugger
0b4e03f5fc
multi: add golang 1.17 compatible build tags
With go 1.17 a change to the build flags was implemented:
https://go.googlesource.com/proposal/+/master/design/draft-gobuild.md

The formatter now automatically adds the forward-compatible build tag
format and the linter checks for them, so we need to include them in our
code.
2021-09-29 17:31:37 -07:00
Oliver Gugger
7aa9661d42
lntest: use errgroup for node startup
This commit fixes a nil pointer issue when a node fails to start up.
Because require.NoErrorf() doesn't abort a test immediately if run
inside a goroutine, this lead to the test continuing with nil node
references which lead to a panic later on.
2021-09-29 17:31:32 -07:00
Olaoluwa Osuntokun
dd4cf268a0
Merge pull request #5804 from guggero/itest-setup-error
lntest: use errgroup for node startup [skip ci]
2021-09-29 17:31:17 -07:00
eugene
fdcd726f9a
multi: replace DefaultDustLimit with script-specific DustLimitForSize
This commit updates call-sites to use the proper dust limits for
various script types. This also updates the default dust limit used
in the funding flow to be 354 satoshis instead of 573 satoshis.
2021-09-29 13:33:10 -04:00
Oliver Gugger
493262e253
itest: fix flake in update_channel_status itest
This commit fixes a flake in the channel status update itest that
occurred if Carol got a channel edge update for a channel before it
heard of the channel in the first place. To avoid that, we wait for
Carol to sync her graph before sending out channel edge or policy
updates.

As always when we touch itest code, we bring the formatting and use of
the require library up to date.
2021-09-29 17:50:01 +02:00
Oliver Gugger
5aeb728f80
lntest: use errgroup for node startup
This commit fixes a nil pointer issue when a node fails to start up.
Because require.NoErrorf() doesn't abort a test immediately if run
inside a goroutine, this lead to the test continuing with nil node
references which lead to a panic later on.
2021-09-29 11:57:53 +02:00
yyforyongyu
c525c3d34e
itest: test wipe forwarind packages 2021-09-23 13:24:11 +08:00
Joost Jager
daeb96fe0a
postgres: add itest 2021-09-21 10:44:23 +02:00
Olaoluwa Osuntokun
9264185f5b
Merge pull request #5101 from guggero/macaroon-interceptor
Add macaroon based RPC middleware interceptor
2021-09-20 19:15:04 -07:00
Oliver Gugger
4b43e977b2
lntest: add RPC middleware itests 2021-09-20 17:04:39 +02:00
Oliver Gugger
0cc260bfc7
itest: add _test suffix to test file 2021-09-20 17:04:38 +02:00
Oliver Gugger
045765111a
multi: use safe copy for macaroons
Fixes #4383 by adding a new SafeCopyMacaroon function that correctly
clones all caveats and prevents modifications on the copy from affecting
the original.
2021-09-20 13:05:46 +02:00
Oliver Gugger
4b7452a35e
lnrpc+itest: fix write deadline issue with WS ping
Fixes #5680.
To make sure we're always reading from the WebSocket connection, we need
to always have an ongoing (but blocking) conn.ReadMessage() call going
on. To achieve this, we do the read in a separate goroutine and write to
a buffered channel. That way we can always read the next message while
the current one is being forwarded. This allows incoming ping messages
to be received and processed which then leads to the deadlines to be
extended correctly.
2021-09-20 12:21:03 +02:00
yyforyongyu
66dae6ecf7
itest: put node.CloseChannel inside wait 2021-09-17 07:50:44 +08:00
yyforyongyu
7038d0e5c8
itest: fix typo 2021-09-17 07:50:43 +08:00
yyforyongyu
cdec34c5f7
itest: remove the method waitForChannelUpdate
This commit removes the method waitForChannelUpdate, and uses
node.WaitForChannelPolicyUpdate instead.
2021-09-17 07:50:43 +08:00
yyforyongyu
06fa17513c
itest: move tests by their category 2021-09-17 07:50:43 +08:00
yyforyongyu
87c13d31b4
itest: watch channel policy updates in harness node 2021-09-17 07:50:43 +08:00
yyforyongyu
d2277ac915
itest: replace chanOpen bool with chanWatchType 2021-09-17 07:50:42 +08:00
yyforyongyu
a58543d1c7
itest: remove extra graph topology subscription 2021-09-17 07:50:42 +08:00
yyforyongyu
92cd6657c5
lntest: refactor handle close channel update 2021-09-17 07:50:42 +08:00
yyforyongyu
0701834a5d
lntest: refactor handle update open channel 2021-09-17 07:50:42 +08:00
yyforyongyu
a1024163fe
itest: add more verbose log and print node state 2021-09-17 07:50:42 +08:00
Turtle
0120c86687
itest: Test new RPC call for checking macaroon permissions 2021-09-14 16:27:02 -05:00
Turtle
ba17842e34
itest: Test new BakeMacaroonRequest for allowing external permissions 2021-09-14 16:27:02 -05:00
Joost Jager
3827d15ca6 lntest/itest: fix SendPaymentAMP test 2021-09-14 18:53:17 +02:00
yyforyongyu
c4913e6f4a
itest: require server being started when creating node
We now require the lnd to be fully started when creating a new node
using newNode.
2021-09-14 07:34:10 +08:00
Andras Banki-Horvath
9bf04f9870
itest+etcd: save etcd logs along the node logs 2021-09-10 14:40:57 +02:00
Andras Banki-Horvath
6c2d8bb176
etcd: enable optional log file for embedded etcd log output
In this commit we add an extra config for enabling logging to an
external file when using embedded etcd. This can be useful when running
integration tests to see more details about etcd related issues.
2021-09-10 14:40:54 +02:00
Oliver Gugger
7a9ee48cf1
itest: add batch funding test 2021-09-03 18:39:45 +02:00
Wilmer Paulino
523eef5cf4
lntest: use explicit channel commitment negotiation for multi-hop itests 2021-08-30 19:17:42 -07:00
Wilmer Paulino
449f207217
lntest: replace commitType type with rpc alternative 2021-08-30 19:17:39 -07:00
Torkel Rogstad
d6045a0fd5 lntest: avoid global ServeMux
Using the default, global ServeMux prevents the same process from
calling `lntest.NewNetworkHarness` multiple times, because we get a
panic when registering HTTP routes.

Instead, we use the ServeMux beloning to the fee service struct.
2021-08-27 11:30:01 +02:00
Oliver Gugger
23cd231483
Merge pull request #4717 from guggero/xprv-wallet-init
walletunlocker: Allow wallet to be created from extended master root key (xprv)
2021-08-24 13:01:41 +02:00
Oliver Gugger
c74c46147f
Merge pull request #5646 from yyforyongyu/fix-context-leak
itest: properly handle the creation of timeout context
2021-08-24 10:44:36 +02:00
Oliver Gugger
0822573743
itest: test wallet recovery from extended master root key
We add an additional test case to the on-chain fund recovery test that
tries restoring the same wallet from the extended master root key
instead of the seed.
2021-08-24 10:37:34 +02:00
Oliver Gugger
3fd944e7e4
lntest: allow node restore by extended root key
To allow testing restoring a node from an extended master root key, we
add an extra argument to the RestoreNodeWithSeed function.
2021-08-24 10:37:33 +02:00
yyforyongyu
104b7a09db
itest: fix inheritance when creating timeout ctxt
This commit fixes the issue where a wrong context being inherited to
create a timeout context. When a parent context timed out, all its
children contexts also timed out, even the children contexts had a
larger timeout value. This means it only makes sense to inherite from a
parent when its children have smaller timeout value. Given the setup of
the itest, all the timeout contexts need to be created from a context
background(hence no timeout on the parent) unless there's an explicit
timeout bound we want to set.
2021-08-24 12:28:40 +08:00
yyforyongyu
edffd65e92
itest: manage context timeout in utils.go
This commit finishes moving the context management into utils.go.
2021-08-24 12:28:40 +08:00
yyforyongyu
a6c5255e77
itest: manage context timeout inside completePaymentRequests 2021-08-24 12:28:39 +08:00
yyforyongyu
5a94919b7e
itest: manage context timeout inside network harness
This is the last commit to refactor the context management such that all
the timeout are managed inside the network harness.
2021-08-24 12:28:35 +08:00
yyforyongyu
d9e9238b0c
itest: make WaitForTxInMempool a private method 2021-08-24 12:16:46 +08:00
yyforyongyu
16403da91e
itest: manage context in CloseChannel and AssertChannelExists 2021-08-24 12:16:46 +08:00
yyforyongyu
3e26d77f91
itest: manage context inside WaitForChannelOpen and WaitForChannelClose 2021-08-24 12:16:46 +08:00
yyforyongyu
1629858a3d
itest: manage context inside assertions - II
This commit continues moving context management into assertions.
2021-08-24 12:16:40 +08:00
yyforyongyu
02e4c3ad4c
itest: manage context inside assertions - I
This commit changes the methods assertTxLabel, assertReports,
assertSweepFound, and sendAndAssertSuccess to manage their own context
with deadline.
2021-08-24 11:17:20 +08:00
yyforyongyu
74f8fe482d
itest: manage context inside EnsureConnected 2021-08-24 11:06:44 +08:00
yyforyongyu
d10d1e3e24
itest: manage context inside SendCoins 2021-08-24 11:06:44 +08:00
yyforyongyu
8de495b96b
itest: initialize context inside ConnectNodes 2021-08-24 11:06:43 +08:00
yyforyongyu
dca20d80a7
itest: fix context leak in openChannelAndAssert
In this commit, we put the context initialization inside
openChannelAndAssert, thus saving us a few lines and making sure the
context is always properly handled.
2021-08-24 11:06:43 +08:00
ErikEk
ca7192f8fd itest: include compressed btcd backend logs 2021-08-24 02:00:44 +02:00
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
yyforyongyu
1abc5f8b00
chainfee: change min conf target to be 1
This commit changes the minBlockTarget used by the WebAPIEstimator to be
1, inline with the bitcoind's accepted min conf target.
2021-06-29 20:25:46 +08:00
Olaoluwa Osuntokun
44e461b233
Merge pull request #5428 from wpaulino/enforce-anchor-reserve
lnwallet: prevent anchor reserve enforcement on legacy inbound channel
2021-06-28 16:08:43 -07:00
yyforyongyu
310e923170
itest: use require inside net.EnsureConnected/net.ConnectNodes 2021-06-29 01:41:48 +08:00
Olaoluwa Osuntokun
e62f0e1f3a
Merge pull request #5429 from Roasbeef/itest-recovery-shutdown
lntest: retry node shutdown attempts to recovery tests
2021-06-24 18:43:39 -07:00
Olaoluwa Osuntokun
198ac3482c
Merge pull request #5332 from yyforyongyu/5259-routing-fix-state
routing: fix payment state and refactor payment lifecycle tests
2021-06-24 18:42:17 -07:00
Olaoluwa Osuntokun
5bd84e2a60
lntest: retry node shutdown attempts to recovery tests
In #5364 we added a new error path in the `StopDaemon` method to return
an error if shutdown was attempted while a rescan/recover instance was
in progress. Since the wallet actually won't fully stop (atm)
mid-recovery, the call effectively didn't do anything in that scenario,
so we started to return an error to properly reflect that. However this
causes certain itests to fail, as during recovery, the stop attempt will
fail leading to the test itself failing.

In this commit, we wrap the calls to stop a running daemon within a
`wait.NoError` call so we'll continually try to shut down the daemon
rather than quit on the first try.

Fixes #5423.
2021-06-24 15:37:32 -07:00
Wilmer Paulino
d7299802d4
itest: extend testAnchorReservedValue to open additional channels
We do this to trigger a bug that will be resolved in a follow-up commit.
This bug prevents inbound legacy channels from being rejected by the
recipient if they have at least one anchor channel already opened
without an on-chain balance.
2021-06-23 18:24:30 -07:00
yyforyongyu
54ed6c271b
itest: silence depreciation warnings 2021-06-23 20:35:28 +08:00
yyforyongyu
193d149d48
itest: test channel policy update in private channels 2021-06-23 20:35:28 +08:00
yyforyongyu
319cc533a6
itest: fix make lint 2021-06-23 20:35:28 +08:00
yyforyongyu
e10bd84a4f
itest: moving routing related tests into one file 2021-06-23 20:35:23 +08:00
carla
6aa37066b2
server: send 0 bandwidth hints for links that can't add htlc 2021-06-22 15:39:33 +02:00
Olaoluwa Osuntokun
2fd75ace9d
Merge pull request #5374 from yyforyongyu/itest-use-require-sendcoin
itest: use require inside net.SendCoins
2021-06-18 14:12:39 -07:00
Olaoluwa Osuntokun
16bce31e46
Merge pull request #5348 from yyforyongyu/fix-itest-channel-close
itest: fix wrong node queried for balance
2021-06-18 14:09:19 -07:00
Olaoluwa Osuntokun
a4d4d5f8dc
Merge pull request #5299 from C-Otto/insufficient-bandwidth-log
add detailed log message for "insufficient bandwidth" error
2021-06-18 14:07:15 -07:00
yyforyongyu
6515c575bd
itest: use require inside net.SendCoins
This commit refactored the function SendCoins to take a new *testing.T
so the unexpected error is handled inside it.
2021-06-10 01:29:22 +08:00
yyforyongyu
b42bb87c81
itest: use require inside net.NewNode
This commit refactored the function NewNode to take a *testing.T so that
the unexpected error is checked inside it. The caller is now free from
checking the errors.
2021-06-09 02:14:37 +08:00
yyforyongyu
a60db53a5a
itest: fix wrong node queried for balance 2021-06-03 19:55:25 +08:00
Conner Fromknecht
d6f88cbe6f
lnrpc: allow payment addr override for AMP invoices
This permits an AMP invoice to be "pseudo-reusable", where the invoice
paramters can be used multiple times so long as a new payment address is
supplied. This prevents additional round trips between payer and payee
to obtain a new invoice, even though the payments/invoices won't be
logically associated via the RPC interface like they would when the full
reusable invoices are deployed.
2021-05-28 09:30:05 -07:00
Conner Fromknecht
a765ba1f3d
lntest/mpp_test: ensure ctx.alice and ctx.bob are shutdown
Not doing so prevents consecutive subtests from starting properly.
2021-05-28 09:30:05 -07:00
Carsten Otto
4b4d34fcce htlcswitch: change errors to warnings
for issues caused by bogus incoming HTLC data
2021-05-23 19:17:59 +01:00
Oliver Gugger
e39d00900c
Merge pull request #5260 from guggero/windows-itest
Travis: fix Windows itest
2021-05-14 12:57:51 +02:00
Oliver Gugger
e4873ac878
lntest: re-use P2P ports during SCB recovery
In some rare instances it can happen that the nodes don't find each
other again after one of them has been re-created and the other one has
been restarted in the SCB tests. By making sure the re-created has the
same P2P port again as before, we make sure they can connect to each
other again successfully for executing DLP.
2021-05-14 10:59:10 +02:00
Oliver Gugger
702dda6448
itest: reconnect nodes more quickly on SCB restore
Since there is a lot of connecting and disconnecting between nodes in
the channel backup tests, we try to speed up that process by lowering
the min backoff from 1 second to 50 milliseconds. We also make sure we
never wait more than 1 second if it does take multple attempts. This
should sum up and hopefully speed up our tests a bit.
2021-05-14 10:09:04 +02:00
Olaoluwa Osuntokun
7ab5906093
Merge pull request #5245 from bhandras/kvdb_module
kvdb: make kvdb a top level submodule to allow dependency in other projects
2021-05-13 15:59:20 -07:00
Olaoluwa Osuntokun
c0acdd8082
Merge pull request #5036 from halseth/breacharbiter-justice-splitting
[breacharbiter] Split justice tx in case of delayed confirmation.
2021-05-12 13:42:42 -07:00
Olaoluwa Osuntokun
86c5e483b2
Merge pull request #5206 from carlaKC/4987-heightexpirywatcher
invoices: add height based expiry watcher
2021-05-12 13:41:52 -07:00
Olaoluwa Osuntokun
dc73a23e81
Merge pull request #5253 from cfromknecht/amp-invoice
Support paying AMP invoices via SendPaymentV2
2021-05-12 13:38:42 -07:00
Johan T. Halseth
3aa5e650fb
lntest/mock: set input index on spend event 2021-05-12 12:32:28 +02:00
carla
8066ff7047
itest/test: assert expired hold invoice updated correctly 2021-05-11 08:45:32 +02:00
carla
b7d1ed0cbb
itest/test: test hold invoice cancel before force close 2021-05-11 08:45:31 +02:00
Conner Fromknecht
ef392dcd0c
lntest: add amp invoice test 2021-05-10 22:02:15 -07:00
Conner Fromknecht
4e93c1303c
lntest: isolate alice+bob in mppTestContext 2021-05-10 22:02:15 -07:00
Conner Fromknecht
2ecd1de713
config: expose distinct accept-amp flag
This mirrors the accept-keysend flag, but also permits users to
eventually toggle off keysend separately from AMP.
2021-05-10 22:02:15 -07:00
Conner Fromknecht
8c404ade18
routing: allow splitting for AMP or MPP 2021-05-10 22:02:14 -07:00
Conner Fromknecht
dba055de2d
lntest/amp_test: assert subscribe invoice in sendtoroute_amp 2021-05-10 22:02:14 -07:00
Olaoluwa Osuntokun
ba5aaec632
Merge pull request #5266 from wpaulino/import-dry-run
walletrpc: expose dry run support for ImportAccount
2021-05-10 17:19:09 -07:00
Oliver Gugger
6c37cae639
lntest+routing: update best height after graph pruning
It seems #5246 introduced a subtle bug that lead to the error "out of
order block: expecting height=1, got height=XXX" some times during
startup. Apparently it can happen that during pruning of the graph tip
some blocks can come in before we start our chain view and the new block
subscription. By querying the chain backend for the best height before
syncing with the graph we ensure that we never miss a block.
2021-05-10 16:46:28 +02:00
Oliver Gugger
8147b270d4
lntest: wait for chain sync in switch test 2021-05-10 16:46:28 +02:00
Andras Banki-Horvath
14c851c8fc
kvdb: move channeldb/kvdb to top level 2021-05-07 14:18:56 +02:00
yyforyongyu
270984b7d5
trivial: update log_error_whitelist 2021-05-07 13:20:54 +08:00
Wilmer Paulino
994405709a
lnwallet: expose dry run support for ImportAccount 2021-05-06 19:04:21 -07:00
Andras Banki-Horvath
dd14947154
lint: silence depreciation warnings 2021-05-04 17:33:14 +02:00
Andras Banki-Horvath
7caf26ce94
itest: add itest for failover after forcefull shutdown 2021-05-04 17:33:12 +02:00
Andras Banki-Horvath
5d8488871c
itest: basic failover itest when using leader election on etcd 2021-05-04 17:33:12 +02:00
Andras Banki-Horvath
5e215a7a66
lnrpc: add "waiting to start" state to state service
This commit adds a new "waiting to start" state which may be used to
query if we're still waiting to become the cluster leader. Once leader
we advance the state to "wallet not exist" or "wallet locked" given
wallet availablity.
2021-05-04 17:33:11 +02:00
Andras Banki-Horvath
e5f249ad51
mod: integrate latest btcwallet and bump protobuf and grpc 2021-05-04 17:33:09 +02:00
Olaoluwa Osuntokun
140dd944c0
Merge pull request #5257 from wpaulino/neutrino-update
lncfg: add config options for new neutrino options
2021-04-30 16:54:35 -07:00
Wilmer Paulino
f26cfac440
itest: use wait predicate for balance assertion in assertDLPExecuted
This assertion would at times fail if the wallet balance hadn't been
updated yet.
2021-04-29 13:56:20 -07:00
Wilmer Paulino
6bb7b00a80
lntest: decrease broadcast timeout for neutrino-backed integration tests
Since we don't have to worry about network latency within our
integration tests, we can shorten the broadcast timeout for neutrino
integration tests from 5s to 1s.
2021-04-29 13:56:19 -07:00
Oliver Gugger
13aed071bd
itest: add test for bi-directional WebSocket 2021-04-29 10:39:55 +02:00
Oliver Gugger
066472fd3e
itest: refactor WS tests into functions 2021-04-29 10:39:55 +02:00
Johan T. Halseth
13c00127da
itest: add SendPayment AMP itest 2021-04-27 09:47:24 +02:00
Johan T. Halseth
a2a61a104f
itest: make sendAndAssertSuccess take context 2021-04-27 09:47:23 +02:00
Johan T. Halseth
f07c9d002c
routing: use Identifier in place of PaymentHash
Since we want to support AMP payment using a different unique payment
identifier (AMP payments don't go to one specific hash), we change the
nomenclature to be Identifier instead of PaymentHash.
2021-04-27 09:47:23 +02:00
Olaoluwa Osuntokun
8af00ab0cf
Merge pull request #5205 from carlaKC/4987-refactorprep
invoices: add test to demonstrate hodl invoice bug and refactor
2021-04-26 15:48:56 -07:00
Olaoluwa Osuntokun
bfcaf02f04
Merge pull request #4905 from LN-Zap/feat/spend-unconfirmed-estimate
Support spend_unconfirmed in EstimateFee and FundPsbt
2021-04-26 15:48:11 -07:00
Olaoluwa Osuntokun
9ef00d98a7
Merge pull request #5230 from carlaKC/5059-interceptorchanupdate
multi: send channel update for failed interceptor packets
2021-04-26 15:45:43 -07:00
carla
d0d0d21573
itest/test: remove hold force close dependency
Our aggregate htlc test depends on our previous behavior
where recipients would allow channels with pending hold
invoice htlcs to force close. Now that we have an expiry
watcher to prevent these force closes, we can't rely on
this for tests because the recipient will cancel the htlcs
back before they expire.
2021-04-23 08:19:58 +02:00
carla
2e39edd6bd
itest/test: add test for expired hold invoices
This commit adds a test for a hold invoice which is accepted
off-chain, and held by the recipient until it expired and
the payer force-closes the channel. With this test we
demonstrate two bugs in our handling of hold invoice state
in the invoice registry when we expire on chain:
- Htlcs not updated: even when we've timed out, we don't
  update the htlc state accordingly.
- Invoice can be settled: the invoice can be settled even
  though it's expired on chain.
2021-04-23 08:19:51 +02:00
carla
16373d3879
itest/test: add test to reproduce settling timed out invoice
Reproduce the case where we allow settling of invoices that have
htlcs that have actually timed out on chain. This bug can rarely
occur if a hodl invoice goes to chain and is manually settled
after it has timed out. Funds are SAFU, but this could be a
headache because the invoice says it's settled when no funds
were claimed.
2021-04-23 08:19:50 +02:00
carla
fff6f83f23
itest/test: update remote force close timeout to use hodl inv
This commit updates our multi-hop force close test to use a hodl
invoice so that we can reproduce some bugs which will require
the preimage for the invoice that is timed out on chain.
2021-04-23 08:19:47 +02:00
Tom Kirkpatrick
2f80283ec2
rpc: minConfs and spendUnconfirmed for EstimateFee 2021-04-22 20:35:51 +02:00
Tom Kirkpatrick
03b55446b5
refactor: use camel case for minConfs 2021-04-22 20:35:00 +02:00
carla
5b7b6ab9b0
multi: send channel update for failed interceptor packets 2021-04-22 19:39:37 +02:00
whythat
1adeb41a9d rpcserver+lnrpc: make Subscribe RPCs context aware
This commit makes all the Subscribe RCP's context aware so that they
stop executing when the request context is cancelled.
2021-04-22 07:49:29 +02:00
carla
0368da02bd
itest: whitelist neutrino shutting down error 2021-04-21 12:36:43 +02:00
Conner Fromknecht
748265d097
Merge pull request #5207 from carlaKC/4727-singleinvoice
invoicesrpc: terminate SubscribeSingleInvoice once invoice reaches a final state
2021-04-14 15:32:53 -07:00
Olaoluwa Osuntokun
54e315101d
Merge pull request #4577 from yyforyongyu/itest-better-logging
itest: logging for subtests and refactor WaitForBlockchainSync
2021-04-14 15:04:34 -07:00
carla
db1d671b1a
multi: terminate SubscribeSingleInvoice once completed 2021-04-14 09:19:23 +02:00
carla
0686329062
itest/test: add settle/canceled assertions for subscribe single 2021-04-14 09:19:22 +02:00
carla
7f1e0a4d7b
itest/test: move test hold persistence into its own file 2021-04-14 09:19:21 +02:00
yyforyongyu
96c3a64316
lntest: refactor WaitForBlockchainSync 2021-04-14 12:30:22 +08:00
yyforyongyu
a215c55186
itest: add logging for subtests 2021-04-14 12:30:19 +08:00
Olaoluwa Osuntokun
25dfbc4106
Merge pull request #5193 from wpaulino/neutrino-assume-valid
Use routing.assumechanvalid=true by default in Neutrino mode
2021-04-13 15:37:51 -07:00
Wilmer Paulino
2f1f616c65
lntest: use validatechannels config option for itests 2021-04-09 15:47:04 -07:00
Johan T. Halseth
cd87fe89eb
Merge pull request #5181 from yyforyongyu/refactor-itest
itest: move funding tests into one file
2021-04-08 09:53:29 +02:00
Conner Fromknecht
730b718208
lntest: add AMP itest 2021-04-07 12:09:47 -07:00
Conner Fromknecht
888af51ab4
lntest: make buildRoute method on mppTestContext
This will be reused by the amp itest.
2021-04-07 12:09:47 -07:00
yyforyongyu
1be7331c4f
itest: move funding tests into one file 2021-04-07 02:40:06 +08:00
Wilmer Paulino
983f402369
itest: add wallet import cases 2021-04-05 15:41:12 -07:00
Wilmer Paulino
2d163b788b
lnwallet: expose wallet import related methods to WalletController 2021-04-05 15:41:09 -07:00
Wilmer Paulino
f91e7cde59
lnwallet: expose optional account filter for several WalletController methods 2021-04-05 15:41:06 -07:00
Wilmer Paulino
f38bf4d7fa
lnwallet: expose required account parameter for WalletController methods 2021-04-05 15:41:05 -07:00
Wilmer Paulino
a620ce3682
build: update btcd and btcwallet dependencies 2021-04-05 15:41:04 -07:00
yyforyongyu
9d0d88ac21
lnrpc+lncli: deprecate sat_per_byte and add sat_per_vbyte
This commit deprecates/replaces the old field `sat_per_byte` with
`sat_per_vbyte`. While the old field suggests sat per byte, it’s
actually using sat per virtual byte. We use the Hidden param to hide all
the deprecated flags. These flags won't show up in help menu onwards,
while stay valid that can be passed from cli. Thus bash scripts
referencing these fields won't be broken.
2021-03-26 17:16:40 +08:00
Olaoluwa Osuntokun
24d1d9cb14
Merge pull request #5095 from bottlepay/wtxmgr-parameterized-lock
lnwallet+walletrpc: list leases and parameterize duration
2021-03-25 17:31:13 -07:00
Olaoluwa Osuntokun
a9afd86a5b
Merge pull request #5127 from alexbosworth/patch-15
rpcserver: revert target conf to previous behavior
2021-03-24 16:53:17 -07:00
Alex Bosworth
069de38186
itest: add support for specifying chain fee rate 2021-03-22 13:08:38 -07:00
carla
d0e7164c07
routerrpc: add mission control import 2021-03-18 10:51:45 +02:00
Wilmer Paulino
022d44f776
itest: test new channel update rate limiting options 2021-03-16 12:08:18 -07:00
Joost Jager
9398220568 walletrpc: add ListLeases 2021-03-13 08:45:52 +01:00
Joost Jager
5ba0f8e355 lnwallet: bump btcwallet 2021-03-13 08:45:52 +01:00
Johan T. Halseth
148f1be75f
itest: add RPC errors to whitelist
Since we now log RPC errors as the first thing in our interceptor chain,
more benign errors bubble up. We add them to the whitelist.
2021-03-11 13:05:24 +01:00
Johan T. Halseth
2877511fce
rpcperms+lnd: gate RPC calls on RPC state
This commit makes us gate the calls to the RPC servers according to the
current RPC state. This ensures we won't try to call the RPC server
before it has been fully initialized, and that we won't call the
walletUnlocker after the wallet already has been unlocked.
2021-03-11 13:05:24 +01:00
Johan T. Halseth
5e9e03858d
lntest/node: call FetchNode info in wait.NoError after init
In case we call it before the RPC server is fully active.
2021-03-11 13:05:24 +01:00
Oliver Gugger
c623d21bd2
Merge pull request #5083 from guggero/psbt-size-fix
lncli: allow PSBT to be read from file
2021-03-10 23:02:02 +01:00
Oliver Gugger
f55aae0068
itest: add new neutrino error to whitelist 2021-03-10 16:55:49 +01:00
Olaoluwa Osuntokun
65b0bbcd53
Merge pull request #5033 from robot-dreams/set-channel-status
Add lncli command / RPC for manually setting channel state
2021-03-09 18:12:08 -08:00
eugene
99a7271289
lntest/itest+lnwallet: add legacy chanrestore test
The test makes use of a nextRevocationProducer that is only used during
integration tests.
2021-03-05 12:49:18 -05:00
Conner Fromknecht
d004442efb
lnrpc+itest: expose AMP fields on InvoiceHTLC
We also test that legacy keysend payments are promoted to AMP payments
on the receiver-sdie by asserting basic properties of the fields
returned via the rpc.
2021-03-04 10:11:21 -08:00
Elliott Jin
215bf637ea itest: add test for new UpdateChanStatus RPC 2021-02-24 07:13:29 -08:00
Elliott Jin
ce2796257e multi: move GetChanPointFundingTxid from lnd to lnrpc
This refactor-only change makes the GetChanPointFundingTxid helper
function available from sub-systems outside of the root lnd package.
2021-02-24 07:13:28 -08:00
Conner Fromknecht
17489ba6a3
lntest/itest: add websocket close to error whitelist 2021-02-18 12:14:50 -08:00
Olaoluwa Osuntokun
b73a6e2c61
routing: if MaxShardAmt is set, then use that as a ceiling for our splits
In this commit, we thread through the necessary state to allow users to
set a max shard amount. If this value is set, then this'll effectively
serve as a ceiling for all our split attempts. If we need to split,
we'll first try to use `paymentAmt/2`, if that's bigger than
`MaxShardAmt, then we'll use the latter instead.

Ideally in the future we have a dynamic way to automatically set both
the `MaxShardAmt` as well as `MaxParts` for users. Until then exposing
these two new fields will allow us to experiment with setting them
automatically using the RPC interface, and also give users a bit more
control over how we attempt to route payments, akin to coin control for
on-chain payments.

Fixes #4730
2021-02-15 19:31:52 -08:00
Conner Fromknecht
91a3350dd1
lntest: add Block height out of range to whitelist 2021-02-11 17:51:07 -08:00
Conner Fromknecht
cc34af4e57
lntest: add unable to extract ChannelUpdate to whitelist 2021-02-11 17:48:41 -08:00
Olaoluwa Osuntokun
7b0ea3c029
Merge pull request #4909 from carlaKC/mc-paramsapi
routing: allow runtime updates to mission control config
2021-02-10 18:51:53 -08:00
Conner Fromknecht
1ee5eb97d5
Merge pull request #5006 from wpaulino/new-rate-limit-chan-updates
discovery: use token bucket based rate limiting to throttle gossip
2021-02-10 17:31:41 -08:00
Wilmer Paulino
d4fa430ca6
Revert "lntest: always turn off gossip throttling for nodes created in itests"
This reverts commit 447c9f2c0b.
2021-02-10 15:45:47 -08:00
Conner Fromknecht
58e924ad1c
discovery: don't historical sync when NumActiveSyncers == 0
Currently when numgraphsyncpeers=0, lnd will still attempt to perform
an initial historical sync. We change this behavior here to forgoe
historical sync entirely when numgraphsyncpeers is zero, since the
routing table isn't being updated anyway while the node is active.

This permits a no-graph lnd mode where no syncing occurs at all.
2021-02-10 09:35:45 -08:00
carla
63bdd6b07b
itest: add coverage for hold invoices with hop hints
This PR updates the hold invoice itest to create a private
channel, and sets the private option on the invoices created
to add coverage for the addition of hop hints.
2021-02-08 09:19:21 +02:00
Conner Fromknecht
7f006832fb
Merge pull request #4934 from cfromknecht/pinned-active-syncers
discovery: pinned syncers
2021-02-03 10:54:00 -08:00
Conner Fromknecht
814b81bd25
Merge pull request #4902 from Crypt-iQ/lntestchannels_01072021
lntest/channels: introduce subpackage to deduplicate static structs
2021-02-01 14:12:08 -08:00
Conner Fromknecht
227fd45da2
lntest: fix linter errors 2021-01-29 01:37:37 -08:00
Conner Fromknecht
e42301dee2
lntest: call markGraphSynced from gossipSyncer
Rather than performing this call in the SyncManager, we give each
gossipSyncer the ability to mark the first sync completed. This permits
pinned syncers to contribute towards the rpc-level synced_to_graph
value, allowing the value to be true after the first pinned syncer or
regular syncer complets. Unlinke regular syncers, pinned syncers can
proceed in parallel possibly decreasing the waiting time if consumers
rely on this field before proceeding to load their application.
2021-01-29 00:19:48 -08:00
Conner Fromknecht
920eda26fc
lntest/graph_top: test pinned syncers 2021-01-29 00:19:48 -08:00
Conner Fromknecht
ba67f3ecaa
lntest/graph_top: remove dependence on net.Alice/Bob 2021-01-29 00:19:47 -08:00
eugene
f8b98a1d3b
lntest/channels: introduce subpackage to deduplicate static structs 2021-01-25 14:04:39 -05:00
Johan T. Halseth
8c78f20ffa
itest: add testAnchorReservedValue
We test that Alice as expected will not be allowed to spend her wallet
balance below the reserved amount.
2021-01-19 20:06:52 +01:00
carla
64dad77e2e
multi: add get and set mission control to routerrpc 2021-01-19 10:57:15 +02:00
Olaoluwa Osuntokun
ff897db293
Merge pull request #4901 from bhandras/etcd_itest_ci
etcd+itests: use itest generated ports for embedded etcd and add etcd itests to travis CI
2021-01-14 17:53:54 -08:00
Johan T. Halseth
01f31e436a
itest: fix node names out of bounds
If the last channel fails, the indexing into nodeNames would panic. We
instead name the channels, such that the slices will be of the same
length.
2021-01-14 20:55:32 +01:00
Andras Banki-Horvath
b2ab5e8af1
itests: run etcd itests with generated ports 2021-01-08 15:39:12 +01:00
Wilmer Paulino
023f327cdd
lntest: add rebroadcast stale announcements err to whitelist 2021-01-06 14:33:41 -08:00
eugene
caa0f5da6a multi: move and export funding-related vars to funding package
Also moves the lnd global MaxFundingAmount to server.go
2020-12-17 09:36:34 -05:00
Johan T. Halseth
413ece2ccc
itest: account for capped anchor commit fee rate in balance calc 2020-12-15 19:54:50 +01:00
Conner Fromknecht
4af24158c4
Merge pull request #4779 from halseth/anchor-htlc-aggregation
[anchors] HTLC second level aggregation in the sweeper
2020-12-11 16:22:17 -08:00
Oliver Gugger
094545a300
itest: add neutrino errors to whitelist 2020-12-11 08:55:45 +01:00
Johan T. Halseth
1627310fb0
itest: add HTLC aggregation test 2020-12-10 14:24:21 +01:00
Johan T. Halseth
42c51b662a
itest/channel_force_close test: handle HTLCs going through sweeper
Now that the HTLC second-level transactions are going through the
sweeper instead of the nursery, there are a few things we must account
for.
1. The sweeper sweeps the CSV locked HTLC output one block earlier than
   the nursery.
2. The sweeper aggregates several HTLC second levels into one
   transaction. This also means it is not enough to check txids of the
   transactions spent by the final sweep, but we must use the actual
   outpoint to distinguish.
2020-12-10 14:24:21 +01:00
Johan T. Halseth
4b9fbe2146
itest/local_chain_claim test: mine one less blocks for anchor sweeps
In case of anchor channel types, we mine one less block before we expect
the second level sweep to appear in the mempool, since the sweeper
sweeps one block earlier than the nursery.
2020-12-10 14:24:21 +01:00
Johan T. Halseth
241e21a0d1
itest: use hex encoded hash in error message 2020-12-10 14:24:18 +01:00
Johan T. Halseth
09f2307d14
itest: increase htlc amt for local force close tests
Since the tests set a quite high fee rate before the node goes to chain,
the HTLCs wouldn't be economical to sweep at this fee rate.

Pre sweeper handling of the second-level transactions this was not a
problem, since the fees were set when the second-levels were created,
before the fee estimate was increased.
2020-12-10 14:24:18 +01:00
Oliver Gugger
a08d6c469f
itest: update and sort error whitelist 2020-12-09 09:06:14 +01:00
Oliver Gugger
af0f39f4a6
itest: fix log whitelist check
Because a previous PR changed the location of the itest log files, we
also need to update the script that looks for non-whitelisted errors.
2020-12-09 08:06:16 +01:00
Conner Fromknecht
2f38a7ce9c
itest: increase recovery payment amount so htlc isn't dust 2020-12-08 14:55:40 -08:00
Oliver Gugger
9de659ea4f
itest: use require.Eventually where tick speed matters
To not waste a lot of time with the adjusted longer tick interval, we
use a short interval with require.Eventually where we can save some
time.
2020-12-08 21:40:37 +01:00
Oliver Gugger
a436618e43
lntest: fix linter errors for changed code 2020-12-08 21:40:36 +01:00
Oliver Gugger
809d238364
itest: wait for server to start when restoring
To avoid running into the "server is still starting" error when trying
to close a channel, we first wait for the error to disappear before we
try closing the actual channel.
2020-12-08 21:40:31 +01:00
Oliver Gugger
cdcbc0376d
lntest: replace hard coded timeouts
This commit replaces most of the hard coded 10, 15, 20 and 30 second
timeouts with the default timeout. This should allow darwin users to
successfully run the parallel itests locally as well.
2020-12-08 21:37:12 +01:00
Oliver Gugger
3823315820
lntest: go easy on goroutines when polling
In high CPU usage scenarios such as our parallel itests, it seems that
some goroutines just don't get any CPU time before our test timeouts
expire. By polling 10 times less frequently, we hope to reduce the
overall number of goroutines that are spawned because of the RPC
requests within the polling code.
2020-12-08 21:37:11 +01:00
Oliver Gugger
4d2a12e552
itest: fix incorrect error message 2020-12-08 21:37:10 +01:00
Conner Fromknecht
123c3a2530
itest: defer shutdown of nodes in main test method
This ensures that the nodes will properly be shutdown even if one fails
to start or any of them fail to connect. Previously the shutdown is
defered only in the event that the setup was successful.
2020-12-03 23:06:32 -08:00
Conner Fromknecht
374725842e
itest: use fresh alice and bob for fwd interceptor tests 2020-12-03 23:06:32 -08:00
Conner Fromknecht
92b820a6d1
itest: move to require in forward_interceptor_test
Certain checks were implemented with Errorf, which only logs the
failure. This results in the test harness panicking further down. We go
further ahead and convert all calls in this file to use require.
2020-12-03 23:06:29 -08:00
Oliver Gugger
36756c012d
lntest: use nextAvailablePort for miner and btcd backend
With the new btcd version we can specify our own listen address
generator function for any btcd nodes. This should reduce flakiness as
the previous way of getting a free port was based on just picking a
random number which lead to conflicts.
We also double the default values for connection retries and timeouts,
effectively waiting up to 4 seconds in total now.
2020-12-03 11:30:23 +01:00
Oliver Gugger
2edc3cf98f
multi: update to latest btcd version
With this commit we update btcd to the latest version which allows us to
specify the btcd binary we want to use when spinning up a new node.
2020-12-03 11:30:22 +01:00
Oliver Gugger
0a4962a18e
itest: run sub itests correctly
To avoid the "Error outside of test" log and to properly terminate the
test if a sub test fails, we need to correctly invoke them using the
RunTestCase method.
2020-12-01 22:24:03 +01:00
Johan T. Halseth
8ec4697fe3
Merge pull request #4810 from Roasbeef/gossip-throttle-config
multi: add new config option to toggle gossip rate limiting
2020-12-01 13:32:52 +01:00
Olaoluwa Osuntokun
94f8311667
Merge pull request #4782 from cfromknecht/anchor-wtserver
watchtower: anchor channel support
2020-11-30 17:49:32 -08:00
Olaoluwa Osuntokun
447c9f2c0b
lntest: always turn off gossip throttling for nodes created in itests 2020-11-30 16:39:06 -08:00
Olaoluwa Osuntokun
7e298f1434
Merge pull request #3367 from cfromknecht/batched-graph-updates
Batched graph updates
2020-11-25 18:40:40 -08:00
Conner Fromknecht
82a238317c
lncfg+itest: expose configurable batch-commit-interval
This will permit a greater degree of tuning or customization depending
on various hardware/environmental factors.
2020-11-25 16:45:25 -08:00
Olaoluwa Osuntokun
4e079d1d20
lntest/itest: fix SendToRoute in UpdateChanPolicy test
It needs to include the MPP payload  now.
2020-11-25 16:32:15 -08:00
Olaoluwa Osuntokun
7fdf46ea4e
lntest/itest: update SendToRoute tests to include payment addr 2020-11-25 16:32:09 -08:00
Olaoluwa Osuntokun
d996607470
routing+lnrpc: extend BuildRoute to accept raw payAddr
In this commit, we extend the `BuildRoute` method and RPC on the router
sub-server to accept a raw payment address which will be included as
part of an MPP payload for the finla hop. This change actually also
allows users to craft their own MPP paths using BuildRoute+SendToRoute.
Our primary goal however, was to fix some broken itests since we now
require the payAddr to be present for ALL payments other than key send
payments.
2020-11-25 16:32:02 -08:00
Conner Fromknecht
b28bbc3223
wtclinet+itest: expose anchor client via rpc + add itest 2020-11-25 16:16:47 -08:00
Conner Fromknecht
f86c26878a
lntest/timeouts: fix darwin+kvdb_etcd build
Currently trying to run etcd tests on darwin will cause the timeouts to
improperly select timeouts_darwin.go which are stricter than
timeouts_etcd.go. We fix this by always defaulting to timeouts_etcd.go
no matter the platform, and only falling back to timeouts_darwin.go if
the kvdb_etcd tag is not present.
2020-11-18 15:28:39 -08:00
Conner Fromknecht
b70b6d9a6e
lntest/timeouts: remove spaces from build predicates
Otherwise this breaks various conditional compilation targets and the
linter.
2020-11-18 15:16:25 -08:00
Andras Banki-Horvath
5f3b800630
lint: fix error reported by the linter 2020-11-18 15:34:46 +01:00
Andras Banki-Horvath
efedb5547c
itest: timeouts for itets with etcd 2020-11-18 15:34:45 +01:00
Andras Banki-Horvath
369ae5e372
itest: move all test db files when using both etcd and bbolt
In some tests we moved channeld.db to a temp location in order to
"time travel". This commit extends the existing semantics by moving all
files, including embedded etcd db too besides the channeld.db file.
2020-11-18 15:34:45 +01:00
Andras Banki-Horvath
98342433ab
itest: add etcd flag to control if new lnd nodes should run on etcd 2020-11-18 15:34:44 +01:00
carla
887ff442db
multi: fix verbose output for listsweeps and check all against wallet
Previously, the verbose output of listsweeps would fail if we did not
find some sweeps in our wallet's listtransactions output. This could be
the case for sweeps that were rbf-ed, so the endpoint would fail. This
commit also updates the listsweeps endpoint to always check against the
wallet, so that we do not return these discarded sweeps that never
confirmed.
2020-11-13 13:59:52 +02:00
Andras Banki-Horvath
38e8184926
itest: update error log whitelist 2020-11-12 09:17:53 +01:00
Andras Banki-Horvath
9eac0dd3c9
itest: fix crash in parallel macaroon tests 2020-11-12 09:17:52 +01:00
Andras Banki-Horvath
979c8497b2
itest: add icase to node log filename + restart nodes before each icase
This commit adds the icase name to the log filename, to make it simpler
to find problematic tests. Additionally after this commit we'll restart
Alice and Bob (the base harness nodes) before each icase to start with a
clean state.
2020-11-12 09:17:52 +01:00
Andras Banki-Horvath
d6c2ee1bbf
itest: use require.NoError in TestLightningNetworkDaemon 2020-11-12 09:17:47 +01:00
Olaoluwa Osuntokun
99b0913562
Merge pull request #3672 from breez/invoice-hints
Allow user specify routing hints in private invoice.
2020-11-11 19:57:49 -08:00
Oliver Gugger
47e8882480
make+itest: allow the same test to be run in parallel 2020-11-10 13:57:31 +01:00
Oliver Gugger
24adf475ce
lnd_test: add integration tests for stateless init 2020-11-07 11:24:35 +01:00
Roei Erez
4463a4ce17 invoicerpc: Allow user specify routing hints. 2020-11-06 17:54:20 +02:00
Oliver Gugger
a606f462bc
itest: move longest test to beginning
To make sure the test that takes the longest overall time is always
started first, independent of the number of test tranches we run, we
move it to the beginning of the list. Because that test involves a lot
of waiting, it allows us to play around with the number of tranches more
efficiently.
2020-11-04 11:03:37 +01:00
Oliver Gugger
e6c47294fb
itest: fix typo and formatting 2020-11-04 11:03:36 +01:00
Oliver Gugger
ea4bb5dc5c
itest: fix chanbackup restore flake
Updating the fee of the mock estimator _after_ starting carol turned out
to be flaky and could lead to the new fee not being picked up in time
for the force close. That lead to carol not cpfp'ing the force closed
transaction.
2020-11-04 11:03:34 +01:00