Commit Graph

92 Commits

Author SHA1 Message Date
Andras Banki-Horvath
d161b34ee5
lnd: integrate leader elector to lnd main
This commit also changes the order of DB init to be run after the RPC
server is up. This will allow us to later add an RPC endpoint to be used
to query leadership status.
2021-05-04 17:33:08 +02:00
Andras Banki-Horvath
41532ce634
cluster: add etcd based leader elector and factory 2021-05-04 17:33:07 +02:00
Andras Banki-Horvath
9992e5c0b5
etcd: decouple embedded etcd instance startup
This refactor changes how we instantiate the etcd based Backend to allow
separate initialization and startup for the embedded instance.
2021-05-04 17:33:05 +02:00
Andras Banki-Horvath
6757e14998
etcd: refactors to simplify etcd configuration
This refactor removes a redundancy where we had etcd configuration under
kvdb and kvdb/etcd packages.
2021-05-04 17:33:04 +02:00
Andras Banki-Horvath
44e312ace9
etcd: remove (unused) etcd root bucket prefix
This commit removes the unused prefix from the etcd backend config as
etcd key space separation in LND is implemented by using namespaces
instead.
2021-05-04 17:32:59 +02:00
Wilmer Paulino
2084cb0ad5
lncfg: add config options for new neutrino options 2021-04-29 13:56:17 -07:00
Olaoluwa Osuntokun
6c27de7d11
routing: add strict pruning as new flag, default for neutrino
In this commit we add a new flag that controls if lnd will do strict
zombie pruning or not. If true, then this will cause lnd to maintain a
tighter graph as it wants both edges to always be live. We enable this by
default for neutrino as without this, it's possible that a node never
sees both edges begin disabled, so those edges are never actually pruned
from the graph.
2021-04-21 13:56:29 -05:00
Olaoluwa Osuntokun
25dfbc4106
Merge pull request #5193 from wpaulino/neutrino-assume-valid
Use routing.assumechanvalid=true by default in Neutrino mode
2021-04-13 15:37:51 -07:00
Wilmer Paulino
56c536583f
lncfg: add new PrunedNodeMaxPeers config option/flag 2021-04-06 14:55:19 -07:00
Oliver Gugger
6fe4114e96
lncfg+sample-lnd.conf: deprecate routing.assumechanvalid 2021-03-30 15:19:05 +02:00
Oliver Gugger
c43a9ea71f
lncfg+sample-lnd.conf: add --neutrino.validatechannels 2021-03-30 15:18:59 +02:00
Wilmer Paulino
dcac5a87f4
lncfg: expose channel update rate limiting options 2021-03-16 11:42:29 -07:00
Olaoluwa Osuntokun
3ad8b86bac
Merge pull request #5007 from Roasbeef/ipv6-tor-parse-fix
lncfg: add IPv6 resolution bypass & account for local hostname aliases
2021-02-10 23:49:47 -08:00
Olaoluwa Osuntokun
e41091a765
lncfg: detect tor resolution error case and fallback to system resolver
In this commit, we fix a bug that would cause resolution of items in
/etc/hosts (or the like) to fail as Tor wouldn't recognize them as
proper host names. With this commit, we'll catch this error and fall
back to the system's resolver.
2021-02-10 18:36:57 -08:00
Olaoluwa Osuntokun
099efadd92
lncfg: use net.ParseIP to detect IPv6 addresses 2021-02-10 18:35:53 -08:00
Wilmer Paulino
1f1f7be770
Revert "lncfg: add new legacy protocol option to turn off gossip throttling"
This reverts commit b1fbbcf5622317575b0917593cfd16602043621d.
2021-02-10 15:45:49 -08:00
rockstardev
57ac57ea66
fix: correct no-rest-tls parameter in error message 2021-02-07 13:22:53 -06:00
eugene
80eb5dbece
lncfg: add isIPv6Host helper to force v6 addrs through system resolver
With this commit, if --tor.active is specified, then IPv6 addresses
will no longer go through the connmgr.TorLookupIP function from btcd.
This function does not have proper IPv6 support and would fail with
the error "tor general error". Instead, use the system resolver.
2021-02-05 15:37:39 -05:00
Conner Fromknecht
fcd5cb625a
config: expose gossip.pinned-syncers for conf
The pinned syncer set is exposed as a comma-separated list of pubkeys.
2021-01-29 00:19:47 -08:00
Olaoluwa Osuntokun
ff897db293
Merge pull request #4901 from bhandras/etcd_itest_ci
etcd+itests: use itest generated ports for embedded etcd and add etcd itests to travis CI
2021-01-14 17:53:54 -08:00
Johan T. Halseth
c86761f1b3
lncfg: make anchor commitments opt-in
This commit reverts the anchors-by-default change, and instead make
anchor commitments and opt-in option. The plan is to enable anchors by
default further down the line.
2021-01-14 09:09:42 +01:00
Oliver Gugger
236294622e
config+lncfg+sample-lnd.conf: fix feeurl documentation
A new top level feeurl option was added recently to replace the neutrino.feeurl
option. The new option was never added to the sample config file and the
text was never updated to reflect that the option is required for
neutrino on mainnet. We fix this and also add a valid mainnet example
URL to the sample config file.
2021-01-11 09:27:19 +01:00
Andras Banki-Horvath
f1831f0581
etcd: add support for user specified ports for testing 2021-01-08 15:39:11 +01:00
Johan T. Halseth
64659e6156
protocol+rpctest: disable anchors by default for itests 2020-12-15 10:13:28 +01:00
Johan T. Halseth
c92c06400b
config+protocol: enable anchor commitments (zero-fee HTLC ) by default 2020-12-15 10:13:25 +01:00
Yong
582b164c46
kvdb: add timeout options for bbolt (#4787)
* mod: bump btcwallet version to accept db timeout

* btcwallet: add DBTimeOut in config

* kvdb: add database timeout option for bbolt

This commit adds a DBTimeout option in bbolt config. The relevant
functions walletdb.Open/Create are updated to use this config. In
addition, the bolt compacter also applies the new timeout option.

* channeldb: add DBTimeout in db options

This commit adds the DBTimeout option for channeldb. A new unit
test file is created to test the default options. In addition,
the params used in kvdb.Create inside channeldb_test is updated
with a DefaultDBTimeout value.

* contractcourt+routing: use DBTimeout in kvdb

This commit touches multiple test files in contractcourt and routing.
The call of function kvdb.Create and kvdb.Open are now updated with
the new param DBTimeout, using the default value kvdb.DefaultDBTimeout.

* lncfg: add DBTimeout option in db config

The DBTimeout option is added to db config. A new unit test is
added to check the default DB config is created as expected.

* migration: add DBTimeout param in kvdb.Create/kvdb.Open

* keychain: update tests to use DBTimeout param

* htlcswitch+chainreg: add DBTimeout option

* macaroons: support DBTimeout config in creation

This commit adds the DBTimeout during the creation of macaroons.db.
The usage of kvdb.Create and kvdb.Open in its tests are updated with
a timeout value using kvdb.DefaultDBTimeout.

* walletunlocker: add dbTimeout option in UnlockerService

This commit adds a new param, dbTimeout, during the creation of
UnlockerService. This param is then passed to wallet.NewLoader
inside various service calls, specifying a timeout value to be
used when opening the bbolt. In addition, the macaroonService
is also called with this dbTimeout param.

* watchtower/wtdb: add dbTimeout param during creation

This commit adds the dbTimeout param for the creation of both
watchtower.db and wtclient.db.

* multi: add db timeout param for walletdb.Create

This commit adds the db timeout param for the function call
walletdb.Create. It touches only the test files found in chainntnfs,
lnwallet, and routing.

* lnd: pass DBTimeout config to relevant services

This commit enables lnd to pass the DBTimeout config to the following
services/config/functions,
  - chainControlConfig
  - walletunlocker
  - wallet.NewLoader
  - macaroons
  - watchtower
In addition, the usage of wallet.Create is updated too.

* sample-config: add dbtimeout option
2020-12-07 15:31:49 -08:00
Marty Jones
c04773963b
healthcheck: add healthcheck to shutdown if cert is expired (#4792)
In certain container set ups, it's useful to optionally have lnd just shutdown if it detects that its certs are expired, as assuming there's a hypervisor to restart the container/pod, then upon restart, lnd will have fully up to date certs.
2020-12-01 18:34:19 -08:00
Olaoluwa Osuntokun
b1fbbcf562
lncfg: add new legacy protocol option to turn off gossip throttling 2020-11-30 16:38:53 -08:00
Conner Fromknecht
82a238317c
lncfg+itest: expose configurable batch-commit-interval
This will permit a greater degree of tuning or customization depending
on various hardware/environmental factors.
2020-11-25 16:45:25 -08:00
Andras Banki-Horvath
511e817624
lncfg+channeldb: add config to be able to run lnd on embedded etcd 2020-11-18 15:34:43 +01:00
Olaoluwa Osuntokun
e4f0f2aa69
Merge pull request #4667 from guggero/auto-compact
channeldb/kvdb/bolt: automatically compact database on startup
2020-11-16 17:50:14 -08:00
Oliver Gugger
f8907fdb47
multi: add AutoCompact option to bolt backend
With this commit we thread the new AutoCompact flags all the way through
to the bolt backend.
2020-11-13 10:19:49 +01:00
Oliver Gugger
6131a53eb4
lncfg+channeldb: add autocompact flags to BoltConfig 2020-11-13 10:19:49 +01:00
Oliver Gugger
1548528a3f
lncfg+sample-lnd.conf: add DNS seed flag to chain cfg 2020-11-13 09:49:18 +01:00
Johan T. Halseth
4d0537d4c3
config: enforce safe use of TLS 2020-11-11 09:37:53 +01:00
carla
f4136decae
multi: add max local csv config option
To allow nodes more control over the amount of time that their funds
will be locked up, we add a MaxLocalCSVDelay option which sets the
maximum csv delay we will accept for all channels. We default to the
existing constant of 10000, and set a sane minimum on this value so that
clients cannot set unreasonably low maximum csv delays which will result
in their node rejecting all channels.
2020-11-04 13:55:37 +02:00
Olaoluwa Osuntokun
297c614126
Merge pull request #4701 from carlaKC/4581-removeexperimential
multi: remove experimential build flag for assumechanvalid
2020-11-03 17:34:50 -08:00
Eugene
46ef212de4 lnd+lncfg: move normalizeNetwork to lncfg 2020-10-29 15:20:00 -04:00
carla
c92b030652
multi: remove experimential build flag for assumechanvalid 2020-10-21 14:13:50 +02:00
Conner Fromknecht
e135047304
Merge pull request #4353 from LN-Zap/feat/neutrino-user-agent
Ability to configure neutrino useragent
2020-09-23 16:45:19 -07:00
Joost Jager
2ebfb64b9b
Merge pull request #4606 from joostjager/cpfp-sweep-prep
cnct+sweep+itest: preparations for cpfp-aware sweeper
2020-09-16 11:48:39 +02:00
Joost Jager
fc3fd26a3d
config: allow web fee estimation on regtest 2020-09-15 10:29:14 +02:00
Olaoluwa Osuntokun
ffe7c3e626
Merge pull request #4473 from yyforyongyu/allow-no-auth-private-addr
lncfg: allow no auth on private addresses
2020-09-14 19:03:27 -07:00
carla
5a73029442
multi: add minimum disk space check 2020-08-24 09:38:11 +02:00
carla
c365a16656
healthcheck: monitor access to chain backend
Add a new health check package which will periodically poll health
check functions and shutdown if we do not succeed after our set number
of attempts. The first check that we add is one for our chain backend,
to ensure that we are connected to a bitcoin node.
2020-08-24 09:35:36 +02:00
Olaoluwa Osuntokun
7355c8ba3a
lncfg: add new GetBackends which returns active DB backends
In this commit, we modify the existing `GetBackend` method to now be
called `GetBackends`. This new method will populate a new `RemoteDB`
attribute based on if the replicated backend is active or not. As is,
the local backend is used everywhere. An upcoming commit will once again
re-enable the remote backend, in a hybrid manner.
2020-08-07 18:44:00 -07:00
Olaoluwa Osuntokun
e616903d4f
config: unify old and new config values for sync-freelist
In this commit, unify the old and new values for `sync-freelist`, and
also ensure that we don't break behavior for any users that're using the
_old_ value.

To do this, we first rename what was `--db.bolt.no-sync-freelist`, to
`--db.bolt.sync-freelist`. This gets rid of the negation on the config
level, and lets us override that value if the user is specifying the
legacy config option.

In the future, we'll deprecate the old config option, in favor of the
new DB scoped option.
2020-08-04 18:55:00 -07:00
yyforyongyu
3a3b5413b9
lncfg: allow no auth on private addresses 2020-07-22 22:50:25 +08:00
Olaoluwa Osuntokun
5345069b16
server+lncfg: add new config flag to enable wumbo channels
In this commit, we add a new config flag to enable wumbo channels, with
the default being that nodes reject all wumbo channel attempts.
2020-07-10 16:27:13 -07:00
Olaoluwa Osuntokun
43a355321f
lncfg: split off protocol options into normal and legacy, normal reqs no build tag
In this commit, we split off the protocol options into a normal and
legacy sub-config. The legacy sub-config protected by a built tag, and
will only be populated if thet tag is set. Legacy options now have a
`legacy` prefix. So `--protocol.legacyonion` is now `--protocol.onion`,
and `--protocol.committweak`, is now `--protocol.legacy.committweak`.

We also create a new experimental protocol feature sub-config for newer
features that may not yet been fully complete, so they require a build
tag.
2020-07-10 16:27:12 -07:00