Commit Graph
100 Commits
Author SHA1 Message Date
Johan T. Halseth 3d7bbd6d72 channeldb/graph: write max 80 sig len for nodes 2018-12-05 09:31:26 +01:00
Johan T. Halseth 5dcd2a4530 gossiper: validate our own node announement 2018-12-05 09:31:25 +01:00
Johan T. Halseth 349551373d Merge pull request #2257 from yancyribbens/apk-docker-dependencies-fix
docker: fix dockerfile dependency bug
2018-12-05 08:26:53 +01:00
Johan T. Halseth 0ba4fb8605 make: don't hardcode commit date
As it won't correspond to the commit hash, include the whole version
string.
2018-12-04 14:09:33 +01:00
Johan T. Halseth bafc44c14b make: get btcd commit hash from go.mod
Since go.sum also contains historical commits, we must fetch currenct
commit hash from go.mod.
2018-12-04 13:50:51 +01:00
Johan T. Halseth 5f8425cb03 routing/pathfind_test: check error before attempting cleanup 2018-12-04 12:20:45 +01:00
Johan T. Halseth 67b018476c routing/pathfind test: add TestPathSourceEdgesBandwidth
This commit adds a new test that checks that the bandwidth hints are
considered correclty for local channels, and that disable flags are
ignored in this case.
2018-12-04 12:20:45 +01:00
Johan T. Halseth 0b6a19866b routing/pathfind: pass ignore disable flags for local channels
To decouple our own path finding from the graph state, we don't consider
the disable bit when attempting to use local channels. Instead the
bandwidth hints will be zero for local inactive channels.

We alos modify the unit test to check that the disable flag is ignored
for local edges.
2018-12-04 12:20:45 +01:00
Johan T. Halseth 20b9d5d000 routing: define graphParams and restrictParams
To avoid the findPath parameter list getting out of hand, we define new
structs that wraps the mandatory and optional parameters to findPath.
2018-12-04 12:20:44 +01:00
Johan T. Halseth b07499f227 Merge pull request #2224 from halseth/itest-timeouts
lnd_test: increase test timeouts
2018-11-28 08:22:46 +01:00
Johan T. Halseth 7e48b012e2 Merge pull request #2230 from halseth/itests-tryconnect-peer
lntest/harness: retry ConnectPeer of chain backend still syncing
2018-11-28 08:21:08 +01:00
Johan T. Halseth 0011bcdad1 Merge pull request #2229 from halseth/global-defaultcsv
lnd_test: make tests use global defaultCSV
2018-11-28 08:19:58 +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
Johan T. Halseth 5c294601f0 lnwallet/channel: remove startingHeight from commitmentChain
Field is not being used.
2018-11-23 08:58:45 +01: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
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
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
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
Johan T. Halseth 881ed08709 Merge pull request #2150 from wpaulino/abandon-channel-rest
lnrpc: modify AbandonChannel REST endpoint
2018-11-12 09:02:37 +01:00
Johan T. Halseth d4b042dc19 Merge pull request #2159 from halseth/integration-tests-net-aware-db
lntest: make DBPath aware of active net
2018-11-09 12:14:55 +01:00
Johan T. Halseth 715db90435 Merge pull request #2170 from AdamISZ/fix-typos-signer
fix two comment typos in signer.go
2018-11-09 11:44:02 +01:00
Johan T. Halseth c694663d94 Merge pull request #2143 from ErikEk/improv_color_validation
Improving color validation
2018-11-09 09:58:41 +01:00
Johan T. Halseth d7cbdea9db lnd_test: add waitForChannelPendingForceClose
This commit introduces a new utility method
waitForChannelPendingForceClose, that is used to ensure a force closed
channel has been recognized by the UTXO nursery, and is ready to be
swept as soon as it matures.

The commit also utilizes this method to properly wait before mining
blocks in certain tests, as it makes sure that the UTXO nursery will
react properly to the new blocks.
2018-11-09 08:50:00 +01:00
Johan T. Halseth 1516ceb37a Merge pull request #2160 from halseth/integration-tests-mine-reorged-funding-tx
[Integration tests] mine reorged funding tx
2018-11-09 08:48:09 +01:00
Johan T. Halseth 9c3be96490 Merge pull request #2167 from joostjager/nursery-cleanup
utxonursery: clean up unused code
2018-11-09 08:44:44 +01:00
Johan T. Halseth 3df62268ea Merge pull request #2158 from halseth/integration-tests-remove-externalip
[Trivial] lntest/node: remove extraneous externalip
2018-11-09 08:44:04 +01:00
Johan T. Halseth b0c6f666f6 Merge pull request #2166 from joostjager/cnct-fixes
cnct: add todo for invalid expiry value handling
2018-11-09 08:43:43 +01:00
Johan T. Halseth a2b553cf57 Merge pull request #2157 from halseth/integration-tests-remove-log
[Integration tests] remove log disabling hack
2018-11-09 08:42:35 +01:00
Johan T. Halseth 3ff6055a62 Merge pull request #1782 from xsb/getinfo-inactive-channels
rpcserver: show inactive channels in GetInfo
2018-11-07 08:45:15 +01:00
Johan T. Halseth 1208c66a89 lnd_test: mine reorged out funding tx 2018-11-06 10:35:05 +01:00
Johan T. Halseth cba0854230 lntest: make DBPath aware of active net 2018-11-06 10:32:32 +01:00
Johan T. Halseth 5a6b796664 lntest/node: remove extraneous externalip 2018-11-06 10:29:52 +01:00
Johan T. Halseth 6d91d816a9 lnd_test: remove log disabling hack 2018-11-06 10:27:47 +01:00
Johan T. Halseth 3bb9b398e5 lnd_test: define global test timeouts
In preparation for the added propagation delay by separating the miner
and the chain backend, we increase several timeouts throughout the test,
and extract them into constants that can easily be altered.
2018-11-05 22:16:32 +01:00
Johan T. Halseth 9b6055764a lntest: define and export various test constants 2018-11-05 22:10:37 +01:00
Johan T. Halseth 08c2ee05f6 Merge pull request #2107 from vwoo/grpc-ruby-doc-macaroon
gRPC ruby doc updates
2018-10-31 08:26:56 +01:00
Johan T. Halseth 13b33d79b3 discover/gossiper test: add TestNodeAnnouncementNoChannels
This commit adds a new test TestNodeAnnouncementNoChannels that ensures
a node announcement for a unknown node is not forwarded by the gossiper.
2018-10-30 10:01:51 +01:00
Johan T. Halseth 2911944e5a discovery/gossiper test: define unknown node announcement as stal
To mimic the current behaviour of the router's IsStaleNode, we make the
mockGraphSource consider a unknown node with no channels in the graph as
stale.
2018-10-30 10:01:33 +01:00
Johan T. Halseth e8003af3cd make: ensure make fmt is run with -s flag
Linting will fail if code is not formatted with the -s flag, so make
sure we always use it when formatting.
2018-10-24 19:07:42 -07:00
Johan T. Halseth 9cba3e813a Merge pull request #1992 from halseth/listinvoices-offset
Make reversed listinvoices consistent in edge cases
2018-10-24 17:25:54 -07:00
Johan T. Halseth 0e683d895b Merge pull request #2074 from Roasbeef/chan-close-summary-fix-short-chan-remote-node
lnwallet: properly set the short chan ID for remote unilateral close …
2018-10-22 18:16:41 -07:00
Johan T. Halseth b9f3c85288 Merge pull request #2024 from bob-333/patch-1
Improve 'updating' instructions
2018-10-22 18:15:42 -07:00
Johan T. Halseth dbf9b4ea4c chainntnfs+queue: move ConcurrentQueue to own package 'queue' 2018-10-18 12:38:10 -07:00
Johan T. Halseth 29acb9f1f8 routing/chainview: new neutrino API 2018-10-16 19:28:29 -07:00
Johan T. Halseth 6db0bc4b05 chainntnfs/neutrino_debug: new neutrino API 2018-10-16 19:27:07 -07:00
Johan T. Halseth e0fd163096 chainntnfs/neutrino: new neutrino API 2018-10-16 19:26:41 -07:00
Johan T. Halseth 146875ba65 lnwallet/btcwallet: remove filter check
GetBestBlock will now return only blocks where the filter header is synced.
2018-10-16 19:24:22 -07:00
Johan T. Halseth 7ad1f9f7d7 dep: update neutrino and btcwallet deps 2018-10-16 19:24:20 -07:00
Johan T. Halseth d8863bea8c routing/chainview: demote logging of new utxos for filter to Trace
It was previously Debug, which would spam the logs at startup, and not
provide very useful (human-readable) information.
2018-10-10 15:00:50 +02:00
Johan T. Halseth b00e43eec1 Merge pull request #2028 from halseth/travis-race-env
travis: correctly set RACE=TRUE in build matrix
2018-10-10 13:22:50 +02:00
Johan T. Halseth 2c62f3e1f6 travis: correctly set RACE=TRUE in build matrix 2018-10-10 11:03:24 +02:00
Johan T. Halseth 22d0e5b43e channeldb/invoice test: add more tests for edge cases 2018-09-28 13:00:57 +02:00
Johan T. Halseth 0c51e31d1c channeldb/invoices+test: don't return invoices on reversed query at index 1
Previously a call to QueryInvoices with reversed=true and index_offset=1
would make the cursor point to the first available invoice (num 1) that
would be returned as part of the response. This is inconsistent with the
othre indexes, so we instead just return an empty list in this case.

A test case for this situation is also added.
2018-09-28 13:00:57 +02:00
Johan T. Halseth 54a608d09d htlcswitch+discovery mock: adhere to new lnpeer interface 2018-09-28 09:05:18 +02:00
Johan T. Halseth a433e70575 fundingmanager test: satisfy new interfaces 2018-09-28 09:05:01 +02:00
Johan T. Halseth b712b861f8 peer: make AddNewChannel take OpenChannel
This commit makes the AddNewChannel expect a OpenChannel instead of a
LightningChannel struct. This moves the responsibility for starting the
LightningChannel from the fundingmanager to the peer, and we can defer
the channel restoration until we know that the channel is not already
active.
2018-09-28 08:59:27 +02:00
Johan T. Halseth addb4aed89 funding+server: make FindChannel return OpenChannel instead of LightningChannel 2018-09-28 08:59:27 +02:00
Johan T. Halseth 240318befe peer: return error on newChanReq
Previously the errors weren't returned back to the sender of the new
channel, making it impossible to tell whether it suceeded or not.
2018-09-28 08:59:26 +02:00
Johan T. Halseth 835617b576 Merge pull request #1799 from tailnode/fix-markdown-issue
docs:fix markdown issues in docker/README.md
2018-09-26 10:02:08 +02:00
Johan T. Halseth 0a5f982280 utxonursery: pass broadcastHeight to registerPreschoolConf
In this commit IncubateOutputs are given an extra parameter
broadcastHeight, which is passed from the server and used when called
registerPresschoolConf.

Earlier the utxonursery used the bestHeight as height hint in this case,
which would be wrong in the cases where we got outputs for incubation
which was confirmed below the best height.
2018-09-20 13:16:39 +02:00
Johan T. Halseth 3a67fe2552 contractcourt+server: make IncubateOutputs take broadcastHeight 2018-09-20 12:54:48 +02:00
Johan T. Halseth 6d0deed885 utxonursery test: run tests in parallel 2018-09-20 12:54:48 +02:00
Johan T. Halseth 9a3e19b77f Merge pull request #1916 from guggero/crash-on-listchaintxns
rpcserver: handle unconfirmed TX properly when listing all transactions
2018-09-17 20:05:26 +02:00
Johan T. Halseth 598904fbb9 lnd_test: restart nodes twice to trigger pruning logic 2018-09-11 10:25:48 +02:00
Johan T. Halseth a926665358 lnd_test: make sure we stay disconnected using WaitInvariant in testGarbageCollectLinkNodes 2018-09-11 10:25:48 +02:00
Johan T. Halseth d742529bb2 rpcserver: set AmtPaidMsat when creating RPC invoice 2018-09-07 14:13:48 +02:00
Johan T. Halseth 90a9f5882a lnrpc: add field amt_paid_msat to Invoice 2018-09-07 14:13:48 +02:00
Johan T. Halseth baee07ef48 Merge pull request #1846 from roeierez/invoice_amt_paid
rpcserver: amount paid should be in satoshis as other fields used for amount
2018-09-05 12:58:59 +02:00