blinded_path: add constructor for trampoline blinded path
What changed, and why it matters
This commit adds a new internal test-only helper function to create a special kind of private payment path (called a 'trampoline blinded path') in the Lightning Dev Kit library. It does not change any existing behavior, fix a bug, or expose new public functionality to users. There is no indication this is a security patch.
No security action needed. Review as normal code quality for the new test utility.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds a new new_for_trampoline constructor for BlindedPaymentPath, gated behind #[cfg(any(test, feature = "_test_utils"))], meaning it is only compiled for tests or test utilities. The function delegates to the existing new_inner method with an empty &[] slice for one argument. It is purely additive and does not alter existing code paths.
Changed components
lightning/src/blinded_path/payment.rsInspect captured patch +23 / −0
diff --git a/lightning/src/blinded_path/payment.rs b/lightning/src/blinded_path/payment.rs
index 5766bdf..f06c91b 100644
--- a/lightning/src/blinded_path/payment.rs
+++ b/lightning/src/blinded_path/payment.rs
@@ -161,6 +161,29 @@ impl BlindedPaymentPath {
)
}
+ /// Create a blinded path for a trampoline payment, to be forwarded along `intermediate_nodes`.
+ #[cfg(any(test, feature = "_test_utils"))]
+ pub(crate) fn new_for_trampoline<
+ ES: EntropySource,
+ T: secp256k1::Signing + secp256k1::Verification,
+ >(
+ intermediate_nodes: &[ForwardNode<TrampolineForwardTlvs>], payee_node_id: PublicKey,
+ local_node_receive_key: ReceiveAuthKey, payee_tlvs: ReceiveTlvs, htlc_maximum_msat: u64,
+ min_final_cltv_expiry_delta: u16, entropy_source: ES, secp_ctx: &Secp256k1<T>,
+ ) -> Result<Self, ()> {
+ Self::new_inner(
+ intermediate_nodes,
+ payee_node_id,
+ local_node_receive_key,
+ &[],
+ payee_tlvs,
+ htlc_maximum_msat,
+ min_final_cltv_expiry_delta,
+ entropy_source,
+ secp_ctx,
+ )
+ }
+
fn new_inner<
F: ForwardTlvsInfo,
ES: EntropySource,
Why this scored 15/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.