Commit Graph
100 Commits
Author SHA1 Message Date
Conner Fromknecht f6c194c3cd netann/node_announcement: consolidate signing logic 2020-03-17 16:25:02 -07:00
Conner Fromknecht 089ac647d8 discovery/chan_series: use netann.ChannelUpdateFromEdge helper 2020-03-17 16:24:25 -07:00
Conner Fromknecht 7b0d564692 discovery: move remotePubFromChanInfo to gossiper, remove utils 2020-03-17 16:24:10 -07:00
Conner Fromknecht 6a813e3433 discovery/multi: move CreateChanAnnouncement to netann 2020-03-17 16:23:54 -07:00
Conner Fromknecht d82aacbdc5 discovery/utils: use netann.ChannelUpdateFromEdge 2020-03-17 16:23:37 -07:00
Conner Fromknecht 9d92cfd2b4 netann/channel_update: use generic SignAnnouncement 2020-03-17 16:23:19 -07:00
Conner Fromknecht df44d19936 discovery/multi: move SignAnnouncement to netann 2020-03-17 16:23:01 -07:00
Conner Fromknecht fcecc5cc39 Merge pull request #4066 from guggero/unlock-stdin
lncli: allow unlock with password from stdin
2020-03-10 17:58:55 -07:00
Conner Fromknecht ae815f221f input/size: correct NestedP2WSHSize comment 2020-03-10 11:53:58 -07:00
Conner Fromknecht 7a1013fb9e make+travis: verify compiled protos on travis 2020-03-10 13:03:01 +01:00
Conner Fromknecht 852ab592bb Merge pull request #4034 from cfromknecht/nested-size-fix
input/size: correct NP2WKH and NP2SH input count
2020-03-09 18:24:52 -07:00
Conner Fromknecht 8a5d846f94 Merge pull request #3996 from guggero/lncli-json
lncli+proto: use original name in jsonpb marshaler and remove json_name fields in proto
2020-03-07 11:08:14 -08:00
Conner Fromknecht ecf7d82904 Merge pull request #4055 from cfromknecht/remove-failed-channels
peer: remove unused failedChannels channels map
2020-03-06 16:50:57 -08:00
Conner Fromknecht e4090c3c67 peer: remove unused failedChannels channels map 2020-03-06 15:45:34 -08:00
Conner Fromknecht 089953ea97 Merge pull request #4045 from cfromknecht/list-channels-with
cmd/lncli: add --with flag to list channels
2020-03-06 12:38:34 -08:00
Conner Fromknecht 11532df5f3 cmd/lncli: add --peer flag to list channels
This commit adds a flag to listchannels that filters by remote pubkey.
2020-03-05 20:44:18 -08:00
Conner Fromknecht c2ec4a450d Merge pull request #4040 from cfromknecht/fee-report-sid
lnrpc+rpcserver: expose short chan id on feereport
2020-03-05 20:16:11 -08:00
Conner Fromknecht 5c9b336a61 lnrpc+rpcserver: expose short chan id on feereport
This commit adds each channel's short chan id to the `feereport` rpc.
Without this, it can be tedious to lookup more info about a particular
channel since most rpcs only accept short chan ids and not channel
points. For instance, now one can take a channel id from `feereport` and
look it up directly via `getchaninfo` to examine the policy in more
detail.
2020-03-04 15:37:17 -08:00
Conner Fromknecht 4c2bc7bc79 lnwallet+input: move size_test.go to input pkg 2020-03-04 08:01:37 -08:00
Conner Fromknecht 4c402ab9d4 lnwallet/size_test: refactor and expand unit tests 2020-03-04 08:00:48 -08:00
Conner Fromknecht 6eb7f2800d input/size: correct NP2WKH and NP2SH input count
This commit corrects a bug in TxWeightEstimator that could result in
underestimations for transactions involving NestedP2WPKH and NestedP2WSH
inputs. The scriptSig data push is now accounted for in a proper size
constant, and the input count is now incremented in both. This would
only be detectable in the event that the number of non-nested inputs and
the total number of inputs straddle the discontinuities in the
CompactSize encoding, e.g. 253, 2^16-1, or 2^32-1.
2020-03-04 08:00:33 -08:00
Conner Fromknecht be74d94c48 lnwallet/size_test: add test exercising nested input count bug
This commit modifies the NP2WKH and NP2WSH input tests to ensure the
input count is properly incremented and accounted for in the size
estimate. 253 is chosen because it is the lowest value that, when
serialized, occupies more than one byte on the wire.
2020-03-04 08:00:09 -08:00
Conner Fromknecht 1467cd4dd3 Merge pull request #4035 from elkanatovey/master
fix typo
2020-03-02 07:23:59 -03:00
Conner Fromknecht e3d86780af Merge pull request #4013 from fguisso/wtclientrpc
Remove remaining wtclientrpc flags
2020-02-27 16:19:11 -03:00
Conner Fromknecht 9fc197d8b1 routing/route: fix TestMPPHop comment 2020-01-28 06:43:44 -08:00
Conner Fromknecht 0cb27151e5 routing/route: add AMP record to payload size calcs 2020-01-28 06:43:34 -08:00
Conner Fromknecht de88a4b174 record: add AMP record and encode/decode methods 2020-01-28 06:43:07 -08:00
Conner Fromknecht 51dbdd3b38 multi: rename key_send, key-send and key send to keysend 2020-01-16 18:37:16 -08:00
Conner Fromknecht 51306f4ecd lncli: fix sendcoins docs, allow base58 or bech32 addrs 2020-01-15 05:01:42 -08:00
Conner Fromknecht b3f2a94c3b lncli: improve last_hop help message
Clarifies that last_hop is not the destination, but the penultimate node
in the path, i.e. the last intermediary.
2020-01-09 17:57:52 -08:00
Conner Fromknecht 32284ef1f1 routing/pathfind_test: use ctx in recent tests
Modifies TestMissingFeatureDep and TestDestPaymentAddr to use the test
ctx directly instead of generating a closure and using local state to
modify restrictions.
2020-01-09 13:53:45 -08:00
Conner Fromknecht 6c8c99dae9 Merge pull request #3893 from cfromknecht/pathfind-ignore-required-features
routing: ignore unknown required features in pathfinding
2020-01-08 14:13:04 -08:00
Conner Fromknecht 2510ec00f5 watchtower/wtwire/init: use feature.ValidateRequired
This allows us to remove the custom error type originally implemented
for this purpose.
2020-01-08 12:26:00 -08:00
Conner Fromknecht 0f9023256e peer: use feature.ValidateRequired, cleanup error msgs 2020-01-08 12:25:41 -08:00
Conner Fromknecht b9b66419ff zpay32/invoice: remove unknown required fbit check from decode
This commit removes the unknown required feature bit check from the
invoice decoding logic. This allows greater utility to users of the
decodepayreq rpc since it can provide inspection of otherwise invalid
invoices. In the prior commit, this check moved into our path finding
logic, so invalid features taken from an invoice will instead cause a
failure when attempting to pay.
2020-01-08 12:25:21 -08:00
Conner Fromknecht c7a241fc59 routing/pathfind: ignore unknown required features
This commit brings us inline with recent modifications to the spec, that
say we shouldn't pay nodes whose feature vectors signal unknown required
features, and also that we shouldn't route through nodes signaling
unknown required features.

Currently we assert that invoices don't have such features during
decoding, but now that users can specify feature vectors via the rpc
interface, it makes sense to perform this check deeper in call stack.
This will also allow us to remove the check from decoding entirely,
making decodepayreq more useful for debugging.
2020-01-08 12:25:00 -08:00
Conner Fromknecht f9a1acfbe4 feature/required: add ValidateRequired method
This wraps the raw UnknownRequiredFeatures method and returns a proper
error type to enable more exact testing.
2020-01-08 12:24:37 -08:00
Conner Fromknecht 72a49d486a Merge pull request #3647 from cfromknecht/hex-jsonpb
build+lncli: default to hex encoding for byte slices
2019-12-20 18:23:52 -08:00
Conner Fromknecht 153cd58c97 lnrpc+lncli: reorder getinfo and use printRespJSON 2019-12-20 01:05:27 -08:00
Conner Fromknecht 8f5d78c875 build+lncli: default to hex encoding for byte slices
This commit swaps out golang/protobuf/jsonpb for a custom variant that
by default prints byte slices as hex, which is more useful for our
setting. Some existing wrapper structs are removed as they can now be
printed directly with the new jsonpb.

!!! NOTE !!!

This commit introduces a breaking change to lncli listinvoices since
payment hashes and preimages will now be printed in hex instead of
base64.
2019-12-20 01:05:08 -08:00
Conner Fromknecht fb6cf21948 Merge pull request #3862 from cfromknecht/allow-graph-feature-fallback
routerrpc: allow dest_features graph fallback
2019-12-20 00:39:26 -08:00
Conner Fromknecht f6172fb83a Merge pull request #3858 from bhandras/betweenness_centrality
autopilot: fix memChannelGraph channel edge addition
2019-12-19 22:52:40 -08:00
Conner Fromknecht e6db31f267 routerrpc: allow dest_features graph fallback 2019-12-19 16:28:57 -08:00
Conner Fromknecht e745798a6e zpay32: update spec test vectors, write features last
This commit updates the BOLT11 test vectors to use the updated versions
from the spec (with TLV bit set). This also pointed out that the
ordering was inconsistent with the spec, in that the payment secret
should be serialized before the feature vector.
2019-12-19 14:36:28 -08:00
Conner Fromknecht ff443a389b routing/pathfind_test: constructed sorted edge policies
This commit fixes a potential bug in our test harness, by ensuring that
the constructed node policies are configured _after_ sorting. Currently
the node pubkeys are sorted, but additional parameters (max htlc,
disabled, etc) are applied using the unsorted policies.

Most of the constructors used today use the symmetric channel
constructor, so this shouldn't cause an issue with the majority of our
tests. We recently introduced an asymmetric channel constructor for
which this could have been an issue, however, no known issues were
discovered.

Lastly, we remove the direction from the configuration altogether, and
derive it purely from the final sorting of the pubkeys.
2019-12-19 03:47:24 -08:00
Conner Fromknecht 8ce9e15f4a Merge pull request #3679 from cfromknecht/bolt-11-payment-addr
bolt 11 payment addr + single shot mpp for SendPayment
2019-12-19 01:48:14 -08:00
Conner Fromknecht 1dbeb34a66 feature/default_sets: expose optional mpp and pay_addr features IN9 2019-12-18 23:58:11 -08:00
Conner Fromknecht 35dd5f354d routerrpc: parse dest_features bits for manual SendPayment 2019-12-18 23:57:38 -08:00
Conner Fromknecht 457fda6095 routerrpc: add dest_features to SendPaymentRequest 2019-12-18 23:57:23 -08:00
Conner Fromknecht 396a978cec lntest+wait: replace sleeps in assertAmountSent
This commit constructs a helper closure assertAmountSent that can be
reused by other functions. The closure returns an error so that it can
be used with wait.NoError or the new wait.InvariantNoError. The latter
is added since the predicate could otherwise pass immediately for the
sphinx_replay_persistence tests, but change shortly after. It also
rounds out the wait package so that we offer all combinations of
predicate and no-error style waits.
2019-12-18 23:57:12 -08:00
Conner Fromknecht f868bc128b rpcserver+routerrpc: thread features + payment addr to SendPayment 2019-12-18 23:56:59 -08:00
Conner Fromknecht 0993256b77 routing/pathfind: set single-shot MPP if payment addr is known 2019-12-18 23:56:42 -08:00
Conner Fromknecht 7965cb08db routing/pathfind: consolidate population of custom records 2019-12-18 23:56:23 -08:00
Conner Fromknecht cddb71ee53 routing/pathfind: evaluate TLV support sooner
We move up the check for TLV support, since we will later use it to
determine if we can use dependent features, e.g. TLV records and payment
addresses.
2019-12-18 23:56:05 -08:00
Conner Fromknecht e3a9603846 routing/pathfind: simplify cltv calculation 2019-12-18 23:55:47 -08:00
Conner Fromknecht b97adf79a4 routing/pathfind: consolidate final vs non-final hop processing 2019-12-18 23:55:27 -08:00
Conner Fromknecht 495ae8ca42 routing: consolidate final hop params for newRoute
This commit creates a wrapper struct, grouping all parameters that
influence the final hop during route construction. This is a preliminary
step for passing in the receiver's invoice feature bits, which will be
used to select an appropriate payment or payload type.
2019-12-18 23:55:08 -08:00
Conner Fromknecht 71e05e05bf routing/pathfind: set final hop features used in pathfinding
In this commit, we overwrite the final hop's features with either the
destination features or those loaded from the graph fallback. This
ensures that the same features used in pathfinding will be provided to
route construction.

In an earlier commit, we validated the final hop's transitive feature
dependencies, so we also add validation to non-final nodes.
2019-12-18 23:54:49 -08:00
Conner Fromknecht 990d55d08c routing/pathfind: ensure final hop supports payment addrs
This commit adds an optional PaymentAddr field to the RestrictParams, so
that we can verify the final hop can support it before doing an
expensive round of pathfindig.
2019-12-18 23:54:31 -08:00
Conner Fromknecht acb7b83ead routing/pathfind: validate final hop feature dependencies 2019-12-18 23:54:11 -08:00
Conner Fromknecht cfa3fe2921 routing/pathfind: fix TLV fallback for unadvertised hops
In this commit, we fix a bug that prevents us from sending custom
records to nodes that aren't in the graph. Previously we would simply
fail if we were unable to retrieve the node's features.

To remedy, we add the option of supplying the destination's feature bits
into path finding. If present, we will use them directly without
consulting the graph, resolving the original issue. Instead, we will
only consult the graph as a fallback, which will still fail if the node
doesn't exist since the TLV features won't be populated in the empty
feature vector.

Furthermore, this also permits us to provide "virtual features" into the
pathfinding logic, where we make assumptions about what the receiver
supports even if the feature vector isn't actually taken from an
invoice. This can useful in cases like keysend, where we don't have an
invoice, but we can still attempt the payment if we assume the receiver
supports TLV.
2019-12-18 23:53:51 -08:00
Conner Fromknecht bd66c0d34e routing/pathfind_test: allow custom node features
This commit allows custom node features to be populated in specific test
instances. For consistency, we auto-populate an empty feature vector for
nodes that have nil feature vectors before writing them to the database.
2019-12-18 23:53:32 -08:00
Conner Fromknecht 618810394c routing/pathfind_test: add asymmetric chan consructor
Later this will be used to populate distinct feature vectors for either
end of the channel.
2019-12-18 23:53:18 -08:00
Conner Fromknecht 80802d8e84 channeldb/graph: always populate LightningNode features
Previously we would return nil features when we didn't have a node
announcement or a given node. With this change, we can always assume the
feature vector is populated during pathfinding.
2019-12-18 23:53:05 -08:00
Conner Fromknecht 9025a30f5d lnwire/features: add EmptyFeatureVector constructor 2019-12-18 23:52:44 -08:00
Conner Fromknecht 46a994350c Merge pull request #3834 from cfromknecht/transitive-features
feature: add transitive feature bit validation
2019-12-16 14:00:58 -08:00
Conner Fromknecht 34fd27280a peer: validate remote peer's feature deps 2019-12-16 13:06:59 -08:00
Conner Fromknecht 3208e287c3 feature/manager: ensure all feature sets properly set deps 2019-12-16 13:06:45 -08:00
Conner Fromknecht 868a5425c1 feature/deps: validate feature dependencies 2019-12-16 13:06:30 -08:00
Conner Fromknecht 24e663519a lnwire/features: add payment-addr and mpp feature bits 2019-12-16 13:06:15 -08:00
Conner Fromknecht b2d276feb8 lnrpc: update all feature vectors to maps 2019-12-14 07:05:21 -08:00
Conner Fromknecht 990bdd6b64 lnrpc: display remote peer features via rpc 2019-12-14 07:05:07 -08:00
Conner Fromknecht db0029d03d lnrpc: add node features to LightningNode and NodeInfo 2019-12-14 07:04:51 -08:00
Conner Fromknecht d5d38c6e01 signrpc: fix uncommitted changes from proto 2019-12-12 17:20:33 -08:00
Conner Fromknecht 1901f59c07 Merge pull request #3828 from joostjager/custom-records-sanity
channeldb: custom records sanity check
2019-12-12 11:36:27 -08:00
Conner Fromknecht cc18d0ae6b Merge pull request #3824 from cfromknecht/invoice-features-rpc
lnrpc: expose features on rpc invoices
2019-12-12 01:33:48 -08:00
Conner Fromknecht aba49c9a5a rpcserver: populate features on lnrpc invoices
In the process, we also move the feature serialization into the
invoicesrpc package, so that it can be shared between the invoicesrpc
and main rpcserver.
2019-12-12 00:12:51 -08:00
Conner Fromknecht 7446495b6d lnrpc: add features field to invoices 2019-12-12 00:08:18 -08:00
Conner Fromknecht 840476996c zpay32: ensure feature vector is always populated 2019-12-11 17:37:18 -08:00
Conner Fromknecht 1367187454 multi: set invoice feature bits using feature manager 2019-12-10 13:09:52 -08:00
Conner Fromknecht a168f37b9c lnwire+rpcserver: populate feature bits on decodepayreq 2019-12-10 13:09:36 -08:00
Conner Fromknecht 5defa425e1 lnrpc: add feature bits to PayReq 2019-12-10 13:09:17 -08:00
Conner Fromknecht f34239889b lnwire/feature: remove feature bit number from name
The number and the name will be separate on the rpc level, so we remove
the feature bit from the string. Currently this method is unused apart
from maybe in some rare logging instances.
2019-12-10 13:08:59 -08:00
Conner Fromknecht a77e111c52 zpay32: remove unused InvoiceFeatures
Originally the feature namespaces were destined to be split, but this
has changed with the introduction of flat features.
2019-12-10 13:08:40 -08:00
Conner Fromknecht d230cf89b9 Merge pull request #3774 from bhandras/hotfix
lnwire: fixing buffer size and cleaning up uint16/32 conversion
2019-12-05 17:03:16 -08:00
Conner Fromknecht 8b3ee62366 Merge pull request #3794 from cfromknecht/stage-travis
travis: staged builds
2019-12-05 15:34:01 -08:00
Conner Fromknecht d7af7934b8 travis: staged travis builds
This PR introduces staging to our travis pipeline. Currently all
instances perform:

 - compilation of lnd
 - linting
 - compilation and installation of btcd binaries
 - installation of bitcoind binaries

In total this adds about 3 minutes to each of our 5 instances, resulting in
roughly 12 minutes of redundant execution time. Additionally, if if a build
fails to compile or lint we detect this 5 separate times, consuming precious
instances from other builds.

We alleviate this by adding an initial Build phase, which runs a single
instance performing the actions above. This has the benefit of quickly sanity
checking the pr before moving on to the more expensive unit or integration test
suites, and failing faster for common mistakes. It also warms up the build
caches for the Test stage in one fell swoop.

For instance, if 5 people push changes at the same time, they can all get
immediate feedback regarding compilation or linting issues, and potentially
save hours waiting for other people's test to finish or fail before finding out
they had a spelling error. This doesn't alleviate all possible issues, e.g. the
5 instances may already be consumed by test suites, but it does make a sizable
step towards minimizing time-to-failure in common scenarios.
2019-12-05 14:36:01 -08:00
Conner Fromknecht f3398c0c0e Merge pull request #3789 from cfromknecht/coop-close-rpc-status
republish force and coop closes on startup
2019-12-05 10:35:53 -08:00
Conner Fromknecht 969fe440b7 Merge pull request #3788 from cfromknecht/payment-addr
parse and generate bolt 11 invoices w/ payment addrs
2019-12-05 10:29:35 -08:00
Conner Fromknecht abb7f4fa9e lnrpc+rpcserver: add payment_addr field to PayReq 2019-12-05 07:59:47 -08:00
Conner Fromknecht cd27ee7cfc rpcserver+invoicesrpc: set payment addr on new invoices
This commit modifies Lighting.AddInvoice and InvoicesRPC.AddHoldInvoice
to include the node's supported feature bits on the invoice. For now
this only includes the optional TLV Onion Payload bit.
2019-12-05 07:59:31 -08:00
Conner Fromknecht df72097f2d zpay32/invoice: parse payment address as type s 2019-12-05 07:59:17 -08:00
Conner Fromknecht 2bf94fa409 zpay32/invoice: consolidate 32-byte array parsing and encoding logic
This commit also consolidates the existing code duplication in parsing
payment hashes and description hashes into a single, combined method for
parsing 32-byte values. A similar change is made for encoding 32-byte
values.

zpay32/invoice: consolidate 32-byte encoding logic
2019-12-05 07:58:55 -08:00
Conner Fromknecht 4c30f7d5de Merge pull request #3719 from guggero/scb-unconfirmed-channels
chanbackup: encode broadcast height in chan ID for unconfirmed channels
2019-12-04 19:26:24 -08:00
Conner Fromknecht 0610578abb lntest/itest/lnd_test: assert coop close chan status
This commit adds an itest assertion to check that a coop closed
channel's status is properly refelcted in list channels. We also fix a
race condition that prevented the rpc from being externally consistent
by marking the close sooner in the pipeline.
2019-12-04 14:25:29 -08:00
Conner Fromknecht 46990c412c channeldb/channel: allow storing empty closes
This is preparation for the subsequent commit, allowing us to fix a race
condition in the integration test assertions.
2019-12-04 14:25:29 -08:00
Conner Fromknecht d9cf0396b3 peer+chancloser: mark coop broadcasted 2019-12-04 14:25:28 -08:00
Conner Fromknecht b3c28c9cba contractcourt: generalize rebroadcast for force and coop 2019-12-04 14:25:28 -08:00
Conner Fromknecht 1c0dc98a7c channeldb: differentiate force vs coop close 2019-12-04 14:25:28 -08:00
Conner Fromknecht 884c5f0125 Merge pull request #3584 from bjarnemagnussen/ltcd-docker
docker: fix ltcd ports
2019-12-03 13:07:34 -08:00