Commit Graph

52 Commits

Author SHA1 Message Date
yyforyongyu
6618ab493a
multi: enhance loggings and fix logging format
Also adds TODO for a possible bug.
2023-02-23 21:56:08 +08:00
bitromortac
6aac2762b3
routing: stricter maxHTLC checks
We require channel updates to have the max HTLC message flag set.

Several flows need to pass that check before channel updates are
forwarded to peers:
* after channel funding: `addToRouterGraph`
* after receiving channel updates from a peer:
  `ProcessRemoteAnnouncement`
* after we update channel policies: `PropagateChanPolicyUpdate`
2023-02-21 14:03:51 +01:00
yyforyongyu
0735522194
multi: fix make fmt 2022-08-23 22:10:24 +08:00
eugene
b9ef26061a
server+netann+peer: put peer's alias in Update, proper config for link
This commit modifies the netann subsystem to use the peer's alias
for ChannelUpdates where appropriate (i.e. in case we are sending
the alias to the peer). It also modifies the loadActiveChannels
function in the peer package to handle upgrading a channel when the
scid-alias feature bit is turned on.
2022-07-07 17:10:30 -04:00
Tommy Volk
9a10c80bcb multi: move many t.Fatalf calls to require.NoError 2022-06-17 04:26:55 +00:00
positiveblue
ae2aa5671f
lnrpc/peers: handle feature bit changes in updateNodeAnnouncement 2022-04-02 19:10:25 -07:00
positiveblue
76196db70e
lnrpc/peers: handle net address changes in updateNodeAnnouncement 2022-04-02 19:09:10 -07:00
positiveblue
aacb2565f5
lnrpc/peers: handle color changes in updateNodeAnnouncement 2022-04-01 18:36:26 -07:00
positiveblue
ce4813940d
lnrpc/peers: handle alias changes in updateNodeAnnouncement 2022-04-01 18:36:26 -07:00
yyforyongyu
0e242bae82
netann: create testSigBytes for unit test 2022-03-11 12:31:51 +08:00
Oliver Gugger
7dfe4018ce
multi: use btcd's btcec/v2 and btcutil modules
This commit was previously split into the following parts to ease
review:
 - 2d746f68: replace imports
 - 4008f0fd: use ecdsa.Signature
 - 849e33d1: remove btcec.S256()
 - b8f6ebbd: use v2 library correctly
 - fa80bca9: bump go modules
2022-03-09 19:02:37 +01:00
yyforyongyu
1ad6bbfbc2
multi: add logs when subservers are starting
Also unified the log messages.
2022-02-11 21:17:03 +08:00
Oliver Gugger
895a2e497b
multi: formatting and comment fixes 2022-02-10 11:02:02 +01:00
Dimitris Apostolou
530a2059e5
multi: Fix typos [skip ci] 2022-01-24 12:19:02 +02:00
Matthew Bajorek
6fb3c25228 netann: clarify invalid config timeout constraints [skip ci] 2021-12-09 09:29:04 -05:00
Oliver Gugger
6093393e2f
multi: refactor SignMessage to specify hashing 2021-10-14 15:42:44 +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
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
Oliver Gugger
02757f6735
multi: refactor SignDigest into SignMessage
To make it possible to use a remote signrpc 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
signrpc.SignMessage RPC to accept a digest instead of only the message
which has security implications.
2021-10-08 12:06:51 +02:00
yyforyongyu
3204e2d74b
multi: add shutdown logs in subservers
This commit adds a simple shutdown to every subserver to assist
debugging.
2021-09-15 19:52:03 +08:00
Elliott Jin
a259317d72 netann: add test for RequestAuto 2021-02-24 07:13:28 -08:00
Elliott Jin
59bd617c97 netann: add RequestAuto for restoring auto chan state management
If a channel was manually disabled, subsequent automatic / background
requests to update that channel's state will be ignored. A RequestAuto
call restores automatic / background state management and indicates
that such requests should no longer be ignored.
2021-02-24 07:13:28 -08:00
Elliott Jin
e1709f20eb netann: add tests for manually enabling/disabling channels 2021-02-24 07:13:28 -08:00
Elliott Jin
dbabc2e696 netann: add bool param to chan_status_manager_test
Add boolean parameter for test functions without changing any
existing functionality. All current tests set manual = false, but
Future tests can set manual = true to test manual requests to
update channel state.
2021-02-24 07:13:28 -08:00
Elliott Jin
542c89ad5d netann: update channel status transitions to handle manual requests 2021-02-24 07:13:28 -08:00
Elliott Jin
c40d291488 netann: add ChanStatusManuallyDisabled state
Add new value for ChanStatus without changing any existing
functionality. The new value indicates that a user manually
requested disabling a channel.
2021-02-24 07:13:28 -08:00
Elliott Jin
e9baf0e4a2 multi: add bool param to channel enable/disable methods
Add a new boolean parameter without changing any existing
functionality. The parameter will be used to indicate
whether a request to update a channel's status was made
manually by a user (currently always false).
2021-02-24 07:13:28 -08:00
Johan T. Halseth
3485a7874f
netann: ignore unknown channel updat on startup
Since the funding manager might be in process of adding the edge to the
graph, we ignore the error.
2021-01-26 15:33:45 +01:00
Olaoluwa Osuntokun
ba3688c3b9
netann: add new HostAnnouncer to support dynamic IPs via domains
In this commit, we add a new sub-system, then `HostAnnouncer` which
allows a users without a static IP address to ensure that lnd always
announces the most up to date address based on a domain name. A new
command line flag `--external-hosts` has been added which allows a user
to specify one or most hosts that should be periodically resolved to
update any advertised IPs the node has.

Fixes #1624.
2020-07-06 17:30:08 -07:00
Wilmer Paulino
d0fe8b737b
netann: decode features when creating chan ann from stored chan info
This was the only field not properly set when creating a
lnwire.ChannelAnnouncement from a channeldb.ChannelEdgeInfo.
2020-06-01 17:30:23 -07:00
Oliver Gugger
be890ef9be
lnd+server+netann: use signing interface in node signer 2020-05-20 09:05:35 +02:00
Andras Banki-Horvath
2d6c73f0fd netann: remove unused logClosure 2020-04-24 19:15:08 +02:00
Andras Banki-Horvath
28c2ef12b2 netann: one append instead of appends in a loop 2020-04-24 19:15:08 +02:00
Conner Fromknecht
0f94b8dc62
multi: return input.Signature from SignOutputRaw 2020-04-10 14:27:35 -07:00
Conner Fromknecht
5c2fc4a2d6
discovery/gossiper: use netann pkg for signing channel updates 2020-03-19 13:43:39 -07:00
Conner Fromknecht
5147a6d63d
netann/channel_update: set timestamp via modifier 2020-03-17 16:25:22 -07:00
Conner Fromknecht
f6c194c3cd
netann/node_announcement: consolidate signing logic 2020-03-17 16:25:02 -07:00
Conner Fromknecht
6a813e3433
discovery/multi: move CreateChanAnnouncement to netann 2020-03-17 16:23:54 -07:00
Conner Fromknecht
9d92cfd2b4
netann/channel_update: use generic SignAnnouncement 2020-03-17 16:23:19 -07:00
Conner Fromknecht
df44d19936
discovery/multi: move SignAnnouncement to netann 2020-03-17 16:23:01 -07:00
Joost Jager
3d7de2ad39
multi: remove dead code 2019-09-10 17:21:59 +02:00
Federico Bond
0a9141763e multi: replace manual CAS with sync.Once in several more modules 2019-06-12 09:37:26 -03:00
Conner Fromknecht
714e42fce2
netann/chan_status_manager: remove unknown edges from passive disable
Modifies the netann.ChanStatusManager to remove outpoints
from the set of tracked channels when it encounters a
channeldb.ErrEdgeNotFound when passively disabling. It is
possible for this to occur if a channel is closed w/o first
being disabled, which may happen if the remote party force
closes.
2019-03-12 17:35:12 -07:00
Conner Fromknecht
cd467195d7
netann/chan_status_manager_test: adds ChanStatusManager unit tests 2019-02-14 17:12:59 -08:00
Conner Fromknecht
53797b7dc7
netann/chan_status_manager: adds ChanStatusManager 2019-02-14 17:12:49 -08:00
Conner Fromknecht
b405c87578
netann/channel_state: defines ChanStatus and per-channel state 2019-02-14 17:12:37 -08:00
Conner Fromknecht
559255e6f6
netann/interface: defines chan status mgr interfaces 2019-02-14 17:12:25 -08:00
Conner Fromknecht
a0daf6f59f
netann/channel_update_test: adds unit tests UpdateDisableFlag 2019-02-14 17:12:13 -08:00
Conner Fromknecht
1a7fd6e6f1
netann/channel_update: exposes channel update helpers moved from server 2019-02-14 17:12:03 -08:00
Johan T. Halseth
3c2b46eb8c
Merge pull request #2445 from cfromknecht/netann-logging
netann: Add NANN subsystem logger
2019-01-11 10:45:29 +01:00