Commit Graph
100 Commits
Author SHA1 Message Date
Conner Fromknecht f94de2308f chainntnfs/txconfnotifier: return HistoricalConfDispatch from Register 2018-10-26 18:32:29 -07:00
Conner Fromknecht 74122e00f5 chainntnfs/txconfnotifier: add PkScript to ConfNtfn 2018-10-26 18:32:29 -07:00
Conner Fromknecht 37c864d6f6 chainntnfs/txconfnotifier: add HistoricalConfDispatch struct 2018-10-26 18:32:29 -07:00
Conner Fromknecht e804b30669 chainntnfs/txconfnotifier_test: update to use multi-value Register 2018-10-26 18:32:29 -07:00
Conner Fromknecht cf7700e6cb chainntnfs/bitcoind+btcd+neutrino: let tcn query for height hint 2018-10-26 18:32:29 -07:00
Conner Fromknecht 8b8007bb5a chainntnfs/txconfnotifier: query conf hint in Register 2018-10-26 18:32:28 -07:00
Conner Fromknecht a1756b0b1b chainntnfs/bitcoind+btcd+neutrino: pass nil conf details 2018-10-26 18:32:28 -07:00
Conner Fromknecht 1babec971f chainntnfs/txconfnotifier: isolate scanning ntfns 2018-10-26 18:32:28 -07:00
Conner Fromknecht 2f0b5596da chainntnfs/txconfnotifier: add rescanStates 2018-10-26 18:32:28 -07:00
Conner Fromknecht 012d17efaa chainntnfs/txnotifier_test: update nil spend details to restore tests 2018-10-26 18:32:28 -07:00
Conner Fromknecht 7661d00d5a chainntnfs/txconfnotifier_test: update height hint cache test 2018-10-26 18:32:28 -07:00
Conner Fromknecht d3bde428ea chainntnfs/txconfnotifier_test: use tcn instead of txConfNotifier 2018-10-26 18:32:28 -07:00
Conner Fromknecht fd6024c306 watchtower/wtdb/mock: adds MockDB for debug build 2018-10-24 20:18:21 -07:00
Conner Fromknecht da56aa3528 lnd_test: process all node/edge updates in graph_top_itest
This commit modifies the graph topology test to
properly count channel updates and node
announcments in the event that they are batched
into a single topology update. The prior logic
made the assumption that they were always in
distinct topology updates, so this method should
be more general and robust.
2018-10-24 19:20:01 -07:00
Conner Fromknecht f9cec4a67b cnct/contract_resolvers: propagate checkpoint failures 2018-10-24 13:57:10 -07:00
Conner Fromknecht f957b78c0b cnct/contract_resolvers: ignore duplicate publication error 2018-10-24 13:57:10 -07:00
Conner Fromknecht 682c4c96c7 cnct/contract_resolvers: reliably publish htlc success sweep 2018-10-24 13:57:10 -07:00
Conner Fromknecht b7aebd92cf cnct/contract_resolvers: reliably publish commit sweep 2018-10-24 13:57:10 -07:00
Conner Fromknecht 9ab620c7be watchtower/wtwire/error_code: add shared error codes 2018-10-23 18:28:23 -07:00
Conner Fromknecht 999466c860 watchtower/wtwire/error: add generic error message 2018-10-23 18:28:22 -07:00
Conner Fromknecht d171df5184 watchtower/wtwire/features: add watchtower feature bits 2018-10-23 18:28:20 -07:00
Conner Fromknecht 5ba95585e5 watchtower/wtwire/init: borrow LN init msg for WT init 2018-10-23 18:28:19 -07:00
Conner Fromknecht 4325d9ec1e watchtower/wtwire/wtwire: add watchtower message codec 2018-10-23 18:23:08 -07:00
Conner Fromknecht cae4f43c19 sweep/sweeper: ignore unknown witness types
This commit restores the sweep behavior of
filtering inputs with unknown witness types
from the final sweep transaction. Currently,
such inputs will be included without adding
anything to the weight estimate, possibly
creating a transaction with insufficient fees.
2018-10-17 16:21:06 -07:00
Conner Fromknecht c2d9cb11d3 docs/MAKEFILE: add log params to unit test targets 2018-10-05 13:04:45 +09:00
Conner Fromknecht 1881ccdaf2 Makefile: merge build+install tags with DEV/PROD_TAGS, trim whitespace 2018-10-05 13:04:45 +09:00
Conner Fromknecht 57ec03564e make/testing_flags: add LOG_TAGS, set using log envvar
The default is nolog, which prevents the unit tests in
the main pkg from being active, since otherwise they
would print as if they were being run like a dev build
of the daemon. Users can pass in custom tags when running
the Makefile by passing arguments using the log variable,
e.g. log="xxxxx xxx"".
2018-10-05 13:04:45 +09:00
Conner Fromknecht 2e489fcf24 rpcserver: replace DebugBuild cmp w/ IsDevBuild in AbandonChannel 2018-10-05 13:04:45 +09:00
Conner Fromknecht 5706c12d69 config_production: remove in favor of build.Deployment 2018-10-05 13:04:45 +09:00
Conner Fromknecht a98cdfd897 config_debug: remove in favor of build.Deployment 2018-10-05 13:04:45 +09:00
Conner Fromknecht ecc5d267e3 Makefile: use git describe for better commit versions 2018-10-05 13:04:45 +09:00
Conner Fromknecht 0903fe3183 main+lnd: display build.Version() for commit hash 2018-10-05 13:04:45 +09:00
Conner Fromknecht 97fd56cf47 cmd/lncli: display build.Version() for commit hash 2018-10-05 13:04:45 +09:00
Conner Fromknecht 1e64070a1d build/version: move version.go to build pkg 2018-10-05 13:04:45 +09:00
Conner Fromknecht bbceec8bea lnd: log shutdown before closing rotator 2018-10-05 13:04:45 +09:00
Conner Fromknecht bfcda6e205 log: initialize subloggers w/ build.LogWriter
and build.NewSubLogger
2018-10-05 13:04:45 +09:00
Conner Fromknecht 59b459674d multi: init subsystem loggers via build pkg 2018-10-05 13:04:45 +09:00
Conner Fromknecht 9654a1c619 build/log: add log types + NewSubLogger 2018-10-05 13:04:45 +09:00
Conner Fromknecht 4ea1a40a88 build/loglevel: add build flag hooks for log levels 2018-10-05 13:04:45 +09:00
Conner Fromknecht 738ba45bcf build/deployment: add prod+dev targets 2018-10-05 13:04:45 +09:00
Conner Fromknecht 10b35a8f20 main: remove disable log in testing + clean up imports 2018-10-05 13:04:45 +09:00
Conner Fromknecht bab52421fa make/testing_flags: make DEV_TAGS+PROD_TAGS, switch debug to dev 2018-10-05 13:04:45 +09:00
Conner Fromknecht ece3051237 htlcswitch/hodl: switch from debug tag to dev 2018-10-05 13:04:45 +09:00
Conner Fromknecht 3403794e81 chainntnfs: switch debug tag to dev
This avoids collisions with the logging level tags
2018-10-05 12:59:34 +09:00
Conner Fromknecht 91b0e9cae5 chainntnfs/txconfnotifier: commit conf hints before notifying 2018-10-02 01:09:26 -07:00
Conner Fromknecht 7dceac92d2 chainntnfs/neutrino: commit spend hints before notifying 2018-10-02 01:09:26 -07:00
Conner Fromknecht e498a837a3 chainntnfs/btcd: commit spend hints before notifying 2018-10-02 01:09:26 -07:00
Conner Fromknecht fb7b12a7db chainntnfs/bitcoind: commit spend hints before notifying 2018-10-01 16:47:01 -07:00
Conner Fromknecht b5b8602820 chainntnfs/neutrinonotify/neutrino: remove height shadowing
This commit removes shadowing of the currentHeight
variable when registering for neutrino spend
notifications. Currently, a locally scoped variable
is used when determining if the backend is fully
synced before attempting to call GetUtxo, which
means that the variable won't be updated after
breaking out of the loop. As a result, this could
cause us to scan unnecessarily if the backend is
catching up, e.g. after being offline for some time.
2018-09-20 18:47:04 -07:00
Conner Fromknecht 652ec893e0 lntest/node: persist network subscription state across restarts 2018-09-20 18:28:48 -07:00
Conner Fromknecht 974ec02d24 channeldb/migrations: improve performance of edge update migration
This commit modifies the edge update index
migration to avoid repetitive calls to
Cursor.First(). Instead, we construct a set
of all edge update keys to remove, and then do
a second pass to remove each from the bucket.
Additional log messages are included to notify
users on progress, as some have reported long
migration times.
2018-09-17 00:05:24 -07:00
Conner Fromknecht 3974dbeda0 make: clean lnd-debug, lncli-debug and .vendor-new 2018-09-13 14:17:33 -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
Conner Fromknecht 3f3e2bf4e8 dep: add golang.org/x/time for rate limiter 2018-09-11 00:12:36 -07:00
Conner Fromknecht a56e7122d6 discovery/syncer: use rate limiter for gossip queries
This commit replaces the simplistic rate limiting
technique added in 557cb6e2, to use the
golang.org/x/time's rate limiter. This has the
benefit of performing traffic shaping to meet a
target maximum rate, and yet tolerate bursts. Bursts
are expected during initial sync, though should become
more rare afterwards. Performing traffic shaping with
this mechanism should improve the ability of the gossip
syncer to detect sustained bursts from the remote peer,
and penalize them appropriately.

This commit also modifies the default parameters to
accept bursts of 10 queries, with a target rate of 1
reply every 5 seconds.
2018-09-11 00:12:35 -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
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
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
Conner Fromknecht 322e53ec5f dep: constrain siphash, x/sys, and errgo.v1, upd neutrino 2018-09-05 17:08:59 -07:00
Conner Fromknecht 98518706b2 sample-lnd.conf: remove noencryptwallet flag from sample 2018-09-04 20:52:44 -07:00
Conner Fromknecht 13e4fe2104 docker/lnd/start-lnd.sh: pass noseedbackup instead of noencryptwallet 2018-09-04 20:52:44 -07:00
Conner Fromknecht 8e017465c0 macaroons/README: update noencryptwallet -> noseedbackup 2018-09-04 20:52:44 -07:00
Conner Fromknecht e47412be3a docs/INSTALL: remove noencryptwallet from install docs
We will be slowly phasing this out, though abruptly
discontinuing support would be a more extensive change.
For now, we will ensure that this feature is not
recommended to users setting up a new wallet.
2018-09-04 20:52:43 -07:00
Conner Fromknecht d75a01ec83 walletunlocker/service: change noencryptwallet reference to noseedbackup 2018-09-04 20:52:43 -07:00
Conner Fromknecht fb3ace9b28 lnd: use default enc pw when noseedbackup is passed 2018-09-04 20:52:43 -07:00
Conner Fromknecht 7c4abd2418 lntest/node: change noencryptwallet to noseedbackup 2018-09-04 20:52:43 -07:00
Conner Fromknecht d11212dd61 cmd/lncli/commands: change noencryptwallet -> noseedbackup 2018-09-04 20:52:43 -07:00
Conner Fromknecht d85e58f435 config: rename noencryptwallet to noseedbackup
This commit renames the confusing noencryptwallet
flag to noseedbackup, since this highlights the more
crucial information of the flags behavior to the user.
The description has also been capitalized to urge
the user think twice about what they're doing.
2018-09-04 20:52:43 -07:00
Conner Fromknecht 8e94e55839 discovery/gossiper: require explict gossip syncer init
This commit removes the fallback in fetchGossipSyncer
that creates a gossip syncer if one is not registered
w/in the gossiper. Now that we register gossip syncers
explicitly before reading any gossip query messages,
this should not longer be required. The fallback also
did not honor the cfg.NoChanUpdates flag, which may
have led to inconsistencies between configuration and
actual behavior.
2018-09-04 17:32:25 -07:00
Conner Fromknecht 51090a41b5 peer: log disconnect to info, remove go-errors pkg 2018-09-04 17:28:51 -07:00
Conner Fromknecht adf6b8619f peer: dispatch gossip sync in peer start
This commit moves the gossip sync dispatch
such that it is more tightly coupled to the
life cycle of the peer. In testing, I noticed
that the gossip syncer needs to be dispatched
before the first gossip messages come across
the wire.

The prior spawn location in the server happens
after starting all of the peer's goroutines,
which could permit an ordering where the
gossip syncer has not yet been registered.
The new location registers the gossip syncer
within the read handler such that the call is
blocks before any messages are read.
2018-09-04 17:28:50 -07:00
Conner Fromknecht 2415675c3d server: move gossip dispatch to peer
See next commit msg for more detail.
2018-09-04 17:28:50 -07:00
Conner Fromknecht 21a4e21863 server: stop requesting initial graph sync
In this commit, we remove signaling for initial routing
dumps, which create unnecessary log spam, bandwidth, and
CPU. Now that gossip syncing is in full force, we will
instead opt to use the more efficient querying/set
reconciliation. Other nodes may still request initial
gossip sync from us, and we will respond.
2018-09-04 05:04:21 -07:00
Conner Fromknecht 8d7eb41d48 server: always backoff for unstable peers
This commit modifies the connection peer backoff
logic such that it will always backoff for "unstable"
peers. Unstable in this context is determined by
connections whose duration is shorter than 10
minutes. If a disconnect happens with a peer
whose connection lasts longer than 10 minutes,
we will scale back our stored backoff for that peer.

This resolves an issue that would result in a tight
connection loop with remote peers. This stemmed
from the connection duration being very short,
and always driving the backoff to the default
backoff of 1 second. Short connections like
this are now caught by the stable connection
threshold.

This also modifies the computation on the
backoff relaxation to subtract the connection
duration after applying randomized exponential
backoff, which offers better stability when
the connection duration and backoff are roughly
equal.
2018-09-04 03:40:08 -07:00
Conner Fromknecht d706e40ff7 contractcourt/channel_arbitrator: handle onchain close race on restart 2018-09-03 23:12:57 -07:00
Conner Fromknecht 9aaf046481 Makefile: add tags env argument to build and install 2018-09-03 20:15:18 -07:00
Conner Fromknecht 89113654fe routing/conf: add experimental assume valid conf 2018-09-03 20:15:18 -07:00
Conner Fromknecht af0265f8fa config: add experimental assumechanvalid flag 2018-09-03 20:15:18 -07:00
Conner Fromknecht f33cfdaa07 server: pass AssumeChannelValid to router 2018-09-03 20:15:18 -07:00
Conner Fromknecht 1e473b2364 routing/router: add assume chan valid 2018-09-03 20:15:12 -07:00
Conner Fromknecht 09992f3fb0 server: remove unused lightningID field 2018-09-03 18:11:25 -07:00
Conner Fromknecht 9c35528fce server: attempt reconnection to all known addresses 2018-09-03 18:11:21 -07:00
Conner Fromknecht 95a98d86f6 lnd_test: add wait predicates to pending channel checks 2018-08-31 18:34:33 -07:00
Conner Fromknecht c569c40cef lnd_test: prevent calling Fatal in goroutine
This commit prevents an error that I've seen on travis,
wherein the test fails because a call to Fatal happens
after the test finishes. The root cause is that we call
Fatal in a goroutine that is reading from the subscribe
graph rpc call.

To fix this, we now pass an err chan back into the main
test context, where we can receive any errors and fail
the test if one comes through.
2018-08-31 17:11:17 -07:00
Conner Fromknecht 48dc38d9f9 peer: ensure link failures are processed in peer life cycle 2018-08-30 17:36:13 -07:00
Conner Fromknecht a5b9279ca1 lnd_test: correct force close test re: htlc limbo funds
This commit fixes a bug in the integration test, that
reliably fails after disabling the height hint cache.
The test originally asserted that the htlc funds were
in limbo, but was reading a stale copy of the force
close information. Recently, the test was amended to
provided a valid read of the force close in
96a079873a. However,
the issue was not apparent until build against the
disabled height hint cache.

The test is now correct to assert that there are no
funds in limbo, as the commitment output has been
swept, but the htlcs are still in the contract
court, so the nursery is unaware of them. We also
add another sanity check to validate that there are
no pending htlcs on the force close at that point
in time.
2018-08-26 19:55:38 -07:00
Conner Fromknecht 98e7c968d4 chainntnfs/btcdnotify: disable height hint cache in testing 2018-08-26 15:34:20 -07:00
Conner Fromknecht ab28db5b0d chainntnfs/bitcoindnotify: disable height hints in testing 2018-08-26 15:34:05 -07:00
Conner Fromknecht 0e29a457e1 chainregistry: disable height hint cache 2018-08-26 15:32:10 -07:00
Conner Fromknecht 70ba3119b7 lnwallet/interface_test: run tests with disabled hint cache 2018-08-26 15:32:10 -07:00
Conner Fromknecht 12761a4f43 chainntnfs/interface_test: run tests w/ disabled cache 2018-08-26 15:32:10 -07:00