Skip to content

Commit 9e2a61a

Browse files
tankyleocarlaKC
andcommitted
Revert HTLC transactions in 0FC channels back to Version::TWO
Otherwise, we could potentially hit the max 10_000vB size limit on V3 transactions (BIP 431 rule 4) if we aggregate enough HTLC-claims together. For now in 0FC channels, we do not aggregate HTLC-claims with the P2A-anchor-claim, and wait for the commitment transaction to be fully confirmed before broadcasting HTLC claims (which is the same behavior as in keyed-anchor channels). There is hence no need for HTLC transactions to be V3. Note that the counterparty signature on the HTLC transaction *does* commit to the version of the transaction. Co-authored-by: Carla Kirk-Cohen <[email protected]>
1 parent a0e25b6 commit 9e2a61a

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

lightning/src/events/bump_transaction/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -855,11 +855,7 @@ where
855855
.transaction_parameters
856856
.channel_type_features;
857857
let mut htlc_tx = Transaction {
858-
version: if channel_type.supports_anchor_zero_fee_commitments() {
859-
Version::non_standard(3)
860-
} else {
861-
Version::TWO
862-
},
858+
version: Version::TWO,
863859
lock_time: tx_lock_time,
864860
input: vec![],
865861
output: vec![],

lightning/src/ln/chan_utils.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -830,14 +830,8 @@ pub fn build_htlc_transaction(
830830
revocation_key,
831831
)];
832832

833-
let version = if channel_type_features.supports_anchor_zero_fee_commitments() {
834-
Version::non_standard(3)
835-
} else {
836-
Version::TWO
837-
};
838-
839833
Transaction {
840-
version,
834+
version: Version::TWO,
841835
lock_time: LockTime::from_consensus(if htlc.offered { htlc.cltv_expiry } else { 0 }),
842836
input: txins,
843837
output: txouts,

lightning/src/ln/monitor_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2889,7 +2889,7 @@ fn do_test_anchors_aggregated_revoked_htlc_tx(p2a_anchor: bool) {
28892889
}],
28902890
};
28912891
let mut htlc_tx = Transaction {
2892-
version: if p2a_anchor { Version::non_standard(3) } else { Version::TWO },
2892+
version: Version::TWO,
28932893
lock_time: LockTime::ZERO,
28942894
input: vec![TxIn { // Fee input
28952895
previous_output: bitcoin::OutPoint { txid: coinbase_tx.compute_txid(), vout: 0 },

0 commit comments

Comments
 (0)