Commit Graph

8262 Commits

Author SHA1 Message Date
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
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
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
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
Conner Fromknecht
b3b51923dc
tlv/truncated: add non-generic encoders for truncated types
These encoders can be composed to create composite types without
incurring additional allocations that would be required to pass the
truncated types through the generic interface.
2019-11-04 14:10:43 -08:00
Oliver Gugger
ae04bdb98a
doc: describe macaroon bakery 2019-11-04 15:07:24 +01:00
nsa
b392dd1b95
routing: move statTicker to prevent race condition 2019-11-02 13:55:41 -04:00
Olaoluwa Osuntokun
083b574fd8
autopilot: fix race condition in new test 2019-11-01 19:30:21 -07:00
Olaoluwa Osuntokun
acd8a6e302
Merge pull request #3470 from cfromknecht/invalid-onion-payload
htlcswitch+lnwire: invalid onion payload
2019-11-01 18:58:00 -07:00
Olaoluwa Osuntokun
38e313a869
Merge pull request #3633 from joostjager/safe-migrations
channeldb: isolate migrations
2019-11-01 18:28:56 -07:00
Olaoluwa Osuntokun
bef1cd01c7
Merge pull request #3520 from halseth/autopilot-heuristic-update-trigger
[autopilot] Trigger channel opening on external score update
2019-11-01 17:24:22 -07:00
Johan T. Halseth
e0744a3983
Merge pull request #3650 from guggero/update-grpc-gateway
proto+lnrpc: update gRPC-REST gateway to v1.8.6
2019-11-01 09:03:48 +01:00
Olaoluwa Osuntokun
4592f87033
Merge pull request #3653 from Roasbeef/external-funding-chainfees
chainfees: create new chainfees package extracting fees from lnwallet
2019-10-31 17:44:00 -07:00
Olaoluwa Osuntokun
cc159decf5
Merge pull request #3654 from Roasbeef/external-funding-chantype-bits
multi: convert the existing channeldb.ChannelType uint8 into a bit field
2019-10-31 17:24:20 -07:00
Olaoluwa Osuntokun
777ed104a3
chainfee: create new chainfee package extracting fees from lnwallet
In this commit, we create a new chainfee package, that houses all fee
related functionality used within the codebase. The creation of this new
package furthers our long-term goal of extracting functionality from the
bloated `lnwallet` package into new distinct packages. Additionally,
this new packages resolves a class of import cycle that could arise if a
new package that was imported by something in `lnwallet` wanted to use
the existing fee related functions in the prior `lnwallet` package.
2019-10-31 16:41:57 -07:00
Olaoluwa Osuntokun
a73ee28e46
multi: convert the existing channeldb.ChannelType uint8 into a bit field
In this commit, we convert the existing `channeldb.ChannelType` type
into a _bit field_. This doesn't require us to change the current
serialization or interpretation or the type as it is, since all the
current defined values us a distinct bit. This PR lays the ground work
for any future changes that may introduce new channel types (like anchor
outputs), and also any changes that may modify the existing invariants
around channels (if we're the initiator, we always have the funding
transaction).
2019-10-31 16:34:37 -07:00
Joost Jager
4486a06b1a
migration_01_to_11: remove version checking for migration tests 2019-10-31 11:25:07 +01:00
Johan T. Halseth
5a8ecfcc49
autopilot/agent_test: add TestAgentHeuristicUpdateSignal
TestAgentHeuristicUpdateSignal tests that upon notification about a
heuristic update, the agent reconsults the heuristic.
2019-10-31 10:19:50 +01:00
Johan T. Halseth
7524265ab1
autopilot: trigger agent channel open on new scores
This commit adds a new signal to the autopilot agent, meant to signal
when any of the available heuristics has gotten an update.

We currently use this to trigger a new channel opening after the
external scores have been updated.
2019-10-31 10:17:31 +01:00
Johan T. Halseth
f0ba4be758
autopilot/manager: fix slice modifications
When appending to a slice, there is no guarantee the slice won't be
modified. So instead of appending to the global slice
availableHeuristics, we create a temporary local one.
2019-10-31 10:17:31 +01:00
Johan T. Halseth
df5baa4275
autopilot/agent: trace log reason nodes being skipped 2019-10-31 10:17:31 +01:00
Oliver Gugger
b6c7ff8183
lnrpc: generate protos with new gateway version 2019-10-31 09:13:38 +01:00
Oliver Gugger
b6b57d1c00
proto: update to grpc-gateway v1.8.6 2019-10-31 09:13:33 +01:00
Joost Jager
fcf81ed8ff
Merge pull request #3556 from joostjager/query-mc-prob
routerrpc: add queryprob rpc
2019-10-31 08:03:29 +01:00
Joost Jager
60503d6c44
channeldb/migration_01_to_11: remove unused code 2019-10-31 07:18:36 +01:00
Conner Fromknecht
cba523ae30
htlcswitch/hop/payload: apply known constraints if required failure
This commit modifies the NewPayloadFromReader to apply known
presence/omission contraints in the event that the tlv parser returns an
unknown required type failure.

Now that the parser has been modified to finished parsing the stream to
obtain a proper parsed type set, we can accurately apply these higher
level validation checks. This overrides required type failures, such
that they are only returned if the sender properly abided by the
constraints on fields for which we know.

The unit tests are updated to create otherwise valid payloads that then
return unknown required type failures. In one case, a test which
previously returned an unknown required type failure is made to return
an included failure for the sid, indicating the unknown required type 0
is being overruled.
2019-10-30 21:21:10 -07:00