Commit Graph

11612 Commits

Author SHA1 Message Date
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
Johan T. Halseth
74e62e5c5b
Merge pull request #4589 from yyforyongyu/itest-proper-cleanup
Itest: proper connect/disconnect miner
2020-09-25 10:31:56 +02:00
Conner Fromknecht
3362c9437b
Merge pull request #4647 from halseth/go-15-sprintf
[tests] reverse macaroon time caveat check, fix go 1.15 vet check.
2020-09-24 13:03:41 -07:00
yyforyongyu
86779fb6a5
itest: fix code lint 2020-09-24 20:51:58 +08:00
yyforyongyu
48f6c47b17
itest: test all ChannelBalance fields 2020-09-24 20:33:23 +08:00
yyforyongyu
1b200c9930
itest: explicit checking ChannelBalance response 2020-09-24 20:30:51 +08:00
yyforyongyu
f8c1bee637
lnrpc+rpcserver: verbose result in ChannelBalance 2020-09-24 20:26:08 +08:00
Johan T. Halseth
65865030d6
macaroons test: fix formatting 2020-09-24 11:59:08 +02:00
Johan T. Halseth
14960b1fb4
macaroons test: reverse macaroon time caveat check
This commit fixes a go 1.15 vet check.

In doing so it uncovers that the time caveat check is actually reversed.
Since we should check that the caveat is added, we should only fail the
check when the caveat prefix is not equal.
2020-09-24 11:22:20 +02:00
Johan T. Halseth
8ca5342b37
brontide test: fix go 1.15 vet check 2020-09-24 11:20:48 +02:00
Eugene
cc29e1cce8
Merge pull request #4640 from Crypt-iQ/brontide_fuzz_fixups
fuzz/brontide: fix fuzz_utils.go NewBrontideMachine callsites
2020-09-24 00:53:43 -04: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
Conner Fromknecht
936b733f16
Merge pull request #4634 from krtk6160/patch-1
docs: fix sync-freelist documentation
2020-09-23 16:02:52 -07:00
Olaoluwa Osuntokun
50976e5418
Merge pull request #4576 from cfromknecht/anchor-justice-txn
watchtower: conditionally reconstruct justice txns for anchor channels
2020-09-22 21:10:53 -07:00
eugene
6ba35238ef fuzz/brontide: fix fuzz_utils.go NewBrontideMachine callsites 2020-09-22 15:53:49 -04: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
Olaoluwa Osuntokun
719e32830d
lntest: fix most linter warnings, silence rest
We fix all linter issues except for the 'lostcontext' and 'unparam' ones
as those are too numerous and would increase the diff even more.
Therefore we silence them in the itest directory for now.
Because the linter is still not build tag aware, we also have to silence
the unused and deadcode sub linters to not get false positives.
2020-09-21 21:16:31 +02:00
Olaoluwa Osuntokun
c769247198
lntest: allow the main test files to be buildable w/o the rpctest build tag
In this commit, we modify our build tag set up to allow the main test
files to be buildable w/o the current rpctest tag. We do this so that
those of us that use extensions which will compile live files like
vim-go can once again fix compile errors as we go in our editors.

In order to do this, we now make an external `testsCases` variable, and
have two variants: one that's empty (no build tag), and one that's fully
populated with all our tests (build tag active). As a result, the main
file will now always build regardless of if the build tag is active or
not, but we'll only actually execute tests if the `testCases` variable
has been populated.

As sample run w/ the tag off:
```
=== RUN   TestLightningNetworkDaemon
--- PASS: TestLightningNetworkDaemon (0.00s)
PASS
ok  	github.com/lightningnetwork/lnd/lntest/itest	0.051s
```
2020-09-21 21:16:31 +02:00
Olaoluwa Osuntokun
acd615aca4
lntest: default to btcd as default test harness backend
Otherwise, if we remove the build tags, then there's no default backend,
and compilation will fail.
2020-09-21 21:16:31 +02:00
Olaoluwa Osuntokun
95634186c2
lntest/itest: move harness to new file
This in prep for a bigger move in the next commit.
2020-09-21 21:16:30 +02:00
githorray
a94c990f8e
Remove unsupported newaddress type p2pkh 2020-09-21 12:45:06 +08:00
Kartik Shah
b55c4e1ca9
Fix sync-freelist documentation 2020-09-20 02:50:48 +05:30
Conner Fromknecht
98da919bf1
Merge pull request #4622 from guggero/config-mkdir
config: create all directories
2020-09-18 14:32:28 -04:00
Joost Jager
6ae05c6bac
Merge pull request #4592 from joostjager/sweep-deadline
cnct+sweep: cpfp-aware anchor sweeping
2020-09-18 20:15:03 +02:00
Tom Kirkpatrick
51a5137d3f
lnd: set default value for neutrino ua overrides 2020-09-18 13:18:12 +01:00
András Bánki-Horváth
111db801e7
Merge pull request #4457 from bhandras/etcd_tx_queue
etcd: STM transaction queue to effectively reduce retries for conflicting transactions
2020-09-17 17:35:59 +02:00
Matheus Degiovani
38c74f6418
signal: do not trap SIGABRT
SIGABRT is used by the Go runtime to forcefully terminate all
goroutines, even if they are in a deadlocked state.

It is useful in development (to get a glimpse of any potential race or
hang conditions) and in production to forcefully terminate execution
when a standard SIGQUIT won't do.

This modifies the signal package to _not_ trap SIGABRT and let it be
handled in the standard way by the runtime.
2020-09-17 12:27:40 -03: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
Andras Banki-Horvath
26effca761
build: unit test on github with kvdb_etcd tag 2020-09-17 14:50:19 +02:00
Andras Banki-Horvath
357cd7d7a7
make: allow optional extra tags when running unit tests 2020-09-17 14:50:19 +02:00
Andras Banki-Horvath
9c47392dfa
etcd: integrate the commitQueue to the STM commit loop
This commit integrates an externally passed commitQueue instance with
the STM to reduce retries for conflicting transactions.
2020-09-17 14:50:19 +02:00
Andras Banki-Horvath
6f3a45b75f
etcd: make embedded etcd context cancelable 2020-09-17 14:50:18 +02:00
Andras Banki-Horvath
281c0b9d92
etcd: add commit queue to effectively reduce transaction retries
This commit adds commitQueue which is a lightweight contention manager
for STM transactions. The queue attempts to queue up transactions that
conflict for sequential execution, while leaving all "unblocked"
transactons to run freely in parallel.
2020-09-17 14:50:18 +02:00
Andras Banki-Horvath
b4b5a9d7de
etcd: increase message and transaction limits for embedded etcd 2020-09-17 14:50:14 +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
Joost Jager
29602e88e8
cnct: cpfp-sweep anchors
For unconfirmed commit tx anchors, supply the sweeper with cpfp info and
a confirmation target fee estimate.

The sweeper will try to pay for the parent commit tx as long as the
current fee estimate exceeds the pre-signed commit tx fee rate.
2020-09-17 12:30:41 +02:00
Joost Jager
681496b474
sweep: make sweeper aware of unconfirmed parent transactions.
Extend the fee estimator to take into account parent transactions with
their weights and fees.

Do not try to cpfp parent transactions that have a higher fee rate than
the sweep tx fee rate.
2020-09-17 12:30:39 +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
Mayank Chhabra
ac46f9a298
Remove duplicate tor.streamisolation option
This commit removes the duplicate tor.streamisolation option from `sample-lnd.conf` example config file (which was accidentally added in commit #104a9094980f31560ca269d3b01f000dd775778d)
2020-09-17 12:37:20 +05:30
yyforyongyu
d2d71476bd
lntest: init SignerClient and test DeriveSharedKey 2020-09-17 14:52:36 +08: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
yyforyongyu
1c80f9818f
signrpc: SharedKeyRequest accept raw pubkey 2020-09-17 10:14:54 +08:00
yyforyongyu
6efeee4d88
keychain: add missing KeyFamily type 2020-09-17 10:14:54 +08:00
Conner Fromknecht
d4d7533193
Merge pull request #4620 from halseth/txnotifier-panic
[bugfix] txnotifier: delete ntfn by confirm height always
2020-09-16 18:38:16 -04:00