Commit Graph

6517 Commits

Author SHA1 Message Date
Wilmer Paulino
70d3fc640a channeldb/db: prevent filtering channels with unconfirmed close txs
In this commit, we address an issue with the FetchWaitingCloseChannels
method where it would not properly return channels that are unconfirmed
and also have an unconfirmed closing transaction because they were
filtered out. We fix this by fetching channels that remain unconfirmed
that are also waiting for a confirmed closing transaction.

This will allow the recently added test TestFetchWaitingCloseChannels to
pass.
2019-01-03 20:48:28 -05:00
Wilmer Paulino
409efd1361 channeldb/channel_test: add TestFetchWaitingCloseChannels
In this commit, we add a test case for FetchWaitingCloseChannels to
ensure it behaves as intended. Currently, this test fails due to not
fetching channels which are pending to be closed but are also pending to
be opened. This will be fixed in the following commit and should allow
the test to pass.
2019-01-03 20:48:28 -05:00
Wilmer Paulino
f6c02aec20 channeldb/channel_test: use random outpoint when creating new test channels
In this commit, we use random outpoints when creating new test channels
to ensure we can uniquely identify them.
2019-01-03 20:33:33 -05:00
Joost Jager
6c027e2bc9 htlcswitch: remove lnrpc dependency
This commits removes an unwanted dependency that prevents
moving parts of rpcserver to a sub server.
2019-01-03 09:07:56 +01:00
Joost Jager
237f2b6d4b lnrpc: remove ConfirmationUpdate message from close status updates 2019-01-03 09:06:52 +01:00
Olaoluwa Osuntokun
d8a991ee68
docs/INSTALL.md: pin brew install against go 1.11 2019-01-02 15:14:46 -08:00
Olaoluwa Osuntokun
11dac33c6f
docs/INSTALL.md: update Go installation options for Linux
In this commit, we modify the Linux installation instructions to use the
pre-built archives rather than install from the ppa. We do this as
typically the ppa lags behind the latest releases, and also by
downloading it in this new manner, we're able to verify the sha256 sum
of the installed Go release.
2019-01-02 15:11:19 -08:00
Olaoluwa Osuntokun
23df03566c
build: fix release script to include commit hash
In this commit we update the release script to properly include the
commit hash in compiled binaries of lnd and lncli. In the future, we
should ditch the release script and extend the Makefile to support this
use case.

Fixes #2389.
2019-01-02 12:01:00 -08:00
Olaoluwa Osuntokun
f7fb9486b4
build: tidy go modules 2019-01-02 11:21:22 -08:00
John
6e2762ba8c build: update ltcd import
The main ltcd repo has been force pushed, which removed the commit that we pinned against prior. In this commit, we update to the latest version of ltcd.
2019-01-02 11:15:34 -08:00
Olaoluwa Osuntokun
089d461552
Merge pull request #2378 from vwoo/grpc_max_receive_message_length_ruby_doc
Show in gRPC Ruby doc how to avoid GRPC::ResourceExhausted exceptions
2018-12-28 15:13:11 -06:00
Olaoluwa Osuntokun
c0087e8be5
Merge pull request #2374 from Roasbeef/increase-lightning-block-size
cmd/lncli: increase lightning gRPC block size to 50MB
2018-12-28 15:12:04 -06:00
Vincent Woo
5f1d859c0a Show in gRPC Ruby doc how to avoid GRPC::ResourceExhausted exceptions
Otherwise mainnet DescribeGraph calls will fail
2018-12-26 14:02:29 -08:00
Olaoluwa Osuntokun
0453078213
cmd/lncli: increase lightning gRPC block size to 50MB
In this commit, we increase the gRPC block size from 4MB to 50MB.
Recently, the output of `lncli describegraph` has hit the block size cap
due to the expansion of the mainnet graph. Without this attempts to
fetch the graph returns an error of:
```
[lncli] rpc error: code = ResourceExhausted desc = grpc: received message larger than max (4246753 vs. 4194304)
```

With this commit, we give ourselves some breathing room. It's important
to note that the max message size limit is a _client side_ setting. As a
result, any developers driving `lnd` with gRPC will also need to raise
their block size limit as well if they wish to fetch the graph over
gRPC.
2018-12-25 13:23:14 -06:00
Olaoluwa Osuntokun
4226232881
lnwire: export ReadElements and WriteElements
In this commit, we export the ReadElements and WriteElements functions.
We do this as exporting these functions makes it possible for outside
packages to define serializations which use the BOLT 1.0 wire format.
2018-12-24 19:58:06 -06:00
Olaoluwa Osuntokun
e6623f98b3
Merge pull request #2359 from joostjager/nursery-bound-var
utxonursery: fix bound variable bug
2018-12-21 14:39:40 -06:00
Joost Jager
4a58ec5b15
utxonursery: fix bound variable bug
A pointer to the loop variable was passed to the waitForSweepConf
goroutine, causing the wrong output to be graduated from
kindergarten.
2018-12-21 09:29:26 +01:00
Olaoluwa Osuntokun
bd0177ddc5
Merge pull request #2325 from federicobond/remove-unused-rootkey
Remove unused LightningWallet.rootKey field
2018-12-20 17:16:16 -08:00
Johan T. Halseth
c9868aae8f
htlcswitch test: add fwdinglog inspection on triggered FwdEventTicker 2018-12-20 08:57:22 +01:00
Olaoluwa Osuntokun
52f1a255d3
Merge pull request #2349 from halseth/autopilot-pilot-error-reset
autopilot/manager: only set m.pilot if started successfully
2018-12-19 17:31:23 -08:00
Olaoluwa Osuntokun
b5c3a37c05
Merge pull request #2347 from joostjager/sweeper-mock
utxonursery: mock sweeper in tests
2018-12-19 17:29:35 -08:00
Olaoluwa Osuntokun
9c0e0f445a
Merge pull request #2323 from Roasbeef/update-contribution-guidelines
Update contribution guidelines
2018-12-19 17:28:24 -08:00
Olaoluwa Osuntokun
af306e2360
docs: expand contributor checklist w/ commit structure 2018-12-19 17:02:25 -08:00
Olaoluwa Osuntokun
b72b38e128
Merge pull request #2315 from joostjager/fix-genprotos
lnrpc: remove reference to GOPATH
2018-12-19 15:16:39 -08:00
Johan T. Halseth
dbf7b380a9
autopilot/manager: only set m.pilot if started successfully
This commit fixes a subtle bug within the autopilot manager, that would
cause the active pilot to not be reset in case it wasn't started
successfully.

We also make sure the associated goroutines close over the started
pilot, and not the active pilot.
2018-12-19 19:48:44 +01:00
Joost Jager
347d1545de
utxonursery: use mocked sweeper in tests
This commit fixes a test flake caused by a race condition. Using the
real sweeper in the nursery test created too complex concurrent
behaviour to reliably assert on and made the tests difficult to
comprehend.
2018-12-19 14:14:53 +01:00
Joost Jager
e29b0f8894
utxonursery: add mock sweeper
This commit adds a simple mock of the sweeper to be able to test
dependents of sweeper in isolation.
2018-12-19 14:09:30 +01:00
Joost Jager
74e9852e3d
utxonursery: configure using SweepInput function
As a preparation for mocking sweeper, this commit modifies the
utxonursery config to take a function pointer instead of the full
sweeper struct.
2018-12-19 12:49:19 +01:00
Johan T. Halseth
902d6edad2
autopilot/choice: add weightedChoice tests 2018-12-19 08:27:35 +01:00
Johan T. Halseth
4ac3c171ec
autopilot/choice: avoid costly map allocations
This commit makes the weightedChoice algorithm take a slice of weights
instead of a map of node scores. This let us avoid costly map allocation
and iteration.

In addition we make the chooseN algorithm keep track of the remaining
nodes by keeping a slice of weights through its entire run, similarly
avoiding costly map allocation and iteration.

In total this brings the runtime of the TestChooseNSample testcase down
from ~73s to ~3.6s.
2018-12-19 08:27:34 +01:00
Johan T. Halseth
3d2a39a18c
autopilot/choice_test: add chooseN tests 2018-12-19 08:27:34 +01:00
Johan T. Halseth
a202860ce1
autopilot: make n uint32 in chooseN
To avoid negative values being input, as it doesn't really make sense.
2018-12-19 08:27:34 +01:00
Olaoluwa Osuntokun
49da4a60aa
docs: update contribution guidelines with new merge commit policy 2018-12-18 20:59:58 -08:00
Olaoluwa Osuntokun
a76affae91
docs: replace golint with make lint in contributor guidelines 2018-12-18 20:59:56 -08:00
Olaoluwa Osuntokun
0d5eef4f30
docs: in contributor guidelines, use make check not go test 2018-12-18 20:59:54 -08:00
Olaoluwa Osuntokun
ce39910f96
docs: add section in contribution guidelines describing fixup commits 2018-12-18 20:59:53 -08:00
Olaoluwa Osuntokun
d1571badaf
docs: add section in contribution guidelines for unique lnd code style 2018-12-18 20:59:52 -08:00
Olaoluwa Osuntokun
0dc9b35a1a
docs: add section in testing pointing towards Makefile docs 2018-12-18 20:59:51 -08:00
Olaoluwa Osuntokun
516a48741f docs: update contribution guidelines to add section on commit structure 2018-12-18 20:59:46 -08:00
Olaoluwa Osuntokun
2f17030e8c
Merge pull request #1960 from joostjager/sweeper
sweep: create sweeper
2018-12-18 18:26:35 -08:00
Olaoluwa Osuntokun
6ddb632f82
Merge pull request #2338 from Roasbeef/pr-template
github: add PR contribution checklist
2018-12-18 11:49:45 -08:00
Joost Jager
78aaf8639b
lnrpc: remove reference to GOPATH
As go modules allow us to build outside of the GOPATH, we shouldn't look for .proto imports there anymore.
2018-12-18 14:57:26 +01:00
Joost Jager
9e611636ee
lnrpc: update github.com/golang/protobuf to v1.2.0
Update is necessary to get protoc to generate files in the right
directory when using modules outside the gopath. The old version of this
dependency did not support paths=source_relative.

This commit also fixes a build error in lnd_test.go because of a
slight difference in generated code.
2018-12-18 14:57:24 +01:00
Joost Jager
6ca52c4ec7
lnrpc/walletrpc: remove unused gen_proto.sh script 2018-12-18 14:56:52 +01:00
Joost Jager
687d4e7725
cnct: add todo comment for sweeper 2018-12-18 10:50:22 +01:00
Joost Jager
6389a97708
utxonursery: connect to time-based sweeper
Previously, nursery generated and published its own sweep txes. It
stored the sweep tx in nursery_store to prevent a new tx with a new
sweep address from being generated on restart.

In this commit, sweep generation and publication is removed from nursery
and delegated to the sweeper. Also the confirmation notification is
received from the sweeper.
2018-12-18 10:50:20 +01:00
Joost Jager
eec2efdd6b
sweep: add sweeper test 2018-12-18 10:50:19 +01:00
Joost Jager
01e64afd56
sweep: add time-based sweeper
In this commit, the sweep package is extended from just tx generation to
an active sweeper that collects sweep inputs and autonomously proceeds
to publish the sweep tx after the batch window time interval has passed
without new inputs being added.
2018-12-18 10:50:17 +01:00
Joost Jager
1f0656559e
sweep: add sweeper store
This commit adds a store for the sweeper. The sweeper needs minimal
persistent data to be able to recognize its own sweeps.
2018-12-18 10:50:16 +01:00
Joost Jager
a2dcca2b08
sweep: add input partitionings generator
This commit adds a function that takes a set of inputs and splits them
in sensible sets to be used for generating transactions.
2018-12-18 10:50:14 +01:00