Commit Graph

6517 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
6d4a769203
Merge pull request #2231 from karliatto/change-contribution-guide-link-#2214
Docs: code_contribution_guidelines change link
2018-11-27 15:48:27 -08:00
Johan T. Halseth
8854db5191
gitignore: ignore temp backend logs folder 2018-11-27 10:21:19 +01:00
Johan T. Halseth
4d05e6bbd8
lnd_test+lntest: keep btcd debug logs from test run
Useful for debugging 🤷
2018-11-27 10:21:19 +01:00
Johan T. Halseth
3a2fd51f2f
lnd_test+lntest: move copyFile() -> lntest.CopyFile() 2018-11-27 10:21:17 +01:00
Carlos Garcia Ortiz
0f03120a46 Docs: code_contribution_guidelines change link 2018-11-27 10:20:06 +01:00
Johan T. Halseth
b389d5f6b0
lntest/harness: retry ConnectPeer of chain backend still syncing 2018-11-27 10:15:00 +01:00
Johan T. Halseth
ec76a25530
lnd_test: make test use globale defaultCSV 2018-11-27 10:11:32 +01:00
Johan T. Halseth
62e37ec840
lnd_test: use global defaultTimeout instead of test specific timeouts 2018-11-27 10:01:02 +01:00
Johan T. Halseth
f13e5472d5
lnd_test: use global minerMempoolTimeout when waiting for miner to see TXs 2018-11-27 09:59:46 +01:00
Johan T. Halseth
ea32a13fdb
lnd_test: use global channelCloseTimeout when closing channels 2018-11-27 09:59:31 +01:00
Johan T. Halseth
864d77d82e
lnd_test: use global channelOpenTimeout when opening channels 2018-11-27 09:59:29 +01:00
Olaoluwa Osuntokun
0348db760e
Merge pull request #2221 from Roasbeef/open-channel-sync-fix
rpc: properly set output index in OpenChannelSync resp
2018-11-26 16:36:13 -08:00
ErikEk
6884fe40db Set private setting for invoice 2018-11-26 09:05:37 +01:00
Olaoluwa Osuntokun
a1c39af313
rpc: properly set output index in OpenChannelSync resp
Fixes #2219
2018-11-25 21:13:00 -06:00
Olaoluwa Osuntokun
42c4597921
Merge pull request #1937 from halseth/data-loss-protect-resending
Data loss protect resending
2018-11-25 20:47:16 -06:00
Olaoluwa Osuntokun
28eb8474f4
chainntnfs: modify all historical rescans to scan backwards
In this commit, we modify all existing historical rescans for
ChainNotifier backends to scan backwards rather than forwards. If we
know that a transaction has been confirmed, or outpoint spent, the it's
likely that the event has recently transpired assuming we've been
offline for a short period of time. Therefore, if we scan backwards
rather than forwards, then we can save potentially hundreds or thousands
of block fetches if the event recently happened close to the tip of the
chain.

We bound this search at the genesis block, to ensure we don't underflow
the uint32 used throughout the package in the main loop.
2018-11-24 15:50:12 -06:00
Olaoluwa Osuntokun
8924d8fb20
Merge pull request #2206 from halseth/channel-commitchainheight-remove
[trivial] lnwallet/channel: remove startingHeight from commitmenChain
2018-11-24 15:27:54 -06:00
Johan T. Halseth
5c294601f0
lnwallet/channel: remove startingHeight from commitmentChain
Field is not being used.
2018-11-23 08:58:45 +01:00
Olaoluwa Osuntokun
712fc3ebed
Merge pull request #2205 from valentinewallace/better-sync-info
lnwallet/btcwallet: return best header timestamp while wallet is resc…
2018-11-21 23:06:25 -08:00
Johan T. Halseth
b1a35fc8f4
channeldb/migrations_test: add TestMigrateOptionalChannelCloseSummaryFields 2018-11-21 13:36:42 +01:00
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