Skip to content

Commit 747788b

Browse files
committed
Remove TaprootChannelSigner
We plan to have a single channel signer type going forward, so this is unnecessary.
1 parent 59ac8aa commit 747788b

11 files changed

Lines changed: 5 additions & 451 deletions

File tree

fuzz/src/chanmon_consistency.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,6 @@ impl NodeSigner for KeyProvider {
447447

448448
impl SignerProvider for KeyProvider {
449449
type EcdsaSigner = TestChannelSigner;
450-
#[cfg(taproot)]
451-
type TaprootSigner = TestChannelSigner;
452450

453451
fn generate_channel_keys_id(&self, _inbound: bool, _user_channel_id: u128) -> [u8; 32] {
454452
let id = self.rand_bytes_id.fetch_add(1, atomic::Ordering::Relaxed) as u8;

fuzz/src/full_stack.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,6 @@ impl NodeSigner for KeyProvider {
457457

458458
impl SignerProvider for KeyProvider {
459459
type EcdsaSigner = TestChannelSigner;
460-
#[cfg(taproot)]
461-
type TaprootSigner = TestChannelSigner;
462460

463461
fn generate_channel_keys_id(&self, inbound: bool, _user_channel_id: u128) -> [u8; 32] {
464462
let ctr = self.counter.fetch_add(1, Ordering::Relaxed) as u8;

fuzz/src/onion_message.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,6 @@ impl NodeSigner for KeyProvider {
296296

297297
impl SignerProvider for KeyProvider {
298298
type EcdsaSigner = TestChannelSigner;
299-
#[cfg(taproot)]
300-
type TaprootSigner = TestChannelSigner;
301299

302300
fn generate_channel_keys_id(&self, _inbound: bool, _user_channel_id: u128) -> [u8; 32] {
303301
unreachable!()

lightning-background-processor/src/lib.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -378,18 +378,11 @@ type DynMessageRouter = lightning::onion_message::messenger::DefaultMessageRoute
378378
&'static (dyn EntropySource + Send + Sync),
379379
>;
380380

381-
#[cfg(all(not(c_bindings), not(taproot)))]
381+
#[cfg(not(c_bindings))]
382382
type DynSignerProvider = dyn lightning::sign::SignerProvider<EcdsaSigner = lightning::sign::InMemorySigner>
383383
+ Send
384384
+ Sync;
385385

386-
#[cfg(all(not(c_bindings), taproot))]
387-
type DynSignerProvider = (dyn lightning::sign::SignerProvider<
388-
EcdsaSigner = lightning::sign::InMemorySigner,
389-
TaprootSigner = lightning::sign::InMemorySigner,
390-
> + Send
391-
+ Sync);
392-
393386
#[cfg(not(c_bindings))]
394387
type DynChannelManager = lightning::ln::channelmanager::ChannelManager<
395388
&'static (dyn chain::Watch<lightning::sign::InMemorySigner> + Send + Sync),

lightning/src/ln/channel.rs

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,8 +2229,6 @@ where
22292229
splice_input_index as usize,
22302230
&context.secp_ctx,
22312231
),
2232-
#[cfg(taproot)]
2233-
ChannelSignerType::Taproot(_) => todo!(),
22342232
};
22352233
Some(sig)
22362234
} else {
@@ -5988,13 +5986,9 @@ impl<SP: SignerProvider> ChannelContext<SP> {
59885986

59895987
// We sign "counterparty" commitment transaction, allowing them to broadcast the tx if they wish.
59905988
let signature = match &self.holder_signer {
5991-
// TODO (arik): move match into calling method for Taproot
59925989
ChannelSignerType::Ecdsa(ecdsa) => ecdsa.sign_counterparty_commitment(
59935990
channel_parameters, &counterparty_initial_commitment_tx, Vec::new(), Vec::new(), &self.secp_ctx
59945991
).ok(),
5995-
// TODO (taproot|arik)
5996-
#[cfg(taproot)]
5997-
_ => todo!()
59985992
};
59995993

60005994
if signature.is_some() && self.signer_pending_funding {
@@ -6104,7 +6098,6 @@ impl<SP: SignerProvider> ChannelContext<SP> {
61046098
);
61056099
let counterparty_initial_commitment_tx = commitment_data.tx;
61066100
match self.holder_signer {
6107-
// TODO (taproot|arik): move match into calling method for Taproot
61086101
ChannelSignerType::Ecdsa(ref ecdsa) => {
61096102
let channel_parameters = &funding.channel_transaction_parameters;
61106103
ecdsa
@@ -6117,9 +6110,6 @@ impl<SP: SignerProvider> ChannelContext<SP> {
61176110
)
61186111
.ok()
61196112
},
6120-
// TODO (taproot|arik)
6121-
#[cfg(taproot)]
6122-
_ => todo!(),
61236113
}
61246114
}
61256115

@@ -8427,9 +8417,6 @@ where
84278417
ChannelError::close("Failed to validate revocation from peer".to_owned())
84288418
})?;
84298419
},
8430-
// TODO (taproot|arik)
8431-
#[cfg(taproot)]
8432-
_ => todo!(),
84338420
};
84348421

84358422
self.context
@@ -10384,9 +10371,6 @@ where
1038410371
&self.context.secp_ctx,
1038510372
)
1038610373
.ok(),
10387-
// TODO (taproot|arik)
10388-
#[cfg(taproot)]
10389-
_ => todo!(),
1039010374
};
1039110375
if sig.is_none() {
1039210376
log_trace!(logger, "Closing transaction signature unavailable, waiting on signer");
@@ -11505,10 +11489,7 @@ where
1150511489
node_signature: our_node_sig,
1150611490
bitcoin_signature: our_bitcoin_sig,
1150711491
})
11508-
},
11509-
// TODO (taproot|arik)
11510-
#[cfg(taproot)]
11511-
_ => todo!()
11492+
}
1151211493
}
1151311494
}
1151411495

@@ -11538,10 +11519,7 @@ where
1153811519
bitcoin_signature_2: if were_node_one { their_bitcoin_sig } else { our_bitcoin_sig },
1153911520
contents: announcement,
1154011521
})
11541-
},
11542-
// TODO (taproot|arik)
11543-
#[cfg(taproot)]
11544-
_ => todo!()
11522+
}
1154511523
}
1154611524
} else {
1154711525
Err(ChannelError::Ignore("Attempted to sign channel announcement before we'd received announcement_signatures".to_string()))
@@ -11883,8 +11861,6 @@ where
1188311861
(Some(prev_funding_txid), ChannelSignerType::Ecdsa(ecdsa)) => {
1188411862
ecdsa.new_funding_pubkey(prev_funding_txid, &self.context.secp_ctx)
1188511863
},
11886-
#[cfg(taproot)]
11887-
_ => todo!(),
1188811864
};
1188911865

1189011866
let funding_feerate_per_kw = context.funding_feerate_sat_per_1000_weight;
@@ -11989,8 +11965,6 @@ where
1198911965
(Some(prev_funding_txid), ChannelSignerType::Ecdsa(ecdsa)) => {
1199011966
ecdsa.new_funding_pubkey(prev_funding_txid, &self.context.secp_ctx)
1199111967
},
11992-
#[cfg(taproot)]
11993-
_ => todo!(),
1199411968
};
1199511969
let mut new_keys = self.funding.get_holder_pubkeys().clone();
1199611970
new_keys.funding_pubkey = funding_pubkey;
@@ -12758,11 +12732,8 @@ where
1275812732
#[cfg(taproot)]
1275912733
partial_signature_with_nonce: None,
1276012734
})
12761-
},
12762-
// TODO (taproot|arik)
12763-
#[cfg(taproot)]
12764-
_ => todo!()
12765-
}
12735+
}
12736+
}
1276612737
}
1276712738

1276812739
/// Adds a pending outbound HTLC to this channel, and builds a new remote commitment
@@ -13319,15 +13290,11 @@ impl<SP: SignerProvider> OutboundV1Channel<SP> {
1331913290
&self.context.counterparty_next_commitment_point.unwrap(), false, false, logger);
1332013291
let counterparty_initial_commitment_tx = commitment_data.tx;
1332113292
let signature = match &self.context.holder_signer {
13322-
// TODO (taproot|arik): move match into calling method for Taproot
1332313293
ChannelSignerType::Ecdsa(ecdsa) => {
1332413294
let channel_parameters = &self.funding.channel_transaction_parameters;
1332513295
ecdsa.sign_counterparty_commitment(channel_parameters, &counterparty_initial_commitment_tx, Vec::new(), Vec::new(), &self.context.secp_ctx)
1332613296
.map(|(sig, _)| sig).ok()
1332713297
},
13328-
// TODO (taproot|arik)
13329-
#[cfg(taproot)]
13330-
_ => todo!()
1333113298
};
1333213299

1333313300
if signature.is_some() && self.context.signer_pending_funding {
@@ -15775,8 +15742,6 @@ mod tests {
1577515742
#[cfg(ldk_test_vectors)]
1577615743
impl SignerProvider for Keys {
1577715744
type EcdsaSigner = InMemorySigner;
15778-
#[cfg(taproot)]
15779-
type TaprootSigner = InMemorySigner;
1578015745

1578115746
fn generate_channel_keys_id(&self, _inbound: bool, _user_channel_id: u128) -> [u8; 32] {
1578215747
self.signer.channel_keys_id()

lightning/src/sign/mod.rs

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ use crate::util::transaction_utils;
6565
use crate::crypto::chacha20::ChaCha20;
6666
use crate::prelude::*;
6767
use crate::sign::ecdsa::EcdsaChannelSigner;
68-
#[cfg(taproot)]
69-
use crate::sign::taproot::TaprootChannelSigner;
7068
use crate::util::atomic_counter::AtomicCounter;
7169

7270
use core::convert::TryInto;
@@ -79,8 +77,6 @@ use musig2::types::{PartialSignature, PublicNonce};
7977
pub(crate) mod type_resolver;
8078

8179
pub mod ecdsa;
82-
#[cfg(taproot)]
83-
pub mod taproot;
8480
pub mod tx_builder;
8581

8682
pub(crate) const COMPRESSED_PUBLIC_KEY_SIZE: usize = bitcoin::secp256k1::constants::PUBLIC_KEY_SIZE;
@@ -1084,18 +1080,7 @@ impl<T: OutputSpender + ?Sized, O: Deref<Target = T>> OutputSpender for O {
10841080
/// A dynamic [`SignerProvider`] temporarily needed for doc tests.
10851081
///
10861082
/// This is not exported to bindings users as it is not intended for public consumption.
1087-
#[cfg(taproot)]
10881083
#[doc(hidden)]
1089-
#[deprecated(note = "Remove once taproot cfg is removed")]
1090-
pub type DynSignerProvider =
1091-
dyn SignerProvider<EcdsaSigner = InMemorySigner, TaprootSigner = InMemorySigner>;
1092-
1093-
/// A dynamic [`SignerProvider`] temporarily needed for doc tests.
1094-
///
1095-
/// This is not exported to bindings users as it is not intended for public consumption.
1096-
#[cfg(not(taproot))]
1097-
#[doc(hidden)]
1098-
#[deprecated(note = "Remove once taproot cfg is removed")]
10991084
pub type DynSignerProvider = dyn SignerProvider<EcdsaSigner = InMemorySigner>;
11001085

11011086
/// A trait that can return signer instances for individual channels.
@@ -1109,9 +1094,6 @@ pub type DynSignerProvider = dyn SignerProvider<EcdsaSigner = InMemorySigner>;
11091094
pub trait SignerProvider {
11101095
/// A type which implements [`EcdsaChannelSigner`] which will be returned by [`Self::derive_channel_signer`].
11111096
type EcdsaSigner: EcdsaChannelSigner;
1112-
#[cfg(taproot)]
1113-
/// A type which implements [`TaprootChannelSigner`]
1114-
type TaprootSigner: TaprootChannelSigner;
11151097

11161098
/// Generates a unique `channel_keys_id` that can be used to obtain a [`Self::EcdsaSigner`] through
11171099
/// [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow
@@ -1151,8 +1133,6 @@ pub trait SignerProvider {
11511133

11521134
impl<T: SignerProvider + ?Sized, SP: Deref<Target = T>> SignerProvider for SP {
11531135
type EcdsaSigner = T::EcdsaSigner;
1154-
#[cfg(taproot)]
1155-
type TaprootSigner = T::TaprootSigner;
11561136

11571137
fn generate_channel_keys_id(&self, inbound: bool, user_channel_id: u128) -> [u8; 32] {
11581138
self.deref().generate_channel_keys_id(inbound, user_channel_id)
@@ -1983,65 +1963,6 @@ impl EcdsaChannelSigner for InMemorySigner {
19831963
}
19841964
}
19851965

1986-
#[cfg(taproot)]
1987-
#[allow(unused)]
1988-
impl TaprootChannelSigner for InMemorySigner {
1989-
fn generate_local_nonce_pair(
1990-
&self, commitment_number: u64, secp_ctx: &Secp256k1<All>,
1991-
) -> PublicNonce {
1992-
todo!()
1993-
}
1994-
1995-
fn partially_sign_counterparty_commitment(
1996-
&self, counterparty_nonce: PublicNonce, commitment_tx: &CommitmentTransaction,
1997-
inbound_htlc_preimages: Vec<PaymentPreimage>,
1998-
outbound_htlc_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<All>,
1999-
) -> Result<(PartialSignatureWithNonce, Vec<schnorr::Signature>), ()> {
2000-
todo!()
2001-
}
2002-
2003-
fn finalize_holder_commitment(
2004-
&self, commitment_tx: &HolderCommitmentTransaction,
2005-
counterparty_partial_signature: PartialSignatureWithNonce, secp_ctx: &Secp256k1<All>,
2006-
) -> Result<PartialSignature, ()> {
2007-
todo!()
2008-
}
2009-
2010-
fn sign_justice_revoked_output(
2011-
&self, justice_tx: &Transaction, input: usize, amount: u64, per_commitment_key: &SecretKey,
2012-
secp_ctx: &Secp256k1<All>,
2013-
) -> Result<schnorr::Signature, ()> {
2014-
todo!()
2015-
}
2016-
2017-
fn sign_justice_revoked_htlc(
2018-
&self, justice_tx: &Transaction, input: usize, amount: u64, per_commitment_key: &SecretKey,
2019-
htlc: &HTLCOutputInCommitment, secp_ctx: &Secp256k1<All>,
2020-
) -> Result<schnorr::Signature, ()> {
2021-
todo!()
2022-
}
2023-
2024-
fn sign_holder_htlc_transaction(
2025-
&self, htlc_tx: &Transaction, input: usize, htlc_descriptor: &HTLCDescriptor,
2026-
secp_ctx: &Secp256k1<All>,
2027-
) -> Result<schnorr::Signature, ()> {
2028-
todo!()
2029-
}
2030-
2031-
fn sign_counterparty_htlc_transaction(
2032-
&self, htlc_tx: &Transaction, input: usize, amount: u64, per_commitment_point: &PublicKey,
2033-
htlc: &HTLCOutputInCommitment, secp_ctx: &Secp256k1<All>,
2034-
) -> Result<schnorr::Signature, ()> {
2035-
todo!()
2036-
}
2037-
2038-
fn partially_sign_closing_transaction(
2039-
&self, closing_tx: &ClosingTransaction, secp_ctx: &Secp256k1<All>,
2040-
) -> Result<PartialSignature, ()> {
2041-
todo!()
2042-
}
2043-
}
2044-
20451966
/// Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
20461967
/// 32-byte seed for use as a BIP 32 extended key and derives keys from that.
20471968
///
@@ -2548,8 +2469,6 @@ impl OutputSpender for KeysManager {
25482469

25492470
impl SignerProvider for KeysManager {
25502471
type EcdsaSigner = InMemorySigner;
2551-
#[cfg(taproot)]
2552-
type TaprootSigner = InMemorySigner;
25532472

25542473
fn generate_channel_keys_id(&self, _inbound: bool, user_channel_id: u128) -> [u8; 32] {
25552474
let child_idx = self.channel_child_index.fetch_add(1, Ordering::AcqRel);
@@ -2697,8 +2616,6 @@ impl OutputSpender for PhantomKeysManager {
26972616

26982617
impl SignerProvider for PhantomKeysManager {
26992618
type EcdsaSigner = InMemorySigner;
2700-
#[cfg(taproot)]
2701-
type TaprootSigner = InMemorySigner;
27022619

27032620
fn generate_channel_keys_id(&self, inbound: bool, user_channel_id: u128) -> [u8; 32] {
27042621
self.inner.generate_channel_keys_id(inbound, user_channel_id)

0 commit comments

Comments
 (0)