Skip to content

Commit 279f2c1

Browse files
committed
fuzz: handle missing SendTx* message events in chanmon_consistency
Add handlers for SendTxInitRbf, SendTxAckRbf, SendTxRemoveInput, and SendTxRemoveOutput in the chanmon_consistency fuzz target. These variants were reachable but not matched, causing panics on the wildcard arm ("Unhandled message event"). SendTxInitRbf became reachable after commit 5873660 added splicing support without updating the fuzz target's message delivery logic. AI tools were used in preparing this commit.
1 parent dcf0c20 commit 279f2c1

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

fuzz/src/chanmon_consistency.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,14 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(
15151515
if Some(*node_id) == expect_drop_id { panic!("peer_disconnected should drop msgs bound for the disconnected peer"); }
15161516
*node_id == a_id
15171517
},
1518+
MessageSendEvent::SendTxRemoveInput { ref node_id, .. } => {
1519+
if Some(*node_id) == expect_drop_id { panic!("peer_disconnected should drop msgs bound for the disconnected peer"); }
1520+
*node_id == a_id
1521+
},
1522+
MessageSendEvent::SendTxRemoveOutput { ref node_id, .. } => {
1523+
if Some(*node_id) == expect_drop_id { panic!("peer_disconnected should drop msgs bound for the disconnected peer"); }
1524+
*node_id == a_id
1525+
},
15181526
MessageSendEvent::SendTxComplete { ref node_id, .. } => {
15191527
if Some(*node_id) == expect_drop_id { panic!("peer_disconnected should drop msgs bound for the disconnected peer"); }
15201528
*node_id == a_id
@@ -1523,6 +1531,14 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(
15231531
if Some(*node_id) == expect_drop_id { panic!("peer_disconnected should drop msgs bound for the disconnected peer"); }
15241532
*node_id == a_id
15251533
},
1534+
MessageSendEvent::SendTxInitRbf { ref node_id, .. } => {
1535+
if Some(*node_id) == expect_drop_id { panic!("peer_disconnected should drop msgs bound for the disconnected peer"); }
1536+
*node_id == a_id
1537+
},
1538+
MessageSendEvent::SendTxAckRbf { ref node_id, .. } => {
1539+
if Some(*node_id) == expect_drop_id { panic!("peer_disconnected should drop msgs bound for the disconnected peer"); }
1540+
*node_id == a_id
1541+
},
15261542
MessageSendEvent::SendTxSignatures { ref node_id, .. } => {
15271543
if Some(*node_id) == expect_drop_id { panic!("peer_disconnected should drop msgs bound for the disconnected peer"); }
15281544
*node_id == a_id
@@ -1715,6 +1731,22 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(
17151731
}
17161732
}
17171733
},
1734+
MessageSendEvent::SendTxInitRbf { ref node_id, ref msg } => {
1735+
for (idx, dest) in nodes.iter().enumerate() {
1736+
if dest.get_our_node_id() == *node_id {
1737+
out.locked_write(format!("Delivering tx_init_rbf from node {} to node {}.\n", $node, idx).as_bytes());
1738+
dest.handle_tx_init_rbf(nodes[$node].get_our_node_id(), msg);
1739+
}
1740+
}
1741+
},
1742+
MessageSendEvent::SendTxAckRbf { ref node_id, ref msg } => {
1743+
for (idx, dest) in nodes.iter().enumerate() {
1744+
if dest.get_our_node_id() == *node_id {
1745+
out.locked_write(format!("Delivering tx_ack_rbf from node {} to node {}.\n", $node, idx).as_bytes());
1746+
dest.handle_tx_ack_rbf(nodes[$node].get_our_node_id(), msg);
1747+
}
1748+
}
1749+
},
17181750
MessageSendEvent::SendTxSignatures { ref node_id, ref msg } => {
17191751
for (idx, dest) in nodes.iter().enumerate() {
17201752
if dest.get_our_node_id() == *node_id {

0 commit comments

Comments
 (0)