Commit Graph

5195 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
55e9ef0157
Merge pull request #1887 from cfromknecht/parallel-chain-watcher-start
contractcourt/chain_arbitrator: parallel chain watcher start
2018-09-11 19:38:40 -07:00
Olaoluwa Osuntokun
ea5a18f4e5
Merge pull request #1886 from Roasbeef/lax-migration-assumptions
channeldb: relax bucket assumptions for latest db migration
2018-09-11 19:18:03 -07:00
Olaoluwa Osuntokun
2c48ec8dde
Merge pull request #1877 from halseth/garbage-collect-link-nodes
[integration tests] Fix flake in persistent connection pruning test
2018-09-11 19:17:21 -07:00
Conner Fromknecht
0c74575c44
contractcourt/chain_arbitrator: parallel chain watcher start
This commit restructures the initialization procedure
for chain watchers such that they can proceed in parallel.
This is primarily to help nodes running with the neutrino
backend, which otherwise forces a serial rescan for each
active channel to check for spentness.

Doing so allows the rescans to take advantage of batch
scheduling in registering for the spend notifications,
ensuring that only one or two passes are made, as opposed
to one for each channel.

Lastly, this commit ensures that the chain arb is properly
shutdown if any of it's chain watchers or channel arbs
fails to start, so as to cancel their goroutines before
exiting.
2018-09-11 16:10:29 -07:00
Olaoluwa Osuntokun
09924f3f2c
channeldb: relax bucket assumptions for latest db migration
In this commit, we no longer assume that the bucket hierarchy has been
created properly when applying the latest DB migration. On older nodes
that never obtained a channel graph, or updated _before_ the query sync
stuff was added, then they're missing buckets that the migration expects
them to have.

We fix this by simply creating the buckets as we go, if needed.
2018-09-11 16:09:25 -07:00
Olaoluwa Osuntokun
d050cedd02
Merge pull request #1872 from Roasbeef/create-proper-buckets
channeldb: fix bucket creation hierarchy in createChannelDB
2018-09-11 16:04:40 -07:00
Johan T. Halseth
598904fbb9
lnd_test: restart nodes twice to trigger pruning logic 2018-09-11 10:25:48 +02:00
Johan T. Halseth
a926665358
lnd_test: make sure we stay disconnected using WaitInvariant in testGarbageCollectLinkNodes 2018-09-11 10:25:48 +02:00
Olaoluwa Osuntokun
3e67321aa7
channeldb: fix bucket creation hierarchy in createChannelDB
In this commit, we fix a bug in the bucket creation code in
createChannelDB. This bug can cause migrations on older nodes to fail,
as we expect the bucket to already have been created. With this commit,
we ensure that all the buckets under the main node and edges bucket are
properly created. Otherwise, a set of the newer migrations will fail to
apply for nodes updating from 0.4.
2018-09-09 15:49:28 -07:00
Olaoluwa Osuntokun
874002022f
channeldb: remove unused fwdPackageLogBucket key
In this commit, we move the declaration of the key for an unused bucket.
In the past, this bucket was used to store the revocation forwarding
package log. However, this has been moved under the key
`fwdPackagesKey`.
2018-09-09 15:47:52 -07:00
Olaoluwa Osuntokun
1941353fb2
Merge pull request #1824 from cfromknecht/gossip-delay-reply
discovery/syncer: delay replies after initial sync to prevent DOS
2018-09-09 15:28:22 -07:00
Francisco Calderon
98712c037d cmd/lncli: fix missing whitespaces on lncli queryroutes desc
Adds whitespaces missing on command description,
without those whitespaces at the end of the line
it showed the words together
2018-09-09 15:16:00 -07:00
Olaoluwa Osuntokun
6831ad3fa3
Merge pull request #1861 from wpaulino/connect-tor-if-active
server: ensure persistent connections to tor addrs are made if active
2018-09-08 18:13:06 -07:00
Olaoluwa Osuntokun
e63a5c3d77
Merge pull request #1855 from halseth/amt-paid-msat
Add amt_paid_msat to invoice
2018-09-08 18:12:39 -07:00
Olaoluwa Osuntokun
b343ef24e7
cmd/lncli+fundingmanager: use a default num min confs for 1 for openchannel 2018-09-08 14:41:03 -07:00
Olaoluwa Osuntokun
d4fdc41c8c
Merge pull request #1864 from Roasbeef/btcwallet-update-panic-fix
build: update btcwallet to latest version
2018-09-07 13:12:56 -07:00
Johan T. Halseth
d742529bb2
rpcserver: set AmtPaidMsat when creating RPC invoice 2018-09-07 14:13:48 +02:00
Johan T. Halseth
90a9f5882a
lnrpc: add field amt_paid_msat to Invoice 2018-09-07 14:13:48 +02:00
Olaoluwa Osuntokun
712453bbc2
build: update btcwallet to latest version
In this commit, we update btcwallet to the latest version which fixes a
panic bug when attempting to notify a relevant transaction.
2018-09-06 20:44:59 -07:00
Wilmer Paulino
59c404a6d3
server: ensure persistent connections to tor addrs are made if active
In this commit, we restrict the persistent connection logic on startup
to only attempt to establish connections to Tor addresses if Tor
outbound support is enabled. Otherwise, we'll continually attempt to
reach the address even though we never will.
2018-09-06 18:51:19 -07:00
Olaoluwa Osuntokun
dcd8190c80
Merge pull request #1853 from cfromknecht/short-chan-id-compare
lnwire/lnwire_test: assert nil 0-length sid reply msg
2018-09-06 18:20:31 -07:00
Olaoluwa Osuntokun
0121fe8465
Merge pull request #1862 from Roasbeef/chan-series-test-fixes
multi: fix panic bug in chan series, itest test flake, update neutrino to latest version
2018-09-06 18:19:33 -07:00
Olaoluwa Osuntokun
5aed80b5ce
build: update to latest version of neutrino
In this commit we update to the latest version of neutrino which fixes a
bug in the filter header syncing logic.
2018-09-06 16:58:08 -07:00
Olaoluwa Osuntokun
555b7db602
test: fix flake in link node garbage collection test
In this commit, we fix a flake in the link node garbage collection test
by ensuring the channels have been fully closed on both sides before we
attempt to restart and ensure that they don't actually establish
connections. Without this check, it's possible that either side hasn't
yet processed all the blocks, so they'll still reconnect to each other on
start up.
2018-09-06 16:57:32 -07:00
Olaoluwa Osuntokun
27ecfbbd36
lntest: log the expected and last balance in WaitForBalance error case 2018-09-06 16:49:27 -07:00
Olaoluwa Osuntokun
09d4660524
chanseries: fix panic bug by ensuring we access a non-nil edge
In this commit, we fix an existing but that would cause the daemon to at
times crash. Before this commit, we access the wrong edge, which would
possibly actually be nil, leading to a panic. In this commit we fix this
by ensuring we access the proper edge which is known to be non-nil at
this point in the control flow.
2018-09-06 16:48:55 -07:00
Conner Fromknecht
dc0030f11d
discovery/gossiper: remove go-errors pkg 2018-09-05 22:08:16 -07:00
Conner Fromknecht
045a2c7fff
discovery/syncer_test: add DOS delayed replies test 2018-09-05 22:08:16 -07:00
Conner Fromknecht
557cb6e253
discovery/syncer: delay replies after initial sync to prevent DOS 2018-09-05 22:08:16 -07:00
Olaoluwa Osuntokun
fb95858afc
Merge pull request #1740 from valentinewallace/fix-historical-ntfns-reorg-test
chainntnfs/interface_test: fix unreliable historical block ntfns test
2018-09-05 21:01:42 -07:00
Olaoluwa Osuntokun
a1137a4f68
Merge pull request #1818 from cfromknecht/aplt-track-pending-conns
autopilot: prevent duplicate conns to same peer
2018-09-05 21:01:18 -07:00
Conner Fromknecht
85a2d4640f
lnwire/lnwire_test: assert nil 0-length sid reply msg 2018-09-05 20:54:06 -07:00
Conner Fromknecht
d5f97f7bdc
autopilot/multi: replace PubKey -> NodeKey on directive 2018-09-05 20:10:37 -07:00
Conner Fromknecht
e702a6a266
autopilot/agent_test: remove Fatalf calls from goroutines 2018-09-05 20:10:36 -07:00
Conner Fromknecht
2b578e06fc
autopilot/agent_test: ensure directives use unique keys
This commit ensures that the mock attachment
directives use unique keys, ensuring that they
aren't skipped due to already having pending
connection requests. The tests fail when
they're all the same since they collide
in the pendingConns map.
2018-09-05 20:10:35 -07:00
Conner Fromknecht
7d9483c20d
autopilot/agent_test: adds TestAgentSkipPendingConns
Adds a test asserting that the agent prevents
itself from making duplicate outstanding
connection requests to the same peer.
2018-09-05 20:10:35 -07:00
Conner Fromknecht
c214bea9db
autopilot/prefattach: set NodeID for selection candidates 2018-09-05 20:10:34 -07:00
Conner Fromknecht
08b6bf54fb
autopilot/interface: expose NodeID in AttachmentDirective 2018-09-05 20:10:34 -07:00
Conner Fromknecht
4599b0eac3
autopilot/agent: track pending connections
This commit modifies the autopilot agent to track
all pending connection requests, and forgo further
attempts if a connection is already present.
Previously, the agent would try and establish
hundreds of requests to a node, especially if the
connections were timing out and not returning.

This resulted in an OOM OMM when cranking up
maxchannels to 200, since there would be close
to 10k pending connections before the program was
terminated. The issue was compounded by periodic
batch timeouts, causing autopilot to try and
process thousands of triggers for failing
connections to the same peer.

With these fixes, autopilot will skip nodes that we
are trying to connect to during heuristic selection.
The CPU and memory utilization have been significantly
reduced as a result.
2018-09-05 20:10:34 -07:00
Olaoluwa Osuntokun
4100dfcf6b
Merge pull request #1801 from cfromknecht/remove-initial-graph-sync-request
server: Stop requesting initial graph sync
2018-09-05 19:16:56 -07:00
Olaoluwa Osuntokun
1ac1092aaa
lnd: ensure that we set the wallet birthday for --noencryptwallet
In this commit, we ensure that we always set the wallet birthday. If the
user has provided a seed, or is creating a new one, then it will be
overwritten below. However, before this commit, if a user started with
the --noencryptwallet flag, then we would _always_ start to rescan from
genesis with the recent bug fix to ensure that we always start after the
birthday.
2018-09-05 18:58:48 -07:00
Conner Fromknecht
055dc233a1 lnwire/features: add required gq to local features
This commit adds the required feature name to our
set of local known features. This will allow other
peers connecting to us to set the required gossip
queries feature bit. This is required for the
subsequent commits, which instruct the server to
set the bit depending on user configured preferences.
2018-09-05 18:51:04 -07:00
Olaoluwa Osuntokun
aec1e84e3e
Merge pull request #1844 from wpaulino/prune-peer-conn-disk-chans
peer: prune persistent peer connection on zero on-disk channels
2018-09-05 18:45:54 -07:00
Wilmer Paulino
ea51ec34b1
peer: prune persistent peer connection on zero on-disk channels
In this commit, we fix a small bug with regards to the persistent peer
connection pruning logic. Before this commit, it'd be the case that we'd
prune a persistent connection to a peer if all links happen to be
inactive. This isn't ideal, as the channels are still open, so we should
always be atttempting to connect to them. We fix this by looking at the
set of channels on-disk instead and prune the persistent connection if
there aren't any.
2018-09-05 18:30:45 -07:00
Olaoluwa Osuntokun
b0347879db
Merge pull request #1817 from halseth/autopilot-node-update
Reduce goroutine overhead on autopilot updates
2018-09-05 18:08:37 -07:00
Olaoluwa Osuntokun
b2efbce1ac
Merge pull request #1849 from cfromknecht/resync-golock
dep: constrain siphash, x/sys, and errgo.v1 + upd neutrino
2018-09-05 17:58:49 -07:00
Olaoluwa Osuntokun
d2a7d910b7
Merge pull request #1825 from Roasbeef/extra-gossip-message-data
channeldb+discovery: ensure we store, validate and propagate announcements with opaque data
2018-09-05 17:53:02 -07:00
Olaoluwa Osuntokun
146e0efe71
Merge pull request #1802 from wpaulino/equal-zmq-conf-error
config: ensure ZMQ options are not equal and defer creating lnddir until all flag parsing is done
2018-09-05 17:33:40 -07:00
Conner Fromknecht
322e53ec5f
dep: constrain siphash, x/sys, and errgo.v1, upd neutrino 2018-09-05 17:08:59 -07:00
Olaoluwa Osuntokun
785efcfaa2
channeldb: also ignore the EOF error when trying to read ExtraOpaqueBytes
In this commit, we account for the additional case wherein the
announcement hasn't yet been written with the extra zero byte to
indicate that there aren't any remaining bytes to be read. Before this
commit, we accounted for the case where the announcement was written
with the extra byte, but now we ensure that legacy nodes that upgrade
will be able to boot properly.
2018-09-05 16:42:23 -07:00