Commit Graph

11202 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
9042a79db2
Merge pull request #4683 from carlaKC/4471-acceptorupfrontshutdown
channelacceptor: add new fields to acceptor response
2020-11-11 17:43:52 -08:00
Conner Fromknecht
b9f031b3e3
Merge pull request #4746 from wpaulino/tower-last-addr
watchtower: prevent removal of last tower addr
2020-11-11 09:27:54 -08:00
Johan T. Halseth
fac355c5a0
Merge pull request #4756 from guggero/itest-flakehunt
itest: add parallel flakehunter
2020-11-11 12:57:33 +01:00
Johan T. Halseth
b525c04432
Merge pull request #4648 from halseth/option-no-tls
RPC: add --no-rest-tls option
2020-11-11 11:52:23 +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
Johan T. Halseth
b529d42929
sample-config: add no-rest-tls 2020-11-11 09:41:23 +01:00
Johan T. Halseth
4d0537d4c3
config: enforce safe use of TLS 2020-11-11 09:37:53 +01:00
Johan T. Halseth
5be7e710c7
RPC: Add --notls to disable TLS for RPC endpoints
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2020-11-11 09:37:52 +01:00
Johan T. Halseth
a2a924e1e5
rpcserver: move TLS listen config to closure 2020-11-11 09:37:52 +01:00
Olaoluwa Osuntokun
36556cb772
Merge pull request #4753 from C-Otto/master
README: remove stray [
2020-11-10 17:41:13 -08:00
carla
5679dde1bc
multi: add channel open parameters to channel acceptor
Add more fields to channel acceptor response so that users can have more
fine grained control over their incoming channels. With our chained
acceptor, it is possible that we get inconsistent responses from
multiple chained acceptors. We create a conjugate repsponse from all the
set fields in our various responses, but fail if we get different, non-
zero responses from our various acceptors. Separate merge functions are
used per type so that we avoid unexpected outcomes comparing interfaces
(panic on comparing types that aren't comparable), with casting used
where applicable to avoid code duplication.
2020-11-10 21:09:10 +02:00
Johan T. Halseth
428ca37301
Merge pull request #2018 from halseth/peer-remove-failed-chans
Mark channels borked in case of remote error
2020-11-10 18:50:47 +01:00
Oliver Gugger
f51f247a1c
docs: describe new itest make commands 2020-11-10 13:57:31 +01:00
Oliver Gugger
47e8882480
make+itest: allow the same test to be run in parallel 2020-11-10 13:57:31 +01:00
carla
0d35ce7561
mutli: move parse upfront shutdown out of rpcserver 2020-11-10 11:40:52 +02:00
carla
38fd7d206f
multi: add custom error messages to channel acceptor
This commit adds an optional error message to the channel acceptor's
reponse to allow operators to inform (or insult) unsuccessful channel
initiators as to the reason for their rejection.

This field is added in addition to the existing accept field to maintain
backwards compatibity. If we were to deprecate accept and interpret a
non-nil error as rejecting the channel, then received a response with
accept=false and a nil error, the server cannot tell whether this is a
legacy rejection or new mesage type acceptance (due to nil error),
so we keep both fields.
2020-11-10 11:38:47 +02:00
carla
54c3e98b40
multi: move channel acceptor logic out of rpcserver
This commit moves and partially refactors the channel acceptor logic
added in c2a6c86e into the channel acceptor package. This allows us to
use the same logic in our unit tests as the rpcserver, rather than
needing to replicate it in unit tests.

Two changes are made to the existing implementation:
- Rather than having the Accept function run a closure, the closure
  originally used in the rpcserver is moved directly into Accept
- The done channel used to signal client exit is moved into the acceptor
  because the rpc server does not need knowledge of this detail (in
  addition to other fields required for mocking the actual rpc).

Crediting orginal committer as co-author:
Co-authored-by: Crypt-iQ
2020-11-10 11:38:45 +02:00
Olaoluwa Osuntokun
339a9d3915
Merge pull request #4754 from carlaKC/chainreg-uselogger
chainreg: register logger
2020-11-09 11:48:51 -08:00
carla
5668b335d3
chainreg: register logger 2020-11-09 14:11:31 +02:00
Carsten Otto
9b28925da2 README: remove stray [ 2020-11-08 13:43:24 +00:00
Oliver Gugger
72cacb9c5e
Merge pull request #1288 from guggero/stateless-init
walletunlocker+lnd: add command line flag to allow passing admin macaroon after wallet creation
2020-11-07 12:39:04 +00:00
Graham Krizek
5aa0d26251
lnrpc+macaroon: skip subserver macaroons on stateless_init
This will prevent the subservers from writing macaroons to disk
when the stateless_init flag is set to true. It accomplishes
this by storing the StatelessInit value in the Macaroon Service.
2020-11-07 11:24:35 +01:00
Oliver Gugger
0b9b7def15
docs: describe stateless wallet initialization 2020-11-07 11:24:35 +01:00
Oliver Gugger
24adf475ce
lnd_test: add integration tests for stateless init 2020-11-07 11:24:35 +01:00
Oliver Gugger
e7aa9256ab
walletunlocker+lnd: implement stateless wallet initialization 2020-11-07 11:24:34 +01:00
Oliver Gugger
4b0b20c98b
walletunlocker: use require library, fix linter issues
To prepare for new tests to be added, we first rewrite the existing
tests to use the require library and get rid of some smaller linter
issues.
2020-11-07 11:24:34 +01:00
Oliver Gugger
b685a97fcd
lnd: shutdown wallet unlocker after macaroon creation
Because we'll need to return the macaroon through the wallet unlocker
we cannot shut down its service before we have done so, otherwise
we'll end up in a deadlock. That's why we collect all shutdown
tasks and return them as a function that can be called after we've
initialized the macaroon service.
2020-11-07 11:24:34 +01:00
Oliver Gugger
71ba2a8e60
lnd: prepare for proper wallet unlocker cleanup
As a preparation for the next commit where we add proper wallet unlocker
shutdown handling, we move the calls that require cleanup down after the
creation of the wallet unlocker service itself.
2020-11-07 11:24:33 +01:00
Oliver Gugger
294cb4a966
macaroons: remember stateless init
To make sure no macaroons are created anywhere if the stateless
initialization was requested, we keep the requested initialization mode
in the memory of the macaroon service.
2020-11-07 11:24:33 +01:00
Oliver Gugger
ae71d60715
macaroons: add ability to change the password or create a new root key 2020-11-07 11:24:33 +01:00
Oliver Gugger
cd85e17b19
macaroons: use require for tests 2020-11-07 11:18:52 +01:00
Oliver Gugger
10673b9dfa
lncli: add flags for stateless init to wallet unlocker commands 2020-11-07 11:18:52 +01:00
Oliver Gugger
4c8d374007
lnrpc: add arguments for stateless wallet initialization to wallet unlocker
This commit adds the --stateless_init flag to all three wallet unlocker
operations. Once you initialize a wallet stateless, you need to set
this flag for every further wallet unlocker operation. Otherwise you
risk non-encrypted macaroon information to leak to the underlying
system.
2020-11-07 11:18:52 +01:00
Olaoluwa Osuntokun
4f4adab1dc
Merge pull request #4738 from positiveblue/fix-wordlist-check
aezeed: fix mnemonic word validation
2020-11-06 13:19:23 -08:00
Roei Erez
4463a4ce17 invoicerpc: Allow user specify routing hints. 2020-11-06 17:54:20 +02:00
András Bánki-Horváth
0c3c6e6155
Merge pull request #4705 from bhandras/kvdb_view_reset
multi: add reset closure to `kvdb.View/Update` to be able to clean up external state before retries
2020-11-06 12:47:35 +01:00
Andras Banki-Horvath
adfd99ec08
etcd: allow readwrite bucket Delete with nil key (bbolt compatibility) 2020-11-05 17:57:13 +01:00
Andras Banki-Horvath
e8f47cf882
invoices: channel graph reference was wrongly retrieved from remote db
This commit fixes a bug where we tried to use the graph from the remote
db instance whereas it lives in the local db instance.
2020-11-05 17:57:13 +01:00
Andras Banki-Horvath
d89f51d1d0
multi: add reset closure to kvdb.Update
Similarly as with kvdb.View this commits adds a reset closure to the
kvdb.Update call in order to be able to reset external state if the
underlying db backend needs to retry the transaction.
2020-11-05 17:57:12 +01:00
Andras Banki-Horvath
2a358327f4
multi: add reset closure to kvdb.View
This commit adds a reset() closure to the kvdb.View function which will
be called before each retry (including the first) of the view
transaction. The reset() closure can be used to reset external state
(eg slices or maps) where the view closure puts intermediate results.
2020-11-05 17:57:12 +01:00
Andras Banki-Horvath
ffb27284df
channeldb: change walletdb dependency to kvdb 2020-11-05 17:57:08 +01:00
Carla Kirk-Cohen
a0ab96de5d
Merge pull request #4735 from carlaKC/2426-defaultmaxcsv
multi: add control over maximum acceptable local CSV delay
2020-11-05 12:39:35 +02:00
Johan T. Halseth
1c96cc7e10
Merge pull request #4546 from bjarnemagnussen/fix-coinselect-tests
chanfunding: Add/improve tests for CoinSelectSubtractFees
2020-11-05 10:21:30 +01:00
Olaoluwa Osuntokun
0552ba93c8
Merge pull request #4655 from guggero/itest-parallel
Travis: run itests in parallel, get ~60% speedup overall
2020-11-04 16:16:49 -08:00
Wilmer Paulino
d3157bcaf8
watchtower: prevent removal of last tower addr
This addresses a potential panic when a tower has one of its candidate
sessions chosen, but its only reachable address was removed by a
user-initiated RPC before the fact.
2020-11-04 15:43:18 -08:00
Bjarne Magnussen
0e2d6dc0a9
chanfunding: match error string when testing CoinSelectSubtractFees 2020-11-04 18:54:57 +01:00
Bjarne Magnussen
493bc27ec2
chanfunding: fix tiny typo 2020-11-04 18:54:57 +01:00
Bjarne Magnussen
c56457c869
chanfunding: add test for a non-zero change 2020-11-04 18:54:57 +01:00
Bjarne Magnussen
07549d50ff
chanfunding: assure logic for high-fee
Without this change the high-fee logic is never tested as it is instead caught by the dust-output logic. This change uses a higher fee rate to ensure an output value above the dust limit, while still spending 20% on fees.
2020-11-04 18:54:57 +01:00
Bjarne Magnussen
9e825e6c0f
chanfunding: assure logic for dust output
Without this change the fee for the test case is above 20% and hence the error could be caught by the high-fee logic instead.
2020-11-04 18:54:57 +01:00