Commit Graph
10992 Commits
Author SHA1 Message Date
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
Yaacov Akiba Slama 12f8cdd6d5 Merge branch 'master' into enable-encode-invoice-via-rpc 2020-11-04 16:47:01 +02:00
carla f1aa3d2071 lncli: allow setting max local csv for open channel requests 2020-11-04 13:57:21 +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
Johan T. Halseth c3397d7e77 htlcswitch/link test: add test for permanent failure 2020-11-04 11:16:22 +01:00
Johan T. Halseth dde6763cef htlcswitch/link: set PermanentFailure in case of remote error 2020-11-04 11:16:22 +01:00
Johan T. Halseth a97182b1e9 peer: mark channel borked in case of PermanentFailure 2020-11-04 11:16:22 +01:00
Oliver Gugger a606f462bc itest: move longest test to beginning
To make sure the test that takes the longest overall time is always
started first, independent of the number of test tranches we run, we
move it to the beginning of the list. Because that test involves a lot
of waiting, it allows us to play around with the number of tranches more
efficiently.
2020-11-04 11:03:37 +01:00
Oliver Gugger e6c47294fb itest: fix typo and formatting 2020-11-04 11:03:36 +01:00
Oliver Gugger ea4bb5dc5c itest: fix chanbackup restore flake
Updating the fee of the mock estimator _after_ starting carol turned out
to be flaky and could lead to the new fee not being picked up in time
for the force close. That lead to carol not cpfp'ing the force closed
transaction.
2020-11-04 11:03:34 +01:00