Conner Fromknecht
fad8932d75
watchtower/multi: fix logging in wtclient
2019-06-19 19:57:59 -07:00
Conner Fromknecht
059887bd7b
watchtower/wtdb: apply sanity checks to session policy before accepting
2019-06-13 19:54:22 -07:00
Conner Fromknecht
1979f9a7c0
watchtower/multi: use sane sweep fee rate in unit tests
2019-06-13 19:54:22 -07:00
Conner Fromknecht
a543c781fe
watchtower/wtpolicy: add basic validity constraints
2019-06-13 19:54:22 -07:00
Conner Fromknecht
37052f1561
watchtower/wtdb: only accept properly sized blobs
...
Modifies the bbolt and mock tower databases to only accept blobs that
are the expected size of the session's blob type. This prevents resource
exhaustion attacks where a client may provide disproportionately large
encrypted blob, even though all supported blob types are of fixed-size.
2019-06-13 19:54:22 -07:00
Conner Fromknecht
dce24d1d47
watchtower/wtdb+wtserver: pass properly sized blob in unit tests
2019-06-13 19:54:22 -07:00
Conner Fromknecht
29009fdc34
watchtower/standalone: disable reward towers
2019-06-13 19:54:22 -07:00
Conner Fromknecht
6504058c74
watchtower/wtserver: add DisableReward config option
2019-06-13 19:54:21 -07:00
Conner Fromknecht
a246d8216a
watchtower/multi: define blob TypeAltruistCommit and TypeRewardCommit
2019-06-13 19:54:21 -07:00
Conner Fromknecht
2d47618055
watchtower/multi: define AltruistSessions feature bit as 0/1
2019-06-13 19:54:21 -07:00
Conner Fromknecht
86e1d111e5
watchtower/wtwire/message: bump wtwire messages outside reserved ranges
...
BOLT01 reserves the following ranges:
- Setup & Control (types 0-31)
- Channel (types 32-127)
- Commitment (types 128-255)
- Routing (types 256-511)
The wtwire messages now occupy 600-607.
2019-06-13 19:54:21 -07:00
Conner Fromknecht
7cabe2667f
watchtower/wtclient/client: use existing session with same TxPolicy
...
This commit modifies the client's filtering when selecting from existing
sessions. The new logic compares the configured TxPolicy with the
TxPolicy of the candidate sessions, which has the effect of ignoring
operational parameters such as MaxUpdates. Prior, changing MaxUpdates
would cause the client to request a new session even if it had perfectly
good slots available in a policy with an equal TxPolicy.
2019-06-13 19:54:21 -07:00
Conner Fromknecht
98c2d329e5
watchtower/multi: embed TxPolicy in wtpolicy.Policy
...
This commit splits out the parameters that shape the justice transaction
into their own struct, which then embedded within the overarching
wtpolicy.Policy which may have additional parameters describing
operation of the session.
This is done as a preliminary step to support comparison of sessions
based on matching TxPolicy configurations. This prevents otherwise
identical Policies from being counted as different if operational
parameters like MaxUpdates differ, even if it has no material difference
to the justice transaction.
2019-06-13 19:54:20 -07:00
Conner Fromknecht
9b365567b6
watchtower/wtclient/client: avoid over requesting sessions
...
This commit fixes a bug that would cause us to request more sessions
that needed from the session negotiator. With the current stat ticker,
we'd ask the negotiator for a new session every 30s if session
session negotiation did not return before printing the stats. Now we'll
avoid requesting to sessions by jumping back into the select loop.
2019-06-13 19:54:20 -07:00
Conner Fromknecht
c823878154
watchtower/conf: abstract address normalizer to prevent import cycle
2019-06-13 19:54:19 -07:00
Conner Fromknecht
db65d7ead4
watchtower/conf: remove experimental conditional compilation
2019-06-13 19:54:19 -07:00
Conner Fromknecht
d2f3d5ef6c
server: add watchtower client
2019-06-13 19:54:18 -07:00
Conner Fromknecht
ab4a4b77f5
watchtower/wtclient/session_queue: unify logging
2019-06-13 19:54:17 -07:00
Conner Fromknecht
3b51906a78
watchtower/multi: use new blob.BreachKey for enc/dec of justice kits
2019-06-13 19:54:17 -07:00
Conner Fromknecht
59bf4857f4
watchtower/blob/breach_key: define breach key as sha(txid || txid)
2019-06-13 19:33:16 -07:00
Conner Fromknecht
d9cfa610dc
watchtower/wtdb/breach_hint: redefine breach hint as sha(txid)
2019-06-13 19:33:16 -07:00
Conner Fromknecht
1b89ba1782
watchtower/multi: move BreachHint to blob pkg
2019-06-13 17:40:04 -07:00
Conner Fromknecht
28bf49807e
watchtower/wtdb: add CSessionStatus field to ClientSession
...
This commit adds persisted status bit-field to ClientSessions, that can
be used to modify behavior of their handling in the client. Currently,
only a default CSessionActive status is defined. However, the intention
is that this could later be used to signal that a session is abandoned
without needing to perform a db migration to add the field. As we move
forward with testing, this will likely be useful if a session gets
borked and we need a simple method of the client to temporarily ignore
certain sessions.
The field may be useful in signaling other types of status changes,
though this was the primary motivation that warranted the addition.
2019-05-24 18:24:41 -07:00
Conner Fromknecht
9157c88f93
watchtower/wtclient: dedup backups across restarts
...
Now that the committed and acked updates are persisted across restarts,
we will use them to filter out duplicate commit heights presented by the
client.
2019-05-24 18:24:41 -07:00
Conner Fromknecht
3be651b0b3
watchtower/wtdb: add ClientDB
...
This commit adds the full bbolt-backed client database as well as a set
of unit tests to assert that it exactly implements the same behavior as
the mock ClientDB.
2019-05-24 18:24:41 -07:00
Conner Fromknecht
b35a5b8892
watchtower/wtclient: integrate ClientChannelSummaries
...
In this commit, we utilize the more generic ClientChanSummary instead of
exposing methods that only allow us to set and fetch sweep pkscripts.
2019-05-23 20:48:50 -07:00
Conner Fromknecht
25fc464a6e
watchtower/wtdb/client_chan_summary: add ClientChanSummary
...
A ClientChanSummary will be inserted for each channel registered with
the client, which for now will just track the sweep pkscript to use. In
the future, this will be extended with additional information to enable
the client to efficiently compute which historical states need to be
backed up under a given policy.
2019-05-23 20:48:36 -07:00
Conner Fromknecht
440ae7818a
watchtower/wtmock/client_db: adjust mock clientdb behavior
...
In advance of the upcoming wtdb.ClientDB, we'll modify the behavior
of the mockdb to be more like the final bbolt backed one, and assert
that all or our tests are still passing.
2019-05-23 20:48:23 -07:00
Conner Fromknecht
2a904cb69f
watchtower/wtdb: add Encode/Decode methods to wtclient structs
2019-05-23 20:48:08 -07:00
Conner Fromknecht
1db9bf2fd4
watchtower/wtdb: create embedded ClientSessionBody
...
This commit splits out the portions of the ClientSession into an
embedded ClientSessionBody, since these fields will be serialized
together on-disk.
2019-05-23 20:47:49 -07:00
Conner Fromknecht
5ad9530502
watchtower/wtdb: return sorted ClientSession.CommittedUpdates
...
This commit replaces the map-based CommittedUpdates field with a slice.
When reading from disk, these will already be sorted by bbolt, so the
client restore the updates as presented without needing to sort them
first.
Since the key in the map variant was the sequence number, we refactor
the CommittedUpdate struct to have a sequence number and an embedded
CommittedUpdateBody (which is equivalent to the old CommittedUpdate).
The database is then expected to populate the sequence number from the
key on disk.
Since the sequence number is now directly integrated in the
CommittedUpdate struct, this allow allows us to remove the now redundant
seqNum argument from CommitUpdate.
2019-05-23 20:47:36 -07:00
Conner Fromknecht
3509c0c991
watchtower/multi: use proper TowerID type
...
This allows serialization methods to be added with TowerID method
receivers.
2019-05-23 20:47:22 -07:00
Conner Fromknecht
ec7c16fdc1
watchtower/wtdb: prepare for addition of client db
...
This commit renames the variables dbName to towerDBName and dbVersions
to towerDBVersions, to distinguish between the upcoming clientDBName
clientDBVersions. We also move resusable portions of the database
initialization and default endianness to its own file so that it can be
shared between both tower and client databases.
2019-05-23 20:47:08 -07:00
Conner Fromknecht
17b2140cb5
multi: fix spelling mistakes
2019-05-04 15:35:37 -07:00
Conner Fromknecht
54c908be1a
watchtower/wtserver/create_session: log missing error in create session
2019-04-26 17:22:02 -07:00
Conner Fromknecht
b7cd70f186
watchtower/wtdb/tower_db_test: add mock+bolt iface tests
2019-04-26 17:21:48 -07:00
Conner Fromknecht
3ef2a36733
watchtower/wtdb/tower_db: add TowerDB and db versioning
2019-04-26 17:21:35 -07:00
Conner Fromknecht
c99d1313fe
watchtower/wtdb/log: add WTDB logs
2019-04-26 17:21:20 -07:00
Conner Fromknecht
a36397e21a
watchtower/wtdb/codec_test: encode/decode quick checks
2019-04-26 17:21:05 -07:00
Conner Fromknecht
7ba197c6a7
watchtower/wtdb: add encode/decode to session info + updates
2019-04-26 17:20:52 -07:00
Conner Fromknecht
dccef4c8bf
watchtower/wtdb/codec: import channeldb code for extension
2019-04-26 17:20:36 -07:00
Conner Fromknecht
2ce6228021
watchtower/wtmock/tower_db: move mock tower db to wtmock pkg
2019-04-26 17:19:58 -07:00
Conner Fromknecht
d1ff783a9e
watchtower/wtclient/client_test: test no ack create session
2019-04-23 20:08:02 -07:00
Conner Fromknecht
71f72894f8
watchtower/wtclient/client: ensure dispatcher can force quit...
...
during session creation.
2019-04-23 20:07:46 -07:00
Conner Fromknecht
9603bfa602
watchtower/wtclient/session_negotiator: don't backoff on first attempt
2019-04-23 20:07:29 -07:00
Conner Fromknecht
1622a212d7
watchtower/wtserver: add NoAckCreateSession for testing
2019-04-23 20:07:12 -07:00
Conner Fromknecht
1000223c71
watchtower/wtwire/error_code: add DeleteSessionCodeNotFound string
2019-04-23 20:06:56 -07:00
Conner Fromknecht
590f5811e8
watchtower/wtserver/server: print connFailure error code name
2019-04-23 20:06:38 -07:00
Conner Fromknecht
ec6e2010d6
watchtower/wtmock: validate key index reservation
2019-04-23 20:06:20 -07:00
Conner Fromknecht
978a0a8de6
watchtower/wtserver/server: permit unused session overrwite
2019-04-23 20:06:04 -07:00
Conner Fromknecht
9b1bc9fd79
watchtower/wtwire/create_session_reply: return last applied
2019-04-23 20:05:47 -07:00
Conner Fromknecht
9aa775e64e
watchtower/wtserver/server: only generate addrs for reward sessions
2019-04-23 20:05:29 -07:00
Conner Fromknecht
999cbbdc54
watchtower/wtserver/server: check blob type first
2019-04-23 20:05:12 -07:00
Conner Fromknecht
bebe6461a9
watchtower/wtclient: use HD session key derivation
2019-04-23 20:04:55 -07:00
Conner Fromknecht
0404aedede
watchtower/wtclient/interface+wtmock: add session key reservation
2019-04-23 20:04:40 -07:00
Conner Fromknecht
df390df966
watchtower/wtmock/client_db: clone bytes w/ nil
2019-04-23 20:04:23 -07:00
Conner Fromknecht
c6f95c5667
watchtower/wtdb/client_session: replace keydesc w/ KeyIndex
2019-04-23 20:04:06 -07:00
Conner Fromknecht
2f9f46cf24
keychain/derivation: adds watchtower session key family
2019-04-23 20:03:48 -07:00
Conner Fromknecht
3af6eafc8e
watchtower/wtclient/interface: add SecretKeyRing iface
2019-04-23 20:03:15 -07:00
Conner Fromknecht
7d99005dde
watchtower/wtclient/interface: add LoadTower and mock impl
2019-04-23 19:17:21 -07:00
Olaoluwa Osuntokun
8e3a8f2d01
watchtower/wtclient: fix linter issue
2019-03-20 19:36:59 -07:00
Conner Fromknecht
0c519778a1
watchtower/wtserver/server_test: add TestServerDeleteSession
2019-03-19 19:41:17 -07:00
Conner Fromknecht
3564406dc1
watchtower/wtserver/server_test: cleanup test framework, remove test case indexes
2019-03-19 19:38:57 -07:00
Conner Fromknecht
26adf735c4
watchtower/wtserver: add DeleteSession handler
2019-03-19 19:38:46 -07:00
Conner Fromknecht
8e4a20e1a5
watchtower/wtserver/interface: add DeleteSession + mock impl
2019-03-19 19:38:34 -07:00
Conner Fromknecht
25b2a352cb
watchtower/wtserver: refactor server handlers into own files
2019-03-19 19:38:20 -07:00
Conner Fromknecht
3d934d0978
watchtower/wtwire: add DeleteSession and DeleteSessionReply message
2019-03-19 19:38:09 -07:00
Conner Fromknecht
05e3a7f6c0
watchtower/wtmock/peer: set local pubkey
2019-03-15 02:34:00 -07:00
Conner Fromknecht
80040d9d96
watchtower/wtclient/client_test: adds client-server upload test
2019-03-15 02:33:47 -07:00
Conner Fromknecht
e1e805d1b8
watchtower/wtserver/server: fix race condition on Stop
2019-03-15 02:33:33 -07:00
Conner Fromknecht
a222a63d81
watchtower/wtserver/server: no ack updates
2019-03-15 02:33:20 -07:00
Conner Fromknecht
8b0cc487f0
watchtower/wtdb+wtserver: allow retransmission of last update
2019-03-15 02:33:06 -07:00
Conner Fromknecht
81497eceaf
watchtower/wtmock/peer: create mock net.Conn using bidi MockPeer
2019-03-15 02:32:53 -07:00
Conner Fromknecht
87e8700c5d
watchtower/wtmock/client_db: add mock client db
2019-03-15 02:32:40 -07:00
Conner Fromknecht
f00b4c5e96
watchtower/wtclient/client: hook up full client pipeline
2019-03-15 02:32:27 -07:00
Conner Fromknecht
abef9e09e7
watchtower/wtclient/stats: adds clientStats
2019-03-15 02:32:15 -07:00
Conner Fromknecht
aa2b21117c
watchtower/wtclient/session_queue: batch upload state updates
2019-03-15 02:32:02 -07:00
Conner Fromknecht
65d09fca64
watchtower/wtclient/task_pipeline: add reliable task aggregator
2019-03-15 02:31:50 -07:00
Conner Fromknecht
95fa7659e0
watchtower/wtclient/session_negotiator: add session negotiation
2019-03-15 02:31:37 -07:00
Conner Fromknecht
a8721bcedf
watchtower/wtclient/tower_candidate_iterator: linked-list iterator
2019-03-15 02:31:24 -07:00
Conner Fromknecht
b23bff62d5
watchtower/wtclient/errors
2019-03-15 02:31:11 -07:00
Conner Fromknecht
4642954e72
watchtower/wtclient/backup_task: bind to ClientSession instead of SessionInfo
2019-03-15 02:30:59 -07:00
Conner Fromknecht
b1903451d9
watchtower/wtclient/interface: add DB ifaces
2019-03-15 02:30:47 -07:00
Conner Fromknecht
04bbf39f51
watchtower/wtclient/log: adds wtclient logging
2019-03-15 02:30:35 -07:00
Conner Fromknecht
9177358a3c
watchtower/wtdb/client_session: add ClientSession
2019-03-15 02:30:22 -07:00
Conner Fromknecht
247978dfe2
watchtower/wtdb/tower: store wt pk and addrs
2019-03-15 02:30:09 -07:00
Conner Fromknecht
99dbbf48aa
watchtower/wtwire/error_code: add human-readable descriptors
2019-03-15 02:29:55 -07:00
Conner Fromknecht
9c70f49901
watchtower/wtwire/create_session_reply: remove extra Reject from code
2019-03-15 02:29:42 -07:00
Wilmer Paulino
7946d0a256
multi: remove ErrDoubleSpend check for PublishTransaction
...
In this commit, we address a lingering issue within some subsystems that
are responsible for broadcasting transactions. Previously,
ErrDoubleSpend indicated that a transaction was already included in the
mempool/chain. This error was then modified to actually be returned for
conflicting transactions, but its callers were not modified accordingly.
This would lead to conflicting transactions to be interpreted as valid,
when they shouldn't be.
2019-03-13 17:57:19 -07: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
Olaoluwa Osuntokun
f4dfcc35aa
Merge pull request #2606 from cfromknecht/wtwire-init-connection-features
...
watchtower/multi: send connection features + chain hash in Init
2019-02-08 18:48:54 -08:00
Olaoluwa Osuntokun
16d69e8551
Merge pull request #2605 from cfromknecht/wtwire-uniform-feature-names
...
watchtower/wtwire/features: make wtwire features uniform
2019-02-08 18:39:37 -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
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
Olaoluwa Osuntokun
55ed7769a5
Merge pull request #2514 from cfromknecht/add-wtmock-pkg
...
watchtower/multi: move MockSigner+MockPeer to wtmock
2019-01-31 19:13:47 -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
Joost Jager
9e012ecc93
multi: move Input interface and related code
...
This commit is a step to split the lnwallet package. It puts the Input
interface and implementations in a separate package along with all their
dependencies from lnwallet.
2019-01-31 13:25:33 +01:00
Conner Fromknecht
f78319d32c
watchtower/wtserver/server: return valid reward script
2019-01-17 22:19:28 -08:00
Olaoluwa Osuntokun
099d260318
Merge pull request #2320 from cfromknecht/wtpolicy
...
[watchtower] add wtpolicy.Policy and wtserver message logging
2019-01-16 14:05:59 -08:00
Olaoluwa Osuntokun
5b2afaff8f
Merge pull request #2448 from cfromknecht/watchtower-pkg
...
watchtower pkg
2019-01-15 20:01:50 -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
7a8669a531
watchtower/log: add WTWR subsystem logger
2019-01-14 19:42:33 -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
bb8469d8ee
watchtower/lookout: correct txid + session id logging
2019-01-07 19:20:45 -08:00
Conner Fromknecht
226640aa3c
watchtower/wtwire/wtwire: fix missed error handling
2018-12-06 15:49:53 -08:00
Olaoluwa Osuntokun
00001e7dad
watchtower: fix linter errors
2018-11-29 21:26:02 -08:00
Olaoluwa Osuntokun
fd82200a15
Merge pull request #2140 from cfromknecht/wtserver-move
...
[watchtower/wtserver] rename server package, add godocs, general code health
2018-11-28 15:07:01 -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
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
712e7f08f0
watchtower/server/server_test: add test vectors for server behavior
2018-10-24 20:18:22 -07:00
Conner Fromknecht
db4c4488c5
watchtower/server/mock: create MockPeer for debug build
2018-10-24 20:18:22 -07:00
Conner Fromknecht
48643a1747
watchtower/server/interface: adds Server, Peer and DB
2018-10-24 20:18:22 -07:00
Conner Fromknecht
a3e1bb15c5
watchtower/server/log: adds wt SRVR sublogger
2018-10-24 20:18:21 -07:00
Conner Fromknecht
73709530e3
watchtower/server/server: server skeleton
2018-10-24 20:18:21 -07:00
Conner Fromknecht
fd6024c306
watchtower/wtdb/mock: adds MockDB for debug build
2018-10-24 20:18:21 -07:00
Conner Fromknecht
8b47a96459
watchtower/wtdb/session_state_update: adds session state
2018-10-24 20:18:21 -07:00
Conner Fromknecht
405838d29c
watchtower/wtdb/session_info: adds SessionInfo
2018-10-24 20:18:21 -07:00
Conner Fromknecht
e825a756f4
watchtower/wtdb/session_id: adds SessoinID, client pubkey
2018-10-24 20:18:21 -07:00
Conner Fromknecht
bc86ccf212
watchtower/wtdb/breach_hint: adds BreachHint, txid prefix
2018-10-24 20:18:17 -07:00
Conner Fromknecht
8acd13a094
watchtower/wtwire/wtwire_test: adds quick tests wtwire msgs
2018-10-23 18:28:30 -07:00
Conner Fromknecht
42a4b373a6
watchtower/wtwire/state_update_reply: ack w/ highest seqnum or error
2018-10-23 18:28:28 -07:00
Conner Fromknecht
fdd3ad3149
watchtower/wtwire/state_update: sends encrypted blobs
2018-10-23 18:28:27 -07:00
Conner Fromknecht
216c77e10e
watchtower/wtwire/create_session_reply: accept/deny session init
2018-10-23 18:28:26 -07:00
Conner Fromknecht
71541bc94e
watchtower/wtwire/create_session: propose new session
2018-10-23 18:28:25 -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
49b2a3bdb5
watchtower/wtwire/message: define wtwire message interface
2018-10-23 18:28:18 -07:00
Conner Fromknecht
4325d9ec1e
watchtower/wtwire/wtwire: add watchtower message codec
2018-10-23 18:23:08 -07:00
Conner Fromknecht
085e1f9ca8
watchtower/blob/justice_kit_test: add encrypt/decrypt test vectors
2018-07-24 19:55:07 -07:00
Conner Fromknecht
9749096403
watchtower/blob/justice_kit: adds v0 encoding and encryption
2018-07-24 19:55:07 -07:00