Require channelmanager logger to implement Clone
What changed, and why it matters
This commit changes the Rust type requirements for the logger used by the ChannelManager so that the logger must implement the Clone trait. This is a compile-time API change, not a fix for an exploitable runtime bug. It may break downstream code that passes a logger that cannot be cloned, but it does not introduce or patch a security vulnerability on its own.
No security action required. Downstream users should verify that their logger type implements Clone when upgrading, or wrap it in an Arc if needed.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds L: Clone bounds to ChannelManagerReadArgs and its ReadableArgs implementations, and to the ChannelManager::new constructor. The existing ChannelManager struct already required L: Deref<Target = Logger>. This change simply requires the logger type to also be Clone. There is no logic change, no bug fix, and no new unsafe code. It is an API contract change that may cause compilation failures for consumers whose logger type is not Clone.
Changed components
lightning/src/ln/channelmanager.rsChannelManagerReadArgsChannelManager::new constructorReadableArgs implementations for ChannelManagerInspect captured patch +8 / −5
diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs
index cfef054..bca110a 100644
--- a/lightning/src/ln/channelmanager.rs
+++ b/lightning/src/ln/channelmanager.rs
@@ -3728,7 +3728,10 @@ where
fee_est: F, chain_monitor: M, tx_broadcaster: T, router: R, message_router: MR, logger: L,
entropy_source: ES, node_signer: NS, signer_provider: SP, config: UserConfig,
params: ChainParameters, current_timestamp: u32,
- ) -> Self {
+ ) -> Self
+ where
+ L: Clone,
+ {
let mut secp_ctx = Secp256k1::new();
secp_ctx.seeded_randomize(&entropy_source.get_secure_random_bytes());
@@ -15610,7 +15613,7 @@ pub struct ChannelManagerReadArgs<
F: Deref,
R: Deref,
MR: Deref,
- L: Deref,
+ L: Deref + Clone,
> where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
T::Target: BroadcasterInterface,
@@ -15690,7 +15693,7 @@ impl<
F: Deref,
R: Deref,
MR: Deref,
- L: Deref,
+ L: Deref + Clone,
> ChannelManagerReadArgs<'a, M, T, ES, NS, SP, F, R, MR, L>
where
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
@@ -15742,7 +15745,7 @@ impl<
F: Deref,
R: Deref,
MR: Deref,
- L: Deref,
+ L: Deref + Clone,
> ReadableArgs<ChannelManagerReadArgs<'a, M, T, ES, NS, SP, F, R, MR, L>>
for (BlockHash, Arc<ChannelManager<M, T, ES, NS, SP, F, R, MR, L>>)
where
@@ -15775,7 +15778,7 @@ impl<
F: Deref,
R: Deref,
MR: Deref,
- L: Deref,
+ L: Deref + Clone,
> ReadableArgs<ChannelManagerReadArgs<'a, M, T, ES, NS, SP, F, R, MR, L>>
for (BlockHash, ChannelManager<M, T, ES, NS, SP, F, R, MR, L>)
where
Why this scored 17/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.