Commit Graph

5896 Commits

Author SHA1 Message Date
Johan T. Halseth
a9bd6100ff
htlcswitch/link: remove handled TODO 2018-11-21 10:28:57 +01:00
Johan T. Halseth
0c4948b40b
lnd test: add offline scenario to testDataLossProtection
This adds the scenario where a channel is closed while the node is
offline, the node loses state and comes back online. In this case the
node should attempt to resync the channel, and the peer should resend a
channel sync message for the closed channel, such that the node can
retrieve its funds.
2018-11-21 10:28:57 +01:00
Johan T. Halseth
9e81b1fe53
chain_watcher: poll for commit point in case of failure
We pool the database for the channel commit point with an exponential
backoff. This is meant to handle the case where we are in process of
handling a channel sync, and the case where we detect a channel close
and must wait for the peer to come online to start channel sync before
we can proceed.
2018-11-21 10:28:57 +01:00
Johan T. Halseth
0dd7eed64e
peer: define resendChanSyncMsg
This method is used to fetch channel sync messages for closed channels
from the db, and respond to the peer.
2018-11-21 10:28:56 +01:00
Johan T. Halseth
da3f515f12
channeldb/db_test: add TestFetchClosedChannelForID 2018-11-21 10:28:56 +01:00
Johan T. Halseth
45b132a954
channeldb/db: define FetchClosedChannelForID
FetchClosedChannelForID is used to find the channel close summary given
only a channel ID.
2018-11-21 10:28:56 +01:00
Johan T. Halseth
a9f93b2988
contractcourt/chain_watcher: add channel sync message to CloseChannelSummary 2018-11-21 10:28:56 +01:00
Johan T. Halseth
676a1b1407
lnwallet+link: make ChanSyncMsg take channel state as arg
This lets us get the channel reestablish message without creating the LightningChannel struct first.
2018-11-21 10:28:56 +01:00
Johan T. Halseth
0b9a323fcb
channeldb/channel: add LastChanSync field to CloseChannelSummary
This commit adds an optional field LastChanSyncMsg to the
CloseChannelSummary, which will be used to save the ChannelReestablish
message for the channel at the point of channel close.
2018-11-21 10:28:43 +01:00
Johan T. Halseth
46c961aa17
channeldb/migrations: migrate ChannelCloseSummary 2018-11-21 10:27:58 +01:00
Johan T. Halseth
28b15dcbbb
channeldb/channel: write boolean to indicate presence of ChannelCloseSummary fields 2018-11-21 10:27:58 +01:00
Johan T. Halseth
149a8ce94f
channeldb/legacy_serialization: add deserializeCloseChannelSummaryV6
This commit adds a new file legacy_serialization.go, where a copy of the
current deserializeCloseChannelSummary is made, called
deserializeCloseChannelSummaryV6.

The rationale is to keep old deserialization code around to be used
during migration, as it is hard maintaining compatibility with the old
format while changing the code in use.
2018-11-21 10:12:05 +01:00
Johan T. Halseth
780e1bbead
peer: correct variable name, print error 2018-11-21 10:12:04 +01:00
Johan T. Halseth
13098a595a
lnd test: refactor testDataLossProtection
This extracts part of the test into a new helper method timeTravel,
which can be used to easily reset a node back to a state where channel
state is lost.
2018-11-21 10:12:04 +01:00
Johan T. Halseth
0ca7c8c5f8
lnd_test: define helper getChanInfo 2018-11-21 10:12:04 +01:00
Johan T. Halseth
eb2f832bba
lnd_test: define createPayReqs helper method 2018-11-21 10:12:04 +01:00
Johan T. Halseth
e1d8b07735
lnd_test: remove unused math/rand rependency 2018-11-21 10:07:56 +01:00
Valentine Wallace
3c1e0f2aef lnwallet/btcwallet: return best header timestamp while wallet is rescanning.
One way applications built on top of lnd can estimate sync percentage is
through comparing the current time to the best known timestamp of the
lnd wallet's sync state. Therefore, we should always return this
information even if the the wallet is not synced.
2018-11-21 02:15:11 +00:00
Olaoluwa Osuntokun
d3b44542d3
Merge pull request #2200 from wpaulino/birthday-block-infinite-loop
build: update btcwallet dep to fix birthday block sanity check infinite loop
2018-11-20 16:59:14 -08:00
Wilmer Paulino
62071d9082
build: update btcwallet dep to fix birthday block sanity check infinite loop
In this commit, we update our btcwallet dependency that includes a fix
to address an issue that would cause users to be stuck in an infinite
loop by fetching the same candidate birthday block due to its height not
being updated if the sanity check was attempting to fix an estimate in
the future.
2018-11-20 15:42:06 -08:00
Xavi Soler
8db3c04773 lnrpc: reorder fields in lncli getingo output
Move num_inactive_channels closer to num_active_channel,
best_header_timestamp closer to block_hash/block_height and version as
first item in the list.
2018-11-20 20:35:04 +01:00
Johan T. Halseth
d6d833c242
Merge pull request #2185 from babonet13/patch-1
Add EXPOSE directive for 9735 (p2p) & 10009 (rpc)
2018-11-19 08:48:20 +01:00
Johan T. Halseth
a6b3ef3f08
Merge pull request #2178 from grunch/removes-duplicated-default-msg
removes duplicated default message on queryroutes command
2018-11-19 08:44:47 +01:00
Tom Kirkpatrick
b3c78d7110
queryroutes: set queryroutes numRoutes param default to 10
Fix an inconsistency between the gRPC/CLI queryroutes implementations.
Ensure that the numRoutes param always defaults to 10.
2018-11-17 13:35:59 +01:00
Xavi Soler
26492c5f05 release: update release script to allow user to specify systems 2018-11-16 13:45:54 +01:00
Johan T. Halseth
aceda7fbcb
travis: enable caches
This commit sets the GOCACHE environment variable, and enables caching
on travis.

GOCACHE will tell the compiler (only go 1.10+) where to store build and
test artifacts. Caching this directory will significantly speed up
succeeding builds and test runs.

We also cache vendor/ as this will speed up the call to 'make dep'.

A few dependencies in the GOPATH are cached, as calls to 'go get' for
these will be sped up. Note that we don't cache the lnd directory, as it
will conflict with the changes in the PR being built.
2018-11-16 11:08:54 +01:00
Johan T. Halseth
b4aeb83dbb
travis: split up into 3 builds
This commit distributes the CI tests into 3 independend builds, by
splitting the integration test run and unit test coverage.

To better handle the extra cases, we define a build matrix with the
three build types (RACE and LINT, ITEST, COVER).
2018-11-16 11:08:16 +01:00
Johan T. Halseth
d3c9be1f32
travis: only run on latest go 2018-11-16 11:07:03 +01:00
Johan T. Halseth
b64d55cdbf
make: remove make travis 2018-11-16 11:04:51 +01:00
Johan T. Halseth
9e950b4739
travis: execute make travis step by step
Instead of calling 'make travis' directly, we call each step. This lets us
better track how much time is spent on each.

Also note that we execute 'itest-only' instead of 'itest', and instead
execute the dependencies (btcd, build) manually first.

We explicitly set the ITEST environment variable, for readability, and
define a new COVER. This is currently true when ITEST=true to keep the
existing build configuration, but will later be configured to be
independent.
2018-11-16 11:04:51 +01:00
Johan T. Halseth
b98ab723ee
travis: remove unnecessary export PATH
This is done automatically by travis as part of the go setup.
2018-11-16 11:04:51 +01:00
Johan T. Halseth
23c858576f
make: define itest-only
'itest-only' can be used to only run integration tests, not build any of
the dependencies. This is useful on travis, where manually executing
each command makes it easier to track the time spent on each.
2018-11-16 11:04:50 +01:00
Johan T. Halseth
c6ee2803ad
make: define goveralls 2018-11-16 11:04:50 +01:00
Johan T. Halseth
099a9b7b79
make: remove uneccessary go install
'go install' is done as part of 'go get -u'.
2018-11-16 11:04:50 +01:00
Olaoluwa Osuntokun
4da1c867c3
build: bump version to 0.5.1 2018-11-15 19:47:13 -08:00
Olaoluwa Osuntokun
99dd6f75f8
Merge pull request #2190 from Roasbeef/rescan-btcwallet-fix
build: update to latest version of btcwallet
2018-11-15 19:42:12 -08:00
Olaoluwa Osuntokun
6e06a617b2
build: update to latest version of btcwallet
In this commit, we update to the latest version of btcwallet. This
version includes a bug fix which ensures that the wallet birthday sanity
check only executes once and not each time the deamon is restarted.
2018-11-15 19:08:44 -08:00
Olaoluwa Osuntokun
3f57f65bf0
Merge pull request #2181 from wpaulino/btcwallet-notify-received
build+lnwallet: notify wallet upon relevant transaction confirmation
2018-11-14 21:39:00 -08:00
Wilmer Paulino
9ca9802d9c
lnwallet/btcwallet: check wallet rescan is complete within IsSynced
In this commit, we add an additional check to btcwallet's IsSynced
method to ensure that it is not currently undergoing a rescan. We do
this to block upon starting the server and all other dependent
subsystems until the rescan is complete.
2018-11-14 20:17:36 -08:00
Wilmer Paulino
b1860a95e0
lnwallet/btcwallet: add lightning addr scope before wallet start
In this commit, we add the lightning address scope before the wallet
starts to prevent a race condition between the wallet syncing and adding
the scope itself. This became more apparent with the recent btcwallet
fixes, as several database transactions now occur between the wallet
being started and it syncing.
2018-11-14 20:17:36 -08:00
Wilmer Paulino
f9b15e97f3
build: update btcwallet dependency to address SendOutputs bug
In this commit, we update our btcwallet dependency to include the latest
changes that aim to address the recently discovered SendOutputs bug.

This commit will also allow the lnwallet test case added in the
previous commit to succeed.
2018-11-14 20:17:36 -08:00
Wilmer Paulino
5b42a38c0f
lnwallet/interface_test: add test to detect confirmation of change output spend tx
In this commit, we add a new test to the existing set of wallet tests to
ensure we can properly detect the confirmation of transactions that
spend our change outputs. We do this as a measure to prevent future
regressions from happening where the wallet doesn't request its backend
to be notified of when an on-chain transaction pays to a change address,
like with the recently discovered SendOutputs bug.

As is, this test will not pass until we update the btcwallet dependency
in the next commit.
2018-11-14 20:17:36 -08:00
Wilmer Paulino
255f38e72d
lnwallet/btcwallet: check output is under our control in FetchInputInfo
In this commit, we add an additional check to btcwallet's FetchInputInfo
method to ensure the output is actually under control of the wallet.
Previously, the wallet would assume the output was under its control if
the txid of the output was found within the wallet. This is not a safe
assumption to make however, because if we happened to be the sender of
this transaction, it would be found within the wallet but it's not
actually under our control. To fix this, we explicitly check that there
exists an address in our wallet for this output.
2018-11-14 20:17:36 -08:00
babonet13
4f10771e48
Add EXPOSE directive for 9735 (p2p) & 10009 (rpc)
See EXPOSE additional directive line 32
2018-11-14 14:12:20 +01:00
Olaoluwa Osuntokun
fd5b24fb4e
Merge pull request #2149 from wpaulino/chan-full-proof-node-ann
discovery/gossiper: send node anns when constructing full chan proof
2018-11-13 21:13:57 -08:00
Olaoluwa Osuntokun
2f0bc5c370
Merge pull request #2124 from cfromknecht/wtlookout
[watchtower/lookout]: on-chain breach monitoring
2018-11-13 19:53:07 -08:00
Olaoluwa Osuntokun
adb8bdc359
Merge pull request #2153 from halseth/integration-tests-waitforpendingclose
lnd_test: add waitForChannelPendingForceClose
2018-11-13 16:11:05 -08:00
Johan T. Halseth
776059bdab
Merge pull request #2155 from joostjager/return-tx
lnwallet: update to new SendOutputs signature
2018-11-13 16:39:54 +01:00
Johan T. Halseth
721e9a2a90
Merge pull request #2173 from chokoboko/peer-handshake-timeout-err-msg
peer: Fix handshake timeout error message
2018-11-13 08:18:28 +01:00
Xavi Soler
ebc34a9785 rpc: add missing rest endpoints for SignMessage and VerifyMessage 2018-11-12 18:57:29 +01:00