Commit Graph

6899 Commits

Author SHA1 Message Date
Wilmer Paulino
0b0a9f4172
channeldb+routing: refactor DeleteChannelEdge to use ChannelID
In this commit, we refactor DeleteChannelEdge to use ChannelIDs rather
than ChannelPoints. We do this as the only use of DeleteChannelEdge is
when we are pruning zombie channels from our graph. When running under a
light client, we are unable to obtain the ChannelPoint of each edge due
to the expensive operations required to do so. As a stop-gap, we'll
resort towards using an edge's ChannelID instead, which is already
gossiped between nodes.
2019-04-18 21:57:41 -07:00
Wilmer Paulino
760f38736e
fundingmanager: populate additional edge info after adding to graph
This commit serves as another stop-gap for light clients since they are
unable to obtain the capacity and channel point of graph edges. Since
they're aware of these things for their own channels, they can populate
the information within the graph themselves once each channel has been
successfully added to the graph.
2019-04-18 21:57:40 -07:00
Wilmer Paulino
aed0c2a90e
discovery: support optional message fields when processing announcements
In this commit, we extend the gossiper with support for external callers
to provide optional fields that can serve as useful when processing a
specific network announcement. This will serve useful for light clients,
which are unable to obtain the channel point and capacity for a given
channel, but can provide them manually for their own set of channels.
2019-04-18 21:57:39 -07:00
Wilmer Paulino
5d3621cc83
routing: skip max htlc validation when capacity is 0
Since light clients no longer have access to an edge's capacity, they
are unable to validate whether the max HTLC value for an updated edge
policy respects the capacity limit. As a stop-gap, we'll skip this
check.
2019-04-18 21:57:38 -07:00
Wilmer Paulino
f2637d63ba
routing: prevent fetching blocks for graph edges with AssumeChannelValid
This serves as a stop-gap for light clients as blocks need to be
downloaded from the P2P network, and even with caches, would be too
costly for them to verify. Doing this has two side effects however:
we'll no longer know of the channel capacity and outpoint, which are
essential for some of lnd's responsibilities.
2019-04-18 21:57:37 -07:00
Wilmer Paulino
fd1aa478a9
routing: disable FilteredChainView when AssumeChannelValid is active
In this commit, we disable attempting to determine when a channel has
been closed out on-chain whenever AssumeChannelValid is active. Since
the flag indicates that performing this operation is expensive, we do
this as a temporary optimization until we can include proofs of channels
being closed in the gossip protocol.

With this change, the only way for channels being removed from the graph
will be once they're considered zombies: which can happen when both
edges of a channel have their disabled bits set or when both edges
haven't had an update within the past two weeks.
2019-04-18 21:57:37 -07:00
Wilmer Paulino
7e7b8a1940
routing: prune graph nodes after pruning zombie channels
We do this to ensure we don't leave any stray nodes in our graph that
were part of the zombie channels that we've pruned.
2019-04-18 21:57:36 -07:00
Wilmer Paulino
7eb720e535
routing: mark policy as stale if edge remains double disabled
To ensure we don't mark an edge as live again just because an update
with a fresh timestamp was received, we'll ensure that we reject any
new updates for zombie channels if they remain disabled when running
with AssumeChannelValid.
2019-04-18 21:57:35 -07:00
Wilmer Paulino
f23c3b488e
routing: prune channels with disabled bit set on both edges
In this commit, we add an additional heuristic when running with
AssumeChannelValid. Since AssumeChannelValid being present assumes that
we're not able to quickly determine whether channels are valid, we also
assume that any channels with the disabled bit set on both sides are
considered zombie. This should be relatively safe to do, since the
disabled bits are usually set when the channel is closed on-chain. In
the case that they aren't, we'll have to wait until both edges haven't
had a new update within two weeks to prune them.
2019-04-18 21:57:34 -07:00
Wilmer Paulino
292defd6ba
channeldb: add IsDisabled method to ChannelEdgePolicy 2019-04-18 21:57:32 -07:00
Wilmer Paulino
78bdcbb115
routing: prune channels only if both edges are present
We do this to ensure we don't prune too aggressively, as it's possible
that we've only received the channel announcement for a channel, but not
its accompanying channel updates.
2019-04-18 21:57:31 -07:00
Wilmer Paulino
29664c9704
routing: make test channel policies optional 2019-04-18 20:47:32 -07:00
Wilmer Paulino
5173ef6f85
Merge pull request #2014 from frennkie/re-create-port-mappings
Re-create forwardings after externalIP change
2019-04-18 17:38:02 -07:00
Olaoluwa Osuntokun
76d91c702f
Merge pull request #2953 from MDrollette/remove-arg
cmd/lncli: remove unused time_limit flag
2019-04-17 19:38:11 -07:00
Olaoluwa Osuntokun
373927fb3e
Merge pull request #2950 from joostjager/remove-route-cache
routing: remove route cache
2019-04-17 19:34:19 -07:00
Olaoluwa Osuntokun
a3c980b1e8
Merge pull request #2871 from halseth/router-subscribetopology-check-started
routing/notifications: check router started on SubscribeTopology
2019-04-16 21:32:10 -07:00
Olaoluwa Osuntokun
e396b557fd
Merge pull request #2900 from valentinewallace/neutrino-fee-est
Accept external URL for neutrino fee estimation.
2019-04-16 20:47:08 -07:00
Unknown
16aad1a9ee lnwallet+chainregistry: remove unused FeeEstimator from wallet cfg 2019-04-16 14:16:56 -07:00
Olaoluwa Osuntokun
1fa13e5cfc chainregistry+config: enable neutrino fee estimation from external api
Co-authored-by: Valentine Wallace <vwallace@protonmail.com>
2019-04-16 14:16:56 -07:00
Valentine Wallace
1179895d20 chainregistry+lnd: remove unused cleanUp variable 2019-04-16 14:16:56 -07:00
Olaoluwa Osuntokun
c6b653457b lnwallet: add new WebApiFeeEstimator for API fee estimation.
Co-authored-by: Valentine Wallace <vwallace@protonmail.com>
2019-04-16 14:16:53 -07:00
Valentine Wallace
4944eb3e54 lnwallet: add implementation of WebApiFeeSource for external APIs
This enables users to specify an external API for fee estimation.
The API is expected to return fees in the JSON format:
`{
	fee_by_block_target: {
	   a: x,
	   b: y,
	   ...
	   c: z
        }
 }`
 where a, b, c are block targets and x, y, z are fees in sat/kb.
 Note that a, b, c need not be contiguous.
2019-04-16 13:50:40 -07:00
Olaoluwa Osuntokun
9b8549011c lnwallet: add new WebApiFeeSource interface
In this commit, we add a new interface which will allow callers to drop
in an arbitrary Web API for fee estimation with an arbitrary
request/response schema.

Co-authored-by: Valentine Wallace <vwallace@protonmail.com>
2019-04-16 13:50:40 -07:00
Johan T. Halseth
58ec9efed2
Merge pull request #2959 from halseth/err-router-shutting-down
[trivial] routing/router: define ErrRouterShuttingDown
2019-04-16 15:30:22 +02:00
Johan T. Halseth
74a4286bba
Merge pull request #2960 from wpaulino/reliable-send-panic
discovery: check nil policy within isMsgStale
2019-04-16 09:11:10 +02:00
Olaoluwa Osuntokun
8418dc5530
Merge pull request #2939 from Roasbeef/hodl-htlc-fix
htlcswitch: only perform CLTV checks for HTLCs with open invoices
2019-04-15 12:52:45 -07:00
Wilmer Paulino
90475d5339
discovery: check nil policy within isMsgStale
If both policies don't exist, then this would result in a panic. Since
they don't exist, we can assume the policy we're currently evaluating is
fresh.
2019-04-15 12:49:34 -07:00
Olaoluwa Osuntokun
c1f7732a31
Merge pull request #2947 from ottosuess/patch-2
lncli: fix exportChanBackup description typo
2019-04-15 12:39:48 -07:00
Johan T. Halseth
2b9efcbaeb
routing/router: define ErrRouterShuttingDown 2019-04-15 16:55:10 +02:00
Matt Drollette
c5b597b501 cmd/lncli: remove unused time_limit flag 2019-04-14 12:09:52 -05:00
Robert Habermann
a27ac66eed server: add periodic renewal of port forwarding
The check prevented the creation of port forwardings which were assumed
to be present already. After this change the port forwardings which
might have been removed from the NAT device can be re-created.
2019-04-13 13:49:31 +00:00
Joost Jager
3b94627c12
routing: remove route cache
This commit removes the QueryRoutes route cache. It is causing wrong
routes to be returned because not all of the request parameters are
stored.

The cache allowed high frequency QueryRoutes calls to the same
destination and with the same amount to be returned fast. This behaviour
can also be achieved by caching the request on the client side. In case
a route is invalidated because of for example a channel update,
the subsequent SendToRoute call will fail. This is a trigger to call
QueryRoutes again for a fresh route.
2019-04-13 08:10:32 +02:00
Otto Suess
2bd217a5d9
lncli: fix exportChanBackup description typo 2019-04-12 20:14:32 +02:00
Johan T. Halseth
c0141a7bc1
Merge pull request #2937 from cfromknecht/moar-darwin-woes
lnd_test: bump timeout for darwin builds
2019-04-12 15:31:42 +02:00
Joost Jager
2b43da4220
Merge pull request #2944 from joostjager/increase-test-timeout
htlcswitch/test: increase test timeout for hodl invoice tests
2019-04-12 11:50:20 +02:00
Joost Jager
40cea6b487
htlcswitch/test: increase test timeout for hodl invoice tests 2019-04-12 09:01:05 +02:00
Olaoluwa Osuntokun
dd48a36226
Merge pull request #2933 from Roasbeef/recovery-docs
docs: add new recovery.md explaning methods of fund recovery
2019-04-11 19:42:01 -07:00
Conner Fromknecht
9946372d52
make/testing_flags: extend itest timeout from 20m to 30m 2019-04-11 18:13:33 -07:00
Olaoluwa Osuntokun
5d68f0f9eb
htlcswitch: only perform CLTV checks for HTLCs with open invoices
In this commit, we fix a bug that would cause a node with a hodl HTLC to
cancel back the HTLC upon restart if the invoice has been settled, but
the HTLC is still present on the commitment transaction. A fix for the
HTLC still being present (not triggering a new commitment) has been
fixed recently. However, for older nodes with a lingering HTLC, on
restart it would be failed back.

In this commit, we make the check stricter by only performing these
checks for HTLCs that are in the open state. This ensures that we'll
only check this constraints the first time around, before the HTLC has
been transitioned to the accepted state.
2019-04-11 17:53:25 -07:00
Olaoluwa Osuntokun
5fc6cbc6d8
docs: add new recovery.md explaning methods of fund recovery 2019-04-11 16:56:57 -07:00
Conner Fromknecht
fd80866627
lnd_test: bump timeout for darwin builds 2019-04-11 16:26:11 -07:00
Olaoluwa Osuntokun
f9a08044dc
release: update release build to include select sub-servers 2019-04-11 16:04:42 -07:00
Olaoluwa Osuntokun
d817b8c9db
server: remove duplicate HistoricalSyncTicker param 2019-04-11 16:01:17 -07:00
Conner Fromknecht
5b3170d542 lnd_test: apply AsyncBenchmarkTimeout to async_payments_benchmark
It was mistakenly only applied to async_bidirectional_payments, which
can also see timeouts due to darwin fsync performance regression.
2019-04-11 15:54:21 -07:00
Olaoluwa Osuntokun
b089eb8c83
Merge pull request #2928 from philippgille/feature/update-go-version
Update Go version from 1.11 to 1.12
2019-04-11 15:51:47 -07:00
Olaoluwa Osuntokun
a8c6d03fae
Merge pull request #2929 from cfromknecht/delay-restored-chan-reestablish
htlcswitch/link: delay restored channel reestablish
2019-04-11 15:50:07 -07:00
Wilmer Paulino
4bb4b0fe4e discovery: increase DefaultHistoricalSyncInterval to one hour
Assuming a graph size of 50,000 channels, an interval of 20 minutes
would cause nodes to consume about 600MB per month in bandwidth doing
these routine historical sync spot checks. In this commit, we increase
to one hour, which consumes about 300MB per month.
2019-04-11 15:46:22 -07:00
Wilmer Paulino
be727ab0be config+server: expose HistoricalSyncInterval flag
This allows us to set how often the daemon should routinely perform
historical graph syncs.
2019-04-11 15:45:19 -07:00
Conner Fromknecht
057bed2b92
htlcswitch/link: delay restored channel reestablish
This commit adds a brief delay when sending our channel reestablish
message if the link contains a restored channel to ensure we first have
a stable connection. Sending the message will cause the remote peer to
force close the channel, which currently may not be resumed reliably if
the connection is being torn town simultaneously. This delay can be
removed after the force close is reliable, but in the meantime it
improves the reliability of successfully closing out the channel and
allows the `channel_backup_restore/restore_during_creation` to pass
reliably.
2019-04-11 15:42:02 -07:00
Olaoluwa Osuntokun
6963a92950
Merge pull request #2931 from cfromknecht/channel-backup-flake
lnd_test: use WaitNoError when testing num singles in...
2019-04-11 15:39:36 -07:00