Skip to content

Commit 898cd51

Browse files
committed
Attributable failures
1 parent 5d75b36 commit 898cd51

File tree

8 files changed

+627
-156
lines changed

8 files changed

+627
-156
lines changed

lightning/src/ln/channel.rs

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use crate::ln::chan_utils::{
4949
ClosingTransaction, commit_tx_fee_sat,
5050
};
5151
use crate::ln::chan_utils;
52-
use crate::ln::onion_utils::{HTLCFailReason};
52+
use crate::ln::onion_utils::{HTLCFailReason, ATTRIBUTION_DATA_LEN};
5353
use crate::chain::BestBlock;
5454
use crate::chain::chaininterface::{FeeEstimator, ConfirmationTarget, LowerBoundedFeeEstimator, fee_for_weight};
5555
use crate::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateStep, LATENCY_GRACE_PERIOD_BLOCKS};
@@ -4718,7 +4718,7 @@ trait FailHTLCContents {
47184718
impl FailHTLCContents for msgs::OnionErrorPacket {
47194719
type Message = msgs::UpdateFailHTLC;
47204720
fn to_message(self, htlc_id: u64, channel_id: ChannelId) -> Self::Message {
4721-
msgs::UpdateFailHTLC { htlc_id, channel_id, reason: self.data }
4721+
msgs::UpdateFailHTLC { htlc_id, channel_id, reason: self.data, attribution_data: self.attribution_data }
47224722
}
47234723
fn to_inbound_htlc_state(self) -> InboundHTLCState {
47244724
InboundHTLCState::LocalRemoved(InboundHTLCRemovalReason::FailRelay(self))
@@ -6746,6 +6746,7 @@ impl<SP: Deref> FundedChannel<SP> where
67466746
channel_id: self.context.channel_id(),
67476747
htlc_id: htlc.htlc_id,
67486748
reason: err_packet.data.clone(),
6749+
attribution_data: err_packet.attribution_data,
67496750
});
67506751
},
67516752
&InboundHTLCRemovalReason::FailMalformed((ref sha256_of_onion, ref failure_code)) => {
@@ -9998,6 +9999,7 @@ impl<SP: Deref> Writeable for FundedChannel<SP> where SP::Target: SignerProvider
99989999
dropped_inbound_htlcs += 1;
999910000
}
1000010001
}
10002+
let mut removed_htlc_failure_attribution_data: Vec<&Option<[u8; ATTRIBUTION_DATA_LEN]>> = Vec::new();
1000110003
(self.context.pending_inbound_htlcs.len() as u64 - dropped_inbound_htlcs).write(writer)?;
1000210004
for htlc in self.context.pending_inbound_htlcs.iter() {
1000310005
if let &InboundHTLCState::RemoteAnnounced(_) = &htlc.state {
@@ -10023,9 +10025,10 @@ impl<SP: Deref> Writeable for FundedChannel<SP> where SP::Target: SignerProvider
1002310025
&InboundHTLCState::LocalRemoved(ref removal_reason) => {
1002410026
4u8.write(writer)?;
1002510027
match removal_reason {
10026-
InboundHTLCRemovalReason::FailRelay(msgs::OnionErrorPacket { data }) => {
10028+
InboundHTLCRemovalReason::FailRelay(msgs::OnionErrorPacket { data, attribution_data }) => {
1002710029
0u8.write(writer)?;
1002810030
data.write(writer)?;
10031+
removed_htlc_failure_attribution_data.push(&attribution_data);
1002910032
},
1003010033
InboundHTLCRemovalReason::FailMalformed((hash, code)) => {
1003110034
1u8.write(writer)?;
@@ -10087,10 +10090,11 @@ impl<SP: Deref> Writeable for FundedChannel<SP> where SP::Target: SignerProvider
1008710090

1008810091
let mut holding_cell_skimmed_fees: Vec<Option<u64>> = Vec::new();
1008910092
let mut holding_cell_blinding_points: Vec<Option<PublicKey>> = Vec::new();
10093+
let mut holding_cell_failure_attribution_data: Vec<(u32, [u8; ATTRIBUTION_DATA_LEN])> = Vec::new();
1009010094
// Vec of (htlc_id, failure_code, sha256_of_onion)
1009110095
let mut malformed_htlcs: Vec<(u64, u16, [u8; 32])> = Vec::new();
1009210096
(self.context.holding_cell_htlc_updates.len() as u64).write(writer)?;
10093-
for update in self.context.holding_cell_htlc_updates.iter() {
10097+
for (i, update) in self.context.holding_cell_htlc_updates.iter().enumerate() {
1009410098
match update {
1009510099
&HTLCUpdateAwaitingACK::AddHTLC {
1009610100
ref amount_msat, ref cltv_expiry, ref payment_hash, ref source, ref onion_routing_packet,
@@ -10115,6 +10119,13 @@ impl<SP: Deref> Writeable for FundedChannel<SP> where SP::Target: SignerProvider
1011510119
2u8.write(writer)?;
1011610120
htlc_id.write(writer)?;
1011710121
err_packet.data.write(writer)?;
10122+
10123+
// Store the attribution data for later writing. Include the holding cell htlc update index because
10124+
// FailMalformedHTLC is stored with the same type 2 and we wouldn't be able to distinguish the two
10125+
// when reading back in.
10126+
if let Some(attribution_data ) = err_packet.attribution_data {
10127+
holding_cell_failure_attribution_data.push((i as u32, attribution_data));
10128+
}
1011810129
}
1011910130
&HTLCUpdateAwaitingACK::FailMalformedHTLC {
1012010131
htlc_id, failure_code, sha256_of_onion
@@ -10298,6 +10309,8 @@ impl<SP: Deref> Writeable for FundedChannel<SP> where SP::Target: SignerProvider
1029810309
(49, self.context.local_initiated_shutdown, option), // Added in 0.0.122
1029910310
(51, is_manual_broadcast, option), // Added in 0.0.124
1030010311
(53, funding_tx_broadcast_safe_event_emitted, option), // Added in 0.0.124
10312+
(55, removed_htlc_failure_attribution_data, optional_vec), // Added in 0.2
10313+
(57, holding_cell_failure_attribution_data, optional_vec), // Added in 0.2
1030110314
});
1030210315

1030310316
Ok(())
@@ -10375,6 +10388,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, &'c Channel
1037510388
let reason = match <u8 as Readable>::read(reader)? {
1037610389
0 => InboundHTLCRemovalReason::FailRelay(msgs::OnionErrorPacket {
1037710390
data: Readable::read(reader)?,
10391+
attribution_data: None,
1037810392
}),
1037910393
1 => InboundHTLCRemovalReason::FailMalformed(Readable::read(reader)?),
1038010394
2 => InboundHTLCRemovalReason::Fulfill(Readable::read(reader)?),
@@ -10439,6 +10453,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, &'c Channel
1043910453
htlc_id: Readable::read(reader)?,
1044010454
err_packet: OnionErrorPacket {
1044110455
data: Readable::read(reader)?,
10456+
attribution_data: None,
1044210457
},
1044310458
},
1044410459
_ => return Err(DecodeError::InvalidValue),
@@ -10582,6 +10597,9 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, &'c Channel
1058210597
let mut pending_outbound_blinding_points_opt: Option<Vec<Option<PublicKey>>> = None;
1058310598
let mut holding_cell_blinding_points_opt: Option<Vec<Option<PublicKey>>> = None;
1058410599

10600+
let mut removed_htlc_failure_attribution_data: Option<Vec<Option<[u8; ATTRIBUTION_DATA_LEN]>>> = None;
10601+
let mut holding_cell_failure_attribution_data: Option<Vec<(u32, [u8; ATTRIBUTION_DATA_LEN])>> = None;
10602+
1058510603
let mut malformed_htlcs: Option<Vec<(u64, u16, [u8; 32])>> = None;
1058610604
let mut monitor_pending_update_adds: Option<Vec<msgs::UpdateAddHTLC>> = None;
1058710605

@@ -10624,6 +10642,8 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, &'c Channel
1062410642
(49, local_initiated_shutdown, option),
1062510643
(51, is_manual_broadcast, option),
1062610644
(53, funding_tx_broadcast_safe_event_emitted, option),
10645+
(55, removed_htlc_failure_attribution_data, optional_vec),
10646+
(57, holding_cell_failure_attribution_data, optional_vec),
1062710647
});
1062810648

1062910649
let holder_signer = signer_provider.derive_channel_signer(channel_keys_id);
@@ -10705,6 +10725,38 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, &'c Channel
1070510725
if iter.next().is_some() { return Err(DecodeError::InvalidValue) }
1070610726
}
1070710727

10728+
if let Some(attribution_datas) = removed_htlc_failure_attribution_data {
10729+
let mut removed_htlc_relay_failures =
10730+
pending_inbound_htlcs.iter_mut().filter_map(|status|
10731+
if let InboundHTLCState::LocalRemoved(ref mut reason) = &mut status.state {
10732+
if let InboundHTLCRemovalReason::FailRelay(ref mut packet) = reason {
10733+
Some(&mut packet.attribution_data)
10734+
} else {
10735+
None
10736+
}
10737+
} else {
10738+
None
10739+
}
10740+
);
10741+
10742+
for attribution_data in attribution_datas {
10743+
*removed_htlc_relay_failures.next().ok_or(DecodeError::InvalidValue)? = attribution_data;
10744+
}
10745+
if removed_htlc_relay_failures.next().is_some() { return Err(DecodeError::InvalidValue); }
10746+
}
10747+
10748+
if let Some(attribution_datas) = holding_cell_failure_attribution_data {
10749+
for (i, attribution_data) in attribution_datas {
10750+
let update = holding_cell_htlc_updates.get_mut(i as usize).ok_or(DecodeError::InvalidValue)?;
10751+
10752+
if let HTLCUpdateAwaitingACK::FailHTLC { htlc_id: _, ref mut err_packet } = update {
10753+
err_packet.attribution_data = Some(attribution_data);
10754+
} else {
10755+
return Err(DecodeError::InvalidValue);
10756+
}
10757+
}
10758+
}
10759+
1070810760
if let Some(malformed_htlcs) = malformed_htlcs {
1070910761
for (malformed_htlc_id, failure_code, sha256_of_onion) in malformed_htlcs {
1071010762
let htlc_idx = holding_cell_htlc_updates.iter().position(|htlc| {
@@ -10902,7 +10954,7 @@ mod tests {
1090210954
use bitcoin::transaction::{Transaction, TxOut, Version};
1090310955
use bitcoin::opcodes;
1090410956
use bitcoin::network::Network;
10905-
use crate::ln::onion_utils::INVALID_ONION_BLINDING;
10957+
use crate::ln::onion_utils::{ATTRIBUTION_DATA_LEN, INVALID_ONION_BLINDING};
1090610958
use crate::types::payment::{PaymentHash, PaymentPreimage};
1090710959
use crate::ln::channel_keys::{RevocationKey, RevocationBasepoint};
1090810960
use crate::ln::channelmanager::{self, HTLCSource, PaymentId};
@@ -11538,7 +11590,7 @@ mod tests {
1153811590
htlc_id: 0,
1153911591
};
1154011592
let dummy_holding_cell_failed_htlc = |htlc_id| HTLCUpdateAwaitingACK::FailHTLC {
11541-
htlc_id, err_packet: msgs::OnionErrorPacket { data: vec![42] }
11593+
htlc_id, err_packet: msgs::OnionErrorPacket { data: vec![42], attribution_data: Some([1; ATTRIBUTION_DATA_LEN]) }
1154211594
};
1154311595
let dummy_holding_cell_malformed_htlc = |htlc_id| HTLCUpdateAwaitingACK::FailMalformedHTLC {
1154411596
htlc_id, failure_code: INVALID_ONION_BLINDING, sha256_of_onion: [0; 32],

lightning/src/ln/channelmanager.rs

Lines changed: 93 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ use crate::routing::gossip::NodeId;
5959
use crate::routing::router::{BlindedTail, InFlightHtlcs, Path, Payee, PaymentParameters, RouteParameters, RouteParametersConfig, Router, FixedRouter, Route};
6060
use crate::ln::onion_payment::{check_incoming_htlc_cltv, create_recv_pending_htlc_info, create_fwd_pending_htlc_info, decode_incoming_update_add_htlc_onion, InboundHTLCErr, NextPacketDetails};
6161
use crate::ln::msgs;
62-
use crate::ln::onion_utils;
62+
use crate::ln::onion_utils::{self, ATTRIBUTION_DATA_LEN};
6363
use crate::ln::onion_utils::{HTLCFailReason, INVALID_ONION_BLINDING};
6464
use crate::ln::msgs::{ChannelMessageHandler, CommitmentUpdate, DecodeError, LightningError};
6565
#[cfg(test)]
@@ -4418,6 +4418,7 @@ where
44184418
channel_id: msg.channel_id,
44194419
htlc_id: msg.htlc_id,
44204420
reason: failure.data.clone(),
4421+
attribution_data: failure.attribution_data,
44214422
})
44224423
}
44234424

@@ -4443,10 +4444,12 @@ where
44434444
}
44444445
let failure = HTLCFailReason::reason($err_code, $data.to_vec())
44454446
.get_encrypted_failure_packet(&shared_secret, &None);
4447+
44464448
return PendingHTLCStatus::Fail(HTLCFailureMsg::Relay(msgs::UpdateFailHTLC {
44474449
channel_id: msg.channel_id,
44484450
htlc_id: msg.htlc_id,
44494451
reason: failure.data,
4452+
attribution_data: failure.attribution_data,
44504453
}));
44514454
}
44524455
}
@@ -12837,11 +12840,15 @@ impl_writeable_tlv_based!(PendingHTLCInfo, {
1283712840
impl Writeable for HTLCFailureMsg {
1283812841
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), io::Error> {
1283912842
match self {
12840-
HTLCFailureMsg::Relay(msgs::UpdateFailHTLC { channel_id, htlc_id, reason }) => {
12843+
HTLCFailureMsg::Relay(msgs::UpdateFailHTLC { channel_id, htlc_id, reason, attribution_data }) => {
1284112844
0u8.write(writer)?;
1284212845
channel_id.write(writer)?;
1284312846
htlc_id.write(writer)?;
1284412847
reason.write(writer)?;
12848+
12849+
// This code will only ever be hit for legacy data that is re-serialized. It isn't necessary to try
12850+
// writing out attribution data, because it can never be present.
12851+
debug_assert!(attribution_data.is_none());
1284512852
},
1284612853
HTLCFailureMsg::Malformed(msgs::UpdateFailMalformedHTLC {
1284712854
channel_id, htlc_id, sha256_of_onion, failure_code
@@ -12866,6 +12873,7 @@ impl Readable for HTLCFailureMsg {
1286612873
channel_id: Readable::read(reader)?,
1286712874
htlc_id: Readable::read(reader)?,
1286812875
reason: Readable::read(reader)?,
12876+
attribution_data: None,
1286912877
}))
1287012878
},
1287112879
1 => {
@@ -13096,6 +13104,7 @@ impl Writeable for HTLCForwardInfo {
1309613104
write_tlv_fields!(w, {
1309713105
(0, htlc_id, required),
1309813106
(2, err_packet.data, required),
13107+
(5, err_packet.attribution_data, option),
1309913108
});
1310013109
},
1310113110
Self::FailMalformedHTLC { htlc_id, failure_code, sha256_of_onion } => {
@@ -13126,8 +13135,12 @@ impl Readable for HTLCForwardInfo {
1312613135
(1, malformed_htlc_failure_code, option),
1312713136
(2, err_packet, required),
1312813137
(3, sha256_of_onion, option),
13138+
(5, attribution_data, option),
1312913139
});
1313013140
if let Some(failure_code) = malformed_htlc_failure_code {
13141+
if attribution_data.is_some() {
13142+
return Err(DecodeError::InvalidValue);
13143+
}
1313113144
Self::FailMalformedHTLC {
1313213145
htlc_id: _init_tlv_based_struct_field!(htlc_id, required),
1313313146
failure_code,
@@ -13138,6 +13151,7 @@ impl Readable for HTLCForwardInfo {
1313813151
htlc_id: _init_tlv_based_struct_field!(htlc_id, required),
1313913152
err_packet: crate::ln::msgs::OnionErrorPacket {
1314013153
data: _init_tlv_based_struct_field!(err_packet, required),
13154+
attribution_data: _init_tlv_based_struct_field!(attribution_data, option),
1314113155
},
1314213156
}
1314313157
}
@@ -14837,7 +14851,8 @@ mod tests {
1483714851
use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
1483814852
use core::sync::atomic::Ordering;
1483914853
use crate::events::{Event, HTLCDestination, MessageSendEvent, MessageSendEventsProvider, ClosureReason};
14840-
use crate::ln::types::ChannelId;
14854+
use crate::ln::onion_utils::ATTRIBUTION_DATA_LEN;
14855+
use crate::ln::types::ChannelId;
1484114856
use crate::types::payment::{PaymentPreimage, PaymentHash, PaymentSecret};
1484214857
use crate::ln::channelmanager::{RAACommitmentOrder, create_recv_pending_htlc_info, inbound_payment, ChannelConfigOverrides, HTLCForwardInfo, InterceptId, PaymentId, RecipientOnionFields};
1484314858
use crate::ln::functional_test_utils::*;
@@ -15311,6 +15326,80 @@ mod tests {
1531115326
nodes[1].logger.assert_log_contains("lightning::ln::channelmanager", "Payment preimage didn't match payment hash", 1);
1531215327
}
1531315328

15329+
#[test]
15330+
fn test_htlc_localremoved_persistence() {
15331+
let chanmon_cfgs: Vec<TestChanMonCfg> = create_chanmon_cfgs(2);
15332+
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
15333+
15334+
let persister;
15335+
let chain_monitor;
15336+
let deserialized_chanmgr;
15337+
15338+
// Send a keysend payment that fails because of a preimage mismatch.
15339+
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
15340+
let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs);
15341+
15342+
let payer_pubkey = nodes[0].node.get_our_node_id();
15343+
let payee_pubkey = nodes[1].node.get_our_node_id();
15344+
15345+
let _chan = create_chan_between_nodes(&nodes[0], &nodes[1]);
15346+
let route_params = RouteParameters::from_payment_params_and_value(
15347+
PaymentParameters::for_keysend(payee_pubkey, 40, false), 10_000);
15348+
let network_graph = nodes[0].network_graph;
15349+
let first_hops = nodes[0].node.list_usable_channels();
15350+
let scorer = test_utils::TestScorer::new();
15351+
let random_seed_bytes = chanmon_cfgs[1].keys_manager.get_secure_random_bytes();
15352+
let route = find_route(
15353+
&payer_pubkey, &route_params, &network_graph, Some(&first_hops.iter().collect::<Vec<_>>()),
15354+
nodes[0].logger, &scorer, &Default::default(), &random_seed_bytes
15355+
).unwrap();
15356+
15357+
let test_preimage = PaymentPreimage([42; 32]);
15358+
let mismatch_payment_hash = PaymentHash([43; 32]);
15359+
let session_privs = nodes[0].node.test_add_new_pending_payment(mismatch_payment_hash,
15360+
RecipientOnionFields::spontaneous_empty(), PaymentId(mismatch_payment_hash.0), &route).unwrap();
15361+
nodes[0].node.test_send_payment_internal(&route, mismatch_payment_hash,
15362+
RecipientOnionFields::spontaneous_empty(), Some(test_preimage), PaymentId(mismatch_payment_hash.0), None, session_privs).unwrap();
15363+
check_added_monitors!(nodes[0], 1);
15364+
15365+
let updates = get_htlc_update_msgs!(nodes[0], nodes[1].node.get_our_node_id());
15366+
nodes[1].node.handle_update_add_htlc(nodes[0].node.get_our_node_id(), &updates.update_add_htlcs[0]);
15367+
commitment_signed_dance!(nodes[1], nodes[0], &updates.commitment_signed, false);
15368+
expect_pending_htlcs_forwardable!(nodes[1]);
15369+
expect_htlc_handling_failed_destinations!(nodes[1].node.get_and_clear_pending_events(), &[HTLCDestination::FailedPayment { payment_hash: mismatch_payment_hash }]);
15370+
check_added_monitors(&nodes[1], 1);
15371+
15372+
// Save the update_fail_htlc message for later comparison.
15373+
let msgs = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
15374+
let htlc_fail_msg = msgs.update_fail_htlcs[0].clone();
15375+
15376+
// Reload node.
15377+
nodes[0].node.peer_disconnected(nodes[1].node.get_our_node_id());
15378+
nodes[1].node.peer_disconnected(nodes[0].node.get_our_node_id());
15379+
15380+
let monitor_encoded = get_monitor!(nodes[1], _chan.3).encode();
15381+
reload_node!(nodes[1], nodes[1].node.encode(), &[&monitor_encoded], persister, chain_monitor, deserialized_chanmgr);
15382+
15383+
nodes[0].node.peer_connected(nodes[1].node.get_our_node_id(), &msgs::Init {
15384+
features: nodes[1].node.init_features(), networks: None, remote_network_address: None
15385+
}, true).unwrap();
15386+
let reestablish_1 = get_chan_reestablish_msgs!(nodes[0], nodes[1]);
15387+
assert_eq!(reestablish_1.len(), 1);
15388+
nodes[1].node.peer_connected(nodes[0].node.get_our_node_id(), &msgs::Init {
15389+
features: nodes[0].node.init_features(), networks: None, remote_network_address: None
15390+
}, false).unwrap();
15391+
let reestablish_2 = get_chan_reestablish_msgs!(nodes[1], nodes[0]);
15392+
assert_eq!(reestablish_2.len(), 1);
15393+
nodes[0].node.handle_channel_reestablish(nodes[1].node.get_our_node_id(), &reestablish_2[0]);
15394+
handle_chan_reestablish_msgs!(nodes[0], nodes[1]);
15395+
nodes[1].node.handle_channel_reestablish(nodes[0].node.get_our_node_id(), &reestablish_1[0]);
15396+
15397+
// Assert that same failure message is resent after reload.
15398+
let msgs = handle_chan_reestablish_msgs!(nodes[1], nodes[0]);
15399+
let htlc_fail_msg_after_reload = msgs.2.unwrap().update_fail_htlcs[0].clone();
15400+
assert_eq!(htlc_fail_msg, htlc_fail_msg_after_reload);
15401+
}
15402+
1531415403
#[test]
1531515404
fn test_multi_hop_missing_secret() {
1531615405
let chanmon_cfgs = create_chanmon_cfgs(4);
@@ -16269,7 +16358,7 @@ mod tests {
1626916358
let mut nodes = create_network(1, &node_cfg, &chanmgrs);
1627016359

1627116360
let dummy_failed_htlc = |htlc_id| {
16272-
HTLCForwardInfo::FailHTLC { htlc_id, err_packet: msgs::OnionErrorPacket { data: vec![42] } }
16361+
HTLCForwardInfo::FailHTLC { htlc_id, err_packet: msgs::OnionErrorPacket { data: vec![42], attribution_data: Some([0; ATTRIBUTION_DATA_LEN]) } }
1627316362
};
1627416363
let dummy_malformed_htlc = |htlc_id| {
1627516364
HTLCForwardInfo::FailMalformedHTLC { htlc_id, failure_code: 0x4000, sha256_of_onion: [0; 32] }

lightning/src/ln/functional_tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use crate::chain::chaininterface::LowerBoundedFeeEstimator;
1717
use crate::chain::channelmonitor;
1818
use crate::chain::channelmonitor::{Balance, ChannelMonitorUpdateStep, CLTV_CLAIM_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS, ANTI_REORG_DELAY, COUNTERPARTY_CLAIMABLE_WITHIN_BLOCKS_PINNABLE};
1919
use crate::chain::transaction::OutPoint;
20+
use crate::ln::onion_utils::ATTRIBUTION_DATA_LEN;
2021
use crate::sign::{ecdsa::EcdsaChannelSigner, EntropySource, OutputSpender, SignerProvider};
2122
use crate::events::bump_transaction::WalletSource;
2223
use crate::events::{Event, FundingInfo, MessageSendEvent, MessageSendEventsProvider, PathFailure, PaymentPurpose, ClosureReason, HTLCDestination, PaymentFailureReason};
@@ -7055,6 +7056,7 @@ pub fn test_update_fulfill_htlc_bolt2_update_fail_htlc_before_commitment() {
70557056
channel_id: chan.2,
70567057
htlc_id: 0,
70577058
reason: Vec::new(),
7059+
attribution_data: Some([0; ATTRIBUTION_DATA_LEN])
70587060
};
70597061

70607062
nodes[0].node.handle_update_fail_htlc(nodes[1].node.get_our_node_id(), &update_msg);

0 commit comments

Comments
 (0)