Conner Fromknecht
0a3e1cfbe5
channeldb+witness_beacon: use sha256 lookup+delete witness
2019-02-19 17:06:42 -08:00
Conner Fromknecht
3428fde5ab
htlcswitch/link_test: batch preimage write test
2019-02-19 17:06:28 -08:00
Conner Fromknecht
76cecb1396
htlcswitch/link: batch write to preimage cache
...
This commit makes use of the batched AddWitness
method of the WitnessCache, in order to avoid
performing one write for each accepted preimage.
Additionally, this fixes an existing hole in the
consistency guarantees since the batched writes
are now guaranteed to take place before accepting
the next CommitSig. Previously, these writes were
processed in an unsynchronized go routine that
could be delayed arbitrarily long before being
executed.
With this change, the async_payments_benchmarks
actually shows a slight improvement in
performance, presumably because we no longer do
an individual write per preimage, even though
the execution is now explicitly in the critical
path. There is likely also a marginal performance
improvement from the reduction in goroutine
overhead.
2019-02-19 17:06:15 -08:00
Conner Fromknecht
29f07a58cb
cnct+lnwl+hswc: use lntypes.Preimage for witness beacon
2019-02-19 17:06:00 -08:00
Conner Fromknecht
2d8bc99d9e
lntypes/preimage: add MakePreimage initializer
2019-02-19 17:05:45 -08:00
Conner Fromknecht
e8b7f1fca3
channeldb/witness_cache: create AddSha256Witnesses helper + test
2019-02-19 17:05:30 -08:00
Conner Fromknecht
56b6becc48
channeldb/witness_cache_test: test batch preimage insertion
2019-02-19 17:05:17 -08:00
Conner Fromknecht
30f61b7630
multi: make AddPreimage variadic, optimistically compute key
...
In this commit, we modify the WitnessCache's
AddPreimage method to accept a variadic number
of preimages. This enables callers to batch
preimage writes in performance critical areas
of the codebase, e.g. the htlcswitch.
Additionally, we lift the computation of the
witnesses' keys outside of the db transaction.
This saves us from having to do hashing inside
and blocking other callers, and limits extraneous
blocking at the call site.
2019-02-19 17:05:04 -08:00
Conner Fromknecht
2900d8aff8
brontide/noise: take read buffers from pool, return w/ finalizer
2019-02-15 19:33:23 -08:00
Conner Fromknecht
5d9514fbe4
buffer+pool: add buffer.Read and pool.ReadBuffer
2019-02-15 19:33:08 -08:00
Conner Fromknecht
6f96d04b72
multi: add buffer.Write and pool.WriteBuffer, make GCQueue generic
2019-02-15 19:31:24 -08:00
Conner Fromknecht
ca4226d429
brontide/listener: handle SetReadDeadline errors
2019-02-15 18:14:02 -08:00
Conner Fromknecht
41940c6c9e
brontide/conn: handle read timeout errors
2019-02-15 18:13:52 -08:00
Conner Fromknecht
04febab85c
brontide/noise: use static default ephemeral keygen closure
2019-02-15 18:13:43 -08:00
Conner Fromknecht
785740493e
brontide/noise: use statically allocated prologue
2019-02-15 18:13:34 -08:00
Conner Fromknecht
de282172a1
peer+server+test_utlils: use new ChanStatusManager
...
This commit hooks up the new netann.ChanStatusManager,
replacing the prior method which used the
watchChannelStatus goroutine.
2019-02-14 17:13:44 -08:00
Conner Fromknecht
8b185e6301
test_utils: waitgroup manually spawned goroutines
...
Found that his can sometimes cause a panic with a
negative waitgroup counter.
2019-02-14 17:13:33 -08:00
Conner Fromknecht
ef41fc6249
lnd_test: set valid chan status config flags
2019-02-14 17:13:21 -08:00
Conner Fromknecht
4686db4196
config+server+lnd_test: expose chan status manager config options
...
Exposes the three parameters that dictate
the behavior of the channel status manager:
* --chan-enable-timeout
* --chan-disable-timeout
* --chan-status-sample-interval
2019-02-14 17:13:11 -08: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
Conner Fromknecht
fd6fb80816
cmd/lncli: show all utxos in listunspent when no args passed
2019-02-11 13:02:35 -08:00
Conner Fromknecht
34e36e9daa
lnrpc+rpcserver: rename ScriptPubkey to PkScript on Utxo msg
2019-02-11 13:02:25 -08:00
Conner Fromknecht
3fa9d81a41
lntest/harness: assert unconfirmed utxos in ListUnspent during sendCoins
2019-02-11 13:02:11 -08:00
Conner Fromknecht
cb2723236f
lnrpc: correct tab indentation to 4 space
2019-02-11 13:01:49 -08:00
Conner Fromknecht
287c4d0658
Merge pull request #2630 from alexbosworth/patch-10
...
trivial: typo fix
2019-02-11 12:49:56 -08:00
Conner Fromknecht
4a0fc3e980
watchtower/multi: thread ChainHash to server
2019-02-08 20:02:17 -08:00
Conner Fromknecht
b3a9650ff9
watchtower/wtserver/server: use CheckRemoteInit to validate Init msgs
2019-02-08 20:02:11 -08:00
Conner Fromknecht
4c7111256e
watchtower/wtwire/features: remove local/global feature names...
...
in favor of a universal FeatureNames index.
2019-02-08 20:02:05 -08:00
Conner Fromknecht
40df51eaaa
watchtower/wtwire/init_test: table test CheckRemoteInit
2019-02-08 20:01:59 -08:00
Conner Fromknecht
572537874b
watchtower/wtwire/init: add CheckRemoteInit method
2019-02-08 20:01:54 -08:00
Conner Fromknecht
0045ad567d
watchtower/wtwire/features: make wtwire feature uniform
2019-02-07 16:13:42 -08:00
Conner Fromknecht
4dbade64dd
watchtower/multi: send connection features + chain hash in Init
2019-02-06 20:09:19 -08:00
Conner Fromknecht
a00fc148c8
watchtower/wtclient/backup_task: make sweep pkscript independent of session
...
This commit changes when the sweep pkscript
is assigned in the construction of the justice
transaction. Currently, the sweep pkscript is
assigned when the task is bound to a session.
However, we will moving to an assignment where
a unique sweep pkscript is used per channel to
prevent address inflation. Hence, this commit
makes the sweep pkscript a state dependent
variable, since it can be known at the time the
channel id is assigned.
2019-02-06 18:24:30 -08:00
Conner Fromknecht
fe9f703b5b
watchtower/wtclient/backup_task: correct txweight + update test vectors
2019-02-06 18:24:30 -08:00
Conner Fromknecht
e13d88f3f3
watchtower/wtclient/backup_task_internal_test: adds backupTask utests
2019-02-05 18:27:19 -08:00
Conner Fromknecht
8f98522f13
watchtower/wtclient/backup_task: adds backupTask
2019-02-05 18:27:13 -08:00
Conner Fromknecht
f1f52410ab
sweep/input: adds NewBaseInput to return reference
2019-02-05 18:27:07 -08:00
Conner Fromknecht
8ac5f2bb17
Merge pull request #2586 from halseth/neutrinonotify-return-on-rescan-error
...
chainnrnfs/neutrino: return on historicalConf error
2019-02-05 18:09:02 -08:00
Conner Fromknecht
6c78fc5740
Merge pull request #2550 from halseth/autpilot-agent-quit-pending-conn
...
autopilot: don't block Stop on pending connection
2019-02-05 16:39:31 -08:00
Conner Fromknecht
4c632627ae
cmd/lncli/commands: filter txid_bytes from list_unspent
2019-02-01 18:02:02 -08:00
Conner Fromknecht
b25f1af347
cmd/lncli/types: add Utxo and OutPoint display types
2019-02-01 18:01:56 -08:00
Conner Fromknecht
c74dcbe6ff
lnrpc+rpcserver: replace ChanPoint w/ OutPoint in Utxo msg
2019-02-01 18:01:51 -08:00
Conner Fromknecht
ddfcba46e7
lnrpc/gen_protos: add missing space before escaped newline
2019-02-01 18:01:44 -08:00
Conner Fromknecht
09e71a1d49
watchtower/multi: use ComputeJusticeTxOuts, test altruist+reward
2019-02-01 17:30:13 -08:00
Conner Fromknecht
9054a3ee4c
watchtower/wtpolicy/policy: add ComputeJusticeTxOuts
2019-02-01 17:26:48 -08:00
Conner Fromknecht
1703502505
watchtower/wtpolicy: add ComputeRewardOutputs
2019-02-01 17:19:33 -08:00
Conner Fromknecht
6b3691a86e
watchtower/wtpolicy: add ComputAltruistOutput calc
2019-02-01 17:19:27 -08:00
Conner Fromknecht
61e5a783e8
travis: use make travis-itest to perform linting
2019-01-31 23:47:15 -08:00
Conner Fromknecht
24dcd3c44e
peer+server: use server-wide writeBufferPool for peer write buffers
2019-01-31 19:21:36 -08:00
Conner Fromknecht
40c5e5e19f
lnpeer/write_buffer_pool_test: adds basic write buffer pool test
2019-01-31 19:21:35 -08:00
Conner Fromknecht
0670db2c3d
lnpeer/write_buffer_pool: adds write buffer pool
2019-01-31 19:21:34 -08:00
Conner Fromknecht
0118120f55
queue/gc_queue_test: adds unit tests for GCQueue
2019-01-31 19:21:32 -08:00
Conner Fromknecht
717672ad83
queue/gc_queue: adds GCQueue to back recyclable pools
2019-01-31 19:21:31 -08:00
Conner Fromknecht
9d20ca4a51
Merge pull request #2495 from halseth/itest-dont-shadow-prederr
...
[trivial] lnd_test: don't shadow predErr
2019-01-31 18:26:11 -08:00
Conner Fromknecht
9fe284923a
watchtower/wtserver: read RewardBase from CreateSession
2019-01-31 18:17:35 -08:00
Conner Fromknecht
46a86a863a
wtwire/create_session: add RewardBase field to CreateSession
2019-01-31 18:17:35 -08:00
Conner Fromknecht
26f4131102
watchtower/wtpolicy: add RewardBase to Policy
2019-01-31 18:17:35 -08:00
Conner Fromknecht
43120fd08c
watchtower/multi: move MockSigner+MockPeer to wtmock
2019-01-31 18:16:02 -08:00
Conner Fromknecht
245b76ab51
Makefile: lint all travis builds
...
Ensures we fail faster if the source code doesn't
pass the lint checks.
2019-01-31 15:36:56 -08:00
Conner Fromknecht
fd1bbe63cf
Merge pull request #2505 from cfromknecht/go-acc-coverage
...
build: more reliable coverage using go-acc
2019-01-29 12:45:28 -08:00
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
e0cf99c53d
Makefile: use go-acc for coverage
2019-01-23 17:42:52 -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