Commit Graph

697 Commits

Author SHA1 Message Date
yyforyongyu
72548ea463
server: start htlcSwitch before chainArb 2022-02-11 21:17:03 +08:00
Oliver Gugger
895a2e497b
multi: formatting and comment fixes 2022-02-10 11:02:02 +01:00
Oliver Gugger
b77c1fb200
Merge pull request #6149 from bhandras/graph_import_rpc
lnd: add `devrpc` sub server and `devrpc.ImportGraph` to import graph dumps
2022-01-28 10:24:59 +01:00
eugene
ebaffb953a server+contractcourt: hand-off BreachCloseInfo to channel arbitrator
This also changes the chain_watcher and breacharbiter handoff. The
new logic ensures that the channel is only marked as pending closed
when the channel arbitrator has persisted the resolutions and commit
set.
2022-01-25 15:42:20 -05:00
eugene
f99933fa69 server+contractcourt: add breachResolver that subscribes to breacharbiter
Introduces a breachResolver that subscribes to the breacharbiter to
determine if the final justice transaction has confirmed and can
clean itself up.
2022-01-25 15:42:20 -05:00
Andras Banki-Horvath
825422a82a
lncfg: move ParseHexColor to lncfg 2022-01-24 17:42:54 +01:00
Dimitris Apostolou
530a2059e5
multi: Fix typos [skip ci] 2022-01-24 12:19:02 +02:00
carla
0ae38457de
server: disable chain health check if we're running without backend
There is no chain backend to check, so this check will always fail.
This commit disables it when we're running without a backend.
2022-01-20 14:21:36 +02:00
Olaoluwa Osuntokun
3481286ea0
lnwire+peer: clamp pong bytes, make ping handler more effcieint
This was not properly enforced and would be a spec violation on the
peer's end. Also re-use a pong buffer to save on heap allocations if
there are a lot of peers. The pong buffer is only read from, so this
is concurrent safe.
2022-01-13 15:01:18 -08:00
Oliver Gugger
da59c1fa62
multi: add health check for remote signer 2022-01-06 14:35:25 +01:00
yyforyongyu
85b626e6a7
server: fix peers not ignored during bootstrapping
This commit fixes the issue where duplicate peers are used both in
making persistent connections and bootstrap connections. When we init
bootstrapping, we need to ignore peers that have connections already
made so far plus peers which we are attempting to make connections with,
hence the persistent peers.
2021-12-23 15:14:37 +08:00
yyforyongyu
46050fc631
multi: enhance logging for debugging peer connection 2021-12-23 15:14:37 +08:00
Olaoluwa Osuntokun
55d983dee7
server: defer ticker stop to avoid goroutine leak 2021-11-04 17:53:36 -07:00
Elle Mouton
6ec9c3c58f
server: stagger multi addr connection attempts
In this commit, we stagger the connection attempts to the multiple
addresses of a peer.
2021-11-04 13:27:33 +02:00
Elle Mouton
b9b7ea2a6a
server: use one func for peer re-connection
Let the connectToPersistentPeer func handle all connection attempts to
persistent peers so that that logic is in once place.
2021-11-04 13:08:50 +02:00
Elle Mouton
789f00746b
server: cleanup persistentPeerAddr when pruned
Delete all the stored addresses from the persistentPeerAddr map when we
prune the persistent peer.
2021-11-04 13:05:40 +02:00
Oliver Gugger
0a2ccfc52b
multi: use single read transaction for path finding
This commit partially reverts bf27d05a.
To avoid creating multiple database transactions during a single path
finding operation, we create an explicit transaction when the cached
graph is instantiated.
We cache the source node to avoid needing to look that up for every path
finding session.
The database transaction will be nil in case of the in-memory graph.
2021-10-22 09:32:49 +02:00
Wilmer Paulino
6052a446dc
lnwire+feature: add feature bit for script enforced lease support 2021-10-19 18:30:14 -07:00
carla
45de686d35
multi: move bandwidth hints behind interface 2021-10-19 09:50:49 +02:00
Joost Jager
ade50d0b2c
lnrpc: receive custom message 2021-10-15 17:08:55 +02:00
Joost Jager
ae959b16ae
lnrpc: send custom message 2021-10-15 17:08:53 +02:00
yyforyongyu
f41f5c7fa6
multi: add tor connection healthcheck
This commit adds a new health check, tor connection, to our liveness
monitor. A monitor refactor is applied to the server creation such that
the scope of health check creation is managed within one function.
2021-10-11 13:11:55 +08:00
Olaoluwa Osuntokun
64211da40d
Merge pull request #5839 from ellemouton/noDuplicateConnsForDupAddrs
server: use deduped addrMap for connReq creation
2021-10-08 17:01:45 -07:00
Elle Mouton
84f6b70773
server: use deduped addrMap for connReq creation
Use the addrMap for connReq creation to prevent creating duplicate
connection requests if persistentPeerAddrs contains duplicate addresses.
2021-10-08 13:18:59 +02:00
Oliver Gugger
f6d7e70f51
multi: extract database initialization 2021-10-08 12:08:25 +02:00
Oliver Gugger
e79d59dd4c
multi: use key locator for lnwallet.MessageSigner
To simplify the message signing API even further, we refactor the
lnwallet.MessageSigner interface to use a key locator instead of the
public key to identify which key should be signed with.
2021-10-08 12:06:52 +02:00
Oliver Gugger
afa03f22cc
multi: use key locator only for signing messages
To simplify the API surface of a remote signer even more, we refactor
the SignMessage and SignMessageCompact calls to only accept a key
locator as we always know what key we're using for signing anyway.
2021-10-08 12:06:52 +02:00
Oliver Gugger
8b7c88537c
multi: refactor SignDigestCompact into SignMessageCompact
To make it possible to use a remote lnrpc server as a signer for our
wallet, we need to change our main interface to sign the message instead
of the message's digest. Otherwise we'd need to alter the
lnrpc.SignMessage RPC to accept a digest instead of only the message
which has security implications.
2021-10-08 12:06:52 +02:00
Elle Mouton
e68b1daf00
server: print pubkey in hex in log [skip ci]
Fix log statement that prints out peer pubkey.
2021-10-07 13:02:10 +02:00
Elle Mouton
da64a24ad8
server: update persistent peer addrs from announcements
In this commit, a subscription is made to topology updates. For any
NodeAnnouncements received for our peristent peers, we store their newly
advertised addresses. If at the time of receiving these new addresses
there are any existing connection requests, these are updated to reflect
the newly advertised addresses.
2021-10-04 14:57:50 +02:00
Elle Mouton
d639a4d73f
server+lntest: use all addrs during reconnect
In this commit, all advertised addresses of a peer are used during
reconnection. This fixes a bug previously demonstrated in an itest.
2021-10-04 14:57:50 +02:00
Elle Mouton
169316eba2
server: fetch addr from db if outbound too
This commit just ensures that we fetch the lastest advertised addresses
for a peer from the db for both inbound and outbound peers. The reason
for seperating this into its own commit is to make future commits in
this PR easier to review.
2021-10-04 14:57:49 +02:00
Elle Mouton
004ce640d0
server: exit early if not persistent peer
The point of this commit is to make future commits in the same PR easier
to review. All that this commit does is exit early if the peer we are
considering is not persistent instead of having a bunch of logic
indented in an if-clause.
2021-10-04 14:57:49 +02:00
Oliver Gugger
692ea25295
Merge pull request #5642 from guggero/in-memory-graph
In-memory graph cache for faster pathfinding
2021-10-04 11:20:23 +02:00
eugene
702b3a3258
multi: introduce config-level DustThreshold for defining threshold 2021-09-30 13:44:35 -04:00
Oliver Gugger
bf27d05aa8
routing+server: use cached graph interface 2021-09-29 17:00:05 +02:00
Oliver Gugger
15d3f62d5e
multi: use cache for source channels 2021-09-29 17:00:04 +02:00
Oliver Gugger
d6fa912188
multi: further decouple graph
To further separate the channel graph from the channel state, we
refactor the AddrsForNode method to use the graphs's public methods
instead of directly accessing any buckets. This makes sure that we can
have the channel state cached with just its buckets while not using a
kvdb level cache for the graph.
At the same time we refactor the graph's test to also be less dependent
upon the channel state DB.
2021-09-29 17:00:03 +02:00
Andras Banki-Horvath
11cf4216e4
multi: move all channelstate operations to ChannelStateDB 2021-09-29 17:00:03 +02:00
Oliver Gugger
ddea833d31
multi: extract address source into interface
As a preparation to have the method for querying the addresses of a node
separate from the channel state, we extract that method out into its own
interface.
2021-09-29 17:00:03 +02:00
Andras Banki-Horvath
60cccf8409
multi: carve out LinkNodeDB from channeldb.DB for cleaner separation 2021-09-29 17:00:02 +02:00
Olaoluwa Osuntokun
7bde1662e2
multi: move breach arbiter and utxo nursery into contractcourt package
In this commit, we take an initial step towards converting the existing
breach arbiter and utxo nursery logic into contract resolvers by moving
the files as is, into the `contractcourt` pacakge.

This commit is primarily move only, though we had to massage some
interfaces and config names along the way to make things compile and the
tests run properly.
2021-09-27 19:10:31 -07:00
Olaoluwa Osuntokun
854d8bcd39
Merge pull request #5722 from xanoni/dedupe-pubkey-log-output
server.go: dedupe pubkey output in debug/log msgs
2021-09-17 16:28:15 -07:00
yyforyongyu
e0e1bfb935
lnd: change start/stop order of subsystems
This commit adds the part of the changes made in this PR:
https://github.com/lightningnetwork/lnd/pull/1783. The origin PR is
quite outdated, instead of rebasing it the relevant changes are taken
out and put into this commit.
2021-09-17 07:50:44 +08:00
xanoni
a17d161e0c server.go: dedupe pubkey output in debug/log msgs
Default human readable format of NetAddress already contains pubkey:
a329c80612/channeldb/migration/lnwire21/netaddress.go (L38-L47)
2021-09-16 04:25:44 -04:00
Turtle
147c7dc94c
router: fix 'out of order block error' by retrieving missing blocks in router
Fixes an issue where an out of order block error occurs in the router. When this occurs, the change uses the chain notifier to catch up on missed blocks and uses those blocks to fully update the routing graph with closed channels. Fixes #4710, #5132
2021-09-13 21:15:49 -04:00
Oliver Gugger
7e68cae8bd
server+contractcourt: signal channel fully resolved
We might want to react to a channel being fully resolved after being
involved in a force close. For this we add a new callback and invoke it
where appropriate.
2021-08-09 13:55:31 +02:00
Olaoluwa Osuntokun
673acd781d server: extract bootstrap logic into new function w/ unit test 2021-08-04 18:30:20 -07:00
Olaoluwa Osuntokun
6b1696c4f2 server: disable DNS boostrap for SigNet nodes
In this commit, we fix a bug that would cause nodes attempting to run
using the signet chain, to waste CPU as they attempted to boostrap to a
non-existent DNS seed. We fix this by ignoring the DNS boostrapper is
signet is active. Along the way, we refactor the conditional sightly to
be more readable, and easily extensible.
2021-08-04 18:30:20 -07:00
Oliver Gugger
75531455da
multi: make watchtower client/server DBs remote compatible
The final database that needs to be made remote compatible is the
watchtower server and client database.
They are handled a bit differently because both of them are not always
active, only when specifically turned on in the config.
2021-08-04 14:55:53 +02:00