Commit Graph

6586 Commits

Author SHA1 Message Date
Joost Jager
d151916ae1
lnrpc: deprecate invoice receipt field 2019-01-07 22:05:52 +01:00
Olaoluwa Osuntokun
a49e39de75
peer: don't d/c on invalid node alias 2019-01-07 12:53:45 -08:00
Olaoluwa Osuntokun
1821773e39
lnwire: add test cases for node alias validation 2019-01-07 12:53:40 -08:00
Olaoluwa Osuntokun
0b10f4c4d8 lnwire: when reading node aliases, properly check validity
In this commit, we ensure that when we read node aliases from the wire,
we ensure that they're valid. Before this commit, we would read the raw
bytes without checking for validity which could result in us writing in
invalid node alias to disk. We've fixed this, and also updated the
quickcheck tests to generate valid strings.
2019-01-07 12:53:10 -08:00
Alex Bosworth
a78e13929e
lnwallet: fix trivial comment typo 2019-01-06 11:39:12 -08:00
Olaoluwa Osuntokun
3c950e8f0d
Merge pull request #2368 from Roasbeef/static-chan-backups-keychain
keychain: extend DerivePrivKey to derive based on pubkey+KeyFamily
2019-01-04 18:01:47 -08:00
Olaoluwa Osuntokun
2e2d5fcf54
Merge pull request #2354 from joostjager/invoice-state
channeldb+lnrpc: invoice state
2019-01-04 14:48:17 -08:00
Olaoluwa Osuntokun
6787ba2653
Merge pull request #2248 from wpaulino/fetch-waiting-close-channels
channeldb/db: prevent filtering channels with unconfirmed close txs
2019-01-04 14:45:05 -08:00
Olaoluwa Osuntokun
6589f686ad
Merge pull request #2400 from Roasbeef/fix-release-script
build: fix release script to include commit hash
2019-01-04 14:42:54 -08:00
Olaoluwa Osuntokun
e86babe133
keychain: extend DerivePrivKey to derive based on pubkey+KeyFamily
In this commit, we extend the DerivePrivKey method to allow callers that
don't know the full KeyLocator information to attempt to derive a
private key via a brute force mechanism. If we don't now the full
KeyLoactor, then given the KeyFamily, we can walk down the derivation
path and compare keys one by one. In order to ensure we don' t enter an
infinite loop when given an unknown public key, we cap the number of
keys derived at 100k.

An upcoming feature to lnd that adds static channel backups will utilize
this feature, as we need to derive the shachain root given only the
public key and key family, as we don't currently store this KeyLocator
on disk.
2019-01-04 14:41:41 -08:00
Olaoluwa Osuntokun
0f43cdfc74
Merge pull request #2414 from webworker01/patch-1
Fix TOC link
2019-01-04 14:23:57 -08:00
Conner Fromknecht
3a2bd124ae
rpcserver: add connectpeer log, fix existing formatting 2019-01-04 14:07:43 -08:00
Conner Fromknecht
d3b5326ae7
server: use cfg.MinBackoff instead of defaultBackoff 2019-01-04 14:05:29 -08:00
Conner Fromknecht
aa75680dcf
config: add minbackoff to mirror maxbackoff 2019-01-04 14:05:28 -08:00
Web Worker
697217630e
Fix TOC link 2019-01-04 12:37:52 -05:00
Joost Jager
1199f17cd9
lnrpc: report invoice state
Expose the new invoice state field over rpc.
2019-01-04 07:54:14 +01:00
Joost Jager
5515713b88
channeldb: convert settled boolean to state
This commit is a preparation for the addition of new invoice
states. A database migration is not needed because we keep
the same field length and values.
2019-01-04 07:53:55 +01:00
Olaoluwa Osuntokun
552a9b7190
Merge pull request #2357 from joostjager/remove-lnrpc-dep
htlcswitch: remove lnrpc dependency
2019-01-03 19:32:49 -08:00
Olaoluwa Osuntokun
2103ebba95
Merge pull request #2369 from Roasbeef/static-chan-backups-lnwire
lnwire: export ReadElements and WriteElements
2019-01-03 18:26:54 -08:00
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