Commit Graph

8284 Commits

Author SHA1 Message Date
Joost Jager
a364d2cd82 routing: log route when payment attempt fails 2019-11-12 14:13:31 +01:00
Joost Jager
53076880f1 htlcswitch: report failure source index for forwarding errors 2019-11-12 14:13:29 +01:00
Joost Jager
85dcaff0d9 routing/route: report amount per hop in Route.String()
Makes log output slightly more descriptive to aid debugging of routing
problems.
2019-11-12 14:13:27 +01:00
Joost Jager
de33010e90 htlcswitch/test: do not string match error 2019-11-12 14:13:25 +01:00
Johan T. Halseth
3b22540fc1 Merge pull request #2533 from yancyribbens/persistent-lnd-volume-docker-compose
add named volume to lnd service for persisting data accross container…
2019-11-11 09:47:30 +01:00
Joost Jager
b222b6e625 Merge pull request #3685 from cfromknecht/flat-features
flat features
2019-11-09 11:43:45 +01:00
Olaoluwa Osuntokun
86bed393f9 Merge pull request #2927 from joostjager/hodl-drop-fix-better
htlcswitch: fix empty commit sig and no commit sig
2019-11-08 17:16:48 -08:00
yancy ribbens
5c4edcab8f add named volume to lnd service for persisting data accross container lifecycle 2019-11-08 11:30:41 -06:00
Conner Fromknecht
5e27b5022c multi: remove LocalFeatures and GlobalFeatures 2019-11-08 05:32:00 -08:00
Conner Fromknecht
16318c5a41 multi: merge local+global features from remote peer 2019-11-08 05:31:47 -08:00
Conner Fromknecht
6c86075354 peer+server: use feature manager to generate feature vectors 2019-11-08 05:29:29 -08:00
Conner Fromknecht
fe566e1755 feature: add new feature pkg to manage feature sets
This commit introduces a feature.Manager, which derives feature vectors
for various contexts within the daemon. The sets can be described via a
staticly compiled format, which makes any runtime adjustments to the
feature sets when the manager is initialized.
2019-11-08 05:29:16 -08:00
Conner Fromknecht
90e36ca04b lnwire/features: add unified Features namespace 2019-11-08 05:28:47 -08:00
Conner Fromknecht
92fb5ac363 Merge pull request #3686 from joostjager/local-apriori
routing: use distinct probability estimation for local channels
2019-11-08 03:32:37 -08:00
Wilmer Paulino
b0dc3b76fd Merge pull request #3661 from guggero/deprecate-rest-string
proto: deprecate duplicate string fields in requests
2019-11-07 10:52:45 -08:00
Wilmer Paulino
2bec35a3d2 Merge pull request #3687 from joostjager/wallet-binding-fix
lnwallet: fix loop binding bug
2019-11-07 10:49:18 -08:00
Johan T. Halseth
d50b3a9c81 Merge pull request #3684 from alexbosworth/patch-12
trivial: fix typo
2019-11-07 12:00:35 +01:00
Joost Jager
c7fad2d7cf lnwallet: fix loop binding bug 2019-11-07 11:45:06 +01:00
Joost Jager
dc0399af51 routing: use distinct probability estimation for local channels
Previously we used the a priori probability also for our own untried
channels. This led to local channels that had seen a success already
being prioritized over untried local channels. In some cases, depending
on the configured payment attempt cost, this could lead to the payment
taking a two hop route while a direct payment was also possible.
2019-11-07 11:26:52 +01:00
Joost Jager
5a80c3459f routing: create prob estimation func taking external node prob 2019-11-07 11:25:14 +01:00
Johan T. Halseth
2947036633 Merge pull request #3664 from joostjager/outgoing-contest-resolver-test
cnct/test: add outgoing contest resolver test
2019-11-07 10:54:45 +01:00
Oliver Gugger
7e9c4f0f87 proto: deprecate duplicate string fields in requests
With this PR we deprecate fields that have been specifically added to
to work around a bug in the gRPC/REST gateway that didn't allow bytes
fields to be encoded in REST requests.
That bug has now been fixed so the fields are no longer required.
To make it more clear how bytes fields have to be used in REST,
comments have been added to all those fields.
2019-11-07 08:53:00 +01:00
Olaoluwa Osuntokun
0fbcc3b2e9 Merge pull request #3682 from guggero/docs-make-check
docs: bitcoind is required for unit tests
2019-11-06 16:00:22 -08:00
Alex Bosworth
bfe3f07959 trivial: typo fix 2019-11-06 15:46:59 -08:00
Alex Bosworth
c390219f3d trivial: fix typo 2019-11-06 15:44:12 -08:00
Joost Jager
f930dd42a6 cnct/test: add outgoing contest resolver test 2019-11-06 16:07:06 +01:00
Joost Jager
1cb796b9b7 cnct: remove redundant current block fetch
The block notifier now always sends the current block immediately.
2019-11-06 15:53:32 +01:00
Oliver Gugger
2b163480cf docs: bitcoind is required for unit tests 2019-11-06 09:47:48 +01:00
Joost Jager
0b5afa64f3 htlcswitch: remove logCommitTick
Replace logCommitTick as a way to deal with revocation window exhaustion
by retrying to update the commit tx when the remote revocation is
received.

The rationale is that the revocation window always opens up because of a
revoke message that is received from the other party. It is therefore
not necessary to set a timer for this. The reception of the revoke
message is the trigger to send a new commit sig if necessary.
2019-11-06 09:21:33 +01:00
Joost Jager
ae67b1a4a4 htlcswitch/test: test revocation window exhaustion 2019-11-06 09:21:31 +01:00
Joost Jager
5078d662ef htlcswitch: remove batch counter
Now that channel exposes the number of pending local updates, it is no
longer necessary to track the batch size separately in the link.
2019-11-06 09:21:29 +01:00
Joost Jager
2482d84d7d htlcswitch: stop batch timer if there are no updates 2019-11-06 09:21:27 +01:00
Joost Jager
03b32d046a htlcswitch+lnwallet: replace updateNeeded by check on channel itself
Instead of tracking local updates in a separate link variable, query
this state from the channel itself.

This commit also fixes the issue where the commit tx was not updated
anymore after a failed first attempt because the revocation window was
closed. Also those pending updates will be taken into account when the
remote party revokes.
2019-11-06 09:21:25 +01:00
Joost Jager
f59b4d62bf htlcswitch: check for signature owed in link
Previously the channel method FullySynced was used to decide whether to
send a new commit sig message. However, it could happen that FullySynced
was false, but that we didn't owe a commitment signature. Instead we
were waiting on the other party to send us a signature. If that
happened, we'd send out an empty commit sig. This commit modifies the
condition that triggers a new commit sig and fixes this deviation from
the spec.
2019-11-06 09:21:23 +01:00
Joost Jager
64f4421d6c htlcswitch/test: add test cases that triggers empty commit sig
Co-authored-by: Johan T. Halseth <johanth@gmail.com>
2019-11-06 09:21:21 +01:00
Joost Jager
517ad4e4f5 lnwallet: log empty commit sig event
To facilitate the logging, this commit adds a new OweCommitment method.
For the logging, we only need to consider the remote perspective. In a
later commit, we'll also start using the local perspective to support
the decision to send another signature.
2019-11-06 09:21:19 +01:00
Olaoluwa Osuntokun
863d795c94 Merge pull request #3616 from Crypt-iQ/router_race_1019
ticker: add tickerMtx to prevent data race
2019-11-05 19:47:18 -08:00
Wilmer Paulino
211eb4d472 Merge pull request #3518 from halseth/make-default-backend
[trivial] make: default backend variable to btcd
2019-11-05 15:42:46 -08:00
Olaoluwa Osuntokun
7ecb7136cf Merge pull request #3442 from cfromknecht/router-registry
single-shot, sender-side mpp via sendtoroute
2019-11-04 17:50:59 -08:00
Olaoluwa Osuntokun
71730a15b4 Merge pull request #3674 from guggero/bakery-docs
doc: describe macaroon bakery
2019-11-04 17:32:27 -08:00
Conner Fromknecht
540e44e186 lntest/itest: expand testSingleHopSendToRoute matrix
In this commit, we refactor the testSingleHopSendToRoute test to support
table driven tests for various endpoints and payment types. Currently
only the main rpcserver's SendToRoute is tested, so we also add
support the SendToRouteSync and the routerrpc's SendToRoute.

The tests are also modified to have each endpoint perform a single-hop,
single-shot MPP payment. This asserts that the Hop messages are being
properly unmarshalled and that setting correctly yields a successful
payment. At the momemnt the receiver does not actually verify or use the
MPP fields presented in the onion, though this test will be expanded
later as those pieces are assembled.
2019-11-04 15:11:55 -08:00
Conner Fromknecht
18a06b0ed3 lntest: remove unnecessary wait from single-hop sendtoroute
We already wait for all channels to open before creating the payment
requests.
2019-11-04 15:11:39 -08:00
Conner Fromknecht
8cb17d5c1f lnrpc/routerrpc/router_backend: populate and unmarshal mpp fields
This commit parses mpp_total_amt_msat and mpp_payment_addr from the
SendToRoute rpc and populates an MPP record on the internal hop
reprsentation. When the router goes to encode the onion packet, these
fields will be serialized for the destination. We also populate the mpp
fields when marshalling routes in rpc responses.
2019-11-04 15:11:23 -08:00
Conner Fromknecht
92aa78dd5f lnrpc/rpc.proto: add mpp fields to Hop message
This commit add mpp_total_amt_msat and mpp_payment_addr to the Hop
message. Doing so enables users submitting mpp payments via rpc to
set these parameters for the destination. In addition, it will allow us
to display these fields in rpc responses.
2019-11-04 15:11:07 -08:00
Conner Fromknecht
014ea0abd0 htlcswitch/iterator: remove unused ExtraOnionBlob method 2019-11-04 15:10:50 -08:00
Conner Fromknecht
9e9b912d3a multi: replace NotifyExitHopHtlc eob param with hop.Payload 2019-11-04 15:10:32 -08:00
Conner Fromknecht
70708e2e71 htlcswitch: return hop.Payload from HopIterator 2019-11-04 15:10:15 -08:00
Conner Fromknecht
4a6f5d8d3d htlcswitch/hop/payload: parse option_mpp 2019-11-04 15:10:00 -08:00
Conner Fromknecht
6d971e5113 routing/route/route: add optional MPP field to Hop
This commit also modifies the Router serialization to persist the MPP
struct when present, and properly restore it when loading from disk.
2019-11-04 14:11:28 -08:00
Conner Fromknecht
b1b7ff8006 records/mpp: add MPP struct to create corresponding tlv.Record
Used to encode/decode MPP tlv records
2019-11-04 14:11:02 -08:00