Commit Graph

11365 Commits

Author SHA1 Message Date
Andras Banki-Horvath
e62dbca11a
cluster: add cluster package skeleton and LeaderElector interface 2021-05-04 17:33:07 +02:00
Andras Banki-Horvath
282618441d
etcd: do not try authenticate when using embedded 2021-05-04 17:33:06 +02:00
Andras Banki-Horvath
5441c1bb6d
etcd: fix embbeded etcd connection cfg 2021-05-04 17:33:06 +02:00
Andras Banki-Horvath
9992e5c0b5
etcd: decouple embedded etcd instance startup
This refactor changes how we instantiate the etcd based Backend to allow
separate initialization and startup for the embedded instance.
2021-05-04 17:33:05 +02:00
Andras Banki-Horvath
6757e14998
etcd: refactors to simplify etcd configuration
This refactor removes a redundancy where we had etcd configuration under
kvdb and kvdb/etcd packages.
2021-05-04 17:33:04 +02:00
Andras Banki-Horvath
44e312ace9
etcd: remove (unused) etcd root bucket prefix
This commit removes the unused prefix from the etcd backend config as
etcd key space separation in LND is implemented by using namespaces
instead.
2021-05-04 17:32:59 +02:00
Olaoluwa Osuntokun
99fe0ab150
Merge pull request #4878 from bhandras/etcd_doc_fix
etcd: `disabletls` option for etcd
2021-05-03 18:56:42 -07:00
Olaoluwa Osuntokun
140dd944c0
Merge pull request #5257 from wpaulino/neutrino-update
lncfg: add config options for new neutrino options
2021-04-30 16:54:35 -07:00
Olaoluwa Osuntokun
98b0b34bb4
Merge pull request #5237 from guggero/ws-bi-di
REST: Enable support for bi-directional streaming RPCs over REST, fix ping/pong support
2021-04-29 15:55:00 -07:00
Olaoluwa Osuntokun
41c089fbf4
Merge pull request #5224 from bhandras/invoice-gc-errors
invoices: do not fail DeleteInvoice if payment addr isn't indexed
2021-04-29 15:39:35 -07:00
Wilmer Paulino
c59c8d9c19
build: increase global test timeout to 60m
This doesn't affect our travis builds as much as our integration suite
is ran in parellel, but it is needed when running it sequentially.
2021-04-29 13:56:21 -07:00
Wilmer Paulino
f26cfac440
itest: use wait predicate for balance assertion in assertDLPExecuted
This assertion would at times fail if the wallet balance hadn't been
updated yet.
2021-04-29 13:56:20 -07:00
Wilmer Paulino
6bb7b00a80
lntest: decrease broadcast timeout for neutrino-backed integration tests
Since we don't have to worry about network latency within our
integration tests, we can shorten the broadcast timeout for neutrino
integration tests from 5s to 1s.
2021-04-29 13:56:19 -07:00
Wilmer Paulino
2084cb0ad5
lncfg: add config options for new neutrino options 2021-04-29 13:56:17 -07:00
Hampus Sjöberg
64d6d26a1c
build: update to latest version of neutrino
This commit updates neutrino to the latest version.
This is to deal with on-chain transaction issues, where in certain
situations the transaction wouldn't be broadcasted.
2021-04-29 13:55:49 -07:00
Olaoluwa Osuntokun
2a2bc64a12
Merge pull request #5156 from ellemouton/blockcache
blockcache: add blockcache pkg and pass it to all backends
2021-04-29 13:52:39 -07:00
Oliver Gugger
13aed071bd
itest: add test for bi-directional WebSocket 2021-04-29 10:39:55 +02:00
Oliver Gugger
066472fd3e
itest: refactor WS tests into functions 2021-04-29 10:39:55 +02:00
Oliver Gugger
5df69cf93f
config+lnd: make WebSocket interval/wait configurable
To make it possible to adapt the WebSocket ping interval and pong wait
time to custom situations, we add new configuration flags to customize
them.
2021-04-29 10:39:54 +02:00
Oliver Gugger
4b685e4d64
lnd+lnrpc: enable WebSocket ping/pong messages
Fixes #4497 by sending out ping messages in a regular interval to make
sure the connection is still alive.
2021-04-29 10:39:50 +02:00
Oliver Gugger
5e7b905f19
lnrpc: fix WS close error
Fixes the logged error "WS: error closing upgraded conn: tls: failed to
send closeNotify alert (but connection was closed anyway): write tcp4
<ip>-><ip>: write: connection reset by peer" that is caused by the
client closing the connection on its end.
2021-04-29 10:39:12 +02:00
Oliver Gugger
993167f14e
docs+lnrpc: enable bi-directional WebSockets
The grpc-gateway library that is used to transform REST calls into gRPC
uses a different method for reading a request body stream depending on
whether the RPC is a request-streaming one or not. We can't really find
out what kind of RPC the user is calling at runtime, so we add a new
parameter to the proxy that lists all request-streaming RPC calls.
In any case the client _has_ to send one request message initially to
kick off the request processing. Normally this can just be an empty
message. This can lead to problems if that empty message is not
expected by the gRPC server. But for the currently existing two
client-streaming RPCs this will only trigger a warning
(HTLC interceptor) or be ignored (channel acceptor).
2021-04-29 10:39:12 +02:00
Elle Mouton
f8de10511e chainntnfs: add block cache to NeutrinoNotifier
This commit adds gives BtcdNotifier access to the block cache and wraps
its GetBlock method so that the block cache's mutex map for the specific
hash is used.
2021-04-28 09:59:50 +02:00
Elle Mouton
6ad5781bf1 routing: add block cache to CfFilteredChainView
This commit adds the block cache to the CfFilteredChainView struct
and wraps its GetBlock function so that block cache mutex map is used
when the call to neutrino's GetBlock function is called.
2021-04-28 09:46:11 +02:00
Elle Mouton
432b1f0588 btcwallet: lock blockcache for Neutrino GetBlock
This commit ensures that for the neutrino implementation of
lnwallet.BlockChainIO, the neutrino GetBlock method is called directly
(since it already uses the blockcache). It also ensures that the block
cache mutex for the given hash is locked before the call to GetBlock.
2021-04-28 09:46:11 +02:00
Elle Mouton
ecf20ed350 multi: init neutrino backend with block cache
This commit initializes the nwutrino backend with the lnd blockcache so
that the two can share a block cache instead of each having its own.
2021-04-28 09:46:11 +02:00
Elle Mouton
a0f7bf8b2d chainntnfs: add block cache to BtcdNotifier
This commit adds gives BtcdNotifier access to the block cache and wraps
its GetBlock method so that it uses the block cache.
2021-04-28 09:46:11 +02:00
Elle Mouton
8a33fbf11a chainntnfs: add block cache to BitcoindNotifier
This commit adds a blockcache pointer to BitcoindNotifier and wraps its
GetBlock method so that the block cache is used.
2021-04-28 09:46:11 +02:00
Elle Mouton
f470946379 routing: add block cache to BtcdFilteredChainView
This commit makes the block cache available to BtcdFilteredChainView and
wraps its GetBlock method so that the block cache is used.
2021-04-28 09:46:11 +02:00
Elle Mouton
0193669ed8 routing: add block cache to BitcoindFilteredChainView
This commit adds the block cache to the BitcoindFilteredChainView struct
and wraps its GetBlock function so that block cache is used.
2021-04-28 09:46:11 +02:00
Elle Mouton
106f93a1b4 btcwallet: make blockcache available to BtcWallet
This commit makes the blockcache available to BtcWallet so that any
GetBlock call made to BtcWallet is wrapped by the blockcache GetBlock
call.
2021-04-28 09:46:11 +02:00
Elle Mouton
6702c79216 multi: add block cache size config
This commit adds block cache size to the main lnd config along with the
chainreg config.
2021-04-28 09:46:11 +02:00
Elle Mouton
275d55c9e6 blockcache: add blockcache package
This commit adds a new blockcache package along with the GetBlock method
to be used along with the blockcache.
2021-04-28 09:46:11 +02:00
Conner Fromknecht
d771ed7616
Merge pull request #5159 from halseth/amp-sendpayment
AMP support for SendPaymentV2
2021-04-27 11:23:39 -07:00
Johan T. Halseth
13c00127da
itest: add SendPayment AMP itest 2021-04-27 09:47:24 +02:00
Johan T. Halseth
a2a61a104f
itest: make sendAndAssertSuccess take context 2021-04-27 09:47:23 +02:00
Johan T. Halseth
c4fc72d573
routerrpc+routing: set AMP options for payments specified as AMP in SendPayment 2021-04-27 09:47:23 +02:00
Johan T. Halseth
8f57dcf28f
routerrpc: validate DestFeatures from RPC 2021-04-27 09:47:23 +02:00
Johan T. Halseth
0b9137cdac
lnrpc: add AMP feature bits 2021-04-27 09:47:23 +02:00
Johan T. Halseth
56a2c65477
router: use SetID as identifier for SendToRoute AMP-payments 2021-04-27 09:47:23 +02:00
Johan T. Halseth
f07c9d002c
routing: use Identifier in place of PaymentHash
Since we want to support AMP payment using a different unique payment
identifier (AMP payments don't go to one specific hash), we change the
nomenclature to be Identifier instead of PaymentHash.
2021-04-27 09:47:23 +02:00
Johan T. Halseth
6104d12cf8
routerrpc: add amp bool to SendPayment
For now this is how you indicate you want to perform an AMP payment to
the destination.
2021-04-27 09:47:23 +02:00
Johan T. Halseth
5531b812e3
routing: use AMP shard tracker
We'll use the AMP-specific ShardTracker for payments having non-nil
AMPOptions.
2021-04-27 09:47:23 +02:00
Johan T. Halseth
2d397b12b1
amp: create amp.ShardTracker
We'll use this AMP-specific ShardTracker for AMP payments.  It will be
used to derive hashes for each HTLC attempt using the underlying AMP
derivation scheme.
2021-04-27 09:47:23 +02:00
Johan T. Halseth
c1e82e534d
amp: add Merge and Zero to Sharer interface 2021-04-27 09:45:14 +02:00
Johan T. Halseth
e1399fb1ec
routing/router: use attempt's unique hash if set on restart 2021-04-27 09:45:13 +02:00
Johan T. Halseth
06f045fca3
channedb/mp_payment: add Hash to individual HTLCs
For AMP payments the hash used for each HTLC will differ, and we will
need to retrive it after a restart. We therefore persist it with each
attempt.
2021-04-27 09:44:19 +02:00
Johan T. Halseth
41ae3530a3
routing/payment_lifecycle: use ShardTracker to track shards
We'll let the payment's lifecycle register each shard it's sending with
the ShardTracker, canceling failed shards. This will be the foundation
for correct AMP derivation for each shard we'll send.
2021-04-27 09:43:40 +02:00
Johan T. Halseth
6474b253d6
routing/shards: add ShardTracker interface
We'll use this to keep track of the outstanding shards and which
preimages we are using for each. For now this is a simple map from
attempt ID to hash, but later we'll hide the AMP child derivation behind
this interface.
2021-04-27 08:27:33 +02:00
Johan T. Halseth
a9f19b100b
router+switch: rename paymentID->attemptID
To distinguish the attempt's unique ID from the overall payment
identifier, we name it attemptID everywhere, and note that the
paymentHash argument won't be the actual payment hash for AMP payments.
2021-04-27 08:27:33 +02:00