1003 Commits
Author SHA1 Message Date
Conner Fromknecht 094ce09644 server: log tower client error on stop (lint) 2020-11-25 15:06:17 -08:00
Conner Fromknecht 60ad01e9c2 server: initialize distinct anchor tower client 2020-11-25 15:05:56 -08: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 32ee527f6b server+htlcswitch: auto compact sphinx DB too 2020-11-13 10:19:51 +01:00
Oliver Gugger 35c1fad517 server+healthcheck: rename function, add absolute disk space function
With this commit we rename the existing AvailableDiskSpace function to
its correct name AvailableDiskSpaceRatio as it only returns a ratio. We
then go ahead and add a new function that returns the actual number of
free bytes available on a file system.

This also fixes some comments and always returns an error instead of
panicking.
2020-11-13 10:19:50 +01:00
Oliver Gugger 08042405c7 server: allow overwriting of DNS seeds 2020-11-13 10:07:03 +01:00
carla ca3b36c4b1 multi: use uptime api for bitcoind healthcheck if version > 0.15
The getblockchaininfo call in bitcoind uses a commonly used lock,
csmain, in bitcoind. This made the endpoint unsuitable for a health
check, because some nodes were seeing waits up to 5 minutes (!). This
commit updates our health check function to use the uptime api, provided
our bitcoind version is > 0.15, when the api was added. We do not need
to switch our health check for btcd, because it has more granular
locking.
2020-11-11 11:26:15 +02:00
carla 91bf59df17 multi: allow specifying max csv for locally initiated channels 2020-11-04 13:55:39 +02: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 9571088756 lnd: log errors for ChainControl when shutting down 2020-10-29 15:24:17 -04:00
Eugene bebe258e2d chainregistry+lnd: moving chainregistry+chainparams to new package 2020-10-29 15:24:14 -04:00
Eugene 4d238cfa2f lnd: export ChainControl, ChainRegistry 2020-10-29 15:20:00 -04:00
Eugene 933b959aa8 chainreg: export ChainCode to new pkg
Moves chainCode from the lnd package to the chainreg package,
where it is exported and can be used by other packages.
2020-10-29 15:19:57 -04:00
carla c92b030652 multi: remove experimential build flag for assumechanvalid 2020-10-21 14:13:50 +02:00
eugene e0859e121f multi: add fmgr.Manager interface, change usage in peer to use Manager
This gets rid of several config functions in the peer and should pave
the way for easier testing of the funding manager and peer.
2020-10-01 10:27:13 -04:00
eugene fada3dd871 server.go + peer: use MessageConn interface instead of brontide.Conn 2020-09-25 12:05:36 -04:00
Wilmer Paulino a5c5304c09 Merge pull request #4452 from yyforyongyu/add-connection-timeout
lnrpc+tor: add network connection timeout
2020-09-16 12:28:29 -07:00
Joost Jager 3531c3fbbe Merge pull request #4602 from joostjager/proportional-attempt-cost
routing: proportional attempt cost
2020-09-16 14:12:19 +02:00
yyforyongyu 469aba9282 lnd+rpcserver: allow customized timeout in ConnectPeer 2020-09-16 11:50:04 +08:00
Calvin Zachman f5fb64e552 add new max channel size config option
- let users specify their MAXIMUM WUMBO with new config option which sets the maximum channel size lnd will accept
- current implementation is a simple check by the fundingManager rather than anything to do with the ChannelAcceptor
- Add test cases which verify that maximum channel limit is respected for wumbo/non-wumbo channels
- use --maxchansize 0 value to distinguish set/unset config. If user sets max value to 0 it will not do anything as 0 is currently used to indicate to the funding manager that the limit should not be enforced. This seems justifiable since --maxchansize=0 doesn't seem to make sense at first glance.
- add integration test case to ensure that config parsing and valiation is proper. I simplified the funding managers check electing to rely on config.go to correctly parse and set up either i) non wumbo default limit of 0.16 BTC OR ii) wumbo default soft limit of 10 BTC

Addresses: https://github.com/lightningnetwork/lnd/issues/4557
2020-09-14 21:16:32 -05:00
Joost Jager bbfeeec8b1 routing: add proportional attempt cost 2020-09-08 15:47:08 +02:00
Joost Jager 17a6175e8b routing+routerrpc: rename PaymentAttemptPenalty to AttemptCost
Make field names consistent with the command line flag.
2020-09-08 14:07:56 +02:00
carla a550ca3d64 multi: store peer flap rate on disk on best effort basis
Since we will use peer flap rate to determine how we rate limit, we
store this value on disk per peer per channel. This allows us to
restart with memory of our peers past behaviour, so we don't give badly
behaving peers have a fresh start on restart. Last flap timestamp is
stored with our flap count so that we can degrade this all time flap
count over time for peers that have not recently flapped.
2020-09-08 13:49:46 +02:00
carla 94accfb69d chanfitness: pass clock in to chaneventstore for testing 2020-09-08 13:47:15 +02:00
carla 3aa008ab04 multi: add interface for subscribe client so it can be mocked
The current implementation of subscribe is difficult to mock because
the queue that we send updates on in unexported, so you cannot create
a subscribe.Client object and then add your own updates. While it is
possible to run a subscribe server in tests, subscribe servers will
shutdown before dispatching their udpates to all clients, which can be
flakey (and is difficult to workaround). In this commit, we add a
subscription interface so that these testing struggles can be addressed
with a mock.
2020-09-08 13:47:13 +02:00
Conner Fromknecht 5c91be3f57 config+rpcserver: allow configurable defualt-remote-max-htlcs 2020-08-24 20:11:23 -07:00
Conner Fromknecht ef69537c7f fundingmanager: add maxHtlcs to openChanReq 2020-08-24 20:08:19 -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
András Bánki-Horváth c3821e5ad1 Merge pull request #4493 from bhandras/invoice_gc
invoices: garbage collect settled/canceled invoices
2020-08-24 08:34:58 +02:00
Conner Fromknecht d04df11c44 Merge pull request #4505 from Crypt-iQ/activeNet_cleanup_0803
lnd: removing activeNetParams global, passed around instead via configs
2020-08-20 12:59:15 -07:00
Conner Fromknecht fd3f7ca6c8 Merge pull request #4434 from carlaKC/labels-general
multi: add labels to lnd native transactions
2020-08-20 12:58:04 -07:00
Olaoluwa Osuntokun 4603b3f981 lnd: properly pass peer remote db for graph, local db for rest
In this commit, we fix a mistake in the split for the new `peer`
package/struct when instantiating the config needed. The existing code
had the DB's swapped. In this commit, we fix this to pass the remote DB
for generic channeldb access, and the local DB for channel graph access.
2020-08-12 14:07:43 -07:00
nsa 3791c9efcb lnd: removing activeNetParams global, passed around instead via configs
This commit removes the activeNetParams global in chainparams.go. This
is necessary to isolate code from the lnd package so we can import it
for use in tests, other projects, etc.
2020-08-11 11:41:24 -04:00
Olaoluwa Osuntokun f58b00ef55 multi: split database storage into remote and local instances
In this commit, we split the database storage into two classes: remote
and local data. If etcd isn't active, then everything is actually just
local though we use two pointers everywhere. If etcd is active, then
everything but the graph goes into the remote database.
2020-08-07 18:44:02 -07:00
Andras Banki-Horvath 2aa680ede2 invoices: optionally garbage collect invoices on the fly
This commit extends invoice garbage collection to also remove invoices
which are canceled when LND is already up and running. When the option
GcCanceledInvoicesOnTheFly is false (default) then invoices are kept and
the behavior is unchanged.
2020-08-05 12:24:17 +02:00
Andras Banki-Horvath a0d7877d9a multi: make canceled invoice garbage collection configurable
This commit extends the application config with a flag to control canceled
invoice garbage collection upon startup.
2020-08-05 12:24:16 +02:00
carla 2a614cc596 multi: add labels to lnd native transactions
Follow up labelling of external transactions with labels for the
transaction types we create within lnd. Since these labels will live
a life of string matching, a version number and rigid format is added
so that string matching is less painful. We start out with channel ID,
where available, and a transaction "type". External labels, added in a
previous PR, are not updated to this new versioned label because they
are not lnd-initiated transactions. Label matching can check this case,
then check for a version number.
2020-07-29 13:46:07 +02:00
Olaoluwa Osuntokun 6f208bce40 server+funding: use max values for csv delay and confs for wumbo channels 2020-07-10 16:27:17 -07:00
Olaoluwa Osuntokun 8177fed302 funding: allow incoming wumbo channel requests if wumbo is enabled 2020-07-10 16:27:15 -07:00
Olaoluwa Osuntokun 6243838444 server: remove unused globalFeatures variable
Everything is done through the feature manager now, so we don't need to
set these feature bits manually anymore.
2020-07-10 16:27:14 -07: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
Wilmer Paulino 9e8c39d4a2 Merge pull request #971 from vctt94/addMaxValueFlag
Add max value in flight flag
2020-07-07 10:29:51 -07:00
Olaoluwa Osuntokun 3a2f3504a5 Merge pull request #4281 from Roasbeef/host-ann
netann: add new HostAnnouncer to support dynamic IPs via domains
2020-07-06 18:12:15 -07:00
Olaoluwa Osuntokun ba3688c3b9 netann: add new HostAnnouncer to support dynamic IPs via domains
In this commit, we add a new sub-system, then `HostAnnouncer` which
allows a users without a static IP address to ensure that lnd always
announces the most up to date address based on a domain name. A new
command line flag `--external-hosts` has been added which allows a user
to specify one or most hosts that should be periodically resolved to
update any advertised IPs the node has.

Fixes #1624.
2020-07-06 17:30:08 -07:00
nsa cbd54101f8 multi: remove peer.go, change all references to point to peer pkg 2020-07-06 19:16:07 -04:00
nsa 9be9d69349 multi: initialize peer with peer.Config 2020-07-06 19:16:07 -04:00
nsa bf161c9835 peer+server: add HandleLocalCloseChanReqs to peer, call from server 2020-07-06 19:16:07 -04:00
nsa 0dda9e06ce multi: exporting PendingUpdate, ChannelCloseUpdate, ErrorBufferSize 2020-07-06 19:16:06 -04:00