lnd.xprv/watchtower/wtclient
Conner Fromknecht c1b9b272cd
input/size: assert witness size constants
This commit introduces a new test case that asserts all of the witness
size constants currently in the codebase. We also reintroduce the
AcceptedHtlcSuccessWitnessSize and OfferedHtlcTimeoutWitnessSize
constants that were recently removed for the sake of completeness.

In asserting the witnes sizes, there were three uncovered discrepancies:
 * OfferedHtlcSuccessWitnessSize overestimated by about 30% because it
   included an extra signature in the calculation.

 * ToLocalPenaltyWitnessSize was underestimated by one byte, because it
   was missing the length byte for the OP_TRUE. This has implications
   the watchtower protocol since the client and server are assumed to
   share the same weight estimates used for signing. This commit keeps
   the current behavior, with the intention of rolling out negotiation
   for which weight estimate to use for a given session.

 * AcceptedHtlcScriptSize was underestimated by one byte because it was
   missing a length byte for the value 32 pushed on the stack when
   asserting the preimage's length. This affects all AcceptedHtlc*
   witness sizes.
2020-04-10 15:34:27 -07:00
..
backup_task_internal_test.go lnwallet: rename DelayKey->ToLocalKey, NoDelayKey->ToRemoteKey 2020-01-06 12:08:01 +01:00
backup_task.go input/size: assert witness size constants 2020-04-10 15:34:27 -07:00
candidate_iterator_test.go watchtower/wtclient: extend TowerCandidateIterator to update candidates 2019-07-30 15:13:24 -07:00
candidate_iterator.go watchtower/wtclient: extend TowerCandidateIterator to update candidates 2019-07-30 15:13:24 -07:00
client_test.go lnwallet: rename DelayKey->ToLocalKey, NoDelayKey->ToRemoteKey 2020-01-06 12:08:01 +01:00
client.go watchtower+htlcswitch: update client tower logic to recognize safu commitments 2019-09-25 18:25:55 -07:00
derivation.go keychain/derivation: adds watchtower session key family 2019-04-23 20:03:48 -07:00
errors.go multi: fix spelling mistakes 2019-05-04 15:35:37 -07:00
interface.go watchtower: extend client databse with CRUD operations for towers 2019-07-30 15:13:23 -07:00
log.go watchtower/wtclient/log: adds wtclient logging 2019-03-15 02:30:35 -07:00
session_negotiator.go watchtower/wtclient: only reset iterator once we've exhausted all candidates 2019-07-30 15:18:18 -07:00
session_queue.go multi: remove dead code 2019-09-10 17:21:59 +02:00
stats.go watchtower/wtclient: extend TowerClient with CRUD operations for towers 2019-07-30 15:18:13 -07:00
task_pipeline.go watchtower/wtclient/task_pipeline: add reliable task aggregator 2019-03-15 02:31:50 -07:00