Skip to content

Commit

Permalink
[fuzz] Allow SendAnnouncementSigs events in chanmon_consistency
Browse files Browse the repository at this point in the history
Because of the merge between peer reconnection and channel monitor
updating channel restoration code, we now sometimes generate
(somewhat spurious) announcement signatures when restoring channel
monitor updating. This should not result in a fuzzing failure.
  • Loading branch information
TheBlueMatt committed Dec 15, 2020
1 parent 87b2944 commit 5552b67
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fuzz/src/chanmon_consistency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,9 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
events::MessageSendEvent::SendFundingLocked { .. } => {
// Can be generated as a reestablish response
},
events::MessageSendEvent::SendAnnouncementSignatures { .. } => {
// Can be generated as a reestablish response
},
events::MessageSendEvent::PaymentFailureNetworkUpdate { .. } => {
// Can be generated due to a payment forward being rejected due to a
// channel having previously failed a monitor update
Expand All @@ -614,6 +617,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
events::MessageSendEvent::SendRevokeAndACK { .. } => {},
events::MessageSendEvent::SendChannelReestablish { .. } => {},
events::MessageSendEvent::SendFundingLocked { .. } => {},
events::MessageSendEvent::SendAnnouncementSignatures { .. } => {},
events::MessageSendEvent::PaymentFailureNetworkUpdate { .. } => {},
_ => panic!("Unhandled message event"),
}
Expand All @@ -626,6 +630,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
events::MessageSendEvent::SendRevokeAndACK { .. } => {},
events::MessageSendEvent::SendChannelReestablish { .. } => {},
events::MessageSendEvent::SendFundingLocked { .. } => {},
events::MessageSendEvent::SendAnnouncementSignatures { .. } => {},
events::MessageSendEvent::PaymentFailureNetworkUpdate { .. } => {},
_ => panic!("Unhandled message event"),
}
Expand All @@ -647,6 +652,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
if *node_id != drop_node_id { true } else { false }
},
events::MessageSendEvent::SendFundingLocked { .. } => false,
events::MessageSendEvent::SendAnnouncementSignatures { .. } => false,
events::MessageSendEvent::PaymentFailureNetworkUpdate { .. } => false,
_ => panic!("Unhandled message event"),
};
Expand Down

0 comments on commit 5552b67

Please sign in to comment.