Commit Graph

10808 Commits

Author SHA1 Message Date
Oliver Gugger
fe834bc0c0
rpcserver: don't allow closing restored channels
To avoid the scenario where the user tries to force close a channel too
early that was restored through SCB, we check the channel status in the
RPC server already. If a restored channel cannot connect to its peer and
mark it as local data loss the channel arbitrator would try to publish
the commitment TX it does not have and crash.
2020-08-12 16:03:35 +02:00
nsa
3791c9efcb lnd: removing activeNetParams global, passed around instead via configs
This commit removes the activeNetParams global in chainparams.go. This
is necessary to isolate code from the lnd package so we can import it
for use in tests, other projects, etc.
2020-08-11 11:41:24 -04:00
yyforyongyu
f362f7670b
macaroons: specify root key ID in bakery 2020-08-11 19:17:48 +08:00
Conner Fromknecht
37a29b4869
Merge pull request #4496 from cfromknecht/moar-whitelist
lntest/itest: update error whitelist
2020-08-10 12:31:22 -07:00
Conner Fromknecht
687da86345
build/version: bump version to v0.11.0-beta.rc2 2020-08-07 19:51:53 -07:00
Olaoluwa Osuntokun
38265b9a46
Merge pull request #4348 from Roasbeef/etcd-local-graph-db
multi: create split local/remote database structure
2020-08-07 19:50:02 -07:00
Conner Fromknecht
0e935eadc0
lntest/itest: add failed getting UTXO error to whitelist 2020-08-07 19:29:35 -07:00
Olaoluwa Osuntokun
f58b00ef55
multi: split database storage into remote and local instances
In this commit, we split the database storage into two classes: remote
and local data. If etcd isn't active, then everything is actually just
local though we use two pointers everywhere. If etcd is active, then
everything but the graph goes into the remote database.
2020-08-07 18:44:02 -07:00
Olaoluwa Osuntokun
7355c8ba3a
lncfg: add new GetBackends which returns active DB backends
In this commit, we modify the existing `GetBackend` method to now be
called `GetBackends`. This new method will populate a new `RemoteDB`
attribute based on if the replicated backend is active or not. As is,
the local backend is used everywhere. An upcoming commit will once again
re-enable the remote backend, in a hybrid manner.
2020-08-07 18:44:00 -07:00
Olaoluwa Osuntokun
6a6521bba0
Merge pull request #4507 from Kixunil/patch-2
Updated deprecation message of noseedbackup
2020-08-06 18:53:53 -07:00
Olaoluwa Osuntokun
ef237c549a
Merge pull request #4511 from guggero/browser-websocket-fix
Bugfix: Allow browsers to send macaroon in WebSocket calls
2020-08-06 18:24:24 -07:00
Olaoluwa Osuntokun
fcb41dae37
Merge pull request #4475 from guggero/travis-windows
travis: add integration test on Windows
2020-08-06 18:15:02 -07:00
Conner Fromknecht
df5d334985
lntest/itest: add chain notifier shutting down to whitelist 2020-08-06 12:16:42 -07:00
Conner Fromknecht
eb1205d399
lntest/itest: add WS connection reset to error whitelist 2020-08-06 12:16:41 -07:00
Conner Fromknecht
1b660c7387
lntest: add canceled adding new channel to whitelist 2020-08-06 12:16:41 -07:00
Conner Fromknecht
de74798c12
lntest/itest: add whitelist entry for block hash fetch 2020-08-06 12:16:41 -07:00
Oliver Gugger
af8ffc9764
lntest: add WS test case with custom header macaroon 2020-08-06 12:11:20 +02:00
Oliver Gugger
c7cb2c0a78
docs: describe how to use WebSockets with the REST API
We add a new document that shows two examples of how to use the
WebSocket REST API with JavaScript.
2020-08-06 12:09:15 +02:00
Oliver Gugger
c5c28564e9
lnrpc: add macaroon workaround for WebSockets in browsers
For security reasons, browsers are limited in the header fields they can
send when opening a WebSocket connection. Specifically, the macaroon
cannot be sent in the Grpc-Metadata-Macaroon header field as that would
be possible for normal REST requests. Instead we only have the special
field "Sec-Websocket-Protocol" that can be used to transport custom
data. We allow the macaroon to be sent there and transform it into a
proper header field for the target request.
2020-08-06 12:07:07 +02:00
Martin Habovštiak
c4f739ac8a config: Updated deprecation message of noseedbackup
According to the recent discussion `noseedbackup` is not deprecated.
This change clarifies the message about deprecation.
Also fixes a typo.

Closes #4499
2020-08-05 21:29:24 +02:00
Conner Fromknecht
24eba7013c
Merge pull request #4509 from CandleHater/patch-2
rpc: add missing space to error message
2020-08-05 11:38:09 -07:00
Conner Fromknecht
0e558cfbed
Merge pull request #4506 from Roasbeef/free-list-sync-config-fix
config: make bbolt freelist settings mutually exclusive
2020-08-05 11:37:27 -07:00
Andras Banki-Horvath
2aa680ede2
invoices: optionally garbage collect invoices on the fly
This commit extends invoice garbage collection to also remove invoices
which are canceled when LND is already up and running. When the option
GcCanceledInvoicesOnTheFly is false (default) then invoices are kept and
the behavior is unchanged.
2020-08-05 12:24:17 +02:00
Andras Banki-Horvath
a0d7877d9a
multi: make canceled invoice garbage collection configurable
This commit extends the application config with a flag to control canceled
invoice garbage collection upon startup.
2020-08-05 12:24:16 +02:00
Andras Banki-Horvath
0ea763d83c
invoices: attempt to delete old invoices upon start 2020-08-05 12:24:15 +02:00
Andras Banki-Horvath
a5778c4673
channeldb: add DeleteInvoices call
This commit extends channeldb with the DeleteInvoices call which is when
passed a slice of delete references will attempt to delete the invoices
pointed to by the references and also clean up all our invoice indexes.
2020-08-05 12:24:15 +02:00
Andras Banki-Horvath
92f3b0a30c
channeldb+invoices: add ScanInvoices and integrate with InvoiceRegistry
This commit adds channeldb.ScanInvoices to scan through all invoices in
the database. The new call will also replace the already existing
channeldb.FetchAllInvoicesWithPaymentHash call in preparation to collect
invoices we'd like to delete and watch for expiry in one scan in later
commits.
2020-08-05 12:24:14 +02:00
Andras Banki-Horvath
ba3c65bfd6
invoices: re-format overreaching code lines 2020-08-05 12:24:13 +02:00
Candle
adfd0dc015
rpc: add missing space to error message
This corrects the output of the chain notifier RPC error. It has been displayed as: "chain notifier RPC *isstill* in the process of starting"
2020-08-05 09:58:05 +00:00
Oliver Gugger
97c73706b5
channeldb: fix for Windows clock resolution
We use the event timestamp of a forwarding event as its primary storage
key. On systems with a bad clock resolution this can lead to collisions
of the events if some of the timestamps are identical. We fix this
problem by shifting the timestamps on the nanosecond level until only
unique values remain.
2020-08-05 09:15:03 +02:00
Oliver Gugger
b21b2ebd6f
lntest: improve fee calculation in multi-hop test 2020-08-05 09:06:32 +02:00
Oliver Gugger
a6a7aca8af
travis: add itest on Windows
This commit adds an integration test that runs on a Windows virtual
machine on Travis. The tests run inside of a "Git Bash" environment
which supports the same command line syntax as a proper bash but doesn't
have all the tooling installed. Some tools also behave differently on
Windows. Therefore we also have to simplify the command to upload the
logs to termbin and remove the upload to file.io on Windows because both
the find and tar command don't work as expected.
2020-08-05 09:02:42 +02:00
Oliver Gugger
6115a7b12b
make+itest: make itest Windows compatible 2020-08-05 08:53:04 +02:00
Oliver Gugger
2f1f8561ae
mod: update to latest btcd version 2020-08-05 08:53:04 +02:00
Olaoluwa Osuntokun
19f68d2538
lnd: log bbolt freelist sync config value on start up 2020-08-04 18:55:02 -07:00
Olaoluwa Osuntokun
e616903d4f
config: unify old and new config values for sync-freelist
In this commit, unify the old and new values for `sync-freelist`, and
also ensure that we don't break behavior for any users that're using the
_old_ value.

To do this, we first rename what was `--db.bolt.no-sync-freelist`, to
`--db.bolt.sync-freelist`. This gets rid of the negation on the config
level, and lets us override that value if the user is specifying the
legacy config option.

In the future, we'll deprecate the old config option, in favor of the
new DB scoped option.
2020-08-04 18:55:00 -07:00
Olaoluwa Osuntokun
675c1b95c9
lnd: don't set freelist value when creating channeldb
This value actually isn't read anywhere, since it's no longer used.
Instead, `cfg.Db.Bolt.NoSyncFreeList` is what's evaluated when we go to
open the DB.
2020-08-04 18:54:59 -07:00
Olaoluwa Osuntokun
ec94532968
Merge pull request #4504 from halseth/mobile-wallet-unlocker-split
mobile: remember walletunlocker.proto
2020-08-04 14:15:46 -07:00
Johan T. Halseth
09b8bee865
mobile: remember walletunlocker.proto 2020-08-04 14:43:08 +02:00
Conner Fromknecht
f144dea3da
Merge pull request #4411 from bhandras/test_channeldb
kvdb+etcd+tests: change etcd flattened bucket key derivation to make it compatible with bbolt
2020-07-31 17:37:13 -07:00
Andras Banki-Horvath
5346ed8a5c
kvdb+etcd: assert on bucket/value key when putting value/bucket
This commit extends compatibility with the bbolt kvdb implementation,
which returns ErrIncompatibleValue in case of a bucket/value key
collision. Furthermore the commit also adds an extra precondition to the
transaction when a key doesn't exist. This is needed as we fix reads to
a snapshot revision and other writers may commit the key otherwise.
2020-08-01 00:29:01 +02:00
Conner Fromknecht
247b7530ca
build/version: use dot syntax for rc 2020-07-29 21:08:47 -07:00
Conner Fromknecht
608617975a
build/version: bump to 0.11.0-beta-rc1 2020-07-29 20:13:24 -07:00
Conner Fromknecht
26c363c6c6
Merge pull request #4494 from guggero/travis-sanity-check
travis: add sanity check stage
2020-07-29 17:03:08 -07:00
Olaoluwa Osuntokun
9f124ce6ad
Merge pull request #4438 from xplorfin/go1.13
chore: Update minimum golang version to 1.13
2020-07-29 16:55:33 -07:00
Olaoluwa Osuntokun
d36d22107c
Merge pull request #4432 from Crypt-iQ/peer_unsigned_fix_0702
channeldb+lnwallet: store updates the peer should sign under new key
2020-07-29 16:54:23 -07:00
nsa
c36840c2a5 lnwallet: add regression test TestChannelLocalUnsignedUpdatesFailure
This commit includes a regression test that checks that we remember
to restore updates that we sent to the peer but they haven't sent
us a signature for yet.
2020-07-29 19:03:44 -04:00
nsa
e4188ba9c2 channeldb+lnwallet: store updates the peer should sign under new key
This fixes a long-standing force close bug. When we receive a
revocation, store the updates that the remote should sign next under
a new database key. Previously, these were not persisted which would
lead to force closure.
2020-07-29 19:03:44 -04:00
Yaacov Akiba Slama
af01571fc6 Let invoice.Encode receive a function which hashes itself the message
Modify the SignCompact function passed to invoice.Encode to receive the
message before it's hashed and hash it itself.
With this modification, the SignMessage rpc function from the signrpc
subserver can be used and an invoice can be encoded outside of lnd.
2020-07-29 21:18:24 +03:00
Andras Banki-Horvath
b17ed28dea build: add all subservers to dev build 2020-07-29 14:33:25 +02:00