Commit Graph

138 Commits

Author SHA1 Message Date
Johan T. Halseth
9ef66f568f
Merge pull request #2203 from ccdle12/reject-htlc-option
htlcswitch+config+server: adding RejectHTLC flag
2019-08-26 14:53:32 +02:00
Olaoluwa Osuntokun
b1aea41d20
lntest/itest: force dave to use the legacy onion payload in multi-hop pay test
In this commit, we force Dave to use the legacy onion payload for the
multi-hop test to ensure that we're able to properly mix the old and new
formats, and have all nodes properly decode+forward the HTLC.
2019-08-22 18:53:10 -07:00
Olaoluwa Osuntokun
2f8d3c4526
Merge pull request #3256 from joostjager/failure-attribution
routing: failure attribution
2019-08-20 16:53:56 -07:00
ccdle12
05d0d028bc
htlcswitch+config+server: Adds a rejecthtlc flag that disables forwarded
htlcs

config: Adding RejectHTLC field in config struct

This commit adds a RejectHTLC field in the config struct in config.go.
This allows the user to run lnd as a node that does not accept onward
HTLCs.

htlcswitch/switch: Adding a field RejectHTLC to the switch config

This commit adds a field RejectHTLC to the switch config. When the
switch receives an HTLC it will check this flag and if the HTLC is not
from the source hop, the HTLC will be rejected.

htlcswitch/switch: adding check for RejectHTLC flag and incomingChanID

This commit adds a check when receiving UpdateAddHTLC. The check looks
for the RejectHTLC flag set and whether the HTLC is from the sourceHop
(the local switch). If the HTLC is not from the sourceHop, then we
reject the HTLC and return a FailChannelDisabled error.

server: adding RejectHTLC field to initialization of switch

lnd_test: adding test for RejectHTLC

This commit adds a test which tests that a node with the --rejecthtlc
flag will reject any onward HTLCs but still can receive direct HTLCs and
can send HTLCs.
2019-08-20 11:01:44 +01:00
Joost Jager
67e40d4433
htlcswitch: always assume an onion error for malformed htlc failures
Previously a temporary channel failure was returning for unexpected
malformed htlc failures. This is not what we want to communicate to the
sender, because the sender may apply a penalty to us only.

Returning the temporary channel failure is especially problematic if we
ourselves are the sender and the malformed htlc failure comes from our
direct peer. When interpretating the failure, we aren't able to
distinguish anymore between our channel not having enough balance and
our peer sending an unexpected failure back.
2019-08-17 10:24:05 +02:00
Joost Jager
4dd054ae90
multi: remove debug invoices
Debug invoices are rarely used nowadays, but keep asking for maintenance
every time refactoring in primarily the invoice registry occurs. We have
passed the cost/benefit tipping point, so therefore the debug invoice
concept is removed in this commit.

Previously the debughtlc flag also controlled whether hodl masks were
active. It is safe to remove that additional condition because the hodl
masks are still guarded by the dev build tag.
2019-08-14 21:33:03 +02:00
Joost Jager
f1769c8c8c
routing: convert to node pair based
Previously mission control tracked failures on a per node, per channel basis.
This commit changes this to tracking on the level of directed node pairs. The goal
of moving to this coarser-grained level is to reduce the number of required
payment attempts without compromising payment reliability.
2019-08-13 19:21:37 +02:00
Joost Jager
aabd68ebcd
multi: rename FailUnknownPaymentHash to FailIncorrectDetails
Align naming better with the lightning spec. Not the full name of the
failure (FailIncorrectOrUnknownPaymentDetails) is used, because this
would cause too many long lines in the code.
2019-08-08 11:04:17 +02:00
Wilmer Paulino
0431701262
multi: only allow specifying towers to TowerClient through RPC
With the introduction of the WatchtowerClient RPC subserver, the lnd
configuration flag to specify private watchtowers for the client is no
longer needed and can lead to confusion upon users. Therefore, we remove
the flag completely, and only rely on the watchtower client being active
through a new --wtclient.active flag.
2019-07-30 15:18:17 -07:00
Wilmer Paulino
8f010abac5
multi: add watchtower client RPC subserver 2019-07-30 15:18:15 -07:00
nsa
7762d55e80 itest+routing: updating tests to account for BlockPadding 2019-07-23 21:03:30 -04:00
Conner Fromknecht
807012f960
Merge pull request #3143 from Crypt-iQ/pipelining_settle_0525
htlcswitch: pipeline settles to switch
2019-07-19 18:12:59 -07:00
Olaoluwa Osuntokun
e2a35ae089
Merge pull request #3237 from orbitalturtle/auto-regenerate-cert
Unit test for autoregenerating expired cert pairs
2019-07-19 17:21:27 -07:00
nsa
00814dc7c1 htlcswitch: pipeline settles to switch
This commit makes the outgoing link pipeline the settle to the
switch as soon as it receives it. Previously, it would wait for a
revocation before sending it, which caused increased latency on
payments as well as possibly never settling on the incoming link.
A duplicate settle is still sent to the switch, but it is handled
gracefully. A new AckEventTicker was added to the switch which
acknowledges any pending settle / fail entries in an outgoing
link's fwd pkgs in batch. This was needed in order to reduce the
number of db txn's which would have been incurred by acking whenever
we receive a duplicate settle without batching.
2019-07-18 17:20:40 -04:00
Valentine Wallace
21c685d530
lnd_test: fix channel event subscription test flake.
This flake was caused by the rpcserver receiving a CloseChannel request
before Alice's channel event subscription request, causing Alice to miss one
notification. As a result, we move Alice's subscription to the beginning of the
test.

Additionally, we add a check to ensure the opening notifications are
received in the right order.
2019-07-12 14:47:28 -07:00
Johan T. Halseth
195a868455
lntest: add flag -goroutinedump 2019-07-11 14:44:44 +02:00
Johan T. Halseth
8d5430dae3
lnd_test: add lndHarness to harnessTest, dump goroutines on Fatalf
Co-authored-by: taketa <853211b@gmail.com>
2019-07-11 14:41:41 +02:00
Johan T. Halseth
314ba7db03
lntest/harness: add method SaveProfilesPages
SaveProfilesPages will write the active goroutines to files
pprof-n-*.log.

Co-authored-by: taketa <853211b@gmail.com>
2019-07-11 14:41:40 +02:00
Johan T. Halseth
6028722d71
lntest/node: make ProfilePort part of node config 2019-07-11 14:36:59 +02:00
Turtle
24ca95ab10 lnd_test: remove TLSAutoRegeneration test 2019-07-11 00:08:24 -04:00
Olaoluwa Osuntokun
ba5fbb3c27
Merge pull request #3156 from joostjager/extended-fail
routerrpc: add more failure reasons and route hints
2019-07-08 19:12:03 -07:00
Joost Jager
ae46fb00cb
routing+channeldb: add more failure reasons 2019-07-04 09:27:12 +02:00
Conner Fromknecht
ea311649b4
lnd: use distinct pubkey for watchtowers and server 2019-06-20 17:04:04 -07:00
Conner Fromknecht
f7da87acc4
lntest+make: build w/ watchtowerrpc tag, add grpc client to harness 2019-06-20 17:04:04 -07:00
Olaoluwa Osuntokun
a53323205c
Merge pull request #3133 from cfromknecht/wt-polish
watchtower: integrate altruist watchtower and watchtower client
2019-06-14 21:34:10 +02:00
Conner Fromknecht
72e355f933
lnd_test: add altruist watchtower itest 2019-06-13 19:54:20 -07:00
Turtle
37d0059d05 lntest: add new test for auto-generating expired certs 2019-06-13 20:55:47 -04:00
Turtle
f2ca4e1ea0 lntest: add getters for TLSCertPath and TLSKeyPath fields 2019-06-13 20:40:56 -04:00
Olaoluwa Osuntokun
41617187c4
lntest/itest: update itests due to ListPayments API change 2019-06-13 16:16:18 -07:00
Olaoluwa Osuntokun
41b7da9bd1
Merge pull request #3190 from halseth/listpayments-status-filter
ListPayments: filter out non-succeeded payments, include payment status
2019-06-14 00:41:35 +02:00
Johan T. Halseth
0aec3fd230
rpcserver: filter out non-suceeded payments, include payment status
Earlier versions of ListPayments only included completed payments. We
return to this behavior by ignore all other payments if the nonSucceeded
boolean is not set in the request.
2019-06-12 08:57:47 +02:00
Wilmer Paulino
638355b603
lntest: add CPFP integration test 2019-06-11 15:06:41 -07:00
Johan T. Halseth
f556b375ff
lnd_test: add testHoldInvoicePersistence
testHoldInvoicePersistence tests that a sender to a hold-invoice, can be
restarted before the payment gets settled, and still be able to receive
the preimage.
2019-06-07 16:53:32 +02:00
Joost Jager
7133f37bb8
routing: global probability based mission control
Previously every payment had its own local mission control state which
was in effect only for that payment. In this commit most of the local
state is removed and payments all tap into the global mission control
probability estimator.

Furthermore the decay time of pruned edges and nodes is extended, so
that observations about the network can better benefit future payment
processes.

Last, the probability function is transformed from a binary output to a
gradual curve, allowing for a better trade off between candidate routes.
2019-06-04 10:00:25 +02:00
Conner Fromknecht
a826d85dac
lntest/itest/lnd_test: assert payreq in listpayment matches paid invoice 2019-05-30 14:18:04 -07:00
Joost Jager
dff0387363
lntest: move itest into package 2019-05-28 21:43:23 +02:00
Johan T. Halseth
ca1e9dcecb
lntest: skip zeroConf ListUnspent for neutrino 2019-05-27 09:29:03 +02:00
Johan T. Halseth
2d49ee56e2
lntest: add Name() to BackendCfg 2019-05-27 09:29:03 +02:00
Johan T. Halseth
8f5a4beaad
lntest: add NeutrinoCfg 2019-05-27 09:29:02 +02:00
Johan T. Halseth
8e8bb9ff09
lntest+lnd_test: build flag btcd for BtcdBackendCfg 2019-05-27 09:29:02 +02:00
Johan T. Halseth
aec00b1277
lntest+lnd_test: add Connect and Disconnect miner for BackendCfgs
This commit gives the current chainbackend the ability to connect and
disconnect the chain backend at will. We do this to let the chain
backend initiate the connection to the miner, not the other way around.

This is a preparation for using Neutrino as a backend, as it only allows
making outbound connections.

We must also move the setup of the chainbackend to after to miner, to
know the address to connect to.
2019-05-27 09:29:02 +02:00
Johan T. Halseth
b917820c5b
lntest/node: set up InvoicesClient for HarnessNode 2019-05-15 14:42:04 +02:00
Wilmer Paulino
1ad4528975
lntest: use test subscription to prevent SubscribeChannelGraph race
This race was possible due to us making a subscription request before
the ChannelRouter has started. We address it by creating a dummy
subscription before proceeding to the real one to ensure we can do so
successfully. We use a dummy one in order to not consume an update from
the real one. This addresses the common "timed out waiting for opened
channel" flake within the integration test suite since the subscription
was never properly created, so we'd never be notified of when new graph
updates were received.
2019-04-25 18:53:36 -07:00
Johan T. Halseth
7f4d1cee6d
lntest: don't return from ensureConnected on non-error
This would casue the method to return before the peer list check was
performed.
2019-04-24 09:44:15 +02:00
Olaoluwa Osuntokun
b451536483
lntest: extend the restore/restart methods to also accept optional SCBs
In this commit, we modify the `RestoreNodeWithSeed` and `RestartNode`
methods to also accept an SCB. This will be useful in new integration
tests to properly exercise the various restore/restart scenarios using
static channel backups.
2019-03-28 17:54:07 -07:00
Olaoluwa Osuntokun
d9c9d6ed73
lntest: add new ChanBackupPath method to expose channels.backup for node 2019-03-28 17:53:50 -07:00
Olaoluwa Osuntokun
b419179c86
lntest: extend RestartNode to also unlock node if password is present 2019-03-28 17:53:49 -07:00
Olaoluwa Osuntokun
e929142ff7
lntest: add new Unlock method to allow unlock of fresh node
In this commit, we convert the Unlock method to accept the
`lnrpc.UnlockWalletRequest`. This makes things a bit more generic as we
no longer need to continue to add params to the method each time a new
field is added to the Unlock method.
2019-03-28 17:53:48 -07:00
Olaoluwa Osuntokun
b62dd09430
lntest: exend newNode method to accept wallet password 2019-03-28 17:53:47 -07:00
Olaoluwa Osuntokun
441f010295
lntest: add new initClientWhenReady to connect RPC then init client 2019-03-28 17:53:46 -07:00