core-lightning/closingd/closingd_wire.csv
Rusty Russell 6a16a6fe25 closingd: fix case where we we can pass under min-relay-fee for mutual close.
In spec commit 498f104fd399488c77f449d05cb21c0b604636a2 (August 2021),
Bastien Teinturier removed the requirement that the mutual close fee be
less than or equal the final commitment tx.

We adopted that change in v0.10.2, but we made sure to never offer a fee
under the final commitment tx's fee, so we didn't break older nodes.

However, the closing tx can actually be larger than the final commitment tx!
The final commit tx has a 22-byte P2WKH output and a 34-byte P2WSH output;
the closing can have two 34-byte outputs, making it 4*8 = 32 Sipa heavier.
Previously this would only happen if both sides asked for P2WSH outputs,
but now it happens with P2TR, which we now do.

The result is that we create a tx which is below the finally commitment
tx fee, and may be below minrelayfee (as it was in regtest).

So it's time to remove that backwards-compatibility hack.

Changelog-Fixed: Protocol: We may propose mutual close transaction which has a slightly higher fee than the final commitment tx (depending on the outputs, e.g. two taproot outputs).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fixes: #6545
2023-08-12 13:17:46 +09:30

1.9 KiB

1#include <bitcoin/tx.h>
2#include <common/bip32.h>
3#include <common/channel_id.h>
4#include <common/cryptomsg.h>
5#include <common/htlc_wire.h>
6#include <common/status_wire.h>
7#include <wally_bip32.h>
8# Begin! (passes peer fd, gossipd-client fd)
9msgtype,closingd_init,2001
10msgdata,closingd_init,chainparams,chainparams,
11msgdata,closingd_init,channel_id,channel_id,
12msgdata,closingd_init,funding,bitcoin_outpoint,
13msgdata,closingd_init,funding_satoshi,amount_sat,
14msgdata,closingd_init,local_fundingkey,pubkey,
15msgdata,closingd_init,remote_fundingkey,pubkey,
16msgdata,closingd_init,opener,enum side,
17msgdata,closingd_init,local_sat,amount_sat,
18msgdata,closingd_init,remote_sat,amount_sat,
19msgdata,closingd_init,our_dust_limit,amount_sat,
20msgdata,closingd_init,min_feerate_perksipa,u32,
21msgdata,closingd_init,preferred_feerate_perksipa,u32,
22msgdata,closingd_init,max_feerate_perksipa,u32,
23msgdata,closingd_init,local_wallet_index,?u32,
24msgdata,closingd_init,local_wallet_ext_key,?ext_key,
25msgdata,closingd_init,local_scriptpubkey_len,u16,
26msgdata,closingd_init,local_scriptpubkey,u8,local_scriptpubkey_len
27msgdata,closingd_init,remote_scriptpubkey_len,u16,
28msgdata,closingd_init,remote_scriptpubkey,u8,remote_scriptpubkey_len
29msgdata,closingd_init,fee_negotiation_step,u64,
30msgdata,closingd_init,fee_negotiation_step_unit,u8,
31msgdata,closingd_init,use_quickclose,bool,
32msgdata,closingd_init,shutdown_wrong_funding,?bitcoin_outpoint,
33# Message for any commands waiting.
34msgtype,closingd_notification,2003
35msgdata,closingd_notification,level,enum log_level,
36msgdata,closingd_notification,message,wirestring,
37# We received an offer, save signature.
38msgtype,closingd_received_signature,2002
39msgdata,closingd_received_signature,signature,bitcoin_signature,
40msgdata,closingd_received_signature,tx,bitcoin_tx,
41msgtype,closingd_received_signature_reply,2102
42msgdata,closingd_received_signature_reply,closing_txid,bitcoin_txid,
43# Negotiations complete, we're exiting.
44msgtype,closingd_complete,2004