ln/refactor: remove BlindedTrampolineEntrypoint
What changed, and why it matters
This commit is a small internal code cleanup in the Lightning Dev Kit's Trampoline routing code. It removes a separate 'BlindedTrampolineEntrypoint' payload variant and folds an optional blinding point into the existing 'Forward' variant. The change simplifies the code but does not appear to fix a security bug or change wire behavior in a way that introduces vulnerability. It is a refactor, not a security patch.
No security action required. Treat as routine code maintenance. If reviewing for Trampoline correctness, verify that the optional current_path_key is correctly populated for blinded trampoline forwarding hops and remains None for non-blinded cases.
Security signals we found
Refactor-only change with no added bounds checks or validation
No mention of vulnerability, CVE, security fix, or bug in commit message
TLV field changed from required to optional, but only for a newly unified variant used in internal construction
No changes to parsing/decoder paths that would affect inbound untrusted data
Evidence from the diff
The patch refactors OutboundOnionPayload in lightning/src/ln/msgs.rs by deleting the BlindedTrampolineEntrypoint variant and adding an Option
Changed components
lightning/src/ln/msgs.rslightning/src/ln/onion_utils.rslightning/src/ln/onion_route_tests.rsInspect captured patch +8 / −26
### lightning/src/ln/msgs.rs
@@ -2633,18 +2633,10 @@ mod fuzzy_internal_msgs {
outgoing_cltv_value: u32,
multipath_trampoline_data: Option<FinalOnionHopData>,
trampoline_packet: TrampolineOnionPacket,
- },
- /// This is used for Trampoline hops that are not the blinded path intro hop.
- /// We would only ever construct this variant when we are a Trampoline node forwarding a
- /// payment along a blinded path.
- #[allow(unused)]
- BlindedTrampolineEntrypoint {
- amt_to_forward: u64,
- outgoing_cltv_value: u32,
- multipath_trampoline_data: Option<FinalOnionHopData>,
- trampoline_packet: TrampolineOnionPacket,
- /// The blinding point this hop needs to use for its Trampoline onion.
- current_path_key: PublicKey,
+ /// The blinding point to include in the outer onion. Only set when forwarding within
+ /// a blinded trampoline path for relaying nodes (the introduction node receives its
+ /// path key inside of the TrampolineOnionPacket, set by the original sender).
+ current_path_key: Option<PublicKey>,
},
Receive {
payment_data: Option<FinalOnionHopData>,
@@ -3618,26 +3610,13 @@ impl<'a> Writeable for OutboundOnionPayload<'a> {
outgoing_cltv_value,
ref multipath_trampoline_data,
ref trampoline_packet,
- } => {
- _encode_varint_length_prefixed_tlv!(w, {
- (2, HighZeroBytesDroppedBigSize(*amt_to_forward), required),
- (4, HighZeroBytesDroppedBigSize(*outgoing_cltv_value), required),
- (8, multipath_trampoline_data, option),
- (20, trampoline_packet, required)
- });
- },
- Self::BlindedTrampolineEntrypoint {
- amt_to_forward,
- outgoing_cltv_value,
current_path_key,
- ref multipath_trampoline_data,
- ref trampoline_packet,
} => {
_encode_varint_length_prefixed_tlv!(w, {
(2, HighZeroBytesDroppedBigSize(*amt_to_forward), required),
(4, HighZeroBytesDroppedBigSize(*outgoing_cltv_value), required),
(8, multipath_trampoline_data, option),
- (12, current_path_key, required),
+ (12, current_path_key, option),
(20, trampoline_packet, required)
});
},
@@ -6582,6 +6561,7 @@ mod tests {
amt_to_forward: 0x0badf00d01020304,
outgoing_cltv_value: 0xffffffff,
trampoline_packet,
+ current_path_key: None,
};
let encoded_payload = msg.encode();
### lightning/src/ln/onion_route_tests.rs
@@ -2216,6 +2216,7 @@ fn test_trampoline_onion_payload_construction_vectors() {
),
total_msat: 150153000,
}),
+ current_path_key: None,
},
];
### lightning/src/ln/onion_utils.rs
@@ -274,6 +274,7 @@ impl<'a, 'b> OnionPayload<'a, 'b> for msgs::OutboundOnionPayload<'a> {
}
}),
trampoline_packet: packet,
+ current_path_key: None,
})
}
}Why this scored 16/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.