Commit Graph

11821 Commits

Author SHA1 Message Date
eugene
e72468646c
htlcswitch+peer: embed ChannelUpdateHandler in ChannelLink
GetLink, GetLinksByInterface now use ChannelUpdateHandler.
2021-08-10 17:15:52 -04:00
eugene
051cd8793a
htlcswitch: introduce and embed packetHandler interface in ChannelLink
This will allow separating the now-private *htlcPacket methods from
the publicly-used ChannelLink interface methods.
2021-08-10 17:15:51 -04:00
eugene
6c6e353597
htlcswitch+peer: pass BestHeight to ChannelLinkConfig
This allows non-test usages of ChannelLinkConfig to omit the raw
htlcswitch.Switch pointer.
2021-08-10 17:15:49 -04:00
Olaoluwa Osuntokun
90db8de6fe
Merge pull request #5460 from ErikEk/lncli-add-command-for-publishtransaction
lncli: add command for publishtransaction
2021-08-06 14:42:49 -07:00
András Bánki-Horváth
254d9be6ff
Merge pull request #5513 from bhandras/commit_queue_fix
etcd: fix dereferencing issue in commit queue causing contention and change design to be more scalable
2021-08-06 09:26:40 +02:00
Andras Banki-Horvath
e243be1ba2
docs: update 0.14.0 release notes 2021-08-06 07:53:14 +02:00
Andras Banki-Horvath
b29ae94e10
etcd: redesign commit queue to make it more robust and scalable
This commit builds on the ideas of @cfromknecht in lnd/5153. The
addition is that the design is now simpler and more robust by queueing
up everything, but allowing maximal parallelism where txns don't block.
Furthermore the commit makes CommitQueue.Done() private essentially
removing the need to understand the queue externally.
2021-08-06 07:53:13 +02:00
Andras Banki-Horvath
02aa77261d
etcd: fix dereferncing issue in etcd.CommitQueue causing contention
This commit fixes an issue where subsequent transaction retries may have
changed the read/write sets inside the STM which in turn left junk
references to these keys in the CommitQueue. The left keys potentially
conflicted with subsequent transactions, queueing them up causing
througput degradation.
2021-08-06 07:53:10 +02:00
Olaoluwa Osuntokun
407ee84838
Merge pull request #5554 from Roasbeef/sendpayment-amp-reuse-fix
cmd/lncli: always parse the pay_addr field for sendpayment
2021-08-05 13:39:48 -07: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
Olaoluwa Osuntokun
945c0fa0df
Merge pull request #5521 from Roasbeef/amp-test-flake-chan-open
lntest: fix possible race condition re asserting channel propagation
2021-08-04 19:21:03 -07:00
Olaoluwa Osuntokun
9505402ec2
docs/release-notes: add item for easy AMP CLI re-use 2021-08-04 19:17:57 -07:00
Olaoluwa Osuntokun
57d70ee9ce
docs/release-notes: add item for sendpayment pay_addr bug fix 2021-08-04 19:17:51 -07:00
Olaoluwa Osuntokun
c235b46e66
cmd/lncli: add new option for easy AMP invoice re-use
In this commit, we add a new option (`--amp-reuse`) that allows for easy
AMP invoice re-use when using either the `sendpayment` command.
2021-08-04 19:17:48 -07:00
Olaoluwa Osuntokun
6e3b33629c
cmd/lncli: always parse the pay_addr field for sendpayment
In this commit, we fix a bug that would cause attempts to re-use an AMP
invoice to fail. Without this commit, we would only attempt to parse the
payment addr if no invoice was specified, so a user manually specifying the
pubkey of the detonation. The fix is straight forward: always parse the
`pay_addr` field as the user may be attempting to re-use an AMP invoice w/o
open coding each of the sections.
2021-08-04 19:17:45 -07:00
Olaoluwa Osuntokun
da1d0226bd
server: disable DNS boostrap for SigNet nodes (#5564)
* server: disable DNS boostrap for SigNet nodes

In this commit, we fix a bug that would cause nodes attempting to run
using the signet chain, to waste CPU as they attempted to boostrap to a
non-existent DNS seed. We fix this by ignoring the DNS boostrapper is
signet is active. Along the way, we refactor the conditional sightly to
be more readable, and easily extensible.

* server: extract bootstrap logic into new function w/ unit test

* docs/release-notes: update release notes for signet DNS fix
2021-08-04 18:58:55 -07:00
Olaoluwa Osuntokun
98b29a6967
docs/release-notes: update release notes for signet DNS fix 2021-08-04 18:31:41 -07:00
Olaoluwa Osuntokun
673acd781d server: extract bootstrap logic into new function w/ unit test 2021-08-04 18:30:20 -07:00
Olaoluwa Osuntokun
6b1696c4f2 server: disable DNS boostrap for SigNet nodes
In this commit, we fix a bug that would cause nodes attempting to run
using the signet chain, to waste CPU as they attempted to boostrap to a
non-existent DNS seed. We fix this by ignoring the DNS boostrapper is
signet is active. Along the way, we refactor the conditional sightly to
be more readable, and easily extensible.
2021-08-04 18:30:20 -07: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
ErikEk
ace615b6e8 lncli: add lncli command for publishtransaction 2021-08-03 04:45:28 +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
xanoni
f5747c20ef lnwallet/wallet.go: clarify anchor chan error str
Improve 'ErrReservedValueInvalidated' error string to explain that the
error is triggered by a transaction that would deplete funds reserved for
potential future anchor channel closings (via CPFP)

Add hint that further details can be found in the debug log

Update strings in 'lntest/itest/log_error_whitelist.txt' correspondingly
2021-08-02 05:38:09 -04:00