Commit Graph

11316 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
8921f81d97
Merge pull request #4752 from Roasbeef/require-payment-addr
features+invoices: force MPP payload inclusion for non-keysend payments
2020-11-25 16:43:18 -08:00
Olaoluwa Osuntokun
4e079d1d20
lntest/itest: fix SendToRoute in UpdateChanPolicy test
It needs to include the MPP payload  now.
2020-11-25 16:32:15 -08:00
Olaoluwa Osuntokun
7fdf46ea4e
lntest/itest: update SendToRoute tests to include payment addr 2020-11-25 16:32:09 -08:00
Olaoluwa Osuntokun
43fc84919e
lnrpc: include payment addr in main Invoice proto
With this change ListInvoices will return the payment addr, and the
response to AddInvoice will as well.
2020-11-25 16:32:05 -08:00
Olaoluwa Osuntokun
d996607470
routing+lnrpc: extend BuildRoute to accept raw payAddr
In this commit, we extend the `BuildRoute` method and RPC on the router
sub-server to accept a raw payment address which will be included as
part of an MPP payload for the finla hop. This change actually also
allows users to craft their own MPP paths using BuildRoute+SendToRoute.
Our primary goal however, was to fix some broken itests since we now
require the payAddr to be present for ALL payments other than key send
payments.
2020-11-25 16:32:02 -08:00
Olaoluwa Osuntokun
530059f18b
invoices: force MPP payload inclusion for non-keysend payments
In this commit, we move to start rejecting any normal payments that
aren't keysend, if they don't also include the MPP invoice payload. With
this change, we require that some sort of e2e secret (either the payment
addr or the keysend pre-image) is present in a payload before we'll
accept the payment.

The second portion of the commit also updates all current tests in the
package. We kept the base `TestSettleInvoice` test in-tact as it still
exercises some useful behavior. However, we've removed all cases that
allow an overpayment, as the new MPP logic doesn't allow overpayment for
various reasons. In addition to this, some of the returned errors are
slightly different, tho the actual behavior is equivalent.
2020-11-25 16:31:59 -08:00
Olaoluwa Osuntokun
baeceb2a0b
lnwire: add new RequiresFeature method
In this commit, we add a new RequiresFeature method to the feature
vector struct. This method allows us to check if the set of features
we're examining *require* that the even portion of a bit pair be set.
This can be used to check if new behavior should be allowed (after we
flip new bits to be required) for existing contexts.
2020-11-25 16:31:56 -08:00
Olaoluwa Osuntokun
82ccab606c
feature: flip the required bit for payment addr in invoices/payload
In this commit, we move to start requiring the payment addr feature bit
in the invoices we produce. With this change, if a user attempts to pay
one of our invoices (assuming they're also an lnd node), then they'll
receive an error when they attempt to pay. At this point, *most* lnd
nodes should be on v0.11 at this point, and this change will notify any
lagging wallet authors to update, as these payments are generally more
secure.
2020-11-25 16:31:50 -08:00
Conner Fromknecht
f3c8311b28
lncli: add policy type flags to wtclient policy 2020-11-25 16:16:49 -08:00
Conner Fromknecht
b28bbc3223
wtclinet+itest: expose anchor client via rpc + add itest 2020-11-25 16:16:47 -08:00
Conner Fromknecht
5b3a08a1cd
multi: thread anchor client down to wtclient subserver 2020-11-25 16:16:28 -08:00
Conner Fromknecht
a5c40858c9
lnrpc/wtclientrpc: add anchor_client bool to all requests 2020-11-25 16:16:24 -08:00
Conner Fromknecht
7fc4c7c412
wtclient: prefix client logs w/ legacy or anchor 2020-11-25 15:39:14 -08:00
Conner Fromknecht
0d0f22aacb
link+peer: thread anchor tower client to link 2020-11-25 15:39:14 -08:00
Wilmer Paulino
791ba3eb50
discovery: rate limit incoming channel updates
This change was largely motivated by an increase in high disk usage as a
result of channel update spam. With an in memory graph, this would've
gone mostly undetected except for the increased bandwidth usage, which
this doesn't aim to solve yet. To minimize the effects to disks, we
begin to rate limit channel updates in two ways. Keep alive updates,
those which only increase their timestamps to signal liveliness, are now
limited to one per lnd's rebroadcast interval (current default of 24H).
Non keep alive updates are now limited to one per block per direction.
2020-11-25 15:38:08 -08:00
Conner Fromknecht
094ce09644
server: log tower client error on stop (lint) 2020-11-25 15:06:17 -08:00
Conner Fromknecht
60ad01e9c2
server: initialize distinct anchor tower client 2020-11-25 15:05:56 -08:00
Conner Fromknecht
781c6e5bea
wtclient: add anchor-aware session negotiation and filtering 2020-11-25 15:05:36 -08:00
Conner Fromknecht
eb00e496bf
watchtower/wtclient: add anchor backup tasks 2020-11-25 15:05:17 -08:00
Conner Fromknecht
97cb030854
wtclient: error on unknown witness type for backup task 2020-11-25 15:04:57 -08:00
Conner Fromknecht
74416c63f8
watchtower/wtpolicy: add IsAnchorChannel helper 2020-11-25 15:04:23 -08:00
Conner Fromknecht
dd325f04d2
watchtower/wtclient: parameterize backup task with channel type 2020-11-25 15:04:12 -08:00
Conner Fromknecht
3856acce50
wathtower/blob+wtserver: support anchor sessions 2020-11-25 15:04:00 -08:00
Conner Fromknecht
069296c46c
watchtower/wtwire: add AnchorCommit feature bits
Adds the optional/required feature bit pair for negotiating sessions for
anchor channels under features bits 2+3.
2020-11-25 15:03:49 -08:00
Conner Fromknecht
e8c545e909
routing/router: increase validation barrier size to 1000
This allows for a 1000 different persistent operations to proceed
concurrently. Now that we are batching operations at the db level, the
average number of outstanding requests will be higher since the commit
latency has increased. To compensate, we allow for more outstanding
requests to keep the router busy while batches are constructed.
2020-11-24 16:40:10 -08:00
Conner Fromknecht
f8154c65c5
discovery/gossiper: increase validation barrier size to 1000
This allows for a 1000 different validation operations to proceed
concurrently. Now that we are batching operations at the db level, the
average number of outstanding requests will be higher since the commit
latency has increased. To compensate, we allow for more outstanding
requests to keep the gossiper busy while batches are constructed.
2020-11-24 16:39:47 -08:00
Conner Fromknecht
edaa5d4308
channeldb/graph: add batched APIs for graph ingestion 2020-11-24 16:39:28 -08:00
Conner Fromknecht
9cfe08c879
channeldb/graph: split out cache updates for policy changes 2020-11-24 16:38:40 -08:00
Conner Fromknecht
d1634b5e13
batch: add external batching engine for bbolt operations 2020-11-24 16:38:27 -08:00
Conner Fromknecht
fb9218d100
discovery/gossiper: channel announcements can't be outdated 2020-11-24 16:38:14 -08:00
Johan T. Halseth
ef503bf14e
Merge pull request #4801 from halseth/router-lifecycle-logs
[logging] add more logging for failed payment shards
2020-11-24 20:49:08 +01:00
Johan T. Halseth
df049ad755
routing: promote shard logs on resume and terminal failure to Info 2020-11-24 14:59:39 +01:00
Johan T. Halseth
f8493a7522
routing: define errShardHandlerExiting 2020-11-24 14:59:39 +01:00
Johan T. Halseth
4d645ef97f
htlcswitch: add debug logs for fetching network result 2020-11-24 14:14:49 +01:00
Olaoluwa Osuntokun
7f9f4a7c8d
Merge pull request #4790 from guggero/old-pr-cleanup
multi: take over multiple small stale PRs
2020-11-23 18:40:53 -08:00
Olaoluwa Osuntokun
fd00a3a5e7
Merge pull request #4794 from halseth/bork-channels-revert
htlcswitch/link: revert borking channels on received Errors
2020-11-23 17:26:43 -08:00
Oliver Gugger
94183e0f52
docker+docs: move dev Dockerfile to root, document dev build
To finally end the discussion what Dockerfile should be used for what
and whether we should build from local source or check out from git, we
place both Dockerfiles next to each other and explicitly document their
purpose.
2020-11-23 14:48:45 +01:00
Yan Pritzker
fc73f269e4
docker: mention how to do a standalone docker build 2020-11-23 14:48:45 +01:00
Jules Lamur
685a27f72f
docs: update guide on docker production images 2020-11-23 14:48:45 +01:00
Federico Bond
10d94f99c0
multi: move several wait group done calls to defer statements 2020-11-23 14:48:44 +01:00
Johan T. Halseth
87cdf3b797
htlcswitch/link: revert borking channels on received Errors
Since it turned out borking channels on every received error could cause
us to bork channels in case of a sync error with C-lightning, we revert
this for now.
2020-11-23 14:42:41 +01:00
Marty Jones
b06e0c648e Add newline to end of log statement 2020-11-23 08:37:42 -05:00
Johan T. Halseth
ca91d50884
Merge pull request #4750 from halseth/sweeper-required-locktime-txout
Sweeper: support Inputs with required locktimes and txOuts
2020-11-21 11:54:34 +01:00
Johan T. Halseth
8d2e6deade
sweeper_test: add txOut sweep test
Add tests that inputs with required TXOuts gets aggregated and swept, while
keeping locktimes satisfied.
2020-11-21 10:17:10 +01:00
Torkel Rogstad
27849d3020
docker: add --rpclisten to start-lnd.sh
To make it possible to communicate over gRPC with an instance
running in Docker we need to expose the correct RPC interface.
2020-11-21 10:05:42 +01:00
Johan T. Halseth
616503de3e
sweep: add required TxOuts to sweep tx
Now that inputs might have accompanied outputs to be added to the sweep
tx, we add them to the sweep transaction first, and account for it when
calculating the change amount.
2020-11-20 13:06:54 +01:00
Johan T. Halseth
7f9df26efd
sweeper_test: return unique wallet utxos
We also increase the value of the wallet UTXO, as it is needed when we
want to afford fees for larger transactions.
2020-11-20 13:06:54 +01:00
Johan T. Halseth
0cba47dac0
sweep/tx_input_set: account for required outputs in input set
If inputs require outputs to be added at the same time, this will
change the weight and amount calculations, so we must account for that.

We wait to get the weight estimator for the sweep tx until needed,
such that we can easily choose whether to include a change output or not
in the estimate. This is needed for the case where the second level
transactions can pay for their own fee, so no change output is needed.
2020-11-20 13:06:54 +01:00
Johan T. Halseth
985b7838ab
sweep+input: add RequiredTxOut to inputs
This is needed to sweep second level HTLC transactions that are signed
using SINGLE|ANYONECANPAY, since the input and ouput must be aligned.
2020-11-20 13:06:54 +01:00
Johan T. Halseth
aa8fa9d0cf
sweep: pass dustLimit to CreateSweepTx 2020-11-20 13:06:53 +01:00