-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefer non-onion nodes in blinded paths #2893
Comments
Hey @TheBlueMatt I was looking at the unit test
Completely new to lightening protocol technically. #[test]
fn reply_path() {
let mut nodes = create_nodes(4);
let test_msg = TestCustomMessage::Request;
let secp_ctx = Secp256k1::new();
// Destination::Node
let 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::BlindedPath
let 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);
} Output of nodes being created [
MessengerNode {
node_id: PublicKey(
8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841bd1e8a8697ad42251de39f6a72081dfdf42abc542a6d6fe0715548b588fafbe70,
),
entropy_source: TestKeysInterface {
backing: PhantomKeysManager {
inner: KeysManager {
secp_ctx: <secp256k1 context 0x7f5e640027f0, all capabilities>,
node_secret: SecretKey(
#50b52cf79f2cc4e4,
),
node_id: PublicKey(
88ce8f35acfc83a200d0b3bf998a4bd18ffdecad1061e3707c0cacf28515927f4e1b189ad34db624e1e906128da9b9428d73532b728d4d44dfd97ab21ac33459,
),
inbound_payment_key: KeyMaterial(
[
42,
90,
154,
123,
239,
238,
192,
97,
51,
63,
55,
130,
194,
193,
107,
129,
71,
4,
143,
131,
4,
176,
187,
222,
174,
101,
172,
77,
4,
221,
230,
168,
],
),
destination_script: Script(OP_0 OP_PUSHBYTES_20 d5a9aa98b89acc215fc3d23d6fec0ad59ca3665f),
shutdown_pubkey: PublicKey(
ea575385e673323088405b596c69ec54f2726dc958e5a0c146aa3e070e76b665ed28c1ec994d22f2d8204420df70fb43259fc198fe83d7c25b72038ae0e12aaf,
),
channel_master_key: ExtendedPrivKey {
network: Testnet,
depth: 1,
parent_fingerprint: 0x729c0d85,
child_number: Hardened {
index: 3,
},
private_key: SecretKey(
#ae13f0902beb3dbe,
),
chain_code: 0xbc7f5327a8cb1cd2cd6d46527fec11fb5c3dc8af359add792e2d02b2f5893a66,
},
channel_child_index: 0,
entropy_source: RandomBytes {
seed: [
15,
154,
183,
3,
49,
171,
42,
47,
153,
213,
11,
238,
54,
18,
22,
51,
108,
224,
96,
136,
252,
46,
167,
28,
196,
241,
67,
202,
176,
74,
13,
116,
],
index: AtomicCounter {
counter_low: 2,
counter_high: 1,
},
},
seed: [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
],
starting_time_secs: 1296688602,
starting_time_nanos: 0,
},
inbound_payment_key: KeyMaterial(
[
127,
78,
106,
114,
154,
160,
10,
226,
11,
80,
228,
106,
117,
176,
213,
250,
62,
50,
224,
51,
86,
108,
170,
69,
175,
159,
207,
93,
58,
49,
30,
204,
],
),
phantom_secret: SecretKey(
#4c37b22d677ad8d8,
),
phantom_node_id: PublicKey(
62fe0a59825cb4cf520904d0710dac6cc3a1164de248b8fe36f4a35966d6c55685675e056757b5d49c3ee0712783ca997ba2585b1b066c9d5f11bcf0d6fbbbf8,
),
},
override_random_bytes: Mutex {
inner: Mutex {
data: None,
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218013,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
disable_revocation_policy_check: false,
enforcement_states: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218014,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
expectations: Mutex {
inner: Mutex {
data: None,
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218015,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
unavailable_signers: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218016,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
messenger: OnionMessenger {
entropy_source: TestKeysInterface {
backing: PhantomKeysManager {
inner: KeysManager {
secp_ctx: <secp256k1 context 0x7f5e640027f0, all capabilities>,
node_secret: SecretKey(
#50b52cf79f2cc4e4,
),
node_id: PublicKey(
88ce8f35acfc83a200d0b3bf998a4bd18ffdecad1061e3707c0cacf28515927f4e1b189ad34db624e1e906128da9b9428d73532b728d4d44dfd97ab21ac33459,
),
inbound_payment_key: KeyMaterial(
[
42,
90,
154,
123,
239,
238,
192,
97,
51,
63,
55,
130,
194,
193,
107,
129,
71,
4,
143,
131,
4,
176,
187,
222,
174,
101,
172,
77,
4,
221,
230,
168,
],
),
destination_script: Script(OP_0 OP_PUSHBYTES_20 d5a9aa98b89acc215fc3d23d6fec0ad59ca3665f),
shutdown_pubkey: PublicKey(
ea575385e673323088405b596c69ec54f2726dc958e5a0c146aa3e070e76b665ed28c1ec994d22f2d8204420df70fb43259fc198fe83d7c25b72038ae0e12aaf,
),
channel_master_key: ExtendedPrivKey {
network: Testnet,
depth: 1,
parent_fingerprint: 0x729c0d85,
child_number: Hardened {
index: 3,
},
private_key: SecretKey(
#ae13f0902beb3dbe,
),
chain_code: 0xbc7f5327a8cb1cd2cd6d46527fec11fb5c3dc8af359add792e2d02b2f5893a66,
},
channel_child_index: 0,
entropy_source: RandomBytes {
seed: [
15,
154,
183,
3,
49,
171,
42,
47,
153,
213,
11,
238,
54,
18,
22,
51,
108,
224,
96,
136,
252,
46,
167,
28,
196,
241,
67,
202,
176,
74,
13,
116,
],
index: AtomicCounter {
counter_low: 2,
counter_high: 1,
},
},
seed: [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
],
starting_time_secs: 1296688602,
starting_time_nanos: 0,
},
inbound_payment_key: KeyMaterial(
[
127,
78,
106,
114,
154,
160,
10,
226,
11,
80,
228,
106,
117,
176,
213,
250,
62,
50,
224,
51,
86,
108,
170,
69,
175,
159,
207,
93,
58,
49,
30,
204,
],
),
phantom_secret: SecretKey(
#4c37b22d677ad8d8,
),
phantom_node_id: PublicKey(
62fe0a59825cb4cf520904d0710dac6cc3a1164de248b8fe36f4a35966d6c55685675e056757b5d49c3ee0712783ca997ba2585b1b066c9d5f11bcf0d6fbbbf8,
),
},
override_random_bytes: Mutex {
inner: Mutex {
data: None,
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218013,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
disable_revocation_policy_check: false,
enforcement_states: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218014,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
expectations: Mutex {
inner: Mutex {
data: None,
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218015,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
unavailable_signers: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218016,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
node_signer: TestNodeSigner {
node_secret: SecretKey(
#04e23f57764f0da5,
),
},
logger: TestLogger {
level: Trace,
id: "node 0",
lines: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218009,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
context: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218010,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
message_recipients: Mutex {
inner: Mutex {
data: {
PublicKey(
66074d25a751c4743342c90ad8ead9454daa00d9b9aed29bca321036d16c4b4dd036ed0d31bd98c1546bb6577f852e668442060feb7c256d8b20fed0a2ad3e2a,
): ConnectedPeer(
[],
),
},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218020,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
secp_ctx: <secp256k1 context 0x7f5e64000e00, all capabilities>,
message_router: TestMessageRouter,
offers_handler: TestOffersMessageHandler,
custom_handler: TestCustomMessageHandler {
expected_messages: Mutex {
inner: Mutex {
data: [],
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218017,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
},
custom_message_handler: TestCustomMessageHandler {
expected_messages: Mutex {
inner: Mutex {
data: [],
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218017,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
},
MessengerNode {
node_id: PublicKey(
66074d25a751c4743342c90ad8ead9454daa00d9b9aed29bca321036d16c4b4dd036ed0d31bd98c1546bb6577f852e668442060feb7c256d8b20fed0a2ad3e2a,
),
entropy_source: TestKeysInterface {
backing: PhantomKeysManager {
inner: KeysManager {
secp_ctx: <secp256k1 context 0x7f5e640040e0, all capabilities>,
node_secret: SecretKey(
#597567cc36675d0d,
),
node_id: PublicKey(
236cdaa42692b2c9dcaa1e9755b09f01015badea0cbd02b6162d328a23d2f8550b2875c8c2a0382aa31936f841ca09946202c0c6d5177ed9a1234ff4969b49db,
),
inbound_payment_key: KeyMaterial(
[
218,
54,
8,
139,
87,
95,
253,
119,
35,
70,
37,
0,
106,
154,
74,
24,
43,
188,
203,
20,
174,
180,
4,
28,
236,
88,
195,
23,
23,
121,
154,
227,
],
),
destination_script: Script(OP_0 OP_PUSHBYTES_20 8e0535b611153ef3f0963737a65bc447a32469a8),
shutdown_pubkey: PublicKey(
106160fb2f019f976a483c41c19d32fc4eacd8caa22fd5f7188c87bfe6d76934edecea6a5c30fae74c668895da465f719f356b04e8dadb0e0abdd56a9c525050,
),
channel_master_key: ExtendedPrivKey {
network: Testnet,
depth: 1,
parent_fingerprint: 0x4ba43603,
child_number: Hardened {
index: 3,
},
private_key: SecretKey(
#09c93f6cd849983c,
),
chain_code: 0xaa9df5e08653966926d540a5244fe0837f31cbb83aaeef2a68228992a322d0ca,
},
channel_child_index: 0,
entropy_source: RandomBytes {
seed: [
114,
225,
251,
140,
0,
167,
127,
163,
127,
59,
173,
129,
207,
166,
141,
31,
63,
138,
4,
191,
27,
239,
213,
211,
185,
163,
4,
164,
116,
54,
200,
36,
],
index: AtomicCounter {
counter_low: 2,
counter_high: 1,
},
},
seed: [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
],
starting_time_secs: 1296688602,
starting_time_nanos: 0,
},
inbound_payment_key: KeyMaterial(
[
204,
163,
250,
128,
138,
222,
183,
229,
224,
210,
212,
4,
109,
95,
226,
58,
130,
28,
149,
67,
58,
126,
69,
175,
133,
165,
49,
221,
217,
17,
203,
54,
],
),
phantom_secret: SecretKey(
#ed3d1499c151be01,
),
phantom_node_id: PublicKey(
cfb24b933b5b3516dbc45892e649b56ce1cb3c03036def993a777c304ff1b39953ecf735cc16672e7c3148459bd690413a629f6fca74f0770ab4cddf63be4226,
),
},
override_random_bytes: Mutex {
inner: Mutex {
data: None,
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218023,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
disable_revocation_policy_check: false,
enforcement_states: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218024,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
expectations: Mutex {
inner: Mutex {
data: None,
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218025,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
unavailable_signers: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218026,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
messenger: OnionMessenger {
entropy_source: TestKeysInterface {
backing: PhantomKeysManager {
inner: KeysManager {
secp_ctx: <secp256k1 context 0x7f5e640040e0, all capabilities>,
node_secret: SecretKey(
#597567cc36675d0d,
),
node_id: PublicKey(
236cdaa42692b2c9dcaa1e9755b09f01015badea0cbd02b6162d328a23d2f8550b2875c8c2a0382aa31936f841ca09946202c0c6d5177ed9a1234ff4969b49db,
),
inbound_payment_key: KeyMaterial(
[
218,
54,
8,
139,
87,
95,
253,
119,
35,
70,
37,
0,
106,
154,
74,
24,
43,
188,
203,
20,
174,
180,
4,
28,
236,
88,
195,
23,
23,
121,
154,
227,
],
),
destination_script: Script(OP_0 OP_PUSHBYTES_20 8e0535b611153ef3f0963737a65bc447a32469a8),
shutdown_pubkey: PublicKey(
106160fb2f019f976a483c41c19d32fc4eacd8caa22fd5f7188c87bfe6d76934edecea6a5c30fae74c668895da465f719f356b04e8dadb0e0abdd56a9c525050,
),
channel_master_key: ExtendedPrivKey {
network: Testnet,
depth: 1,
parent_fingerprint: 0x4ba43603,
child_number: Hardened {
index: 3,
},
private_key: SecretKey(
#09c93f6cd849983c,
),
chain_code: 0xaa9df5e08653966926d540a5244fe0837f31cbb83aaeef2a68228992a322d0ca,
},
channel_child_index: 0,
entropy_source: RandomBytes {
seed: [
114,
225,
251,
140,
0,
167,
127,
163,
127,
59,
173,
129,
207,
166,
141,
31,
63,
138,
4,
191,
27,
239,
213,
211,
185,
163,
4,
164,
116,
54,
200,
36,
],
index: AtomicCounter {
counter_low: 2,
counter_high: 1,
},
},
seed: [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
],
starting_time_secs: 1296688602,
starting_time_nanos: 0,
},
inbound_payment_key: KeyMaterial(
[
204,
163,
250,
128,
138,
222,
183,
229,
224,
210,
212,
4,
109,
95,
226,
58,
130,
28,
149,
67,
58,
126,
69,
175,
133,
165,
49,
221,
217,
17,
203,
54,
],
),
phantom_secret: SecretKey(
#ed3d1499c151be01,
),
phantom_node_id: PublicKey(
cfb24b933b5b3516dbc45892e649b56ce1cb3c03036def993a777c304ff1b39953ecf735cc16672e7c3148459bd690413a629f6fca74f0770ab4cddf63be4226,
),
},
override_random_bytes: Mutex {
inner: Mutex {
data: None,
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218023,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
disable_revocation_policy_check: false,
enforcement_states: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218024,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
expectations: Mutex {
inner: Mutex {
data: None,
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218025,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
unavailable_signers: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218026,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
node_signer: TestNodeSigner {
node_secret: SecretKey(
#33f4cec88838cc84,
),
},
logger: TestLogger {
level: Trace,
id: "node 1",
lines: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218021,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
context: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218022,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
message_recipients: Mutex {
inner: Mutex {
data: {
PublicKey(
8f07ddd5e9f5179cff19486034181ed76505baaad53e5d994064127b56c5841bd1e8a8697ad42251de39f6a72081dfdf42abc542a6d6fe0715548b588fafbe70,
): ConnectedPeer(
[],
),
PublicKey(
37e31fcbbdbdc5c3449a7e533cc8a68fac67c827321323273d50348106e61f5358546af286730e3bd9924e52cd0f205a70ac475a67842aa81b481ee765c2929e,
): ConnectedPeer(
[],
),
},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218028,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
secp_ctx: <secp256k1 context 0x7f5e64022280, all capabilities>,
message_router: TestMessageRouter,
offers_handler: TestOffersMessageHandler,
custom_handler: TestCustomMessageHandler {
expected_messages: Mutex {
inner: Mutex {
data: [],
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218027,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
},
custom_message_handler: TestCustomMessageHandler {
expected_messages: Mutex {
inner: Mutex {
data: [],
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218027,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
},
MessengerNode {
node_id: PublicKey(
37e31fcbbdbdc5c3449a7e533cc8a68fac67c827321323273d50348106e61f5358546af286730e3bd9924e52cd0f205a70ac475a67842aa81b481ee765c2929e,
),
entropy_source: TestKeysInterface {
backing: PhantomKeysManager {
inner: KeysManager {
secp_ctx: <secp256k1 context 0x7f5e64004310, all capabilities>,
node_secret: SecretKey(
#970a5a14c5cece90,
),
node_id: PublicKey(
ce1dc610d880181464ae9a76568387c1fd3839d8af69f74012d241f33d2e8f88c4e526dbe59946cf190e949a2c5f92bafcccce5aa9708d2455d18231162afeb5,
),
inbound_payment_key: KeyMaterial(
[
58,
76,
117,
40,
156,
49,
180,
221,
3,
102,
10,
231,
184,
102,
56,
224,
24,
15,
51,
212,
88,
119,
242,
49,
145,
74,
83,
178,
217,
219,
13,
170,
],
),
destination_script: Script(OP_0 OP_PUSHBYTES_20 96f1652787d6269c8e83a5e7c1c5fb78df7c11a8),
shutdown_pubkey: PublicKey(
d8904787e86a0881e0447078bd26f46ec72f163f92012ddcb9f6259f95708cfd7c81e1812d9c19d1f2292bc86f188757539e547d370baf52c88ad8e0166acf76,
),
channel_master_key: ExtendedPrivKey {
network: Testnet,
depth: 1,
parent_fingerprint: 0x8dfc9b34,
child_number: Hardened {
index: 3,
},
private_key: SecretKey(
#d7624282ca88001c,
),
chain_code: 0xceedc3ba738e60910282a0df3cfdf38585f8c8e8f314d4d72dc785c7d0d18530,
},
channel_child_index: 0,
entropy_source: RandomBytes {
seed: [
170,
74,
174,
247,
227,
36,
254,
196,
22,
138,
167,
184,
59,
31,
253,
185,
117,
12,
61,
138,
71,
179,
211,
88,
83,
241,
236,
36,
114,
5,
25,
179,
],
index: AtomicCounter {
counter_low: 2,
counter_high: 1,
},
},
seed: [
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
],
starting_time_secs: 1296688602,
starting_time_nanos: 0,
},
inbound_payment_key: KeyMaterial(
[
208,
229,
135,
232,
65,
18,
142,
117,
162,
32,
41,
21,
15,
147,
255,
163,
14,
148,
106,
190,
36,
59,
138,
108,
35,
161,
41,
85,
87,
0,
40,
74,
],
),
phantom_secret: SecretKey(
#90b3a5c7b9851ffe,
),
phantom_node_id: PublicKey(
7e725f8b0ff0742ba919c01b57b7bded72148a2e39d883a1de70bd7608658ab930aaa4508fd6f54299bdf73370efe26206004bae3a98d8ba74125004ea6b7ba3,
),
},
override_random_bytes: Mutex {
inner: Mutex {
data: None,
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218038,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
disable_revocation_policy_check: false,
enforcement_states: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218039,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
expectations: Mutex {
inner: Mutex {
data: None,
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218040,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
unavailable_signers: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218041,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
messenger: OnionMessenger {
entropy_source: TestKeysInterface {
backing: PhantomKeysManager {
inner: KeysManager {
secp_ctx: <secp256k1 context 0x7f5e64004310, all capabilities>,
node_secret: SecretKey(
#970a5a14c5cece90,
),
node_id: PublicKey(
ce1dc610d880181464ae9a76568387c1fd3839d8af69f74012d241f33d2e8f88c4e526dbe59946cf190e949a2c5f92bafcccce5aa9708d2455d18231162afeb5,
),
inbound_payment_key: KeyMaterial(
[
58,
76,
117,
40,
156,
49,
180,
221,
3,
102,
10,
231,
184,
102,
56,
224,
24,
15,
51,
212,
88,
119,
242,
49,
145,
74,
83,
178,
217,
219,
13,
170,
],
),
destination_script: Script(OP_0 OP_PUSHBYTES_20 96f1652787d6269c8e83a5e7c1c5fb78df7c11a8),
shutdown_pubkey: PublicKey(
d8904787e86a0881e0447078bd26f46ec72f163f92012ddcb9f6259f95708cfd7c81e1812d9c19d1f2292bc86f188757539e547d370baf52c88ad8e0166acf76,
),
channel_master_key: ExtendedPrivKey {
network: Testnet,
depth: 1,
parent_fingerprint: 0x8dfc9b34,
child_number: Hardened {
index: 3,
},
private_key: SecretKey(
#d7624282ca88001c,
),
chain_code: 0xceedc3ba738e60910282a0df3cfdf38585f8c8e8f314d4d72dc785c7d0d18530,
},
channel_child_index: 0,
entropy_source: RandomBytes {
seed: [
170,
74,
174,
247,
227,
36,
254,
196,
22,
138,
167,
184,
59,
31,
253,
185,
117,
12,
61,
138,
71,
179,
211,
88,
83,
241,
236,
36,
114,
5,
25,
179,
],
index: AtomicCounter {
counter_low: 2,
counter_high: 1,
},
},
seed: [
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
],
starting_time_secs: 1296688602,
starting_time_nanos: 0,
},
inbound_payment_key: KeyMaterial(
[
208,
229,
135,
232,
65,
18,
142,
117,
162,
32,
41,
21,
15,
147,
255,
163,
14,
148,
106,
190,
36,
59,
138,
108,
35,
161,
41,
85,
87,
0,
40,
74,
],
),
phantom_secret: SecretKey(
#90b3a5c7b9851ffe,
),
phantom_node_id: PublicKey(
7e725f8b0ff0742ba919c01b57b7bded72148a2e39d883a1de70bd7608658ab930aaa4508fd6f54299bdf73370efe26206004bae3a98d8ba74125004ea6b7ba3,
),
},
override_random_bytes: Mutex {
inner: Mutex {
data: None,
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218038,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
disable_revocation_policy_check: false,
enforcement_states: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218039,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
expectations: Mutex {
inner: Mutex {
data: None,
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218040,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
unavailable_signers: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218041,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
node_signer: TestNodeSigner {
node_secret: SecretKey(
#e9f13f0a0536a0d3,
),
},
logger: TestLogger {
level: Trace,
id: "node 2",
lines: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218029,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
context: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218030,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
message_recipients: Mutex {
inner: Mutex {
data: {
PublicKey(
66074d25a751c4743342c90ad8ead9454daa00d9b9aed29bca321036d16c4b4dd036ed0d31bd98c1546bb6577f852e668442060feb7c256d8b20fed0a2ad3e2a,
): ConnectedPeer(
[],
),
PublicKey(
0b5be51c72b8b5ef30e0e493a5c7e1102f5f08711a7514465139ad4aad792746f596a5b2eb56d72e1518cb8990acbf866a82ae725d45ea0b0042549f96079c19,
): ConnectedPeer(
[],
),
},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218052,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
secp_ctx: <secp256k1 context 0x7f5e64016d30, all capabilities>,
message_router: TestMessageRouter,
offers_handler: TestOffersMessageHandler,
custom_handler: TestCustomMessageHandler {
expected_messages: Mutex {
inner: Mutex {
data: [],
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218042,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
},
custom_message_handler: TestCustomMessageHandler {
expected_messages: Mutex {
inner: Mutex {
data: [],
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218042,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
},
MessengerNode {
node_id: PublicKey(
0b5be51c72b8b5ef30e0e493a5c7e1102f5f08711a7514465139ad4aad792746f596a5b2eb56d72e1518cb8990acbf866a82ae725d45ea0b0042549f96079c19,
),
entropy_source: TestKeysInterface {
backing: PhantomKeysManager {
inner: KeysManager {
secp_ctx: <secp256k1 context 0x7f5e64020050, all capabilities>,
node_secret: SecretKey(
#625a78c1f8c5dc10,
),
node_id: PublicKey(
20d2f8e0dbf2a35a88a1d378c00dea8780b9b05de9a309f190a84eb1c6c41811774f44c336b4a807947d43abf537aa0e5ffaeacb267f56738f21d293a95c6874,
),
inbound_payment_key: KeyMaterial(
[
112,
213,
164,
30,
222,
249,
34,
198,
233,
95,
14,
156,
137,
236,
15,
239,
237,
226,
15,
23,
95,
94,
57,
168,
207,
44,
61,
172,
168,
170,
177,
183,
],
),
destination_script: Script(OP_0 OP_PUSHBYTES_20 9f86df9a660cab41af294fabd93fc5a7013e2bc9),
shutdown_pubkey: PublicKey(
840c31667006edb31cf61d90e19336c99cc7a4c550663e3db2fbe15ded31268a1f50a622b35afa2dd67468b63ff910471f2b782169a9686b9e13e444a9e4febf,
),
channel_master_key: ExtendedPrivKey {
network: Testnet,
depth: 1,
parent_fingerprint: 0x56c4fac3,
child_number: Hardened {
index: 3,
},
private_key: SecretKey(
#4e0f373f1faea612,
),
chain_code: 0xd06040efa3eb307d2ca7ec45ba59198b344201af28730efa000f81cad8bf1de8,
},
channel_child_index: 0,
entropy_source: RandomBytes {
seed: [
194,
33,
167,
203,
209,
161,
159,
125,
7,
26,
77,
248,
145,
11,
155,
137,
62,
47,
141,
168,
50,
158,
217,
141,
67,
186,
163,
181,
87,
248,
145,
39,
],
index: AtomicCounter {
counter_low: 2,
counter_high: 1,
},
},
seed: [
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
],
starting_time_secs: 1296688602,
starting_time_nanos: 0,
},
inbound_payment_key: KeyMaterial(
[
95,
129,
52,
217,
208,
18,
56,
0,
113,
23,
155,
38,
81,
164,
142,
238,
120,
252,
56,
246,
105,
213,
250,
82,
122,
40,
82,
110,
88,
136,
222,
86,
],
),
phantom_secret: SecretKey(
#9918e88d35d1254b,
),
phantom_node_id: PublicKey(
081729af848cb1cd25f9f71c778cd7e622f7b14732af909e0c56981f43d19b91e599217ec5a58d8bfc696f9d3f12f9890f7bcf2c23b7b3682cb4ba7b20118e42,
),
},
override_random_bytes: Mutex {
inner: Mutex {
data: None,
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218056,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
disable_revocation_policy_check: false,
enforcement_states: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218057,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
expectations: Mutex {
inner: Mutex {
data: None,
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218058,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
unavailable_signers: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218059,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
messenger: OnionMessenger {
entropy_source: TestKeysInterface {
backing: PhantomKeysManager {
inner: KeysManager {
secp_ctx: <secp256k1 context 0x7f5e64020050, all capabilities>,
node_secret: SecretKey(
#625a78c1f8c5dc10,
),
node_id: PublicKey(
20d2f8e0dbf2a35a88a1d378c00dea8780b9b05de9a309f190a84eb1c6c41811774f44c336b4a807947d43abf537aa0e5ffaeacb267f56738f21d293a95c6874,
),
inbound_payment_key: KeyMaterial(
[
112,
213,
164,
30,
222,
249,
34,
198,
233,
95,
14,
156,
137,
236,
15,
239,
237,
226,
15,
23,
95,
94,
57,
168,
207,
44,
61,
172,
168,
170,
177,
183,
],
),
destination_script: Script(OP_0 OP_PUSHBYTES_20 9f86df9a660cab41af294fabd93fc5a7013e2bc9),
shutdown_pubkey: PublicKey(
840c31667006edb31cf61d90e19336c99cc7a4c550663e3db2fbe15ded31268a1f50a622b35afa2dd67468b63ff910471f2b782169a9686b9e13e444a9e4febf,
),
channel_master_key: ExtendedPrivKey {
network: Testnet,
depth: 1,
parent_fingerprint: 0x56c4fac3,
child_number: Hardened {
index: 3,
},
private_key: SecretKey(
#4e0f373f1faea612,
),
chain_code: 0xd06040efa3eb307d2ca7ec45ba59198b344201af28730efa000f81cad8bf1de8,
},
channel_child_index: 0,
entropy_source: RandomBytes {
seed: [
194,
33,
167,
203,
209,
161,
159,
125,
7,
26,
77,
248,
145,
11,
155,
137,
62,
47,
141,
168,
50,
158,
217,
141,
67,
186,
163,
181,
87,
248,
145,
39,
],
index: AtomicCounter {
counter_low: 2,
counter_high: 1,
},
},
seed: [
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
],
starting_time_secs: 1296688602,
starting_time_nanos: 0,
},
inbound_payment_key: KeyMaterial(
[
95,
129,
52,
217,
208,
18,
56,
0,
113,
23,
155,
38,
81,
164,
142,
238,
120,
252,
56,
246,
105,
213,
250,
82,
122,
40,
82,
110,
88,
136,
222,
86,
],
),
phantom_secret: SecretKey(
#9918e88d35d1254b,
),
phantom_node_id: PublicKey(
081729af848cb1cd25f9f71c778cd7e622f7b14732af909e0c56981f43d19b91e599217ec5a58d8bfc696f9d3f12f9890f7bcf2c23b7b3682cb4ba7b20118e42,
),
},
override_random_bytes: Mutex {
inner: Mutex {
data: None,
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218056,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
disable_revocation_policy_check: false,
enforcement_states: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218057,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
expectations: Mutex {
inner: Mutex {
data: None,
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218058,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
unavailable_signers: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218059,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
node_signer: TestNodeSigner {
node_secret: SecretKey(
#3b5ebfc7b79f407c,
),
},
logger: TestLogger {
level: Trace,
id: "node 3",
lines: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218053,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
context: Mutex {
inner: Mutex {
data: {},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218054,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
message_recipients: Mutex {
inner: Mutex {
data: {
PublicKey(
37e31fcbbdbdc5c3449a7e533cc8a68fac67c827321323273d50348106e61f5358546af286730e3bd9924e52cd0f205a70ac475a67842aa81b481ee765c2929e,
): ConnectedPeer(
[],
),
},
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218065,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
secp_ctx: <secp256k1 context 0x7f5e64020250, all capabilities>,
message_router: TestMessageRouter,
offers_handler: TestOffersMessageHandler,
custom_handler: TestCustomMessageHandler {
expected_messages: Mutex {
inner: Mutex {
data: [],
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218060,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
},
custom_message_handler: TestCustomMessageHandler {
expected_messages: Mutex {
inner: Mutex {
data: [],
poisoned: false,
..
},
deps: LockMetadata {
lock_idx: 218060,
locked_before: Mutex {
data: {},
poisoned: false,
..
},
_lock_construction_bt: Backtrace,
},
},
},
},
] |
This needs to be done prior to calling |
No worries. Still curious about how would the nodes be differentiated ? Any whitepaper or resource ? Or in case if that anywhere in |
Sure! When a https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message These announcements can be obtained using LDK's https://docs.rs/lightning/latest/lightning/routing/gossip/struct.NetworkGraph.html |
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.
The text was updated successfully, but these errors were encountered: