Commit Graph

6806 Commits

Author SHA1 Message Date
caa0e2f0b8 Merge pull request #2879 from joostjager/outgoing-go-to-chain
htlcswitch: revert forwarding policy block delta requirements
2019-04-05 15:45:30 -07:00
209c2c6ead Merge pull request #2841 from philippgille/patch-4
docs: fix broken TOC in Tor docs
2019-04-05 15:35:50 -07:00
a52f013161 Merge pull request #2893 from cfromknecht/no-want-zombie
channeldb/graph: filter zombie channels in FilterKnownChanIDs
2019-04-05 14:45:11 -07:00
46aa8503b2 Merge pull request #2892 from wpaulino/verify-chan-backup
rpc: modify VerifyChanBackup to take either a Single or Multi
2019-04-05 14:31:37 -07:00
a12b30f620 Merge pull request #2896 from halseth/make-fmt-routerrpc
[trivial] lnrpc/routerrpc: make fmt on router backend test
2019-04-05 14:03:31 -07:00
e91bacd1bc channeldb/graph: filter zombie channels in FilterKnownChanIDs
This commit modifies FilterKnownChanIDs to skip edges that
we ourselves have deemed zombies. This prevents us from requesting
the updates from them, as this wastes bandwidth and cpu cycles.
2019-04-05 13:01:08 -07:00
b71bb9400a rpc: modify VerifyChanBackup to take either a Single or Multi 2019-04-05 12:51:16 -07:00
f1677e7199 lnrpc/routerrpc: make fmt on router backend test 2019-04-05 17:25:49 +02:00
206d93d856 htlcswitch/test: test zero value for outbound cltv reject delta 2019-04-05 11:36:18 +02:00
1b2816006f htlcswitch/test: align test invoice cltv expiry 2019-04-05 11:36:16 +02:00
af7d0e5ff5 htlcswitch/test: convert TestChannelLinkSingleHopPayment to two hop network 2019-04-05 11:36:13 +02:00
037913fd28 link: rewrite height comparisons without subtraction
Prevent the case where a uint32 wrap around could happen.
2019-04-05 11:36:10 +02:00
ab4da0f53d cnct: define separate broadcast delta for outgoing htlcs
This commits exposes the various parameters around going to chain and
accepting htlcs in a clear way.

In addition to this, it reverts those parameters to what they were
before the merge of commit d107627145.
2019-04-05 11:36:07 +02:00
7a718a401e Merge pull request #2890 from wpaulino/walletunlocker-rest-proxy-dest
lnd+rpcserver: refactor TLS configuration
2019-04-05 00:10:39 -07:00
12ec69a48b Merge pull request #2883 from cfromknecht/chan-restore-child-harness
lnd_test: use child harness chan backup restore cases
2019-04-05 00:04:25 -07:00
4de7d0c561 Merge pull request #2889 from grunch/fix-verifychanbackup-help
Remove equal sign on verifychanbackup cmd argument
2019-04-04 15:49:22 -07:00
4c1bd14c94 Remove equal sign on verifychanbackup cmd on multi_file argument description 2019-04-04 19:06:23 -03:00
cf42719c45 lnd+rpcserver: refactor TLS configuration
This commit restructures the creation of various tls related object. It
also fixes a bug where wildcard IP addresses where only instantiated for
the main RPC server and not the WalletUnlocker service.
2019-04-04 14:18:18 -07:00
9e8fc90754 Merge pull request #2888 from grunch/add-space-on-exportchanbackup-description
Add a missing white space on exportchanbackup command description
2019-04-04 13:08:31 -07:00
0e4f5c0e2f Add a missing white space on exportchanbackup command description 2019-04-04 11:07:06 -03:00
8f5ddf39ca lnd_test: use child harness chan backup restore cases
This prevents a panic during test failure due to a child test calling
FailNow on a parent test context. The sub tests now capture the
testing.T object provided in each closure as opposed to ignoring it and
using the parent context.
2019-04-04 02:36:32 -07:00
3a19afe46d Merge pull request #2882 from wpaulino/sync-manager-stale-syncer
discovery: only replace stale active syncer if disconnected
v0.6-beta-rc2
2019-04-03 20:47:12 -07:00
00338c5ec2 discovery: properly handle SyncManager shutdown signal 2019-04-03 19:32:56 -07:00
46ceaf8cf6 discovery: only replace stale active syncer if disconnected
In this commit, we address a bug where we'd attempt to replace the
stale active syncer when it transitioned to a passive syncer. This
replacement logic is only intended to happen when the active syncer
disconnects, as rotateActiveSyncerCandidate chooses and queues its own
replacement.
2019-04-03 16:43:31 -07:00
2cc6687ff3 build: bump version to 0.6-beta v0.6-beta-rc1 2019-04-03 15:48:17 -07:00
30f2b1ca01 Merge pull request #2740 from wpaulino/gossip-sync-manager
discovery: introduce gossiper syncManager subsystem
2019-04-03 15:46:12 -07:00
ca01695330 rpc: expose peer's GossipSyncer sync type 2019-04-03 15:44:47 -07:00
8b6a9bb5d3 discovery: make timestamp range check inclusive within FilterGossipMsgs
As required by the spec:

> SHOULD send all gossip messages whose timestamp is greater or equal to
first_timestamp, and less than first_timestamp plus timestamp_range.
2019-04-03 15:44:46 -07:00
70be812747 discovery+server: use new gossiper's SyncManager subsystem 2019-04-03 15:44:43 -07:00
80b84eef9c config+peer: replace NoChanUpdates flag with NumGraphSyncPeers
In this commit, we replace the NoChanUpdates flag with a flag that
allows us to specify the number of peers we want to actively receive new
graph updates from. This will be required when integrating the new
gossiper SyncManager subsystem with the rest of lnd.
2019-04-03 15:43:51 -07:00
a188657b2f discovery: introduce gossiper SyncManager subsystem
In this commit, we introduce a new subsystem for the gossiper: the
SyncManager. This subsystem is a major overhaul on the way the daemon
performs the graph query sync state machine with peers.

Along with this subsystem, we also introduce the concept of an active
syncer. An active syncer is simply a GossipSyncer currently operating
under an ActiveSync sync type. Before this commit, all GossipSyncer's
would act as active syncers, which means that we were receiving new
graph updates from all of them. This isn't necessary, as it greatly
increases bandwidth usage as the network grows. The SyncManager changes
this by requiring a specific number of active syncers. Once we reach
this specified number, any future peers will have a GossipSyncer with a
PassiveSync sync type.

It is responsible for three main things:

1. Choosing different peers randomly to receive graph updates from to
ensure we don't only receive them from the same set of peers.

2. Choosing different peers to force a historical sync with to ensure we
have as much of the public network as possible. The first syncer
registered with the manager will also attempt a historical sync.

3. Managing an in-order queue of active syncers where the next cannot be
started until the current one has completed its state machine to ensure
they don't overlap and request the same set of channels, which
significantly reduces bandwidth usage and addresses a number of issues.
2019-04-03 15:08:32 -07:00
e075817e44 discovery: introduce GossipSyncer signal delivery of chansSynced state
In this commit, we introduce another feature to the GossipSyncer in
which it can deliver a signal to an external caller once it reaches its
terminal chansSynced state. This is yet to be used, but will serve
useful with a round-robin sync mechanism, where we wait for to finish
syncing with a specific peer before moving on to the next.
2019-04-03 15:08:31 -07:00
042241dc48 discovery: allow gossip syncer to perform historical syncs
In this commit, we introduce the ability for gossip syncers to perform
historical syncs. This allows us to reconcile any channels we're missing
that the remote peer has starting from the genesis block of the chain.
This commit serves as a prerequisite to the SyncManager, introduced in a
later commit, where we'll be able to make spot checks by performing
historical syncs with peers to ensure we have as much of the graph as
possible.
2019-04-03 15:08:30 -07:00
ca4fbd598c discovery: introduce GossipSyncer sync transitions
In this commit, we introduce the ability for GossipSyncer's to
transition their sync type. This allows us to be more flexible with our
gossip syncers, as we can now prevent them from receiving new graph
updates at any time. It's now possible to transition between the
different sync types, as long as the GossipSyncer has reached its
terminal chansSynced sync state. Certain transitions require some
additional wire messages to be sent, like in the case of an ActiveSync
GossipSyncer transitioning to a PassiveSync type.
2019-04-03 15:08:29 -07:00
acc42c1b68 discovery: set GossipSyncer update horizon to current time
With the introduction of the gossip sync manager in a later commit,
retrieving the backlog of updates within the last hour is no longer
necessary as we'll be forcing full syncs periodically.
2019-04-03 15:08:28 -07:00
8d7c0a9899 discovery: replace GossipSyncer syncChanUpdates flag with SyncerType
In this commit, we introduce a new type: SyncerType. This type denotes
the type of sync a GossipSyncer is currently under. We only introduce
the two possible entry states, ActiveSync and PassiveSync. An ActiveSync
GossipSyncer will exchange channels with the remote peer and receive new
graph updates from them, while a PassiveSync GossipSyncer will not and
will only response to the remote peer's queries.

This commit does not modify the behavior and is only meant to be a
refactor.
2019-04-03 15:08:27 -07:00
7e92b9a4e2 discovery: export gossipSyncer 2019-04-03 15:08:26 -07:00
d954cfc4ba discovery: include peerPub in gossipSyncerCfg 2019-04-03 15:08:25 -07:00
c72db902f0 discovery: replace waitPredicate with lntest version 2019-04-03 15:08:12 -07:00
b96da69476 Merge pull request #2880 from Roasbeef/windows-signals
signal: don't attempt to catch SIGSTOP
2019-04-03 14:36:10 -07:00
2a09db7c76 Merge pull request #2876 from Roasbeef/scb-follow-ups
lnrpc: add REST endpoints for new SCB related calls
2019-04-03 14:30:48 -07:00
0ca65208c5 signal: don't attempt to catch SIGSTOP
In this commit, we modify the set of default signals we attempt to catch in
order to execute a graceful shutdown. Before this commit, we would attempt
to catch/register for `SIGSTOP`. There're two issues with this

  1. `SIGSTOP` is meant to be used in combination with `SIGCONCT` to allow a
  process to be paused/resumed. Therefore, our action of shutting down once
  received was incorrect.

  2. `SIGSTOP` doesn't exist on windows, so users aren't able to compile on
  this platform without modifying the codebase.
2019-04-03 13:13:03 -07:00
fa73a60167 Merge pull request #2868 from cfromknecht/commit-bitcoind-spendhints
chainntnfs: Always commit bitcoind spendhints
2019-04-02 21:13:30 -07:00
6f2087023b lnrpc: add REST endpoints for new SCB related calls 2019-04-02 20:46:33 -07:00
1dc1e8510a Merge pull request #2847 from cfromknecht/reject-and-channel-cache
channeldb: add reject and channel caches
2019-04-02 18:23:52 -07:00
38e4f03cbd Merge pull request #2870 from halseth/stop-chansubswapper
[trivial] server: stop chansubswapper on shutdown instead of start
2019-04-02 10:58:10 +02:00
96f4cd1df9 server: stop chansubswapper on shutdown instead of start 2019-04-02 09:58:13 +02:00
90ffc4a0ab chainntnfs/bitcoindnotify: improve historical conf dispatch logging 2019-04-01 18:21:07 -07:00
7a08825b1e chainntnfs/bitcoindnotify: always call UpdateSpendDetails
This commit fixes a bug that would cause the
notifier not to commit spend hints for items
that are not found. This is done by calling
UpdateSpendDetails with a nil detail, permitting
the notifier to begin updating the spend hints
with new blocks that arrive at tip. The change
is designed to mimic the behavior for historical
confirmation dispatch.

The symptom of this bug is needing to do many
long rescans on startup, even if new blocks
arrive after the rescan had completed. With
this change, nodes will have to do the scans
once more before their hints will be properly
updated. Restarts from then on should not
have this behavior.
2019-04-01 18:20:52 -07:00
893cff60c4 Merge pull request #2839 from joostjager/htlc-expiry-check
link: increase expiry grace delta for exit hop and forwarded htlcs
2019-04-01 18:15:56 -07:00