Commit Graph

11130 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
94f8311667
Merge pull request #4782 from cfromknecht/anchor-wtserver
watchtower: anchor channel support
2020-11-30 17:49:32 -08:00
Olaoluwa Osuntokun
39d2ea752e
Merge pull request #4789 from cfromknecht/wt-clean-shutdown
wtclient: schedule ForceQuit first during Stop
2020-11-30 17:03:18 -08:00
Olaoluwa Osuntokun
447c9f2c0b
lntest: always turn off gossip throttling for nodes created in itests 2020-11-30 16:39:06 -08:00
Olaoluwa Osuntokun
13a2598ded
discovery: add new option to toggle gossip rate limiting
In this commit, we add a new option to toggle gossip rate limiting. This
new option can be useful in contexts that require near instant
propagation of gossip messages like integration tests.
2020-11-30 16:38:56 -08:00
Olaoluwa Osuntokun
b1fbbcf562
lncfg: add new legacy protocol option to turn off gossip throttling 2020-11-30 16:38:53 -08:00
Oliver Gugger
76d2c49a17
lnd: fix Onion v2 support for Neutrino backends
With this commit we make it possible to use an Onion v2 hidden service
address as the Neutrino backend.
This failed before because an .onion address cannot be looked up and
converted into an IP address through the normal DNS resolving process,
even when using a Tor socks proxy.
Instead, we turn any v2 .onion address into a fake IPv6 representation
before giving it to Neutrino's address manager and turn it back into an
Onion host address when actually dialing.
2020-11-30 22:42:57 +01:00
Oliver Gugger
6f3c8611f4
tor: convert onion v2 addrs into fake tcp6
If we use a chain backend that only understands IP addresses (like
Neutrino for example), we need to turn any Onion v2 host addresses into
a fake IPv6 representation, otherwise it would be resolved incorrectly.
To do this, we use the same fake IPv6 address format that bitcoind and
btcd use internally to represent Onion v2 hidden service addresses.
2020-11-30 22:42:57 +01:00
Conner Fromknecht
1f86526250
wtclient: add backoff in negotiation when createSession() fails
Currently if the tower hangs up during session negotiation there is no
backoff applied. We add backoff here to avoid excessive CPU/network
utilization during unexpected failures.
2020-11-30 13:08:18 -08:00
Conner Fromknecht
5aa59906b5
wtclient: schedule ForceQuit first during Stop
Currently the ForceQuit call is scheduled after trying to stop the
backup queue. In certain cases, the call to stop the queue never
finishes, which means the force quit is never scheduled. We rememdy by
scheduling this call before any other operations to ensure we can always
exit ungracefully if necessary.
2020-11-30 13:08:04 -08:00
eugene
81783d682b
make: add zpay32 to fuzz_flags.mk 2020-11-30 07:59:41 -05:00
Olaoluwa Osuntokun
7e298f1434
Merge pull request #3367 from cfromknecht/batched-graph-updates
Batched graph updates
2020-11-25 18:40:40 -08:00
Olaoluwa Osuntokun
cefbf5f637
Merge pull request #4786 from wpaulino/rate-limit-channel-updates
discovery: rate limit incoming channel updates
2020-11-25 17:07:21 -08:00
Olaoluwa Osuntokun
7c6db24b89
Merge pull request #4777 from guggero/gh-release-build
GitHub: build release binaries and upload to release
2020-11-25 16:46:52 -08:00
Conner Fromknecht
82a238317c
lncfg+itest: expose configurable batch-commit-interval
This will permit a greater degree of tuning or customization depending
on various hardware/environmental factors.
2020-11-25 16:45:25 -08:00
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