@@ -1800,7 +1800,7 @@ mod fuzzy_internal_msgs {
1800
1800
1801
1801
#[ allow( unused_imports) ]
1802
1802
use crate :: prelude:: * ;
1803
-
1803
+ use crate :: routing :: gossip :: NodeId ;
1804
1804
// These types aren't intended to be pub, but are exposed for direct fuzzing (as we deserialize
1805
1805
// them from untrusted input):
1806
1806
@@ -1811,6 +1811,14 @@ mod fuzzy_internal_msgs {
1811
1811
pub outgoing_cltv_value : u32 ,
1812
1812
}
1813
1813
1814
+ #[ allow( unused) ]
1815
+ pub struct InboundTrampolineForwardPayload {
1816
+ pub outgoing_node_id : NodeId ,
1817
+ /// The value, in msat, of the payment after this hop's fee is deducted.
1818
+ pub amt_to_forward : u64 ,
1819
+ pub outgoing_cltv_value : u32 ,
1820
+ }
1821
+
1814
1822
#[ allow( unused) ]
1815
1823
pub struct InboundTrampolineEntrypointPayload {
1816
1824
pub amt_to_forward : u64 ,
@@ -1856,6 +1864,10 @@ mod fuzzy_internal_msgs {
1856
1864
Receive ( InboundOnionReceivePayload ) ,
1857
1865
BlindedForward ( InboundOnionBlindedForwardPayload ) ,
1858
1866
BlindedReceive ( InboundOnionBlindedReceivePayload ) ,
1867
+
1868
+ // These payloads should be seen inside an inner Trampoline onion
1869
+ #[ allow( unused) ]
1870
+ TrampolineForward ( InboundTrampolineForwardPayload ) ,
1859
1871
}
1860
1872
1861
1873
pub ( crate ) enum OutboundOnionPayload < ' a > {
@@ -2940,6 +2952,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2940
2952
let mut payment_data: Option < FinalOnionHopData > = None ;
2941
2953
let mut encrypted_tlvs_opt: Option < WithoutLength < Vec < u8 > > > = None ;
2942
2954
let mut intro_node_blinding_point = None ;
2955
+ let mut outgoing_node_id: Option < NodeId > = None ;
2943
2956
let mut payment_metadata: Option < WithoutLength < Vec < u8 > > > = None ;
2944
2957
let mut total_msat = None ;
2945
2958
let mut keysend_preimage: Option < PaymentPreimage > = None ;
@@ -2956,6 +2969,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2956
2969
( 8 , payment_data, option) ,
2957
2970
( 10 , encrypted_tlvs_opt, option) ,
2958
2971
( 12 , intro_node_blinding_point, option) ,
2972
+ ( 14 , outgoing_node_id, option) ,
2959
2973
( 16 , payment_metadata, option) ,
2960
2974
( 18 , total_msat, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
2961
2975
( 20 , trampoline_onion_packet, option) ,
@@ -3048,6 +3062,15 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
3048
3062
amt_to_forward : amt. ok_or ( DecodeError :: InvalidValue ) ?,
3049
3063
outgoing_cltv_value : cltv_value. ok_or ( DecodeError :: InvalidValue ) ?,
3050
3064
} ) )
3065
+ } else if let Some ( outgoing_node_id) = outgoing_node_id {
3066
+ if payment_data. is_some ( ) || payment_metadata. is_some ( ) || encrypted_tlvs_opt. is_some ( ) ||
3067
+ total_msat. is_some ( ) || invoice_request. is_some ( )
3068
+ { return Err ( DecodeError :: InvalidValue ) }
3069
+ Ok ( Self :: TrampolineForward ( InboundTrampolineForwardPayload {
3070
+ outgoing_node_id,
3071
+ amt_to_forward : amt. ok_or ( DecodeError :: InvalidValue ) ?,
3072
+ outgoing_cltv_value : cltv_value. ok_or ( DecodeError :: InvalidValue ) ?,
3073
+ } ) )
3051
3074
} else {
3052
3075
if encrypted_tlvs_opt. is_some ( ) || total_msat. is_some ( ) || invoice_request. is_some ( ) {
3053
3076
return Err ( DecodeError :: InvalidValue )
0 commit comments