Commit Graph

4748 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
3438baaf0c
routing: eliminate nested db transactions by using new FetchOtherNode method 2018-08-09 20:48:06 -07:00
Olaoluwa Osuntokun
0f3c0ccf85
channeldb: add new FetchOtherNode method to ChannelEdgeInfo
In this commit, we add a new method to the ChannelEdgeInfo that will
allow the path finding logic to get the node opposite the pivot node
without first creating a new db transaction. The new method is able to
use an existing db transaction, or create a new one if needed.
2018-08-09 20:47:01 -07:00
Olaoluwa Osuntokun
ce7bfae4f7
channeldb: ensure we always check error from fetchChanEdgePolicy 2018-08-09 20:46:04 -07:00
Olaoluwa Osuntokun
0109672835
channeldb: add new db field for ChannelEdgeInfo to allow new methods 2018-08-09 20:45:39 -07:00
Joost Jager
29b6bae4ed routing: convert fee limit test to table-driven 2018-08-09 20:23:40 -07:00
Joost Jager
3e7473f4f0 routing: backward searching 2018-08-09 20:23:40 -07:00
Joost Jager
e52d829168 routing: path finding test refactored 2018-08-09 20:23:40 -07:00
Joost Jager
6c918a1806 channeldb: store unknown policies in database
The commit ensures that for every channel, there will always
be two entries in the edges bucket. If the policy from one or
both ends of the channel is unknown, it is marked as such.

This allows efficient lookup of incoming edges. This is
required for backwards payment path finding.
2018-08-09 20:23:40 -07:00
Olaoluwa Osuntokun
d2612e51bd
Merge pull request #1644 from wpaulino/kw-fees
multi: switch to sat/kw fees
2018-08-09 20:19:28 -07:00
Olaoluwa Osuntokun
d64bb5921e
Merge pull request #1635 from halseth/funding-broadcast-fail
Move funding tx broadcasting to Fundingmanager
2018-08-09 20:04:30 -07:00
Olaoluwa Osuntokun
cc6348088c
Merge pull request #1714 from Roasbeef/update-btcd-neutrino-fix
build: update to use latest btcd
2018-08-09 18:27:20 -07:00
Wilmer Paulino
336f1c156e
rpcserver: convert sat/vbyte fee rates input by the user to sat/kw
In this commit, we explicitly convert sat/vbyte fee rates input by the
user to sat/kw. We do this as users are typically more accustomed to
sat/vbyte fee rates, rather than sat/kw.
2018-08-09 17:29:53 -07:00
Wilmer Paulino
9d2eeb6304
multi: update to latest fee estimation interface 2018-08-09 17:29:52 -07:00
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
bf4283f069
build: update to use latest btcd
In this commit, we update the set of deps to use the latest version of
btcd. Namely this version fixes a bug in re-org handling logic, ensures
that btcd will always respond to getheaders (fixes #511), and also
ensure that it will properly respond to cfheaders messages which is
required for the neutrino sync to operate smoothly.
2018-08-09 17:15:41 -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