Commit Graph

11295 Commits

Author SHA1 Message Date
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
Johan T. Halseth
c207a1528b
Merge pull request #5238 from guggero/windows-dep-fix
mod+tools: pin down build flag dependent go.sum entry
2021-04-26 14:57:21 +02:00
Olaoluwa Osuntokun
260ea9b842
Merge pull request #5165 from Crypt-iQ/psbt_funding_04022021
lnwallet/chanfunding: check all PSBT inputs have witness stack
2021-04-23 12:04:27 -07:00
Olaoluwa Osuntokun
4d358a84e4
Merge pull request #5214 from carlaKC/4788-terminalshard
routing: handle failure to launch shard after permanent failure
2021-04-23 09:50:15 -07:00
Oliver Gugger
364421dced
mod+tools: pin down build flag dependent go.sum entry
This is a workaround to fix the windows build. Apparently there was a
change in go 1.16 in how the go.sum entries are calculated. Dependencies
that aren't directly depended on are stripped. Because we need this
indirect windows dependency for the integration tests, we add a
workaround that makes sure the entry is kept in go.sum.
2021-04-23 14:15:33 +02:00
Oliver Gugger
585a78dbc7
Merge pull request #5022 from bjarnemagnussen/fix-docker-ltc
docker: fix chain for lnd_ltc
2021-04-23 10:13:53 +02:00
carla
b43ddfdb11
routing: label payment lifecycle loop 2021-04-23 08:51:07 +02:00
carla
a63640c488
routing: account for payment terminal errors
If we have processed a terminal state while we're pathfinding
for another shard, the payment loop should not error out on
ErrPaymentTerminal. Instead, it would wait for our shards to
complete then cleanly exit.
2021-04-23 08:46:22 +02:00
Oliver Gugger
2e9e4567ee
Merge pull request #5135 from GameXG/master
lnd: fix #1990 LND can't read .cookie file in Bitcoin datadir (Windows 10)
2021-04-23 08:41:26 +02:00
carla
58d95be4dd
multi: change RegisterAttempt error checking order
Move our more generic terminal check forward so that we only
need to handle a single class of expected errors. This change
is mirrored in our mock, and our reproducing tests are updated
to assert that this move catches both classes of errors we get.
2021-04-23 08:39:45 +02:00
carla
12136a97a9
routing/test: add test for stuck payment with in-flight htlcs
Add an additional stuck-payment case, where our payment gets
a terminal error while it has other htlcs in-flight, and a
shard fails with ErrTerminalPayment. This payment also falls in
our class of expected errors, but is not currently handled. The
mock is updated accordingly, using the same ordering as in our
real RegisterAttempt implementation.
2021-04-23 08:39:45 +02:00
carla
80451afe48
routing/test: add test to demonstrate stuck payment, single shard
This commit adds a test which demonstrates that payments can
get stuck if we receive a payment failure while we're pathfinding
for another shard, then try to dispatch a shard after we've
recorded a permanent failure. It also updates our mock to
only consider payments with no in-flight htlcs as in-flight,
to more closely represent our actual RegisterAttempt.
2021-04-23 08:39:44 +02:00
carla
125980afb7
routing/test: block on pathfinding in tests
This commit adds a step to our payment lifecycle test to add
control over when we find a path for our payment, This is
required for testing race conditions around pathfinding
completing and payment failures being reported.
2021-04-23 08:39:43 +02:00
carla
a68155545c
routing/test: use half shard for single success case
Update our single shard success case to use a route which
splits the payment amount in half. This change still tests
the case where reveal of the preimage counts as a success,
even if we don't have the full amount. This change is made
to cut down on potential races in this test case. While we
are waiting for collectResultAsync to report a success, the
payment lifecycle will continue trying to dispatch shards.
In the case where we send 1/4 of the payment amount, we
send 1 or 2 more shards, depending on how long collectAsync
takes. Reducing this test to send 1/2 of the payment amount
means that we will always only try one more shard before
waiting for our shard.
2021-04-23 08:39:42 +02:00
carla
198d567cb2
routing/test: assert error value for payment failures 2021-04-23 08:39:41 +02:00
carla
e0c52e4473
routing/test: close payment result channel on shutdown, mimicking switch
This commit updates our mock to more closely follow the behavior of the
switch for mocked calls to GetPaymentResult. As it stands, our tests
send a test-created error from the switch when we want to mock shutdown.
In reality, the switch will close its result channel, so we update this
test to follow that behavior. This matters for the commit that follows,
because we start checking the error our payments return. If we have an
error from the switch, our tests will fail with an error that we do
not encounter in practice.
2021-04-23 08:39:40 +02:00
carla
9a78e9da73
routing/tests: move lock acquisition after state driving channels
In our payment lifecycle tests, we have two goroutines that
compete for the lock in our mock control tower: the resumePayment
loop which tries to call RegisterAttempt, and the collectResult
handler which is launched in a goroutine by collectResultAsync
and is responsible for various settle/fail calls.

The order that the lock is acquired by these goroutines is
arbitrary, and can lead to flakes in our tests if the step
that we do not intend to execute first gets the lock (eg,
we want to fail a payment in collectResult, but RegisterAttempt
gets there first). This commit moves contention for this lock
after our mock's various "state driving" channels, so that the
lock will be acquired in the order that the test intends it.
2021-04-23 08:39:39 +02:00
carla
b2d941ebfb
routing/test: remove test channel buffers
Now that we run each test individually, we don't need to buffer
our mock's channels anymore. This helps to tighten our test loop,
which currently can move on from a step before it's actually
been processed by the mock. This removal ensures that our payment
loop processes each of the test's steps before moving on to the
next once.
2021-04-23 08:39:38 +02:00
carla
806c4cbd57
routing/test: run each test case individually, add names
Update our payment lifecycle test to run each test case with
a fresh router. This prevents test cases from interacting with
each other. Names are also added for easy debugging.
2021-04-23 08:39:37 +02:00
carla
cb927e89b0
routing/test: add check that sendpayment completes
As is, we don't check that our SendPayment call in
TestRouterPaymentStateMachine completes. This makes it easier
to create malformed tests that just run through steps but leave
the SendPayment call hanging. This commit adds a check that we
have completed our payment to help catch tests like this. We
also remove an unused quit channel.
2021-04-23 08:39:36 +02:00
Olaoluwa Osuntokun
5a82340a03
Merge pull request #5198 from hsjoberg/sampleconf-tlsdisableautofill
mobile: add tlsdisableautofill to sample config
2021-04-22 15:49:55 -07:00
Olaoluwa Osuntokun
d07202d17b
Merge pull request #5212 from wpaulino/wtclient-update-stats-after-backup
wtclient: decrement pending tasks stats upon accepted task
2021-04-22 15:49:11 -07:00
Olaoluwa Osuntokun
045b58891a
Merge pull request #5146 from ellemouton/context-aware-rpcserver
rpcserver+lnrpc: make Subscribe RPCs context aware
2021-04-22 15:44:00 -07:00
Olaoluwa Osuntokun
5d1574f566
Merge pull request #2522 from roeierez/cleanup_server_error
Cleanup in case of server failed to start
2021-04-22 13:00:22 -07:00
Olaoluwa Osuntokun
bc3c5eb383
Merge pull request #5235 from Roasbeef/btcwallet-simnet-fix
build: update btcwallet to latest version
2021-04-22 12:48:27 -07:00
carla
5b7b6ab9b0
multi: send channel update for failed interceptor packets 2021-04-22 19:39:37 +02:00
eugene
fa5627b779
lnwallet/chanfunding: non-segwit spend Verify test
Also fixes error-handling in the Verify test when expectedErr == ""
2021-04-22 13:04:25 -04:00
eugene
b3f14d66f0
lnwallet/chanfunding: assert PSBT Inputs have WitnessUtxo 2021-04-22 13:04:24 -04:00
eugene
9e2cccdbbd
docs: add malleability note in psbt.md 2021-04-22 13:04:23 -04:00
Olaoluwa Osuntokun
81452a1e1c
build: update btcwallet to latest version
This version includes a fix to a regression that caused simnet wallets
to no longer operate in certain conditions.
2021-04-22 11:20:49 -05:00
Olaoluwa Osuntokun
eda3d45b3d
Merge pull request #5232 from Roasbeef/go-mod-fix
build: set Go version to 1.15 remove retract
2021-04-22 09:15:20 -07: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
Olaoluwa Osuntokun
2b5c9e1606
build: set Go version to 1.15 remove retract
We need to remove the retract as it's a new directive that isn't
understood by Go versions < 1.16.
2021-04-21 17:44:13 -05:00
Olaoluwa Osuntokun
8f940a5ea3
Merge pull request #5138 from Roasbeef/strict-zombie
channeldb+discovery: implement strict zombie pruning
2021-04-21 14:03:50 -07:00
Olaoluwa Osuntokun
a9f1b341be
discovery: update zombie resurrection test w/ new logic
In this commit, we update the existing zombie resurrection test to
ensure that if we prune an edge and another pubkey is marked as nil,
that we only accept a resurrection channel update from the node the we
originally pruned if the pruning decision was one sided.
2021-04-21 13:56:35 -05:00
Olaoluwa Osuntokun
6c27de7d11
routing: add strict pruning as new flag, default for neutrino
In this commit we add a new flag that controls if lnd will do strict
zombie pruning or not. If true, then this will cause lnd to maintain a
tighter graph as it wants both edges to always be live. We enable this by
default for neutrino as without this, it's possible that a node never
sees both edges begin disabled, so those edges are never actually pruned
from the graph.
2021-04-21 13:56:29 -05:00
Olaoluwa Osuntokun
7b589e5811
routing: add strict zombie pruning as a config level param
In this commit, we add strict zombie pruning as a config level param.
This allow us to add the option for those that want a tighter graph, and
not change the default composition of the channel graph for most users
over night.

In addition, we expand the test case slightly by testing that the self
node won't be pruned, but also that if there's a node with only a single
known stale edge, then both variants will prune that edge.
2021-04-21 13:56:27 -05:00
Olaoluwa Osuntokun
916059da48
routing: update chan pruning test w/ new zombie logic 2021-04-21 13:56:24 -05:00
Conner Fromknecht
e3a8b3b0c4
routing/router: prune zombies when either end is stale 2021-04-21 13:56:21 -05:00
Conner Fromknecht
672dbe39e7
channeldb/graph: only set laggard zombie pubkey 2021-04-21 13:56:19 -05:00
Conner Fromknecht
f28a98aa6f
discovery/gossiper: only parse zombie pubkey if non-empty 2021-04-21 13:56:16 -05:00
Conner Fromknecht
4baee9537b
discovery/gossiper: move zombie handling to helper 2021-04-21 13:56:11 -05:00
Olaoluwa Osuntokun
60250f0a04
Merge pull request #5034 from Roasbeef/m1-go1.16
build: switch all builds systems and CI/ID to go 1.16, update min go version, add support for compiling M1 binaries
2021-04-21 08:59:46 -07:00
Carla Kirk-Cohen
10a15ad73f
Merge pull request #5228 from carlaKC/errlist-neutrinoshutdown
itest: whitelist neutrino shutting down error
2021-04-21 14:04:32 +02:00
Hampus Sjöberg
3826bd735d mobile: add tlsdisableautofill to sample config
This addresses new restrictions in Android 11.
2021-04-21 12:55:46 +02:00
carla
0368da02bd
itest: whitelist neutrino shutting down error 2021-04-21 12:36:43 +02:00
Olaoluwa Osuntokun
1a8d1874a5
Merge pull request #5213 from hsjoberg/mobile-moveup
mobile: Move lndStarted check to the top of the Start function
2021-04-20 09:16:55 -07:00
Hampus Sjöberg
e1ebdb311a mobile: Move lndStarted check to the top of the Start function 2021-04-20 14:51:27 +02:00
Olaoluwa Osuntokun
5c5b91216a
Merge pull request #5221 from Roasbeef/btcwallet-chain-client-alignment
build: update to latest version of btcwallet
2021-04-19 20:15:54 -07:00
Olaoluwa Osuntokun
1301377e1a
build: update to latest version of btcwallet
In this commit, we upgrade to the latest version of `btcwallet` that
fixes an alignment issue with usage of atomics that can cause a panic on
certain systems.

Fixes #5196.
2021-04-16 11:18:01 -07:00