Commit Graph

6981 Commits

Author SHA1 Message Date
Johan T. Halseth
58ec9efed2
Merge pull request #2959 from halseth/err-router-shutting-down
[trivial] routing/router: define ErrRouterShuttingDown
2019-04-16 15:30:22 +02:00
Johan T. Halseth
74a4286bba
Merge pull request #2960 from wpaulino/reliable-send-panic
discovery: check nil policy within isMsgStale
2019-04-16 09:11:10 +02:00
Olaoluwa Osuntokun
8418dc5530
Merge pull request #2939 from Roasbeef/hodl-htlc-fix
htlcswitch: only perform CLTV checks for HTLCs with open invoices
2019-04-15 12:52:45 -07:00
Wilmer Paulino
90475d5339
discovery: check nil policy within isMsgStale
If both policies don't exist, then this would result in a panic. Since
they don't exist, we can assume the policy we're currently evaluating is
fresh.
2019-04-15 12:49:34 -07:00
Olaoluwa Osuntokun
c1f7732a31
Merge pull request #2947 from ottosuess/patch-2
lncli: fix exportChanBackup description typo
2019-04-15 12:39:48 -07:00
Johan T. Halseth
2b9efcbaeb
routing/router: define ErrRouterShuttingDown 2019-04-15 16:55:10 +02:00
Johan T. Halseth
7528e7de8b
lnd_test: wait for state update in completePaymentRequests
Instead of sleeping, we wait for at least one update to one of our
channels. This to make sure the HTLC has actually been committed.
2019-04-15 15:01:54 +02:00
Matt Drollette
c5b597b501 cmd/lncli: remove unused time_limit flag 2019-04-14 12:09:52 -05:00
Robert Habermann
a27ac66eed server: add periodic renewal of port forwarding
The check prevented the creation of port forwardings which were assumed
to be present already. After this change the port forwardings which
might have been removed from the NAT device can be re-created.
2019-04-13 13:49:31 +00:00
Joost Jager
3b94627c12
routing: remove route cache
This commit removes the QueryRoutes route cache. It is causing wrong
routes to be returned because not all of the request parameters are
stored.

The cache allowed high frequency QueryRoutes calls to the same
destination and with the same amount to be returned fast. This behaviour
can also be achieved by caching the request on the client side. In case
a route is invalidated because of for example a channel update,
the subsequent SendToRoute call will fail. This is a trigger to call
QueryRoutes again for a fresh route.
2019-04-13 08:10:32 +02:00
Wilmer Paulino
b43894724a
lncfg: parse network for TCP addresses to listen on correct interface
TCP addresses resolved through net.ResolveTCPAddr give a default network
of "tcp", so we'll map back the correct network for the given address.
This ensures that we can listen on the correct interface (IPv4 vs IPv6).
2019-04-12 18:45:11 -07:00
Wilmer Paulino
88aafe5c91
config: enforce safe auth of gRPC/REST listeners after parsing 2019-04-12 18:39:14 -07:00
Otto Suess
2bd217a5d9
lncli: fix exportChanBackup description typo 2019-04-12 20:14:32 +02:00
Johan T. Halseth
c0141a7bc1
Merge pull request #2937 from cfromknecht/moar-darwin-woes
lnd_test: bump timeout for darwin builds
2019-04-12 15:31:42 +02:00
Joost Jager
2b43da4220
Merge pull request #2944 from joostjager/increase-test-timeout
htlcswitch/test: increase test timeout for hodl invoice tests
2019-04-12 11:50:20 +02:00
Joost Jager
40cea6b487
htlcswitch/test: increase test timeout for hodl invoice tests 2019-04-12 09:01:05 +02:00
Olaoluwa Osuntokun
dd48a36226
Merge pull request #2933 from Roasbeef/recovery-docs
docs: add new recovery.md explaning methods of fund recovery
2019-04-11 19:42:01 -07:00
Conner Fromknecht
9946372d52
make/testing_flags: extend itest timeout from 20m to 30m 2019-04-11 18:13:33 -07:00
Olaoluwa Osuntokun
5d68f0f9eb
htlcswitch: only perform CLTV checks for HTLCs with open invoices
In this commit, we fix a bug that would cause a node with a hodl HTLC to
cancel back the HTLC upon restart if the invoice has been settled, but
the HTLC is still present on the commitment transaction. A fix for the
HTLC still being present (not triggering a new commitment) has been
fixed recently. However, for older nodes with a lingering HTLC, on
restart it would be failed back.

In this commit, we make the check stricter by only performing these
checks for HTLCs that are in the open state. This ensures that we'll
only check this constraints the first time around, before the HTLC has
been transitioned to the accepted state.
2019-04-11 17:53:25 -07:00
Olaoluwa Osuntokun
5fc6cbc6d8
docs: add new recovery.md explaning methods of fund recovery 2019-04-11 16:56:57 -07:00
Conner Fromknecht
fd80866627
lnd_test: bump timeout for darwin builds 2019-04-11 16:26:11 -07:00
Olaoluwa Osuntokun
f9a08044dc
release: update release build to include select sub-servers 2019-04-11 16:04:42 -07:00
Olaoluwa Osuntokun
d817b8c9db
server: remove duplicate HistoricalSyncTicker param 2019-04-11 16:01:17 -07:00
Conner Fromknecht
5b3170d542 lnd_test: apply AsyncBenchmarkTimeout to async_payments_benchmark
It was mistakenly only applied to async_bidirectional_payments, which
can also see timeouts due to darwin fsync performance regression.
2019-04-11 15:54:21 -07:00
Olaoluwa Osuntokun
b089eb8c83
Merge pull request #2928 from philippgille/feature/update-go-version
Update Go version from 1.11 to 1.12
2019-04-11 15:51:47 -07:00
Olaoluwa Osuntokun
a8c6d03fae
Merge pull request #2929 from cfromknecht/delay-restored-chan-reestablish
htlcswitch/link: delay restored channel reestablish
2019-04-11 15:50:07 -07:00
Wilmer Paulino
4bb4b0fe4e discovery: increase DefaultHistoricalSyncInterval to one hour
Assuming a graph size of 50,000 channels, an interval of 20 minutes
would cause nodes to consume about 600MB per month in bandwidth doing
these routine historical sync spot checks. In this commit, we increase
to one hour, which consumes about 300MB per month.
2019-04-11 15:46:22 -07:00
Wilmer Paulino
be727ab0be config+server: expose HistoricalSyncInterval flag
This allows us to set how often the daemon should routinely perform
historical graph syncs.
2019-04-11 15:45:19 -07:00
Conner Fromknecht
057bed2b92
htlcswitch/link: delay restored channel reestablish
This commit adds a brief delay when sending our channel reestablish
message if the link contains a restored channel to ensure we first have
a stable connection. Sending the message will cause the remote peer to
force close the channel, which currently may not be resumed reliably if
the connection is being torn town simultaneously. This delay can be
removed after the force close is reliable, but in the meantime it
improves the reliability of successfully closing out the channel and
allows the `channel_backup_restore/restore_during_creation` to pass
reliably.
2019-04-11 15:42:02 -07:00
Olaoluwa Osuntokun
6963a92950
Merge pull request #2931 from cfromknecht/channel-backup-flake
lnd_test: use WaitNoError when testing num singles in...
2019-04-11 15:39:36 -07:00
Olaoluwa Osuntokun
bc425b1a77
Merge pull request #2918 from joostjager/hodl-drop-fix
htlcswitch: ensure commit tx gets updated after settle hodl invoice
2019-04-11 15:38:56 -07:00
Olaoluwa Osuntokun
7a0c9f33bc
Merge pull request #2923 from Roasbeef/scb-peer-fixes
multi: peer related SCB fixes
2019-04-10 21:33:26 -07:00
Conner Fromknecht
f19a6a0ba2
lnd_test: use WaitNoError when testing num singles in...
export_channel_backup. Fixes a local flake hit reliably on darwin.
2019-04-10 19:23:08 -07:00
Olaoluwa Osuntokun
7b0a31217f
chanrestore: ensure we have no existing connections to recovery peer
In this commit, we fix a slight bug in the existing implantation that
would cause no channel recovery if the recovering node was already
connected to their channel peer. As we need the link to be known at the
time of connection, if we're already connected, then the chan sync
message won't be sent again. By first disconnecting an existing peer, we
ensure that during the next connection (after the recovered channel is
added to the database), then the regular chan sync message exchange will
take place as expected.  # Please enter the commit message for your
changes.
2019-04-10 18:01:54 -07:00
Olaoluwa Osuntokun
5ac9ba6472
htlcswitch: synchronously send the chan sync message to the remote peer
In this commit, we modify the starting link logic to always send the
chan sync message to the remote peer in a synchronous manner. Otherwise,
it's possible that we fail very quickly below this block, and don't ever
send the message to the remote peer.
2019-04-10 18:01:52 -07:00
Olaoluwa Osuntokun
71e080a2fb
chanrestore: don't exit with an error if we're already connected to the peer
In this commit, we fix a bug in the existing logic for ConnectPeer that
would cause an SCB restore to fail if we were already connected to the
peer. To fix this, we now instead will just return with a success if
we're already connected to the peer.
2019-04-10 18:01:51 -07:00
Olaoluwa Osuntokun
c0d2ffc87e
Merge pull request #2917 from Roasbeef/private-chan-updates
discovery: don't send private chan updates to wider network
2019-04-10 17:58:40 -07:00
Olaoluwa Osuntokun
4b57fb199f server: add new errPeerAlreadyConnected error type 2019-04-10 17:27:58 -07:00
Olaoluwa Osuntokun
58aa32035c
Merge pull request #2921 from cfromknecht/skip-unknown-edges
channeldb/graph: skip unknown edges in FetchChanInfos
2019-04-10 17:18:13 -07:00
Olaoluwa Osuntokun
de621246a9
Merge pull request #2925 from halseth/newaddress-log-level
[trivial] rpcserver: demote newaddress log to debug, log addr type
2019-04-10 17:07:22 -07:00
Olaoluwa Osuntokun
53beed7aaf
discovery: send policy updates for private channels directly to the remote peer
In this commit, we modify the main loop in `processChanPolicyUpdate` to
send updates for private channels directly to the remote peer via the
reliable message sender. This fixes a prior issue where the remote peer
wouldn't receive new updates as this method doesn't go through the
traditional path for channel updates.
2019-04-10 17:05:51 -07:00
Olaoluwa Osuntokun
a9d6273828
discovery: add new TestPropagateChanPolicyUpdate test case
In this commit, we add a new test case to exercise a recent bug fix to
ensure that we no longer broadcast private channel policy changes. Along
the way, a few helper functions were added to slim down the test to the
core logic compared to some of the existing tests in this package. In
the future, these new helper functions should be utilized more widely for
tests in this package in order to cut down on some of the duplicated
logic.
2019-04-10 17:05:49 -07:00
Olaoluwa Osuntokun
a6ae397f8c
discovery: ensure we don't broadcast policy changes for private channels 2019-04-10 17:05:48 -07:00
Olaoluwa Osuntokun
921eea9f57
discovery: update mockGraphSource to implement ForAllOutgoingChannels 2019-04-10 17:05:47 -07:00
Olaoluwa Osuntokun
aba32de1f4
discovery: set AnnSigner for mock signer in testCtx 2019-04-10 17:05:44 -07:00
Olaoluwa Osuntokun
13b91e6ea1 discovery: properly set short chan IDs for ann sigs in tests 2019-04-10 17:05:37 -07:00
Joost Jager
72c86fbf5d
htlcswitch/test: test revocation window exhaustion 2019-04-10 21:30:31 +02:00
Philipp Gille
c99c1f59f3 docs: update Go version from 1.11 to 1.12
- Also changed "go" to "Go" when used as a name
- Also changed "http" to "https" for two URLs that support HTTPS
2019-04-10 21:15:18 +02:00
Philipp Gille
31602026db docker: update Go version from 1.11 to 1.12 2019-04-10 21:13:11 +02:00
Joost Jager
6d2dfed03d
htlcswitch: increase batch counter for exit hop settle and fail
The idea of the batch counter is to increase it for commit tx updates,
so that if the commit tx cannot be updated immediately (revocation
window exhausted), the batch ticker makes sure it happens later.

The batch counter was increased for forwarded htlcs, but not for exit hop
resolutions.

This lead to the situation where the commitment tx would not be updated,
even though the htlc was settled locally. When no other changes happen
on the channel, the htlc eventually reaches its expiry and the channel
is force closed.
2019-04-10 21:04:51 +02:00