Commit Graph
100 Commits
Author SHA1 Message Date
Conner Fromknecht d7ac4bd6f9 Merge pull request #2543 from alexbosworth/patch-9
trivial: typo fix
2019-01-28 16:56:28 -08:00
Conner Fromknecht 58f95322c0 server: fix notify-online log message 2019-01-23 20:40:27 -08:00
Conner Fromknecht f78319d32c watchtower/wtserver/server: return valid reward script 2019-01-17 22:19:28 -08:00
Conner Fromknecht 7e1b399437 Merge pull request #2494 from halseth/make-flakehunter-build-itest
[trivial] build lnd-itest before flakehunting
2019-01-17 19:22:01 -08:00
Conner Fromknecht 45cfa65b47 watchtower/wtserver/server: handle missed err case from read msg 2019-01-15 19:46:04 -08:00
Conner Fromknecht 4a2fb1b4d0 watchtower/wtserver/server: log sent/recvd wire messages 2019-01-15 19:38:41 -08:00
Conner Fromknecht 00db396b51 watchtower/wtwire/summary: adds message summaries 2019-01-15 19:38:41 -08:00
Conner Fromknecht b32afd9001 watchtower/conf_experimental: adds CLI options in experimental builds 2019-01-14 19:42:34 -08:00
Conner Fromknecht a9d21799a8 watchtower/conf: adds non-experimental empty Conf 2019-01-14 19:42:34 -08:00
Conner Fromknecht b1c6dd678b watchtower/standalone: adds Standalone watchtower 2019-01-14 19:42:34 -08:00
Conner Fromknecht e0b72580f5 watchtower/errors: adds pkg level errors 2019-01-14 19:42:34 -08:00
Conner Fromknecht 2a6dbb9d78 watchtower/config: add capstone Config struct 2019-01-14 19:42:34 -08:00
Conner Fromknecht 25daa538e2 watchtower/interface: adds composite DB iface 2019-01-14 19:42:33 -08:00
Conner Fromknecht e0c652791b log: add watchtower logs 2019-01-14 19:42:33 -08:00
Conner Fromknecht 7a8669a531 watchtower/log: add WTWR subsystem logger 2019-01-14 19:42:33 -08:00
Conner Fromknecht 043631e59f Merge pull request #2430 from cfromknecht/remove-breach-txn-from-retribution
lnwallet: Remove breach txn from NewBreachRetribution
2019-01-11 13:47:30 -08:00
Conner Fromknecht 2cf220a137 peer: handle message encoding errors on write
In this commit, we modify the peer's writeMessage
method to properly handle errors returned from
encoding an lnwire message and from setting the
write deadline on the connection. Since an error
would likely result in an empty byte slice, the
worse case seems to be that we may have tried to
send an empty message on the wire.

Lastly, we correct the way we compute bytes sent
on the wire to properly count the number of bytes
*written*, and not just the length of the encoded
message.
2019-01-10 19:49:44 -08:00
Conner Fromknecht 6ae77bc3cb htlcswitch/switch_test: adds HasActiveLink unit test 2019-01-10 16:34:03 -08:00
Conner Fromknecht 164250d1cd htlcswitch/switch: check EligibleToForward in HasActiveLink
This commit modifies the behavior of the
HasActiveLink method within the switch to
only return true if the link is in the
link index and is eligible to forward
HTLCs.

The prior version returns true whenever
the link is found in the link index,
which may return true for pending
channels that are not actually active.
2019-01-10 16:34:02 -08:00
Conner Fromknecht f66e713b35 watchtower/blob/justice_kit_test: test witness script/stack construction 2019-01-10 15:59:54 -08:00
Conner Fromknecht ca3e06b785 watchtower/wtserver: reject unknown blob types 2019-01-10 15:59:54 -08:00
Conner Fromknecht 4f3655ba93 watchtower/wtwire/create_session_reply: add reject blob type code 2019-01-10 15:59:54 -08:00
Conner Fromknecht b746bf86c2 watchtower/multi: switch over to wtpolicy
migrate to using wtpolicy.Policy in wtwire messages and wtserver
2019-01-10 15:59:54 -08:00
Conner Fromknecht c315d74347 watchtower/wtpolicy/policy: adds watchtower policy 2019-01-10 15:59:54 -08:00
Conner Fromknecht cf1b8ba78f watchtower/blob/type_test: adds Flag and Type unit tests 2019-01-10 15:59:54 -08:00
Conner Fromknecht bc09c6dbae watchtower/blob/type: introduces blob type flags
Adds flags for reward outputs and commitment outputs.
The fixed-size encoding for commitment outputs is
treated as a flag, so that the blob format can be
modified, extended, or replaced in future iterations.
2019-01-10 15:35:07 -08:00
Conner Fromknecht eb1167cc52 Merge pull request #2418 from cfromknecht/connectpeer-logging
rpcserver: add connectpeer log, fix existing formatting
2019-01-10 13:51:48 -08:00
Conner Fromknecht eb2f5cecf6 multi: remove breach tx arg from NewBreachRetribution args
This commit removes the breach transaction from the
arguments passed to NewBreachRetribution. We already
keep all prior remote commitments on disk in the
commitment log, and load that transaction from disk
inside the method. In practice, the one loaded from
disk will be the same one that is passed in by the
caller, so there should be no change in behavior
as we've already derived the appropriate state number.

This changes makes integration with the watchtower
client simpler, since we no longer need to acquire
the breaching commitment transaction to be able to
construct the BreachRetribution. This simplifies
not only the logic surrounding transient backsups,
but also on startup (and later, retroactively
backing up historic updates).
2019-01-10 13:13:38 -08:00
Conner Fromknecht a5b22788bf routing/router: avoid naked spew of channel policies 2019-01-09 23:54:41 -08:00
Conner Fromknecht a8b2c093aa Merge pull request #2416 from cfromknecht/netann-node-signer
netann: move NodeSigner out of main package
2019-01-09 17:01:00 -08:00
Conner Fromknecht 381b5275c4 lncfg/address_test: test LNAddress parsing, refactor addr tests 2019-01-09 16:37:56 -08:00
Conner Fromknecht 198f9323cc lncfg/address: add LN address parsing 2019-01-09 16:37:48 -08:00
Conner Fromknecht 97f4f10355 log: initialize NANN logger for netann pkg 2019-01-09 13:31:39 -08:00
Conner Fromknecht 4c8b64d2a6 netann/log: add NANN logger 2019-01-09 13:29:46 -08:00
Conner Fromknecht 7987a41c0d nodesigner: remove file, now in netann pkg 2019-01-08 16:18:55 -08:00
Conner Fromknecht 32041e703b server: replace nodeSigner in main with netann.NodeSigner 2019-01-08 16:18:39 -08:00
Conner Fromknecht 30441871d3 netann/node_signer: copy and export NodeSigner from main 2019-01-08 16:18:06 -08:00
Conner Fromknecht bb8469d8ee watchtower/lookout: correct txid + session id logging 2019-01-07 19:20:45 -08:00
Conner Fromknecht 75ec66d9b3 Merge pull request #1975 from halseth/fwdtrigger-force
[tests] Force tick on FwdEventTicker
2019-01-07 17:46:58 -08:00
Conner Fromknecht 088fb33718 contractcourt: nil keyring curves on breach info 2019-01-07 17:15:45 -08:00
Conner Fromknecht cd54625c2d lnwallet/channel: add keyring + remote csv to breach info 2019-01-07 17:15:33 -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
Conner Fromknecht 226640aa3c watchtower/wtwire/wtwire: fix missed error handling 2018-12-06 15:49:53 -08:00
Conner Fromknecht c27b90f76c queue/queue_test: adds 100% test coverage 2018-12-03 13:58:25 -08:00
Conner Fromknecht a4442608e6 queue/queue: wait group inner go routines, add idempotency 2018-12-03 13:58:25 -08:00
Conner Fromknecht 7557bded50 Makefile: remove unused HAVE_ declarations + cleanup 2018-12-02 15:24:14 -08:00
Conner Fromknecht ae46d2e716 Merge pull request #2211 from Roasbeef/notifier-reverse-scan
chainntnfs: modify all historical rescans to scan backwards
2018-11-30 16:26:24 -08:00
Conner Fromknecht da21f33a2a chan_series: remove chan_series from main 2018-11-30 15:33:34 -08:00
Conner Fromknecht 4e48a56d5e server: init gossiper w/ discovery.ChanSeries 2018-11-30 15:33:34 -08:00
Conner Fromknecht 5fc0a192ad discovery/syncer: move CGTimeSerires to chan_series 2018-11-30 15:33:34 -08:00
Conner Fromknecht 1c81a8fad6 discovery/chan_series: copy chan_series to discovery 2018-11-30 15:33:34 -08:00
Conner Fromknecht 157d181a66 Merge pull request #2194 from xsb/num-inactive-chan-reorder
lnrpc: reorder num_inactive_channels
2018-11-30 15:24:22 -08:00
Conner Fromknecht 0d9b5ecc3c Makefile: use period for print for consistency 2018-11-30 15:20:50 -08:00
Conner Fromknecht 5039c106f6 make/testing_flags: remove unused PROD_TAGS 2018-11-30 15:20:49 -08:00
Conner Fromknecht 0ad3302e16 Makefile: remove unnecessary PROD_TAGS 2018-11-30 15:20:47 -08:00
Conner Fromknecht 2c716095d5 travis: use make targets instead of chaining 2018-11-30 15:20:46 -08:00
Conner Fromknecht 3e0ca05740 Makefile: add travis-race and travis-cover targets 2018-11-30 15:20:45 -08:00
Conner Fromknecht 668bd4db33 Merge pull request #2094 from cfromknecht/validate-color
config: validate node color after reading config
2018-11-29 16:18:44 -08:00
Conner Fromknecht ba53879b2b watchtower/wtserver/server: add missing godocs + code move 2018-11-02 15:59:47 -07:00
Conner Fromknecht 7cdbb786d6 watchtower/wtserver: move from watchtower/server 2018-11-02 15:51:06 -07:00
Conner Fromknecht 9b7a800630 watchtower/server/log: modify default log tag 2018-11-02 15:51:06 -07:00
Conner Fromknecht a9e523ecf1 watchtower/server/server: add start/stop logging 2018-11-02 15:51:06 -07:00
Conner Fromknecht ef309f43d2 discovery: pass peer quit signal to ProcessQueryMsg
This commit passes the peer's quit signal to the
gossipSyncer when attempt to hand off gossip query
messages. This allows a rate-limited peer's read
handler to break out immediately, which would
otherwise remain stuck until the rate-limited
gossip syncer pulled the message.
2018-11-01 17:35:55 -07:00
Conner Fromknecht 96c47f7de4 discovery/gossiper: bypass main event loop for queries
This commit restructures the delivery of gossip
query related messages, such that they are delivered
directly to the gossip syncers. Gossip query rate
limiting was introduced in #1824 on a per-peer basis.
However, since all gossip query messages were being
delivered in the main event loop, the end result is
that one rate-limited peer could stall all other
peers.

In addition, since no other peers would be able to
submit gossip-related messages through the blocked
event loop, the back pressure would eventually rate
limit the read handlers of all peers as well.
The end result would be lengthy delays in reading
messages related to htlc forwarding.

The fix is to lift the delivery of gossip query
messages outside of the main event loop. With
this change, the rate limiting backpressure is
delivered only to the intended peer.
2018-11-01 17:28:20 -07:00
Conner Fromknecht b0b2475660 peer: remove quit chan from AddMsg signature 2018-11-01 17:08:24 -07:00
Conner Fromknecht 8bc896427d watchtower/lookout/justice_descriptor_test: add create txn test 2018-10-31 20:42:17 -07:00
Conner Fromknecht fa63ba2e37 watchtower/lookout/lookout_test: adds simple lookout tests 2018-10-31 20:42:15 -07:00
Conner Fromknecht 671be69743 watchtower/lookout/mock: adds mock backend 2018-10-31 20:42:14 -07:00
Conner Fromknecht 475ab01442 watchtower/lookout/lookout: adds Lookout 2018-10-31 20:42:12 -07:00
Conner Fromknecht 3ab34f8426 watchtower/lookout/punisher: adds Punisher craft+bcast justice txn 2018-10-31 20:42:11 -07:00
Conner Fromknecht 0632520f40 watchtower/lookout/justice_descriptor: adds justice txn creation 2018-10-31 20:42:10 -07:00
Conner Fromknecht bd5ed47ce4 watchtower/lookout/interface: adds primary lookout ifaces 2018-10-31 20:42:08 -07:00
Conner Fromknecht 1d7e382097 watchtower/lookout/log: adds lookout subsystem logger 2018-10-31 20:42:07 -07:00
Conner Fromknecht b79bab0920 watchtower/wtdb/mock: adds lookout-related mock functions 2018-10-31 20:42:06 -07:00
Conner Fromknecht 4e6dc3863b watchtower/wtdb/session_info: compute rewards outputs 2018-10-31 20:42:04 -07:00
Conner Fromknecht 740e8fd686 watchtower/blob/justice_kit_test: remove external nonce
The nonce is now passed in as the prefix to the
ciphertext, and is generated randomly in calls
to Encrypt.
2018-10-31 20:42:03 -07:00
Conner Fromknecht c5eba3b608 watchtower/blob/justice_kit: use randomized 192-bit nonce
This commit modifies the blob encryption scheme to
use chacha20-poly1305 with a randomized 192-bit nonce.
The previous approach used a deterministic nonce scheme,
which is being replaced to simplify the requirements of
a correct implementation.  As a result, each payload
gains an addtional 24-bytes prepended to the ciphertext.
2018-10-31 20:42:01 -07:00
Conner Fromknecht 2dd399ca52 watchtower/blob/justice_kit: return DER signatures
This commit fixes an issue with the witness stack
construction for to-local and to-remote inputs,
that would cause the justice kit to return
signatures as fixed-size, 64-byte signatures.
The correct behavior is to return DER-encoded
signatures so that they will properly verify on
the network, since the consensus rules won't
be able to understand the fixed-size variant.
2018-10-31 17:36:18 -07:00
Conner Fromknecht 2255ce17db watchtower/blob/justice_kit_test: add sweep addr tests
Adds vectors to the justice kit tests to
ensure variable length sweep addresses are
properly encoded/decoded.
2018-10-29 16:48:43 -07:00
Conner Fromknecht b7d811b3dd watchtower/blob/justice_kit: add variable length sweep addr
This commit fixes an oversight in the previous
design of the watchtower blob, by introducing
a length byte for sweep addresses. The previous
format supposed that addresses would be padded
to 42 bytes, but had no indication of the
address's actual length.

To rememdy this, we introduce a single byte
indicating the actual size of the address,
such that the padding can be removed upon
decoding.
2018-10-29 16:48:43 -07:00
Conner Fromknecht ae6f06155a watchtower/blob/justice_kit_test: use test.Run for sub tests 2018-10-29 16:34:31 -07:00
Conner Fromknecht ba28ec3be0 chainntnfs/neutrinonotify/neutrino: fix debug logs 2018-10-26 18:32:32 -07:00
Conner Fromknecht e03c818aa7 chainntnfs/txconfnotifier: remove ntfn details, bound conf depth
Removes details field from conf notifications, in favor
of using the details on the confSet. We also bound the
requested conf depth to the reorg saftey limit, as the
behavior of state tracking within the notifier is
undefined otherwise.
2018-10-26 18:32:31 -07:00
Conner Fromknecht eee5311557 chainntnfs/txconnotifier: add debug logs, log errs/warnings, godocs 2018-10-26 18:32:31 -07:00
Conner Fromknecht 2dcb86bced chainntnfs/txconfnotifier: set confset details at tip
This commit ensures that a confSet's details
are assigned in the confNotifications index
after discovering the transaction at tip. The
recent changes allow a later notification to
be dispatched on registration if an earlier one
has already discovered the confirmation details.

Before this change, it was observed that a later
registration would attempt an immediate delivery,
but fail to do so because the confset's details
were nil. This commit remedies that dispatch path,
allowing the integration tests to pass again.
2018-10-26 18:32:30 -07:00
Conner Fromknecht df9bb56068 chainntnfs/neutrino: use HistoricalConfDispatch in ntfn registry 2018-10-26 18:32:30 -07:00
Conner Fromknecht 6cd0f867ad chainntnfs/btcd: use HistoricalConfDispatch in ntfn registry 2018-10-26 18:32:30 -07:00
Conner Fromknecht a4c9f62c6b chainntnfs/bitcoind: use HistoricalConfDispatch in ntfn registry 2018-10-26 18:32:30 -07:00
Conner Fromknecht 11c231d814 chainntnfs/txconfnotifier_test: remove clientID argument...
to UpdateConfDetails
2018-10-26 18:32:30 -07:00
Conner Fromknecht 32e7368e1e chainntnfs/txconfnotifier: remove clientID from UpdateConfDetails signature 2018-10-26 18:32:30 -07:00
Conner Fromknecht 9ae6d43916 chainntnfs/txconfnotifier: split out ntfn dispatch into helper 2018-10-26 18:32:30 -07:00
Conner Fromknecht 217b1fc0ef chainntnfs/txconfnotifier: return HistoricalConfDispatch from Register 2018-10-26 18:32:29 -07:00
Conner Fromknecht f94de2308f chainntnfs/txconfnotifier: return HistoricalConfDispatch from Register 2018-10-26 18:32:29 -07:00
Conner Fromknecht 74122e00f5 chainntnfs/txconfnotifier: add PkScript to ConfNtfn 2018-10-26 18:32:29 -07:00
Conner Fromknecht 37c864d6f6 chainntnfs/txconfnotifier: add HistoricalConfDispatch struct 2018-10-26 18:32:29 -07:00
Conner Fromknecht e804b30669 chainntnfs/txconfnotifier_test: update to use multi-value Register 2018-10-26 18:32:29 -07:00
Conner Fromknecht cf7700e6cb chainntnfs/bitcoind+btcd+neutrino: let tcn query for height hint 2018-10-26 18:32:29 -07:00
Conner Fromknecht 8b8007bb5a chainntnfs/txconfnotifier: query conf hint in Register 2018-10-26 18:32:28 -07:00