From: Matt Corallo Date: Wed, 14 Dec 2022 21:08:51 +0000 (+0000) Subject: Update references to "blinded route" to "blinded path" X-Git-Tag: v0.0.113~1^2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=refs%2Fheads%2F2022-12-one-blinded-path;p=rust-lightning Update references to "blinded route" to "blinded path" Finishing the work from the previous two commits. --- diff --git a/lightning/src/onion_message/functional_tests.rs b/lightning/src/onion_message/functional_tests.rs index 34414904d..f65a50ee1 100644 --- a/lightning/src/onion_message/functional_tests.rs +++ b/lightning/src/onion_message/functional_tests.rs @@ -168,8 +168,8 @@ fn too_big_packet_error() { #[test] fn we_are_intro_node() { - // If we are sending straight to a blinded route and we are the introduction node, we need to - // advance the blinded route by 1 hop so the second hop is the new introduction node. + // If we are sending straight to a blinded path and we are the introduction node, we need to + // advance the blinded path by 1 hop so the second hop is the new introduction node. let mut nodes = create_nodes(3); let test_msg = TestCustomMessage {}; @@ -179,7 +179,7 @@ fn we_are_intro_node() { nodes[0].messenger.send_onion_message(&[], Destination::BlindedPath(blinded_path), OnionMessageContents::Custom(test_msg.clone()), None).unwrap(); pass_along_path(&nodes, None); - // Try with a two-hop blinded route where we are the introduction node. + // Try with a two-hop blinded path where we are the introduction node. let blinded_path = BlindedPath::new(&[nodes[0].get_node_pk(), nodes[1].get_node_pk()], &*nodes[1].keys_manager, &secp_ctx).unwrap(); nodes[0].messenger.send_onion_message(&[], Destination::BlindedPath(blinded_path), OnionMessageContents::Custom(test_msg), None).unwrap(); nodes.remove(2); @@ -188,7 +188,7 @@ fn we_are_intro_node() { #[test] fn invalid_blinded_path_error() { - // Make sure we error as expected if a provided blinded route has 0 or 1 hops. + // Make sure we error as expected if a provided blinded path has 0 or 1 hops. let nodes = create_nodes(3); let test_msg = TestCustomMessage {}; diff --git a/lightning/src/onion_message/messenger.rs b/lightning/src/onion_message/messenger.rs index 1a5673a35..269b5f8cb 100644 --- a/lightning/src/onion_message/messenger.rs +++ b/lightning/src/onion_message/messenger.rs @@ -89,12 +89,12 @@ use crate::prelude::*; /// let message = OnionMessageContents::Custom(your_custom_message); /// onion_messenger.send_onion_message(&intermediate_hops, Destination::Node(destination_node_id), message, reply_path); /// -/// // Create a blinded route to yourself, for someone to send an onion message to. +/// // Create a blinded path to yourself, for someone to send an onion message to. /// # let your_node_id = hop_node_id1; /// let hops = [hop_node_id3, hop_node_id4, your_node_id]; /// let blinded_path = BlindedPath::new(&hops, &keys_manager, &secp_ctx).unwrap(); /// -/// // Send a custom onion message to a blinded route. +/// // Send a custom onion message to a blinded path. /// # let intermediate_hops = [hop_node_id1, hop_node_id2]; /// let reply_path = None; /// # let your_custom_message = YourCustomMessage {}; @@ -122,7 +122,7 @@ pub struct OnionMessenger pub enum Destination { /// We're sending this onion message to a node. Node(PublicKey), - /// We're sending this onion message to a blinded route. + /// We're sending this onion message to a blinded path. BlindedPath(BlindedPath), } @@ -158,8 +158,8 @@ pub enum SendError { /// /// [`KeysInterface`]: crate::chain::keysinterface::KeysInterface GetNodeIdFailed, - /// We attempted to send to a blinded route where we are the introduction node, and failed to - /// advance the blinded route to make the second hop the new introduction node. Either + /// We attempted to send to a blinded path where we are the introduction node, and failed to + /// advance the blinded path to make the second hop the new introduction node. Either /// [`KeysInterface::ecdh`] failed, we failed to tweak the current blinding point to get the /// new blinding point, or we were attempting to send to ourselves. BlindedPathAdvanceFailed, @@ -216,8 +216,8 @@ impl OnionMessenger let OnionMessageContents::Custom(ref msg) = message; if msg.tlv_type() < 64 { return Err(SendError::InvalidMessage) } - // If we are sending straight to a blinded route and we are the introduction node, we need to - // advance the blinded route by 1 hop so the second hop is the new introduction node. + // If we are sending straight to a blinded path and we are the introduction node, we need to + // advance the blinded path by 1 hop so the second hop is the new introduction node. if intermediate_nodes.len() == 0 { if let Destination::BlindedPath(ref mut blinded_path) = destination { let our_node_id = self.keys_manager.get_node_id(Recipient::Node) @@ -346,7 +346,7 @@ impl OnionMessageHandler for OnionMessenger pk, diff --git a/lightning/src/onion_message/mod.rs b/lightning/src/onion_message/mod.rs index f8ecf7de8..e735b428e 100644 --- a/lightning/src/onion_message/mod.rs +++ b/lightning/src/onion_message/mod.rs @@ -12,13 +12,13 @@ //! Onion messages are multi-purpose messages sent between peers over the lightning network. In the //! near future, they will be used to communicate invoices for [offers], unlocking use cases such as //! static invoices, refunds and proof of payer. Further, you will be able to accept payments -//! without revealing your node id through the use of [blinded routes]. +//! without revealing your node id through the use of [blinded paths]. //! //! LDK sends and receives onion messages via the [`OnionMessenger`]. See its documentation for more //! information on its usage. //! //! [offers]: -//! [blinded routes]: crate::onion_message::BlindedPath +//! [blinded paths]: crate::onion_message::BlindedPath mod blinded_path; mod messenger; diff --git a/lightning/src/onion_message/packet.rs b/lightning/src/onion_message/packet.rs index ea317afbf..3222c08a3 100644 --- a/lightning/src/onion_message/packet.rs +++ b/lightning/src/onion_message/packet.rs @@ -141,7 +141,7 @@ pub trait CustomOnionMessageContents: Writeable { /// Forward control TLVs in their blinded and unblinded form. pub(super) enum ForwardControlTlvs { - /// If we're sending to a blinded route, the node that constructed the blinded route has provided + /// If we're sending to a blinded path, the node that constructed the blinded path has provided /// this hop's control TLVs, already encrypted into bytes. Blinded(Vec), /// If we're constructing an onion message hop through an intermediate unblinded node, we'll need