lnd.xprv/sweep
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
..
backend_mock_test.go sweep: add wallet inputs to reach dust limit 2019-12-17 22:00:39 +01:00
bucket_list.go sweep: add exclusive groups 2020-02-13 09:52:21 +01:00
defaults_rpctest.go sweep: add time-based sweeper 2018-12-18 10:50:17 +01:00
defaults.go sweep: add time-based sweeper 2018-12-18 10:50:17 +01:00
fee_estimator_mock_test.go chainfee: create new chainfee package extracting fees from lnwallet 2019-10-31 16:41:57 -07:00
interface.go trivial: typo fix 2020-03-19 05:43:49 +01:00
log.go multi: modify sweeper.CreateSweepTx to accept conf target, style changes 2018-10-18 18:08:27 -07:00
store_mock.go sweep: add sweeper store 2018-12-18 10:50:16 +01:00
store_test.go Merge pull request #4101 from ErikEk/typo_fixes_trivial 2020-03-19 21:36:38 +01:00
store.go sweep: convert to use new kvdb abstraction 2020-03-18 19:35:10 -07:00
sweeper_test.go Merge pull request #4101 from ErikEk/typo_fixes_trivial 2020-03-19 21:36:38 +01:00
sweeper.go Merge pull request #4101 from ErikEk/typo_fixes_trivial 2020-03-19 21:36:38 +01:00
test_utils.go multi: return input.Signature from SignOutputRaw 2020-04-10 14:27:35 -07:00
tx_input_set_test.go sweep: allow force sweeps 2020-01-15 16:56:44 +01:00
tx_input_set.go sweep: allow force sweeps 2020-01-15 16:56:44 +01:00
txgenerator_test.go input/size: assert witness size constants 2020-04-10 15:34:27 -07:00
txgenerator.go sweep: log sweep tx id and full list of inputs 2020-03-27 07:42:03 +01:00
walletsweep_test.go chainfee: create new chainfee package extracting fees from lnwallet 2019-10-31 16:41:57 -07:00
walletsweep.go trivial: typo fix 2020-03-19 05:43:49 +01:00