Commit Graph
100 Commits
Author SHA1 Message Date
Joost Jager 1bd211a722 Merge pull request #4147 from joostjager/unify-pay-responses
router+routerrpc: unify sendtoroute and payment responses
2020-05-13 20:36:14 +02:00
Joost Jager 2d7c942d47 lnrpc: direct to SendPaymentV2 2020-05-12 19:57:02 +02:00
Joost Jager 5a56a6870e lnrpc: deprecate main SendToRoute rpc 2020-05-12 19:57:00 +02:00
Joost Jager 261588cc8e itest: switch over to routerrpc.SendToRouteV2 2020-05-12 19:56:58 +02:00
Joost Jager 0f6eacb4fa lncli: switch to routerrpc.SendToRouteV2 2020-05-12 19:56:56 +02:00
Joost Jager b6170788ea routerrpc: add SendToRouteV2 that returns an HTLCAttempt message
Unify data structure with SendPayment/ListPayments.
2020-05-12 19:56:54 +02:00
Joost Jager 674c199047 routing: return full htlc attempt from router 2020-05-12 19:56:52 +02:00
Joost Jager cc37485432 routing: return full htlc attempt from shard handler 2020-05-12 19:56:50 +02:00
Joost Jager 8e7c0757ec routerrpc: expose preimage on the htlc level 2020-05-12 19:56:49 +02:00
Joost Jager 185813abb1 Merge pull request #4257 from joostjager/multi-outgoing-chan-restriction
routing+routerrpc: add multiple outgoing channel restriction
2020-05-12 13:07:36 +02:00
Joost Jager 25a50b62fb itest: extend whitelist 2020-05-12 09:13:41 +02:00
Joost Jager c33d94ff27 routing+routerrpc: add multiple outgoing channel restriction 2020-05-12 07:17:24 +02:00
Joost Jager 53e4876a1d routing/test: add channel id constants 2020-05-12 07:17:22 +02:00
Joost Jager e1e4c8ef6b itest: extend whitelist 2020-05-08 13:40:31 +02:00
Joost Jager c0da0675c1 itest: add error detection explanation 2020-05-08 13:40:29 +02:00
Joost Jager 6f153d6eaa itest: extend whitelist 2020-05-06 21:21:51 +02:00
Joost Jager b59c0e1349 itest: add SendPaymentV2 to whitelist 2020-05-04 23:42:57 +02:00
Joost Jager 542e1466b1 itest: case insensitive log errors check 2020-05-04 22:20:24 +02:00
Joost Jager f6b2410011 routing+routerrpc: rename max_shards to max_parts
Don't introduce a new term and align with the P in MPP.
2020-04-22 14:49:19 +02:00
Joost Jager 8d7e07d96b lncli: live table-based payment updates 2020-04-22 14:49:17 +02:00
Joost Jager 6ffdf7ef1f lncli: live table-based payment updates 2020-04-21 17:02:15 -07:00
Joost Jager d51bb65536 routerrpc+lncli: add flag to suppress in-flight updates
This is a preparation for enabling the REST interface on routerrpc.
It provides REST clients that don't support server-side streaming
via keep-alive connections to use the streaming endpoint in the
typical request/response pattern. The url just needs to contain
?no_inflight_updates=true and only the terminal response is sent
back before the connection is closed.
2020-04-21 17:02:09 -07:00
Joost Jager 7fe100bcfb routerrpc: bring back legacy track and send rpcs
To soften the transition for routerrpc users to the V2 messages.
2020-04-21 20:37:45 +02:00
Joost Jager ad5f1404cb lnrpc: remove experimental tag from payment htlcs 2020-04-21 20:36:59 +02:00
Joost Jager d451ef4ee1 routerrpc: rename rpcs to SendPaymentV2 and TrackPaymentV2
The message in the response stream changed. Rename the calls themselves,
to prevent older applications from getting decode errors. Especially
troublesome is the case where the request is executed (send payment),
but the application can't read the outcome (payment sent or not?)
2020-04-21 20:36:58 +02:00
Joost Jager 1307a96624 itest: check for new errors in logs 2020-04-20 14:02:23 +02:00
Joost Jager 7b7edfbde6 fundingmanager: fix log 2020-04-20 14:02:21 +02:00
Joost Jager 7fc1938f10 routing: payment splitting pre-check
This commit reverts cb4cd49dc8 to bring
back the insufficient local balance failure.

Distinguishing betweeen this failure and a regular "no route" failure
prevents meaningless htlcs from being sent out.
2020-04-18 08:30:26 +02:00
Joost Jager f44a9e1d4c routing/test: make test channel capacities configurable 2020-04-17 15:56:19 +02:00
Joost Jager 9c4f9416d5 Merge pull request #4199 from joostjager/no-legacy-split
routing: do not split payment if destination does not support mpp
2020-04-17 15:54:43 +02:00
Joost Jager 805641adf5 routing: do not split payment if destination does not support mpp 2020-04-17 14:23:57 +02:00
Joost Jager 9bd7eb74b6 routing: add prefix logger for payment session 2020-04-17 14:23:55 +02:00
Joost Jager 6e8442b333 routing: move payment session constructor 2020-04-16 16:25:24 +02:00
Joost Jager 19006b108c Merge pull request #4189 from joostjager/rename-max-htlcs
routing+routerrpc+lncli: rename MaxHtlcs to MaxShards
2020-04-14 13:49:40 +02:00
Joost Jager 969eecc7d2 routing+routerrpc+lncli: rename MaxHtlcs to MaxShards 2020-04-14 10:31:59 +02:00
Joost Jager e61ff2202d lnrpc: report total fees paid
Fixes a bug where only the fees of the last route where reported.
2020-04-10 11:05:55 +02:00
Joost Jager 06f73c0a66 lnrpc: remove deprecated payment path
Not applicable anymore on the payment level with multi-part sends.
2020-04-10 11:05:52 +02:00
Joost Jager ef38f8f2c7 itest: log failure time 2020-04-09 08:20:58 +02:00
Joost JagerandJohan T. Halseth af14f2e425 itest: add multi-part payment test
Co-authored-by: Johan T. Halseth <johanth@gmail.com>
2020-04-09 08:20:56 +02:00
Joost Jager 35ebfcda9e itest: create mpp test context 2020-04-09 08:20:54 +02:00
Joost Jager 110c99f676 routing: continue trying after mpp timeout
It can happen that the receiver times out some htlcs of the set if it
took to long to complete. But because the sender's mission control is
now updated, it is worth to keep trying to send those shards again.
2020-04-09 08:20:52 +02:00
Joost Jager f5c3f930c4 lncli: expose max payment htlcs 2020-04-09 08:20:50 +02:00
Joost Jager e9bd691e6a routerrpc+routing: adapt payment session for multi shard send
Modifies the payment session to launch additional pathfinding attempts
for lower amounts. If a single shot payment isn't possible, the goal is
to try to complete the payment using multiple htlcs. In previous
commits, the payment lifecycle has been prepared to deal with
partial-amount routes returned from the payment session. It will query
for additional shards if needed.

Additionally a new rpc payment parameter is added that controls the
maximum number of shards that will be used for the payment.
2020-04-09 08:20:49 +02:00
Joost Jager 46f5fc7400 routing: distinguish between receiver amount and total amount in newRoute 2020-04-09 08:20:47 +02:00
Joost Jager e5c7e9a38c routing/test: return pathfinding error 2020-04-09 08:20:45 +02:00
Joost Jager 0f8eb80965 routing/test: use fixed identifiers in test graph 2020-04-09 08:20:43 +02:00
Joost Jager 3c6e4612ff routing/test: expose full list of htlc attempts 2020-04-09 08:20:41 +02:00
Joost Jager b13616a593 routing/test: use payment session in integrated routing test
Cover the payment session in the integrated routing test as a
preparation for executing the upcoming mpp split logic as part of the
test.
2020-04-09 08:20:39 +02:00
Joost Jager 47f9c1c3fd routing: use routingGraph interface in payment session
Preparation for more test coverage of payment session.

The function findPath now has the call signature of the former
findPathInternal function.
2020-04-09 08:20:37 +02:00
Joost Jager cb4cd49dc8 routing: map insufficient local bandwidth error to no path
With mpp it isn't possible anymore for findPath to determine that there
isn't enough local bandwidth. The full payment amount isn't known at
that point.

In a follow-up, this payment outcome can be reintroduced on a higher
level (payment lifecycle).
2020-04-09 08:20:35 +02:00
Joost Jager 3ed3c90efe lncli: add show_inflight flag 2020-04-08 09:26:35 +02:00
Joost Jager af4abe7d58 routing+routerrpc: notify full payment structures
This commit fixes the inconsistency between the payment state as
reported by routerrpc.SendPayment/routerrpc.TrackPayment and the main
rpc ListPayments call.

In addition to that, payment state changes are now sent out for every
state change. This opens the door to user interfaces giving more
feedback to the user about the payment process. This is especially
interesting for multi-part payments.
2020-04-08 09:26:33 +02:00
Joost Jager 5bebda8c5d multimutex: add hash mutex 2020-04-08 08:54:05 +02:00
Joost Jager f907fbcadc queue: detect close of incoming channel 2020-04-08 08:54:03 +02:00
Joost JagerandJohan T. Halseth 278915e598 channeldb: return updated payment on attempt update
Similar to what is done for SettleAttempt.

Co-authored-by: Johan T. Halseth <johanth@gmail.com>
2020-04-08 08:54:01 +02:00
Joost Jager 351d8e174c lnrpc: expose payment failure reason 2020-04-08 08:53:59 +02:00
Joost Jager 327634e9f7 routerrpc: move payment marshalling 2020-04-08 08:53:57 +02:00
Joost Jager 5d0a117162 routing: fix log 2020-04-08 08:14:10 +02:00
Joost Jager afaabdae88 Merge pull request #4128 from joostjager/default-routerrpc
routerrpc+lncli: enable subserver by default and switch over lncli sendpayment
2020-03-31 23:30:25 +02:00
Joost Jager 6b649eeb10 lncli: remove unused type chain 2020-03-31 22:05:00 +02:00
Joost Jager 3191b949f5 lnrpc: deprecate SendPayment
There is an alternative in routerrpc now. It doesn't support REST yet,
but the main rpc SendPayment with its bidirectional streaming isn't
usable via REST either.

SendPaymentSync still serves REST users and cannot be deprecated yet.
2020-03-31 21:41:34 +02:00
Joost Jager 37849194f4 lncli: add trackpayment command 2020-03-31 21:41:32 +02:00
Joost Jager acefb64207 routerrpc: remove payment-level route field
With multi-part payments, a payment-level route field does not make
sense anymore.
2020-03-31 21:41:30 +02:00
Joost Jager dead6a772a lncli: use routerrpc for payments 2020-03-31 21:41:28 +02:00
Joost Jager f060da3971 lncli: move payment commands to separate file 2020-03-31 21:41:26 +02:00
Joost Jager 767c4f2298 routerrpc: remove reflection-based initialization 2020-03-31 21:41:24 +02:00
Joost Jager ffa7bed7f0 build+routerrpc+lncli: remove routerrpc conditional compilation 2020-03-31 21:41:22 +02:00
Joost Jager e11a3b24d8 lnrpc/routerrpc: rename RoutingConfig file 2020-03-31 21:41:20 +02:00
Joost Jager bc7ee9a7d0 routerrpc: fix empty payment request bug 2020-03-31 21:41:18 +02:00
Joost Jager 7ba5bf69e0 Merge pull request #4129 from joostjager/pending-close-type
lnrpc: expose commitment type on pending open and waiting close channels
2020-03-31 21:40:24 +02:00
Joost Jager baffe156db lnrpc: expose commitment type on pending open and waiting close channels 2020-03-31 19:35:52 +02:00
Joost Jager 41573004a3 lnrpc: extract rpcCommitmentType 2020-03-31 19:35:50 +02:00
Joost Jager a2336005e6 Merge pull request #4113 from joostjager/mc-failure-overwrite
routing: minimum failure relaxation interval
2020-03-28 11:10:26 +01:00
Joost Jager 1a6b28553a routing: stricter mission control state failure updates
This commit puts a mechanism in place to prevent a failure for a low
amount from being overwritten very soon after by a higher amount
failure.
2020-03-28 07:49:23 +01:00
Joost JagerandJohan T. Halseth 8628a989a6 itest: enable anchor commitment for multi-hop test
These tests exercise the different ways of sweeping a commitment, so
we'll cover the modified scripts used for anchor commitments and
spending the anchor itself by both parties.

Co-authored-by: Johan T. Halseth <johanth@gmail.com>
2020-03-27 08:01:52 +01:00
Joost JagerandJohan T. Halseth 23c81949cc itest: enable anchor type for force close test
Co-authored-by: Johan T. Halseth <johanth@gmail.com>
2020-03-27 08:01:50 +01:00
Joost JagerandJohan T. Halseth 714166eeb0 itest: enable anchor type for basic funding flow
Co-authored-by: Johan T. Halseth <johanth@gmail.com>
2020-03-27 08:01:48 +01:00
Joost Jager 7dbb936791 lntest/itest: use helper functions in calcStaticFee 2020-03-27 08:01:44 +01:00
Joost Jager 0e8eb40625 lntest/itest: add mempool tx utility functions 2020-03-27 07:42:05 +01:00
Joost Jager b3afa0c9ed sweep: log sweep tx id and full list of inputs
To facilitate debugging.
2020-03-27 07:42:03 +01:00
Joost Jager 8b7bde7200 cnct: log txid for force close 2020-03-27 07:42:01 +01:00
Joost Jager 863966bac9 lntest/itest: fix scope bug
Fixes a subtle bug where the outer scope predErr was hidden when the
return value of findForceClosedChannel was stored in a newly
defined variable with the same name.
2020-03-27 07:41:59 +01:00
Joost Jager 6e30dda54f Merge pull request #4114 from joostjager/routing-logging
routing+htlcswitch: logging improvements
2020-03-25 12:15:39 +01:00
Joost Jager 36e1b92e0c routing: log reported success amount 2020-03-24 19:02:40 +01:00
Joost Jager 2d07756263 routing: log amount for probability 2020-03-24 19:02:38 +01:00
Joost Jager 6a36ed44f8 routing: extract mission control state
Preparation for unit testing just the state logic.
2020-03-24 16:48:35 +01:00
Joost Jager e2052f7f65 Merge pull request #3758 from joostjager/anchor-output-poc-joost
cnct: anchor output sweeping and fee bumping
2020-03-18 18:59:06 +01:00
Joost Jager fa115b543d lncli: add bumpchannelclose command
This command allows users to easily bump the fee on their unconfirmed
closing transactions.
2020-03-18 12:27:06 +01:00
Joost Jager d60303b092 lnrpc: expose commit hashes for waiting close channels
To make it easier to determine which pending sweep to bump in order to
get your anchor commitment tx confirmed.
2020-03-18 12:27:05 +01:00
Joost Jager ab451f634e cnct+lnrpc: report anchor resolution 2020-03-18 12:27:03 +01:00
Joost Jager ea397c9d6e cnct: resolve anchors post-confirmation
Sweeping anchors and being able to bump the fee was already added in a
previous commit. This commit extends anchor sweeping with an anchor
resolver object that becomes active after the commitment tx confirms.
At that point, the anchors do not serve the purpose of getting the
commitment tranaction confirmed anymore. It is however still possible to
reclaim some of their value if using a low fee rate.
2020-03-18 12:27:01 +01:00
Joost Jager d84b596f55 cnct: do not ignore resolver reports after resolution
Preparation for anchor resolver. The recovered anchor amount should
still be included in the pending channel report even after it has been
resolved.

This also fixes an existing bug that in some cases caused the recovered
amount from an htlc resolver not to be included in the total.
2020-03-18 12:26:59 +01:00
Joost Jager 07a39b1ebf cnct: do not persist stateless resolvers
Preparation for the anchor resolver which does not have persistent
state.
2020-03-18 12:26:57 +01:00
Joost Jager d2b6472843 cnct: pre-confirmation anchor sweep
Start anchor sweep attempts immediately after the commitment transaction
has been published. This makes the anchor known to the sweeper and
allows the user to bump the fee on it to get their commitment
transaction confirmed in case the fee committed too is insufficient for
timely confirmation.
2020-03-18 12:26:55 +01:00
Joost Jager e8e99c6533 cnct: simplify channel arbitrator state logging 2020-03-17 16:25:39 +01:00
Joost Jager 3b517390d8 cnct+sweeper: give contract court access to relay fee
Relay fee is needed later to sweep anchors at the minimum fee rate.
2020-03-17 16:25:37 +01:00
Joost Jager c376cdb733 input: add anchor witness type 2020-03-17 16:25:35 +01:00
Joost Jager dd77d9263e cnct: persist anchor resolutions 2020-03-17 16:25:33 +01:00
Joost Jager 7f3d4e7d49 cnct: create channel interface for arbitrator
Allows unit testing of the channel arbitrator with fewer dependencies.
This is a preparation for the addition of anchor sweeping.
2020-03-17 16:25:31 +01:00
Joost Jager c0b1b3be14 cnct: always set trigger height to close height
Prior to this change, the trigger height for closed channels was set to
the current best block height. As this height is in some cases used as a
height hint, the spend may have been missed.
2020-03-17 16:25:29 +01:00