You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If, when building a blinded path, we pick a peer as an intro node, but that peer only supports onions, we may end up making responses difficult - (a) not all peers have a local tor daemon and can connect to onions to DC to respond, (b) connecting to an onion has substantial additional latency. IMO we should filter out onion nodes when building an onion message reply path until onion message routing is more common.
Hey @TheBlueMatt I was looking at the unit test reply_path and was curious about the following
How do we get to know if a node is onion node or not ? I have tried looking at the nodes by debugging it (attaching o/p below) but it got overwhelming at first sight to figure out the field which can help out.
Where do we filter them out ? I guess in new_for_message ?
Completely new to lightening protocol technically.
#[test]fnreply_path(){letmut nodes = create_nodes(4);let test_msg = TestCustomMessage::Request;let secp_ctx = Secp256k1::new();// Destination::Nodelet path = OnionMessagePath{intermediate_nodes:vec![nodes[1].node_id, nodes[2].node_id],destination:Destination::Node(nodes[3].node_id),first_node_addresses:None,};let reply_path = BlindedPath::new_for_message(&[nodes[2].node_id, nodes[1].node_id, nodes[0].node_id],&*nodes[0].entropy_source,&secp_ctx).unwrap();
nodes[0].messenger.send_onion_message_using_path(path, test_msg.clone(),Some(reply_path)).unwrap();
nodes[3].custom_message_handler.expect_message(TestCustomMessage::Request);pass_along_path(&nodes);// Make sure the last node successfully decoded the reply path.
nodes[0].custom_message_handler.expect_message(TestCustomMessage::Response);
nodes.reverse();pass_along_path(&nodes);// Destination::BlindedPathlet blinded_path = BlindedPath::new_for_message(&[nodes[1].node_id, nodes[2].node_id, nodes[3].node_id],&*nodes[3].entropy_source,&secp_ctx).unwrap();let path = OnionMessagePath{intermediate_nodes:vec![],destination:Destination::BlindedPath(blinded_path),first_node_addresses:None,};let reply_path = BlindedPath::new_for_message(&[nodes[2].node_id, nodes[1].node_id, nodes[0].node_id],&*nodes[0].entropy_source,&secp_ctx).unwrap();
nodes[0].messenger.send_onion_message_using_path(path, test_msg,Some(reply_path)).unwrap();
nodes[3].custom_message_handler.expect_message(TestCustomMessage::Request);pass_along_path(&nodes);// Make sure the last node successfully decoded the reply path.
nodes[0].custom_message_handler.expect_message(TestCustomMessage::Response);
nodes.reverse();pass_along_path(&nodes);}
Hey @TheBlueMatt I was looking at the unit test reply_path and was curious about the following
How do we get to know if a node is onion node or not ? I have tried looking at the nodes by debugging it (attaching o/p below) but it got overwhelming at first sight to figure out the field which can help out.
Where do we filter them out ? I guess in new_for_message ?
Completely new to lightening protocol technically.
This needs to be done prior to calling new_for_message, as BlindedPath doesn't carry the necessary information. I actually have a draft of this locally as I'm touching the necessary code in another PR. Sorry, should have assigned this issue to myself.
This needs to be done prior to calling new_for_message, as BlindedPath doesn't carry the necessary information. I actually have a draft of this locally as I'm touching the necessary code in another PR. Sorry, should have assigned this issue to myself.
No worries. Still curious about how would the nodes be differentiated ? Any whitepaper or resource ? Or in case if that anywhere in Mastering the Lightning Network Book I can come across the chapter real soon.
No worries. Still curious about how would the nodes be differentiated ? Any whitepaper or resource ? Or in case if that anywhere in Mastering the Lightning Network Book I can come across the chapter real soon.
Sure! When a node_announcement is gossiped, it may contain addresses needed to reach the node.
Activity
Harshil-Jani commentedon Feb 25, 2024
Hey @TheBlueMatt I was looking at the unit test
reply_pathand was curious about the followingnew_for_message?Completely new to lightening protocol technically.
Output of nodes being created
jkczyz commentedon Feb 27, 2024
This needs to be done prior to calling
new_for_message, asBlindedPathdoesn't carry the necessary information. I actually have a draft of this locally as I'm touching the necessary code in another PR. Sorry, should have assigned this issue to myself.Harshil-Jani commentedon Feb 27, 2024
No worries. Still curious about how would the nodes be differentiated ? Any whitepaper or resource ? Or in case if that anywhere in
Mastering the Lightning NetworkBook I can come across the chapter real soon.jkczyz commentedon Feb 27, 2024
Sure! When a
node_announcementis gossiped, it may contain addresses needed to reach the node.https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
These announcements can be obtained using LDK's
NetworkGraph.https://docs.rs/lightning/latest/lightning/routing/gossip/struct.NetworkGraph.html