Commit Graph
100 Commits
Author SHA1 Message Date
Oliver Gugger 8b32285f48 Merge pull request #4721 from guggero/itest-flake-hunt
itest: cleanup and flake fix
2020-10-28 17:05:06 +00:00
Oliver Gugger 098598ec74 itest: sort error whitelist 2020-10-28 14:35:11 +01:00
Oliver Gugger fd684a8ffa itest: add new errors to whitelist 2020-10-28 14:35:10 +01:00
Oliver Gugger 34439fbc2a itest: cleanup multi-hop tests
As a preparation to fix an issue with the mempool wait, we clean up the
multi-hop itests a bit. We fix the formatting, use the require library
for assertions consistently and simplify some of the wait predicates.
Commonly used code is also extracted into functions.
2020-10-28 13:38:04 +01:00
Oliver Gugger d1b46211d8 itest: replace WaitForTxBroadcast with WaitForTxInMempool 2020-10-28 13:29:18 +01:00
Oliver Gugger 1714394add itest: fix send payment flake
In some cases the router isn't yet fully aware of all newly opened
channels. We need to give it some time to process the updates. Therefore
we add a wait for sending payments to give it a few more changes to
catch up.
2020-10-28 13:22:48 +01:00
Oliver Gugger e6b0141b10 itest: fix typos, formatting 2020-10-28 13:22:48 +01:00
Oliver Gugger ac16bd0fe3 Merge pull request #4699 from matheusdtech/failing-link-flake
itest: Fix flakes when payments cause chan closure
2020-10-28 09:10:35 +00:00
Oliver Gugger 747bd674dc Merge pull request #4716 from matheusdtech/fix-itest-comment
itest: Sync nodes to chain during singleHop tests
2020-10-27 09:36:46 +00:00
Oliver Gugger 9e4cfa0182 Merge pull request #4718 from yyforyongyu/fix-rpc-format
trivial: fix make rpc-format
2020-10-26 08:40:00 +00:00
Oliver Gugger d12f76fd6d Merge pull request #4626 from guggero/sample-conf-check
GitHub workflow: Check all command line flags are described in sample-lnd.conf
2020-10-16 13:12:22 +02:00
Oliver Gugger 7ea4caa635 github: add sample-lnd.conf to PR checklist 2020-10-16 08:53:16 +02:00
Oliver Gugger ab4f1c3b5a github+make: check all CLI flags are in sample-lnd.conf
We add a GitHub action to our workflow that makes sure all command line
flags of lnd that are available with the default build tags are
contained in the sample-lnd.conf file.
2020-10-16 08:53:16 +02:00
Oliver Gugger 96379f3503 sample-lnd.conf: remove extra whitespaces 2020-10-16 08:53:16 +02:00
Oliver Gugger b555357f9b sample-lnd.conf: add all flags without build tag
Because we'll add a check that enforces all command line flags that are
available with the default build tags to also be contained in the
sample-lnd.conf file, we first add all that currently are missing.
2020-10-16 08:53:15 +02:00
Oliver Gugger f98c74319c Merge pull request #4617 from guggero/no-txindex-itest
itest: add bitcoind test without txindex enabled
2020-10-09 15:51:20 +02:00
Oliver Gugger 4dcdfd98bb travis: add bitcoind test without txindex 2020-10-09 13:35:06 +02:00
Oliver Gugger 3e3618ae9a lntest: add build flag for disabling txindex on bitcoind
We create a new build flag for running the bitcoind tests without the
txindex enabled. We don't want this to be the default so we use a
negated build flag.
2020-10-09 13:35:04 +02:00
Oliver Gugger b7fc7c3dae lntest: use extraArgs, fix linter issues 2020-10-09 13:35:02 +02:00
Oliver Gugger 43c2031fa8 lntest: extract common bitcoind code into own file
To prepare for running multiple tests on bitcoind with different options
each time, we extract the common code into its own file.
2020-10-09 13:35:00 +02:00
Oliver Gugger 902d7dd812 Merge pull request #4643 from guggero/make-fuzz
Add fuzzing commands to Makefile
2020-10-09 11:03:30 +02:00
Oliver Gugger 41d8d56354 gitignore: ignore fuzzing artifacts 2020-10-09 09:53:56 +02:00
Oliver Gugger 1a1a9a6744 mod: add auto-added go mod changes
When running the make DEPGET target for the go-fuzz binaries, this entry
is auto added, even though we don't have a direct reference to it in our
code. Not sure why this is needed in the first place.
2020-10-09 09:53:56 +02:00
Oliver Gugger 5189cb799a make: add fuzz-build and fuzz commands 2020-10-09 09:53:55 +02:00
Oliver Gugger 916b75fd4e Merge pull request #4680 from guggero/travis-bitcoind-speedup
Travis+GitHub: update bitcoind to 0.20.1, extract bitcoind binary from docker image to speed up download
2020-10-09 09:43:52 +02:00
Oliver Gugger e8253479d5 Travis+GitHub: update to bitcoind 0.20.1, remove cache
With this commit we use the same version of bitcoind in all tests and
also remove the caches for the binary as docker has its own cache.
2020-10-08 21:30:11 +02:00
Oliver Gugger 785e797ef8 scripts: install bitcoind binary from docker image
Because the bitcoind mirror is extremely slow, we spend at least 2 to 3
minutes of each bitcoind related test on just downloading the binary. We
can achieve the same result by just pulling the docker image and
extracting the binary from that.
2020-10-08 21:29:51 +02:00
Oliver Gugger eb74011d5a itest: add error to whitelist 2020-10-08 20:39:11 +02:00
Oliver Gugger 843efc324b walletrpc: serialize TXID not outpoint
The txid_str field of a locked UTXO's outpoint shouldn't contain the
output index but only the reverse order hex serialized transaction ID.
2020-10-06 10:59:51 +02:00
Oliver Gugger 8e9f37b0fc lncli+docs: fix outpoint serialization in JSON output
This commit fixes the JSON output of the outpoint field of locked UTXOs
in the response of the PSBT fund command.
2020-10-06 10:59:50 +02:00
Oliver Gugger 0c0d114d18 mod: bump btcwallet dep to fix scriptSig in PSBT bug
To fix a bug where the scriptSig field was mistakenly set on nested
SegWit inputs of a PSBT, we bump the btcwallet dependency that contains
said fix.
2020-10-06 10:59:46 +02:00
Oliver Gugger f8e3b41d10 Merge pull request #4389 from guggero/psbt-signing
walletrpc: add new PSBT creation+signing RPCs
2020-10-03 11:47:55 +02:00
Oliver Gugger 84dfed3fe2 docs: update PSBT documentation 2020-10-03 10:34:57 +02:00
Oliver Gugger eb280fd248 itest: use new PSBT functions for funding flow
Now that we have all functions that we need to complete the whole
PSBT channel funding flow, we change the itest to use Dave's wallet
to fund the channel from Carol to Dave through a PSBT.
2020-10-03 10:34:56 +02:00
Oliver Gugger f114fb3c8d itest: use require library
We rewrite the test to use the require library to make it a
bit more condensed.
2020-10-03 10:34:56 +02:00
Oliver Gugger c206d062d5 lncli: add new PSBT wallet commands 2020-10-03 10:34:55 +02:00
Oliver Gugger 9a063355e2 walletrpc: disallow locking with internal ID
The internal lock ID that the wallet kit subserver uses to lock inputs
for itself shouldn't be allowed to be used when locking inputs manually
over the RPC.
2020-10-03 10:34:55 +02:00
Oliver Gugger 6229609be7 lnrpc+walletrpc: add RPCs for new PSBT methods 2020-10-03 10:34:53 +02:00
Oliver Gugger f947576f33 lnwallet+mock: add new PSBT methods 2020-10-03 10:34:39 +02:00
Oliver Gugger 9f5f98e736 btcwallet: use new base wallet methods 2020-10-03 10:34:39 +02:00
Oliver Gugger 936a83858b chanfunding: use util functions from psbt package 2020-10-03 10:34:39 +02:00
Oliver Gugger 8e0a162b8b mod: update to latest btcwallet version 2020-10-03 10:34:34 +02:00
Oliver Gugger fd962d322a Merge pull request #4650 from guggero/lncli-no-macaroons
lncli: fix macaroon usage when unlocking or using --no-macaroons
2020-09-26 10:01:32 +02:00
Oliver Gugger b28bf29c5f lncli: don't read macaroons when not using them
When we either don't use macaroons (because the global --no-macaroons
flag is set) or don't need them (for the wallet unlocker commands), we
don't try to read the file at all to avoid running into an error if the
file doesn't exist (which it doesn't in those two cases).
2020-09-25 15:54:10 +02:00
Oliver Gugger 44524fd2e5 lncli: fix go vet recommendations 2020-09-25 15:18:45 +02:00
Oliver Gugger ca679e0f0e lncli: move wallet unlocker commands into own file
This is a pure code move, we extract all wallet unlocker operations
(create, unlock, changepassword) into its own file.
2020-09-25 15:16:56 +02:00
Oliver Gugger cd41cd4d2d Merge pull request #4593 from guggero/itest-linter-fix
lntest: allow the main test files to be buildable w/o the rpctest build tag
2020-09-21 22:57:33 +02:00
Oliver Gugger 1558edbc3c travis+lint: fix memory usage
There is a setting to control how often the garbage collector is run.
Apparently this is a tradeoff between CPU and memory usage. If we can
limit the memory being used in that way, this allows us to use multiple
worker again, so overall this shouldn't be much slower than before.
2020-09-21 21:17:46 +02:00
Oliver Gugger 9f7d8dd92e lntest: make compilable without subserver build tags
To make it possible to compile the itests together with the other tests,
we don't want to use anything from the optional subservers.
2020-09-21 21:16:32 +02:00
Oliver Gugger ae7d69838e Merge pull request #4625 from guggero/letsencrypt-listen
lnd+config: allow Let's Encrypt listen IP to be set
2020-09-17 14:55:30 +02:00
Oliver Gugger 01ff012631 Merge pull request #4624 from mayankchhabra/patch-1
docs: remove duplicate "tor.streamisolation" option from sample-lnd.conf
2020-09-17 14:21:31 +02:00
Oliver Gugger d33ddffca4 sample-lnd.conf: change letsencryptport to letsencryptlisten 2020-09-17 12:31:01 +02:00
Oliver Gugger 85c2103f44 Merge pull request #4436 from yyforyongyu/accept-base-pubkey
signrpc: SharedKeyRequest accept raw pubkey
2020-09-17 11:38:00 +02:00
Oliver Gugger 00cb6fcc5d lnd+config: allow Let's Encrypt listen IP to be set
To make it possible to request a Let's Encrypt certificate by using a
different IP address where the port 80 might still be free, we add the
IP part to its configuration as well instead of just the port.
This makes it possible to use an IPv6 address for the ACME request if
all available IPv4 addresses already have their port 80 occupied.
2020-09-17 09:54:23 +02:00
Oliver Gugger e62ae66510 config: create all directories
With this commit we make sure that all directories where lnd could
potentially want to write files to are created on startup. This fixes
the case where the lnddir isn't set but all other paths point to
explicit locations with non-existend parent directories.

We don't create the log dir as that's done by the log rotator already.
2020-09-17 08:50:44 +02:00
Oliver Gugger a93aaff2fd travis: only upload log files on test failure
To speed up tests and also not DoS termbin and file.io, we only upload
the integration test logs on failure.
2020-09-16 15:16:10 +02:00
Oliver Gugger 904055cf4f Merge pull request #4601 from guggero/psbt-final-tx-raw
PSBT funding: allow final TX to be specified as raw wire format transaction
2020-09-15 10:07:52 +02:00
Oliver Gugger 107e135df9 itest: test PSBT funding flow with raw final TX
As we already create two channels in our PSBT funding flow itest we can
easily just submit the final transaction for the second channel in the
raw wire format to test this new functionality.
2020-09-15 08:30:23 +02:00
Oliver Gugger 5375f88b55 lnwallet+rpcserver: allow final raw tx to be specified
With this commit we allow the final transaction of a PSBT funding flow
to also be specified as a raw wire format transaction.
2020-09-15 08:30:23 +02:00
Oliver Gugger 1c832cbce7 chanfunding: verify inputs are signed in raw tx 2020-09-15 08:30:22 +02:00
Oliver Gugger d581cd02fc chanfunding: extract FinalizeRawTX into own method
As a preparation to also allow the final TX to be specified in the raw
wire format, we extract the check of the final transaction into its own
method.
2020-09-15 08:30:22 +02:00
Oliver Gugger 154dc1af66 lncli: allow final transaction as raw hex in PSBT funding flow 2020-09-15 08:30:21 +02:00
Oliver Gugger c4ada8a592 lnrpc: add final raw TX to PSBT finalize 2020-09-15 08:30:21 +02:00
Oliver Gugger 7f68649b44 mod: update btcwallet and psbt library version 2020-09-15 08:29:56 +02:00
Oliver Gugger 9ea836c237 Merge pull request #4614 from guggero/printmacaroon-fix
lncli: print all permission actions
2020-09-14 13:41:05 +02:00
Oliver Gugger 384ab9f616 lncli: print all permission actions
Due to a misunderstanding about how the entities/actions are encoded
inside the macaroon, only the first action was printed per entity.
Even though we add them as separate pairs in the macaroon service (for
example "offchain:read" and "offchain:write"), they are grouped in the
serialized macaroon ("offchain:read,write").
2020-09-14 10:55:19 +02:00
Oliver Gugger 061040c57b rpcserver: export MainRPCServerPermissions
To be able to properly delegate requests to the correct component in LiT we
need to know all URIs of lnd and the other subservers.
2020-09-10 10:25:38 +02:00
Oliver Gugger 8988a01d7e lnd+rpcserver: allow external subservers to specify macaroon validator
Give the external subservers the possibility to also use their own
validator to check any macaroons attached to calls to their registered
gRPC URIs.
This allows them to have their own root key ID database and permission
entities.
2020-09-10 10:24:10 +02:00
Oliver Gugger c3227057f4 macaroons: allow external validators to be registered
When external subservers register themselves to be served through the
same gRPC interface as the main lnd RPC, their requests are also
intercepted by the main lnd macaroon interceptor.
If the external subservers want to use their own macaroons that are
independent of lnd's, they need a way to overwrite the default validator
of the macaroon interceptor. We add this mechanism with the concept of
external validators.
2020-09-10 10:24:09 +02:00
Oliver Gugger d4c4cf01f0 lnd+macaroons: specify location when creating macaroon service
To allow the macaroon service to be used in other projects, we want the
location to be passed in as a parameter instead of being hard coded.
2020-09-10 10:24:08 +02:00
Oliver Gugger 8668248d96 Merge pull request #4310 from guggero/lncli-profiles
lncli: add profiles for easy multi-node management
2020-09-09 09:00:27 +02:00
Oliver Gugger d792a8ef61 lncli: use readPassword function everywhere 2020-09-07 15:55:05 +02:00
Oliver Gugger 070cfb804f lncli: use profiles 2020-09-07 15:55:04 +02:00
Oliver Gugger a2721a15a8 lncli: use CleanAndExpandPath from lncfg 2020-09-07 15:55:04 +02:00
Oliver Gugger 10f73b3b91 lncli: add new profile commands
We add a new 'profile' sub command to lncli to manage pre-defined
configuration profiles for all of lncli's CLI flags.
2020-09-07 15:55:04 +02:00
Oliver Gugger e2c14edd7b lncli: add struct to hold profile configuration
A profile file can contain multiple profile entries. Each
entry has a name, a set of default options to use and an optional list
of macaroons in a jar. The profile file can be
serialized/deserialized to and from JSON.
2020-09-07 15:23:17 +02:00
Oliver Gugger c34732af3d lncli: add encrypted macaroon jar
With this commit we add a simple macaroon jar that can encrypt its
content with a user-provided password when being serialized to JSON.
2020-09-07 15:23:12 +02:00
Oliver Gugger 907c744189 build: bump version of master branch to v0.11.99-beta 2020-09-07 15:06:07 +02:00
Oliver Gugger d33f87493e routerrpc: pass in probability source 2020-09-04 16:39:52 +02:00
Oliver Gugger b4bf4b2906 Merge pull request #4463 from guggero/macaroon-custom-permissions
Advanced macaroons 1/2: Custom URI permissions
2020-09-04 11:42:42 +02:00
Oliver Gugger 4996b28dab lnrpc+lncli: add command to print macaroon 2020-09-04 09:50:42 +02:00
Oliver Gugger 3ce7f72cd4 lncli: add new listpermissions command 2020-09-04 09:50:41 +02:00
Oliver Gugger 830ce163c6 lncli: add new URI permissions to bakemacaroon 2020-09-04 09:50:41 +02:00
Oliver Gugger 295bd44fea itest: test custom permissions 2020-09-04 09:50:41 +02:00
Oliver Gugger decd2d975c itest: parallelize test steps 2020-09-04 09:50:40 +02:00
Oliver Gugger 9862ee7cd6 itest: extract connection setup 2020-09-04 09:50:40 +02:00
Oliver Gugger 17276e9a7f itest: use only one timeout context
All these operations should be very fast and can be done in just one
timeout context.
2020-09-04 09:50:39 +02:00
Oliver Gugger a929f56781 itest: use require for macaroon tests 2020-09-04 09:50:39 +02:00
Oliver Gugger 906011f278 itest: add _test file name suffix to tests
To fix the compiler of some IDEs complaining about types and functions
it cannot find, we rename all files that contain tests back to lnd_xxx_test.go to make
sure they are compiled correctly.
2020-09-04 09:50:39 +02:00
Oliver Gugger ba6156d41d lnrpc+rpcserver: add ListPermissions RPC
As a convenience method for users to look up what RPC method URIs exist
and what permissions they require, we add a new ListPermissions call
that simply returns all registered URIs (including internal and external
subservers) and their required permissions.
2020-09-04 09:50:38 +02:00
Oliver Gugger 84879fddc6 rpcserver: allow to bake macaroons for specific URIs
To support the new URI specific permissions, we allow them to be added
in the BakeMacaroon call.
2020-09-04 09:22:36 +02:00
Oliver Gugger 6d201ef4fc macaroons: add special permission entity for URI specific permissions
To make the permission system even more fine-grained, we want to allow
users to specify exact gRPC URIs in the macaroon permissions instead of
just broad entity/action groups.
For this we add the special entity "uri" which allows an URI specific
permission to be defined as "uri:/lnrpc.Lightning/GetInfo" for example
instead of the more coarse "info:read" which gives access to multiple
URIs.
2020-09-04 09:22:35 +02:00
Oliver Gugger 6055b00dbb Merge pull request #4580 from guggero/fundingmgr-mutex
fundingmanager: hold lock during loop
2020-08-31 14:34:51 +02:00
Oliver Gugger 199336a342 fundingmanager: hold lock during loop
As a follow-up to #4560 we actually need to hold the reservation mutex
during the full loop where we count the pending reservations. Otherwise
the results might become inaccurate for concurrent funding flows.
2020-08-31 09:15:01 +02:00
Oliver Gugger e4764a67cc Merge pull request #4560 from guggero/abandon-shim-chans
Shim funded channels: don't count towards max pending channels, allow to abandon them
2020-08-28 14:41:45 +02:00
Oliver Gugger 7a15131715 Merge pull request #4573 from yyforyongyu/small-fix
trivial: remove unused print
2020-08-28 13:05:39 +02:00
Oliver Gugger 4346a1a3c6 itest: test max pending and abandon channel for shim chans
We change the external funding test to now test two more things: First
that we can open multiple externally funded channels without needing to
lift the default --maxpendingchannels setting. Then we test that we can
use the safer pending_funding_shim_only flag of the AbandonChannel RPC
to get rid of the never confirming external channels.
2020-08-28 12:28:59 +02:00
Oliver Gugger 8ed0efed0b itest: use NoError in external funding tests 2020-08-28 12:28:59 +02:00
Oliver Gugger aa6e3f6d01 itest: extract deriveFundingShim
As a preparation to test accepting multiple externally funded channels
at the same time, we extract the deriveFundingShim function from the
external funding integration test.
2020-08-28 12:28:59 +02:00
Oliver Gugger 3caca4fa3f lnrpc+rpcserver: enable abandonchannel for externally funded chans
To make sure we can use the abandonchannel RPC for getting rid of
externally funded channels who's funding transaction was never
published, we allow the RPC to be used on non-dev builds for externally
funded and pending channels only.
2020-08-28 12:28:58 +02:00