lnd.xprv/watchtower
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
..
blob watchtower/multi: define blob TypeAltruistCommit and TypeRewardCommit 2019-06-13 19:54:21 -07:00
lookout input/size: assert witness size constants 2020-04-10 15:34:27 -07:00
wtclient input/size: assert witness size constants 2020-04-10 15:34:27 -07:00
wtdb watchtower: convert to use new kvdb abstraction 2020-03-18 19:35:01 -07:00
wtmock multi: return input.Signature from SignOutputRaw 2020-04-10 14:27:35 -07:00
wtpolicy chainfee: create new chainfee package extracting fees from lnwallet 2019-10-31 16:41:57 -07:00
wtserver watchtower/multi: use sane sweep fee rate in unit tests 2019-06-13 19:54:22 -07:00
wtwire watchtower/wtwire/init: use feature.ValidateRequired 2020-01-08 12:26:00 -08:00
conf.go watchtower: add externalip CLI configuration 2019-06-20 17:04:03 -07:00
config.go lnd+server+watchtower: allow Standalone access to the tor controller 2020-03-29 12:36:54 -04:00
errors.go watchtower/conf: remove experimental conditional compilation 2019-06-13 19:54:19 -07:00
interface.go watchtower/conf: abstract address normalizer to prevent import cycle 2019-06-13 19:54:19 -07:00
log.go multi: remove dead code 2019-09-10 17:21:59 +02:00
standalone.go lnd+server+watchtower: allow Standalone access to the tor controller 2020-03-29 12:36:54 -04:00