Commit Graph
100 Commits
Author SHA1 Message Date
Oliver Gugger 03bce2129b Merge pull request #5732 from ellemouton/returnPingHanglerIfError
peer: return from pingHandler if error
2021-09-15 09:48:17 +02:00
Oliver Gugger 08c9d3fbdd Merge pull request #5304 from orbitalturtle/check-macaroon-rpcs
rpc: Bake and validate macaroons with external permissions
2021-09-15 09:42:38 +02:00
Oliver Gugger 4d89585a2d Travis: reduce ARM itest parallelism to 2
Reduces the number of concurrent tranches of itests running to two on
ARM in an attempt to make the tests less flaky because of very high CPU
usage with the default 4 parallel tranches.
2021-09-14 22:11:25 +02:00
Oliver Gugger 1ea6db1f26 Merge pull request #5725 from bottlepay/fix-amp-itest
lntest/itest: fix SendPaymentAMP test
2021-09-14 22:06:58 +02:00
Oliver Gugger 777abe5ff0 Merge pull request #5716 from guggero/fix-unit-tests
cluster: fix kvdb unit test
2021-09-13 15:59:31 +02:00
Oliver Gugger 55b3802387 cluster: fix kvdb unit test
It looks like #5702 was merged prematurely and broke the kvdb unit
tests.
2021-09-13 14:57:42 +02:00
Oliver Gugger 45343e4454 Merge pull request #5660 from LN-Zap/upstream/feat/delete-payment
add DeletePayment that allows to delete a specific payment or its failed HTLCs
2021-09-13 14:56:51 +02:00
Oliver Gugger 25a53f04f7 Merge pull request #5702 from bhandras/itest_etcd_logs
itest: save etcd logs along node logs in separate files
2021-09-13 11:50:35 +02:00
Oliver Gugger cc939cfa5d Merge pull request #5706 from Liongrass/patch-1
trivial: link from readme to builder's guide [skip ci]
2021-09-10 10:23:44 +02:00
Oliver Gugger 4337116bce Merge pull request #5697 from arshbot/export-selectHopHints
invoicesrpc: expose selectHopHints
2021-09-08 10:27:36 +02:00
Oliver Gugger d50ee834e1 Merge pull request #5688 from bhandras/recovery_itest_flake
itest: fix on-chain recovery flake caused by short timeout/btcd on ARM
2021-09-07 10:44:43 +02:00
Oliver Gugger f901d450a5 Merge pull request #5692 from guggero/migration-guide-arm
docs: update safety warning in migration guide [skip ci]
2021-09-06 11:57:26 +02:00
Oliver Gugger 8d7f5314a8 docs: update safety warning in migration guide [skip ci]
Fixes #5691.
With this commit we update the safety guidelines for migrating lnd data
between 32bit ARM and 64bit ARM devices.
2021-09-06 11:00:36 +02:00
Oliver Gugger e76c4c0e9b Merge pull request #5356 from guggero/batch-channel-open
Atomic batch channel funding
2021-09-03 19:56:56 +02:00
Oliver Gugger 180fba056f docs: add BatchOpenChannel to PSBT doc and release notes 2021-09-03 18:39:45 +02:00
Oliver Gugger 7a9ee48cf1 itest: add batch funding test 2021-09-03 18:39:45 +02:00
Oliver Gugger bb079f746b lncli: add batchopenchannel command 2021-09-03 18:39:44 +02:00
Oliver Gugger 37d0d651c4 rpcserver: extract abandonChan method
We'll want to re-use the abandon channel functionality for the batch
funding, as a cleanup in case the funding is aborted before publishing
any transaction.
2021-09-02 12:13:46 +02:00
Oliver Gugger ae2e9541a4 walletrpc: export wallet kit sub server name
We'll want to re-use the PSBT funding functionality from the wallet kit
sub server in the main RPC server. To be able to dynamically obtain an
instance of the wallet kit server we need to know its name under which
it registers itself in the list of sub server. We export the name so we
don't have to hard code it in the main server.
2021-09-02 12:13:46 +02:00
Oliver Gugger 84035f1fb2 funding: add batch funding function 2021-09-02 12:13:42 +02:00
Oliver Gugger 7c41d4b349 lnrpc: add batch channel open RPC types 2021-09-02 12:11:10 +02:00
Oliver Gugger 93d12cd9fc Merge pull request #5643 from bottlepay/updatepolicy-nested-tx
routing/localchans: fix nested db tx
2021-08-24 17:42:39 +02:00
Oliver Gugger ed5a3416bc Merge pull request #5623 from yyforyongyu/update-contrib-guide
docs: explicitly set line wrap rules for error messages [skip ci]
2021-08-24 17:29:18 +02:00
Oliver Gugger 2835cebe90 Merge pull request #5659 from guggero/unit-test-race-fix
multi: fix unit test for high CPU load envs
2021-08-24 15:16:28 +02:00
Oliver Gugger 998abd1886 Merge pull request #5657 from ErikEk/releasedoc-fix
docs: release note fix
2021-08-24 14:00:45 +02:00
Oliver Gugger 1f3a6e101d multi: fix unit test for high CPU load envs
It seems that the GitHub CI runners share a CPU and therefore only have
very few ressources available. This causes the wallet unlocker and breach
arbiter tests to fail if we don't give them enough time to complete.
2021-08-24 13:03:21 +02:00
Oliver Gugger 23cd231483 Merge pull request #4717 from guggero/xprv-wallet-init
walletunlocker: Allow wallet to be created from extended master root key (xprv)
2021-08-24 13:01:41 +02:00
Oliver Gugger c74c46147f Merge pull request #5646 from yyforyongyu/fix-context-leak
itest: properly handle the creation of timeout context
2021-08-24 10:44:36 +02:00
Oliver Gugger 648374ec2a Merge pull request #5354 from ErikEk/itest-include-btcd-backend-rotation-logs
itest: include compressed btcd backend logs from logrotate
2021-08-24 10:40:01 +02:00
Oliver Gugger 8632fc9233 docs: update release notes 2021-08-24 10:37:34 +02:00
Oliver Gugger 0822573743 itest: test wallet recovery from extended master root key
We add an additional test case to the on-chain fund recovery test that
tries restoring the same wallet from the extended master root key
instead of the seed.
2021-08-24 10:37:34 +02:00
Oliver Gugger 3fd944e7e4 lntest: allow node restore by extended root key
To allow testing restoring a node from an extended master root key, we
add an extra argument to the RestoreNodeWithSeed function.
2021-08-24 10:37:33 +02:00
Oliver Gugger bbd5980d42 lncli: add extended master root key to create command
To allow users to restore a wallet from an existing extended master root
key, we accept one of three answers when asking for an existing seed.
2021-08-24 10:37:33 +02:00
Oliver Gugger 370d056863 lncli: extract printCipherSeedWords 2021-08-24 10:37:33 +02:00
Oliver Gugger bdae6711af lncli: extract askRecoveryWindow 2021-08-24 10:37:32 +02:00
Oliver Gugger aa9435be84 lnd+walletunlocker: allow creating wallet from extended key
In addition to creating a new wallet from an aezeed, we allow specifying
an exteded master root key as the main wallet key directly.
Because an exteded key (xprv) doesn't contain any information about the
creation time of the wallet, we must assume a birthday to start scanning
the chain from (if the user doesn't provide an explicit value). Since
lnd only uses SegWit addresses, it makes sense to
choose the date that corresponds to the first mainnet block that
contained SegWit transactions.
Restoring a wallet from an extended master root key will result in a
significantly longer initial wallet rescan time if the default value is
used.
2021-08-24 10:37:32 +02:00
Oliver Gugger 6d70468ad5 lnrpc: add extended master key to walletunlocker 2021-08-23 11:26:00 +02:00
Oliver Gugger d329655bf6 mod: update to latest btcwallet dep 2021-08-23 11:25:39 +02:00
Oliver Gugger 951e2164fd Merge pull request #5536 from Kixunil/systemd-notify
Implemented systemd notify
2021-08-20 19:19:34 +02:00
Oliver Gugger 746a7dfbfc Merge pull request #5559 from de6df1re/lntest-itest-bugfix
itest: fix payment test error message
2021-08-20 19:01:13 +02:00
Oliver Gugger 9e8b9ccd4c Merge pull request #5615 from yyforyongyu/itest-fix-commitment-deadline
itest: fix commit deadline for neutrino backend
2021-08-19 16:40:14 +02:00
Oliver Gugger 958119a12a Merge pull request #5609 from mateuszmp/patch-2
Docs: Replacing deprecated import in JS readme
2021-08-16 10:24:14 +02:00
Oliver Gugger 5499a35987 Merge pull request #5395 from Crypt-iQ/fuzz_lnwire_patch_06162021
fuzz/lnwire: minor touch-ups, remove MaxPayloadLength
2021-08-12 09:30:38 +02:00
Oliver Gugger f7384a09e6 Merge pull request #5620 from szollo/master
docs: fix inconsistent naming of channel.backup [skip ci]
2021-08-12 09:26:13 +02:00
Oliver Gugger 07fa98fca5 Merge pull request #5614 from yyforyongyu/skip-release-note
trivial: skip release note for trivial fixes
2021-08-11 11:50:15 +02:00
Oliver Gugger dee9b9a9b1 Merge pull request #5603 from Crypt-iQ/peer_switch_refactor_08022021
htlcswitch+peer: introduce packetHandler, ChannelUpdateHandler interfaces for cleaner separation
2021-08-11 09:31:02 +02:00
Oliver Gugger a5e0ece64b Merge pull request #5616 from yyforyongyu/fix-context-timeout
itest: fix close channel context timeout
2021-08-11 09:19:17 +02:00
Oliver Gugger 527c6f06e2 docs: add release notes 2021-08-09 16:06:56 +02:00
Oliver Gugger f7943448b9 itest: fix channel open and close ntfn test
Because we now get one more update per channel when closing it, we need
to update our test that looks at the close notifications sent by the
SubscribeChannelEvent RPC.
2021-08-09 16:06:56 +02:00
Oliver Gugger bb4c754504 itest: test local force close restore scenario
We want to make sure we can recover funds from a channel that was force
closed by the local node just before the node needed to be restored. We
add a special test case with specific assertions for that scenario.
2021-08-09 13:55:37 +02:00
Oliver Gugger 294fba0bc5 itest: fix channel backup subscription test
With one more notification event being dispatched in the local force
close case we need to update one of the integration tests to account for
the additional message.
2021-08-09 13:55:35 +02:00
Oliver Gugger 06a693f10e lnrpc+rpcserver: add new fully resolved chan update event
This commit adds the new channel update event for a channel that is now
fully resolved to the event subscription RPC.
2021-08-09 13:55:34 +02:00
Oliver Gugger 5917486dc9 channel_notifier: keep chan in SCB on local foce close
In case we force close a channel from our end the funds can be time
locked for up to 2 weeks worst case. If something happens to our node in
that time, we don't have any information on that channel anymore because
currently the channel is removed from the channel backup file the moment
the commitment transaction confirms.
Instead we want to keep the channel around in the SCB file until we've
actually swept the time locked funds.

It looks like lnd even supports recovering from such a case if the peer
is still online and can tell us what commit height to use for deriving
the commit point. If the peer isn't around anymore then external tools
could be used to brute force the commit height.
2021-08-09 13:55:33 +02:00
Oliver Gugger 7e68cae8bd server+contractcourt: signal channel fully resolved
We might want to react to a channel being fully resolved after being
involved in a force close. For this we add a new callback and invoke it
where appropriate.
2021-08-09 13:55:31 +02:00
Oliver Gugger dcff9e5e26 channelnotifier: add event for fully resolved channel
We'll want to be informed about a channel that's been fully resolved on
chain in case it was involved in a force close. We add a new event type
and emit method for it.
2021-08-09 13:55:30 +02:00
Oliver Gugger 31063c269e Merge pull request #5509 from guggero/itest-flake-hunt
itest: neutrino anchor output flake fix
2021-08-05 17:44:53 +02:00
Oliver Gugger ec587b7253 docs: add release notes 2021-08-05 16:11:48 +02:00
Oliver Gugger 6421fd532c itest: fix anchor SCB sweep tests
Fixes another flake related to Neutrino and how it handles UTXOs.
2021-08-05 16:11:29 +02:00
Oliver Gugger f68335d7e4 itest: fix flake in garbage collect test, use require
This commit uses the require library for the link nodes garbage collect
test and fixes a flake that was discovered while hunting for other
flakes. Some times the channel isn't updated fast enough so we can
detech it on first try. So we give it a few more tries to stabilize the
test.
2021-08-05 16:11:29 +02:00
Oliver Gugger 3ae2cdb003 lntest: fix commitment TX not found in mempool error
This commit fixes an old flake in the neutrino anchor output tests. It
turns out that sometimes with Neutrino we don't have enough UTXOs in our
wallet to sweep both the local and remote anchor. This is very likely a
timing issue, we need to give the wallet more time to catch up with the
chain and process all transactions to find unspent outputs.
We address this two-fold: We add an additional UTXO to Alice. And then
we also make sure we detect both UTXOs properly after restarting.
2021-08-05 16:11:28 +02:00
Oliver Gugger 5cabd980b1 lntest: make it clear that profile failure is follow-up error
From the error in the itest output log it is not clear whether scraping
the profile page caused a test to fail or whether it was just a
follow-up error. We make it a bit more clear with an added message.
2021-08-05 16:11:28 +02:00
Oliver Gugger b149a090df itest: update error whitelist 2021-08-05 16:11:28 +02:00
Oliver Gugger ea8c0abaaf Merge pull request #5601 from guggero/falafel-js-stubs
lnrpc: add JSON stubs for interacting with lnrpc from a WASM context
2021-08-05 09:37:25 +02:00
Oliver Gugger 4c010e803e Merge pull request #5484 from guggero/database-full-remote
etcd: enable full remote database support
2021-08-04 22:20:23 +02:00
Oliver Gugger 66ed64da48 lntest: fix timing related flakes 2021-08-04 19:42:13 +02:00
Oliver Gugger 2eb0a4600f make+itest: add tranche index to test name
To make it easier to see what tranche a failed test was running in, we
add the tranche index to the test name. This corresponds to the number
in the .logs-tranche<index> folder name so the logs can be found much
quicker.
2021-08-04 14:55:57 +02:00
Oliver Gugger 9e1bb7e8e2 docs: add release notes for 0.14.0 2021-08-04 14:55:57 +02:00
Oliver Gugger 06032b3f75 itest: fix timeout issue in sweep test 2021-08-04 14:55:56 +02:00
Oliver Gugger fe931d179f etcd+channeldb: fix linter issues, rename receiver
With this commit we address some issues the linter picked up after
touching older code.
2021-08-04 14:55:56 +02:00
Oliver Gugger 482f76a0f4 mod+kvdb+channeldb: use btcwallet new DB interface
Depends on btcsuite/btcwallet#757.
Pulls in the updated version of btcwallet and walletdb that have the DB
interface enhanced by their own View() and Update() methods with the
reset callback/closure supported out of the box. That way the global
package-level View() and Update() functions now become pure redirects.
2021-08-04 14:55:55 +02:00
Oliver Gugger 1e84b52fee lncfg+etcd: add namespace support for etcd databases
Since we're now storing the content of multiple previously distinct
database files in etcd, we want to properly namespace them as not to
provoke any key collisions. We append a sub namespace to the given
global namespace in order to still support multiple lnd nodes using the
same etcd database simultaneously.

Because the btcwallet code uses the legacy walletdb interface we must
assume it is not fully concurrency safe. Therefore we make sure only a
single writer can be active at any given time for the wallet DB backend
when using etcd.
2021-08-04 14:55:54 +02:00
Oliver Gugger 57c7862eeb lnd+lncfg: move wallet DB options into backend method
To have all the database backend related code in one place, we finally
also move the initialization of the wallet DB loader option into the
GetBackends() method.
2021-08-04 14:55:54 +02:00
Oliver Gugger 75531455da multi: make watchtower client/server DBs remote compatible
The final database that needs to be made remote compatible is the
watchtower server and client database.
They are handled a bit differently because both of them are not always
active, only when specifically turned on in the config.
2021-08-04 14:55:53 +02:00
Oliver Gugger 1e27f491c7 multi: make decayed log DB remote compatible
Even though the sphinx router's persistent replay log is not crucial in
the operation of lnd as its state can be re-created by creating a new
brontide connection, we want to make lnd fully stateless and therefore
have the option of not storing any state on disk.
2021-08-04 14:55:53 +02:00
Oliver Gugger 6043113857 config: make sure network dir is created
The wallet and macaroon databases are the first files that are created
for a new node. When initializing those databases, the parent directory
is created if it does not exist.
With both of the databases now potentially being remote, that code that
creates the parent directory might never be executed and we need to do
that manually when parsing the configuration.
Otherwise we run into an error when we later try to create our default
macaroons in that folder and it doesn't exist.
2021-08-04 14:55:52 +02:00
Oliver Gugger f7b17df452 multi: make macaroon DB remote compatible
The macaroon root keys should also be stored to the remote database if a
replicated backend such as etcd is used.
This commit refactors the macaroons service and wallet unlocker to
accept a kvdb backend directly instead of creating the bolt instance
automatically.
2021-08-04 14:55:52 +02:00
Oliver Gugger 0d3647d715 lnd+lncfg: make etcd fully remote
This commit gets rid of the concept of a local and remote database when
etcd is used. Instead the same backend is now used for both the
(previously renamed from local and remote DB) graph and channel state
databases.
This will make path finding extremely slow on etcd and will require
further optimizations and possibly a write-through cache for the graph
DB. But this is a requirement for making lnd itself fully stateless.
2021-08-04 14:55:51 +02:00
Oliver Gugger c4917ae7fc multi: use kvdb.Backend for height hint DB
In order to separate our databases more clearly, we refactor the height
hint cache DB to use a kvdb backend instead of the channel DB instance
directly.
2021-08-04 14:55:51 +02:00
Oliver Gugger 9138c8abac multi: rename local and remote chan DBs
As a preparation to not have a local and remote version of the database
around anymore, we rename the variables into what their actual function
is. In case of the RPC server we even directly use the channel graph
instead of the DB instance. This should allow us to extract the channel
graph into its own, separate database (perhaps with better access
characteristics) in the future.
2021-08-04 14:55:50 +02:00
Oliver Gugger abf3942228 lnd+server: use struct for database instances
As a preparation to initialize more than just the channel database on
startup we introduce a new struct that holds a reference to each of our
database instances.
2021-08-04 14:55:50 +02:00
Oliver Gugger ad061b73e3 walletunlocker: remove unnecessary conversions 2021-08-04 14:55:49 +02:00
Oliver Gugger b1b0aac643 kvdb+lncfg: fix some typos in comments 2021-08-04 14:55:48 +02:00
Oliver Gugger 74dc883aa4 GitHub+make: compile JSON/WASM stubs 2021-08-03 13:44:37 +02:00
Oliver Gugger 702f0d7ced lnrpc: generate JSON/WASM client stubs 2021-08-03 13:44:36 +02:00
Oliver Gugger 44971f0c46 Merge pull request #5577 from xanoni/master
lnwallet/wallet.go: clarify anchor chan error str
2021-08-02 13:58:42 +02:00
Oliver Gugger a8530b9dfc Merge pull request #5535 from ErikEk/trivial-cmd-fix
trivial: missing dots
2021-08-02 08:28:10 +02:00
Oliver Gugger 9331a259d8 Merge pull request #5588 from guggero/disable-itest-err-whitelist
make: disable itest error whitelist check
2021-07-30 10:24:12 +02:00
Oliver Gugger 3d9d985fdf make: disable itest error whitelist check
Since we don't really do anything with the errors we check in the itest
error whitelist but get a lot of failed Travis runs because of it, we
disable the check for the moment.
2021-07-30 10:18:43 +02:00
Oliver Gugger 6906c838ed Merge pull request #5573 from yyforyongyu/5530-payment-test-race
routing: fix race in TestSendMPPaymentFailed
2021-07-30 10:04:04 +02:00
Oliver Gugger ebabda6717 Merge pull request #5582 from guggero/fix-js-healthcheck
build: fix JS health check and module git tag
2021-07-28 13:27:44 +02:00
Oliver Gugger 417effd223 mod: bump healthcheck to next version
We bump the version of the healthcheck module to a version that does not
exist. But by doing so we can tag the merge commit of this PR with that
actual version and have everything working. That is faster than merging
the changes to the module, pushing a tag, then bumping the tag in
go.mod.
2021-07-28 11:01:27 +02:00
Oliver Gugger a35031ca2e healthcheck: fix missing import 2021-07-28 11:01:27 +02:00
Oliver Gugger 4a6b1f7c82 Merge pull request #5534 from Kixunil/admin-macaroon-group-read
Allow group reading admin macaroon
2021-07-27 18:16:21 +02:00
Oliver Gugger c3962528e2 Merge pull request #5473 from guggero/grpc-gateway-update
maintenance: update etcd and grpc-gateway libraries, rename rpc.proto to lightning.proto
2021-07-27 16:11:48 +02:00
Oliver Gugger 046d4513b0 Merge pull request #5579 from bhandras/payment_bench_timeout_flake
itest: fix async payment benchmark timeout flakes
2021-07-27 16:10:41 +02:00
Oliver Gugger 64360c0e34 docs: add release notes 2021-07-27 13:10:00 +02:00
Oliver Gugger c8df606427 GitHub+lint: reduce linter memory usage
To reduce the likelyhood of the linter OOMing on the GitHub runner, we
exclude any generated code from being inspected and also tune the golang
garbage collector to be a bit more agressive.
2021-07-27 13:09:59 +02:00
Oliver Gugger dd749fe580 lnrpc: update grpc-gateway library to v2 2021-07-27 13:09:59 +02:00
Oliver Gugger 76e1223bf2 mod+kvdb: update etcd to v3.5.0 2021-07-27 13:09:59 +02:00
Oliver Gugger 235efc04e4 docs+lnrpc: rename rpc.proto to lightning.proto
To avoid a naming conflict with etcd, we rename our very generic
rpc.proto to lightning.proto to match the service name that's declared
within. This will break many external tutorials and possibly also our
API docs but the change needs to be done eventually.
2021-07-27 12:59:56 +02:00