PR #159 adds a TXIN_BASE_WEIGHT constant, which represents the base weight of a Txin, not counting the weight needed for satisfaying it. At the moment this constant is calculated as:
// prev_txid (32 bytes) + prev_vout (4 bytes) + sequence (4 bytes) + script_len (1 bytes)
pub const TXIN_BASE_WEIGHT: usize = (32 + 4 + 4 + 1) * 4;
My doubt is: should the script_len be included in the calculation? Miniscript docs say that the satisfaction weight Includes the weight of the VarInts encoding the scriptSig and witness stack length. (see https://docs.rs/miniscript/3.0.0/miniscript/descriptor/enum.Descriptor.html#method.max_satisfaction_weight)
Removing the script_len (i.e. defining TXIN_BASE_WEIGHT as (32 + 4 + 4) * 4) causes electrs tests to fail (min relay fee not met, see .https://github.com/bitcoindevkit/bdk/runs/1336260689?check_suite_focus=true).
I'm trying to understand if there's something I'm not seeing, or if there's some bug in bdk, or if I should ask directly in miniscript repo :)
PR #159 adds a
TXIN_BASE_WEIGHTconstant, which represents thebase weight of a Txin, not counting the weight needed for satisfaying it. At the moment this constant is calculated as:My doubt is: should the
script_lenbe included in the calculation? Miniscript docs say that the satisfaction weightIncludes the weight of the VarInts encoding the scriptSig and witness stack length.(see https://docs.rs/miniscript/3.0.0/miniscript/descriptor/enum.Descriptor.html#method.max_satisfaction_weight)Removing the
script_len(i.e. definingTXIN_BASE_WEIGHTas(32 + 4 + 4) * 4) causes electrs tests to fail (min relay fee not met, see .https://github.com/bitcoindevkit/bdk/runs/1336260689?check_suite_focus=true).I'm trying to understand if there's something I'm not seeing, or if there's some bug in bdk, or if I should ask directly in miniscript repo :)