Commit Graph

10799 Commits

Author SHA1 Message Date
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
Olaoluwa Osuntokun
2284d8c775
Merge pull request #4556 from Roasbeef/update-sample-lnd-conf-08-2020
docs: update sample-lnd.conf
2020-09-03 18:29:11 -07:00
Olaoluwa Osuntokun
104a909498
docs: update sample-lnd.conf
In this commit, we update the `sample-lnd.conf` example config file to
be up to date with all the new configuration parameters we've added over
the past few release.
2020-09-03 18:27:38 -07:00
Conner Fromknecht
7c91f744ee
Merge pull request #4547 from Crypt-iQ/fwdpkg_cleanup_0819
htlcswitch: reduce db contention when removing forwarding packages
2020-09-02 16:58:28 -07:00
eugene
ea467783e9 htlcswitch+peer: remove fwd pkgs once before tick, bump timer to 1hr
This commit changes the logic when garbage collecting forwarding
packages such that they are removed once when the function is called,
and then again upon subsequent ticks. This allows us to bump the
peer timer to 1 hour to limit the number of db transactions happening
in lnd. The forwarding packages need to be removed initially as
otherwise a flappy node will never have them garbage collected.
2020-08-31 20:52:51 -04:00
eugene
62e19185f1 htlcswitch+channeldb: single tx for removing fwdpkgs
This commit changes RemoveFwdPkg to RemoveFwdPkgs so that a single
tx is used instead of N where N is the number of fwd pkgs to remove.
2020-08-31 20:52:51 -04:00
eugene
9ce89c1b46 lnd: delete mock.go, move mockSpendNotifier to lntest/mock 2020-08-31 20:06:11 -04:00
eugene
4ff03afee0 lnd: move fundingBroadcastHeight to fundingmanager_test.go 2020-08-31 19:42:53 -04:00
eugene
c7cbacc35b multi: move mockChainIO, mockNotifier to lntest/mock 2020-08-31 19:41:09 -04:00
eugene
3fa5d042c9 multi: move mockWalletController, mockSecretKeyRing to lntest/mock 2020-08-31 18:36:05 -04: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
eugene
49d8f04197 multi: migrate instances of mockSigner to the mock package
This commit moves all localized instances of mock implementations of
the Signer interface to the lntest/mock package. This allows us to
remove a lot of code and have it housed under a single interface in
many cases.
2020-08-28 15:43:51 -04: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
Oliver Gugger
f2e0ed19ff
lnwallet+fundingmgr: ignore shim channels in pending count
Externally funded channels are expected by the user and explicitly
registered through the use of a funding shim and should therefore not
count towards the max pending channel count which is primarily there to
mitigate DoS attacks.
2020-08-28 12:28:43 +02:00
yyforyongyu
acc0ec13e1
trivial: remove unused print 2020-08-28 17:09:39 +08:00
Olaoluwa Osuntokun
8b894fe321
Merge pull request #4570 from wpaulino/listtransactions-skip-unsupported-addr
btcwallet: skip unsupported addresses in ListTransasctionDetails
2020-08-26 15:54:24 -07:00
Olaoluwa Osuntokun
63bd8e7776
Merge pull request #4527 from cfromknecht/configurable-remote-max-htlcs
fundingmanager: configurable remote max htlcs
2020-08-25 16:47:11 -07:00
Wilmer Paulino
a85c4feb17
btcwallet: skip unsupported addresses in ListTransasctionDetails
A transaction with an unsupported address would prevent the method from
returning any other transactions and would instead return an error.
2020-08-25 11:21:29 -07:00
Oliver Gugger
fac3c84806
Merge pull request #4551 from gkrizek/cors
lnd: Add CORS support to the WalletUnlocker proxy
2020-08-25 09:31:40 +02:00
Conner Fromknecht
a4031f500b
rpcserver+fundingmanager: thread remote_max_htlcs to channel opening 2020-08-24 20:11:33 -07:00
Conner Fromknecht
9e73683c45
lnrpc: add remote_max_htlcs to OpenChannelRequest
This will allow users to set a custom limit for the max number of
concurrent HTLCs the remote party can add to the channel.
2020-08-24 20:11:33 -07:00
Conner Fromknecht
5c91be3f57
config+rpcserver: allow configurable defualt-remote-max-htlcs 2020-08-24 20:11:23 -07:00
Conner Fromknecht
1760fe30db
fundingmanager: cache remote-max-htlcs in res context
Currenlty the maxHtlcs value is recomputed after receiving
accept_channel. This works when the derivation is deterministic, howver
we now allow the user to manually override this value from open_channel.
As such, we must retain the chosen value in memory throughout the
funding process, otherwise the initiator would revert to the
deterministic derivation and the two endpoints will disagree on the
correct max-htlcs value in their view of the other's policy.
2020-08-24 20:08:19 -07:00
Conner Fromknecht
ef69537c7f
fundingmanager: add maxHtlcs to openChanReq 2020-08-24 20:08:19 -07:00
Conner Fromknecht
8a22e4fd1c
lntest/itest: swap want/got channel constraints
Otherwise the fatal error message incorrectly describes what happpened.
2020-08-24 20:08:19 -07:00
Conner Fromknecht
6c14c73b6b
lntest/harness: correct typo in error message 2020-08-24 20:08:19 -07:00
Conner Fromknecht
8390e303c1
lntest/itest: add t.Helper() to assertChannelConstraints 2020-08-24 20:08:15 -07:00
Graham Krizek
3f944dd337
lnd: Add CORS support to the WalletUnlocker proxy
This commit adds the same CORS functionality that's currently in the main gRPC proxy to the WalletUnlocker proxy. This ensures the CORS configuration is carried through all API endpoints
2020-08-24 14:29:31 -05:00
Conner Fromknecht
7d4547a8e9
Merge pull request #4559 from guggero/itest-error-whitelist
itest: fix pattern for short_chan_id in err whitelist
2020-08-24 11:19:03 -07:00
Oliver Gugger
a268314d1b
Merge pull request #4565 from guggero/update-cert
mod: update cert to v1.0.3
2020-08-24 15:00:55 +02:00
Carla Kirk-Cohen
1b8fbba615
Merge pull request #4479 from carlaKC/4306-shutdownlogger
healthcheck: add regular chain backend and disk space checks
2020-08-24 11:16:40 +02:00
Oliver Gugger
d8f1478e5b
mod: update cert to v1.0.3
The PR #4421 updated the cert package. To make lnd usable as dependency
in other projects after the PR was merged, we need to tag and update the
cert package.
2020-08-24 10:01:11 +02:00
Oliver Gugger
c513d0874e
itest: fix pattern for short_chan_id in err whitelist 2020-08-24 09:53:41 +02: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
carla
daae8a9944
multi: wrap logger to request shutdown from signal on critical error
This commit adds a shutdown logger which will send a request for
shutdown on critical errors. It uses the signal package to request safe
shutdown of the daemon. Since we init our logs in config validation,
we add a started channel to the signal package to prevent the case where
we have a critical log after the ShutdownLogger has started but before
the daemon has started listening for intercepts. In this case, we just
ignore the shutdown request.
2020-08-24 08:54:34 +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
Olaoluwa Osuntokun
bd18f9acf5
Merge pull request #4427 from yyforyongyu/customize-root-key-id
macaroons: customize root key ID
2020-08-21 19:34:15 -07:00
Olaoluwa Osuntokun
d14aa9feaa
Merge pull request #4421 from gkrizek/tls-disable-autofill
tls: add --tlsdisableautofill flag to prevent sensitive data leaks
2020-08-21 19:32:24 -07:00
Conner Fromknecht
94526b8d9a
Merge pull request #4538 from GlenCooper/patch-1
Update INSTALL.md
2020-08-21 12:13:21 -07:00
Olaoluwa Osuntokun
05fbd5a9a0
Merge pull request #4548 from cfromknecht/remove-dev-wt-tests
watchtower: remove dev tag from unit test files
2020-08-20 18:43:18 -07:00
Conner Fromknecht
b4c32c2da6
Merge pull request #4550 from Roasbeef/update-sec-key-2020
README: update link to security disclosure GPG key
2020-08-20 17:14:41 -07:00