Commit Graph
100 Commits
Author SHA1 Message Date
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 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
Conner Fromknecht a1756b0b1b chainntnfs/bitcoind+btcd+neutrino: pass nil conf details 2018-10-26 18:32:28 -07:00
Conner Fromknecht 1babec971f chainntnfs/txconfnotifier: isolate scanning ntfns 2018-10-26 18:32:28 -07:00
Conner Fromknecht 2f0b5596da chainntnfs/txconfnotifier: add rescanStates 2018-10-26 18:32:28 -07:00
Conner Fromknecht 012d17efaa chainntnfs/txnotifier_test: update nil spend details to restore tests 2018-10-26 18:32:28 -07:00
Conner Fromknecht 7661d00d5a chainntnfs/txconfnotifier_test: update height hint cache test 2018-10-26 18:32:28 -07:00
Conner Fromknecht d3bde428ea chainntnfs/txconfnotifier_test: use tcn instead of txConfNotifier 2018-10-26 18:32:28 -07:00
Conner Fromknecht b0318e2b74 config: validate node color after reading config 2018-10-24 22:10:18 -07:00
Conner Fromknecht fd6024c306 watchtower/wtdb/mock: adds MockDB for debug build 2018-10-24 20:18:21 -07:00
Conner Fromknecht da56aa3528 lnd_test: process all node/edge updates in graph_top_itest
This commit modifies the graph topology test to
properly count channel updates and node
announcments in the event that they are batched
into a single topology update. The prior logic
made the assumption that they were always in
distinct topology updates, so this method should
be more general and robust.
2018-10-24 19:20:01 -07:00
Conner Fromknecht f9cec4a67b cnct/contract_resolvers: propagate checkpoint failures 2018-10-24 13:57:10 -07:00
Conner Fromknecht f957b78c0b cnct/contract_resolvers: ignore duplicate publication error 2018-10-24 13:57:10 -07:00
Conner Fromknecht 682c4c96c7 cnct/contract_resolvers: reliably publish htlc success sweep 2018-10-24 13:57:10 -07:00
Conner Fromknecht b7aebd92cf cnct/contract_resolvers: reliably publish commit sweep 2018-10-24 13:57:10 -07:00
Conner Fromknecht 9ab620c7be watchtower/wtwire/error_code: add shared error codes 2018-10-23 18:28:23 -07:00
Conner Fromknecht 999466c860 watchtower/wtwire/error: add generic error message 2018-10-23 18:28:22 -07:00
Conner Fromknecht d171df5184 watchtower/wtwire/features: add watchtower feature bits 2018-10-23 18:28:20 -07:00
Conner Fromknecht 5ba95585e5 watchtower/wtwire/init: borrow LN init msg for WT init 2018-10-23 18:28:19 -07:00
Conner Fromknecht 4325d9ec1e watchtower/wtwire/wtwire: add watchtower message codec 2018-10-23 18:23:08 -07:00
Conner Fromknecht cae4f43c19 sweep/sweeper: ignore unknown witness types
This commit restores the sweep behavior of
filtering inputs with unknown witness types
from the final sweep transaction. Currently,
such inputs will be included without adding
anything to the weight estimate, possibly
creating a transaction with insufficient fees.
2018-10-17 16:21:06 -07:00
Conner Fromknecht c2d9cb11d3 docs/MAKEFILE: add log params to unit test targets 2018-10-05 13:04:45 +09:00
Conner Fromknecht 1881ccdaf2 Makefile: merge build+install tags with DEV/PROD_TAGS, trim whitespace 2018-10-05 13:04:45 +09:00
Conner Fromknecht 57ec03564e make/testing_flags: add LOG_TAGS, set using log envvar
The default is nolog, which prevents the unit tests in
the main pkg from being active, since otherwise they
would print as if they were being run like a dev build
of the daemon. Users can pass in custom tags when running
the Makefile by passing arguments using the log variable,
e.g. log="xxxxx xxx"".
2018-10-05 13:04:45 +09:00