Skip to content

Commit ae6e5ff

Browse files
committed
Clarify docs regarding one-hop blinded paths
The docs assumed ChannelManager is parameterized by DefaultRouter, which may not be the case. Clarify the behavior is specific to using DefaultRouter.
1 parent ecb4784 commit ae6e5ff

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8261,10 +8261,8 @@ macro_rules! create_offer_builder { ($self: ident, $builder: ty) => {
82618261
///
82628262
/// Uses [`MessageRouter`] to construct a [`BlindedPath`] for the offer based on the given
82638263
/// `absolute_expiry` according to [`MAX_SHORT_LIVED_RELATIVE_EXPIRY`]. See those docs for
8264-
/// privacy implications. However, if one is not found, uses a one-hop [`BlindedPath`] with
8265-
/// [`ChannelManager::get_our_node_id`] as the introduction node instead. In the latter case,
8266-
/// the node must be announced, otherwise, there is no way to find a path to the introduction
8267-
/// node in order to send the [`InvoiceRequest`].
8264+
/// privacy implications as well as those of the parameterized [`Router`], which implements
8265+
/// [`MessageRouter`].
82688266
///
82698267
/// Also, uses a derived signing pubkey in the offer for recipient privacy.
82708268
///
@@ -8329,10 +8327,8 @@ macro_rules! create_refund_builder { ($self: ident, $builder: ty) => {
83298327
///
83308328
/// Uses [`MessageRouter`] to construct a [`BlindedPath`] for the refund based on the given
83318329
/// `absolute_expiry` according to [`MAX_SHORT_LIVED_RELATIVE_EXPIRY`]. See those docs for
8332-
/// privacy implications. However, if one is not found, uses a one-hop [`BlindedPath`] with
8333-
/// [`ChannelManager::get_our_node_id`] as the introduction node instead. In the latter case,
8334-
/// the node must be announced, otherwise, there is no way to find a path to the introduction
8335-
/// node in order to send the [`Bolt12Invoice`].
8330+
/// privacy implications as well as those of the parameterized [`Router`], which implements
8331+
/// [`MessageRouter`].
83368332
///
83378333
/// Also, uses a derived payer id in the refund for payer privacy.
83388334
///
@@ -8431,10 +8427,9 @@ where
84318427
///
84328428
/// # Privacy
84338429
///
8434-
/// Uses a one-hop [`BlindedPath`] for the reply path with [`ChannelManager::get_our_node_id`]
8435-
/// as the introduction node and a derived payer id for payer privacy. As such, currently, the
8436-
/// node must be announced. Otherwise, there is no way to find a path to the introduction node
8437-
/// in order to send the [`Bolt12Invoice`].
8430+
/// For payer privacy, uses a derived payer id and uses [`MessageRouter::create_blinded_paths`]
8431+
/// to construct a [`BlindedPath`] for the reply path. For further privacy implications, see the
8432+
/// docs of the parameterized [`Router`], which implements [`MessageRouter`].
84388433
///
84398434
/// # Limitations
84408435
///

lightning/src/onion_message/messenger.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,13 @@ pub trait MessageRouter {
456456
}
457457

458458
/// A [`MessageRouter`] that can only route to a directly connected [`Destination`].
459+
///
460+
/// # Privacy
461+
///
462+
/// Creating [`BlindedPath`]s may affect privacy since, if a suitable path cannot be found, it will
463+
/// create a one-hop path using the recipient as the introduction node if it is a announced node.
464+
/// Otherwise, there is no way to find a path to the introduction node in order to send a message,
465+
/// and thus an `Err` is returned.
459466
pub struct DefaultMessageRouter<G: Deref<Target=NetworkGraph<L>>, L: Deref, ES: Deref>
460467
where
461468
L::Target: Logger,

lightning/src/routing/router.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ use core::{cmp, fmt};
3636
use core::ops::Deref;
3737

3838
/// A [`Router`] implemented using [`find_route`].
39+
///
40+
/// # Privacy
41+
///
42+
/// Implements [`MessageRouter`] by delegating to [`DefaultMessageRouter`]. See those docs for
43+
/// privacy implications.
3944
pub struct DefaultRouter<G: Deref<Target = NetworkGraph<L>> + Clone, L: Deref, ES: Deref, S: Deref, SP: Sized, Sc: ScoreLookUp<ScoreParams = SP>> where
4045
L::Target: Logger,
4146
S::Target: for <'a> LockableScore<'a, ScoreLookUp = Sc>,

0 commit comments

Comments
 (0)