lnd.xprv/lnrpc/signrpc
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
..
config_active.go signrpc+subserver: add key chain to signer 2019-12-10 09:48:13 +01:00
config_default.go lnrpc/signrpc: add lnrpc.SubServerDriver for signrpc 2018-11-28 20:57:03 -08:00
driver.go lnrpc/signrpc: add lnrpc.SubServerDriver for signrpc 2018-11-28 20:57:03 -08:00
log.go multi: remove dead code 2019-09-10 17:21:59 +02:00
signer_server.go input/size: assert witness size constants 2020-04-10 15:34:27 -07:00
signer.pb.go lnrpc: run clang-format 2020-03-10 20:19:08 +01:00
signer.proto lnrpc: run clang-format 2020-03-10 20:19:08 +01:00