Skip to content

Commit a85aca9

Browse files
committed
Add trampoline_hops field to Path
1 parent a67b6a2 commit a85aca9

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
@@ -559,6 +559,7 @@ fn send_payment(
559559
maybe_announced_channel: true,
560560
}],
561561
blinded_tail: None,
562+
trampoline_hops: vec![],
562563
}],
563564
route_params: None,
564565
},
@@ -639,6 +640,7 @@ fn send_hop_payment(
639640
},
640641
],
641642
blinded_tail: None,
643+
trampoline_hops: vec![],
642644
}],
643645
route_params: None,
644646
},

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
@@ -1911,7 +1911,7 @@ impl MaybeReadable for Event {
19111911
payment_hash,
19121912
payment_failed_permanently,
19131913
failure,
1914-
path: Path { hops: path.unwrap(), blinded_tail },
1914+
path: Path { hops: path.unwrap(), trampoline_hops: vec![], blinded_tail },
19151915
short_channel_id,
19161916
#[cfg(test)]
19171917
error_code,
@@ -2051,7 +2051,7 @@ impl MaybeReadable for Event {
20512051
Ok(Some(Event::PaymentPathSuccessful {
20522052
payment_id: payment_id.0.unwrap(),
20532053
payment_hash,
2054-
path: Path { hops: path, blinded_tail },
2054+
path: Path { hops: path, trampoline_hops: vec![], blinded_tail },
20552055
}))
20562056
};
20572057
f()
@@ -2131,7 +2131,7 @@ impl MaybeReadable for Event {
21312131
Ok(Some(Event::ProbeSuccessful {
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
}))
21362136
};
21372137
f()
@@ -2148,7 +2148,7 @@ impl MaybeReadable for Event {
21482148
Ok(Some(Event::ProbeFailed {
21492149
payment_id: payment_id.0.unwrap(),
21502150
payment_hash: payment_hash.0.unwrap(),
2151-
path: Path { hops: path, blinded_tail },
2151+
path: Path { hops: path, trampoline_hops: vec![], blinded_tail },
21522152
short_channel_id,
21532153
}))
21542154
};

lightning/src/ln/blinded_payment_tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,7 @@ fn route_blinding_spec_test_vector() {
15111511
cltv_expiry_delta: 42,
15121512
maybe_announced_channel: false,
15131513
}],
1514+
trampoline_hops: vec![],
15141515
blinded_tail: Some(BlindedTail {
15151516
hops: blinded_hops,
15161517
blinding_point: bob_blinding_point,

lightning/src/ln/channel.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9850,7 +9850,7 @@ mod tests {
98509850
cltv_expiry: 200000000,
98519851
state: OutboundHTLCState::Committed,
98529852
source: HTLCSource::OutboundRoute {
9853-
path: Path { hops: Vec::new(), blinded_tail: None },
9853+
path: Path { hops: Vec::new(), trampoline_hops: vec![], blinded_tail: None },
98549854
session_priv: SecretKey::from_slice(&<Vec<u8>>::from_hex("0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff").unwrap()[..]).unwrap(),
98559855
first_hop_htlc_msat: 548,
98569856
payment_id: PaymentId([42; 32]),
@@ -10226,6 +10226,7 @@ mod tests {
1022610226
node_features: NodeFeatures::empty(), short_channel_id: 0, fee_msat: 0,
1022710227
cltv_expiry_delta: 0, maybe_announced_channel: false,
1022810228
}],
10229+
trampoline_hops: vec![],
1022910230
blinded_tail: None
1023010231
},
1023110232
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
@@ -651,7 +651,7 @@ impl HTLCSource {
651651
pub fn dummy() -> Self {
652652
assert!(cfg!(not(feature = "grind_signatures")));
653653
HTLCSource::OutboundRoute {
654-
path: Path { hops: Vec::new(), blinded_tail: None },
654+
path: Path { hops: Vec::new(), trampoline_hops: Vec::new(), blinded_tail: None },
655655
session_priv: SecretKey::from_slice(&[1; 32]).unwrap(),
656656
first_hop_htlc_msat: 0,
657657
payment_id: PaymentId([2; 32]),
@@ -12167,7 +12167,7 @@ impl Readable for HTLCSource {
1216712167
// instead.
1216812168
payment_id = Some(PaymentId(*session_priv.0.unwrap().as_ref()));
1216912169
}
12170-
let path = Path { hops: path_hops, blinded_tail };
12170+
let path = Path { hops: path_hops, trampoline_hops: vec![], blinded_tail };
1217112171
if path.hops.len() == 0 {
1217212172
return Err(DecodeError::InvalidValue);
1217312173
}

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
@@ -539,7 +539,7 @@ mod tests {
539539
// Ensure the onion will not fit all the payloads by adding a large custom TLV.
540540
recipient_onion.custom_tlvs.push((13377331, vec![0; 1156]));
541541

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

566566
let path = Path {
567567
hops: hops,
568+
trampoline_hops: vec![],
568569
blinded_tail: None,
569570
};
570571

lightning/src/ln/onion_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,7 @@ mod tests {
13301330
channel_features: ChannelFeatures::empty(), node_features: NodeFeatures::empty(),
13311331
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.
13321332
},
1333-
], blinded_tail: None }],
1333+
], trampoline_hops: vec![], blinded_tail: None }],
13341334
route_params: None,
13351335
};
13361336

lightning/src/ln/outbound_payment.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2543,7 +2543,7 @@ mod tests {
25432543
fee_msat: 0,
25442544
cltv_expiry_delta: 0,
25452545
maybe_announced_channel: true,
2546-
}], blinded_tail: None }],
2546+
}], trampoline_hops: vec![], blinded_tail: None }],
25472547
route_params: Some(route_params.clone()),
25482548
};
25492549
router.expect_find_route(route_params.clone(), Ok(route.clone()));
@@ -2899,6 +2899,7 @@ mod tests {
28992899
maybe_announced_channel: true,
29002900
}
29012901
],
2902+
trampoline_hops: vec![],
29022903
blinded_tail: None,
29032904
}
29042905
],

0 commit comments

Comments
 (0)