Commit Graph

7953 Commits

Author SHA1 Message Date
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
Conner Fromknecht
8bb4337cac
Makefile: run coverage tests with -tags=debug 2018-08-09 13:46:08 -07:00
Offer Markovich
57d87aef3b test: ensure integration tests use unique context timeouts for each assertion 2018-08-09 12:37:30 -07:00
Ben Woosley
896128efd0
Move noiseDial from config.go to server.go
noiseDial is only called from server.go, has nothing to do with configuration,
and moving it removes config.go's reliance on btcec and brontide.
2018-08-09 15:13:05 -04:00
Conner Fromknecht
8cc4681201
test_utils: init switch with default fwd/log tickers 2018-08-09 02:48:07 -07:00
Conner Fromknecht
d5d01dd575
server: configure switch w/ default log/fwd tickers 2018-08-09 02:48:07 -07:00
Conner Fromknecht
2762546eeb
peer: replace NewBatchTicker with ticker.New 2018-08-09 02:48:07 -07:00
Conner Fromknecht
c90ec19595
htlcswitch/test_utils: repalce mockTicker with new MockTicker 2018-08-09 02:48:07 -07:00
Conner Fromknecht
6a709526d8
htlcswitch/mock: remove mockTicker, use ticker.MockNew 2018-08-09 02:48:07 -07:00
Conner Fromknecht
2651136806
htlcswitch/link_test: replace mockTicker with ticker.Mock 2018-08-09 02:48:07 -07:00
Conner Fromknecht
e3253a4f3b
htlcswitch/switch: add log/fwd event tickers to Config 2018-08-09 02:48:07 -07:00
Conner Fromknecht
1c456a5144
htlcswitch/link: replace batch ticker with...
resumable ticker.Ticker interface
2018-08-09 02:48:06 -07:00
Conner Fromknecht
83353b44bd
ticker/ticker_test: adds Ticker interface tests 2018-08-09 02:48:06 -07:00
Conner Fromknecht
eeab500de7
ticker/mock: adds debug Mock Ticker
This commit adds a Mock Ticker, implementing the
Ticker interface. The ticker abides by the
behavioral requirements of the production
implementation, but also includes the ability to
force feed ticks while the Ticker is paused.

This commit also places the mock.go file behind
the debug build flag. This allows us to import
the MockTicker into our unit tests.
2018-08-09 02:48:06 -07:00
Conner Fromknecht
f8fe26fb06
ticker/ticker: adds resumable Ticker interface 2018-08-09 02:48:00 -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
f
0ae268397b lncli: add confirmPayreq used when paying 2018-08-07 18:37:35 -07:00
Conner Fromknecht
fab87e5880
Makefile: switch to gometalinter.v2 2018-08-07 16:57:40 -07:00
Conner Fromknecht
a76b9a86cd
routing/chainview/interface_test: use EdgePoint field names 2018-08-07 16:57:40 -07:00
Conner Fromknecht
b608fca447
htlcswitch/circuit_test: use CircuitKey field names 2018-08-07 16:57:40 -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