Commit Graph

4727 Commits

Author SHA1 Message Date
Wilmer Paulino
a63677a381
multi: switch to transaction weight to calculate transaction fees
Due to a recent change within the codebase to return estimated fee rates
in sat/kw, this commit ensures that we use this fee rate properly by
calculing a transaction's fees using its weight. This includes all of
the different transactions that are created within lnd (funding, sweeps,
etc.). On-chain transactions still rely on a sat/vbyte fee rate since it's
required by btcwallet.
2018-08-09 17:29:50 -07:00
Wilmer Paulino
b3d5d7ab9c
lnwallet: switch fee estimation to return sat/kw fee rates
In this commit, we modify our FeeEstimator interface to return an
estimated fee rate in sat/kw. Recently, due to low fees on the network,
users have been experiencing failures broadcasting transactions due to
not meeting specific fee requirements. This was happening more often
than not, as the estimated fee returned by backend nodes (bitcoind and
btcd) only takes into account vbytes, rather than weight. The fees
returned are also expressed in sat/kb, so we must take care that we do
not lose precision while converting to sat/kw. In the event that this
happens, a fee floor of 253 sat/kw has been added. This fee rate
originates from bitcoind rounding up the conversion from weight to
vbytes.
2018-08-09 17:29:48 -07:00
Olaoluwa Osuntokun
30b156c706
Merge pull request #1566 from wpaulino/bitcoind-rescan-client
multi: share the same bitcoind connection between multiple rescan clients
2018-08-09 17:10:57 -07:00
Offer Markovich
57d87aef3b test: ensure integration tests use unique context timeouts for each assertion 2018-08-09 12:37:30 -07:00
Olaoluwa Osuntokun
bb310a3d0d
Merge pull request #1681 from cfromknecht/lock-chain-arb-shutdown
contractcourt/chain_arbitrator: fix potential shutdown race
2018-08-08 22:03:53 -07:00
Wilmer Paulino
e58486b599
docs: note that different ZMQ sockets must be used with bitcoind 2018-08-08 20:26:31 -07:00
Wilmer Paulino
936fcc1f16
multi: update to latest BitcoindClient interface
In this commit, we introduce a nice optimization with regards to lnd's
interaction with a bitcoind backend. Within lnd, we currently have three
different subsystems responsible for watching the chain: chainntnfs,
lnwallet, and routing/chainview. Each of these subsystems has an active
RPC and ZMQ connection to the underlying bitcoind node. This would incur
a toll on the underlying bitcoind node and would cause us to miss ZMQ
events, which are crucial to lnd. We remedy this issue by sharing the
same connection to a bitcoind node between the different clients within
lnd.
2018-08-08 20:26:30 -07:00
Wilmer Paulino
75192a15e3
config: parse different ZMQ hosts for block and tx notifications
Due to recent changes to the BitcoindClient interface, we now require
the backing bitcoind to use different hosts for its ZMQ raw block and
raw transaction notifications. This was needed as the notification queue
maintained by the bitcoind node would sometimes overflow with
transactions and cause block notifications to be dropped/missed.
In this commit, we expand extractBitcoindRPCParams to account for this.
2018-08-08 20:26:29 -07:00
Wilmer Paulino
533a45574c
build: update to btcwallet with bitcoind conn changes 2018-08-08 20:26:28 -07:00
Olaoluwa Osuntokun
61681a59eb
Merge pull request #1705 from Roasbeef/neutrino-update
build: update neutrino to latest version
2018-08-08 20:22:08 -07:00
Olaoluwa Osuntokun
97f9759ee1
Merge pull request #1675 from cfromknecht/peer-backoff-backoff
server: peer backoff backoff
2018-08-08 20:03:28 -07:00
Olaoluwa Osuntokun
8a56b33aa6
Merge pull request #1702 from wpaulino/peer-bootstrapper-backoff
server: prevent increasing epochErrors if conn was established
2018-08-08 19:54:54 -07:00
Olaoluwa Osuntokun
31117e6b30
lnwallet: lower timeout for waitForWalletSync back to 10s 2018-08-08 19:48:21 -07:00
Olaoluwa Osuntokun
a368205fc6 build: update to latest version neutrino
In this commit, we update to the latest version of neutrino. This
version contains a number of bug fixes, and optimizations. Additionally
this version will allow the lnwallet re-org tests to once again pass
reliably on Travis.
2018-08-08 19:48:01 -07:00
Wilmer Paulino
0de0a39291
server: prevent increasing epochErrors if conn was established
In this commit, we fix a small bug where we would increase epochErrors
by one even if connections were successfully established. Due to this,
we would stay stuck inside of the peer bootstrapper loop without
requerying for new peers.
2018-08-08 17:24:14 -07:00
Olaoluwa Osuntokun
8379bbaa9b
Merge pull request #1673 from cfromknecht/prevent-db-reversions
channeldb: fail Open on db reversion
2018-08-07 15:47:02 -07:00
Conner Fromknecht
a704c67791
server: compute backoff with connection duration relaxation 2018-08-07 14:50:11 -07:00
Conner Fromknecht
60edca164c
peer: adds StartTime() used to compute backoff relaxation 2018-08-07 14:50:07 -07:00
Olaoluwa Osuntokun
33a5567a0f
Merge pull request #1691 from wpaulino/sync-gopkg
build: sync Gopkg.lock with Gopkg.toml
2018-08-06 16:15:33 -07:00
Wilmer Paulino
17556f4799
build: sync Gopkg.lock with Gopkg.toml 2018-08-06 13:11:46 -07:00
Conner Fromknecht
8758671552
contractcourt/chain_arbitrator: fix potential shutdown race
This commit fixes a potential race condition during
shutdown, that could allow the chain arb's
activeWatchers or activeChannels map to be modified
while ranging over their contents. We fix this by
copying the contents into new maps with the mutex
held, before releasing the mutex and shutting down
each watcher or channel arbitrator.
2018-08-03 16:46:41 -07:00
Conner Fromknecht
f0f5e11b82
Merge pull request #1661 from cfromknecht/restore-linter
Makefile: Restore linter
2018-08-03 03:13:58 -07:00
Conner Fromknecht
e3138004ca
Makefile: restore broken linter 2018-08-02 18:20:50 -07:00
Conner Fromknecht
cf2c371042
multi: fix linting errors 2018-08-02 18:20:50 -07:00
Conner Fromknecht
8beeeb1944
macaroons/constraints_test: remove extraneous semicolon 2018-08-02 18:20:50 -07:00
Conner Fromknecht
9eff876f52
routing/pathfind_test: fmt whitespace 2018-08-02 18:20:49 -07:00
Conner Fromknecht
614b3b3862
routing/pathfind: fmt whitespace 2018-08-02 18:20:49 -07:00
Conner Fromknecht
1ded697e8d
multi: sort import paths with gofmt 2018-08-02 18:20:49 -07:00
Conner Fromknecht
dff7706d04
channeldb/meta_test: adds TestMigrationReversion
Adds a test asserting that we will fail to open
a channeldb with a version higher than the
highest known version to the current build of
lnd.
2018-08-02 18:18:49 -07:00
Conner Fromknecht
e23fc40d63
channeldb/db: check for db reversions on startup 2018-08-02 16:46:17 -07:00
Conner Fromknecht
ee34b9c7b0
channeldb/error: adds ErrDBReversion error
Adds an error for signaling that we detected
the case where a user is trying to revert
to prior version before a db migration.
2018-08-02 16:45:03 -07:00
Conner Fromknecht
d0179eb6b5
Merge pull request #1669 from Roasbeef/funding-mgr-server-init
funding+server: move initialization of funding manager into the server
2018-08-02 14:30:00 -07:00
Olaoluwa Osuntokun
33979b2636
funding+server: move initialization of funding manager into the server
In this commit, we move the initialization of the server into the
funding manager itself. We do this as it's no longer the case that _any_
RPC needs to access the funding manager. In the past, this was the
only reason that the funding manager was instantiated outside of the
server: to be able to respond to queries _before_ the server was
started.

This change also fixes a bug as atm, the funding manager will try to
register for notifications _before_ the ChainNotifier itself has fully
started.
2018-08-01 16:02:55 -07:00
Olaoluwa Osuntokun
f6ea91af71
Merge pull request #1579 from Roasbeef/gcs-modifications
multi: update primary interfaces to be compatible with latest version of BIP 158, use latest btcd+neutrino+btcwallet
2018-08-01 12:41:09 -07:00
Olaoluwa Osuntokun
b1a775b29e
chainntnfs/neutrinonotify: update async conf dispatch to use scripts 2018-07-31 21:29:04 -07:00
Olaoluwa Osuntokun
f7d9b8e6b0
lnwallet: increase timeout in waitForWalletSync for new neutrino re-org logic 2018-07-31 21:29:03 -07:00
Olaoluwa Osuntokun
40806532c7
funding: fix import paths for test 2018-07-31 21:29:03 -07:00
Olaoluwa Osuntokun
3c60861005
routing/chainview: give neutrino backend more time to catch up for re-org test
In this commit, we modify the test to explitlcy give the neutrino
backend more time to catch up compared to the RPC backends. We do this
as a recent change has been made in the neutrino backend to wait for the
filter headers to finish syncing before proceeding with the rescan
itself. As a result, we'll need to account for this in the test and
sleep enough to give the backend a chance to catch up.
2018-07-31 21:29:03 -07:00
Olaoluwa Osuntokun
293a377edd
lnwallet: modify IsSynced() for neutrino backend to ensure filter headers are synced 2018-07-31 21:29:02 -07:00
Olaoluwa Osuntokun
2d71b5a0d5
build: update build to point to latest versions of btcd+btcwallet+neutrino 2018-07-31 21:29:02 -07:00
Olaoluwa Osuntokun
d9969f5dc2
contractcourt: update contract resolvers to use pkScripts for spend ntfns 2018-07-31 21:29:01 -07:00
Olaoluwa Osuntokun
c6950fcc2f
contractcourt: update channel arbitrator unit tests due to recent API changes 2018-07-31 21:29:01 -07:00
Olaoluwa Osuntokun
08e11d197d
contractcourt: update chain watcher to make funding pkScript for spend ntfn 2018-07-31 21:29:00 -07:00
Olaoluwa Osuntokun
ac9f9bd061
contractcourt: remove now obsolete code from the chain arbitrator
We no longer need this code fragment as the chain watcher is now able to
handle confirmed cooperative channel closures itself.
2018-07-31 21:29:00 -07:00
Olaoluwa Osuntokun
ab5b8b8fac
breacharbiter: use the pkScript of the breached output for spend ntnfs 2018-07-31 21:28:59 -07:00
Olaoluwa Osuntokun
62ab7424af
breacharbiter: update second level pkScript as well
In this commit, we update the convertToSecondLevelRevoke function to
also upgrade the second level pkScript as well. This is required as
we'll need to use this for a confirmation notification once we sweep the
output in the case that the remote party goes to the second layer.
2018-07-31 21:28:59 -07:00
Olaoluwa Osuntokun
53416260e3
htlcswitch: update test to account for new ChainNotifier API 2018-07-31 21:28:58 -07:00
Olaoluwa Osuntokun
067db8572c
test+lnd: update unit test mocks to adhere to new interface API's 2018-07-31 21:28:58 -07:00
Olaoluwa Osuntokun
88bedec65b
discovery: update unit tests to account for new ChainNotifier API 2018-07-31 21:28:57 -07:00
Olaoluwa Osuntokun
343c1b80d2
lnwallet: update NewBreachRetribution to include pkScripts for htlc outputs
In this commit, we update the NewBreachRetribution method to include
pkScripts for htlc outputs. We do this now, as the breach arbiter will
need the raw pkScript when attempting to request spend notifications for
each HTLC.
2018-07-31 21:28:57 -07:00