This PR is a late follow-up for #30162, where I retrospectively consider the padding unit of choice as a mistake. The weight unit is merely a consensus rule detail and is largely irrelevant from a user’s perspective w.r.t. fee-rate calculations and mempool policy rules (e.g. for package relay and TRUC limits), so there doesn’t seem to be any value of using a granularity that we can’t even guarantee to reach exactly anyway.
Switch to the more natural unit of vsize instead, which simplifies both the padding implementation (no “round up to the next multiple of 4” anymore) and the current tests that take use of this padding. The rather annoying multiplications by WITNESS_SCALE_FACTOR
can then be removed and weird-looking magic numbers like 4004
can be replaced by numbers that are more connected to actual policy limit constants from the codebase, e.g. 1001
for exceeding TRUC_CHILD_MAX_VSIZE
by one. The second commits introduces a constant for that.