Commit Graph

12419 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
090b917ee2
docs/release-notes: add entry for rpc graph cache 2021-11-04 15:30:36 -07:00
Olaoluwa Osuntokun
67e18e6089
rpc: optimize DescribeGraph by caching the response
Unfortunately, we can't use the graph cache directly here as it doesn't
include all the information we need, since it only includes the minimal
amount of information needed for path finding.

Instead, we use a simple mutex guarded cache that evicts itself after a
certain interval. The default is set small enough that most users
shouldn't really notice. We also provide a way to disable the cache, and
also disable the cache in the itests.

Fixes https://github.com/lightningnetwork/lnd/issues/1232
2021-11-04 15:30:31 -07:00
Olaoluwa Osuntokun
79406696ad
rpc: optimize GetNetworkInfo by using the channel graph cache 2021-11-04 15:30:29 -07:00
Olaoluwa Osuntokun
fae470293f
channeldb: add new ForEachNode method using the channel graph cache
This commit, adds a new ForEachNode method to the channel graph cache
that assumes the contents won't be modified. This is generally useful,
and will be used in a later commit to optimize some heavy RPC calls.
2021-11-04 15:30:25 -07:00
Olaoluwa Osuntokun
a6f22c6185
Merge pull request #5928 from Roasbeef/bitcoind-22
script: update CI to bitcoind 22
2021-11-03 18:10:40 -07:00
Olaoluwa Osuntokun
906120d80c
docs/release-notes: add bitcoind 22 to release notes 2021-11-03 16:43:32 -07:00
Olaoluwa Osuntokun
56d00f40ef
script: update CI to bitcoind 22 2021-11-03 16:43:27 -07:00
Olaoluwa Osuntokun
859c6d7ac5
Merge pull request #5922 from Roasbeef/graph-cache-panic-fix
channeldb: fix crash when inbound policy is unset
2021-11-03 10:30:35 -07:00
Andras Banki-Horvath
4d4b525058
docs: update release notes 2021-11-02 20:19:07 -07:00
Olaoluwa Osuntokun
fc2a29f717
channeldb: add failing test to demonstrate panic w/o graph cache
This test panics as is, since we assume the inbound edge is always
there.
2021-11-02 20:19:01 -07:00
Andras Banki-Horvath
ea5d43a2a8
channeldb: fix crash when inbound policy is unset 2021-11-02 20:18:58 -07:00
Olaoluwa Osuntokun
b99157efbe
Merge pull request #5905 from guggero/itest-fixes
itest: fix two flakes
2021-11-02 14:59:37 -07:00
Oliver Gugger
eb2be7c7c0
lntest: count unconfirmed balance as well
It looks like in some cases (apparently mostly on Windows) a previous
sub test sometimes leaves some unconfirmed balance in the wallet. That
balance is confirmed in the next test when new coins are sent to the
wallet.
2021-11-02 20:36:45 +01:00
Oliver Gugger
066a83315e
docs: update release notes 2021-11-02 20:36:43 +01:00
Oliver Gugger
2a6f128a43
itest: wait for channel to be properly closed
It looks like in some cases a channel is still being closed while we
already try to create a sweep output. In that case the pending closed
channel is still counted as anchor channel and a reserve output is
created. To make sure that doesn't happen, we make sure there are no
pending or open channels of any kind around before we create the sweep
transaction.
2021-11-02 20:36:27 +01:00
Oliver Gugger
2ca3eea3f7
itest: fix REST WebSocket ping/pong itest
This commit fixes a flake in the REST itest that was caused by an
invoice being created before the actual subscription client was
registered.
2021-11-02 20:36:26 +01:00
Oliver Gugger
32101db873
Merge pull request #5916 from blastshielddown/docs_5899
lnrpc: add public key detail to signrpc KeyDescriptor [skip ci]
2021-11-02 15:03:14 +01:00
Oliver Gugger
919b31a67b
Merge pull request #5896 from schjonhaug/instructions-for-creating-swift-protoc-definitions
Added instructions on how to build proto definitions for Swift
2021-11-02 15:02:39 +01:00
Michael Rhee
7c18fb64ae lnrpc: add public key detail to signrpc KeyDescriptor [skip ci]
Clarification that KeyDescriptor describes the public key in
raw_key_bytes and the key_loc identifies the private key. Helps
clarify responses from calls like DeriveKey and DeriveNextKey from
WalletKit.

Fixes #5899
2021-11-02 07:57:12 -05:00
Oliver Gugger
97786c72fc
Merge pull request #5878 from halseth/filter-ascii-bbolt-name
kvdb/bolt_compact: filter out non-ASCII from bucket name before printing
2021-11-02 10:22:46 +01:00
Oliver Gugger
e399814aea
Merge pull request #5550 from bottlepay/postgres-run-channeldb
kvdb: run channeldb test suite on postgres
2021-11-02 10:21:12 +01:00
Johan T. Halseth
7162af7656
docs: update release notes 2021-11-02 08:55:25 +01:00
Johan T. Halseth
6be6585643
kvdb/bolt_compact: filter out non-ASCII from bucket name before printing
Printing the raw bucket name lead to weird characters and even sounds
being printed.
2021-11-02 08:54:35 +01:00
Johan T. Halseth
10aaa35db5
kvdb: add loggableKeyName method
Safely logs the bucket key name as hex if it includes special
characters.

Co-authored-by: Oliver Gugger <gugger@gmail.com>
2021-11-02 08:54:35 +01:00
Olaoluwa Osuntokun
40ea494d2a
Merge pull request #5913 from bhandras/invoices_5911
invoices: do not log when invoice is already deleted
2021-11-01 15:31:53 -07:00
Olaoluwa Osuntokun
df6492d4d7
Merge pull request #5917 from bhandras/le_doc_update
docs: update leader election docs [skip ci]
2021-11-01 15:25:58 -07:00
Andras Banki-Horvath
c9533bf6b9
docs: update leader election docs [skip ci] 2021-11-01 16:30:13 +01:00
Andras Banki-Horvath
76065e84d3
invoices: do not log when invoice is already deleted 2021-11-01 16:10:45 +01:00
Joost Jager
d997bbf6b3
channeldb/test: test with postgres 2021-10-29 10:54:44 +02:00
Joost Jager
7c048efa21
kvdb/postgres/test: single instance embedded postgres database
Prepare for parallel tests that use a postgres backend. We don't want a
high number of embedded postgres instances running simultaneously.
2021-10-29 10:54:42 +02:00
Joost Jager
bd291286f7
kvdb/postgres: convert all types of panic data to error
Previously the assumption existed that panic data was already an error.
If that wasn't the case for example because panic("string") was used,
the transaction wasn't unlocked.
2021-10-29 10:54:40 +02:00
Olaoluwa Osuntokun
217019aa8a
build: bump version to 0.14.0-beta.rc1 2021-10-28 17:47:35 -07:00
Olaoluwa Osuntokun
66ca2a994b
Merge pull request #5901 from Roasbeef/dedup-interceptor
Dedup interceptor
2021-10-28 17:44:49 -07:00
Olaoluwa Osuntokun
7b45a47ce3
docs/release-notes: add entry for HTLC interceptor bug fix 2021-10-28 16:53:44 -07:00
Olaoluwa Osuntokun
52146e0970
Merge pull request #5803 from Roasbeef/amp-set-id-index
channeldb+invoices: enable repeated payments to AMP invoices via new HTLC key prefix storage
2021-10-28 16:49:43 -07:00
Roei Erez
fe44aedb25
itest: dedup interceptor packets
Aded a test for the dedup intercepted packets of htlc interceptor.
2021-10-28 16:16:55 -07:00
Roei Erez
1f1b33bf85
routerrpc: de-duplicate htlc held by interceptor
This commit ensures htlcs currently held by the interceptor
Are not sent again. This prevents potential races in the user code that
may lead to loosing funds.
2021-10-28 16:16:50 -07:00
Olaoluwa Osuntokun
a6e9a17659
docs/release-notes: add note for new AMP invoice features 2021-10-28 15:50:40 -07:00
Olaoluwa Osuntokun
a5ae7fbf9c
lntest: add new itest for repeated payments to the same AMP invoice 2021-10-28 15:50:35 -07:00
Olaoluwa Osuntokun
31336f91b0
invoices: update testSpontaneousAmpPayment for new AMP logic
Rather than checking the AMP invoice state itself, we'll instead check
the HTLC state.
2021-10-28 15:50:32 -07:00
Olaoluwa Osuntokun
3935725329
invoices: update cancel logic for AMP invoices to be more efficient
By passing in the set ID here, we ensure that we don't need to read ALL
the invoices to update the state of a set of them.
2021-10-28 15:50:30 -07:00
Olaoluwa Osuntokun
01f408ca38
invoices: recognize AMP invoice settles during ntnf dispatch+catchup
In this commit, we add the setID to the invoiceEvent struct as it will
be useful when we need to be able to distinguish a new open invoice,
from an AMP invoice that's being settled for the first time.

we then update the logic during notification dispatch to utilize the new
field to allow it to detect the repeated settles of AMP invoices.
2021-10-28 15:50:27 -07:00
Olaoluwa Osuntokun
37fe29af88
channeldb: add new TestSettleIndexAmpPayments test case 2021-10-28 15:50:25 -07:00
Olaoluwa Osuntokun
7dc5efbebf
channeldb: add new test to exercise cancellation of multiple AMP setIDs 2021-10-28 15:50:22 -07:00
Olaoluwa Osuntokun
698b5a8079
lnrpc: populate new AmpInvoiceState field in CreateRPCInvoice 2021-10-28 15:50:20 -07:00
Olaoluwa Osuntokun
d8ce00e016
lnrpc/invoicesrpc: expose new lookup modifier to LookupInvoiceV2 2021-10-28 15:50:17 -07:00
Olaoluwa Osuntokun
a4f8842831
channeldb: optimize updateInvoice for AMP by only reading relevant HTLCs
In this commit, we update the logic in `updateInvoice` to allow callers
to pass in either a hint, or the setID in the update callback. This
makes things more efficient for AMP invoices with thousands of recurring
payments, as we no longer need to read out _all_ the invoices each time
we go to update the state of a few HTLCs.
2021-10-28 15:50:15 -07:00
Olaoluwa Osuntokun
f969d81e1a
channeldb: for AMP, store set ID w/ invoice num in settle index
This change allows us to deliver notifications to a user of all the
settled recurring payments to the same payment_addr in the order that
they occurred.
2021-10-28 15:50:12 -07:00
Olaoluwa Osuntokun
3b28ad6d72
channeldb: for AMP don't update the main invoice state in updateInvoice
In this commit, we modify the way we handle state updates for AMP
invoices. With the current logic, once an invoice is settled, we'll
update the primary invoice state. This means that a user can't take the
same payment_addr, w/ a new set_id and pay the invoice again.

To remedy this, we'll move to instead _not_ updating the main invoice
state each time a new htlc Set (group of HTLCs according to setID) is
added. Instead, given that each HTLC stores an individual state, we'll
instead just use that directly from now on.

We also update TestSetIDIndex to account for new repeated settle AMP
logic.
2021-10-28 15:50:10 -07:00
Olaoluwa Osuntokun
c0f934e363
channeldb: don't cancel other HTLCs w/ diff setID once once is settled
With this change, we allow multiple users to concurrently pay the same
AMP invoice with distinct set IDs.
2021-10-28 15:50:07 -07:00