Commit Graph
100 Commits
Author SHA1 Message Date
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
Conner Fromknecht 2e489fcf24 rpcserver: replace DebugBuild cmp w/ IsDevBuild in AbandonChannel 2018-10-05 13:04:45 +09:00
Conner Fromknecht 5706c12d69 config_production: remove in favor of build.Deployment 2018-10-05 13:04:45 +09:00
Conner Fromknecht a98cdfd897 config_debug: remove in favor of build.Deployment 2018-10-05 13:04:45 +09:00
Conner Fromknecht ecc5d267e3 Makefile: use git describe for better commit versions 2018-10-05 13:04:45 +09:00
Conner Fromknecht 0903fe3183 main+lnd: display build.Version() for commit hash 2018-10-05 13:04:45 +09:00
Conner Fromknecht 97fd56cf47 cmd/lncli: display build.Version() for commit hash 2018-10-05 13:04:45 +09:00
Conner Fromknecht 1e64070a1d build/version: move version.go to build pkg 2018-10-05 13:04:45 +09:00
Conner Fromknecht bbceec8bea lnd: log shutdown before closing rotator 2018-10-05 13:04:45 +09:00
Conner Fromknecht bfcda6e205 log: initialize subloggers w/ build.LogWriter
and build.NewSubLogger
2018-10-05 13:04:45 +09:00
Conner Fromknecht 59b459674d multi: init subsystem loggers via build pkg 2018-10-05 13:04:45 +09:00
Conner Fromknecht 9654a1c619 build/log: add log types + NewSubLogger 2018-10-05 13:04:45 +09:00
Conner Fromknecht 4ea1a40a88 build/loglevel: add build flag hooks for log levels 2018-10-05 13:04:45 +09:00
Conner Fromknecht 738ba45bcf build/deployment: add prod+dev targets 2018-10-05 13:04:45 +09:00
Conner Fromknecht 10b35a8f20 main: remove disable log in testing + clean up imports 2018-10-05 13:04:45 +09:00
Conner Fromknecht bab52421fa make/testing_flags: make DEV_TAGS+PROD_TAGS, switch debug to dev 2018-10-05 13:04:45 +09:00
Conner Fromknecht ece3051237 htlcswitch/hodl: switch from debug tag to dev 2018-10-05 13:04:45 +09:00
Conner Fromknecht 3403794e81 chainntnfs: switch debug tag to dev
This avoids collisions with the logging level tags
2018-10-05 12:59:34 +09:00
Conner Fromknecht 91b0e9cae5 chainntnfs/txconfnotifier: commit conf hints before notifying 2018-10-02 01:09:26 -07:00
Conner Fromknecht 7dceac92d2 chainntnfs/neutrino: commit spend hints before notifying 2018-10-02 01:09:26 -07:00
Conner Fromknecht e498a837a3 chainntnfs/btcd: commit spend hints before notifying 2018-10-02 01:09:26 -07:00
Conner Fromknecht fb7b12a7db chainntnfs/bitcoind: commit spend hints before notifying 2018-10-01 16:47:01 -07:00
Conner Fromknecht b5b8602820 chainntnfs/neutrinonotify/neutrino: remove height shadowing
This commit removes shadowing of the currentHeight
variable when registering for neutrino spend
notifications. Currently, a locally scoped variable
is used when determining if the backend is fully
synced before attempting to call GetUtxo, which
means that the variable won't be updated after
breaking out of the loop. As a result, this could
cause us to scan unnecessarily if the backend is
catching up, e.g. after being offline for some time.
2018-09-20 18:47:04 -07:00