Skip to content

Commit d9b4ea2

Browse files
Add blinded path {metadata} fields to Path
1 parent 81e9f73 commit d9b4ea2

File tree

12 files changed

+99
-53
lines changed

12 files changed

+99
-53
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ fn send_payment(source: &ChanMan, dest: &ChanMan, dest_chan_id: u64, amt: u64, p
359359
channel_features: dest.channel_features(),
360360
fee_msat: amt,
361361
cltv_expiry_delta: 200,
362-
}]}],
362+
}], blinded_tail: None }],
363363
payment_params: None,
364364
}, payment_hash, RecipientOnionFields::secret_only(payment_secret), PaymentId(payment_id)) {
365365
check_payment_err(err);
@@ -388,7 +388,7 @@ fn send_hop_payment(source: &ChanMan, middle: &ChanMan, middle_chan_id: u64, des
388388
channel_features: dest.channel_features(),
389389
fee_msat: amt,
390390
cltv_expiry_delta: 200,
391-
}]}],
391+
}], blinded_tail: None }],
392392
payment_params: None,
393393
}, payment_hash, RecipientOnionFields::secret_only(payment_secret), PaymentId(payment_id)) {
394394
check_payment_err(err);

lightning-background-processor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1512,7 +1512,7 @@ mod tests {
15121512
channel_features: ChannelFeatures::empty(),
15131513
fee_msat: 0,
15141514
cltv_expiry_delta: MIN_CLTV_EXPIRY_DELTA as u32,
1515-
}]};
1515+
}], blinded_tail: None };
15161516

15171517
$nodes[0].scorer.lock().unwrap().expect(TestResult::PaymentFailure { path: path.clone(), short_channel_id: scored_scid });
15181518
$nodes[0].node.push_pending_event(Event::PaymentPathFailed {

lightning/src/events/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@ impl MaybeReadable for Event {
11411141
payment_hash,
11421142
payment_failed_permanently,
11431143
failure,
1144-
path: Path { hops: path.unwrap() },
1144+
path: Path { hops: path.unwrap(), blinded_tail: None },
11451145
short_channel_id,
11461146
#[cfg(test)]
11471147
error_code,
@@ -1255,7 +1255,7 @@ impl MaybeReadable for Event {
12551255
Ok(Some(Event::PaymentPathSuccessful {
12561256
payment_id,
12571257
payment_hash,
1258-
path: Path { hops: path.unwrap() },
1258+
path: Path { hops: path.unwrap(), blinded_tail: None },
12591259
}))
12601260
};
12611261
f()
@@ -1316,7 +1316,7 @@ impl MaybeReadable for Event {
13161316
Ok(Some(Event::ProbeSuccessful {
13171317
payment_id,
13181318
payment_hash,
1319-
path: Path { hops: path.unwrap() },
1319+
path: Path { hops: path.unwrap(), blinded_tail: None },
13201320
}))
13211321
};
13221322
f()
@@ -1336,7 +1336,7 @@ impl MaybeReadable for Event {
13361336
Ok(Some(Event::ProbeFailed {
13371337
payment_id,
13381338
payment_hash,
1339-
path: Path { hops: path.unwrap() },
1339+
path: Path { hops: path.unwrap(), blinded_tail: None },
13401340
short_channel_id,
13411341
}))
13421342
};

lightning/src/ln/channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7202,7 +7202,7 @@ mod tests {
72027202
cltv_expiry: 200000000,
72037203
state: OutboundHTLCState::Committed,
72047204
source: HTLCSource::OutboundRoute {
7205-
path: Path { hops: Vec::new() },
7205+
path: Path { hops: Vec::new(), blinded_tail: None },
72067206
session_priv: SecretKey::from_slice(&hex::decode("0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff").unwrap()[..]).unwrap(),
72077207
first_hop_htlc_msat: 548,
72087208
payment_id: PaymentId([42; 32]),

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7019,7 +7019,7 @@ impl Readable for HTLCSource {
70197019
// instead.
70207020
payment_id = Some(PaymentId(*session_priv.0.unwrap().as_ref()));
70217021
}
7022-
let path = Path { hops: path_hops.ok_or(DecodeError::InvalidValue)? };
7022+
let path = Path { hops: path_hops.ok_or(DecodeError::InvalidValue)?, blinded_tail: None };
70237023
if path.hops.len() == 0 {
70247024
return Err(DecodeError::InvalidValue);
70257025
}

lightning/src/ln/functional_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ fn fake_network_test() {
10441044
});
10451045
hops[1].fee_msat = chan_4.1.contents.fee_base_msat as u64 + chan_4.1.contents.fee_proportional_millionths as u64 * hops[2].fee_msat as u64 / 1000000;
10461046
hops[0].fee_msat = chan_3.0.contents.fee_base_msat as u64 + chan_3.0.contents.fee_proportional_millionths as u64 * hops[1].fee_msat as u64 / 1000000;
1047-
let payment_preimage_1 = send_along_route(&nodes[1], Route { paths: vec![Path { hops }], payment_params: None }, &vec!(&nodes[2], &nodes[3], &nodes[1])[..], 1000000).0;
1047+
let payment_preimage_1 = send_along_route(&nodes[1], Route { paths: vec![Path { hops, blinded_tail: None }], payment_params: None }, &vec!(&nodes[2], &nodes[3], &nodes[1])[..], 1000000).0;
10481048

10491049
let mut hops = Vec::with_capacity(3);
10501050
hops.push(RouteHop {
@@ -1073,7 +1073,7 @@ fn fake_network_test() {
10731073
});
10741074
hops[1].fee_msat = chan_2.1.contents.fee_base_msat as u64 + chan_2.1.contents.fee_proportional_millionths as u64 * hops[2].fee_msat as u64 / 1000000;
10751075
hops[0].fee_msat = chan_3.1.contents.fee_base_msat as u64 + chan_3.1.contents.fee_proportional_millionths as u64 * hops[1].fee_msat as u64 / 1000000;
1076-
let payment_hash_2 = send_along_route(&nodes[1], Route { paths: vec![Path { hops }], payment_params: None }, &vec!(&nodes[3], &nodes[2], &nodes[1])[..], 1000000).1;
1076+
let payment_hash_2 = send_along_route(&nodes[1], Route { paths: vec![Path { hops, blinded_tail: None }], payment_params: None }, &vec!(&nodes[3], &nodes[2], &nodes[1])[..], 1000000).1;
10771077

10781078
// Claim the rebalances...
10791079
fail_payment(&nodes[1], &vec!(&nodes[3], &nodes[2], &nodes[1])[..], payment_hash_2);

lightning/src/ln/onion_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ mod tests {
929929
channel_features: ChannelFeatures::empty(), node_features: NodeFeatures::empty(),
930930
short_channel_id: 0, fee_msat: 0, cltv_expiry_delta: 0 // We fill in the payloads manually instead of generating them from RouteHops.
931931
},
932-
]}],
932+
], blinded_tail: None }],
933933
payment_params: None,
934934
};
935935

lightning/src/ln/outbound_payment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,7 @@ mod tests {
15521552
channel_features: ChannelFeatures::empty(),
15531553
fee_msat: 0,
15541554
cltv_expiry_delta: 0,
1555-
}]}],
1555+
}], blinded_tail: None }],
15561556
payment_params: Some(payment_params),
15571557
};
15581558
router.expect_find_route(route_params.clone(), Ok(route.clone()));

lightning/src/ln/payment_tests.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,15 +1846,15 @@ fn auto_retry_partial_failure() {
18461846
channel_features: nodes[1].node.channel_features(),
18471847
fee_msat: amt_msat / 2,
18481848
cltv_expiry_delta: 100,
1849-
}]},
1849+
}], blinded_tail: None },
18501850
Path { hops: vec![RouteHop {
18511851
pubkey: nodes[1].node.get_our_node_id(),
18521852
node_features: nodes[1].node.node_features(),
18531853
short_channel_id: chan_2_id,
18541854
channel_features: nodes[1].node.channel_features(),
18551855
fee_msat: amt_msat / 2,
18561856
cltv_expiry_delta: 100,
1857-
}]},
1857+
}], blinded_tail: None },
18581858
],
18591859
payment_params: Some(route_params.payment_params.clone()),
18601860
};
@@ -1867,15 +1867,15 @@ fn auto_retry_partial_failure() {
18671867
channel_features: nodes[1].node.channel_features(),
18681868
fee_msat: amt_msat / 4,
18691869
cltv_expiry_delta: 100,
1870-
}]},
1870+
}], blinded_tail: None },
18711871
Path { hops: vec![RouteHop {
18721872
pubkey: nodes[1].node.get_our_node_id(),
18731873
node_features: nodes[1].node.node_features(),
18741874
short_channel_id: chan_3_id,
18751875
channel_features: nodes[1].node.channel_features(),
18761876
fee_msat: amt_msat / 4,
18771877
cltv_expiry_delta: 100,
1878-
}]},
1878+
}], blinded_tail: None },
18791879
],
18801880
payment_params: Some(route_params.payment_params.clone()),
18811881
};
@@ -1888,7 +1888,7 @@ fn auto_retry_partial_failure() {
18881888
channel_features: nodes[1].node.channel_features(),
18891889
fee_msat: amt_msat / 4,
18901890
cltv_expiry_delta: 100,
1891-
}]},
1891+
}], blinded_tail: None },
18921892
],
18931893
payment_params: Some(route_params.payment_params.clone()),
18941894
};
@@ -2135,15 +2135,15 @@ fn retry_multi_path_single_failed_payment() {
21352135
channel_features: nodes[1].node.channel_features(),
21362136
fee_msat: 10_000,
21372137
cltv_expiry_delta: 100,
2138-
}]},
2138+
}], blinded_tail: None },
21392139
Path { hops: vec![RouteHop {
21402140
pubkey: nodes[1].node.get_our_node_id(),
21412141
node_features: nodes[1].node.node_features(),
21422142
short_channel_id: chans[1].short_channel_id.unwrap(),
21432143
channel_features: nodes[1].node.channel_features(),
21442144
fee_msat: 100_000_001, // Our default max-HTLC-value is 10% of the channel value, which this is one more than
21452145
cltv_expiry_delta: 100,
2146-
}]},
2146+
}], blinded_tail: None },
21472147
],
21482148
payment_params: Some(payment_params),
21492149
};
@@ -2229,7 +2229,7 @@ fn immediate_retry_on_failure() {
22292229
channel_features: nodes[1].node.channel_features(),
22302230
fee_msat: 100_000_001, // Our default max-HTLC-value is 10% of the channel value, which this is one more than
22312231
cltv_expiry_delta: 100,
2232-
}]},
2232+
}], blinded_tail: None },
22332233
],
22342234
payment_params: Some(PaymentParameters::from_node_id(nodes[1].node.get_our_node_id(), TEST_FINAL_CLTV)),
22352235
};
@@ -2324,7 +2324,7 @@ fn no_extra_retries_on_back_to_back_fail() {
23242324
channel_features: nodes[2].node.channel_features(),
23252325
fee_msat: 100_000_000,
23262326
cltv_expiry_delta: 100,
2327-
}]},
2327+
}], blinded_tail: None },
23282328
Path { hops: vec![RouteHop {
23292329
pubkey: nodes[1].node.get_our_node_id(),
23302330
node_features: nodes[1].node.node_features(),
@@ -2339,7 +2339,7 @@ fn no_extra_retries_on_back_to_back_fail() {
23392339
channel_features: nodes[2].node.channel_features(),
23402340
fee_msat: 100_000_000,
23412341
cltv_expiry_delta: 100,
2342-
}]}
2342+
}], blinded_tail: None }
23432343
],
23442344
payment_params: Some(PaymentParameters::from_node_id(nodes[2].node.get_our_node_id(), TEST_FINAL_CLTV)),
23452345
};
@@ -2526,7 +2526,7 @@ fn test_simple_partial_retry() {
25262526
channel_features: nodes[2].node.channel_features(),
25272527
fee_msat: 100_000_000,
25282528
cltv_expiry_delta: 100,
2529-
}]},
2529+
}], blinded_tail: None },
25302530
Path { hops: vec![RouteHop {
25312531
pubkey: nodes[1].node.get_our_node_id(),
25322532
node_features: nodes[1].node.node_features(),
@@ -2541,7 +2541,7 @@ fn test_simple_partial_retry() {
25412541
channel_features: nodes[2].node.channel_features(),
25422542
fee_msat: 100_000_000,
25432543
cltv_expiry_delta: 100,
2544-
}]}
2544+
}], blinded_tail: None }
25452545
],
25462546
payment_params: Some(PaymentParameters::from_node_id(nodes[2].node.get_our_node_id(), TEST_FINAL_CLTV)),
25472547
};
@@ -2692,7 +2692,7 @@ fn test_threaded_payment_retries() {
26922692
channel_features: nodes[2].node.channel_features(),
26932693
fee_msat: amt_msat / 1000,
26942694
cltv_expiry_delta: 100,
2695-
}]},
2695+
}], blinded_tail: None },
26962696
Path { hops: vec![RouteHop {
26972697
pubkey: nodes[2].node.get_our_node_id(),
26982698
node_features: nodes[2].node.node_features(),
@@ -2707,7 +2707,7 @@ fn test_threaded_payment_retries() {
27072707
channel_features: nodes[3].node.channel_features(),
27082708
fee_msat: amt_msat - amt_msat / 1000,
27092709
cltv_expiry_delta: 100,
2710-
}]}
2710+
}], blinded_tail: None }
27112711
],
27122712
payment_params: Some(PaymentParameters::from_node_id(nodes[2].node.get_our_node_id(), TEST_FINAL_CLTV)),
27132713
};

0 commit comments

Comments
 (0)