Commit Graph

10428 Commits

Author SHA1 Message Date
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
Joost Jager
403d72b468
lnrpc: lets encrypt
This commit enables lnd to request and renew a Let's Encrypt
certificate. This certificate is used both for the grpc as well as the
rest listeners. It allows clients to connect without having a copy of
the (public) server certificate.

Co-authored-by: Vegard Engen <vegard@engen.priv.no>
2020-09-15 09:59:09 +02:00
carla
a42e4fca32
config: disable disk space health check by default
The disk availability health check is less critical than our chain
access check, and may break existing setups (particularly mobile) if we
enable it by default. Here we disable by default, but leave our other
default values in so that it can easily be flipped on.
2020-09-15 09:33:15 +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
Calvin Zachman
f5fb64e552 add new max channel size config option
- let users specify their MAXIMUM WUMBO with new config option which sets the maximum channel size lnd will accept
- current implementation is a simple check by the fundingManager rather than anything to do with the ChannelAcceptor
- Add test cases which verify that maximum channel limit is respected for wumbo/non-wumbo channels
- use --maxchansize 0 value to distinguish set/unset config. If user sets max value to 0 it will not do anything as 0 is currently used to indicate to the funding manager that the limit should not be enforced. This seems justifiable since --maxchansize=0 doesn't seem to make sense at first glance.
- add integration test case to ensure that config parsing and valiation is proper. I simplified the funding managers check electing to rely on config.go to correctly parse and set up either i) non wumbo default limit of 0.16 BTC OR ii) wumbo default soft limit of 10 BTC

Addresses: https://github.com/lightningnetwork/lnd/issues/4557
2020-09-14 21:16:32 -05:00
Olaoluwa Osuntokun
ffe7c3e626
Merge pull request #4473 from yyforyongyu/allow-no-auth-private-addr
lncfg: allow no auth on private addresses
2020-09-14 19:03:27 -07:00
András Bánki-Horváth
dea6d91431
Merge pull request #4603 from bhandras/fix_help
config: prevent displaying usage twice if --help was requested
2020-09-14 18:58:21 +02:00
Andras Banki-Horvath
b778b25866
config: prevent displaying usage twice if --help was requested 2020-09-14 15:18:41 +02:00
Joost Jager
999ffffa37
lnd: join imports to form three groups
In line with https://github.com/pavius/impi
2020-09-14 14:52:07 +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
András Bánki-Horváth
d62b93e012
Merge pull request #4607 from bhandras/routing_experiments
lncli: add outgoing_chanid to queryroutes
2020-09-14 13:26:56 +02:00
Carla Kirk-Cohen
db0802bc8d
Merge pull request #4440 from carlaKC/4165-ratelimit
chanfitness: Rate limit in memory events based on peer flap rate
2020-09-14 13:11:07 +02:00
Hampus Sjöberg
6dd1555e66 lnd: Call loader.UnloadWallet on shutdown
This is required to make restart work for LndMobile builds.
Not calling UnloadWallet would make `UnlockWallet` stall forever as
the file is already opened.
2020-09-14 12:32:48 +02:00
Joost Jager
dae0e2194d
lnd: start fee estimator at a single point 2020-09-14 11:51:05 +02:00
Joost Jager
166be979dd
lnwallet: add no cache option to web api estimator 2020-09-14 11:51:03 +02:00
Joost Jager
23cd2f40eb
lnwallet: remove unused WebAPIEstimator field 2020-09-14 11:51:01 +02:00
Andras Banki-Horvath
4ffe744364
lncli: add outgoing_chanid to queryroutes 2020-09-14 11:36:06 +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
yyforyongyu
65383a1494
build: update to btcd version with notfound msg fix 2020-09-13 11:25:46 +08:00
yyforyongyu
567fa9ed10
itest: disable node retrying to connect to miner
Previously the chainbackend connected to the miner using a permanent
connection, which would retry the connection when it’s disconnected.
It would leave multiple connections between the chainbackend and the
miner, causing difficulties in debugging. Currently, there are two
occasions when disconnection happens. One happens when running the open
channel reorg test, the miner is connected/disconnected multiple times
on purpose. The other happens when the chainbackend receives a
MSG_WITNESS_TX type from the miner, which would be considered as an
invalid type and disconnects the miner. With the latter one being fixed
in btcd, the chainbackend will still be disconnected from the miner if
it reaches the ban score by requesting too many notfound messages in a
short time which is why the `--nobanning` flag is added.
2020-09-12 20:09:54 +08:00
yyforyongyu
724f6e0969
itest: require no error when cleaning up chainbackends 2020-09-12 20:09:53 +08:00
yyforyongyu
933d84273a
itest: require no error when tearing down miners 2020-09-12 20:09:52 +08:00
Conner Fromknecht
c704c5747a
Merge pull request #4558 from halseth/anchors-spec
[anchor commitment] Make the anchor commitment type spec compliant
2020-09-11 15:43:56 -04:00
Conner Fromknecht
3c606bd9c0
Merge pull request #4542 from Crypt-iQ/mock_signer_cleanup_0817
multi: remove mock.go
2020-09-11 13:16:17 -04:00
Johan T. Halseth
bf18929f0e
peer/brontide: fix pubkey log 2020-09-11 11:10:58 +02:00
Johan T. Halseth
a48c369250
lnwallet: check coop close fee negative balance
Also modify the test to check for this condition.
2020-09-11 11:10:58 +02:00
Johan T. Halseth
09a126b29f
lnwallet: add anchor size back to balance on coop close
To be spec compliant, we require the initiator to not pay the anchor
values into fees on coop close. We extract the balance calculation into
commitment.go, and add back the value of the anchors to the initiator's
balance.
2020-09-11 11:10:58 +02:00
Johan T. Halseth
07a57ae778
lnwallet: extract coop close balance calc into method 2020-09-11 11:10:58 +02:00
Johan T. Halseth
724f439b0b
lnwire: update anchor bit to spec 2020-09-11 11:10:58 +02:00
Johan T. Halseth
517fcd691a
channeldb: correct anchor comment 2020-09-11 11:10:58 +02:00
Olaoluwa Osuntokun
bc6e528887
Merge pull request #4604 from janoside/fix-sample-conf
docs: fix "tor.active" item in sample-lnd.conf
2020-09-10 18:49:24 -07:00
Olaoluwa Osuntokun
f80549d6e5
Merge pull request #4464 from guggero/macaroon-interceptor
Advanced macaroons 2/2: Custom macaroon validator for external subservers
2020-09-10 12:49:34 -07: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
Dan Janosik
52c7a1519f
docs: fix "tor.active" item in sample-lnd.conf
When starting up with lnd.conf that contains the sample line
"tor.active", lnd crashes and prints the error:

malformed key=value (tor.active)

Using "tor.active=true" instead works as expected.
2020-09-09 16:27:57 -04: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
Joost Jager
bbfeeec8b1
routing: add proportional attempt cost 2020-09-08 15:47:08 +02:00
Joost Jager
60a22ff09d
routing/test: parametrize test amount 2020-09-08 15:28:49 +02:00
carla
e2c0604657
multi: add flap count and last flap time to listpeers 2020-09-08 15:01:06 +02:00
carla
6cf66aea47
chanfitness: cool down flap count for rate limiting
Since we store all-time flap count for a peer, we add a cooldown factor
which will discount poor flap counts in the past. This is only applied
to peers that have not flapped for at least a cooldown period, so that
we do not downgrade our rate limiting for badly behaved peers.
2020-09-08 15:01:02 +02:00
Joost Jager
17a6175e8b
routing+routerrpc: rename PaymentAttemptPenalty to AttemptCost
Make field names consistent with the command line flag.
2020-09-08 14:07:56 +02:00
carla
a550ca3d64
multi: store peer flap rate on disk on best effort basis
Since we will use peer flap rate to determine how we rate limit, we
store this value on disk per peer per channel. This allows us to
restart with memory of our peers past behaviour, so we don't give badly
behaving peers have a fresh start on restart. Last flap timestamp is
stored with our flap count so that we can degrade this all time flap
count over time for peers that have not recently flapped.
2020-09-08 13:49:46 +02:00