Skip to content

Commit de9f85a

Browse files
committed
Add trampoline_hops field to Path
1 parent f1a1a0c commit de9f85a

File tree

13 files changed

+49
-37
lines changed

13 files changed

+49
-37
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ fn send_payment(
566566
maybe_announced_channel: true,
567567
}],
568568
blinded_tail: None,
569+
trampoline_hops: vec![],
569570
}],
570571
route_params: None,
571572
},
@@ -646,6 +647,7 @@ fn send_hop_payment(
646647
},
647648
],
648649
blinded_tail: None,
650+
trampoline_hops: vec![],
649651
}],
650652
route_params: None,
651653
},

lightning-background-processor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2540,7 +2540,7 @@ mod tests {
25402540
fee_msat: 0,
25412541
cltv_expiry_delta: MIN_CLTV_EXPIRY_DELTA as u32,
25422542
maybe_announced_channel: true,
2543-
}], blinded_tail: None };
2543+
}], trampoline_hops: vec![], blinded_tail: None };
25442544

25452545
$nodes[0].scorer.write_lock().expect(TestResult::PaymentFailure { path: path.clone(), short_channel_id: scored_scid });
25462546
$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
@@ -1894,7 +1894,7 @@ impl MaybeReadable for Event {
18941894
payment_hash,
18951895
payment_failed_permanently,
18961896
failure,
1897-
path: Path { hops: path.unwrap(), blinded_tail },
1897+
path: Path { hops: path.unwrap(), trampoline_hops: vec![], blinded_tail },
18981898
short_channel_id,
18991899
#[cfg(test)]
19001900
error_code,
@@ -2034,7 +2034,7 @@ impl MaybeReadable for Event {
20342034
Ok(Some(Event::PaymentPathSuccessful {
20352035
payment_id: payment_id.0.unwrap(),
20362036
payment_hash,
2037-
path: Path { hops: path, blinded_tail },
2037+
path: Path { hops: path, trampoline_hops: vec![], blinded_tail },
20382038
}))
20392039
};
20402040
f()
@@ -2114,7 +2114,7 @@ impl MaybeReadable for Event {
21142114
Ok(Some(Event::ProbeSuccessful {
21152115
payment_id: payment_id.0.unwrap(),
21162116
payment_hash: payment_hash.0.unwrap(),
2117-
path: Path { hops: path, blinded_tail },
2117+
path: Path { hops: path, trampoline_hops: vec![], blinded_tail },
21182118
}))
21192119
};
21202120
f()
@@ -2131,7 +2131,7 @@ impl MaybeReadable for Event {
21312131
Ok(Some(Event::ProbeFailed {
21322132
payment_id: payment_id.0.unwrap(),
21332133
payment_hash: payment_hash.0.unwrap(),
2134-
path: Path { hops: path, blinded_tail },
2134+
path: Path { hops: path, trampoline_hops: vec![], blinded_tail },
21352135
short_channel_id,
21362136
}))
21372137
};

lightning/src/ln/blinded_payment_tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,6 +1439,7 @@ fn route_blinding_spec_test_vector() {
14391439
cltv_expiry_delta: 42,
14401440
maybe_announced_channel: false,
14411441
}],
1442+
trampoline_hops: vec![],
14421443
blinded_tail: Some(BlindedTail {
14431444
hops: blinded_hops,
14441445
blinding_point: bob_blinding_point,

lightning/src/ln/channel.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9835,7 +9835,7 @@ mod tests {
98359835
cltv_expiry: 200000000,
98369836
state: OutboundHTLCState::Committed,
98379837
source: HTLCSource::OutboundRoute {
9838-
path: Path { hops: Vec::new(), blinded_tail: None },
9838+
path: Path { hops: Vec::new(), trampoline_hops: vec![], blinded_tail: None },
98399839
session_priv: SecretKey::from_slice(&<Vec<u8>>::from_hex("0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff").unwrap()[..]).unwrap(),
98409840
first_hop_htlc_msat: 548,
98419841
payment_id: PaymentId([42; 32]),
@@ -10211,6 +10211,7 @@ mod tests {
1021110211
node_features: NodeFeatures::empty(), short_channel_id: 0, fee_msat: 0,
1021210212
cltv_expiry_delta: 0, maybe_announced_channel: false,
1021310213
}],
10214+
trampoline_hops: vec![],
1021410215
blinded_tail: None
1021510216
},
1021610217
session_priv: test_utils::privkey(42),

lightning/src/ln/channelmanager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ impl HTLCSource {
639639
pub fn dummy() -> Self {
640640
assert!(cfg!(not(feature = "grind_signatures")));
641641
HTLCSource::OutboundRoute {
642-
path: Path { hops: Vec::new(), blinded_tail: None },
642+
path: Path { hops: Vec::new(), trampoline_hops: Vec::new(), blinded_tail: None },
643643
session_priv: SecretKey::from_slice(&[1; 32]).unwrap(),
644644
first_hop_htlc_msat: 0,
645645
payment_id: PaymentId([2; 32]),
@@ -11667,7 +11667,7 @@ impl Readable for HTLCSource {
1166711667
// instead.
1166811668
payment_id = Some(PaymentId(*session_priv.0.unwrap().as_ref()));
1166911669
}
11670-
let path = Path { hops: path_hops, blinded_tail };
11670+
let path = Path { hops: path_hops, trampoline_hops: vec![], blinded_tail };
1167111671
if path.hops.len() == 0 {
1167211672
return Err(DecodeError::InvalidValue);
1167311673
}

lightning/src/ln/functional_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ fn fake_network_test() {
10931093
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;
10941094
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;
10951095
let payment_preimage_1 = send_along_route(&nodes[1],
1096-
Route { paths: vec![Path { hops, blinded_tail: None }], route_params: None },
1096+
Route { paths: vec![Path { hops, trampoline_hops: vec![], blinded_tail: None }], route_params: None },
10971097
&vec!(&nodes[2], &nodes[3], &nodes[1])[..], 1000000).0;
10981098

10991099
let mut hops = Vec::with_capacity(3);
@@ -1127,7 +1127,7 @@ fn fake_network_test() {
11271127
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;
11281128
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;
11291129
let payment_hash_2 = send_along_route(&nodes[1],
1130-
Route { paths: vec![Path { hops, blinded_tail: None }], route_params: None },
1130+
Route { paths: vec![Path { hops, trampoline_hops: vec![], blinded_tail: None }], route_params: None },
11311131
&vec!(&nodes[3], &nodes[2], &nodes[1])[..], 1000000).1;
11321132

11331133
// Claim the rebalances...

lightning/src/ln/onion_payment.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ mod tests {
538538
// Ensure the onion will not fit all the payloads by adding a large custom TLV.
539539
recipient_onion.custom_tlvs.push((13377331, vec![0; 1156]));
540540

541-
let path = Path { hops, blinded_tail: None, };
541+
let path = Path { hops, trampoline_hops: vec![], blinded_tail: None, };
542542
let onion_keys = super::onion_utils::construct_onion_keys(&secp_ctx, &path, &session_priv).unwrap();
543543
let (onion_payloads, ..) = super::onion_utils::build_onion_payloads(
544544
&path, total_amt_msat, &recipient_onion, cur_height + 1, &Some(keysend_preimage)
@@ -564,6 +564,7 @@ mod tests {
564564

565565
let path = Path {
566566
hops: hops,
567+
trampoline_hops: vec![],
567568
blinded_tail: None,
568569
};
569570

lightning/src/ln/onion_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,7 @@ mod tests {
13211321
channel_features: ChannelFeatures::empty(), node_features: NodeFeatures::empty(),
13221322
short_channel_id: 0, fee_msat: 0, cltv_expiry_delta: 0, maybe_announced_channel: true, // We fill in the payloads manually instead of generating them from RouteHops.
13231323
},
1324-
], blinded_tail: None }],
1324+
], trampoline_hops: vec![], blinded_tail: None }],
13251325
route_params: None,
13261326
};
13271327

lightning/src/ln/outbound_payment.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2418,7 +2418,7 @@ mod tests {
24182418
fee_msat: 0,
24192419
cltv_expiry_delta: 0,
24202420
maybe_announced_channel: true,
2421-
}], blinded_tail: None }],
2421+
}], trampoline_hops: vec![], blinded_tail: None }],
24222422
route_params: Some(route_params.clone()),
24232423
};
24242424
router.expect_find_route(route_params.clone(), Ok(route.clone()));
@@ -2771,6 +2771,7 @@ mod tests {
27712771
maybe_announced_channel: true,
27722772
}
27732773
],
2774+
trampoline_hops: vec![],
27742775
blinded_tail: None,
27752776
}
27762777
],

0 commit comments

Comments
 (0)