Commit Graph

10771 Commits

Author SHA1 Message Date
Wilmer Paulino
62d716d3c3
chainregistry: properly close neutrino database upon errors 2019-07-15 13:42:01 -07:00
Wilmer Paulino
e147445c08
lnd: prevent panic on nil neutrino cleanup
A cleanup closure is not included when an error is returned, causing the
defer to execute and triggering the following panic:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x105da38]

goroutine 1 [running]:
github.com/lightningnetwork/lnd.Main(0x2083e40, 0xc0004f6db0)
	/home/user/lnd/lnd.go:208 +0x2bfa
main.main()
	/home/user/lnd/cmd/lnd/main.go:14 +0x26
2019-07-15 13:32:37 -07:00
Joost Jager
8055bcf2e0
routing: report failures to mission control directly
As there is no more state kept in the payment session, failure reporting
can go straight to mission control.
2019-07-13 22:38:25 +02:00
Joost Jager
dc13da5abb
routing: move second chance logic into mission control
If nodes return a channel policy related failure, they may get a second
chance. Our graph may not be up to date. Previously this logic was
contained in the payment session.

This commit moves that into global mission control and thereby removes
the last mission control state that was kept on the payment level.

Because mission control is not aware of the relation between payment
attempts and payments, the second chance logic is no longer based
tracking second chances given per payment.

Instead a time based approach is used. If a node reports a policy
failure that prevents forwarding to its peer, it will get a second
chance. But it will get it only if the previous second chance was
long enough ago.

Also those second chances are no longer dependent on whether an
associated channel update is valid. It will get the second chance
regardless, to prevent creating a dependency between mission control and
the graph. This would interfer with (future) replay of history, because
the graph may not be the same anymore at that point.
2019-07-13 22:38:23 +02:00
Joost Jager
d31efddf1b
routing: move generateBandwidthHints 2019-07-13 22:38:21 +02:00
Joost Jager
37e2751695
routing+routerrpc: isolate payment session source from mission control 2019-07-13 22:38:19 +02:00
Joost Jager
cf3dd3fb94
routing/test: create mission control test context 2019-07-13 22:38:17 +02:00
Olaoluwa Osuntokun
616750184e
Merge pull request #2926 from Crypt-iQ/visited_nodes_0410
routing: tracking visited nodes in findPath
2019-07-12 17:29:11 -07:00
Conner Fromknecht
0c8ff3021c
Merge pull request #2682 from valentinewallace/fix-subscribe-chans-flake
lnd_test: fix channel event subscription test flake.
2019-07-12 16:08:18 -07:00
Valentine Wallace
21c685d530
lnd_test: fix channel event subscription test flake.
This flake was caused by the rpcserver receiving a CloseChannel request
before Alice's channel event subscription request, causing Alice to miss one
notification. As a result, we move Alice's subscription to the beginning of the
test.

Additionally, we add a check to ensure the opening notifications are
received in the right order.
2019-07-12 14:47:28 -07:00
Brett Cawley
9d213948ba docs/grpc: add C# docs 2019-07-12 13:23:31 -07:00
Johan T. Halseth
f069276970
Merge pull request #3306 from ottosuess/patch-4
invoicesrpc: fix route hint off-by-one-error
2019-07-12 12:28:15 +02:00
Johan T. Halseth
e593c5e16f
Merge pull request #3284 from wpaulino/bitcoind-zmq-unnecessary-timeouts
build: update dependencies to prevent unnecessary bitcoind ZMQ timeouts
2019-07-12 12:26:55 +02:00
nsa
7e6a34532e routing: add index map to distanceHeap
This commit adds the pubkeyIndices map to the distanceHeap to avoid
duplicate entries on the heap. This happened in the earlier iteration
of the findPath algorithm and would cause the driving loop to
evaluate already evaluated entries when there was no need.
2019-07-12 06:08:01 -04:00
nsa
61a1ab08fb routing+channeldb: findPath uses Vertex instead of LightningNode
This commit modifies the nodeWithDist struct to use a route.Vertex
instead of a *channeldb.LightningNode. This change, coupled with
the new ForEachNodeChannel function, allows the findPath Djikstra's
algorithm to cut down on database lookups since we no longer need
to call the FetchOtherNode function.
2019-07-12 06:08:01 -04:00
Wilmer Paulino
4faed1deff
build: update btcwallet and zmq dependencies
* We address an issue where we would unnecessarily time out bitcoind ZMQ
  connections if there are no messages to be read. This would cause
  connections to be torn down, which would then trigger the reconnection
  logic and prevent us from detecting this issue.

* A new sanity check within the wallet is done to prevent adding
  unconfirmed transactions that the wallet has already recognized as
  confirmed.
2019-07-12 02:40:16 -07:00
Otto Suess
c843835a05
invoicesrpc: fix route hint off-by-one-error
right now it is possible to add 21 route hints which results in an error.
2019-07-12 08:51:30 +02:00
Conner Fromknecht
0193034f4f
Merge pull request #2957 from halseth/taketa-goroutine-snapshot
[lnd test] write goroutine snapshot on integration test failure
2019-07-11 16:11:51 -07:00
Wilmer Paulino
5c11dd44d7
Merge pull request #3297 from orbitalturtle/makefile-case-clarification
MAKEFILE: Clarify what the testcase argument is
2019-07-11 14:40:29 -07:00
Conner Fromknecht
a4f4ff0f83
Merge pull request #3188 from joostjager/error-source-idx
htlcswitch+routing+routerrpc: error source as index and expose decrypt failure
2019-07-11 13:27:14 -07:00
Conner Fromknecht
2e0af923f3
Merge pull request #2366 from ccdle12/routing-policy-timestamps
lnrpc+rpcserver: Adding timestamps to RoutingPolicy
2019-07-11 12:10:03 -07:00
Joost Jager
2726f50d7c
htlcswitch: do not consider unknown failures an error 2019-07-11 19:49:49 +02:00
Joost Jager
c6f9517e48
lnwire+htlcswitch: only use references for failure messages
Methods on failure message types used to be defined on value receivers.
This allowed assignment of a failure message to ForwardingError both as
a value and as a pointer. This is error-prone, especially when using a
type switch.

In this commit the failure message methods are changed so that they
target pointer receivers.

Two instances where a value was assigned instead of a reference are
fixed.
2019-07-11 19:49:47 +02:00
Joost Jager
418fe364de
htlcswitch: use distinct error for unreadable failures 2019-07-11 19:49:45 +02:00
Johan T. Halseth
0820b07c19
make: add -goroutinedump, rm pprof*.log to itest 2019-07-11 14:47:02 +02:00
Johan T. Halseth
8b64b14627
gitignore: add pprof files to gitignore 2019-07-11 14:44:50 +02:00
Johan T. Halseth
195a868455
lntest: add flag -goroutinedump 2019-07-11 14:44:44 +02:00
Johan T. Halseth
8d5430dae3
lnd_test: add lndHarness to harnessTest, dump goroutines on Fatalf
Co-authored-by: taketa <853211b@gmail.com>
2019-07-11 14:41:41 +02:00
Johan T. Halseth
314ba7db03
lntest/harness: add method SaveProfilesPages
SaveProfilesPages will write the active goroutines to files
pprof-n-*.log.

Co-authored-by: taketa <853211b@gmail.com>
2019-07-11 14:41:40 +02:00
Johan T. Halseth
6028722d71
lntest/node: make ProfilePort part of node config 2019-07-11 14:36:59 +02:00
Joost Jager
0cdae56d28
htlcswitch+routing: make error decryption mockable 2019-07-11 10:37:28 +02:00
Joost Jager
2b47632b26
htlcswitch+routing+routerrpc: return error source as index 2019-07-11 10:37:26 +02:00
Joost Jager
55bef96cf3
htlcswitch/test: stricter error check in TestSwitchSendPayment 2019-07-11 10:37:24 +02:00
Joost Jager
569f821142
routing/test: allow arbitrary graph source nodes 2019-07-11 10:37:22 +02:00
ccdle12
a93d63f04b
lnrpc+rpcserver: Adding last_update timestamp to RoutingPolicy
lnrpc/rpc.proto: updates RoutingPolicy last_update number

rpcserver: adding LastUpdate field to marshalDbEdge

This commit adds a LastUpdate field to each RoutingPolicy, it will show
the time each RoutingPolicy was updated.

lnrpc: regenerating proto files
2019-07-11 07:44:28 +01:00
Turtle
47609a511e MAKEFILE: Clarify what the testcase argument is 2019-07-11 00:37:30 -04:00
Turtle
f958555ce3 Lnd + server_test: Add unit test for TLS cert autoregeneration 2019-07-11 00:10:55 -04:00
Turtle
24ca95ab10 lnd_test: remove TLSAutoRegeneration test 2019-07-11 00:08:24 -04:00
Wilmer Paulino
93aad89f4c
Merge pull request #3296 from exfrog/patch-1
Update recovery.md (typo)
2019-07-10 20:52:16 -07:00
Wilmer Paulino
f9816330c5
Merge pull request #3238 from breez/chan_reserve_fields
rpc: add channel reserve fields in RPC responses.
2019-07-10 16:30:33 -07:00
exfrog
f98b737cfe
Update recovery.md
minor typo on line 286, said 'implement' twice
2019-07-10 16:04:55 -07:00
Roei Erez
404abcbd04 rpc: add channel reserve fields in RPC responses.
In this commit two fields were added to the Channl RPC result in both
open and pending states.
The fields: local_chan_reserve, remote_chan_reserve represents the
reservation the nodes are rquired to keep in both sides of the channel.
This is usefull when calculating the "real" inbound and outbound
liquidity in an accurate way.
2019-07-11 00:03:20 +03:00
Olaoluwa Osuntokun
d1d6c310e6
Merge pull request #3294 from wpaulino/use-bsaes-mirror
build: use github mirror of bsaes dependency
2019-07-10 13:39:23 -07:00
Wilmer Paulino
d67d3e6258
Merge pull request #3295 from Roasbeef/remove-catch-all-code-owners
CODEOWNERS: remove top level catch all
2019-07-10 13:15:53 -07:00
Olaoluwa Osuntokun
a3d5a708bb CODEOWNERS: remove top level catch all 2019-07-10 12:15:38 -07:00
Wilmer Paulino
03cf9a53e4
Merge pull request #3293 from halseth/bumpfee-doc
[trivial] lnrpc: make BumpFee doc start with RPC name
2019-07-10 12:02:41 -07:00
Wilmer Paulino
383dd8111b
build: use github mirror of bsaes dependency
This allows us to not depend on external hosts for third-party
dependencies other than the standard hosts: github.com,
google.golang.org, and gopkg.in.
2019-07-10 11:52:57 -07:00
Johan T. Halseth
7a5247b766
Merge pull request #3245 from breez/non_static_permissions
rpc: fix calculating RPC permissions.
2019-07-10 13:33:54 +02:00
Johan T. Halseth
f0cbe46324
lnrpc: make BumpFee doc start with RPC name 2019-07-10 12:56:54 +02:00
Roei Erez
46489050ef rpc: make RPC permissions non static.
This commit fixes a but where restarting LND at the same process causes
It to fail.
The problem resides in the fact that an array of permissions is
initialized as a package variable and when creating the
RPCServer all subserver permissions are appended while checking for
duplicates.
On subsequent restart this array is left over from the previous run and
being populated again with the same permissions causing a duplicate
error.
The solution is simple, just to extract out the initial permissions to
a separate function and call it from the context is is needed.
2019-07-10 13:10:24 +03:00