lnd/watchtower/lookout
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
..
interface.go watchtower/multi: move BreachHint to blob pkg 2019-06-13 17:40:04 -07:00
justice_descriptor_test.go input/size: assert witness size constants 2020-04-10 15:34:27 -07:00
justice_descriptor.go input/size: assert witness size constants 2020-04-10 15:34:27 -07:00
log.go watchtower/lookout/log: adds lookout subsystem logger 2018-10-31 20:42:07 -07:00
lookout_test.go watchtower/multi: use sane sweep fee rate in unit tests 2019-06-13 19:54:22 -07:00
lookout.go watchtower/lookout: fix double-hex encoded chainhash 2019-11-05 15:05:20 -08:00
mock.go watchtower/lookout/mock: adds mock backend 2018-10-31 20:42:14 -07:00
punisher.go multi: remove ErrDoubleSpend check for PublishTransaction 2019-03-13 17:57:19 -07:00